Merge pull request #807 from Citadel-Station-13/upstream-merge-26631

[MIRROR] 2017 Cult Overhaul P1:  Cult Master and Datum Cult
This commit is contained in:
LetterJay
2017-05-16 17:13:30 -04:00
committed by GitHub
28 changed files with 834 additions and 200 deletions
+61 -7
View File
@@ -5,6 +5,51 @@
qdel(communion)
return ..()
/datum/antagonist/cult/proc/add_objectives()
var/list/target_candidates = list()
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(player.mind && !is_convertable_to_cult(player) && (player != owner) && isliving(player))
target_candidates += player.mind
if(target_candidates.len == 0)
message_admins("Cult Sacrifice: Could not find unconvertable target, checking for convertable target.")
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(player.mind && (player != owner) && isliving(player))
target_candidates += player.mind
if(target_candidates.len > 0)
GLOB.sac_mind = pick(target_candidates)
if(!GLOB.sac_mind)
message_admins("Cult Sacrifice: ERROR - Null target chosen!")
else
var/datum/job/sacjob = SSjob.GetJob(GLOB.sac_mind.assigned_role)
var/datum/preferences/sacface = GLOB.sac_mind.current.client.prefs
var/icon/reshape = get_flat_human_icon(null, sacjob, sacface)
reshape.Shift(SOUTH, 4)
reshape.Shift(EAST, 1)
reshape.Crop(7,4,26,31)
reshape.Crop(-5,-3,26,30)
GLOB.sac_image = reshape
else
message_admins("Cult Sacrifice: Could not find unconvertable or convertable target. WELP!")
GLOB.sac_complete = TRUE
SSticker.mode.cult_objectives += "sacrifice"
SSticker.mode.cult_objectives += "eldergod"
on_gain()
/datum/antagonist/cult/proc/cult_memorization(datum/mind/cult_mind)
var/mob/living/current = cult_mind.current
for(var/obj_count = 1,obj_count <= SSticker.mode.cult_objectives.len,obj_count++)
var/explanation
switch(SSticker.mode.cult_objectives[obj_count])
if("sacrifice")
if(GLOB.sac_mind)
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role] via invoking a Sacrifice rune with them on it and three acolytes around it."
else
explanation = "The veil has already been weakened here, proceed to the final objective."
if("eldergod")
explanation = "Summon Nar-Sie by invoking the rune 'Summon Nar-Sie' with nine acolytes on it. You must do this after sacrificing your target."
to_chat(current, "<B>Objective #[obj_count]</B>: [explanation]")
cult_mind.memory += "<B>Objective #[obj_count]</B>: [explanation]<BR>"
/datum/antagonist/cult/can_be_owned(datum/mind/new_owner)
. = ..()
if(.)
@@ -12,14 +57,17 @@
/datum/antagonist/cult/on_gain()
. = ..()
SSticker.mode.cult += owner
var/mob/living/current = owner.current
if(SSticker.mode.cult_objectives.len == 0)
add_objectives()
return
SSticker.mode.cult += owner // Only add after they've been given objectives
cult_memorization(owner)
if(jobban_isbanned(current, ROLE_CULTIST))
addtimer(CALLBACK(SSticker.mode, /datum/game_mode.proc/replace_jobbaned_player, current, ROLE_CULTIST, ROLE_CULTIST), 0)
SSticker.mode.update_cult_icons_added(owner)
if(istype(SSticker.mode, /datum/game_mode/cult))
var/datum/game_mode/cult/C = SSticker.mode
C.memorize_cult_objectives(owner)
if(jobban_isbanned(owner.current, ROLE_CULTIST))
addtimer(CALLBACK(SSticker.mode, /datum/game_mode.proc/replace_jobbaned_player, owner.current, ROLE_CULTIST, ROLE_CULTIST), 0)
owner.current.log_message("<font color=#960000>Has been converted to the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
current.throw_alert("bloodsense", /obj/screen/alert/bloodsense)
current.log_message("<font color=#960000>Has been converted to the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
/datum/antagonist/cult/apply_innate_effects(mob/living/mob_override)
. = ..()
@@ -28,6 +76,8 @@
current = mob_override
current.faction |= "cult"
current.verbs += /mob/living/proc/cult_help
if(!GLOB.cult_mastered)
current.verbs += /mob/living/proc/cult_master
communion.Grant(current)
/datum/antagonist/cult/remove_innate_effects(mob/living/mob_override)
@@ -38,6 +88,10 @@
current.faction -= "cult"
current.verbs -= /mob/living/proc/cult_help
communion.Remove(current)
owner.current.verbs -= /mob/living/proc/cult_master
for(var/datum/action/innate/cultmast/H in owner.current.actions)
qdel(H)
current.clear_alert("bloodsense")
/datum/antagonist/cult/on_removal()
owner.wipe_memory()
@@ -0,0 +1,9 @@
diff a/code/datums/antagonists/datum_cult.dm b/code/datums/antagonists/datum_cult.dm (rejected hunks)
@@ -65,6 +65,7 @@
cult_memorization(owner)
if(jobban_isbanned(current, ROLE_CULTIST))
addtimer(CALLBACK(SSticker.mode, /datum/game_mode.proc/replace_jobbaned_player, current, ROLE_CULTIST, ROLE_CULTIST), 0)
+ SSticker.mode.update_cult_icons_added(owner)
current.throw_alert("bloodsense", /obj/screen/alert/bloodsense)
current.log_message("<font color=#960000>Has been converted to the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
+60 -67
View File
@@ -52,7 +52,7 @@
var/linglink
var/miming = 0 // Mime's vow of silence
var/list/antag_datums
var/list/antag_datums
var/antag_hud_icon_state = null //this mind's ANTAG_HUD should have this icon_state
var/datum/atom_hud/antag/antag_hud = null //this mind's antag HUD
var/datum/gang/gang_datum //Which gang this mind belongs to, if any
@@ -69,10 +69,10 @@
/datum/mind/Destroy()
SSticker.minds -= src
if(islist(antag_datums))
for(var/i in antag_datums)
qdel(i)
antag_datums = null
if(islist(antag_datums))
for(var/i in antag_datums)
qdel(i)
antag_datums = null
return ..()
/datum/mind/proc/transfer_to(mob/new_character, var/force_key_move = 0)
@@ -90,12 +90,12 @@
new_character.mind.current = null
var/datum/atom_hud/antag/hud_to_transfer = antag_hud//we need this because leave_hud() will clear this list
var/mob/living/old_current = current
var/mob/living/old_current = current
current = new_character //associate ourself with our new body
new_character.mind = src //and associate our new body with ourself
for(var/a in antag_datums) //Makes sure all antag datums effects are applied in the new body
var/datum/antagonist/A = a
A.on_body_transfer(old_current, current)
for(var/a in antag_datums) //Makes sure all antag datums effects are applied in the new body
var/datum/antagonist/A = a
A.on_body_transfer(old_current, current)
if(iscarbon(new_character))
var/mob/living/carbon/C = new_character
C.last_mind = src
@@ -111,42 +111,42 @@
/datum/mind/proc/wipe_memory()
memory = null
// Datum antag mind procs
/datum/mind/proc/add_antag_datum(datum_type)
if(!datum_type)
return
var/datum/antagonist/A = new datum_type(src)
if(!A.can_be_owned(src))
qdel(A)
return
LAZYADD(antag_datums, A)
A.on_gain()
return A
/datum/mind/proc/remove_antag_datum(datum_type)
if(!datum_type)
return
var/datum/antagonist/A = has_antag_datum(datum_type)
if(A)
A.on_removal()
return TRUE
/datum/mind/proc/remove_all_antag_datums() //For the Lazy amongst us.
for(var/a in antag_datums)
var/datum/antagonist/A = a
A.on_removal()
/datum/mind/proc/has_antag_datum(datum_type, check_subtypes = TRUE)
if(!datum_type)
return
. = FALSE
for(var/a in antag_datums)
var/datum/antagonist/A = a
if(check_subtypes && istype(A, datum_type))
return A
else if(A.type == datum_type)
return A
// Datum antag mind procs
/datum/mind/proc/add_antag_datum(datum_type)
if(!datum_type)
return
var/datum/antagonist/A = new datum_type(src)
if(!A.can_be_owned(src))
qdel(A)
return
LAZYADD(antag_datums, A)
A.on_gain()
return A
/datum/mind/proc/remove_antag_datum(datum_type)
if(!datum_type)
return
var/datum/antagonist/A = has_antag_datum(datum_type)
if(A)
A.on_removal()
return TRUE
/datum/mind/proc/remove_all_antag_datums() //For the Lazy amongst us.
for(var/a in antag_datums)
var/datum/antagonist/A = a
A.on_removal()
/datum/mind/proc/has_antag_datum(datum_type, check_subtypes = TRUE)
if(!datum_type)
return
. = FALSE
for(var/a in antag_datums)
var/datum/antagonist/A = a
if(check_subtypes && istype(A, datum_type))
return A
else if(A.type == datum_type)
return A
/*
Removes antag type's references from a mind.
objectives, uplinks, powers etc are all handled.
@@ -293,7 +293,7 @@
to_chat(recipient, "<i>[output]</i>")
/datum/mind/proc/edit_memory()
if(!SSticker.HasRoundStarted())
if(!SSticker.HasRoundStarted())
alert("Not before round-start!", "Alert")
return
@@ -1181,7 +1181,7 @@
log_admin("[key_name_admin(usr)] has made [current] unable to ascend as a devil.")
return
if(!ishuman(current) && !iscyborg(current))
to_chat(usr, "<span class='warning'>This only works on humans and cyborgs!</span>")
to_chat(usr, "<span class='warning'>This only works on humans and cyborgs!</span>")
return
SSticker.mode.devils += src
special_role = "devil"
@@ -1230,17 +1230,17 @@
log_admin("[key_name(usr)] turned [current] into abductor.")
SSticker.mode.update_abductor_icons_added(src)
if("equip")
if(!ishuman(current))
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
return
var/mob/living/carbon/human/H = current
if(!ishuman(current))
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
return
var/mob/living/carbon/human/H = current
var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist")
if(gear)
if(gear=="Agent")
H.equipOutfit(/datum/outfit/abductor/agent)
H.equipOutfit(/datum/outfit/abductor/agent)
else
H.equipOutfit(/datum/outfit/abductor/scientist)
H.equipOutfit(/datum/outfit/abductor/scientist)
else if (href_list["monkey"])
var/mob/living/L = current
@@ -1437,15 +1437,8 @@
special_role = "Cultist"
to_chat(current, "<font color=\"purple\"><b><i>You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.</b></i></font>")
to_chat(current, "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>")
var/datum/game_mode/cult/cult = SSticker.mode
if (istype(cult))
cult.memorize_cult_objectives(src)
else
var/explanation = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it."
to_chat(current, "<B>Objective #1</B>: [explanation]")
memory += "<B>Objective #1</B>: [explanation]<BR>"
var/datum/antagonist/cult/C
C.cult_memorization(src)
var/mob/living/carbon/human/H = current
if (!SSticker.mode.equip_cultist(current))
to_chat(H, "Spawning an amulet from your Master failed.")
@@ -1509,8 +1502,8 @@
H.set_species(/datum/species/abductor)
var/datum/species/abductor/S = H.dna.species
if(role == "Scientist")
S.scientist = TRUE
if(role == "Scientist")
S.scientist = TRUE
S.team = team
var/list/obj/effect/landmark/abductor/agent_landmarks = new
@@ -1529,8 +1522,8 @@
if("Agent")
L = agent_landmarks[team]
if("Scientist")
L = scientist_landmarks[team]
H.forceMove(L.loc)
L = scientist_landmarks[team]
H.forceMove(L.loc)
/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
spell_list += S
+29
View File
@@ -228,3 +228,32 @@
name = "Wish Granter's Immortality"
desc = "You are being resurrected!"
icon_state = "wish_granter"
/datum/status_effect/cult_master
id = "The Cult Master"
duration = -1
tick_interval = 100
alert_type = null
var/alive = TRUE
/datum/status_effect/cult_master/proc/deathrattle()
var/area/A = get_area(owner)
for(var/datum/mind/B in SSticker.mode.cult)
if(isliving(B.current))
var/mob/living/M = B.current
M << 'sound/hallucinations/veryfar_noise.ogg'
to_chat(M, "<span class='cultlarge'>The Cult's Master, [owner], has fallen in the [A]!")
/datum/status_effect/cult_master/tick()
if(owner.stat != DEAD && !alive)
alive = TRUE
return
if(owner.stat == DEAD && alive)
alive = FALSE
deathrattle()
/datum/status_effect/cult_master/on_remove()
deathrattle()
. = ..()