112 Commits

Author SHA1 Message Date
Z. Cliffe Schreuders
7cdcc354c1 feat: Implement three-mode interaction system in HUD
- Added hand frames PNG for interaction modes.
- Updated HUD CSS to support new player HUD buttons and styles.
- Enhanced combat configuration to define interaction modes: interact, jab, and cross.
- Integrated player HUD creation and management in the game core.
- Improved player combat system to handle interaction modes and associated animations.
- Modified interaction handling to auto-switch modes for chairs and hostile NPCs.
- Updated health UI to always display health status.
- Created a new HUD JavaScript module to manage avatar and interaction mode toggle.
- Added a test HTML file for the three-mode toggle functionality.
2026-02-13 16:04:02 +00:00
Z. Cliffe Schreuders
5c28743144 Update CSS file paths and enhance tutorial system
- Changed CSS file paths in index.html and show.html.erb to reflect new directory structure under public/break_escape.
- Added a new tutorial.css file with styles tailored for the tutorial system, ensuring a cohesive pixel-art aesthetic.
- Enhanced the tutorial manager to track player interactions, including clicks to move and inventory item usage, improving the tutorial experience for new players.
- Updated tutorial steps to dynamically include objectives based on the current scenario.

Files modified:
- index.html: Updated CSS links.
- show.html.erb: Updated CSS links.
- tutorial.css: New styles for the tutorial system.
- player.js: Added notifications for player actions.
- tutorial-manager.js: Enhanced logic for tracking tutorial progress and objectives.
- interactions.js: Added notifications for inventory interactions.
2026-01-19 09:54:15 +00:00
Z. Cliffe Schreuders
1a8da6df23 Add interactive tutorial system for new players
Implements a comprehensive tutorial system that:
- Prompts first-time players with option to take tutorial
- Detects device type (mobile vs keyboard) for appropriate instructions
- Shows interactive steps with objectives for basic controls:
  * Keyboard: WASD movement, Shift to run, E to interact
  * Mobile: Click/tap to move and interact
- Tracks player actions to progress through tutorial steps
- Saves completion status in localStorage
- Includes polished UI with animations and responsive design

Files added:
- tutorial-manager.js: Core tutorial logic and state management
- tutorial.css: Styled UI components with animations

Files modified:
- game.js: Integrated tutorial check on first load
- player.js: Added tutorial notifications for movement/running
- interactions.js: Added tutorial notification for interactions
- main.js: Imported tutorial manager system
- index.html: Added tutorial CSS stylesheet
2026-01-14 10:10:12 +00:00
Z. Cliffe Schreuders
aad985ee98 Add new functionality to open workstations in new tabs
- Introduced buttons in the Crypto and Lab Workstation title bars to allow users to open the respective workstations in new tabs.
- Implemented JavaScript functions `openCryptoWorkstationInNewTab` and `openLabWorkstationInNewTab` to handle the new tab functionality.
- Updated CSS styles for the new buttons to ensure proper positioning and visual appeal.
- Made necessary imports and exports in helper files to integrate the new functionality across the application.
2025-12-05 15:37:31 +00:00
Z. Cliffe Schreuders
f8b20c2db0 feat(rfid): Complete system integration
Integrated RFID minigame into all game systems:

Chat System Integration:
- Added clone_keycard tag handler to chat-helpers.js
- Format: # clone_keycard:Card Name|HEX_ID
- Uses proven window.pendingConversationReturn pattern
- Automatically returns to conversation after cloning

Inventory Integration:
- Added keycard click handler in interactions.js
- Click keycard with cloner → starts clone mode
- Shows alert if no cloner available

Interaction Indicator:
- Added RFID icon support to getInteractionSpriteKey()
- RFID-locked doors/items show rfid-icon overlay
- Works for both door and item lock types

HTML Integration:
- Added rfid-minigame.css link to index.html
- Loaded alongside other minigame styles

Phaser Asset Integration:
- Added keycard sprites (base + 3 variants)
- Added rfid_cloner sprite
- Added rfid-icon and nfc-waves icons
- Loaded in js/core/game.js preload

All integration follows existing patterns from other minigames.
Ready for testing and asset creation.
2025-11-15 23:48:15 +00:00
Z. Cliffe Schreuders
660105421a Add Hostile NPC mode
Fix NPC interaction and event handling issues

