mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[MIRROR] Addiction rework (#3445)
* Addiction rework * a Co-authored-by: Qustinnus <Floydje123@hotmail.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Qustinnus
Gandalf2k15
parent
43febe3145
commit
3b85cf1430
@@ -257,6 +257,8 @@
|
||||
add_event(null, "jolly", /datum/mood_event/jolly)
|
||||
|
||||
|
||||
|
||||
|
||||
///Sets sanity to the specified amount and applies effects.
|
||||
/datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_GREAT, override = FALSE)
|
||||
// If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.7
|
||||
@@ -478,5 +480,18 @@
|
||||
add_event(null, "slipped", /datum/mood_event/slipped)
|
||||
|
||||
|
||||
/datum/component/mood/proc/HandleAddictions()
|
||||
if(!iscarbon(parent))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/affected_carbon = parent
|
||||
|
||||
if(sanity < SANITY_GREAT) ///Sanity is low, stay addicted.
|
||||
return
|
||||
|
||||
for(var/addiction_type in affected_carbon.mind.addiction_points)
|
||||
var/datum/addiction/addiction_to_remove = SSaddiction.all_addictions[type]
|
||||
affected_carbon.mind.remove_addiction_points(type, addiction_to_remove.high_sanity_addiction_loss) //If true was returned, we lost the addiction!
|
||||
|
||||
#undef MINOR_INSANITY_PEN
|
||||
#undef MAJOR_INSANITY_PEN
|
||||
|
||||
Reference in New Issue
Block a user