From c9cc58f8977a08dafe82d6d3871f0e72d3bb174c Mon Sep 17 00:00:00 2001 From: ihatethisengine Date: Wed, 3 Jul 2024 05:42:43 +0300 Subject: [PATCH 1/7] init --- code/__DEFINES/traits.dm | 2 ++ .../game/objects/structures/stool_bed_chair_nest/xeno_nest.dm | 2 ++ code/game/turfs/transit.dm | 2 ++ code/modules/projectiles/projectile.dm | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7b669124a2d0..00dc2333a237 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -161,6 +161,8 @@ #define TRAIT_MERGED_WITH_WEEDS "merged_with_weeds" /// Apply this to identify a mob as temporarily muted #define TRAIT_TEMPORARILY_MUTED "temporarily_muted" +/// Mob wont get hit by stray projectiles +#define TRAIT_NO_STRAY "trait_no_stray" // SPECIES TRAITS /// Knowledge of Yautja technology diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index c3f0b97e509a..68b899f78f15 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -245,6 +245,7 @@ do_buckle(mob, user) ADD_TRAIT(mob, TRAIT_NESTED, TRAIT_SOURCE_BUCKLE) + ADD_TRAIT(mob, TRAIT_NO_STRAY, TRAIT_SOURCE_BUCKLE) SEND_SIGNAL(mob, COMSIG_MOB_NESTED, user) if(!human) @@ -275,6 +276,7 @@ buckled_mob.pixel_y = 0 buckled_mob.old_y = 0 REMOVE_TRAIT(buckled_mob, TRAIT_NESTED, TRAIT_SOURCE_BUCKLE) + REMOVE_TRAIT(buckled_mob, TRAIT_NO_STRAY, TRAIT_SOURCE_BUCKLE) var/mob/living/carbon/human/buckled_human = buckled_mob var/mob/dead/observer/G = ghost_of_buckled_mob diff --git a/code/game/turfs/transit.dm b/code/game/turfs/transit.dm index 00175ac5e365..445a1658570d 100644 --- a/code/game/turfs/transit.dm +++ b/code/game/turfs/transit.dm @@ -138,6 +138,7 @@ clear_active_explosives() ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) + ADD_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) var/image/cables = image('icons/obj/structures/droppod_32x64.dmi', src, "chute_cables_static") overlays += cables var/image/chute = image('icons/obj/structures/droppod_64x64.dmi', src, "chute_static") @@ -163,6 +164,7 @@ return REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) + REMOVE_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) overlays -= cables overlays -= chute diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index c1a43bda0ae8..74571f640764 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -841,8 +841,8 @@ //mobs use get_projectile_hit_chance instead of get_projectile_hit_boolean /mob/living/proc/get_projectile_hit_chance(obj/projectile/P) - if((body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_NESTED)) && src != P.original) - return FALSE // Snowflake check for xeno nests, because we want bullets to fly through even though they're standing in it + if((body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_NO_STRAY)) && src != P.original) + return FALSE var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(ammo_flags & AMMO_XENO) if((status_flags & XENO_HOST) && HAS_TRAIT(src, TRAIT_NESTED)) From a1c079272a37352738ae641436c0c922c2651d59 Mon Sep 17 00:00:00 2001 From: ihatethisengine Date: Wed, 3 Jul 2024 07:29:16 +0300 Subject: [PATCH 2/7] eh --- .../dcs/signals/atom/signals_movable.dm | 3 +++ code/game/turfs/transit.dm | 20 ++++++++++++++++++- code/modules/movement/movement.dm | 10 +++++----- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/dcs/signals/atom/signals_movable.dm b/code/__DEFINES/dcs/signals/atom/signals_movable.dm index ba889d0b5212..c207ce1468d5 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_movable.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_movable.dm @@ -11,6 +11,9 @@ #define COMPONENT_CANCEL_MOVE (1<<0) /// From /turf/open/gm/river/Entered(): (turf/open/gm/river/river, covered) #define COMSIG_MOVABLE_ENTERED_RIVER "movable_entered_river" +/// From /atom/Cross(): (atom) +#define COMSIG_MOVABLE_PRE_CROSSED "movable_pre_cross" + #define COMPONENT_IGNORE_CROSS (1<<0) ///from /mob/living/carbon/xenomorph/start_pulling(): (mob/living/carbon/xenomorph/X) #define COMSIG_MOVABLE_XENO_START_PULLING "movable_xeno_start_pulling" diff --git a/code/game/turfs/transit.dm b/code/game/turfs/transit.dm index 445a1658570d..7d44d34c1bc5 100644 --- a/code/game/turfs/transit.dm +++ b/code/game/turfs/transit.dm @@ -136,9 +136,14 @@ /atom/movable/proc/handle_paradrop(turf/target, dropship_name) clear_active_explosives() - ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) + //ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) + RegisterSignal(src, COMSIG_MOVABLE_PRE_CROSSED, PROC_REF(cancel_cross)) + RegisterSignal(src, list( + COMSIG_LIVING_FLAMER_FLAMED, + COMSIG_LIVING_PREIGNITION + ), PROC_REF(cancel_fire)) var/image/cables = image('icons/obj/structures/droppod_32x64.dmi', src, "chute_cables_static") overlays += cables var/image/chute = image('icons/obj/structures/droppod_64x64.dmi', src, "chute_static") @@ -165,8 +170,14 @@ REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) + UnregisterSignal(src, COMSIG_MOVABLE_PRE_CROSSED) + UnregisterSignal(src, COMSIG_LIVING_FLAMER_FLAMED) overlays -= cables overlays -= chute + for(var/atom/movable/atom in loc) + if(atom == src) + continue + atom.Cross(src) /atom/movable/proc/clear_active_explosives() for(var/obj/item/explosive/explosive in contents) @@ -234,6 +245,13 @@ death(last_damage_data) status_flags |= PERMANENTLY_DEAD +/atom/movable/proc/cancel_cross() + SIGNAL_HANDLER + return COMPONENT_IGNORE_CROSS + +/atom/movable/proc/cancel_fire() + SIGNAL_HANDLER + return COMPONENT_NO_BURN /turf/open/space/transit/dropship/alamo shuttle_tag = DROPSHIP_ALAMO diff --git a/code/modules/movement/movement.dm b/code/modules/movement/movement.dm index e12a5b439296..c160de82d346 100644 --- a/code/modules/movement/movement.dm +++ b/code/modules/movement/movement.dm @@ -140,11 +140,11 @@ destination.Entered(src, oldloc) if(destarea && (old_area != destarea || !isturf(oldloc))) destarea.Entered(src, oldloc) - - for(var/atom/movable/AM in destination) - if(AM == src) - continue - AM.Crossed(src, oldloc) + if(!(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_CROSSED) & COMPONENT_IGNORE_CROSS)) + for(var/atom/movable/AM in destination) + if(AM == src) + continue + AM.Crossed(src, oldloc) Moved(oldloc, NONE, TRUE) . = TRUE From cb29f47adc83ef2d93bd931964fd006b65870e4e Mon Sep 17 00:00:00 2001 From: ihatethisengine Date: Wed, 3 Jul 2024 07:30:38 +0300 Subject: [PATCH 3/7] ehhh --- code/__DEFINES/dcs/signals/atom/signals_movable.dm | 2 +- code/game/turfs/transit.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/dcs/signals/atom/signals_movable.dm b/code/__DEFINES/dcs/signals/atom/signals_movable.dm index c207ce1468d5..c43001487719 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_movable.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_movable.dm @@ -11,7 +11,7 @@ #define COMPONENT_CANCEL_MOVE (1<<0) /// From /turf/open/gm/river/Entered(): (turf/open/gm/river/river, covered) #define COMSIG_MOVABLE_ENTERED_RIVER "movable_entered_river" -/// From /atom/Cross(): (atom) +/// From /atom/movable/proc/doMove: I think it only works with forceMove so watch out #define COMSIG_MOVABLE_PRE_CROSSED "movable_pre_cross" #define COMPONENT_IGNORE_CROSS (1<<0) diff --git a/code/game/turfs/transit.dm b/code/game/turfs/transit.dm index 7d44d34c1bc5..d1094a025a8b 100644 --- a/code/game/turfs/transit.dm +++ b/code/game/turfs/transit.dm @@ -136,7 +136,7 @@ /atom/movable/proc/handle_paradrop(turf/target, dropship_name) clear_active_explosives() - //ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) RegisterSignal(src, COMSIG_MOVABLE_PRE_CROSSED, PROC_REF(cancel_cross)) From 46d246ade668cc19c3db22d97a7b5448be2583ea Mon Sep 17 00:00:00 2001 From: ihatethisengine Date: Wed, 3 Jul 2024 07:35:24 +0300 Subject: [PATCH 4/7] a --- code/game/turfs/transit.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/turfs/transit.dm b/code/game/turfs/transit.dm index d1094a025a8b..7f94534e2987 100644 --- a/code/game/turfs/transit.dm +++ b/code/game/turfs/transit.dm @@ -170,8 +170,11 @@ REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) - UnregisterSignal(src, COMSIG_MOVABLE_PRE_CROSSED) - UnregisterSignal(src, COMSIG_LIVING_FLAMER_FLAMED) + UnregisterSignal(src, list( + COMSIG_MOVABLE_PRE_CROSSED, + COMSIG_LIVING_FLAMER_FLAMED, + COMSIG_LIVING_PREIGNITION + )) overlays -= cables overlays -= chute for(var/atom/movable/atom in loc) From 8d6a217500c7df3fe63d99dcccd406b61b87ceb4 Mon Sep 17 00:00:00 2001 From: ihatethisengine <115417687+ihatethisengine@users.noreply.github.com> Date: Sun, 7 Jul 2024 10:37:48 +0300 Subject: [PATCH 5/7] Update signals_movable.dm --- code/__DEFINES/dcs/signals/atom/signals_movable.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/dcs/signals/atom/signals_movable.dm b/code/__DEFINES/dcs/signals/atom/signals_movable.dm index c43001487719..ad4be2b1dc9f 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_movable.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_movable.dm @@ -12,7 +12,7 @@ /// From /turf/open/gm/river/Entered(): (turf/open/gm/river/river, covered) #define COMSIG_MOVABLE_ENTERED_RIVER "movable_entered_river" /// From /atom/movable/proc/doMove: I think it only works with forceMove so watch out -#define COMSIG_MOVABLE_PRE_CROSSED "movable_pre_cross" +#define COMSIG_MOVABLE_FORCEMOVE_PRE_CROSSED "movable_forcemove_pre_crossed" #define COMPONENT_IGNORE_CROSS (1<<0) ///from /mob/living/carbon/xenomorph/start_pulling(): (mob/living/carbon/xenomorph/X) From 2f1ac2d538df648a6bef376f3954eb5ca6309513 Mon Sep 17 00:00:00 2001 From: ihatethisengine <115417687+ihatethisengine@users.noreply.github.com> Date: Sun, 7 Jul 2024 10:38:22 +0300 Subject: [PATCH 6/7] Update movement.dm --- code/modules/movement/movement.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/movement/movement.dm b/code/modules/movement/movement.dm index c160de82d346..8151d2df6707 100644 --- a/code/modules/movement/movement.dm +++ b/code/modules/movement/movement.dm @@ -140,7 +140,7 @@ destination.Entered(src, oldloc) if(destarea && (old_area != destarea || !isturf(oldloc))) destarea.Entered(src, oldloc) - if(!(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_CROSSED) & COMPONENT_IGNORE_CROSS)) + if(!(SEND_SIGNAL(src, COMSIG_MOVABLE_FORCEMOVE_PRE_CROSSED) & COMPONENT_IGNORE_CROSS)) for(var/atom/movable/AM in destination) if(AM == src) continue From 45fcf32c3a77f046ce97841e0229df55d953b337 Mon Sep 17 00:00:00 2001 From: ihatethisengine <115417687+ihatethisengine@users.noreply.github.com> Date: Sun, 7 Jul 2024 10:42:00 +0300 Subject: [PATCH 7/7] Update transit.dm --- code/game/turfs/transit.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/turfs/transit.dm b/code/game/turfs/transit.dm index 7f94534e2987..5b4645805d3b 100644 --- a/code/game/turfs/transit.dm +++ b/code/game/turfs/transit.dm @@ -139,7 +139,7 @@ ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) ADD_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) - RegisterSignal(src, COMSIG_MOVABLE_PRE_CROSSED, PROC_REF(cancel_cross)) + RegisterSignal(src, COMSIG_MOVABLE_FORCEMOVE_PRE_CROSSED, PROC_REF(cancel_cross)) RegisterSignal(src, list( COMSIG_LIVING_FLAMER_FLAMED, COMSIG_LIVING_PREIGNITION @@ -171,7 +171,7 @@ REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_DROPSHIP_INTERACTION) REMOVE_TRAIT(src, TRAIT_NO_STRAY, TRAIT_SOURCE_DROPSHIP_INTERACTION) UnregisterSignal(src, list( - COMSIG_MOVABLE_PRE_CROSSED, + COMSIG_MOVABLE_FORCEMOVE_PRE_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, COMSIG_LIVING_PREIGNITION ))