Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alcohols unintentionally have only very brief potion effects #645

Open
eggdropsoap opened this issue Apr 17, 2020 · 0 comments · May be fixed by #646
Open

Alcohols unintentionally have only very brief potion effects #645

eggdropsoap opened this issue Apr 17, 2020 · 0 comments · May be fixed by #646

Comments

@eggdropsoap
Copy link

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant