[MIRROR] Fugitive hunters gather candidates with a deadchat poll [MDB IGNORE] (#21566)

* Fugitive hunters gather candidates with a deadchat poll (#75485)

## About The Pull Request

Fugitive Hunter spawning now works a lot more like it does for Pirates.

Rather than just using the spawners, it collects candidates from a ghost
poll, and leaves the remaining spawners to be used if any are left.
## Why It's Good For The Game

The only way this event gathered candidates was through the
notify_ghosts that hunter spawners threw on Initialize(). This easily
flies under the radar (and I think also stopped working after
lazyloading was implemented??), contributing to how infrequently hunter
rolls are taken.

The hunters are an important part of fugitives as a whole, so making
sure they're properly filled out is good.

Closes #74625.
## Changelog
🆑
qol: Fugitive hunters now get a deadchat poll and notify deadchat
properly.
/🆑

* Fugitive hunters gather candidates with a deadchat poll

---------

Co-authored-by: Rhials <Datguy33456@gmail.com>
This commit is contained in:
SkyratBot
2023-06-03 18:33:37 -07:00
committed by GitHub
co-authored by Rhials
parent 1c77a390d2
commit 2ef95c78f7
3 changed files with 30 additions and 15 deletions
+4 -4
View File
@@ -330,7 +330,7 @@ GLOBAL_LIST_INIT(human_invader_antagonists, list(
// If this flag is enabled the antagonist datum allows the antagonist to be inducted into a nuclear operative team.
#define FLAG_ANTAG_CAN_BE_INDUCTED (1 << 0)
#define HUNTER_PACK_COPS "cop_hunters"
#define HUNTER_PACK_RUSSIAN "russian_hunters"
#define HUNTER_PACK_BOUNTY "bounty_hunters"
#define HUNTER_PACK_PSYKER "psyker_hunters"
#define HUNTER_PACK_COPS "Spacepol Fugitive Hunters"
#define HUNTER_PACK_RUSSIAN "Russian Fugitive Hunters"
#define HUNTER_PACK_BOUNTY "Bounty Fugitive Hunters"
#define HUNTER_PACK_PSYKER "Psyker Fugitive Hunters"
@@ -56,7 +56,13 @@
//after spawning
playsound(src, 'sound/weapons/emitter.ogg', 50, TRUE)
new /obj/item/storage/toolbox/mechanical(landing_turf) //so they can actually escape maint
addtimer(CALLBACK(src, PROC_REF(spawn_hunters)), 10 MINUTES)
var/hunter_backstory = pick(
HUNTER_PACK_COPS,
HUNTER_PACK_RUSSIAN,
HUNTER_PACK_BOUNTY,
HUNTER_PACK_PSYKER,
)
addtimer(CALLBACK(src, PROC_REF(spawn_hunters), hunter_backstory), 10 MINUTES)
role_name = "fugitive hunter"
return SUCCESSFUL_SPAWN
@@ -98,9 +104,11 @@
new /obj/item/autosurgeon(landing_turf)
//security team gets called in after 10 minutes of prep to find the refugees
/datum/round_event/ghost_role/fugitives/proc/spawn_hunters()
var/backstory = pick(HUNTER_PACK_COPS, HUNTER_PACK_RUSSIAN, HUNTER_PACK_BOUNTY, HUNTER_PACK_PSYKER)
var/datum/map_template/shuttle/ship
/datum/round_event/ghost_role/fugitives/proc/spawn_hunters(backstory)
var/list/candidates = poll_ghost_candidates("Do you wish to be considered for a group of [backstory]?", ROLE_FUGITIVE_HUNTER)
shuffle_inplace(candidates)
var/datum/map_template/shuttle/hunter/ship
switch(backstory)
if(HUNTER_PACK_COPS)
ship = new /datum/map_template/shuttle/hunter/space_cop
@@ -114,11 +122,22 @@
var/x = rand(TRANSITIONEDGE,world.maxx - TRANSITIONEDGE - ship.width)
var/y = rand(TRANSITIONEDGE,world.maxy - TRANSITIONEDGE - ship.height)
var/z = SSmapping.empty_space.z_value
var/turf/T = locate(x,y,z)
if(!T)
var/turf/placement_turf = locate(x,y,z)
if(!placement_turf)
CRASH("Fugitive Hunters (Created from fugitive event) found no turf to load in")
if(!ship.load(T))
if(!ship.load(placement_turf))
CRASH("Loading [backstory] ship failed!")
for(var/turf/shuttle_turf in ship.get_affected_turfs(placement_turf))
for(var/obj/effect/mob_spawn/ghost_role/human/fugitive/spawner in shuttle_turf)
if(length(candidates))
var/mob/our_candidate = candidates[1]
var/mob/spawned_mob = spawner.create_from_ghost(our_candidate)
candidates -= our_candidate
notify_ghosts("[spawner.prompt_name] has awoken: [spawned_mob]!", source = spawned_mob, action = NOTIFY_ORBIT, header="Come look!")
else
notify_ghosts("[spawner.prompt_name] spawner has been created!", source = spawner, action = NOTIFY_ORBIT, header="Spawn Here!")
priority_announce("Unidentified ship detected near the station.")
#undef TEAM_BACKSTORY_SIZE
@@ -7,10 +7,6 @@
show_flavor = FALSE
var/back_story = "error"
/obj/effect/mob_spawn/ghost_role/human/fugitive/Initialize(mapload)
. = ..()
notify_ghosts("Hunters are waking up looking for refugees!", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_FUGITIVE)
/obj/effect/mob_spawn/ghost_role/human/fugitive/special(mob/living/carbon/human/spawned_human)
. = ..()
var/datum/antagonist/fugitive_hunter/fughunter = new