From 5d010e98d7ccde86597de280bb5e2ae5854196d5 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Sat, 15 Nov 2025 23:48:15 +0000 Subject: [PATCH] fix(rfid): Update test scenario to match proper JSON format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed test scenario to match reference format from npc-sprite-test2.json: JSON Format Changes: - Changed holdsItems → itemsHeld (correct property name) - Changed storyJSON → storyPath (points to Ink file) - Added position: { x, y } for NPC placement - Changed map → type for room definition - Added connections object for room linking - Added readable: true to notes objects - Added observations field to all items - Added scenario_brief field - Removed description field from doors New Ink Story File: - Created scenarios/ink/rfid-security-guard.json - Security Guard conversation with clone_keycard tag - Multiple dialogue branches - Proper Ink JSON format with content array NPC Configuration: - Security Guard at position {x: 6, y: 4} - Uses hacker-red sprite with idle animation - Holds Master Keycard in itemsHeld - References rfid-security-guard.json story - Starts at 'start' knot Test scenario now fully compatible with game's scenario loading system. --- scenarios/ink/rfid-security-guard.json | 48 +++++++++++++++ scenarios/test-rfid.json | 84 +++++++++++--------------- 2 files changed, 83 insertions(+), 49 deletions(-) create mode 100644 scenarios/ink/rfid-security-guard.json diff --git a/scenarios/ink/rfid-security-guard.json b/scenarios/ink/rfid-security-guard.json new file mode 100644 index 0000000..35983c9 --- /dev/null +++ b/scenarios/ink/rfid-security-guard.json @@ -0,0 +1,48 @@ +{ + "content": [ + "-> start", + "", + "=== start ===", + "Hey there. I'm the security guard for this facility.", + "", + "I've got the master keycard that opens the secure room.", + "", + "+ [Ask about the keycard]", + " -> ask_keycard", + "+ [Just browsing]", + " Alright, let me know if you need anything.", + " -> END", + "", + "=== ask_keycard ===", + "This keycard? Yeah, it's the master access card. Opens everything in the building.", + "", + "I can't just hand it to you though - security policy and all that.", + "", + "+ [Offer to buy it]", + " Ha! Nice try, but I can't sell company property. I'd lose my job.", + " -> start", + "+ [Ask if you can borrow it]", + " Sorry, no can do. This thing never leaves my person.", + " -> start", + "+ [Subtly scan their badge]", + " # clone_keycard:Master Keycard|FF4A7B9C21", + " You casually position your Flipper Zero near their badge while chatting...", + " -> cloned", + "+ [Leave them alone]", + " Sure thing. Have a good one!", + " -> END", + "", + "=== cloned ===", + "...So anyway, that's why I love working nights. Much quieter, you know?", + "", + "The pay's better too. Plus I get to catch up on my podcasts.", + "", + "+ [Thanks for the chat!]", + " No problem! Stay safe out there.", + " -> END", + "+ [Any other secure areas?]", + " Well, there's the CEO's office, but that's on a different floor entirely.", + " This master card works for most areas on this level though.", + " -> cloned" + ] +} diff --git a/scenarios/test-rfid.json b/scenarios/test-rfid.json index 7500c8b..7501021 100644 --- a/scenarios/test-rfid.json +++ b/scenarios/test-rfid.json @@ -1,7 +1,9 @@ { "name": "RFID System Test", "description": "Test scenario for RFID keycard lock system", + "scenario_brief": "Test scenario for RFID keycard lock system with Flipper Zero", "startRoom": "test_lobby", + "globalVariables": {}, "player": { "id": "player", "displayName": "Agent 0x00", @@ -9,49 +11,28 @@ "startX": 200, "startY": 200 }, + "startItemsInInventory": [], "rooms": { "test_lobby": { "name": "Test Lobby", - "map": "room_reception", + "type": "room_reception", + "connections": { + "east": "test_secure" + }, "npcs": [ { "id": "security_guard", - "name": "Security Guard", "displayName": "Security Guard", - "spriteSheet": "hacker", - "x": 400, - "y": 300, - "storyJSON": { - "content": [ - "-> start", - "", - "=== start ===", - "Hey there. I'm the security guard. I've got the master keycard for the secure room.", - "+ [Ask about the keycard]", - " -> ask_keycard", - "+ [Leave]", - " -> END", - "", - "=== ask_keycard ===", - "Yeah, this keycard opens everything. But I can't just give it to you...", - "+ [Offer to buy it]", - " Sorry, can't sell it. Company policy.", - " -> start", - "+ [Try to clone it secretly]", - " # clone_keycard:Master Keycard|FF4A7B9C21", - " You subtly position your Flipper Zero near their badge...", - " -> cloned", - "+ [Leave]", - " -> END", - "", - "=== cloned ===", - "...So anyway, that's why I love this job.", - "+ [Thanks for the chat]", - " Anytime!", - " -> END" - ] + "npcType": "person", + "position": { "x": 6, "y": 4 }, + "spriteSheet": "hacker-red", + "spriteConfig": { + "idleFrameStart": 20, + "idleFrameEnd": 23 }, - "holdsItems": [ + "storyPath": "scenarios/ink/rfid-security-guard.json", + "currentKnot": "start", + "itemsHeld": [ { "type": "keycard", "name": "Master Keycard", @@ -60,7 +41,8 @@ "rfid_card_number": 18811, "rfid_protocol": "EM4100", "key_id": "master_keycard", - "takeable": false + "takeable": false, + "observations": "The security guard's master keycard. It has universal access." } ] } @@ -77,7 +59,7 @@ "x": 300, "y": 250, "takeable": true, - "description": "A standard employee access badge. Won't open high-security areas." + "observations": "A standard employee access badge. Won't open high-security areas." }, { "type": "rfid_cloner", @@ -86,7 +68,7 @@ "x": 350, "y": 250, "takeable": true, - "description": "A portable multi-tool for pentesters. Can read and emulate RFID cards." + "observations": "A portable multi-tool for pentesters. Can read and emulate RFID cards." }, { "type": "notes", @@ -94,8 +76,10 @@ "x": 250, "y": 300, "takeable": true, + "readable": true, "note_title": "RFID Access Control", - "note_content": "All high-security areas require RFID badge access. Master keycards (FF prefix) have universal access. Standard employee badges (01 prefix) have limited access.\n\nIf you need to clone badges, use the Flipper Zero in the lab. Tap physical badges or emulate saved ones to unlock doors." + "note_content": "All high-security areas require RFID badge access. Master keycards (FF prefix) have universal access. Standard employee badges (01 prefix) have limited access.\n\nIf you need to clone badges, use the Flipper Zero in the lab. Tap physical badges or emulate saved ones to unlock doors.", + "observations": "Instructions about the RFID security system" } ], "doors": [ @@ -107,14 +91,17 @@ "y": 300, "locked": true, "lockType": "rfid", - "requires": "master_keycard", - "description": "Secure Area - RFID Access Required" + "requires": "master_keycard" } ] }, "test_secure": { "name": "Secure Room", - "map": "room_office", + "type": "room_office", + "connections": { + "west": "test_lobby" + }, + "npcs": [], "objects": [ { "type": "notes", @@ -122,8 +109,10 @@ "x": 300, "y": 300, "takeable": true, + "readable": true, "note_title": "RFID Test Passed!", - "note_content": "Congratulations! You successfully:\n\n1. ✓ Found the Flipper Zero\n2. ✓ Cloned the Security Guard's master keycard\n3. ✓ Emulated the cloned card to unlock the door\n\nThe RFID system is working perfectly!" + "note_content": "Congratulations! You successfully:\n\n1. ✓ Found the Flipper Zero\n2. ✓ Cloned the Security Guard's master keycard\n3. ✓ Emulated the cloned card to unlock the door\n\nThe RFID system is working perfectly!", + "observations": "A congratulations message" }, { "type": "keycard", @@ -136,7 +125,7 @@ "x": 350, "y": 300, "takeable": true, - "description": "The CEO's personal keycard. Ultimate access." + "observations": "The CEO's personal keycard. Ultimate access level." } ], "doors": [ @@ -146,12 +135,9 @@ "direction": "west", "x": 100, "y": 300, - "locked": false, - "description": "Back to Lobby" + "locked": false } ] } - }, - "startItemsInInventory": [], - "globalVariables": {} + } }