From 41191c39742dfd36bb9d1ba0100ce5d319f7ded6 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 20 Jan 2020 19:01:11 -0700 Subject: [PATCH 1/2] trauma --- code/game/objects/items/devices/PDA/PDA.dm | 1 - .../antagonists/abductor/abductee/abductee.dm | 30 +++++++++++++++++++ .../abductor/abductee/abductee_objectives.dm | 2 +- .../antagonists/abductor/abductee/trauma.dm | 15 ++++++++++ code/modules/antagonists/abductor/abductor.dm | 29 ------------------ tgstation.dme | 2 ++ 6 files changed, 48 insertions(+), 31 deletions(-) create mode 100644 code/modules/antagonists/abductor/abductee/abductee.dm create mode 100644 code/modules/antagonists/abductor/abductee/trauma.dm diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index c0b510111f..81de8e64de 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1,4 +1,3 @@ - //The advanced pea-green monochrome lcd of tomorrow. GLOBAL_LIST_EMPTY(PDAs) diff --git a/code/modules/antagonists/abductor/abductee/abductee.dm b/code/modules/antagonists/abductor/abductee/abductee.dm new file mode 100644 index 0000000000..cf09a76912 --- /dev/null +++ b/code/modules/antagonists/abductor/abductee/abductee.dm @@ -0,0 +1,30 @@ +/datum/antagonist/abductee + name = "Abductee" + roundend_category = "abductees" + antagpanel_category = "Abductee" + +/datum/antagonist/abductee/on_gain() + give_objective() + . = ..() + +/datum/antagonist/abductee/greet() + to_chat(owner, "Your mind snaps!") + to_chat(owner, "You can't remember how you got here...") + owner.announce_objectives() + +/datum/antagonist/abductee/proc/give_objective() + var/mob/living/carbon/human/H = owner.current + if(istype(H)) + H.gain_trauma_type(BRAIN_TRAUMA_MILD, TRAUMA_RESILIENCE_LOBOTOMY) + var/objtype = (prob(75) ? /datum/objective/abductee/random : pick(subtypesof(/datum/objective/abductee/) - /datum/objective/abductee/random)) + var/datum/objective/abductee/O = new objtype() + objectives += O + +/datum/antagonist/abductee/apply_innate_effects(mob/living/mob_override) + update_abductor_icons_added(mob_override ? mob_override.mind : owner,"abductee") + var/mob/living/carbon/C = mob_override || owner?.current + if(istype(C)) + C.gain_trauma_type(/datum/brain_trauma/abductee, TRAUMA_RESILIENCE_SURGERY) + +/datum/antagonist/abductee/remove_innate_effects(mob/living/mob_override) + update_abductor_icons_removed(mob_override ? mob_override.mind : owner) diff --git a/code/modules/antagonists/abductor/abductee/abductee_objectives.dm b/code/modules/antagonists/abductor/abductee/abductee_objectives.dm index f188319644..2d62bf1ac9 100644 --- a/code/modules/antagonists/abductor/abductee/abductee_objectives.dm +++ b/code/modules/antagonists/abductor/abductee/abductee_objectives.dm @@ -18,7 +18,7 @@ /datum/objective/abductee/paint/New() var/color = pick(list("red", "blue", "green", "yellow", "orange", "purple", "black", "in rainbows", "in blood")) - explanation_text+= " [color]!" + explanation_text = " [color]!" /datum/objective/abductee/speech explanation_text = "Your brain is broken... you can only communicate in" diff --git a/code/modules/antagonists/abductor/abductee/trauma.dm b/code/modules/antagonists/abductor/abductee/trauma.dm new file mode 100644 index 0000000000..1edc96421d --- /dev/null +++ b/code/modules/antagonists/abductor/abductee/trauma.dm @@ -0,0 +1,15 @@ +/datum/brain_trauma/abductee + name = "abductee mindsnapped" + desc = "The patient's brain has been scrambled by experimental procedures." + scan_desc = "brain scrambling" + gain_text = "Your mind snaps.. you feel fragmented." + lose_text = "Your mind heals itself and you feel whole again." + random_gain = FALSE + clonable = TRUE + +/datum/brain_trauma/abductee/on_gain() + if(!owner.has_antag_datum(/datum/antagonist/abductee)) + owner.add_antag_datum(/datum/antagonist/abductee) + +/datum/brain_trauma/abductee/on_lose() + owner.remove_antag_datum(/datum/antagonist/abductee) diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index 92504641a9..564e9a8617 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -159,35 +159,6 @@ return "
[result.Join("
")]
" -/datum/antagonist/abductee - name = "Abductee" - roundend_category = "abductees" - antagpanel_category = "Abductee" - -/datum/antagonist/abductee/on_gain() - give_objective() - . = ..() - -/datum/antagonist/abductee/greet() - to_chat(owner, "Your mind snaps!") - to_chat(owner, "You can't remember how you got here...") - owner.announce_objectives() - -/datum/antagonist/abductee/proc/give_objective() - var/mob/living/carbon/human/H = owner.current - if(istype(H)) - H.gain_trauma_type(BRAIN_TRAUMA_MILD, TRAUMA_RESILIENCE_LOBOTOMY) - var/objtype = (prob(75) ? /datum/objective/abductee/random : pick(subtypesof(/datum/objective/abductee/) - /datum/objective/abductee/random)) - var/datum/objective/abductee/O = new objtype() - objectives += O - -/datum/antagonist/abductee/apply_innate_effects(mob/living/mob_override) - update_abductor_icons_added(mob_override ? mob_override.mind : owner,"abductee") - -/datum/antagonist/abductee/remove_innate_effects(mob/living/mob_override) - update_abductor_icons_removed(mob_override ? mob_override.mind : owner) - - // LANDMARKS /obj/effect/landmark/abductor var/team_number = 1 diff --git a/tgstation.dme b/tgstation.dme index 43301633c2..7e6d098c4a 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1227,7 +1227,9 @@ #include "code\modules\antagonists\_common\antag_spawner.dm" #include "code\modules\antagonists\_common\antag_team.dm" #include "code\modules\antagonists\abductor\abductor.dm" +#include "code\modules\antagonists\abductor\abductee\abductee.dm" #include "code\modules\antagonists\abductor\abductee\abductee_objectives.dm" +#include "code\modules\antagonists\abductor\abductee\trauma.dm" #include "code\modules\antagonists\abductor\equipment\abduction_gear.dm" #include "code\modules\antagonists\abductor\equipment\abduction_outfits.dm" #include "code\modules\antagonists\abductor\equipment\abduction_surgery.dm" From b5ca546ac3503462b800ac1b660a481ce97382bf Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 20 Jan 2020 22:45:21 -0700 Subject: [PATCH 2/2] patch --- code/datums/brain_damage/brain_trauma.dm | 2 +- code/modules/antagonists/abductor/abductee/abductee.dm | 6 +++++- code/modules/antagonists/abductor/abductee/trauma.dm | 9 ++++++--- code/modules/mob/living/brain/brain_item.dm | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/datums/brain_damage/brain_trauma.dm b/code/datums/brain_damage/brain_trauma.dm index 1aa1341c9c..eaaab8da45 100644 --- a/code/datums/brain_damage/brain_trauma.dm +++ b/code/datums/brain_damage/brain_trauma.dm @@ -14,7 +14,7 @@ var/can_gain = TRUE var/random_gain = TRUE //can this be gained through random traumas? var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure? - var/clonable = TRUE // will this transfer if the brain is cloned? + var/clonable = TRUE // will this transfer if the brain is cloned? - currently has no effect /datum/brain_trauma/Destroy() if(brain && brain.traumas) diff --git a/code/modules/antagonists/abductor/abductee/abductee.dm b/code/modules/antagonists/abductor/abductee/abductee.dm index cf09a76912..901d2f5b11 100644 --- a/code/modules/antagonists/abductor/abductee/abductee.dm +++ b/code/modules/antagonists/abductor/abductee/abductee.dm @@ -2,6 +2,7 @@ name = "Abductee" roundend_category = "abductees" antagpanel_category = "Abductee" + var/datum/brain_trauma/abductee/brain_trauma /datum/antagonist/abductee/on_gain() give_objective() @@ -24,7 +25,10 @@ update_abductor_icons_added(mob_override ? mob_override.mind : owner,"abductee") var/mob/living/carbon/C = mob_override || owner?.current if(istype(C)) - C.gain_trauma_type(/datum/brain_trauma/abductee, TRAUMA_RESILIENCE_SURGERY) + if(brain_trauma) + qdel(brain_trauma) //make sure there's no lingering trauma + brain_trauma = C.gain_trauma(/datum/brain_trauma/abductee, TRAUMA_RESILIENCE_SURGERY) /datum/antagonist/abductee/remove_innate_effects(mob/living/mob_override) update_abductor_icons_removed(mob_override ? mob_override.mind : owner) + qdel(brain_trauma) diff --git a/code/modules/antagonists/abductor/abductee/trauma.dm b/code/modules/antagonists/abductor/abductee/trauma.dm index 1edc96421d..1518825e1b 100644 --- a/code/modules/antagonists/abductor/abductee/trauma.dm +++ b/code/modules/antagonists/abductor/abductee/trauma.dm @@ -8,8 +8,11 @@ clonable = TRUE /datum/brain_trauma/abductee/on_gain() - if(!owner.has_antag_datum(/datum/antagonist/abductee)) - owner.add_antag_datum(/datum/antagonist/abductee) + . = ..() + if(owner.mind) + if(!owner.mind.has_antag_datum(/datum/antagonist/abductee)) + owner.mind.add_antag_datum(/datum/antagonist/abductee) /datum/brain_trauma/abductee/on_lose() - owner.remove_antag_datum(/datum/antagonist/abductee) + . = ..() + owner.mind?.remove_antag_datum(/datum/antagonist/abductee) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index f2ea4f2b01..15cab5fc64 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -389,6 +389,7 @@ if(resilience) actual_trauma.resilience = resilience SSblackbox.record_feedback("tally", "traumas", 1, actual_trauma.type) + return actual_trauma //Add a random trauma of a certain subtype /obj/item/organ/brain/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, resilience)