- Added a visual problem-solution summary for debugging NPC event handling.
- Resolved cooldown bug in NPCManager by implementing explicit null/undefined checks.
- Modified PersonChatMinigame to prioritize event parameters over state restoration.
- Updated security guard dialogue in Ink scenarios to improve interaction flow.
- Adjusted vault key parameters in npc-patrol-lockpick.json for consistency.
- Changed inventory stylesheet references to hud.css in test HTML files for better organization.

feat(combat): Integrate chair kicking with punch mechanic

Update chair interaction to use the punch system instead of direct kicking:

**Changes to interactions.js:**
- Modified swivel chair interaction to trigger player punch instead of
  directly applying kick velocity
- Simplified chair interaction handler to just call playerCombat.punch()

**Changes to player-combat.js:**
- Extended checkForHits() to detect chairs in punch range and direction
- Added kickChair() method that applies the same velocity calculation:
  - Calculates direction from player to chair
  - Applies 1200 px/s kick force in that direction
  - Triggers spin direction calculation for visual rotation
  - Adds visual feedback (flash chair, light screen shake)
- Chairs now respond to punch AOE damage like hostile NPCs

Now clicking a chair or pressing 'E' near it triggers a punch, and if the
chair is in punch range and facing direction, it gets kicked with the
original velocity physics. Multiple chairs can be kicked with one punch.

feat(combat): Implement hostile NPC behavior and final integration (Phase 6-7)

Complete hostile NPC combat system with chase behavior and integration:

**Phase 6: Hostile NPC Behavior**
- Modified npc-behavior.js determineState() to check hostile state from npcHostileSystem
- Implemented updateHostileBehavior() with chase and attack logic:
  - NPCs chase player when hostile and in aggro range
  - NPCs stop and attack when in attack range
  - NPCs use directional movement with proper animations
  - Integration with npcCombat system for attack attempts
- Added KO state check to prevent KO'd NPCs from acting

**Phase 7: Final Integration**
- Modified player.js to disable movement when player is KO
- Added visual KO effect (50% alpha) to NPC sprites in npc-hostile.js
- Connected all combat systems end-to-end:
  - Ink dialogue → hostile tag → hostile state → chase behavior → combat
  - Player interaction → punch → NPC damage → KO → visual feedback
  - NPC chase → attack → player damage → HP UI → game over

Full combat loop now functional: hostile NPCs chase and attack player,
player can punch hostile NPCs, complete visual/audio feedback, game over on KO.

feat(combat): Add feedback, UI, and combat mechanics (Phase 2-5)

Implement comprehensive combat feedback, UI, and mechanics:

**Phase 2: Enhanced Feedback Systems**
- damage-numbers.js: Floating damage numbers with object pooling
- screen-effects.js: Screen flash and shake for combat feedback
- sprite-effects.js: Sprite tinting, flashing, and visual effects
- attack-telegraph.js: Visual indicators for incoming NPC attacks

**Phase 3: UI Components**
- health-ui.js: Player health display as hearts (5 hearts, shows when damaged)
- npc-health-bars.js: Health bars above hostile NPCs with color coding
- game-over-screen.js: KO screen with restart/main menu options

**Phase 4-5: Combat Mechanics**
- player-combat.js: Player punch system with AOE directional damage
- npc-combat.js: NPC attack system with telegraph and cooldowns
- Modified interactions.js to trigger punch on hostile NPC interaction
- Integrated all systems into game.js create() and update() loops

Combat now functional with complete visual/audio feedback pipeline.
Player can punch hostile NPCs, NPCs can attack player, health tracking works.

feat(combat): Add hostile NPC system foundation (Phase 0-1)

Implement core hostile NPC combat system infrastructure:

- Add #hostile tag handler to chat-helpers.js for Ink integration
- Fix security-guard.ink to use proper hub pattern with -> hub instead of -> END
- Add #hostile:security_guard tags to hostile conversation paths
- Create combat configuration system (combat-config.js)
- Create combat event constants (combat-events.js)
- Implement player health tracking system with HP and KO state
- Implement NPC hostile state management with HP tracking
- Add combat debug utilities for testing
- Add error handling utilities for validation
- Integrate combat systems into game.js create() method
- Create test-hostile.ink for testing hostile tag system

This establishes the foundation for hostile NPC behavior, allowing NPCs to
become hostile through Ink dialogue and tracking health for both player and NPCs.

docs(npc): Apply codebase-verified corrections to hostile NPC plans

Apply critical corrections based on actual codebase verification:

CORRECTIONS.md (Updated):
-  Confirms #exit_conversation tag ALREADY IMPLEMENTED
  * Location: person-chat-minigame.js line 537
  * No handler needed in chat-helpers.js
-  Hostile tag still needs implementation in chat-helpers.js
- Provides exact code for hostile tag handler
- Clarifies tag format: #hostile:npcId or #hostile (uses current NPC)
- Updated action items to reflect what's already working

INTEGRATION_UPDATES.md (New):
- Comprehensive correction document
- Issue 1 Corrected: Exit conversation already works
- Issue 6 Corrected: Punch mechanics are interaction-based with AOE
- Details interaction-based punch targeting:
  * Player clicks hostile NPC OR presses 'E' nearby
  * Punch animation plays in facing direction
  * Damage applies to ALL NPCs in range + direction (AOE)
  * Can hit multiple enemies if grouped (strategic gameplay)
- Provides complete implementation examples
- Removes complexity of target selection systems
- Uses existing interaction patterns

quick_start.md (Updated):
- Removed exit_conversation handler (already exists)
- Updated hostile tag handler code
- Added punch mechanics design section
- Clarified interaction-based targeting
- Added troubleshooting for exit_conversation

Key Findings:
 Exit conversation tag works out of the box
 Punch targeting uses existing interaction system (simpler!)
 AOE punch adds strategic depth without complexity
 Only ONE critical task remains: Add hostile tag to chat-helpers.js

Impact:
- Less work required (don't need exit_conversation handler)
- Simpler implementation (use existing interaction patterns)
- Better gameplay (AOE punches, directional attacks)
- Clear path forward with exact code examples

docs(npc): Add critical corrections and codebase integration review

Add comprehensive review of hostile NPC plans against actual codebase:

CORRECTIONS.md:
- Identifies critical Ink pattern error (-> END vs -> hub)
- Documents correct hub-based conversation pattern
- Provides corrected examples for all Ink files
- Explains why -> hub is required after #exit_conversation

FORMAT_REVIEW.md:
- Validates JSON scenario format against existing scenarios
- Reviews NPC object structure and required fields
- Documents correct Ink hub pattern from helper-npc.ink
- Proposes hostile configuration object for NPC customization
- Provides complete format reference and checklists

review2/integration_review.md:
- Comprehensive codebase analysis by Explore agent
- Identifies 2 critical blockers requiring immediate attention:
  * Missing tag handlers for #hostile and #exit_conversation
  * Incorrect Ink pattern (-> END) in planning documents
- Documents 4 important integration differences:
  * Initialization in game.js not main.js
  * Event dispatcher already exists (window.eventDispatcher)
  * Room transition behavior needs design decision
  * Multi-hostile NPC targeting needs design decision
- Confirms 8 systems are fully compatible with plan
- Provides existing code patterns to follow
- Corrects integration sequence

review2/quick_start.md:
- Step-by-step guide for Phase 0-1 implementation
- Includes complete code examples for critical systems
- Browser console test procedures
- Common issues and solutions
- Success criteria checklist

Key Findings:
 90% compatible with existing codebase
 Must add tag handlers to chat-helpers.js before implementation
 Must fix all Ink examples to use -> hub not -> END
⚠️ Should follow game.js initialization pattern not main.js
⚠️ Should use existing window.eventDispatcher
⚠️ Need design decisions on room transitions and multi-targeting

All critical issues documented with solutions ready.
Implementation can proceed with high confidence after corrections applied.

docs(npc): Add comprehensive planning documents for hostile NPC system

Add detailed implementation plans for hostile NPC feature including:
- Complete implementation plan with phase-by-phase breakdown
- Architecture overview with system diagrams and data flows
- Detailed TODO list with 200+ actionable tasks
- Phase 0 foundation with design decisions and base components
- Enhanced combat feedback implementation guide
- Implementation roadmap with 6-day schedule

Add comprehensive review documents:
- Implementation review with risk assessment and recommendations
- Technical review analyzing code patterns and best practices
- UX review covering player experience and game feel

Key features planned:
- NPC hostile state triggered via Ink tags
- Player health system with heart-based UI
- NPC health bars and combat mechanics
- Punch combat for both player and NPCs
- Strong visual/audio feedback for combat
- Game over system and KO states
- Attack telegraphing for fairness
- Enhanced NPC chase behavior with LOS
- Debug utilities and error handling
- Comprehensive testing strategy
2025-11-14 19:47:54 +00:00
Z. Cliffe Schreuders
9b49e43b79 feat(npc): Update NPC talk icon positions and enhance personal space behavior 2025-11-10 00:08:02 +00:00
Z. Cliffe Schreuders
f055d6c536 feat(npc): Update conversation flow to handle exit choices and NPC responses 2025-11-05 20:15:33 +00:00
Z. Cliffe Schreuders
2d0e30f157 Add helper NPC dialogue and interactions for mission assistance
- Created a new JSON file for the helper NPC with various dialogue options and interactions.
- Implemented responses for asking about the NPC, unlocking the CEO's office, and providing items.
- Enhanced trust-building mechanics with the NPC, allowing for item exchanges and hints based on player actions.
- Updated existing NPC dialogue to integrate new features and improve player guidance throughout the mission.
2025-11-05 20:15:26 +00:00
Z. Cliffe Schreuders
78cc3beab4 feat(person-chat): Implement click-through mode for dialogue advancement and enhance UI with continue button 2025-11-05 09:18:58 +00:00
Z. Cliffe Schreuders
4daaa87534 feat(npc): Implement conversation state management and enhance NPC interaction features 2025-11-05 01:03:08 +00:00
Z. Cliffe Schreuders
e73a6a038b Add NPC sprite test scenario, server for development, and HTML test pages
- Created a new JSON scenario file for testing NPC sprite functionality.
- Implemented a simple HTTP server with caching headers for development purposes.
- Added an HTML page for testing NPC interactions, including system checks and game controls.
- Introduced a separate HTML page for testing item delivery through person chat interactions.
2025-11-04 14:16:48 +00:00
Z. Cliffe Schreuders
5f6cc7e59d feat: Add NPCs and phone interactions to the CEO exfiltration scenario; implement new dialogue for Neye Eve and Gossip Girl 2025-10-30 14:40:54 +00:00
Z. Cliffe Schreuders
9fffb6b4e4 Add NPC dialogue and interaction scripts
- Created a generic NPC script with conversation handling.
- Developed an Alice NPC script demonstrating branching dialogue and state tracking.
- Implemented a test NPC script for development purposes.
- Added JSON representations for the NPC scripts.
- Created an HTML test interface for NPC integration testing.
- Included event handling and bark systems for NPC interactions.
2025-10-29 13:48:22 +00:00
Z. Cliffe Schreuders
48b1ad3bbf Refactor Lockpicking Minigame: Update button functionality for mode switching between key and lockpicking modes. Introduce new icons for keyway, password, and pin in the inventory. Enhance interaction logic for locked objects and doors, including visual indicators. Clean up CSS styles for improved layout and user experience. Remove unused assets and streamline code for better performance. 2025-10-22 00:10:26 +01:00
Z. Cliffe Schreuders
441aeae8d3 Update Minigame Framework: Replace references to 'minigames.css' with 'minigames-framework.css' across multiple HTML files for improved organization. Add new Google Font 'Pixelify Sans' to enhance typography in the game. Introduce new icon assets for better visual representation in various minigames, including search, disk, backpack, and clipboard icons. Update CSS styles for various minigames to enhance visual consistency and user experience. 2025-10-21 10:58:56 +01:00
Z. Cliffe Schreuders
b04771e0b5 Enhance Minigame Framework: Add new Text File Minigame and integrate it into the existing system. Update interaction logic to support text file objects, allowing players to view and interact with file contents. Introduce CSS styles for the text file interface and update relevant HTML files to include new styles. Modify existing minigames to ensure compatibility with the new text file functionality, enhancing overall gameplay experience. 2025-10-14 17:12:59 +01:00
Z. Cliffe Schreuders
e3ed198059 Add Password Minigame: Introduce a new minigame for password entry, featuring customizable hints, keyboard input, and attempt tracking. Implement CSS styles for the minigame interface and integrate it into the existing framework. Update index.html to include the new CSS file and register the minigame in the minigame manager. Add test page for functionality and ensure compatibility with existing game mechanics. 2025-10-14 01:52:15 +01:00
Z. Cliffe Schreuders
6c06aeafe7 Add PIN Minigame: Introduce a new minigame for PIN entry, featuring a digital keypad, attempt logging, and visual feedback for correct and incorrect inputs. Implement CSS styles for the minigame interface and integrate it into the existing framework. Update index.html to include the new CSS file and register the minigame in the minigame manager. Add test page for functionality and ensure compatibility with the pin-cracker item for enhanced gameplay experience. 2025-10-13 23:45:53 +01:00
Z. Cliffe Schreuders
051b90aaa8 Add Phone Messages Minigame: Introduce a new minigame for interacting with phone messages, including voice and text message playback, voice selection, and observation display. Update index.html to include the new CSS file and integrate the minigame into the existing framework. Add test page for functionality and enhance interaction logic for phone objects in the game. 2025-10-13 18:48:14 +01:00
Z. Cliffe Schreuders
aa53ce53ea Add Container Minigame: Introduce a new minigame for interacting with container items, including features for visual display, item interaction, and integration with the unlock system. Add CSS styles and test page for functionality. Update index.html and minigame manager to support the new minigame. 2025-10-13 11:53:07 +01:00
Z. Cliffe Schreuders
d46fa79718 Implement Minigames for Bluetooth Scanner, Biometrics, and Lockpick Set: Transition Bluetooth and biometrics functionalities to dedicated minigames, enhancing user interaction and gameplay experience. Introduce new CSS styles for each minigame and update the main game logic to support these changes. Remove legacy systems for biometrics and Bluetooth management to streamline code and improve maintainability. 2025-10-11 02:25:50 +01:00
Z. Cliffe Schreuders
de8aebfa94 Rename index_new.html -> index.html 2025-10-10 23:29:45 +01:00
Z. Cliffe Schreuders
45d885d913 Refactor Notes Minigame: Remove legacy notes system and integrate new note management logic. Update UI components for displaying important notes with star icons and enhance observation editing features. Introduce new assets for improved visual representation and ensure consistent integration with the inventory system. 2025-10-10 17:11:02 +01:00
Z. Cliffe Schreuders
ee4117a651 Add new assets and scripts for object management: Introduce a new tileset JSON file and an update script to ensure all objects are included. Add multiple object images and update HTML for improved asset integration. Remove outdated assets and enhance room definitions for better gameplay experience. 2025-10-07 12:31:07 +01:00
Z. Cliffe Schreuders
a97e65421d Implement password modal in index.html: replace direct password prompt with a modal for improved user experience, encapsulating password input logic and enhancing security. The modal includes show/hide password functionality and user-friendly design elements. 2025-07-02 16:43:14 +01:00
Z. Cliffe Schreuders
6af8347678 Enhance notification message formatting in index.html: update message display to replace newlines with line breaks for better readability, and adjust scenario1.json text and observations for clarity and context. 2025-05-16 11:57:36 +01:00
Z. Cliffe Schreuders
66b9ffb546 Enhance inventory system in index.html: add new inventory container with dynamic item handling, update styles for improved layout, and refactor item interaction logic for better user experience. 2025-05-05 09:57:34 +01:00
Z. Cliffe Schreuders
b0676a48b8 Update OBJECT_SCALES in index.html: adjust scaling for phone and add bluetooth_scanner, and change highlight tint color for improved visual feedback. 2025-04-29 00:26:30 +01:00
Z. Cliffe Schreuders
b23cdb838e Add scaling for object types in index.html: introduce OBJECT_SCALES to adjust sizes for notes, key, phone, and tablet objects, enhancing visual consistency in the game scenario. 2025-04-29 00:13:26 +01:00
Z. Cliffe Schreuders
64a7415779 Refactor font-family declarations in index.html: set 'VT323' for body and 'Press Start 2P' for headings to improve typography consistency. Also don't incl observations if undefined in the scenario. 2025-04-28 23:52:56 +01:00
Z. Cliffe Schreuders
534fc54d92 Adjust #notes-search styles in index.html: change width to 95%, increase font size to 20px, and set font-family to 'VT323' for improved readability and aesthetics. 2025-04-24 00:38:40 +01:00
Z. Cliffe Schreuders
58bb0be6b0 Add Web Font Loader to index.html for improved font loading and remove cursive fallback from font-family declarations. 2025-04-24 00:33:04 +01:00
Z. Cliffe Schreuders
38682be9f2 Update font-family in index.html to include 'VT323' alongside 'Press Start 2P' for enhanced typography consistency. 2025-04-24 00:25:19 +01:00
Z. Cliffe Schreuders
562b8fbdc5 Refactor Google Fonts inclusion in index.html by separating font links for 'Press Start 2P' and 'VT323' to enhance clarity and maintainability. 2025-04-24 00:23:35 +01:00
Z. Cliffe Schreuders
c39880f1f3 Update index.html to incorporate Google Fonts for improved typography. Change font families to 'Press Start 2P' and 'VT323' for various elements, adjust font sizes, and modify layout dimensions for better aesthetics and readability. 2025-04-24 00:12:47 +01:00
Z. Cliffe Schreuders
d5938b6973 Enhance game scenarios with completion messages and update cabinet type in biometric breach scenario. Add viewport meta tag for improved mobile responsiveness. 2025-03-28 16:51:52 +00:00
Z. Cliffe Schreuders
da33424cff allow zooming on mobile devices 2025-03-28 12:06:15 +00:00
Z. Cliffe Schreuders
e2c2862e8e Add mobile device detection and responsive scaling in index.html
Implemented CSS media queries to enhance responsiveness for mobile devices. Adjusted layout and font sizes for better visibility on portrait orientation with coarse pointers.
Not perfect, but an improvement
2025-03-28 11:59:15 +00:00
Z. Cliffe Schreuders
fa513a0f4f Update index.html to replace emoji icons with image assets for toggle buttons and comment out border-radius and transform properties for styling adjustments. 2025-03-27 16:36:29 +00:00
Z. Cliffe Schreuders
6afbe0331b Refactor object handling in index.html to improve room object management and interaction. Introduced a mapping system for room objects by type, streamlined sprite creation, and enhanced inventory handling with unique identifiers. Updated scenario and room JSON files to reflect new object types and connections. 2025-03-27 16:22:27 +00:00
Z. Cliffe Schreuders
4d2e7c473a Remove alert for inventory item click in index.html 2025-03-27 12:20:55 +00:00
Z. Cliffe Schreuders
97ba6d529e Update game title to "Break Escape Game" and enhance responsive design by adjusting canvas dimensions to 80% of the window size (and scaling up via CSS). Added click indicator functionality and refined inventory handling. Improved player positioning logic and added window resize event listener for dynamic adjustments. 2025-03-27 12:10:06 +00:00
c7309830
78958a932c few changes 2025-03-21 14:28:53 +00:00
Z. Cliffe Schreuders
a624e908c1 Adjust player positioning and camera zoom. Commented out debug graphics. 2025-03-17 11:54:22 +00:00
Z. Cliffe Schreuders
3098db8cc8 Enhance player mechanics by implementing character sprite sheet, scaling, and animations. Updated player creation to use sprite instead of rectangle, added movement direction tracking, and refined collision detection for improved gameplay experience. 2025-03-17 11:34:44 +00:00
Z. Cliffe Schreuders
1bc311236f Implement scenario selection feature and dynamic loading of scenarios. Updated index.html to load scenarios based on URL parameters and added scenario_select.html for user interface to choose scenarios. 2025-03-17 00:56:48 +00:00
Z. Cliffe Schreuders
a57697a246 merge 2025-03-16 23:33:16 +00:00
Z. Cliffe Schreuders
d785bfa496 open source graphics replacements 2025-03-16 23:22:30 +00:00
Damian-I
80edb79450 fixed issue where pins moved after being set 2025-03-14 18:07:09 +00:00