From a5f0b9164d8c8d4a605ca512147889e3d1fd2f7a Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Tue, 17 Feb 2026 10:40:16 +0000 Subject: [PATCH] feat: Update NPC and avatar configurations for phone interactions and enhance avatar sizes in chat UI --- public/break_escape/css/phone-chat-minigame.css | 15 +++++++++++---- public/break_escape/js/systems/npc-manager.js | 13 ++++++++++--- scenarios/m01_first_contact/scenario.json.erb | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/public/break_escape/css/phone-chat-minigame.css b/public/break_escape/css/phone-chat-minigame.css index 31004a2..ccd49d9 100644 --- a/public/break_escape/css/phone-chat-minigame.css +++ b/public/break_escape/css/phone-chat-minigame.css @@ -166,8 +166,8 @@ } .contact-avatar { - width: 40px; - height: 40px; + width: 64px; + height: 64px; background: rgba(0, 0, 0, 0.2); border: 2px solid #000; display: flex; @@ -178,6 +178,13 @@ image-rendering: pixelated; } +.contact-avatar img { + width: 64px; + height: 64px; + object-fit: cover; + image-rendering: pixelated; +} + .contact-details { flex: 1; min-width: 0; @@ -277,8 +284,8 @@ .conversation-avatar, .conversation-avatar-placeholder { - width: 32px; - height: 32px; + width: 64px; + height: 64px; border: 2px solid #000; image-rendering: pixelated; flex-shrink: 0; diff --git a/public/break_escape/js/systems/npc-manager.js b/public/break_escape/js/systems/npc-manager.js index 8411ad6..bfa2524 100644 --- a/public/break_escape/js/systems/npc-manager.js +++ b/public/break_escape/js/systems/npc-manager.js @@ -65,16 +65,21 @@ export default class NPCManager { } if (!realId) throw new Error('registerNPC requires an id'); + // Build entry with defaults, but only set phoneId for phone NPCs const entry = Object.assign({ id: realId, displayName: realId, metadata: {}, eventMappings: {}, - phoneId: 'player_phone', // Default to player's phone npcType: 'phone', // Default to phone-based NPC itemsHeld: [] // Initialize empty inventory for NPC item giving }, realOpts); + // Only set default phoneId for phone NPCs (not person NPCs) + if (entry.npcType === 'phone' && !entry.phoneId) { + entry.phoneId = 'player_phone'; + } + this.npcs.set(realId, entry); // Register in global character registry for speaker resolution @@ -260,9 +265,11 @@ export default class NPCManager { this.conversationHistory.set(npcId, []); } - // Get all NPCs for a specific phone + // Get all NPCs for a specific phone (only returns phone-type NPCs) getNPCsByPhone(phoneId) { - return Array.from(this.npcs.values()).filter(npc => npc.phoneId === phoneId); + return Array.from(this.npcs.values()).filter(npc => + npc.npcType === 'phone' && npc.phoneId === phoneId + ); } // Get total unread message count for a phone diff --git a/scenarios/m01_first_contact/scenario.json.erb b/scenarios/m01_first_contact/scenario.json.erb index dc64888..07ff30d 100644 --- a/scenarios/m01_first_contact/scenario.json.erb +++ b/scenarios/m01_first_contact/scenario.json.erb @@ -322,7 +322,7 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A "displayName": "Agent 0x99 'Haxolottle'", "npcType": "phone", "storyPath": "scenarios/m01_first_contact/ink/m01_phone_agent0x99.json", - "avatar": "assets/npc/avatars/npc_helper.png", + "avatar": "assets/characters/female_spy_headshot.png", "phoneId": "player_phone", "currentKnot": "first_call", "timedMessages": [ @@ -360,7 +360,7 @@ password_hints = "Common passwords: Marketing123, Campaign2024, Viral_Dynamics_A "displayName": "Agent 0x99", "npcType": "phone", "storyPath": "scenarios/m01_first_contact/ink/m01_closing_debrief.json", - "avatar": "assets/npc/avatars/npc_helper.png", + "avatar": "assets/characters/female_spy_headshot.png", "phoneId": "player_phone", "currentKnot": "start", "eventMappings": [