mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
feat: Update NPC behavior configuration to include startHostile flag and enhance game over screen delay
This commit is contained in:
@@ -153,7 +153,7 @@ class NPCBehavior {
|
||||
// State
|
||||
this.currentState = 'idle';
|
||||
this.direction = 'down'; // Current facing direction
|
||||
this.hostile = false; // Will be set via setHostile() if defaultState is true
|
||||
this.hostile = false; // Will be set via setHostile() if startHostile is true
|
||||
this.influence = 0;
|
||||
|
||||
// Patrol state
|
||||
@@ -195,7 +195,7 @@ class NPCBehavior {
|
||||
this.escapeWallBox = null; // Reference to the wall we're escaping from
|
||||
|
||||
// Apply initial hostile state if configured
|
||||
if (this.config.hostile.defaultState) {
|
||||
if (this.config.hostile.startHostile) {
|
||||
this.setHostile(true);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ class NPCBehavior {
|
||||
backAwayDistance: config.personalSpace?.backAwayDistance || 5
|
||||
},
|
||||
hostile: {
|
||||
defaultState: config.hostile?.defaultState || false,
|
||||
startHostile: config.hostile?.startHostile || false,
|
||||
influenceThreshold: config.hostile?.influenceThreshold || -50,
|
||||
chaseSpeed: config.hostile?.chaseSpeed || 145,
|
||||
fleeSpeed: config.hostile?.fleeSpeed || 180,
|
||||
|
||||
@@ -129,7 +129,10 @@ export class GameOverScreen {
|
||||
|
||||
// Listen for player KO
|
||||
window.eventDispatcher.on(CombatEvents.PLAYER_KO, () => {
|
||||
this.show();
|
||||
// Add 1 second delay before showing game over screen
|
||||
setTimeout(() => {
|
||||
this.show();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -293,6 +293,14 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A
|
||||
},
|
||||
"storyPath": "scenarios/m01_first_contact/ink/m01_npc_sarah.json",
|
||||
"currentKnot": "start",
|
||||
"behavior": {
|
||||
"hostile": {
|
||||
"startHostile": true,
|
||||
"chaseSpeed": 100,
|
||||
"attackDamage": 10,
|
||||
"pauseToAttack": true
|
||||
}
|
||||
},
|
||||
"itemsHeld": [
|
||||
{
|
||||
"type": "id_badge",
|
||||
|
||||
Reference in New Issue
Block a user