Quit Smoking

If you liked this item, please rate it up on Steam Workshop page.

Author: pillow

Last revision: 22 Dec, 2020 at 15:50 UTC

File size: 65.54 KB

On Steam Workshop

Description:

Allows you to eventually lose the smoker trait over time from abstaining from cigarettes. The chance to quit increases as you approach 4 weeks. If you were a smoker, quit, and smoke again you will regain the smoker trait.

https://github.com/crispiboi/QuitSmoking

Update
12/22/2020 : fixed incremental operand issue and smoker trait not actually being removed. Added cross version compatibility.
12/7/2020: Fixed non-smoker gaining smoker trait bug. Made it more fair to quit as player approaches threshold.
10/1/2020 :Fixed permanent stress bug

It’s possible, but unlikely to quit in less than 2 weeks.
If your character is lucky, you will quit in about 2 weeks.
If your character is unlucky, you will quit in about 6 weeks.
If your character is neither lucky nor unlucky, you will quit in about 4 weeks.

Mechanics:
Every hour, a tiny incremental value is added to the chance to quit, which grows over time at a rate based on the chart above.
Every day, a selection roll is done based on the chance to quit. This value is rounded to the nearest whole number.
formula : selection = 100 – math.floor(playerdata.chancetoquit * 100);
Every day, a magic number is rolled based on a range from 0 to the selection number.
formula : magicnumber = ZombRand(0,selection);
If selection and magic number match, you quit smoking.

You will hear the level up sound if you quit smoking.

This is definitely a work in progress, please report issues if you experience any.

Workshop ID: 2142069709
Mod ID: QuitSmoking