Addes Car Battery support for Spindown dice results

This commit is contained in:
Wofsauge committed 2021-06-13 23:18:22 +02:00
1 parent d2bf2bc4b9
commit 5e89828980
1 file changed
+8
+8
View File
@@ -70,8 +70,13 @@ local game = Game()
local function SpindownDiceCallback(descObj) local function SpindownDiceCallback(descObj)
EID:appendToDescription(descObj, "#{{Collectible723}} :") EID:appendToDescription(descObj, "#{{Collectible723}} :")
local refID = descObj.ObjSubType local refID = descObj.ObjSubType
local hasCarBattery = EID.player:HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY)
for i = 1,EID.Config["SpindownDiceResults"] do for i = 1,EID.Config["SpindownDiceResults"] do
local spinnedID = EID:getSpindownResult(refID) local spinnedID = EID:getSpindownResult(refID)
if hasCarBattery then
refID = spinnedID
spinnedID = EID:getSpindownResult(refID)
end
refID = spinnedID refID = spinnedID
if spinnedID > 0 then if spinnedID > 0 then
EID:appendToDescription(descObj, "{{Collectible"..spinnedID.."}}") EID:appendToDescription(descObj, "{{Collectible"..spinnedID.."}}")
@@ -84,6 +89,9 @@ local game = Game()
break break
end end
end end
if hasCarBattery then
EID:appendToDescription(descObj, " (Results with {{Collectible356}})")
end
return descObj return descObj
end end
EID:addDescriptionModifier("Spindown Dice", SpindownDiceCondition, SpindownDiceCallback) EID:addDescriptionModifier("Spindown Dice", SpindownDiceCondition, SpindownDiceCallback)