Z. Cliffe Schreuders bf0f281ad1 Add Mission 3 Stage 7 Ink Scripts (Part 2 - Final Scripts)
- Add m03_phone_agent0x99.ink (Agent 0x99 phone support)
  - Hint system (RFID, lockpicking, passwords, encoding, network recon)
  - Event-triggered calls (item pickups, detections, achievements)
  - M2 revelation call after distcc flag (emotional impact)
  - Progress tracking and adaptive guidance
  - ~480 lines

- Add m03_npc_guard.ink (Night security guard)
  - Patrol encounter and excuse system
  - Multiple excuse paths (work here, Victoria sent me, maintenance)
  - Bribe mechanic ($500 for access)
  - SAFETYNET reveal option for cooperation
  - Hostile paths and combat triggers
  - ~440 lines

- Add m03_npc_receptionist.ink (Daytime receptionist)
  - Badge check-in process
  - Company history (2010 founding = safe PIN hint)
  - Topics about Victoria, James, building layout
  - Friendly, helpful NPC for world-building
  - ~250 lines

- Add m03_james_choice.ink (James Park moral choice)
  - Evidence discovery (hospital reconnaissance files)
  - Diary reveals James's unknowing participation
  - Moral complexity: deceived initially, conflicted now
  - 3 choice paths: protect/expose/ignore James's fate
  - Direct confrontation variant if James appears
  - ~530 lines

- Add m03_closing_debrief.ink (Act 3 mission debrief)
  - Performance acknowledgment (objectives, stealth, time)
  - Act 1 choice callbacks (approach, trust, priorities)
  - M2 hospital attack discussion and impact
  - Victoria fate discussion (recruited/arrested/escaped)
  - Phase 2 and Architect revelation analysis
  - James fate outcomes and consequences
  - LORE fragment analysis
  - Campaign setup for future missions
  - ~570 lines

Total Part 2: ~2,270 lines across 5 scripts
Total Stage 7: ~4,010 lines across 9 complete Ink scripts

Stage 7 Status:  COMPLETE
All narrative scripts ready for Mission 3 implementation
2026-01-14 09:46:32 +00:00
2025-05-16 10:42:42 +01:00
2025-11-21 15:27:53 +00:00
2025-11-21 15:27:53 +00:00
2025-11-14 19:47:54 +00:00

BreakEscape Rails Engine

Cybersecurity training escape room game as a mountable Rails Engine.

Features

  • 24+ cybersecurity escape room scenarios
  • Server-side progress tracking with 2-table schema
  • Randomized passwords per game instance via ERB
  • JIT Ink script compilation for NPC dialogue
  • Polymorphic player support (User/DemoUser)
  • Pundit authorization
  • RESTful API for game state management
  • Session-based state persistence

Installation

In your Gemfile:

gem 'break_escape', path: 'path/to/break_escape'

Then:

bundle install
rails break_escape:install:migrations
rails db:migrate
rails db:seed  # Optional: creates missions from scenarios

Mounting in Host App

In your config/routes.rb:

mount BreakEscape::Engine => "/break_escape"

Usage

Standalone Mode (Development)

export BREAK_ESCAPE_STANDALONE=true
rails server
# Visit http://localhost:3000/break_escape/

Mounted Mode (Production)

Mount in Hacktivity or another Rails app. The engine will use the host app's current_user via Devise.

Configuration

# config/initializers/break_escape.rb
BreakEscape.configure do |config|
  config.standalone_mode = false  # true for development
  config.demo_user_handle = 'demo_player'
end

Database Schema

  • break_escape_missions - Scenario metadata (name, display_name, published, difficulty)
  • break_escape_games - Player state + scenario snapshot (JSONB)
  • break_escape_demo_users - Standalone mode only (optional)

API Endpoints

  • GET /games/:id/scenario - Scenario JSON (ERB-generated)
  • GET /games/:id/ink?npc=X - NPC script (JIT compiled from .ink)
  • GET /games/:id/bootstrap - Initial game data
  • PUT /games/:id/sync_state - Sync player state
  • POST /games/:id/unlock - Validate unlock attempt
  • POST /games/:id/inventory - Update inventory

Architecture

ERB Scenario Generation

Scenarios are stored as .json.erb templates and rendered on-demand with randomized values:

  • <%= random_password %> - Generates unique password per game
  • <%= random_pin %> - Generates unique 4-digit PIN
  • <%= random_code %> - Generates unique hex code

JIT Ink Compilation

NPC dialogue scripts compile on first request (~300ms):

  1. Check if .json exists and is newer than .ink
  2. If needed, run inklecate to compile
  3. Cache compiled JSON for subsequent requests

State Management

Player state stored in JSONB column:

  • Current room and unlocked rooms
  • Inventory and collected items
  • NPC encounters
  • Global variables (synced with client)
  • Health and minigame state

Testing

rails test

License

AGPL v3 - See LICENSE file for details

Documentation

See HACKTIVITY_INTEGRATION.md for integration guide.

Description
No description provided
Readme 72 MiB
Languages
JavaScript 86.5%
Ink 7%
HTML 2.9%
CSS 2.5%
Ruby 0.9%
Other 0.2%