diff --git a/code/datums/mind.dm b/code/datums/mind.dm index fff0db4c92..cb215ab7e4 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -781,6 +781,13 @@ if(G) G.reenter_corpse() + +/datum/mind/proc/has_objective(objective_type) + for(var/datum/antagonist/A in antag_datums) + for(var/O in A.objectives) + if(istype(O,objective_type)) + return TRUE + /mob/proc/sync_mind() mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) mind.active = 1 //indicates that the mind is currently synced with a client diff --git a/code/game/gamemodes/devil/game_mode.dm b/code/game/gamemodes/devil/game_mode.dm index 44f3368feb..2255766e74 100644 --- a/code/game/gamemodes/devil/game_mode.dm +++ b/code/game/gamemodes/devil/game_mode.dm @@ -1,5 +1,4 @@ /datum/game_mode - var/list/datum/mind/sintouched = list() var/list/datum/mind/devils = list() var/devil_ascended = 0 // Number of arch devils on station @@ -25,16 +24,6 @@ hud.leave_hud(devil_mind.current) set_antag_hud(devil_mind.current, null) -/datum/game_mode/proc/update_sintouched_icons_added(datum/mind/sintouched_mind) - var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] - hud.join_hud(sintouched_mind.current) - set_antag_hud(sintouched_mind.current, "sintouched") - -/datum/game_mode/proc/update_sintouched_icons_removed(datum/mind/sintouched_mind) - var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] - hud.leave_hud(sintouched_mind.current) - set_antag_hud(sintouched_mind.current, null) - /datum/game_mode/proc/update_soulless_icons_added(datum/mind/soulless_mind) var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS] hud.join_hud(soulless_mind.current) diff --git a/code/game/gamemodes/devil/objectives.dm b/code/game/gamemodes/devil/objectives.dm index f3f30ad231..f3d5ce575f 100644 --- a/code/game/gamemodes/devil/objectives.dm +++ b/code/game/gamemodes/devil/objectives.dm @@ -69,8 +69,8 @@ explanation_text = "Ensure at least [target_amount] mortals are sintouched." /datum/objective/devil/sintouch/check_completion() - return target_amount>=SSticker.mode.sintouched.len - + var/list/touched = get_antag_minds(/datum/antagonist/sintouched) + return touched.len >= target_amount /datum/objective/devil/buy_target diff --git a/code/modules/antagonists/devil/devil.dm b/code/modules/antagonists/devil/devil.dm index 0d9032bcb6..55a33820f0 100644 --- a/code/modules/antagonists/devil/devil.dm +++ b/code/modules/antagonists/devil/devil.dm @@ -552,18 +552,6 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", parts += printobjectives(owner) return parts.Join("
") -/datum/antagonist/devil/roundend_report_footer() - //sintouched go here for now as a hack , TODO proper antag datum for these - var/list/parts = list() - if(SSticker.mode.sintouched.len) - parts += "The sintouched were:" - var/list/sintouchedUnique = uniqueList(SSticker.mode.sintouched) - for(var/S in sintouchedUnique) - var/datum/mind/sintouched_mind = S - parts += printplayer(sintouched_mind) - parts += printobjectives(sintouched_mind) - return parts.Join("
") - //A simple super light weight datum for the codex gigas. /datum/fakeDevil var/truename diff --git a/code/modules/antagonists/devil/sintouched/sintouched.dm b/code/modules/antagonists/devil/sintouched/sintouched.dm new file mode 100644 index 0000000000..9983e5f599 --- /dev/null +++ b/code/modules/antagonists/devil/sintouched/sintouched.dm @@ -0,0 +1,83 @@ +#define SIN_ACEDIA "acedia" +#define SIN_GLUTTONY "gluttony" +#define SIN_GREED "greed" +#define SIN_SLOTH "sloth" +#define SIN_WRATH "wrath" +#define SIN_ENVY "envy" +#define SIN_PRIDE "pride" + +/datum/antagonist/sintouched + name = "sintouched" + roundend_category = "sintouched" + antagpanel_category = "Devil" + var/sin + + var/static/list/sins = list(SIN_ACEDIA,SIN_GLUTTONY,SIN_GREED,SIN_SLOTH,SIN_WRATH,SIN_ENVY,SIN_PRIDE) + +/datum/antagonist/sintouched/New() + . = ..() + sin = pick(sins) + +/datum/antagonist/sintouched/proc/forge_objectives() + var/datum/objective/sintouched/O + switch(sin)//traditional seven deadly sins... except lust. + if(SIN_ACEDIA) + O = new /datum/objective/sintouched/acedia + if(SIN_GLUTTONY) + O = new /datum/objective/sintouched/gluttony + if(SIN_GREED) + O = new /datum/objective/sintouched/greed + if(SIN_SLOTH) + O = new /datum/objective/sintouched/sloth + if(SIN_WRATH) + O = new /datum/objective/sintouched/wrath + if(SIN_ENVY) + O = new /datum/objective/sintouched/envy + if(SIN_PRIDE) + O = new /datum/objective/sintouched/pride + objectives += O + +/datum/antagonist/sintouched/on_gain() + forge_objectives() + . = ..() + +/datum/antagonist/sintouched/greet() + owner.announce_objectives() + +/datum/antagonist/sintouched/roundend_report() + return printplayer(owner) + +/datum/antagonist/sintouched/admin_add(datum/mind/new_owner,mob/admin) + var/choices = sins + "Random" + var/chosen_sin = input(admin,"What kind ?","Sin kind") as null|anything in choices + if(!chosen_sin) + return + if(chosen_sin in sins) + sin = chosen_sin + . = ..() + +/datum/antagonist/sintouched/apply_innate_effects(mob/living/mob_override) + . = ..() + add_hud() + +/datum/antagonist/sintouched/remove_innate_effects(mob/living/mob_override) + remove_hud() + . = ..() + +/datum/antagonist/sintouched/proc/add_hud() + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] + hud.join_hud(owner.current) + set_antag_hud(owner.current, "sintouched") + +/datum/antagonist/sintouched/proc/remove_hud() + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] + hud.leave_hud(owner.current) + set_antag_hud(owner.current, null) + +#undef SIN_ACEDIA +#undef SIN_ENVY +#undef SIN_GLUTTONY +#undef SIN_GREED +#undef SIN_PRIDE +#undef SIN_SLOTH +#undef SIN_WRATH \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8e5a1aa7ca..fe9bf5ef4a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -824,34 +824,6 @@ dna.remove_mutation(HM.name) ..() -/mob/living/carbon/human/proc/influenceSin() - var/datum/objective/sintouched/O - switch(rand(1,7))//traditional seven deadly sins... except lust. - if(1) // acedia - log_game("[src] was influenced by the sin of Acedia.") - O = new /datum/objective/sintouched/acedia - if(2) // Gluttony - log_game("[src] was influenced by the sin of gluttony.") - O = new /datum/objective/sintouched/gluttony - if(3) // Greed - log_game("[src] was influenced by the sin of greed.") - O = new /datum/objective/sintouched/greed - if(4) // sloth - log_game("[src] was influenced by the sin of sloth.") - O = new /datum/objective/sintouched/sloth - if(5) // Wrath - log_game("[src] was influenced by the sin of wrath.") - O = new /datum/objective/sintouched/wrath - if(6) // Envy - log_game("[src] was influenced by the sin of envy.") - O = new /datum/objective/sintouched/envy - if(7) // Pride - log_game("[src] was influenced by the sin of pride.") - O = new /datum/objective/sintouched/pride - SSticker.mode.sintouched += src.mind - src.mind.objectives += O - src.mind.announce_objectives() - /mob/living/carbon/human/check_weakness(obj/item/weapon, mob/living/attacker) . = ..() if (dna && dna.species) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 933c25c992..2a0ac731cf 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -927,10 +927,9 @@ return 1 /mob/living/proc/check_acedia() - if(src.mind && src.mind.objectives) - for(var/datum/objective/sintouched/acedia/A in src.mind.objectives) - return 1 - return 0 + if(mind && mind.has_objective(/datum/objective/sintouched/acedia)) + return TRUE + return FALSE /mob/living/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) stop_pulling() diff --git a/code/modules/spells/spell_types/devil.dm b/code/modules/spells/spell_types/devil.dm index fed720ca1a..4f828e8580 100644 --- a/code/modules/spells/spell_types/devil.dm +++ b/code/modules/spells/spell_types/devil.dm @@ -193,11 +193,11 @@ for(var/mob/living/carbon/human/H in targets) if(!H.mind) continue - if(locate(/datum/objective/sintouched) in H.mind.objectives) + if(H.mind.has_antag_datum(/datum/antagonist/sintouched)) continue if(H.anti_magic_check(FALSE, TRUE)) continue - H.influenceSin() + H.mind.add_antag_datum(/datum/antagonist/sintouched) H.Knockdown(400) diff --git a/tgstation.dme b/tgstation.dme index 4a19c03366..07746da3b9 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1200,6 +1200,7 @@ #include "code\modules\antagonists\devil\devil_helpers.dm" #include "code\modules\antagonists\devil\imp\imp.dm" #include "code\modules\antagonists\devil\sintouched\objectives.dm" +#include "code\modules\antagonists\devil\sintouched\sintouched.dm" #include "code\modules\antagonists\devil\true_devil\_true_devil.dm" #include "code\modules\antagonists\devil\true_devil\inventory.dm" #include "code\modules\antagonists\disease\disease_abilities.dm"