Skip to content

.#36

Open
Damian-I wants to merge 1019 commits into1-bluetooth-lock-system-implementationfrom
main
Open

.#36
Damian-I wants to merge 1019 commits into1-bluetooth-lock-system-implementationfrom
main

Conversation

@Damian-I
Copy link
Copy Markdown
Collaborator

@Damian-I Damian-I commented Mar 9, 2025

No description provided.

cliffe added 30 commits March 2, 2026 18:26
- Change phone conversation task type from "phone_conversation" to "npc_conversation"
  to match allowed schema values
- Add conversationMode: "phone-chat" to all 13 Agent 0x99 eventMappings
  so the runtime knows which UI to open when bark notifications are clicked

Validation: schema passes, 9/9 ink files compile clean

https://claude.ai/code/session_011tqCF2oBNxmasyWGmN8HEd
- Replace implausible "sign-off required from the suspect" with
  "Authorised by D. Lawson (IT Manager)" — the actual person who
  would escalate such a report, and a real red flag since Derek
  filed and authorised his own fabricated evidence
- Kevin now calls out the sign-off chain as suspicious during the
  evidence confrontation dialogue

https://claude.ai/code/session_011tqCF2oBNxmasyWGmN8HEd
Kevin is IT Manager, Derek is Senior Marketing Manager.
The red flag is that a Marketing Manager bypassed the IT Manager
to file an IT security anomaly report — not a chain-of-command issue.
Kevin now calls this out explicitly in the confrontation dialogue.

https://claude.ai/code/session_011tqCF2oBNxmasyWGmN8HEd
Add support for a `type: "table"` scenario object with a `tableItems`
array so that authors can explicitly place items on a named table in
the scenario file without knowing Tiled map internals.

How it works:
- A scenario room's `objects` array may contain objects with
  `type: "table"` and `tableItems: [...]`.
- The first such object is paired with the first Tiled table in the
  room (tableGroups[0]), the second with tableGroups[1], and so on.
- Each entry in `tableItems` is resolved through the normal item pool
  (same priority: unconditional items before conditional), so the
  existing sprite pool is reused.
- Resolved sprites are added to their table group and go through the
  existing depth-sort pass: depth = tableBaseDepth + (n+1)*0.01,
  sorted north-to-south, no elevation (same as all table items).
- If no matching Tiled item exists, falls back to random-position
  placement (same as regular unmatched scenario objects).
- `filter_requires_and_contents_recursive` (server-side) now also
  recurses into `tableItems` arrays to strip `requires` fields.

Example scenario usage:
  {
    "type": "table",
    "tableItems": [
      { "type": "laptop", "name": "Research Laptop", "readable": true,
        "text": "Access code: DELTA-7", "takeable": false,
        "observations": "A laptop open on the desk." },
      { "type": "notes", "name": "Lab Notes", "takeable": true,
        "readable": true, "text": "Consult CEO before Phase 2." }
    ]
  }

A new test scenario (test_table_items) demonstrates the feature using
room_office2 (4 tables, rich table_items layer) and room_ceo2 (CEO
desk with conditional_table_items).

https://claude.ai/code/session_01B1vtCfvr8nJWHzAyfuX9Rr
Extends the 'table' scenario object so that specifying a 'sprite'
name and/or 'x'/'y' pixel coordinates (room-relative) causes a
brand-new table sprite to be created at runtime rather than pairing
with an existing Tiled map table.

Modes:
  A) Dynamic table  – sprite and/or x/y present
       A new table sprite is instantiated at the given position
       (or a random room position when coordinates are omitted).
       Items in tableItems are spread evenly across the table surface
       so they are always visually on the table regardless of where
       Tiled originally placed the matching sprites.

  B) Tiled table    – no sprite, no x/y (previous behaviour, unchanged)
       The nth table object pairs with tableGroups[n] from the Tiled
       map and items keep their Tiled pixel positions.

New scenario fields on a table object:
  "sprite"  – texture key of the table image (e.g. "desk-ceo2", "smalldesk2")
  "x"       – room-relative pixel X of the table's top-left corner
  "y"       – room-relative pixel Y of the table's top-left corner

