Fixes a bunch more cult bugs (#27034)

This commit is contained in:
Joan Lung
2017-05-08 12:17:40 -04:00
committed by Leo
parent dcf7030e98
commit 8b912f84aa
10 changed files with 144 additions and 137 deletions

View File

@@ -424,7 +424,7 @@
switch(ignore_category ? askuser(M,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(M,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time))
if(1)
to_chat(M, "<span class='notice'>Choice registered: Yes.</span>")
if((world.time-time_passed)>poll_time)
if(time_passed + poll_time <= world.time)
to_chat(M, "<span class='danger'>Sorry, you answered too late to be considered!</span>")
M << 'sound/machines/buzz-sigh.ogg'
candidates -= M
@@ -501,53 +501,6 @@
++i
return L
/proc/pollCultists(var/mob/living/Nominee) // Cult Master Poll
if(world.time < CULT_POLL_WAIT)
to_chat(Nominee, "It would be premature to select a leader while everyone is still settling in, try again in [round((CULT_POLL_WAIT-world.time)/10)] seconds.")
return
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.verbs -= /mob/living/proc/cult_master
if(!B.current.incapacitated())
B.current << 'sound/hallucinations/im_here1.ogg'
to_chat(B.current, "<span class='cultlarge'>Acolyte [Nominee] has asserted that they are worthy of leading the cult. A vote will be called shortly.</span>")
sleep(250)
var/list/asked_cultists = list()
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current && B.current != Nominee && !B.current.incapacitated())
B.current << 'sound/magic/exit_blood.ogg'
asked_cultists += B.current
var/list/yes_voters = pollCandidates("[Nominee] seeks to lead your cult, do you support [Nominee.p_them()]?", poll_time = 1200, group = asked_cultists)
sleep(300)
if(QDELETED(Nominee) || Nominee.incapacitated())
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.verbs += /mob/living/proc/cult_master
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has died in the process of attempting to win the cult's support!")
return FALSE
if(!Nominee.mind)
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.verbs += /mob/living/proc/cult_master
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has gone insane and catatonic in the process of attempting to win the cult's support!")
return FALSE
if(LAZYLEN(yes_voters) <= LAZYLEN(asked_cultists) * 0.5)
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.verbs += /mob/living/proc/cult_master
if(!B.current.incapacitated())
to_chat(B.current, "<span class='cultlarge'>[Nominee] could not win the cult's support and shall continue to serve as an acolyte.")
return FALSE
SSticker.mode.remove_cultist(Nominee.mind, FALSE)
Nominee.mind.add_antag_datum(ANTAG_DATUM_CULT_MASTER)
GLOB.cult_mastered = TRUE
for(var/datum/mind/B in SSticker.mode.cult)
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has won the cult's support and is now their master. Follow [Nominee.p_their()] orders to the best of your ability!")
return TRUE
/proc/poll_helper(var/mob/living/M)
/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character

View File

@@ -9,6 +9,7 @@ GLOBAL_VAR_INIT(blood_target, null) // Cult Master's target or Construct's Maste
GLOBAL_DATUM(blood_target_image, /image)
GLOBAL_DATUM(sac_mind, /datum/mind)
GLOBAL_VAR_INIT(sac_image, null)
GLOBAL_VAR_INIT(cult_vote_called, FALSE)
GLOBAL_VAR_INIT(cult_mastered, FALSE)
GLOBAL_VAR_INIT(reckoning_complete, FALSE)
GLOBAL_VAR_INIT(sac_complete, FALSE)

View File

@@ -290,27 +290,28 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
if(Cviewer)
if(Cviewer.seeking && Cviewer.master)
blood_target = Cviewer.master
if(!blood_target && !GLOB.sac_complete)
if(icon_state == "runed_sense0")
return
animate(src, transform = null, time = 1, loop = 0)
angle = 0
cut_overlays()
icon_state = "runed_sense0"
desc = "Nar-Sie demands that [GLOB.sac_mind] be sacrificed before the summoning ritual can begin."
add_overlay(GLOB.sac_image)
return
if(!blood_target && GLOB.sac_complete)
if(icon_state == "runed_sense1")
return
animate(src, transform = null, time = 1, loop = 0)
angle = 0
cut_overlays()
icon_state = "runed_sense1"
desc = "The sacrifice is complete, prepare to summon Nar-Sie!"
add_overlay(narnar)
return
if(!blood_target)
if(!GLOB.sac_complete)
if(icon_state == "runed_sense0")
return
animate(src, transform = null, time = 1, loop = 0)
angle = 0
cut_overlays()
icon_state = "runed_sense0"
desc = "Nar-Sie demands that [GLOB.sac_mind] be sacrificed before the summoning ritual can begin."
add_overlay(GLOB.sac_image)
else
if(SSticker.mode.eldergod)
desc = "The sacrifice is complete, prepare to summon Nar-Sie!"
else
desc = "The summoning is complete, glory to Nar-Sie!"
if(icon_state == "runed_sense1")
return
animate(src, transform = null, time = 1, loop = 0)
angle = 0
cut_overlays()
icon_state = "runed_sense1"
add_overlay(narnar)
return
var/turf/P = get_turf(blood_target)
var/turf/Q = get_turf(mob_viewer)

View File

@@ -1,8 +1,10 @@
/datum/antagonist/cult
var/datum/action/innate/cultcomm/communion = new
var/datum/action/innate/cult/comm/communion = new
var/datum/action/innate/cult/mastervote/vote = new
/datum/antagonist/cult/Destroy()
QDEL_NULL(communion)
QDEL_NULL(vote)
return ..()
/datum/antagonist/cult/proc/add_objectives()
@@ -79,7 +81,7 @@
current.grant_language(/datum/language/narsie)
current.verbs += /mob/living/proc/cult_help
if(!GLOB.cult_mastered)
current.verbs += /mob/living/proc/cult_master
vote.Grant(current)
communion.Grant(current)
current.throw_alert("bloodsense", /obj/screen/alert/bloodsense)
@@ -91,10 +93,8 @@
current.faction -= "cult"
current.remove_language(/datum/language/narsie)
current.verbs -= /mob/living/proc/cult_help
vote.Remove(current)
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()
@@ -110,8 +110,8 @@
. = ..()
/datum/antagonist/cult/master
var/datum/action/innate/cultmast/finalreck/reckoning = new
var/datum/action/innate/cultmast/cultmark/bloodmark = new
var/datum/action/innate/cult/master/finalreck/reckoning = new
var/datum/action/innate/cult/master/cultmark/bloodmark = new
/datum/antagonist/cult/master/Destroy()
QDEL_NULL(reckoning)

View File

@@ -169,7 +169,7 @@
opentime = 0
/datum/browser/alert/proc/wait()
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout >= world.time))
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time))
stoplag()
/datum/browser/alert/Topic(href,href_list)

