Skip to content

Commit

Permalink
Added toggle for lock jam feature.
Browse files Browse the repository at this point in the history
For all the peeps out there who really don't like jammed locks. You know who you are! Haha!
  • Loading branch information
TheKimy committed Aug 24, 2018
1 parent 49cd48b commit 30afa86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion 00 Core/scripts/Source/zadConfig.psc
Expand Up @@ -15,6 +15,7 @@ Int Property EscapeDifficulty = 4 Auto
Int Property CooldownDifficulty = 4 Auto
Int Property KeyDifficulty = 4 Auto
Bool Property GlobalDestroyKey = True Auto
Bool Property DisableLockJam = False Auto

int Property UnlockThreshold Auto
int thresholdDefault = 185
Expand Down Expand Up @@ -201,6 +202,7 @@ Int EscapeDifficultyOID
Int CooldownDifficultyOID
Int KeyDifficultyOID
Int GlobalDestroyKeyOID
Int DisableLockJamOID


string[] Property EsccapeDifficultyList Auto
Expand Down Expand Up @@ -306,7 +308,7 @@ Event OnConfigInit()
EndEvent

int Function GetVersion()
return 20 ; mcm menu version
return 21 ; mcm menu version
EndFunction

Event OnVersionUpdate(int newVersion)
Expand Down Expand Up @@ -344,6 +346,7 @@ Event OnPageReset(string page)
CooldownDifficultyOID = AddMenuOption("Cooldown Modifier", EsccapeDifficultyList[CooldownDifficulty])
KeyDifficultyOID = AddMenuOption("Keybreak Modifier", EsccapeDifficultyList[KeyDifficulty])
GlobalDestroyKeyOID = AddToggleOption("Consume Keys", GlobalDestroyKey)
DisableLockJamOID = AddToggleOption("Disable Lock Jam", DisableLockJam)
AddHeaderOption("Belt Arousal Options")
beltRateOID = AddSliderOption("Arousal rate belt multiplier", beltRateMult, "{1}")
plugRateOID = AddSliderOption("Arousal rate plugged multiplier", plugRateMult, "{1}")
Expand Down Expand Up @@ -782,6 +785,9 @@ Event OnOptionSelect(int option)
elseif option == GlobalDestroyKeyOID
GlobalDestroyKey = !GlobalDestroyKey
SetToggleOptionValue(GlobalDestroyKeyOID, GlobalDestroyKey)
elseif option == DisableLockJamOID
DisableLockJam = !DisableLockJam
SetToggleOptionValue(DisableLockJamOID, DisableLockJam)
elseif option == debugSigTermOID
If ShowMessage("WARNING:\nThis function will try to remove all DD items. Wiping quest items may result in broken quest states! This feature is intended to be used for debug purposes and as a last resort only! Using it to escape DD devices is strongly discouraged.\n\nAre you sure?")
debugSigTerm = true
Expand Down Expand Up @@ -1065,6 +1071,8 @@ Event OnOptionHighlight(int option)
SetInfoText("Sets the strength of the speed debuff caused by wearing a hobble skirt.\nThe higher the number, the slower characters wearing a hobble skirt can walk.\nNote: The animations are meant for the default value and will look off at lower values, but some people might find this speed too slow.\nDefault: " + HobbleSkirtSpeedDebuffDefault)
elseIf (option == GlobalDestroyKeyOID)
SetInfoText("When enabled, most keys can be used to unlock only one device, and will be consumed on use.\nThis feature will not affect custom keys unless set by the creator.")
elseIf (option == DisableLockJamOID)
SetInfoText("When set to true, locks can not jam when a key breaks.")
endIf
EndEvent

Expand Down
2 changes: 1 addition & 1 deletion 00 Core/scripts/Source/zadEquipScript.psc
Expand Up @@ -536,7 +536,7 @@ bool Function RemoveDeviceWithKey(actor akActor = none, bool destroyDevice=false
If Utility.RandomFloat(0.0, 99.9) < ModValue
Libs.PlayerRef.RemoveItem(DeviceKey, Utility.RandomInt(1, NumberOfKeysNeeded))
libs.SendDeviceKeyBreakEventVerbose(deviceInventory, zad_DeviousDevice, akActor)
If Utility.RandomFloat(0.0, 99.9) < (LockJamChance * CalculateKeyModifier(False))
If Utility.RandomFloat(0.0, 99.9) < (LockJamChance * CalculateKeyModifier(False)) && !libs.Config.DisableLockJam
; broken key becomes stuck in the lock
libs.SendDeviceJamLockEventVerbose(deviceInventory, zad_DeviousDevice, akActor)
StorageUtil.SetIntValue(akActor, "zad_Equipped" + libs.LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus", 1)
Expand Down
Binary file modified 00 Core/scripts/zadConfig.pex
Binary file not shown.
Binary file modified 00 Core/scripts/zadEquipScript.pex
Binary file not shown.

0 comments on commit 30afa86

Please sign in to comment.