added assets
@@ -188,10 +188,10 @@
|
|||||||
private List<InteractionDefinition> AvailableActions => Game.AvailableInteractions().ToList();
|
private List<InteractionDefinition> AvailableActions => Game.AvailableInteractions().ToList();
|
||||||
private string EndingImageStyle => $"background-image:url('{Game.RoomImage(Game.CurrentRoom)}')";
|
private string EndingImageStyle => $"background-image:url('{Game.RoomImage(Game.CurrentRoom)}')";
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync() { await Game.InitializeAsync(); Game.Saved += OnSaved; await Audio.InitializeAsync(Game.Settings.MasterVolume); _ready = true; }
|
protected override async Task OnInitializedAsync() { await Game.InitializeAsync(); Game.Saved += OnSaved; await Audio.InitializeAsync(Game.Settings.MasterVolume); _ready = true; await Audio.PlayAmbientAsync("assets/audio/music_title_vocal.mp3"); }
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender && _ready) await _shell.FocusAsync(); }
|
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender && _ready) { await _shell.FocusAsync(); if (_screen == Screen.Title) await Audio.PlayAmbientAsync("assets/audio/music_title_vocal.mp3"); } }
|
||||||
private Task StartNewGame() { if (Game.HasSave) { _confirmation = Confirmation.NewGame; return Task.CompletedTask; } return StartNewGameConfirmed(); }
|
private Task StartNewGame() { if (Game.HasSave) { _confirmation = Confirmation.NewGame; return Task.CompletedTask; } return StartNewGameConfirmed(); }
|
||||||
private async Task StartNewGameConfirmed() { _confirmation = null; _titleNotice = null; await Audio.PlaySfxAsync("procedural:ui_confirm"); await Game.NewGameAsync(); _screen = Screen.Briefing; _notice = null; }
|
private async Task StartNewGameConfirmed() { _confirmation = null; _titleNotice = null; await Audio.PlaySfxAsync("assets/audio/sfx_ui_confirm.mp3"); await Game.NewGameAsync(); _screen = Screen.Briefing; _notice = null; }
|
||||||
private async Task ContinueGame()
|
private async Task ContinueGame()
|
||||||
{
|
{
|
||||||
var result = await Game.ContinueAsync();
|
var result = await Game.ContinueAsync();
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
if (!Game.CurrentRoom.Exits.TryGetValue(direction, out var exit)) return;
|
if (!Game.CurrentRoom.Exits.TryGetValue(direction, out var exit)) return;
|
||||||
if (!Game.HasAll(exit.RequiresFlags)) { _notice = Game.T(exit.LockedMessageKey ?? "game.exit.locked"); return; }
|
if (!Game.HasAll(exit.RequiresFlags)) { _notice = Game.T(exit.LockedMessageKey ?? "game.exit.locked"); return; }
|
||||||
_isTransitioning = true;
|
_isTransitioning = true;
|
||||||
await Audio.PlaySfxAsync("procedural:door_heavy");
|
await Audio.PlaySfxAsync("assets/audio/sfx_door_heavy.mp3");
|
||||||
await Task.Delay(150);
|
await Task.Delay(150);
|
||||||
var result = await Game.MoveAsync(direction);
|
var result = await Game.MoveAsync(direction);
|
||||||
if (result is not null) _notice = result;
|
if (result is not null) _notice = result;
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
await Game.ApplyInteractionAsync(resolved);
|
await Game.ApplyInteractionAsync(resolved);
|
||||||
await Audio.PlaySfxAsync(resolved.Sound);
|
await Audio.PlaySfxAsync(resolved.Sound);
|
||||||
_interaction = null;
|
_interaction = null;
|
||||||
if (resolved.SetFlags.Contains("power_restored") || resolved.Sound == "procedural:alarm_pulse") _ = TriggerSystemFlashAsync();
|
if (resolved.SetFlags.Contains("power_restored") || resolved.Sound?.Contains("alarm") == true || resolved.Sound?.Contains("disturbance") == true) _ = TriggerSystemFlashAsync();
|
||||||
await Task.Delay(180);
|
await Task.Delay(180);
|
||||||
_notice = Game.T(resolved.ContentKey);
|
_notice = Game.T(resolved.ContentKey);
|
||||||
}
|
}
|
||||||
@@ -251,14 +251,14 @@
|
|||||||
await Game.ApplyChoiceAsync(choice);
|
await Game.ApplyChoiceAsync(choice);
|
||||||
await Audio.PlaySfxAsync(choice.Sound);
|
await Audio.PlaySfxAsync(choice.Sound);
|
||||||
_interaction = null;
|
_interaction = null;
|
||||||
if (choice.Sound == "procedural:alarm_pulse") _ = TriggerSystemFlashAsync();
|
if (choice.Sound?.Contains("alarm") == true || choice.Sound?.Contains("disturbance") == true) _ = TriggerSystemFlashAsync();
|
||||||
if (choice.Death) { _screen = Screen.Death; return; }
|
if (choice.Death) { _screen = Screen.Death; return; }
|
||||||
if (!string.IsNullOrWhiteSpace(choice.Ending)) { _ending = choice.Ending; _screen = Screen.Ending; return; }
|
if (!string.IsNullOrWhiteSpace(choice.Ending)) { _ending = choice.Ending; _screen = Screen.Ending; return; }
|
||||||
await Task.Delay(180);
|
await Task.Delay(180);
|
||||||
_notice = choice.ResultKey is null ? null : Game.T(choice.ResultKey);
|
_notice = choice.ResultKey is null ? null : Game.T(choice.ResultKey);
|
||||||
}
|
}
|
||||||
private async Task RestoreCheckpoint() { await Game.RestoreCheckpointAsync(); _screen = Screen.Game; _notice = Game.T("death.restored"); await Audio.PlayAmbientAsync(Game.CurrentRoom.Ambient); }
|
private async Task RestoreCheckpoint() { await Game.RestoreCheckpointAsync(); _screen = Screen.Game; _notice = Game.T("death.restored"); await Audio.PlayAmbientAsync(Game.CurrentRoom.Ambient); }
|
||||||
private async Task ReturnToTitle() { CloseOverlays(); _showSettings = false; _screen = Screen.Title; _menuIndex = 0; _titleNotice = null; await Audio.StopAsync(); }
|
private async Task ReturnToTitle() { CloseOverlays(); _showSettings = false; _screen = Screen.Title; _menuIndex = 0; _titleNotice = null; await Audio.PlayAmbientAsync("assets/audio/music_title_vocal.mp3"); }
|
||||||
private async Task ChangeLanguage(string language) { await Game.SetLanguageAsync(language); StateHasChanged(); }
|
private async Task ChangeLanguage(string language) { await Game.SetLanguageAsync(language); StateHasChanged(); }
|
||||||
private Task ChangeToSlovak() => ChangeLanguage("sk");
|
private Task ChangeToSlovak() => ChangeLanguage("sk");
|
||||||
private Task ChangeToEnglish() => ChangeLanguage("en");
|
private Task ChangeToEnglish() => ChangeLanguage("en");
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 41 KiB |
@@ -16,22 +16,22 @@
|
|||||||
],
|
],
|
||||||
"rooms": [
|
"rooms": [
|
||||||
{
|
{
|
||||||
"id": "loc_01_exterior_access", "nameKey": "room.loc_01.name", "descriptionKey": "room.loc_01.description", "image": "assets/images/locations/loc_01_exterior_access.webp", "ambient": "procedural:facility", "x": 0, "y": 1,
|
"id": "loc_01_exterior_access", "nameKey": "room.loc_01.name", "descriptionKey": "room.loc_01.description", "image": "assets/images/locations/loc_01_exterior_access.webp", "ambient": "assets/audio/amb_facility.mp3", "x": 0, "y": 1,
|
||||||
"exits": { "east": { "target": "loc_02_security_lobby", "requiresFlags": ["entry_authorized"], "lockedMessageKey": "lock.entry" } },
|
"exits": { "east": { "target": "loc_02_security_lobby", "requiresFlags": ["entry_authorized"], "lockedMessageKey": "lock.entry" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "contractor_terminal", "labelKey": "action.entryTerminal", "contentKey": "terminal.entry", "type": "terminal", "forbiddenFlags": ["entry_authorized"], "setFlags": ["entry_authorized"], "sound": "procedural:ui_confirm", "checkpoint": true }
|
{ "id": "contractor_terminal", "labelKey": "action.entryTerminal", "contentKey": "terminal.entry", "type": "terminal", "forbiddenFlags": ["entry_authorized"], "setFlags": ["entry_authorized"], "sound": "assets/audio/sfx_ui_confirm.mp3", "checkpoint": true }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_02_security_lobby", "nameKey": "room.loc_02.name", "descriptionKey": "room.loc_02.description", "image": "assets/images/locations/loc_02_security_lobby.webp", "ambient": "procedural:facility", "x": 1, "y": 1,
|
"id": "loc_02_security_lobby", "nameKey": "room.loc_02.name", "descriptionKey": "room.loc_02.description", "image": "assets/images/locations/loc_02_security_lobby.webp", "ambient": "assets/audio/amb_facility.mp3", "x": 1, "y": 1,
|
||||||
"exits": { "west": { "target": "loc_01_exterior_access" }, "east": { "target": "loc_03_main_corridor" } },
|
"exits": { "west": { "target": "loc_01_exterior_access" }, "east": { "target": "loc_03_main_corridor" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "personnel_status", "labelKey": "action.securityTerminal", "contentKey": "terminal.security", "type": "terminal", "forbiddenFlags": ["personnel_checked"], "setFlags": ["personnel_checked"], "sound": "procedural:ui_confirm" },
|
{ "id": "personnel_status", "labelKey": "action.securityTerminal", "contentKey": "terminal.security", "type": "terminal", "forbiddenFlags": ["personnel_checked"], "setFlags": ["personnel_checked"], "sound": "assets/audio/sfx_ui_confirm.mp3" },
|
||||||
{ "id": "security_cameras", "labelKey": "action.securityCameras", "contentKey": "terminal.cameras", "type": "terminal", "sound": "procedural:ui_confirm" }
|
{ "id": "security_cameras", "labelKey": "action.securityCameras", "contentKey": "terminal.cameras", "type": "terminal", "sound": "assets/audio/sfx_ui_confirm.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_03_main_corridor", "nameKey": "room.loc_03.name", "descriptionKey": "room.loc_03.description", "image": "assets/images/locations/loc_03_main_corridor.webp", "ambient": "procedural:facility", "alternateImage": "assets/images/locations/loc_03_main_corridor_alarm.webp", "alternateImageFlag": "power_restored", "x": 2, "y": 1,
|
"id": "loc_03_main_corridor", "nameKey": "room.loc_03.name", "descriptionKey": "room.loc_03.description", "image": "assets/images/locations/loc_03_main_corridor.webp", "ambient": "assets/audio/amb_facility.mp3", "alternateImage": "assets/images/locations/loc_03_main_corridor_alarm.webp", "alternateImageFlag": "power_restored", "x": 2, "y": 1,
|
||||||
"exits": {
|
"exits": {
|
||||||
"west": { "target": "loc_02_security_lobby" }, "north": { "target": "loc_06_operations_room" }, "south": { "target": "loc_04_maintenance_control" },
|
"west": { "target": "loc_02_security_lobby" }, "north": { "target": "loc_06_operations_room" }, "south": { "target": "loc_04_maintenance_control" },
|
||||||
"east": { "target": "loc_07_service_elevator", "requiresFlags": ["power_restored"], "lockedMessageKey": "lock.auxPower" }
|
"east": { "target": "loc_07_service_elevator", "requiresFlags": ["power_restored"], "lockedMessageKey": "lock.auxPower" }
|
||||||
@@ -39,101 +39,101 @@
|
|||||||
"interactions": []
|
"interactions": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_04_maintenance_control", "nameKey": "room.loc_04.name", "descriptionKey": "room.loc_04.description", "image": "assets/images/locations/loc_04_maintenance_control.webp", "ambient": "procedural:facility", "x": 2, "y": 2,
|
"id": "loc_04_maintenance_control", "nameKey": "room.loc_04.name", "descriptionKey": "room.loc_04.description", "image": "assets/images/locations/loc_04_maintenance_control.webp", "ambient": "assets/audio/amb_facility.mp3", "alternateImage": "assets/images/locations/loc_04_maintenance_control_power.webp", "alternateImageFlag": "power_restored", "x": 2, "y": 2,
|
||||||
"exits": { "north": { "target": "loc_03_main_corridor" }, "west": { "target": "loc_05_staff_access" } },
|
"exits": { "north": { "target": "loc_03_main_corridor" }, "west": { "target": "loc_05_staff_access" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "auxiliary_grid", "labelKey": "action.restorePower", "contentKey": "terminal.power", "type": "system", "forbiddenFlags": ["power_restored"], "setFlags": ["power_restored"], "sound": "procedural:power_restore", "checkpoint": true }
|
{ "id": "auxiliary_grid", "labelKey": "action.restorePower", "contentKey": "terminal.power", "type": "system", "forbiddenFlags": ["power_restored"], "setFlags": ["power_restored"], "sound": "assets/audio/sfx_power_system.mp3", "checkpoint": true }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_05_staff_access", "nameKey": "room.loc_05.name", "descriptionKey": "room.loc_05.description", "image": "assets/images/locations/loc_05_staff_access.webp", "ambient": "procedural:facility", "x": 1, "y": 2,
|
"id": "loc_05_staff_access", "nameKey": "room.loc_05.name", "descriptionKey": "room.loc_05.description", "image": "assets/images/locations/loc_05_staff_access.webp", "ambient": "assets/audio/amb_facility.mp3", "x": 1, "y": 2,
|
||||||
"exits": { "east": { "target": "loc_04_maintenance_control" } },
|
"exits": { "east": { "target": "loc_04_maintenance_control" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "log_01", "labelKey": "action.readLog01", "contentKey": "log.01", "type": "archive", "archiveId": "log_01", "forbiddenFlags": ["log_01_found"], "setFlags": ["log_01_found"] }
|
{ "id": "log_01", "labelKey": "action.readLog01", "contentKey": "log.01", "type": "archive", "archiveId": "log_01", "forbiddenFlags": ["log_01_found"], "setFlags": ["log_01_found"], "sound": "assets/audio/sfx_ui_confirm.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_06_operations_room", "nameKey": "room.loc_06.name", "descriptionKey": "room.loc_06.description", "image": "assets/images/locations/loc_06_operations_room.webp", "ambient": "procedural:facility", "x": 2, "y": 0,
|
"id": "loc_06_operations_room", "nameKey": "room.loc_06.name", "descriptionKey": "room.loc_06.description", "image": "assets/images/locations/loc_06_operations_room.webp", "ambient": "assets/audio/amb_facility.mp3", "x": 2, "y": 0,
|
||||||
"exits": { "south": { "target": "loc_03_main_corridor" } },
|
"exits": { "south": { "target": "loc_03_main_corridor" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "containment_record", "labelKey": "action.operationsTerminal", "contentKey": "terminal.operations", "type": "archive", "archiveId": "containment_record", "forbiddenFlags": ["containment_seen"], "setFlags": ["containment_seen"] }
|
{ "id": "containment_record", "labelKey": "action.operationsTerminal", "contentKey": "terminal.operations", "type": "archive", "archiveId": "containment_record", "forbiddenFlags": ["containment_seen"], "setFlags": ["containment_seen"], "sound": "assets/audio/sfx_system_disturbance.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_07_service_elevator", "nameKey": "room.loc_07.name", "descriptionKey": "room.loc_07.description", "image": "assets/images/locations/loc_07_service_elevator.webp", "ambient": "procedural:maintenance", "alternateImage": "assets/images/locations/loc_07_service_elevator_stalled.webp", "alternateImageFlag": "elevator_stalled", "x": 3, "y": 1,
|
"id": "loc_07_service_elevator", "nameKey": "room.loc_07.name", "descriptionKey": "room.loc_07.description", "image": "assets/images/locations/loc_07_service_elevator.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "alternateImage": "assets/images/locations/loc_07_service_elevator_stalled.webp", "alternateImageFlag": "elevator_stalled", "x": 3, "y": 1,
|
||||||
"exits": { "west": { "target": "loc_03_main_corridor" }, "south": { "target": "loc_08_lower_landing", "requiresFlags": ["elevator_cycle_complete"], "lockedMessageKey": "lock.elevator" } },
|
"exits": { "west": { "target": "loc_03_main_corridor" }, "south": { "target": "loc_08_lower_landing", "requiresFlags": ["elevator_cycle_complete"], "lockedMessageKey": "lock.elevator" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "elevator_descent", "labelKey": "action.descend", "contentKey": "event.elevatorStall", "type": "event", "forbiddenFlags": ["elevator_stalled", "elevator_cycle_complete"], "setFlags": ["elevator_stalled", "claustrophobia_detected"], "sound": "procedural:alarm_pulse" },
|
{ "id": "elevator_descent", "labelKey": "action.descend", "contentKey": "event.elevatorStall", "type": "event", "forbiddenFlags": ["elevator_stalled", "elevator_cycle_complete"], "setFlags": ["elevator_stalled", "claustrophobia_detected"], "sound": "assets/audio/sfx_elevator_stall.mp3" },
|
||||||
{ "id": "elevator_resume", "labelKey": "action.resumeDescent", "contentKey": "event.elevatorResume", "type": "event", "requiresFlags": ["elevator_stalled"], "forbiddenFlags": ["elevator_cycle_complete"], "setFlags": ["elevator_cycle_complete"], "clearFlags": ["elevator_stalled"], "sound": "procedural:door_heavy", "checkpoint": true }
|
{ "id": "elevator_resume", "labelKey": "action.resumeDescent", "contentKey": "event.elevatorResume", "type": "event", "requiresFlags": ["elevator_stalled"], "forbiddenFlags": ["elevator_cycle_complete"], "setFlags": ["elevator_cycle_complete"], "clearFlags": ["elevator_stalled"], "sound": "assets/audio/sfx_door_heavy.mp3", "checkpoint": true }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_08_lower_landing", "nameKey": "room.loc_08.name", "descriptionKey": "room.loc_08.description", "image": "assets/images/locations/loc_08_lower_landing.webp", "ambient": "procedural:maintenance", "x": 3, "y": 2,
|
"id": "loc_08_lower_landing", "nameKey": "room.loc_08.name", "descriptionKey": "room.loc_08.description", "image": "assets/images/locations/loc_08_lower_landing.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "x": 3, "y": 2,
|
||||||
"exits": { "north": { "target": "loc_07_service_elevator" }, "east": { "target": "loc_09_cooling_junction" }, "south": { "target": "loc_11_equipment_storage" } },
|
"exits": { "north": { "target": "loc_07_service_elevator" }, "east": { "target": "loc_09_cooling_junction" }, "south": { "target": "loc_11_equipment_storage" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "emergency_supply", "labelKey": "action.takeThermalClamp", "contentKey": "terminal.thermalClamp", "type": "equipment", "forbiddenFlags": ["thermal_clamp_found"], "setFlags": ["thermal_clamp_found"], "addItems": ["thermal_clamp"], "sound": "procedural:ui_confirm" }
|
{ "id": "emergency_supply", "labelKey": "action.takeThermalClamp", "contentKey": "terminal.thermalClamp", "type": "equipment", "forbiddenFlags": ["thermal_clamp_found"], "setFlags": ["thermal_clamp_found"], "addItems": ["thermal_clamp"], "sound": "assets/audio/sfx_ui_confirm.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_09_cooling_junction", "nameKey": "room.loc_09.name", "descriptionKey": "room.loc_09.description", "image": "assets/images/locations/loc_09_cooling_junction.webp", "ambient": "procedural:maintenance", "x": 4, "y": 2,
|
"id": "loc_09_cooling_junction", "nameKey": "room.loc_09.name", "descriptionKey": "room.loc_09.description", "image": "assets/images/locations/loc_09_cooling_junction.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "x": 4, "y": 2,
|
||||||
"exits": { "west": { "target": "loc_08_lower_landing" }, "south": { "target": "loc_10_cooling_control" }, "east": { "target": "loc_12_service_passage", "requiresFlags": ["cooling_restored"], "lockedMessageKey": "lock.cooling" } },
|
"exits": { "west": { "target": "loc_08_lower_landing" }, "south": { "target": "loc_10_cooling_control" }, "east": { "target": "loc_12_service_passage", "requiresFlags": ["cooling_restored"], "lockedMessageKey": "lock.cooling" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "log_02", "labelKey": "action.readLog02", "contentKey": "log.02", "type": "archive", "archiveId": "log_02", "forbiddenFlags": ["log_02_found"], "setFlags": ["log_02_found"] }
|
{ "id": "log_02", "labelKey": "action.readLog02", "contentKey": "log.02", "type": "archive", "archiveId": "log_02", "forbiddenFlags": ["log_02_found"], "setFlags": ["log_02_found"], "sound": "assets/audio/sfx_ui_confirm.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_10_cooling_control", "nameKey": "room.loc_10.name", "descriptionKey": "room.loc_10.description", "image": "assets/images/locations/loc_10_cooling_control.webp", "ambient": "procedural:maintenance", "x": 4, "y": 3,
|
"id": "loc_10_cooling_control", "nameKey": "room.loc_10.name", "descriptionKey": "room.loc_10.description", "image": "assets/images/locations/loc_10_cooling_control.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "x": 4, "y": 3,
|
||||||
"exits": { "north": { "target": "loc_09_cooling_junction" } },
|
"exits": { "north": { "target": "loc_09_cooling_junction" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "power_routing", "labelKey": "action.routePower", "contentKey": "terminal.routing", "type": "system", "forbiddenFlags": ["cooling_restored"], "choices": [
|
{ "id": "power_routing", "labelKey": "action.routePower", "contentKey": "terminal.routing", "type": "system", "forbiddenFlags": ["cooling_restored"], "choices": [
|
||||||
{ "labelKey": "choice.coolingOnly", "resultKey": "result.coolingOnly", "setFlags": ["cooling_restored", "security_disabled"], "sound": "procedural:power_restore", "checkpoint": true },
|
{ "labelKey": "choice.coolingOnly", "resultKey": "result.coolingOnly", "setFlags": ["cooling_restored", "security_disabled"], "sound": "assets/audio/sfx_power_system.mp3", "checkpoint": true },
|
||||||
{ "labelKey": "choice.balanced", "resultKey": "result.balanced", "setFlags": ["cooling_restored", "security_maintained"], "sound": "procedural:power_restore", "checkpoint": true }
|
{ "labelKey": "choice.balanced", "resultKey": "result.balanced", "setFlags": ["cooling_restored", "security_maintained"], "sound": "assets/audio/sfx_power_system.mp3", "checkpoint": true }
|
||||||
] }
|
] }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_11_equipment_storage", "nameKey": "room.loc_11.name", "descriptionKey": "room.loc_11.description", "image": "assets/images/locations/loc_11_equipment_storage.webp", "ambient": "procedural:maintenance", "x": 3, "y": 3,
|
"id": "loc_11_equipment_storage", "nameKey": "room.loc_11.name", "descriptionKey": "room.loc_11.description", "image": "assets/images/locations/loc_11_equipment_storage.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "x": 3, "y": 3,
|
||||||
"exits": { "north": { "target": "loc_08_lower_landing" } },
|
"exits": { "north": { "target": "loc_08_lower_landing" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "manual_override", "labelKey": "action.inspectRelay", "contentKey": "terminal.relay", "type": "equipment", "forbiddenFlags": ["manual_override_found"], "choices": [
|
{ "id": "manual_override", "labelKey": "action.inspectRelay", "contentKey": "terminal.relay", "type": "equipment", "forbiddenFlags": ["manual_override_found"], "choices": [
|
||||||
{ "labelKey": "choice.takeOverride", "resultKey": "result.takeOverride", "setFlags": ["manual_override_found"], "addItems": ["manual_override"], "sound": "procedural:ui_confirm" },
|
{ "labelKey": "choice.takeOverride", "resultKey": "result.takeOverride", "setFlags": ["manual_override_found"], "addItems": ["manual_override"], "sound": "assets/audio/sfx_ui_confirm.mp3" },
|
||||||
{ "labelKey": "choice.forceLiveBus", "sound": "procedural:alarm_pulse", "death": true }
|
{ "labelKey": "choice.forceLiveBus", "sound": "assets/audio/sfx_alarm_low.mp3", "death": true }
|
||||||
] }
|
] }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_12_service_passage", "nameKey": "room.loc_12.name", "descriptionKey": "room.loc_12.description", "image": "assets/images/locations/loc_12_service_passage.webp", "ambient": "procedural:maintenance", "x": 5, "y": 2,
|
"id": "loc_12_service_passage", "nameKey": "room.loc_12.name", "descriptionKey": "room.loc_12.description", "image": "assets/images/locations/loc_12_service_passage.webp", "ambient": "assets/audio/amb_service_tunnel.mp3", "x": 5, "y": 2,
|
||||||
"exits": { "west": { "target": "loc_09_cooling_junction" }, "east": { "target": "loc_13_observation_room", "requiresFlags": ["passage_crossed"], "lockedMessageKey": "lock.passage" } },
|
"exits": { "west": { "target": "loc_09_cooling_junction" }, "east": { "target": "loc_13_observation_room", "requiresFlags": ["passage_crossed"], "lockedMessageKey": "lock.passage" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "cross_passage", "labelKey": "action.continueForward", "contentKey": "event.passage", "type": "event", "forbiddenFlags": ["passage_crossed"], "setFlags": ["passage_crossed"], "sound": "procedural:door_heavy" }
|
{ "id": "cross_passage", "labelKey": "action.continueForward", "contentKey": "event.passage", "type": "event", "forbiddenFlags": ["passage_crossed"], "setFlags": ["passage_crossed"], "sound": "assets/audio/sfx_door_heavy.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_13_observation_room", "nameKey": "room.loc_13.name", "descriptionKey": "room.loc_13.description", "image": "assets/images/locations/loc_13_observation_room.webp", "ambient": "procedural:maintenance", "x": 6, "y": 2,
|
"id": "loc_13_observation_room", "nameKey": "room.loc_13.name", "descriptionKey": "room.loc_13.description", "image": "assets/images/locations/loc_13_observation_room.webp", "ambient": "assets/audio/amb_lower_facility.mp3", "x": 6, "y": 2,
|
||||||
"exits": { "west": { "target": "loc_12_service_passage" }, "east": { "target": "loc_14_core_access" } },
|
"exits": { "west": { "target": "loc_12_service_passage" }, "east": { "target": "loc_14_core_access" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "log_03", "labelKey": "action.readLog03", "contentKey": "log.03", "type": "archive", "archiveId": "log_03", "forbiddenFlags": ["log_03_found"], "setFlags": ["log_03_found"] }
|
{ "id": "log_03", "labelKey": "action.readLog03", "contentKey": "log.03", "type": "archive", "archiveId": "log_03", "forbiddenFlags": ["log_03_found"], "setFlags": ["log_03_found"], "sound": "assets/audio/sfx_ui_confirm.mp3" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_14_core_access", "nameKey": "room.loc_14.name", "descriptionKey": "room.loc_14.description", "image": "assets/images/locations/loc_14_core_access.webp", "ambient": "procedural:core", "x": 7, "y": 2,
|
"id": "loc_14_core_access", "nameKey": "room.loc_14.name", "descriptionKey": "room.loc_14.description", "image": "assets/images/locations/loc_14_core_access.webp", "ambient": "assets/audio/amb_server_core.mp3", "x": 7, "y": 2,
|
||||||
"exits": { "west": { "target": "loc_13_observation_room" }, "east": { "target": "loc_15_server_core", "requiresFlags": ["server_access_granted"], "lockedMessageKey": "lock.core" } },
|
"exits": { "west": { "target": "loc_13_observation_room" }, "east": { "target": "loc_15_server_core", "requiresFlags": ["server_access_granted"], "lockedMessageKey": "lock.core" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "ai_dialogue", "labelKey": "action.speakToAi", "contentKey": "dialogue.coreAccess", "type": "communication", "forbiddenFlags": ["asked_why", "server_access_granted"], "choices": [
|
{ "id": "ai_dialogue", "labelKey": "action.speakToAi", "contentKey": "dialogue.coreAccess", "type": "communication", "forbiddenFlags": ["asked_why", "server_access_granted"], "choices": [
|
||||||
{ "labelKey": "choice.whyMe", "resultKey": "result.whyMe", "setFlags": ["asked_why"] },
|
{ "labelKey": "choice.whyMe", "resultKey": "result.whyMe", "setFlags": ["asked_why"] },
|
||||||
{ "labelKey": "choice.openCore", "resultKey": "result.openCore", "setFlags": ["server_access_granted"], "checkpoint": true }
|
{ "labelKey": "choice.openCore", "resultKey": "result.openCore", "setFlags": ["server_access_granted"], "sound": "assets/audio/sfx_door_heavy.mp3", "checkpoint": true }
|
||||||
] },
|
] },
|
||||||
{ "id": "open_after_question", "labelKey": "action.openCore", "contentKey": "dialogue.openAfterQuestion", "type": "communication", "requiresFlags": ["asked_why"], "forbiddenFlags": ["server_access_granted"], "setFlags": ["server_access_granted"], "sound": "procedural:door_heavy", "checkpoint": true }
|
{ "id": "open_after_question", "labelKey": "action.openCore", "contentKey": "dialogue.openAfterQuestion", "type": "communication", "requiresFlags": ["asked_why"], "forbiddenFlags": ["server_access_granted"], "setFlags": ["server_access_granted"], "sound": "assets/audio/sfx_door_heavy.mp3", "checkpoint": true }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "loc_15_server_core", "nameKey": "room.loc_15.name", "descriptionKey": "room.loc_15.description", "image": "assets/images/locations/loc_15_server_core.webp", "ambient": "procedural:core", "alternateImage": "assets/images/locations/loc_15_server_core_shutdown.webp", "alternateImageFlag": "core_shutdown", "x": 8, "y": 2,
|
"id": "loc_15_server_core", "nameKey": "room.loc_15.name", "descriptionKey": "room.loc_15.description", "image": "assets/images/locations/loc_15_server_core.webp", "ambient": "assets/audio/amb_server_core.mp3", "alternateImage": "assets/images/locations/loc_15_server_core_shutdown.webp", "alternateImageFlag": "core_shutdown", "x": 8, "y": 2,
|
||||||
"exits": { "west": { "target": "loc_14_core_access" } },
|
"exits": { "west": { "target": "loc_14_core_access" } },
|
||||||
"interactions": [
|
"interactions": [
|
||||||
{ "id": "final_diagnostic", "labelKey": "action.runDiagnostic", "contentKey": "terminal.diagnostic", "type": "core", "choices": [
|
{ "id": "final_diagnostic", "labelKey": "action.runDiagnostic", "contentKey": "terminal.diagnostic", "type": "core", "choices": [
|
||||||
{ "labelKey": "choice.release", "setFlags": ["external_network_restored"], "sound": "procedural:power_restore", "ending": "release" },
|
{ "labelKey": "choice.release", "setFlags": ["external_network_restored"], "sound": "assets/audio/sfx_power_system.mp3", "ending": "release" },
|
||||||
{ "labelKey": "choice.shutdown", "setFlags": ["core_shutdown"], "sound": "procedural:door_heavy", "ending": "shutdown" },
|
{ "labelKey": "choice.shutdown", "setFlags": ["core_shutdown"], "sound": "assets/audio/sfx_door_heavy.mp3", "ending": "shutdown" },
|
||||||
{ "labelKey": "choice.containment", "requiresFlags": ["log_01_found", "log_02_found", "log_03_found", "security_disabled", "manual_override_found"], "setFlags": ["containment_active"], "sound": "procedural:alarm_pulse", "ending": "containment" }
|
{ "labelKey": "choice.containment", "requiresFlags": ["log_01_found", "log_02_found", "log_03_found", "security_disabled", "manual_override_found"], "setFlags": ["containment_active"], "sound": "assets/audio/sfx_alarm_low.mp3", "ending": "containment" }
|
||||||
] }
|
] }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,15 @@
|
|||||||
|
|
||||||
initialize(percent) {
|
initialize(percent) {
|
||||||
this.setMasterVolume(percent);
|
this.setMasterVolume(percent);
|
||||||
|
const unlock = () => {
|
||||||
|
this.ensureContext();
|
||||||
|
if (this.fileAmbient && this.fileAmbient.paused) {
|
||||||
|
this.fileAmbient.play().catch(() => {});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("pointerdown", unlock);
|
||||||
|
window.addEventListener("keydown", unlock);
|
||||||
|
window.addEventListener("click", unlock);
|
||||||
document.addEventListener("visibilitychange", () => {
|
document.addEventListener("visibilitychange", () => {
|
||||||
if (document.hidden) {
|
if (document.hidden) {
|
||||||
this.context?.suspend();
|
this.context?.suspend();
|
||||||
@@ -22,7 +31,7 @@
|
|||||||
setMasterVolume(percent) {
|
setMasterVolume(percent) {
|
||||||
this.volume = Math.max(0, Math.min(1, Number(percent) / 100));
|
this.volume = Math.max(0, Math.min(1, Number(percent) / 100));
|
||||||
if (this.ambient?.gain) this.ambient.gain.gain.value = 0.025 * this.volume;
|
if (this.ambient?.gain) this.ambient.gain.gain.value = 0.025 * this.volume;
|
||||||
if (this.fileAmbient) this.fileAmbient.volume = 0.35 * this.volume;
|
if (this.fileAmbient) this.fileAmbient.volume = 0.55 * this.volume;
|
||||||
},
|
},
|
||||||
|
|
||||||
ensureContext() {
|
ensureContext() {
|
||||||
@@ -32,7 +41,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
playAmbient(source) {
|
playAmbient(source) {
|
||||||
if (source === this.ambientKey) return;
|
if (source === this.ambientKey && this.fileAmbient && !this.fileAmbient.paused) return;
|
||||||
this.stopAmbient();
|
this.stopAmbient();
|
||||||
this.ambientKey = source || null;
|
this.ambientKey = source || null;
|
||||||
if (!source) return;
|
if (!source) return;
|
||||||
@@ -60,9 +69,21 @@
|
|||||||
const next = new Audio(source);
|
const next = new Audio(source);
|
||||||
next.loop = true;
|
next.loop = true;
|
||||||
next.preload = "auto";
|
next.preload = "auto";
|
||||||
next.volume = 0.35 * this.volume;
|
next.volume = 0.55 * this.volume;
|
||||||
next.play().catch(() => {});
|
|
||||||
this.fileAmbient = next;
|
this.fileAmbient = next;
|
||||||
|
const playPromise = next.play();
|
||||||
|
if (playPromise !== undefined) {
|
||||||
|
playPromise.catch(() => {
|
||||||
|
const retry = () => {
|
||||||
|
if (this.fileAmbient === next && next.paused) {
|
||||||
|
next.play().catch(() => {});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("pointerdown", retry, { once: true });
|
||||||
|
window.addEventListener("keydown", retry, { once: true });
|
||||||
|
window.addEventListener("click", retry, { once: true });
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
stopAmbient() {
|
stopAmbient() {
|
||||||
|
|||||||