Example:
  {
    "type": "table",
    "sprite": "smalldesk2",
    "x": 140,
    "y": 190,
    "tableItems": [
      { "type": "pc", "name": "Security Terminal", ... }
    ]
  }

The dynamic table is stored in rooms[roomId].objects so it participates
in the reveal/hide lifecycle and NPC collision detection.  Its depth is
calculated the same way as all other interactive objects (bottomY + 0.5).

Updated test_table_items scenario to demonstrate both modes:
  - Two Mode-B tables (paired with existing Tiled tables)
  - One Mode-A table in the office with explicit position + sprite
  - One Mode-A table in the CEO room with explicit position + sprite

https://claude.ai/code/session_01B1vtCfvr8nJWHzAyfuX9Rr
…s (bags)

Two bugs fixed in tableItems placement:

1. Wrong Y formula for dynamic tables
   Previous:  sprite.y = tableSprite.y + tableSprite.height * 0.25
              → placed the item's TOP at 25 %, so a tall item's bottom
                could land well past the table midpoint (e.g. 64 %).
   Fixed:     targetBottom = tableSprite.y + tableSprite.height * 0.5
              sprite.y     = max(tableSprite.y, targetBottom - sprite.height)
              → bottom of the sprite sits at exactly the table midpoint,
                clamped so a tall item's top never floats above the table.

2. Floor-layer items (bags, briefcases, etc.) not repositioned for Mode B
   When findMatchFor() returns an item from the 'items' or
   'conditional_items' layer the Tiled Y coordinate is a floor position,
   not on the table.  The fix tracks fromTableLayer per resolved sprite
   and applies the table-surface repositioning whenever:
     • group.isDynamic (Mode A – always, because the new table is at an
       arbitrary location unrelated to any Tiled item coords), OR
     • !fromTableLayer (Mode B – the item is not from table_items /
       conditional_table_items, so its Tiled position is a floor position).
   Items that ARE from a table layer already have designer-accurate
   positions and are left untouched.

Updated test_table_items scenario to exercise both cases:
  • Office room Mode B desk: laptop (table layer, no reposition) +
    bag with note inside (floor layer, repositioned to table surface).
  • Office room Mode A smalldesk: PC terminal.
  • CEO room Mode B desk: laptop + notes dossier (table layer items).
  • CEO room Mode A desk-ceo2: courier bag with manifest + private phone.

https://claude.ai/code/session_01B1vtCfvr8nJWHzAyfuX9Rr
Any scenario object may now carry x and y fields to specify its exact
pixel position, bypassing the Tiled designer placement:

  Floor items (regular objects array)
    x and y are room-relative pixel offsets from the room's top-left
    corner.  Both Tiled-matched sprites and random-position fallbacks
    are repositioned to the given coordinates before depth is computed,
    so z-ordering stays correct.

  Table items (tableItems array)
    x and y are table-relative pixel offsets from the table sprite's
    top-left corner.  When provided they take precedence over the
    automatic even-spread / bottom-half-Y positioning added previously.
    Partial overrides are supported: specifying only x or only y leaves
    the other axis computed automatically.

applyScenarioProperties now skips 'x' and 'y' (alongside the existing
'texture' skip) so that copying scenarioObj properties onto the sprite
never accidentally overwrites the Phaser world position.  The original
scenario coordinate values remain accessible via sprite.scenarioData.x
and sprite.scenarioData.y.

Scenario syntax examples:

  // Floor item at explicit room-relative position
  { "type": "safe", "x": 50, "y": 80, "locked": true, ... }

  // Table item at explicit table-relative position
  {
    "type": "table",
    "tableItems": [
      { "type": "notes", "x": 10, "y": 8, ... },
      { "type": "bag",   "x": 48, "y": 0, "contents": [...] }
    ]
  }

Updated test_table_items scenario to cover all coordinate modes:
  • Floor safe with room-relative coords (x=50, y=80)
  • Tiled desk with table-relative coords on note (x=10,y=8) and bag (x=48,y=0)
  • Tiled desk with no coords – auto-spread laptop and phone
  • Dynamic CEO desk with table-relative coords on laptop (x=5,y=5) and dossier (x=50,y=8)

