diff --git a/app/policies/break_escape/game_policy.rb b/app/policies/break_escape/game_policy.rb index 3f3e1ed..85bf5f5 100644 --- a/app/policies/break_escape/game_policy.rb +++ b/app/policies/break_escape/game_policy.rb @@ -37,6 +37,18 @@ module BreakEscape show? end + def objectives? + show? + end + + def complete_task? + show? + end + + def update_task_progress? + show? + end + class Scope < Scope def resolve if user&.admin? || user&.account_manager? diff --git a/public/break_escape/css/objectives.css b/public/break_escape/css/objectives.css index 90b2e03..bf190a2 100644 --- a/public/break_escape/css/objectives.css +++ b/public/break_escape/css/objectives.css @@ -5,7 +5,7 @@ .objectives-panel { position: fixed; top: 20px; - right: 20px; + left: 20px; width: 280px; max-height: 60vh; background: rgba(0, 0, 0, 0.85); @@ -106,9 +106,11 @@ .aim-completed .aim-header { color: #4ade80; - text-decoration: line-through; opacity: 0.7; } +.aim-completed .aim-title { + text-decoration: line-through; +} .aim-icon { font-size: 12px; @@ -137,9 +139,11 @@ .task-completed { color: #4ade80; - text-decoration: line-through; opacity: 0.6; } +.task-completed .task-title { + text-decoration: line-through; +} .task-icon { font-size: 10px; diff --git a/public/break_escape/scenarios/test_objectives.json b/public/break_escape/scenarios/test_objectives.json new file mode 100644 index 0000000..a75abe6 --- /dev/null +++ b/public/break_escape/scenarios/test_objectives.json @@ -0,0 +1,151 @@ +{ + "scenario_brief": "Test scenario for the Objectives System. Demonstrates all task types: collect items, unlock rooms, unlock objects, enter rooms, and NPC conversations.", + "endGoal": "Complete all objectives to test the system", + "version": "1.0", + "startRoom": "reception", + "objectives": [ + { + "aimId": "tutorial", + "title": "Complete the Tutorial", + "description": "Learn how to use the objectives system", + "status": "active", + "order": 0, + "tasks": [ + { + "taskId": "explore_reception", + "title": "Explore the reception area", + "type": "enter_room", + "targetRoom": "reception", + "status": "active" + }, + { + "taskId": "collect_documents", + "title": "Collect classified documents", + "type": "collect_items", + "targetItems": ["document"], + "targetCount": 2, + "currentCount": 0, + "status": "active", + "showProgress": true + } + ] + }, + { + "aimId": "gain_access", + "title": "Gain Access to Secure Areas", + "description": "Unlock doors and access restricted zones", + "status": "active", + "order": 1, + "tasks": [ + { + "taskId": "unlock_office", + "title": "Unlock the office door", + "type": "unlock_room", + "targetRoom": "office1", + "status": "active", + "onComplete": { + "unlockTask": "enter_office" + } + }, + { + "taskId": "enter_office", + "title": "Enter the office", + "type": "enter_room", + "targetRoom": "office1", + "status": "locked" + } + ] + }, + { + "aimId": "find_intel", + "title": "Find Hidden Intel", + "status": "locked", + "unlockCondition": { "aimCompleted": "gain_access" }, + "order": 2, + "tasks": [ + { + "taskId": "unlock_safe", + "title": "Crack the safe", + "type": "unlock_object", + "targetObject": "office_safe", + "status": "active" + }, + { + "taskId": "collect_key", + "title": "Find the key", + "type": "collect_items", + "targetItems": ["key"], + "targetCount": 1, + "currentCount": 0, + "status": "active", + "showProgress": true + } + ] + } + ], + "globalVariables": { + "tutorial_complete": false + }, + "rooms": { + "reception": { + "type": "office-reception", + "connections": { + "north": "office1" + }, + "objects": [ + { + "type": "document", + "name": "Classified Report A", + "x": 5, + "y": 5, + "takeable": true, + "interactable": true, + "active": true, + "observations": "A classified document marked TOP SECRET" + }, + { + "type": "document", + "name": "Classified Report B", + "x": 7, + "y": 5, + "takeable": true, + "interactable": true, + "active": true, + "observations": "Another classified document" + } + ] + }, + "office1": { + "type": "office-generic", + "locked": true, + "lockType": "pin", + "requires": "1234", + "connections": { + "south": "reception" + }, + "objects": [ + { + "type": "safe", + "name": "office_safe", + "x": 3, + "y": 3, + "takeable": false, + "interactable": true, + "active": true, + "locked": true, + "lockType": "pin", + "requires": "0000", + "observations": "A heavy duty safe", + "contents": [ + { + "type": "key", + "name": "Master Key", + "takeable": true, + "observations": "An important key" + } + ] + } + ] + } + } +} diff --git a/scenarios/test_objectives2/mission.json b/scenarios/test_objectives/mission.json similarity index 100% rename from scenarios/test_objectives2/mission.json rename to scenarios/test_objectives/mission.json diff --git a/scenarios/test_objectives2/scenario.json.erb b/scenarios/test_objectives/scenario.json.erb similarity index 100% rename from scenarios/test_objectives2/scenario.json.erb rename to scenarios/test_objectives/scenario.json.erb