Skip to content

Commit

Permalink
Emergency Revert
Browse files Browse the repository at this point in the history
F
  • Loading branch information
realforest2001 committed Oct 9, 2024
1 parent 6ccf38f commit 1a463f5
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 179 deletions.
2 changes: 1 addition & 1 deletion code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
if(!istype(user))
return FALSE
if(mods["shift"] && user.tracked_marker)
if(user.observed_mob == user.tracked_marker)
if(user.observed_xeno == user.tracked_marker)
user.overwatch(user.tracked_marker, TRUE) //passing in an obj/effect into a proc that expects mob/xenomorph B)
else
to_chat(user, SPAN_XENONOTICE("We psychically observe the [user.tracked_marker.mark_meaning.name] resin mark in [get_area_name(user.tracked_marker)]."))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
if (stat != DEAD && hivenumber && hivenumber <= GLOB.hive_datum)
var/datum/hive_status/hive = GLOB.hive_datum[hivenumber]
var/mob/living/carbon/xenomorph/queen/Q = hive.living_xeno_queen
if (Q && Q.observed_mob == src)
if (Q && Q.observed_xeno == src)
holder.icon_state = "queen_overwatch"
hud_list[QUEEN_OVERWATCH_HUD] = holder

Expand Down
12 changes: 3 additions & 9 deletions code/game/machinery/computer/fax_responder_spy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@
if(FACTION_WY)
color = "#b6b6b6"

// Make sure to turn off any previous overwatches
spy_operator.overwatch(stop_overwatch = TRUE)

. = ..()

name = "Spy Camera ([spy_faction])"
Expand All @@ -181,8 +178,6 @@
if(is_watching && (can_spy_turf(src, is_watching.loc) & COMPONENT_TURF_DENY_MOVEMENT))
return COMPONENT_OVERRIDE_MOVE

spy_operator.overwatch(stop_overwatch = TRUE)

return ..()

/mob/hologram/spy_camera/proc/start_watching(mob/living/carbon/human/source_mob, mob/living/carbon/human/target_mob)
Expand Down Expand Up @@ -259,17 +254,16 @@
if(!mods["ctrl"])
return

/*
if(is_spy_faction(target_atom))
var/mob/living/carbon/target_mob = target_atom
spy_operator.overwatch(target_mob)
return COMPONENT_INTERRUPT_CLICK

*/

if(!(can_spy_turf(src, T) & COMPONENT_TURF_ALLOW_MOVEMENT))
return

forceMove(T)
if(is_watching)
spy_operator.overwatch(stop_overwatch = TRUE)

return COMPONENT_INTERRUPT_CLICK

Expand Down
3 changes: 0 additions & 3 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
if(stat != CONSCIOUS)
remove_all_indicators()

if(stat != DEAD)
handle_overwatch()

/mob/living/carbon/Destroy()
stomach_contents?.Cut()
view_change_sources = null
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
var/list/active_transfusions = list()

var/datum/huntdata/hunter_data //Stores all information relating to Hunters for use with their HUD and other systems.
var/mob/living/carbon/observed_mob // Overwatched mob for xeno hivemind vision

/mob/living/carbon/vv_get_dropdown()
. = ..()
Expand Down
70 changes: 0 additions & 70 deletions code/modules/mob/living/carbon/mob_overwatch.dm

This file was deleted.

6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/Abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@
var/mob/living/carbon/xenomorph/queen/X = owner
if(!X.check_state())
return
if(X.observed_mob)
var/mob/living/carbon/xenomorph/target = X.observed_mob
if(X.observed_xeno)
var/mob/living/carbon/xenomorph/target = X.observed_xeno
if(target.stat != DEAD && target.client)
if(X.check_plasma(plasma_cost))
var/input = stripped_input(X, "This message will be sent to the overwatched xeno.", "Queen Order", "")
if(!input)
return
var/queen_order = SPAN_XENOANNOUNCE("<b>[X]</b> reaches you:\"[input]\"")
if(!X.check_state() || !X.check_plasma(plasma_cost) || X.observed_mob != target || target.stat == DEAD)
if(!X.check_state() || !X.check_plasma(plasma_cost) || X.observed_xeno != target || target.stat == DEAD)
return
if(target.client)
X.use_plasma(plasma_cost)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/Evolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
new_xeno.visible_message(SPAN_XENODANGER("A [new_xeno.caste.caste_type] emerges from the husk of \the [src]."), \
SPAN_XENODANGER("We emerge in a greater form from the husk of our old body. For the hive!"))

if(hive.living_xeno_queen && hive.living_xeno_queen.observed_mob == src)
if(hive.living_xeno_queen && hive.living_xeno_queen.observed_xeno == src)
hive.living_xeno_queen.overwatch(new_xeno)

src.transfer_observers_to(new_xeno)
Expand Down
79 changes: 40 additions & 39 deletions code/modules/mob/living/carbon/xenomorph/XenoOverwatch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
return

// We are already overwatching something
if (X.observed_mob)
if (X.observed_xeno)
if (isQueen)
var/mob/living/carbon/xenomorph/oldXeno = X.observed_mob
X.overwatch(X.observed_mob, TRUE)
var/mob/living/carbon/xenomorph/oldXeno = X.observed_xeno
X.overwatch(X.observed_xeno, TRUE)
if (oldXeno)
oldXeno.hud_set_queen_overwatch()
else
X.overwatch(X.observed_mob, TRUE)
X.overwatch(X.observed_xeno, TRUE)
return

var/list/possible_xenos = list()
Expand All @@ -49,12 +49,12 @@

var/mob/living/carbon/xenomorph/selected_xeno = tgui_input_list(X, "Target", "Watch which xenomorph?", possible_xenos, theme="hive_status")

if (!selected_xeno || QDELETED(selected_xeno) || selected_xeno == X.observed_mob || selected_xeno.stat == DEAD || should_block_game_interaction(selected_xeno) || !X.check_state(TRUE))
X.overwatch(X.observed_mob, TRUE) // Cancel OW
if (!selected_xeno || QDELETED(selected_xeno) || selected_xeno == X.observed_xeno || selected_xeno.stat == DEAD || should_block_game_interaction(selected_xeno) || !X.check_state(TRUE))
X.overwatch(X.observed_xeno, TRUE) // Cancel OW
else if (!isQueen) // Regular Xeno OW vs Queen
X.overwatch(selected_xeno)
else // We are a queen
var/mob/living/carbon/xenomorph/oldXeno = X.observed_mob
var/mob/living/carbon/xenomorph/oldXeno = X.observed_xeno
X.overwatch(selected_xeno, FALSE)
if (oldXeno)
oldXeno.hud_set_queen_overwatch()
Expand All @@ -65,10 +65,10 @@
// Generic Xeno overwatch proc, very simple for now. If you want it to cancel the overwatch, hand in TRUE in the second var.
// Third var is only for custom event handlers for OW hud indicators, currently only used for the Queen icon
// If you use it, be sure to manually specify the second var, even if its the default value.
/mob/living/carbon/xenomorph/overwatch(mob/living/carbon/xenomorph/target_mob, stop_overwatch = FALSE)
/mob/living/carbon/xenomorph/proc/overwatch(mob/living/carbon/xenomorph/targetXeno, stop_overwatch = FALSE)
if(stop_overwatch)
var/mob/living/carbon/xenomorph/oldXeno = observed_mob
observed_mob = null
var/mob/living/carbon/xenomorph/oldXeno = observed_xeno
observed_xeno = null

SEND_SIGNAL(src, COMSIG_XENO_STOP_OVERWATCH, oldXeno)
UnregisterSignal(src, COMSIG_MOB_MOVE_OR_LOOK)
Expand All @@ -86,29 +86,24 @@
to_chat(src, SPAN_WARNING("There is no Queen. We are alone."))
return

if(!isxeno(target_mob))
to_chat(src, SPAN_WARNING("We cannot watch a host!"))
return
var/mob/living/carbon/xenomorph/target_xeno

if(target_xeno == src)
if(targetXeno == src)
to_chat(src, SPAN_XENOWARNING("We can't watch ourselves!"))
return

if(HAS_TRAIT(src, TRAIT_HIVEMIND_INTERFERENCE))
to_chat(src, SPAN_XENOWARNING("Our psychic connection is cut off!"))
return

if(HAS_TRAIT(target_xeno, TRAIT_HIVEMIND_INTERFERENCE))
if(HAS_TRAIT(targetXeno, TRAIT_HIVEMIND_INTERFERENCE))
to_chat(src, SPAN_XENOWARNING("Our sister's psychic connection is cut off!"))
return

if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED))
to_chat(src, SPAN_XENOWARNING("We cannot do this in our current state!"))
return

if(observed_mob && target_xeno && observed_mob == target_xeno)
if(istype(target_xeno, /obj/effect/alien/resin/marker))
if(observed_xeno && targetXeno && observed_xeno == targetXeno)
if(istype(targetXeno, /obj/effect/alien/resin/marker))
to_chat(src, SPAN_XENOWARNING("We are already watching that mark!"))
return
to_chat(src, SPAN_XENOWARNING("We are already watching that sister!"))
Expand All @@ -117,33 +112,37 @@
if(caste_type != XENO_CASTE_QUEEN && is_zoomed)
zoom_out()

if(observed_mob)
var/mob/living/carbon/xenomorph/oldXeno = observed_mob
observed_mob = null
if(observed_xeno)
var/mob/living/carbon/xenomorph/oldXeno = observed_xeno
observed_xeno = null

SEND_SIGNAL(src, COMSIG_XENO_STOP_OVERWATCH_XENO, oldXeno)
oldXeno.hud_set_queen_overwatch()
UnregisterSignal(src, COMSIG_MOB_MOVE_OR_LOOK)
UnregisterSignal(oldXeno, COMSIG_PARENT_QDELETING)

observed_mob = target_xeno
target_xeno.hud_set_queen_overwatch()
observed_xeno = targetXeno

SEND_SIGNAL(src, COMSIG_XENO_OVERWATCH_XENO, target_xeno)
observed_xeno.hud_set_queen_overwatch()
SEND_SIGNAL(src, COMSIG_XENO_OVERWATCH_XENO, observed_xeno)
RegisterSignal(src, COMSIG_MOB_MOVE_OR_LOOK, PROC_REF(overwatch_handle_mob_move_or_look))
RegisterSignal(target_xeno, COMSIG_PARENT_QDELETING, PROC_REF(overwatch_handle_deletion))
RegisterSignal(observed_xeno, COMSIG_PARENT_QDELETING, PROC_REF(overwatch_handle_deletion))

src.reset_view()

/mob/living/carbon/xenomorph/proc/overwatch_handle_deletion(mob/living/carbon/xenomorph/deleted, forced)
SIGNAL_HANDLER
overwatch(deleted, TRUE)

// Called from xeno Life()
// Makes sure that Xeno overwatch is reset when the overwatched Xeno dies.
/mob/living/carbon/xenomorph/handle_overwatch()
if(observed_mob)
if(observed_mob.stat == DEAD || QDELETED(observed_mob))
/mob/living/carbon/xenomorph/proc/handle_overwatch()
if(observed_xeno)
if(observed_xeno.stat == DEAD || QDELETED(observed_xeno))
overwatch(null, TRUE)
return

if(HAS_TRAIT(observed_mob, TRAIT_HIVEMIND_INTERFERENCE))
if(HAS_TRAIT(observed_xeno, TRAIT_HIVEMIND_INTERFERENCE))
to_chat(src, SPAN_XENOWARNING("Our sister's psychic connection is cut off!"))
overwatch(null, TRUE)
return
Expand All @@ -152,22 +151,24 @@
overwatch(null, TRUE)
return

