ForestryMC/Binnie

Alcohols unintentionally have only very brief potion effects

eggdropsoap opened this issue · 0 comments

Alcohol effects are very brief, only 1s to 4s, which is generally too short to show any visible potion effects or to let the player really trigger the code for drinking while already drunk.

Before commit 61d2f3e, binnie.core.liquid.AlcoholEffect.makedrunk() was being passed a hardcoded 2.1f for alcohol strength (at binnie/extratrees/items/ItemDrink.java, line 143) regardless of the alcohol item used. After the general food and drink improvements in 61d2f3e, alcohol fluids' ABVs are correctly passed instead of a hardcoded float, which range from 0.05f to 0.8f. The code in makedrunk() was written for that strength of 2.1f though, which is the current code's equivalent of 210% ABV. The same calculations now run with fluid ABVs result in very brief times for the potion effects used to represent drunkenness. For almost all drinks time is 3s or less, which is too short to cause visible effects. The exception is Neutral Spirit's ABV of 0.8 (80%), which gives a time of 4s, which is long enough to show a momentary jitter from the nausea shader.

(This is in a sense a regression bug, as the old hardcoded value made alcohol have noticeable drunkenness effects in published versions of the mod, while mod versions built from the current code don't.)

A minimal fix is to roughly rescale the strength variable in makedrunk() for the ABVs now passed in, by multiplying ABV by 100 to get effective strength (basically just get the ABV as a written percentage rather than as a decimal), before plugging strength into the existing time calculations in AlcoholEffect.makedrunk(). This results in a time range from a notable 11s (ABV 0.05) to a respectable 45s (ABV 0.8). Repeated drinking while already drunk works well enough with that change too, with time being extended and slowness and then blindness effects being added.

(Pull request to follow!)