View File

@@ -152,12 +152,12 @@
cult_mind.current.Paralyse(5)
return 1
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1, stun)
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, silent, stun)
if(cult_mind.current)
var/datum/antagonist/cult/cult_datum = cult_mind.has_antag_datum(ANTAG_DATUM_CULT)
if(!cult_datum)
return FALSE
cult_datum.silent = show_message
cult_datum.silent = silent
cult_datum.on_removal()
if(stun)
cult_mind.current.Paralyse(5)
@@ -187,7 +187,7 @@
if(cult_objectives.Find("eldergod"))
cult_fail += eldergod //1 by default, 0 if the elder god has been summoned at least once
if(cult_objectives.Find("sacrifice"))
if(GLOB.sac_mind && GLOB.sac_complete) //if the target has been GLOB.sacrificed, ignore this step. otherwise, add 1 to cult_fail
if(GLOB.sac_mind && !GLOB.sac_complete) //if the target has been GLOB.sacrificed, ignore this step. otherwise, add 1 to cult_fail
cult_fail++
return cult_fail //if any objectives aren't met, failure

View File

@@ -1,19 +1,21 @@
// Contains cult communion, guide, and cult master abilities
#define MARK_COOLDOWN
/datum/action/innate/cultcomm
name = "Communion"
button_icon_state = "cult_comms"
/datum/action/innate/cult
background_icon_state = "bg_demon"
buttontooltipstyle = "cult"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
/datum/action/innate/cultcomm/IsAvailable()
/datum/action/innate/cult/IsAvailable()
if(!iscultist(owner))
return 0
return FALSE
return ..()
/datum/action/innate/cultcomm/Activate()
/datum/action/innate/cult/comm
name = "Communion"
button_icon_state = "cult_comms"
/datum/action/innate/cult/comm/Activate()
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
if(!input || !IsAvailable())
return
@@ -84,22 +86,82 @@
set name = "Assert Leadership"
pollCultists(src) // This proc handles the distribution of cult master actions
/datum/action/innate/cultmast
background_icon_state = "bg_demon"
buttontooltipstyle = "cult"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
/datum/action/innate/cult/mastervote
name = "Assert Leadership"
button_icon_state = "cultvote"
/datum/action/innate/cultmast/IsAvailable()
/datum/action/innate/cult/mastervote/IsAvailable()
if(GLOB.cult_vote_called)
return FALSE
return ..()
/datum/action/innate/cult/mastervote/Activate()
pollCultists(owner)
/proc/pollCultists(var/mob/living/Nominee) //Cult Master Poll
if(world.time < CULT_POLL_WAIT)
to_chat(Nominee, "It would be premature to select a leader while everyone is still settling in, try again in [round((CULT_POLL_WAIT-world.time)/10)] seconds.")
return
GLOB.cult_vote_called = TRUE //somebody's trying to be a master, make sure we don't let anyone else try
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.update_action_buttons_icon()
if(!B.current.incapacitated())
B.current << 'sound/hallucinations/im_here1.ogg'
to_chat(B.current, "<span class='cultlarge'>Acolyte [Nominee] has asserted that they are worthy of leading the cult. A vote will be called shortly.</span>")
sleep(100)
var/list/asked_cultists = list()
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current && B.current != Nominee && !B.current.incapacitated())
B.current << 'sound/magic/exit_blood.ogg'
asked_cultists += B.current
var/list/yes_voters = pollCandidates("[Nominee] seeks to lead your cult, do you support [Nominee.p_them()]?", poll_time = 300, group = asked_cultists)
if(QDELETED(Nominee) || Nominee.incapacitated())
GLOB.cult_vote_called = FALSE
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.update_action_buttons_icon()
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has died in the process of attempting to win the cult's support!")
return FALSE
if(!Nominee.mind)
GLOB.cult_vote_called = FALSE
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.update_action_buttons_icon()
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has gone catatonic in the process of attempting to win the cult's support!")
return FALSE
if(LAZYLEN(yes_voters) <= LAZYLEN(asked_cultists) * 0.5)
GLOB.cult_vote_called = FALSE
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
B.current.update_action_buttons_icon()
if(!B.current.incapacitated())
to_chat(B.current, "<span class='cultlarge'>[Nominee] could not win the cult's support and shall continue to serve as an acolyte.")
return FALSE
GLOB.cult_mastered = TRUE
SSticker.mode.remove_cultist(Nominee.mind, FALSE)
Nominee.mind.add_antag_datum(ANTAG_DATUM_CULT_MASTER)
for(var/datum/mind/B in SSticker.mode.cult)
if(B.current)
for(var/datum/action/innate/cult/mastervote/vote in B.current.actions)
vote.Remove(B.current)
if(!B.current.incapacitated())
to_chat(B.current,"<span class='cultlarge'>[Nominee] has won the cult's support and is now their master. Follow [Nominee.p_their()] orders to the best of your ability!")
return TRUE
/datum/action/innate/cult/master/IsAvailable()
if(!owner.mind || !owner.mind.has_antag_datum(ANTAG_DATUM_CULT_MASTER))
return 0
return ..()
/datum/action/innate/cultmast/finalreck
/datum/action/innate/cult/master/finalreck
name = "Final Reckoning"
desc = "A single-use spell that brings the entire cult to the master's location."
button_icon_state = "sintouch"
/datum/action/innate/cultmast/finalreck/Activate()
/datum/action/innate/cult/master/finalreck/Activate()
for(var/i in 1 to 4)
chant(i)
var/list/destinations = list()
@@ -126,8 +188,11 @@
if(4)
playsound(mobloc, 'sound/magic/exit_blood.ogg', 100, 1)
if(B.current != owner)
B.current.setDir(SOUTH)
var/turf/final = pick(destinations)
if(istype(B.current.loc, /obj/item/device/soulstone))
var/obj/item/device/soulstone/S = B.current.loc
S.release_shades(owner)
B.current.setDir(SOUTH)
new /obj/effect/overlay/temp/cult/blood(final)
addtimer(CALLBACK(B.current, /mob/.proc/reckon, final), 10)
else
@@ -139,7 +204,7 @@
new /obj/effect/overlay/temp/cult/blood/out(get_turf(src))
forceMove(final)
/datum/action/innate/cultmast/finalreck/proc/chant(chant_number)
/datum/action/innate/cult/master/finalreck/proc/chant(chant_number)
switch(chant_number)
if(1)
owner.say("C'arta forbici!", language = /datum/language/common)
@@ -153,7 +218,7 @@
owner.say("N'ath reth sh'yro eth d'rekkathnor!!!", language = /datum/language/common)
playsound(get_turf(owner),'sound/magic/clockwork/narsie_attack.ogg', 100, 1)
/datum/action/innate/cultmast/cultmark
/datum/action/innate/cult/master/cultmark
name = "Mark Target"
desc = "Marks a target for the cult."
button_icon_state = "cult_mark"
@@ -161,32 +226,32 @@
var/cooldown = 0
var/base_cooldown = 1200
/datum/action/innate/cultmast/cultmark/New()
/datum/action/innate/cult/master/cultmark/New()
CM = new()
CM.attached_action = src
..()
/datum/action/innate/cultmast/cultmark/IsAvailable()
/datum/action/innate/cult/master/cultmark/IsAvailable()
if(!owner.mind || !owner.mind.has_antag_datum(ANTAG_DATUM_CULT_MASTER))
return 0
return FALSE
if(cooldown > world.time)
if(!CM.active)
owner << "<span class='cultlarge'><b>You need to wait [round((cooldown - world.time) * 0.1)] seconds before you can mark another target!</b></span>"
return 0
return FALSE
return ..()
/datum/action/innate/cultmast/cultmark/Destroy()
/datum/action/innate/cult/master/cultmark/Destroy()
QDEL_NULL(CM)
return ..()
/datum/action/innate/cultmast/cultmark/Activate()
/datum/action/innate/cult/master/cultmark/Activate()
CM.toggle(owner) //the important bit
return TRUE
/obj/effect/proc_holder/cultmark
active = FALSE
ranged_mousepointer = 'icons/effects/cult_target.dmi'
var/datum/action/innate/cultmast/cultmark/attached_action
var/datum/action/innate/cult/master/cultmark/attached_action
/obj/effect/proc_holder/cultmark/Destroy()
attached_action = null

