Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Assets/Gothic-Core/Scripts/Services/Vm/VmService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ public class VmService

// Lock picking
public string DoorLockSoundName => "DOOR_LOCK.WAV";
public string PickLockFailureSoundName => _gameStateService.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_FAILURE").GetString(0);
public string PickLockBrokenSoundName => _gameStateService.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_BROKEN").GetString(0);
public string PickLockSuccessSoundName => _gameStateService.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_SUCCESS").GetString(0);
public string PickLockUnlockSoundName => _gameStateService.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_UNLOCK").GetString(0);
// G2 has no _STR_SOUND_PICKLOCK_* strings (the symbol is missing) - its SFX instances have these names.
public string PickLockFailureSoundName => GetSoundName("_STR_SOUND_PICKLOCK_FAILURE", "PICKLOCK_FAILURE");
public string PickLockBrokenSoundName => GetSoundName("_STR_SOUND_PICKLOCK_BROKEN", "PICKLOCK_BROKEN");
public string PickLockSuccessSoundName => GetSoundName("_STR_SOUND_PICKLOCK_SUCCESS", "PICKLOCK_SUCCESS");
public string PickLockUnlockSoundName => GetSoundName("_STR_SOUND_PICKLOCK_UNLOCK", "PICKLOCK_UNLOCK");
// public string DoorUnlockSoundName => "DOOR_UNLOCK.WAV"; // _STR_*_UNLOCK value above couldn't be found/isn't used in G1, therefore we use this as fallback.

private string GetSoundName(string symbolName, string fallback)
{
var name = _gameStateService.GothicVm.GetSymbolByName(symbolName)?.GetString(0);
return string.IsNullOrEmpty(name) ? fallback : name;
}

public string[] MobSit => _gameStateService.GothicVm.GetSymbolByName("MOB_SIT").GetString(0).Split(',');
public string[] MobLie => _gameStateService.GothicVm.GetSymbolByName("MOB_LIE").GetString(0).Split(',');
public string[] MobClimb => _gameStateService.GothicVm.GetSymbolByName("MOB_CLIMB").GetString(0).Split(',');
Expand Down