https://claude.ai/code/session_01B1vtCfvr8nJWHzAyfuX9Rr
inventory.js and unlock-system.js imported rooms from '../core/rooms.js'
(no version suffix) while interactions.js used '../core/rooms.js?v=17'.
The browser ES module cache treats these as separate module instances,
so inventory.js held an empty rooms object. The roomObj.active = false
write was silently discarded, leaving the object marked active in the
interactions module's rooms — causing checkObjectInteractions to
re-create the proximity ghost every time the player walked near a
previously-collected item.

Fix: align both imports to ?v=17 so all modules share the same rooms
instance. Also set sprite.active = false and sprite.isHighlighted = false
directly on the sprite in both addToInventory code paths as a belt-and-
suspenders guard against any future import drift.

https://claude.ai/code/session_01B22365Rs7RJJMQwTiwfRU3
Add a comment above every rooms.js import explaining that mismatched
?v= query strings cause the browser to create separate module instances
with separate rooms objects, which is what caused the ghost sprite bug.

https://claude.ai/code/session_01B22365Rs7RJJMQwTiwfRU3
Replace full-sprite collision box (32×64) with a thin 8px strip at the
bottom of the sprite, matching the wall collision profile used by
collision.js. Uses setSize(doorWidth, 8) and setOffset(0, doorHeight-8).

https://claude.ai/code/session_0166HmAtYaAF526yhAXo6nkk
- Updated hall_1x2gu.tmj and small_room_1x1gu.tmj to enhance room layouts and object IDs.
- Adjusted JSON files for small_room_1x1gu to align with new asset configurations.
- Streamlined NPC dialogue for Maya in m01_npc_maya.ink to improve narrative flow and clarity.
- Changed voice style for Maya in scenario.json.erb to reflect a consistent character accent.
- Updated tileset to include two new desk images (desk2.png and desk3.png) and increased tile count.
- Added new office room variants: room_office3_meeting, room_office4_meeting, and room_office5_it.
- Included additional small office room variants in the preload function.
- Updated scenario schema to include new room types.
- Revised documentation to reflect the addition of new room types and ensure compliance checks are updated.
- Updated NPC dialogue and interactions in m01_npc_sarah.json to improve player engagement and narrative flow.
- Revised scenario.json.erb to clarify office layout and staff roles, including updates to the staff directory and maintenance logs.
- Introduced new office and storage room types in scenario schema to accommodate gameplay mechanics.
- Enhanced scenario assembly documentation to include new room type definitions for better clarity in future development.
cliffe and others added 30 commits April 11, 2026 00:58
…ngs; ensure distinct authorization codes for security; enhance puzzle graph connections in generate_dungeon_graph.rb; add new audio files for TTS cache in sis01_healthcare.
- Added workshop key collection and associated logic.
- Introduced progress indicators for submit flags tasks.
- Implemented new puzzle graph actions for character interactions.
- Updated event mappings for SIS investigation tasks to improve clarity and functionality.
- Enhanced item descriptions with puzzle graph roles and aims for better gameplay experience.
- Added new clues and items related to incident response and SIS configuration.
- Improved narrative elements to support incident debriefing and investigation tasks.
MG-06: Network Architecture Diagram minigame for sis02_energy
- Updated dialogue to consistently use "Tom Hadley" instead of "Tom" for clarity.
- Enhanced NPC responses to improve narrative flow and character consistency.
- Adjusted JSON structure to reflect changes in dialogue and maintain compatibility with the ink engine.
- Updated display names for NPCs in scenario.json.erb to remove job titles for better alignment with dialogue parsing.
- Enhanced the TODO.md section by adding recently completed tasks related to Ink files and validation, while streamlining the testing section for clarity.
- Adjusted the status of completed tests in the testing section to reflect their current state.
- Clarified workarounds for unbuilt VMs in the testing section to aid in scenario testing.
MG-03: Facility Alarm Panel State Machine minigame for sis02_en…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants