Enhance FlagStationMinigame and scenario structure

- Added functionality to complete tasks via the objectives manager in FlagStationMinigame, improving gameplay interaction.
- Updated scenario.json.erb to replace flags_submitted with specific SSH and privilege flag submissions, enhancing clarity in task objectives.
- Introduced new task types in the scenario schema to support task completion mechanics, ensuring better integration of gameplay elements.
This commit is contained in:
Z. Cliffe Schreuders
2025-12-04 08:40:25 +00:00
parent 289c0ce1c7
commit e1d3b1ff2c
3 changed files with 35 additions and 9 deletions

View File

@@ -495,6 +495,16 @@ export class FlagStationMinigame extends MinigameScene {
});
}
}
if (reward.type === 'complete_task' && reward.taskId) {
// Complete the specified task via objectives manager
if (window.objectivesManager) {
window.objectivesManager.completeTask(reward.taskId);
console.log('[FlagStation] Completed task:', reward.taskId);
} else {
console.warn('[FlagStation] ObjectivesManager not available');
}
}
}
}

View File

@@ -7,7 +7,8 @@
"player_name": "Agent 0x00",
"lab_instruction_complete": false,
"vm_launched": false,
"flags_submitted": 0
"ssh_flag_submitted": false,
"privilege_flag_submitted": false
},
"objectives": [
{
@@ -32,14 +33,18 @@
"status": "locked"
},
{
"taskId": "submit_desktop_flags",
"title": "Submit both flags from the desktop system",
"taskId": "submit_ssh_flag",
"title": "Submit SSH brute force flag from desktop system",
"type": "unlock_object",
"targetObject": "flag_station_lab",
"targetCount": 2,
"currentCount": 0,
"status": "locked",
"showProgress": true
"status": "locked"
},
{
"taskId": "submit_privilege_flag",
"title": "Submit privilege escalation flag from desktop system",
"type": "unlock_object",
"targetObject": "flag_station_lab",
"status": "locked"
}
]
}
@@ -143,14 +148,24 @@
'flag{privilege_escalation_success}'
]) %>,
"flagRewards": [
{
"type": "complete_task",
"taskId": "submit_ssh_flag",
"description": "SSH access flag submitted - demonstrates SSH brute force skills"
},
{
"type": "emit_event",
"event_name": "ssh_flag_submitted",
"description": "SSH access flag submitted - demonstrates SSH brute force skills"
},
{
"type": "complete_task",
"taskId": "submit_privilege_flag",
"description": "Privilege escalation flag submitted - demonstrates advanced Linux skills"
},
{
"type": "emit_event",
"event_name": "sudo_flag_submitted",
"event_name": "privilege_flag_submitted",
"description": "Privilege escalation flag submitted - demonstrates advanced Linux skills"
}
]

View File

@@ -383,11 +383,12 @@
"properties": {
"type": {
"type": "string",
"enum": ["give_item", "unlock_door", "emit_event", "reveal_secret"]
"enum": ["give_item", "unlock_door", "emit_event", "reveal_secret", "complete_task"]
},
"item_name": { "type": "string" },
"target_room": { "type": "string" },
"event_name": { "type": "string" },
"taskId": { "type": "string" },
"description": { "type": "string" }
}
}