Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Nar'Sie Only Ends The Round After Specific Proc Is Called #990

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
// /obj/item
#define VV_HK_ADD_FANTASY_AFFIX "add_fantasy_affix"

// /obj/narsie
#define VV_HK_BEGIN_NARSIE_ROUNDEND "begin_narsie_roundend"

// /mob
#define VV_HK_GIB "gib"
#define VV_HK_GIVE_MOB_ACTION "give_mob_action"
Expand Down
4 changes: 3 additions & 1 deletion code/modules/antagonists/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@ GLOBAL_VAR_INIT(narsie_summon_count, 0)
sleep(4 SECONDS)
if(src)
color = RUNE_COLOR_RED
new /obj/narsie(rune_turf) //Causes Nar'Sie to spawn even if the rune has been removed

var/obj/narsie/harbinger = new /obj/narsie(rune_turf) //Causes Nar'Sie to spawn even if the rune has been removed
harbinger.start_ending_the_round()

//Rite of Resurrection: Requires a dead or inactive cultist. When reviving the dead, you can only perform one revival for every three sacrifices your cult has carried out.
/obj/effect/rune/raise_dead
Expand Down
50 changes: 40 additions & 10 deletions code/modules/power/singularity/narsie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define NARSIE_MESMERIZE_EFFECT 60
#define NARSIE_SINGULARITY_SIZE 12

#define ADMIN_WARNING_MESSAGE "Invoking this will begin the Nar'Sie roundender. Assume that this WILL end the round in a few minutes. Are you sure?"

/// Nar'Sie, the God of the blood cultists
/obj/narsie
name = "Nar'Sie"
Expand Down Expand Up @@ -39,6 +41,19 @@
/obj/narsie/Initialize(mapload)
. = ..()

narsie_spawn_animation()

/obj/narsie/Destroy()
if (GLOB.cult_narsie == src)
fall_of_the_harbinger()
GLOB.cult_narsie = null

return ..()

/// This proc sets up all of Nar'Sie's abilities, stats, and begins her round-ending capabilities. She does not do anything unless this proc is invoked.
/// This is only meant to be invoked after this instance is initialized in specific pro-sumer procs, as it WILL derail the entire round.
/obj/narsie/proc/start_ending_the_round()
GLOB.cult_narsie = src
SSpoints_of_interest.make_point_of_interest(src)

singularity = WEAKREF(AddComponent(
Expand Down Expand Up @@ -66,9 +81,6 @@
alert_overlay = alert_overlay,
)

narsie_spawn_animation()

GLOB.cult_narsie = src
var/list/all_cults = list()

for (var/datum/antagonist/cult/cultist in GLOB.antagonists)
Expand All @@ -95,10 +107,8 @@
soul_goal = round(1 + LAZYLEN(souls_needed) * 0.75)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(begin_the_end))

/obj/narsie/Destroy()
send_to_playing_players(span_narsie("\"<b>[pick("Nooooo...", "Not die. How-", "Die. Mort-", "Sas tyen re-")]\"</b>"))
sound_to_playing_players('sound/magic/demon_dies.ogg', 50)

/// Cleans up all of Nar'Sie's abilities, stats, and ends her round-ending capabilities. This should only be called if `start_ending_the_round()` successfully started.
/obj/narsie/proc/fall_of_the_harbinger()
var/list/all_cults = list()

for (var/datum/antagonist/cult/cultist in GLOB.antagonists)
Expand All @@ -113,10 +123,28 @@
summon_objective.summoned = FALSE
summon_objective.killed = TRUE

if (GLOB.cult_narsie == src)
GLOB.cult_narsie = null
send_to_playing_players(span_narsie(span_bold(pick("Nooooo...", "Not die. How-", "Die. Mort-", "Sas tyen re-"))))
sound_to_playing_players('sound/magic/demon_dies.ogg', 50)

return ..()
/obj/narsie/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION("", "---------")
VV_DROPDOWN_OPTION(VV_HK_BEGIN_NARSIE_ROUNDEND, "Begin Nar'Sie Roundender")

/obj/narsie/vv_do_topic(list/href_list)
. = ..()

if(!.)
return

if(isnull(usr) || !href_list[VV_HK_BEGIN_NARSIE_ROUNDEND] || !check_rights(R_FUN, show_msg = TRUE))
return

if(tgui_alert(usr, ADMIN_WARNING_MESSAGE, "Begin Nar'Sie Roundender", list("I'm Sure", "Abort")) != "I'm Sure")
return

log_admin("[key_name(usr)] has triggered the Nar'Sie roundender.")
start_ending_the_round()

/obj/narsie/attack_ghost(mob/user)
makeNewConstruct(/mob/living/basic/construct/harvester, user, cultoverride = TRUE, loc_override = loc)
Expand Down Expand Up @@ -300,3 +328,5 @@
#undef NARSIE_MESMERIZE_CHANCE
#undef NARSIE_MESMERIZE_EFFECT
#undef NARSIE_SINGULARITY_SIZE

#undef ADMIN_WARNING_MESSAGE
Loading