diff --git a/code/__DEFINES/dcs/signals/signals_datum.dm b/code/__DEFINES/dcs/signals/signals_datum.dm index a7a93c4ea114..7696d8ad6037 100644 --- a/code/__DEFINES/dcs/signals/signals_datum.dm +++ b/code/__DEFINES/dcs/signals/signals_datum.dm @@ -61,3 +61,6 @@ // from /datum/emergency_call/proc/spawn_candidates() #define COMSIG_ERT_SETUP "ert_setup" + +// from /proc/update_living_queens() : /mob/living/carbon/xenomorph/queen +#define COMSIG_HIVE_NEW_QUEEN "hive_new_queen" diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index 824e0cc5f9fd..d95fbc304397 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -479,3 +479,68 @@ // Perform check_state(TRUE) silently: if(xeno && !xeno.is_mob_incapacitated() || !xeno.buckled || !xeno.evolving && xeno.plasma_stored >= plasma_cost) return TRUE + +/datum/action/xeno_action/onclick/tacmap + name = "View Tactical Map" + action_icon_state = "toggle_queen_zoom" + ability_name = "view tacmap" + + var/mob/living/carbon/xenomorph/queen/tracked_queen + +/datum/action/xeno_action/onclick/tacmap/Destroy() + tracked_queen = null + return ..() + +/datum/action/xeno_action/onclick/tacmap/give_to(mob/living/carbon/xenomorph/xeno) + . = ..() + + RegisterSignal(xeno.hive, COMSIG_HIVE_NEW_QUEEN, PROC_REF(handle_new_queen)) + + if(!xeno.hive.living_xeno_queen) + hide_from(xeno) + return + + if(!xeno.hive.living_xeno_queen.ovipositor) + hide_from(xeno) + + handle_new_queen(new_queen = xeno.hive.living_xeno_queen) + +/// handles the addition of a new queen, hiding if appropriate +/datum/action/xeno_action/onclick/tacmap/proc/handle_new_queen(datum/hive_status/hive, mob/living/carbon/xenomorph/queen/new_queen) + SIGNAL_HANDLER + + if(tracked_queen) + UnregisterSignal(tracked_queen, list(COMSIG_QUEEN_MOUNT_OVIPOSITOR, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, COMSIG_PARENT_QDELETING)) + + tracked_queen = new_queen + + if(!tracked_queen.ovipositor) + hide_from(owner) + + RegisterSignal(tracked_queen, COMSIG_QUEEN_MOUNT_OVIPOSITOR, PROC_REF(handle_mount_ovipositor)) + RegisterSignal(tracked_queen, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, PROC_REF(handle_dismount_ovipositor)) + RegisterSignal(tracked_queen, COMSIG_PARENT_QDELETING, PROC_REF(handle_queen_qdel)) + +/// deals with the queen mounting the ovipositor, unhiding the action from the user +/datum/action/xeno_action/onclick/tacmap/proc/handle_mount_ovipositor() + SIGNAL_HANDLER + + unhide_from(owner) + +/// deals with the queen dismounting the ovipositor, hiding the action from the user +/datum/action/xeno_action/onclick/tacmap/proc/handle_dismount_ovipositor() + SIGNAL_HANDLER + + hide_from(owner) + +/// cleans up references to the queen when the queen is being qdel'd, hides the action from the user +/datum/action/xeno_action/onclick/tacmap/proc/handle_queen_qdel() + SIGNAL_HANDLER + + tracked_queen = null + hide_from(owner) + +/datum/action/xeno_action/onclick/tacmap/use_ability(atom/target) + var/mob/living/carbon/xenomorph/xeno = owner + xeno.xeno_tacmap() + return ..() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm index 96cd2846249d..092dae00d603 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm @@ -71,7 +71,7 @@ /datum/action/xeno_action/activable/spray_acid/boiler, //3rd macro /datum/action/xeno_action/onclick/toggle_long_range/boiler, //4rd macro /datum/action/xeno_action/onclick/acid_shroud, //4th macro - + /datum/action/xeno_action/onclick/tacmap, ) /mob/living/carbon/xenomorph/boiler/Initialize(mapload, mob/living/carbon/xenomorph/oldxeno, h_number) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index 8cfc78a38272..ead254344e0a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -66,6 +66,7 @@ /datum/action/xeno_action/onclick/place_trap, //second macro /datum/action/xeno_action/activable/burrow, //third macro /datum/action/xeno_action/onclick/tremor, //fourth macro + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index fcc9bfcfd3b7..ec1697f30081 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -69,6 +69,7 @@ /datum/action/xeno_action/activable/throw_hugger, //3rd macro /datum/action/xeno_action/activable/retrieve_egg, //4th macro /datum/action/xeno_action/onclick/set_hugger_reserve, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm index 9a2e3e89cb21..bf1702598250 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm @@ -59,6 +59,7 @@ /datum/action/xeno_action/activable/pounce/crusher_charge, /datum/action/xeno_action/onclick/crusher_stomp, /datum/action/xeno_action/onclick/crusher_shield, + /datum/action/xeno_action/onclick/tacmap, ) claw_type = CLAW_TYPE_VERY_SHARP diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm index 4360e5d42ca2..8c05fa53660e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm @@ -47,6 +47,7 @@ /datum/action/xeno_action/activable/headbutt, /datum/action/xeno_action/onclick/tail_sweep, /datum/action/xeno_action/activable/fortify, + /datum/action/xeno_action/onclick/tacmap, ) mutation_icon_state = DEFENDER_NORMAL mutation_type = DEFENDER_NORMAL diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm index 7748f5978a20..dbdb03bb94ca 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm @@ -63,6 +63,7 @@ /datum/action/xeno_action/onclick/choose_resin, //second macro /datum/action/xeno_action/activable/secrete_resin, //third macro /datum/action/xeno_action/activable/transfer_plasma, //fourth macro + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index 1b8ac2ee05dc..150bc1d9fc96 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -50,6 +50,7 @@ /datum/action/xeno_action/watch_xeno, /datum/action/xeno_action/onclick/xenohide, /datum/action/xeno_action/activable/pounce/facehugger, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index 1b7c04eb1a77..271fe3182210 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -58,6 +58,7 @@ /datum/action/xeno_action/onclick/xenohide, /datum/action/xeno_action/activable/pounce/runner, /datum/action/xeno_action/onclick/toggle_long_range/runner, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm index 9ffd0d9a7690..b0a44b0e3835 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm @@ -68,6 +68,7 @@ /datum/action/xeno_action/activable/secrete_resin/hivelord, //third macro /datum/action/xeno_action/activable/transfer_plasma/hivelord, // to be consistent with drone placement /datum/action/xeno_action/active_toggle/toggle_speed, //fourth macro + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 4cf0ff113615..3f65be228443 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -41,6 +41,7 @@ /datum/action/xeno_action/onclick/xeno_resting, /datum/action/xeno_action/watch_xeno, /datum/action/xeno_action/onclick/xenohide, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 1269f89f9144..fb75ed3900ac 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -45,6 +45,7 @@ /datum/action/xeno_action/activable/pounce/lurker, /datum/action/xeno_action/onclick/lurker_invisibility, /datum/action/xeno_action/onclick/lurker_assassinate, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm index e1bdb18a29e2..344e1e21f302 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm @@ -58,6 +58,7 @@ /datum/action/xeno_action/activable/pounce/base_prae_dash, /datum/action/xeno_action/activable/prae_acid_ball, /datum/action/xeno_action/activable/spray_acid/base_prae_spray_acid, + /datum/action/xeno_action/onclick/tacmap, ) icon_xeno = 'icons/mob/xenos/praetorian.dmi' diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm index cf72a5bc419b..c7970e017c4b 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm @@ -60,6 +60,7 @@ /datum/action/xeno_action/onclick/predalien_roar, /datum/action/xeno_action/onclick/smash, /datum/action/xeno_action/activable/devastate, + /datum/action/xeno_action/onclick/tacmap, ) mutation_type = "Normal" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm index 140e2642685f..d8d4a2349f98 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm @@ -56,6 +56,7 @@ /datum/action/xeno_action/activable/pounce/charge, /datum/action/xeno_action/onclick/empower, /datum/action/xeno_action/activable/scissor_cut, + /datum/action/xeno_action/onclick/tacmap, ) icon_xeno = 'icons/mob/xenos/ravager.dmi' diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm index 45bfd4d7f78d..04dd751bdcb8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm @@ -56,6 +56,7 @@ /datum/action/xeno_action/activable/pounce/runner, /datum/action/xeno_action/activable/runner_skillshot, /datum/action/xeno_action/onclick/toggle_long_range/runner, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm index 3e67ae2d18f9..39426b1a9ef7 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm @@ -48,6 +48,7 @@ /datum/action/xeno_action/activable/slowing_spit, //first macro /datum/action/xeno_action/activable/scattered_spit, //second macro /datum/action/xeno_action/onclick/paralyzing_slash, //third macro + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm index 31c8720e9a19..23728b00a642 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm @@ -51,6 +51,7 @@ /datum/action/xeno_action/activable/xeno_spit, /datum/action/xeno_action/onclick/charge_spit, /datum/action/xeno_action/activable/spray_acid/spitter, + /datum/action/xeno_action/onclick/tacmap, ) inherent_verbs = list( /mob/living/carbon/xenomorph/proc/vent_crawl, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index d815bc18f9d5..7c8edace81e4 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -52,6 +52,7 @@ /datum/action/xeno_action/activable/warrior_punch, /datum/action/xeno_action/activable/lunge, /datum/action/xeno_action/activable/fling, + /datum/action/xeno_action/onclick/tacmap, ) mutation_type = WARRIOR_NORMAL diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index 7506788c2576..8b25cf07d14b 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -474,6 +474,7 @@ SStracking.set_leader("hive_[hivenumber]", queen) SShive_status.wait = 2 SECONDS + SEND_SIGNAL(src, COMSIG_HIVE_NEW_QUEEN, queen) living_xeno_queen = queen recalculate_hive()