Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes to paradropping #6609

Merged
merged 7 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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/movable/proc/doMove: I think it only works with forceMove so watch out
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved
#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)
#define COMSIG_MOVABLE_XENO_START_PULLING "movable_xeno_start_pulling"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions code/game/turfs/transit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@
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)
RegisterSignal(src, COMSIG_MOVABLE_FORCEMOVE_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")
Expand All @@ -163,8 +169,18 @@
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)
UnregisterSignal(src, list(
COMSIG_MOVABLE_FORCEMOVE_PRE_CROSSED,
COMSIG_LIVING_FLAMER_FLAMED,
COMSIG_LIVING_PREIGNITION
))
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)
Expand Down Expand Up @@ -232,6 +248,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
Expand Down
10 changes: 5 additions & 5 deletions code/modules/movement/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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_FORCEMOVE_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
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading