feat: Update NPC behavior configuration to include startHostile flag and enhance game over screen delay

This commit is contained in:
Z. Cliffe Schreuders
2026-02-16 10:49:02 +00:00
parent 5c4e3c690f
commit 9b4cb8c069
3 changed files with 15 additions and 4 deletions

View File

@@ -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,

View File

@@ -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);
});
}

View File

@@ -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",