You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.1 KiB

scn EBxGetDrinksToUpgrade
ref rSource
ref rWaterType
ref rWaterEffect
; TTW
ref rMQA
ref rAquaPura
begin function { rSource }
if GetType rSource == 21 ; activator
set rWaterType to rSource.GetActivatorWaterType
else
set rWaterType to GetCrosshairWater
endif
if IsFormValid rWaterType == 0
SetFunctionValue (ar_construct "array")
return
endif
set rWaterEffect to GetWaterFormEffect rWaterType
if IsFormValid rWaterEffect == 0
; fallback for water types without effect
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
elseif rWaterEffect == WaterHeal1Purified
if EBxHardcore
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
else
SetFunctionValue (ar_list WaterPurified, EBxUpgradableToPurifiedList)
endif
elseif rWaterEffect == WaterHeal2Good
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
elseif rWaterEffect == WaterHeal3Average
if EBxHardcore
SetFunctionValue (ar_list IrradiatedWaterUnpurified, NVDLC03AllEmptyBottlesLIST)
else
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
endif
elseif rWaterEffect == WaterHeal4Bad || rWaterEffect == WaterHeal5Terrible
SetFunctionValue (ar_list IrradiatedWaterUnpurified, NVDLC03AllEmptyBottlesLIST)
elseif rWaterEffect == WaterHeal1Rads500 ; Lethal Water
SetFunctionValue (ar_construct "array")
elseif eval EBxTTW && rWaterEffect == GetFormFromMod "BrokenSteel.esm" "B400" ; DLC03TidalBasinWaterEffect
let rMQA := GetFormFromMod "Fallout3.esm" "14E93" ; MQA
let rAquaPura := GetFormFromMod "BrokenSteel.esm" "104F" ; DLC03AquaPura
if IsFormValid rMQA && IsFormValid rAquaPura
if GetStageDone rMQA 100 == 1
; Project Purity water source has been infected, skip bottling
SetFunctionValue (ar_construct "array")
else
SetFunctionValue (ar_list rAquaPura, EBxUpgradableToPuraList)
endif
else
SetFunctionValue (ar_construct "array")
endif
else
; fallback for custom water types
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
endif
end