forked from cgullsHadesMods/hades-CharonSackControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharonSackControl.lua
More file actions
35 lines (27 loc) · 1.06 KB
/
Copy pathCharonSackControl.lua
File metadata and controls
35 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ModUtil.Mod.Register("CharonSackControl")
local config = {
Enabled = true,
SpawnSack = true,
LimitOncePerRun = false,
}
CharonSackControl.config = config
ModUtil.Path.Wrap("WindowDropEntrance", function( baseFunc, ... )
local val = baseFunc(...)
if CharonSackControl.config.Enabled then
local target_chance = 0.22
local target_run_value = "ForbiddenShopItemOffered"
if CharonSackControl.config.SpawnSack then
target_chance = 1.00
end
if not CharonSackControl.config.LimitOncePerRun then
target_run_value = nil
end
for idx, event in ipairs(EncounterData.Shop.StartRoomUnthreadedEvents) do
if event.FunctionName == "CheckForbiddenShopItem" then
EncounterData.Shop.StartRoomUnthreadedEvents[idx].GameStateRequirements.ChanceToPlay = target_chance
EncounterData.Shop.StartRoomUnthreadedEvents[idx].GameStateRequirements.CurrentRunValueFalse = target_run_value
end
end
end
return val
end, CharonSackControl)