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.

51 lines
1.5 KiB

scn EBxGetBottleByDrink
int iCount
ref rDrink
ref rBaseForm
ref rBottle
begin function { rDrink }
if IsReference rDrink
set rBaseForm to rDrink.GetBaseForm
else
set rBaseForm to rDrink
endif
if rBaseForm == IrradiatedScotch || rBaseForm == Scotch || rBaseForm == ScotchGood
set rBottle to ScotchBottle01Empty01
elseif rBaseForm == SSBottleFull || rBaseForm == IrradiatedSSBottleFull
set rBottle to SSBottleEmpty
elseif rBaseForm == Beer || rBaseForm == IrradiatedBeer
set rBottle to EBxBeerBottleEmpty
elseif rBaseForm == Vodka
set rBottle to EBxVodkaBottleEmpty
elseif rBaseForm == Whiskey || rBaseForm == IrradiatedWhiskey || rBaseForm == WhiskeyDixon
set rBottle to WhiskeyBottle01Empty01
elseif rBaseForm == Wine
set rBottle to EBxWineBottleEmpty
elseif eval rBaseForm == EBxBrahminMilk || IsRefInList WaterLIST rDrink > -1
; prevent endless loop
if ListGetCount NVDLC03AllEmptyBottlesLIST > 0
while rBottle == 0 || rBottle == SSBottleEmptyNoFloat
set iCount to ListGetCount NVDLC03AllEmptyBottlesLIST
set iCount to Rand 0 iCount
set rBottle to ListGetNthForm NVDLC03AllEmptyBottlesLIST iCount
loop
endif
elseif IsRefInList NukaBottleDrinks rDrink > -1
set rBottle to NukaColaBottle
elseif eval GetAddictionEffect rBaseForm == WithdrawalAlcohol || IsRefInList AlchoholicDrinks rDrink > -1
set rBottle to ScotchBottle01Empty01
elseif IsRefInList NonAlchoholicDrinks rDrink > -1
set rBottle to SodaBottleEmpty01
endif
SetFunctionValue rBottle
end