Merge pull request #5840 from Poojawa/reverts-crybaby-inducer

Reverts crybaby inducer also does the sync things
This commit is contained in:
deathride58
2018-03-09 18:36:42 +00:00
committed by GitHub
99 changed files with 2091 additions and 1585 deletions
+22 -3
View File
@@ -11,7 +11,7 @@
var/mob_trait //if applicable, apply and remove this mob trait
var/mob/living/trait_holder
/datum/trait/New(mob/living/trait_mob)
/datum/trait/New(mob/living/trait_mob, spawn_effects)
..()
if(!trait_mob || (human_only && !ishuman(trait_mob)) || trait_mob.has_trait_datum(type))
qdel(src)
@@ -23,9 +23,9 @@
trait_holder.add_trait(mob_trait, ROUNDSTART_TRAIT)
START_PROCESSING(SStraits, src)
add()
if(!SSticker.HasRoundStarted()) //on roundstart or on latejoin; latejoin code is in new_player.dm
if(spawn_effects)
on_spawn()
addtimer(CALLBACK(src, .proc/post_add), 30)
addtimer(CALLBACK(src, .proc/post_add), 30)
/datum/trait/Destroy()
STOP_PROCESSING(SStraits, src)
@@ -38,16 +38,25 @@
SStraits.trait_objects -= src
return ..()
/datum/trait/proc/transfer_mob(mob/living/to_mob)
trait_holder.roundstart_traits -= src
to_mob.roundstart_traits += src
trait_holder = to_mob
on_transfer()
/datum/trait/proc/add() //special "on add" effects
/datum/trait/proc/on_spawn() //these should only trigger when the character is being created for the first time, i.e. roundstart/latejoin
/datum/trait/proc/remove() //special "on remove" effects
/datum/trait/proc/on_process() //process() has some special checks, so this is the actual process
/datum/trait/proc/post_add() //for text, disclaimers etc. given after you spawn in with the trait
/datum/trait/proc/on_transfer() //code called when the trait is transferred to a new mob
/datum/trait/process()
if(QDELETED(trait_holder))
qdel(src)
return
if(trait_holder.stat == DEAD)
return
on_process()
/mob/living/proc/get_trait_string(medical) //helper string. gets a string of all the traits the mob has
@@ -67,6 +76,16 @@
return "None"
return dat.Join("<br>")
/mob/living/proc/cleanse_trait_datums() //removes all trait datums
for(var/V in roundstart_traits)
var/datum/trait/T = V
qdel(T)
/mob/living/proc/transfer_trait_datums(mob/living/to_mob)
for(var/V in roundstart_traits)
var/datum/trait/T = V
T.transfer_mob(to_mob)
/*
Commented version of Nearsighted to help you add your own traits
+1 -1
View File
@@ -114,7 +114,7 @@
if(trait_holder.reagents.has_reagent("mindbreaker"))
trait_holder.hallucination = 0
return
if(prob(1)) //we'll all be mad soon enough
if(prob(2)) //we'll all be mad soon enough
madness()
/datum/trait/insanity/proc/madness(mad_fools)