View File

@@ -29,13 +29,13 @@ To draw a rune, use an arcane tome.
var/invocation = "Aiy ele-mayo!" //This is said by cultists when the rune is invoked.
var/req_cultists = 1 //The amount of cultists required around the rune to invoke it. If only 1, any cultist can invoke it.
var/req_cultists_text //if we have a description override for required cultists to invoke
var/rune_in_use = 0 // Used for some runes, this is for when you want a rune to not be usable when in use.
var/rune_in_use = FALSE // Used for some runes, this is for when you want a rune to not be usable when in use.
var/scribe_delay = 50 //how long the rune takes to create
var/scribe_damage = 0.1 //how much damage you take doing it
var/allow_excess_invokers = 0 //if we allow excess invokers when being invoked
var/construct_invoke = 1 //if constructs can invoke it
var/allow_excess_invokers = FALSE //if we allow excess invokers when being invoked
var/construct_invoke = TRUE //if constructs can invoke it
var/req_keyword = 0 //If the rune requires a keyword - go figure amirite
var/keyword //The actual keyword for the rune
@@ -229,14 +229,12 @@ structure_check() searches for nearby cultist structures required for the invoca
var/obj/item/weapon/paper/paper_to_imbue = papers_on_rune[1]
..()
visible_message("<span class='warning'>Dark power begins to channel into the paper!</span>")
rune_in_use = 1
if(!do_after(user, initial(talisman_type.creation_time), target = paper_to_imbue))
rune_in_use = 0
return
new talisman_type(get_turf(src))
visible_message("<span class='warning'>[src] glows with power, and bloody images form themselves on [paper_to_imbue].</span>")
qdel(paper_to_imbue)
rune_in_use = 0
rune_in_use = TRUE
if(do_after(user, initial(talisman_type.creation_time), target = paper_to_imbue))
new talisman_type(get_turf(src))
visible_message("<span class='warning'>[src] glows with power, and bloody images form themselves on [paper_to_imbue].</span>")
qdel(paper_to_imbue)
rune_in_use = FALSE
/obj/effect/rune/imbue/proc/checkpapers()
. = list()
@@ -250,7 +248,7 @@ structure_check() searches for nearby cultist structures required for the invoca
invocation = "Sas'so c'arta forbici!"
icon_state = "2"
color = "#551A8B"
req_keyword = 1
req_keyword = TRUE
var/listkey
/obj/effect/rune/teleport/Initialize(mapload, set_keyword)
@@ -297,15 +295,15 @@ structure_check() searches for nearby cultist structures required for the invoca
to_chat(user, "<span class='warning'>The target rune is blocked. Attempting to teleport to it would be massively unwise.</span>")
fail_invoke()
return
var/movedsomething = 0
var/moveuserlater = 0
var/movedsomething = FALSE
var/moveuserlater = FALSE
for(var/atom/movable/A in T)
if(A == user)
moveuserlater = 1
movedsomething = 1
moveuserlater = TRUE
movedsomething = TRUE
continue
if(!A.anchored)
movedsomething = 1
movedsomething = TRUE
A.forceMove(target)
if(movedsomething)
..()
@@ -326,7 +324,7 @@ structure_check() searches for nearby cultist structures required for the invoca
icon_state = "3"
color = "#FFFFFF"
req_cultists = 1
allow_excess_invokers = 1
allow_excess_invokers = TRUE
rune_in_use = FALSE
/obj/effect/rune/convert/do_invoke_glow()
@@ -450,8 +448,7 @@ structure_check() searches for nearby cultist structures required for the invoca
pixel_y = -32
scribe_delay = 450 //how long the rune takes to create
scribe_damage = 40.1 //how much damage you take doing it
var/used
var/ignore_gamemode = TRUE
var/used = FALSE
/obj/effect/rune/narsie/Initialize(mapload, set_keyword)
. = ..()
@@ -470,33 +467,20 @@ structure_check() searches for nearby cultist structures required for the invoca
if(z != ZLEVEL_STATION)
return
var/datum/game_mode/cult/cult_mode
if(SSticker.mode.name == "cult")
cult_mode = SSticker.mode
if(!cult_mode && !ignore_gamemode)
for(var/M in invokers)
to_chat(M, "<span class='warning'>Nar-Sie does not respond!</span>")
fail_invoke()
log_game("Summon Nar-Sie rune failed - gametype is not cult")
return
if(locate(/obj/singularity/narsie) in GLOB.poi_list)
for(var/M in invokers)
to_chat(M, "<span class='warning'>Nar-Sie is already on this plane!</span>")
log_game("Summon Nar-Sie rune failed - already summoned")
return
//BEGIN THE SUMMONING
used = 1
used = TRUE
..()
send_to_playing_players('sound/effects/dimensional_rend.ogg')
var/turf/T = get_turf(src)
sleep(40)
if(src)
color = "#FF0000"
if(cult_mode)
cult_mode.eldergod = 0
SSticker.mode.eldergod = FALSE
new /obj/singularity/narsie/large(T) //Causes Nar-Sie to spawn even if the rune has been removed
/obj/effect/rune/narsie/attackby(obj/I, mob/user, params) //Since the narsie rune takes a long time to make, add logging to removal.

View File

@@ -69,6 +69,9 @@
user.Paralyse(5)
to_chat(user, "<span class='userdanger'>Your body is wracked with debilitating pain!</span>")
return
release_shades(user)
/obj/item/device/soulstone/proc/release_shades(mob/user)
for(var/mob/living/simple_animal/shade/A in src)
A.status_flags &= ~GODMODE
A.canmove = 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB