Skip to content

Commit

Permalink
TGS Test Merge (#7754)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Dec 25, 2024
2 parents a58a196 + 6147957 commit 0bd9bfc
Show file tree
Hide file tree
Showing 11 changed files with 521 additions and 3 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@

/// From /mob/living/carbon/xenomorph/proc/do_evolve()
#define COMSIG_XENO_EVOLVE_TO_NEW_CASTE "xeno_evolve_to_new_caste"

/// From /obj/structure/tunnel/attack_alien() : (mob/living/carbon/xenomorph/xeno)
#define COMSIG_XENO_ENTER_TUNNEL "xeno_enter_tunnel"
#define COMPONENT_CANCEL_TUNNEL (1<<0)
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,6 @@ GLOBAL_LIST(trait_name_map)
#define HACKED_TRAIT "hacked"
/// traits from chloroform usage
#define CHLOROFORM_TRAIT "chloroform"

// from watchtower.dm
#define TRAIT_ON_WATCHTOWER "on_watchtower"
43 changes: 43 additions & 0 deletions code/datums/elements/bullet_trait/direct_only.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// This trait makes the projectile only hit targets directly clicked

/datum/element/bullet_trait_direct_only
// General bullet trait vars
element_flags = ELEMENT_DETACH|ELEMENT_BESPOKE
id_arg_index = 2

/datum/element/bullet_trait_direct_only/Attach(datum/target)
. = ..()
if(!istype(target, /obj/projectile))
return ELEMENT_INCOMPATIBLE

RegisterSignal(target, COMSIG_BULLET_CHECK_MOB_SKIPPING, PROC_REF(check_distance))

/datum/element/bullet_trait_direct_only/Detach(datum/target)
UnregisterSignal(target, COMSIG_BULLET_CHECK_MOB_SKIPPING)

return ..()

/datum/element/bullet_trait_direct_only/proc/check_distance(obj/projectile/projectile, mob/living/carbon/human/projectile_target)
SIGNAL_HANDLER

if(projectile.original != projectile_target)
return COMPONENT_SKIP_MOB

/datum/element/bullet_trait_direct_only/watchtower/check_distance(obj/projectile/projectile, mob/living/carbon/human/projectile_target)
if(!HAS_TRAIT(projectile.firer, TRAIT_ON_WATCHTOWER))
if(!istype(projectile.firer, /mob))
return
var/mob/firer = projectile.firer
var/obj/item/weapon/gun/gun = firer.get_inactive_hand()
if(istype(gun))
gun.remove_bullet_traits(list("watchtower_arc"))

gun = firer.get_active_hand()
if(istype(gun))
gun.remove_bullet_traits(list("watchtower_arc"))
return

if(HAS_TRAIT(projectile_target, TRAIT_ON_WATCHTOWER))
return

return ..()
5 changes: 3 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,6 @@
SPAN_NOTICE("You look up from [zoom_device]."))
zoom = !zoom
COOLDOWN_START(user, zoom_cooldown, 20)
SEND_SIGNAL(user, COMSIG_LIVING_ZOOM_OUT, src)
SEND_SIGNAL(src, COMSIG_ITEM_UNZOOM, user)
UnregisterSignal(src, list(
COMSIG_ITEM_DROPPED,
COMSIG_ITEM_UNWIELD,
Expand All @@ -896,6 +894,9 @@
user.client.pixel_x = 0
user.client.pixel_y = 0

SEND_SIGNAL(user, COMSIG_LIVING_ZOOM_OUT, src)
SEND_SIGNAL(src, COMSIG_ITEM_UNZOOM, user)

/obj/item/proc/zoom_handle_mob_move_or_look(mob/living/mover, actually_moving, direction, specific_direction)
SIGNAL_HANDLER

Expand Down
36 changes: 35 additions & 1 deletion code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
if(object.density)
to_chat(user, SPAN_WARNING("[object] is blocking you from welding [src] together!"))
return
if(do_after(user,30, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
if(do_after(user, 3 SECONDS, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
if(QDELETED(src))
return
to_chat(user, SPAN_NOTICE("You weld the girder together!"))
Expand Down Expand Up @@ -176,6 +176,33 @@
if(STATE_REINFORCED_WALL)
return do_reinforced_wall(W, user)
if(STATE_DISPLACED)
if(HAS_TRAIT(W, TRAIT_TOOL_BLOWTORCH))
var/area/area = get_area(src)
if(CEILING_IS_PROTECTED(area.ceiling, CEILING_GLASS))
to_chat(user, SPAN_WARNING("Watchtowers can only be built in the open."))
return

var/list/turf/turfs = CORNER_BLOCK(get_turf(src), 2, 2)
var/list/obj/structure/girder/girders = list()

for(var/turf/current_turf in turfs)
var/found_girder = FALSE
for(var/obj/structure/girder/girder in current_turf)
if(girder.state == STATE_DISPLACED)
found_girder = TRUE
girders += girder
if(!found_girder)
return


if(!do_after(user, 3 SECONDS, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return

new /obj/structure/watchtower(loc)

for(var/list/obj/structure/girder as anything in girders)
qdel(girder)

if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR))
var/turf/open/floor = loc
if(!floor.allow_construction)
Expand Down Expand Up @@ -393,6 +420,13 @@
anchored = FALSE
state = STATE_DISPLACED

/obj/structure/girder/broken
health = 0
icon_state = "girder_damaged"
anchored = FALSE
density = FALSE
state = STATE_STANDARD

/obj/structure/girder/reinforced
icon_state = "reinforced"
health = 500
Expand Down
3 changes: 3 additions & 0 deletions code/modules/cm_aliens/structures/tunnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
. = attack_alien(M)

/obj/structure/tunnel/attack_alien(mob/living/carbon/xenomorph/M)
if(SEND_SIGNAL(M, COMSIG_XENO_ENTER_TUNNEL) & COMPONENT_CANCEL_TUNNEL)
return XENO_NO_DELAY_ACTION

if(!istype(M) || M.is_mob_incapacitated(TRUE))
return XENO_NO_DELAY_ACTION

Expand Down
1 change: 1 addition & 0 deletions code/modules/movement/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
setDir(old_dir)
else if(old_dir != direct)
setDir(direct)

l_move_time = world.time
if ((oldloc != loc && oldloc && oldloc.z == z))
last_move_dir = get_dir(oldloc, loc)
Expand Down
45 changes: 45 additions & 0 deletions code/modules/watchtower/blockers.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/// Invisible Blocker Walls, they link up with the watchtower and collapse with it
/obj/structure/blocker/watchtower
name = "Watchtower Blocker"
icon = 'icons/obj/structures/barricades.dmi'
icon_state = "folding_0" // for map editing only
flags_atom = ON_BORDER
invisibility = INVISIBILITY_MAXIMUM
density = TRUE
opacity = FALSE // Unfortunately this doesn't behave as we'd want with ON_BORDER so we can't make tent opaque
throwpass = TRUE // Needs this so xenos can attack through the blocker and hit the tents or people inside
/// The watchtower this blocker relates to, will be destroyed along with it
var/obj/structure/watchtower/linked_watchtower

/obj/structure/blocker/watchtower/Initialize(mapload, ...)
. = ..()
icon_state = null
linked_watchtower = locate(/obj/structure/watchtower) in loc
if(!linked_watchtower)
return INITIALIZE_HINT_QDEL
RegisterSignal(linked_watchtower, COMSIG_PARENT_QDELETING, PROC_REF(collapse))

/obj/structure/blocker/watchtower/Destroy(force)
. = ..()
linked_watchtower = null

/obj/structure/blocker/watchtower/proc/collapse()
SIGNAL_HANDLER
qdel(src)

/obj/structure/blocker/watchtower/initialize_pass_flags(datum/pass_flags_container/PF)
..()
if (PF)
PF.flags_can_pass_all = NONE
PF.flags_can_pass_front = NONE
PF.flags_can_pass_behind = NONE

/obj/structure/blocker/watchtower/get_projectile_hit_boolean(obj/projectile/P)
. = ..()
return FALSE // Always fly through the watchtower

//Blocks all direction, basically an invisible wall
/obj/structure/blocker/watchtower/full_tile
flags_atom = NO_FLAGS
icon = 'icons/landmarks.dmi'
icon_state = "invisible_wall"
Loading

0 comments on commit 0bd9bfc

Please sign in to comment.