/mob/living/carbon/xenomorph/overwatch_handle_mob_move_or_look(mob/living/carbon/xenomorph/mover, actually_moving, direction, specific_direction)
/mob/living/carbon/xenomorph/proc/overwatch_handle_mob_move_or_look(mob/living/carbon/xenomorph/mover, actually_moving, direction, specific_direction)
SIGNAL_HANDLER

if(!actually_moving)
return

mover.overwatch(mover.observed_mob, TRUE) // Goodbye overwatch
mover.overwatch(mover.observed_xeno, TRUE) // Goodbye overwatch
UnregisterSignal(mover, COMSIG_MOB_MOVE_OR_LOOK)
return COMPONENT_OVERRIDE_MOB_MOVE_OR_LOOK

/mob/living/carbon/xenomorph/queen/overwatch_handle_mob_move_or_look(mob/living/carbon/xenomorph/queen/mover, actually_moving, direction, specific_direction)
if(!actually_moving)
return

var/mob/living/carbon/xenomorph/observed_mob = mover.observed_mob
mover.overwatch(observed_mob, TRUE)
if(observed_mob)
observed_mob.hud_set_queen_overwatch()
var/mob/living/carbon/xenomorph/observed_xeno = mover.observed_xeno
mover.overwatch(observed_xeno, TRUE)
if(observed_xeno)
observed_xeno.hud_set_queen_overwatch()
UnregisterSignal(mover, COMSIG_MOB_MOVE_OR_LOOK)
return COMPONENT_OVERRIDE_MOB_MOVE_OR_LOOK

Expand All @@ -181,9 +182,9 @@
if (client)

// Is our observed xeno configured and are we alive?
if(observed_mob && !stat)
if(observed_xeno && !stat)
client.perspective = EYE_PERSPECTIVE
client.eye = observed_mob
client.eye = observed_xeno

// Handle HREF clicks through hive status and hivemind
/mob/living/carbon/xenomorph/Topic(href, href_list)
Expand All @@ -205,7 +206,7 @@
if (!isQueen)
xenoSrc.overwatch(xenoTarget)
else
var/mob/living/carbon/xenomorph/oldXeno = xenoSrc.observed_mob
var/mob/living/carbon/xenomorph/oldXeno = xenoSrc.observed_xeno
xenoSrc.overwatch(xenoTarget, FALSE)
if (oldXeno)
oldXeno.hud_set_queen_overwatch()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
if(is_mob_incapacitated() || body_position == LYING_DOWN || buckled || evolving || !isturf(loc))
to_chat(src, SPAN_WARNING("We cannot do this in our current state."))
return FALSE
else if(caste_type != XENO_CASTE_QUEEN && observed_mob)
else if(caste_type != XENO_CASTE_QUEEN && observed_xeno)
to_chat(src, SPAN_WARNING("We cannot do this in our current state."))
return FALSE
else
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
var/list/xeno_shields = list() // List of /datum/xeno_shield that holds all active shields on the Xeno.
var/acid_splash_cooldown = 5 SECONDS //Time it takes between acid splash retaliate procs
var/acid_splash_last //Last recorded time that an acid splash procced
var/mob/living/carbon/xenomorph/observed_xeno // Overwatched xeno for xeno hivemind vision
var/need_weeds = TRUE // Do we need weeds to regen HP?
var/datum/behavior_delegate/behavior_delegate = null // Holds behavior delegate. Governs all 'unique' hooked behavior of the Xeno. Set by caste datums and strains.
var/datum/action/xeno_action/activable/selected_ability // Our currently selected ability
Expand Down Expand Up @@ -698,7 +699,7 @@
hive?.remove_xeno(src)
remove_from_all_mob_huds()

observed_mob = null
observed_xeno = null
wear_suit = null
head = null
r_store = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
return
if(world.time > burrow_timer && !tunnel)
burrow_off()
if(observed_mob)
overwatch(observed_mob, TRUE)
if(observed_xeno)
overwatch(observed_xeno, TRUE)
if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED))
addtimer(CALLBACK(src, PROC_REF(process_burrow)), 1 SECONDS)

Expand Down
Loading

0 comments on commit 1a463f5

Please sign in to comment.