From 3fa98bd2ccdd04bb543a0d601c9bc8fdcde1e701 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:10:59 +0100 Subject: [PATCH] [MIRROR] Adds `UPSIDE_DOWN` movetype for negative gravity / makes Atrocinator affected by less things [MDB IGNORE] (#25155) * Adds `UPSIDE_DOWN` movetype for negative gravity / makes Atrocinator affected by less things (#79785) ## About The Pull Request Fixes #79764 I was going to tackle this issue by slamming `TRAIT_NO_SLIP_ALL` on Atrocinator users and calling it a day, but like, that didn't feel proper. So I thought hey, we could just give them the flying movetype, even though they technically aren't flying it means they're unaffected by things that flying would make you unaffected by. Nope, this means the mob technically "negates gravity", so no falling and no feetsteps. Let's try floating - this give us feetsteps but no falling upwards. So instead of going back to square one, with `TRAIT_NO_SLIP_ALL`, I decided to go for the more complex route of just adding a movetype. Hence, move type `UPSIDE_DOWN`. This covers situations where a mob would be "floating" above the ground, but still walking. ...Negative gravity. This means overall the Atrociator acts more as you'd expect - you don't slip on ice, you don't trigger bear traps or mouse traps, you can walk over railings, unaffected by conveyor belts, etc. ## Why It's Good For The Game Makes the Atrocinator a lot more consistent with how you'd expect for it to work. Admittedly it is a bit niche use of movetypes, but it can possibly be expanded to more things in the future, who knows? I applied it to mobs on meat spikes (even though they don't move), just for proof of concept. ## Changelog :cl: Melbert fix: Atrocinating mobs will now behave more as you'd expect. Meaning they don't slip on wet patches, can't trigger bear traps / landmines / mouse traps, ignore conveyors, and can walk over tables and railings. fix: Floating mobs are unaffected by conveyor belts, acid (on the ground), glass tables fix: Floating mobs won't squish stuff like roaches anymore fix: Fixes bear traps triggering on floating / flying mobs /:cl: --------- Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> * Adds `UPSIDE_DOWN` movetype for negative gravity / makes Atrocinator affected by less things --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> --- code/__DEFINES/_flags.dm | 5 ++++ code/__DEFINES/traits/declarations.dm | 2 +- code/__DEFINES/traits/sources.dm | 1 + code/_globalvars/bitfields.dm | 1 + code/_globalvars/traits/_traits.dm | 2 ++ code/_globalvars/traits/admin_tooling.dm | 1 + code/datums/components/acid.dm | 2 +- code/datums/components/caltrop.dm | 2 +- code/datums/components/chasm.dm | 2 +- code/datums/components/conveyor_movement.dm | 2 +- code/datums/components/slippery.dm | 2 +- code/datums/components/squashable.dm | 2 +- code/datums/components/squeak.dm | 2 +- code/datums/elements/immerse.dm | 12 ++++---- code/datums/status_effects/wound_effects.dm | 2 +- .../weather/weather_types/floor_is_lava.dm | 2 +- code/game/objects/effects/mines.dm | 2 +- code/game/objects/items/handcuffs.dm | 29 ++++++++++++++----- .../game/objects/items/stacks/sheets/glass.dm | 2 +- code/game/objects/items/syndie_spraycan.dm | 2 +- code/game/objects/structures/kitchen_spike.dm | 2 ++ code/game/objects/structures/railings.dm | 4 +-- code/game/objects/structures/tables_racks.dm | 2 +- code/game/turfs/open/_open.dm | 3 +- code/game/turfs/open/lava.dm | 4 +-- code/modules/assembly/mousetrap.dm | 2 +- code/modules/clothing/glasses/_glasses.dm | 2 +- .../mega_arachnid/mega_arachnid_abilities.dm | 2 +- .../space_fauna/meteor_heart/spine_traps.dm | 2 +- .../mob/living/carbon/carbon_movement.dm | 2 +- code/modules/mob/living/living.dm | 2 ++ code/modules/mod/modules/modules_maint.dm | 2 ++ code/modules/power/lighting/light_items.dm | 2 +- .../projectile/energy/net_snare.dm | 4 +-- 34 files changed, 71 insertions(+), 41 deletions(-) diff --git a/code/__DEFINES/_flags.dm b/code/__DEFINES/_flags.dm index e0b88066d7d..f5fc50004cd 100644 --- a/code/__DEFINES/_flags.dm +++ b/code/__DEFINES/_flags.dm @@ -163,6 +163,11 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define FLOATING (1<<3) /// When moving, will Cross() everything, but won't stop or Bump() anything. #define PHASING (1<<4) +/// The mob is walking on the ceiling. Or is generally just, upside down. +#define UPSIDE_DOWN (1<<5) + +/// Combination flag for movetypes which, for all intents and purposes, mean the mob is not touching the ground +#define MOVETYPES_NOT_TOUCHING_GROUND (FLYING|FLOATING|UPSIDE_DOWN) //Fire and Acid stuff, for resistance_flags #define LAVA_PROOF (1<<0) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 1945a193018..060dd309fbb 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -531,6 +531,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_MOVE_VENTCRAWLING "move_ventcrawling" #define TRAIT_MOVE_FLOATING "move_floating" #define TRAIT_MOVE_PHASING "move_phasing" +#define TRAIT_MOVE_UPSIDE_DOWN "move_upside_down" /// Disables the floating animation. See above. #define TRAIT_NO_FLOATING_ANIM "no-floating-animation" @@ -843,7 +844,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// changelings with this trait can no longer talk over the hivemind #define TRAIT_CHANGELING_HIVEMIND_MUTE "ling_mute" #define TRAIT_HULK "hulk" - /// Isn't attacked harmfully by blob structures #define TRAIT_BLOB_ALLY "blob_ally" diff --git a/code/__DEFINES/traits/sources.dm b/code/__DEFINES/traits/sources.dm index 3ba0008acb2..6be8cdf3f8d 100644 --- a/code/__DEFINES/traits/sources.dm +++ b/code/__DEFINES/traits/sources.dm @@ -136,6 +136,7 @@ #define SPECIES_FLIGHT_TRAIT "species-flight" #define FROSTMINER_ENRAGE_TRAIT "frostminer-enrage" #define NO_GRAVITY_TRAIT "no-gravity" +#define NEGATIVE_GRAVITY_TRAIT "negative-gravity" /// A trait gained from a mob's leap action, like the leaper #define LEAPING_TRAIT "leaping" diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 27c6de53b53..796def0de16 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -283,6 +283,7 @@ DEFINE_BITFIELD(movement_type, list( "GROUND" = GROUND, "PHASING" = PHASING, "VENTCRAWLING" = VENTCRAWLING, + "UPSIDE_DOWN" = UPSIDE_DOWN, )) DEFINE_BITFIELD(obj_flags, list( diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index c373be5b149..d76376ded36 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -48,6 +48,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_MOVE_GROUND" = TRAIT_MOVE_GROUND, "TRAIT_MOVE_PHASING" = TRAIT_MOVE_PHASING, "TRAIT_MOVE_VENTCRAWLING" = TRAIT_MOVE_VENTCRAWLING, + "TRAIT_MOVE_UPSIDE_DOWN" = TRAIT_MOVE_UPSIDE_DOWN, "TRAIT_NO_FLOATING_ANIM" = TRAIT_NO_FLOATING_ANIM, "TRAIT_NO_MANIFEST_CONTENTS_ERROR" = TRAIT_NO_MANIFEST_CONTENTS_ERROR, "TRAIT_NO_MISSING_ITEM_ERROR" = TRAIT_NO_MISSING_ITEM_ERROR, @@ -569,6 +570,7 @@ GLOBAL_LIST_INIT(movement_type_trait_to_flag, list( TRAIT_MOVE_VENTCRAWLING = VENTCRAWLING, TRAIT_MOVE_FLOATING = FLOATING, TRAIT_MOVE_PHASING = PHASING, + TRAIT_MOVE_UPSIDE_DOWN = UPSIDE_DOWN, )) GLOBAL_LIST_INIT(movement_type_addtrait_signals, set_movement_type_addtrait_signals()) diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index d5d19a25f39..388ea89cc7e 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -15,6 +15,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_MOVE_GROUND" = TRAIT_MOVE_GROUND, "TRAIT_MOVE_PHASING" = TRAIT_MOVE_PHASING, "TRAIT_MOVE_VENTCRAWLING" = TRAIT_MOVE_VENTCRAWLING, + "TRAIT_MOVE_UPSIDE_DOWN" = TRAIT_MOVE_UPSIDE_DOWN, "TRAIT_RUNECHAT_HIDDEN" = TRAIT_RUNECHAT_HIDDEN, "TRAIT_SNOWSTORM_IMMUNE" = TRAIT_SNOWSTORM_IMMUNE, "TRAIT_VOIDSTORM_IMMUNE" = TRAIT_VOIDSTORM_IMMUNE, diff --git a/code/datums/components/acid.dm b/code/datums/components/acid.dm index 1d9cf9e87d6..67be754c504 100644 --- a/code/datums/components/acid.dm +++ b/code/datums/components/acid.dm @@ -254,7 +254,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(!isliving(arrived)) return var/mob/living/crosser = arrived - if(crosser.movement_type & FLYING) + if(crosser.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return if(crosser.move_intent == MOVE_INTENT_WALK) return diff --git a/code/datums/components/caltrop.dm b/code/datums/components/caltrop.dm index 45a9d1976c5..0ec866960e3 100644 --- a/code/datums/components/caltrop.dm +++ b/code/datums/components/caltrop.dm @@ -78,7 +78,7 @@ if((flags & CALTROP_IGNORE_WALKERS) && H.move_intent == MOVE_INTENT_WALK) return - if(H.movement_type & (FLOATING|FLYING)) //check if they are able to pass over us + if(H.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) //check if they are able to pass over us //gravity checking only our parent would prevent us from triggering they're using magboots / other gravity assisting items that would cause them to still touch us. return diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm index 18420016c54..f85ca347aa0 100644 --- a/code/datums/components/chasm.dm +++ b/code/datums/components/chasm.dm @@ -101,7 +101,7 @@ return CHASM_NOT_DROPPING if(is_type_in_typecache(dropped_thing, forbidden_types) || (!isliving(dropped_thing) && !isobj(dropped_thing))) return CHASM_NOT_DROPPING - if(dropped_thing.throwing || (dropped_thing.movement_type & (FLOATING|FLYING))) + if(dropped_thing.throwing || (dropped_thing.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) return CHASM_REGISTER_SIGNALS //Flies right over the chasm diff --git a/code/datums/components/conveyor_movement.dm b/code/datums/components/conveyor_movement.dm index 4439b08e0a7..d8affca3649 100644 --- a/code/datums/components/conveyor_movement.dm +++ b/code/datums/components/conveyor_movement.dm @@ -24,7 +24,7 @@ source.delay = speed //We use the default delay if(living_parent) var/mob/living/moving_mob = parent - if((moving_mob.movement_type & FLYING) && !moving_mob.stat) + if((moving_mob.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) && !moving_mob.stat) return MOVELOOP_SKIP_STEP var/atom/movable/moving_parent = parent if(moving_parent.anchored || !moving_parent.has_gravity()) diff --git a/code/datums/components/slippery.dm b/code/datums/components/slippery.dm index 2119c8ad7e1..620f6baa816 100644 --- a/code/datums/components/slippery.dm +++ b/code/datums/components/slippery.dm @@ -161,7 +161,7 @@ if(HAS_TRAIT(turf, TRAIT_TURF_IGNORE_SLIPPERY)) return var/mob/living/victim = arrived - if((victim.movement_type & (FLYING | FLOATING))) + if(victim.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return if(can_slip_callback && !can_slip_callback.Invoke(holder, victim)) return diff --git a/code/datums/components/squashable.dm b/code/datums/components/squashable.dm index 8174127aeb3..86135faa7bb 100644 --- a/code/datums/components/squashable.dm +++ b/code/datums/components/squashable.dm @@ -54,7 +54,7 @@ return //Everything worked, we're done! if(isliving(crossing_movable)) var/mob/living/crossing_mob = crossing_movable - if(crossing_mob.mob_size > MOB_SIZE_SMALL && !(crossing_mob.movement_type & FLYING)) + if(crossing_mob.mob_size > MOB_SIZE_SMALL && !(crossing_mob.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) if(HAS_TRAIT(crossing_mob, TRAIT_PACIFISM)) crossing_mob.visible_message(span_notice("[crossing_mob] carefully steps over [parent_as_living]."), span_notice("You carefully step over [parent_as_living] to avoid hurting it.")) return diff --git a/code/datums/components/squeak.dm b/code/datums/components/squeak.dm index af0686fd1eb..c5d42797ab4 100644 --- a/code/datums/components/squeak.dm +++ b/code/datums/components/squeak.dm @@ -98,7 +98,7 @@ var/obj/item/I = arrived if(I.item_flags & ABSTRACT) return - if(arrived.movement_type & (FLYING|FLOATING) || !arrived.has_gravity()) + if((arrived.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || !arrived.has_gravity()) return if(ismob(arrived) && !arrived.density) // Prevents 10 overlapping mice from making an unholy sound while moving return diff --git a/code/datums/elements/immerse.dm b/code/datums/elements/immerse.dm index 6449d8de1ad..1a3b37d6530 100644 --- a/code/datums/elements/immerse.dm +++ b/code/datums/elements/immerse.dm @@ -229,7 +229,7 @@ */ /datum/element/immerse/proc/try_immerse(atom/movable/movable, atom/movable/buckled) var/atom/movable/to_check = buckled || movable - if(!(to_check.movement_type & (FLYING|FLOATING)) && !movable.throwing) + if(!(to_check.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) && !movable.throwing) add_immerse_overlay(movable) if(!buckled) RegisterSignal(movable, COMSIG_MOVETYPE_FLAG_ENABLED, PROC_REF(on_move_flag_enabled)) @@ -243,7 +243,7 @@ */ /datum/element/immerse/proc/try_unimmerse(atom/movable/movable, atom/movable/buckled) var/atom/movable/to_check = buckled || movable - if(!(to_check.movement_type & (FLYING|FLOATING)) && !movable.throwing) + if(!(to_check.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) && !movable.throwing) remove_immerse_overlay(movable) if(!buckled) UnregisterSignal(movable, list(COMSIG_MOVETYPE_FLAG_ENABLED, COMSIG_MOVETYPE_FLAG_DISABLED, COMSIG_MOVABLE_POST_THROW, COMSIG_MOVABLE_THROW_LANDED)) @@ -256,7 +256,7 @@ ///Removes the overlay from mob and bucklees is flying. /datum/element/immerse/proc/on_move_flag_enabled(atom/movable/source, flag, old_movement_type) SIGNAL_HANDLER - if(!(flag & (FLYING|FLOATING)) || old_movement_type & (FLYING|FLOATING) || source.throwing) + if(!(flag & MOVETYPES_NOT_TOUCHING_GROUND) || (old_movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || source.throwing) return remove_immerse_overlay(source) for(var/mob/living/buckled_mob as anything in source.buckled_mobs) @@ -265,7 +265,7 @@ ///Works just like on_move_flag_enabled, except it only has to check that movable isn't flying /datum/element/immerse/proc/on_throw(atom/movable/source) SIGNAL_HANDLER - if(source.movement_type & (FLYING|FLOATING)) + if(source.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return remove_immerse_overlay(source) for(var/mob/living/buckled_mob as anything in source.buckled_mobs) @@ -274,7 +274,7 @@ ///Readds the overlay to the mob and bucklees if no longer flying. /datum/element/immerse/proc/on_move_flag_disabled(atom/movable/source, flag, old_movement_type) SIGNAL_HANDLER - if(!(flag & (FLYING|FLOATING)) || source.movement_type & (FLYING|FLOATING) || source.throwing) + if(!(flag & MOVETYPES_NOT_TOUCHING_GROUND) || (source.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || source.throwing) return add_immerse_overlay(source) for(var/mob/living/buckled_mob as anything in source.buckled_mobs) @@ -283,7 +283,7 @@ ///Works just like on_move_flag_disabled, except it only has to check that movable isn't flying /datum/element/immerse/proc/on_throw_landed(atom/movable/source) SIGNAL_HANDLER - if(source.movement_type & (FLYING|FLOATING)) + if(source.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return add_immerse_overlay(source) for(var/mob/living/buckled_mob as anything in source.buckled_mobs) diff --git a/code/datums/status_effects/wound_effects.dm b/code/datums/status_effects/wound_effects.dm index 6ec793c5672..f7d640a6d1c 100644 --- a/code/datums/status_effects/wound_effects.dm +++ b/code/datums/status_effects/wound_effects.dm @@ -67,7 +67,7 @@ /datum/status_effect/limp/proc/check_step(mob/whocares, OldLoc, Dir, forced) SIGNAL_HANDLER - if(!owner.client || owner.body_position == LYING_DOWN || !owner.has_gravity() || (owner.movement_type & FLYING) || forced || owner.buckled) + if(!owner.client || owner.body_position == LYING_DOWN || !owner.has_gravity() || (owner.movement_type & (FLYING|FLOATING)) || forced || owner.buckled) return // less limping while we have determination still diff --git a/code/datums/weather/weather_types/floor_is_lava.dm b/code/datums/weather/weather_types/floor_is_lava.dm index df4e9eec0f0..03ed0c68c31 100644 --- a/code/datums/weather/weather_types/floor_is_lava.dm +++ b/code/datums/weather/weather_types/floor_is_lava.dm @@ -39,7 +39,7 @@ for(var/obj/structure/structure_to_check in mob_turf) if(structure_to_check.density) return FALSE - if(mob_to_check.movement_type & (FLYING|FLOATING)) + if(mob_to_check.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return FALSE /datum/weather/floor_is_lava/weather_act(mob/living/victim) diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 1ea301a1427..0731cf8c0c6 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -71,7 +71,7 @@ return FALSE living_mob = on_who - if(living_mob?.incorporeal_move || on_who.movement_type & FLYING) + if(living_mob?.incorporeal_move || (on_who.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) return foot_on_mine ? IS_WEAKREF_OF(on_who, foot_on_mine) : FALSE //Only go boom if their foot was on the mine PRIOR to flying/phasing. You fucked up, you live with the consequences. return TRUE diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 5472f880755..45aed58c91c 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -380,7 +380,7 @@ . = ..() update_appearance() var/static/list/loc_connections = list( - COMSIG_ATOM_ENTERED = PROC_REF(spring_trap), + COMSIG_ATOM_ENTERED = PROC_REF(trap_stepped_on), ) AddElement(/datum/element/connect_loc, loc_connections) @@ -412,10 +412,23 @@ update_appearance() playsound(src, 'sound/effects/snap.ogg', 50, TRUE) -/obj/item/restraints/legcuffs/beartrap/proc/spring_trap(datum/source, atom/movable/target, thrown_at = FALSE) +/obj/item/restraints/legcuffs/beartrap/proc/trap_stepped_on(datum/source, atom/movable/entering, ...) SIGNAL_HANDLER + + spring_trap(entering) + +/** + * Tries to spring the trap on the target movable. + * + * This proc is safe to call without knowing if the target is valid or if the trap is armed. + * + * Does not trigger on tiny mobs. + * If ignore_movetypes is FALSE, does not trigger on floating / flying / etc. mobs. + */ +/obj/item/restraints/legcuffs/beartrap/proc/spring_trap(atom/movable/target, ignore_movetypes = FALSE) if(!armed || !isturf(loc) || !isliving(target)) return + var/mob/living/victim = target if(istype(victim.buckled, /obj/vehicle)) var/obj/vehicle/ridden_vehicle = victim.buckled @@ -424,12 +437,14 @@ ridden_vehicle.visible_message(span_danger("[ridden_vehicle] triggers \the [src].")) return - //don't close the trap if they're as small as a mouse, or not touching the ground - if(victim.mob_size <= MOB_SIZE_TINY || (!thrown_at && victim.movement_type & (FLYING|FLOATING))) + //don't close the trap if they're as small as a mouse + if(victim.mob_size <= MOB_SIZE_TINY) + return + if(!ignore_movetypes && (victim.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) return close_trap() - if(thrown_at) + if(ignore_movetypes) victim.visible_message(span_danger("\The [src] ensnares [victim]!"), \ span_userdanger("\The [src] ensnares you!")) else @@ -477,7 +492,7 @@ qdel(src) /obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user, list/modifiers) - spring_trap(null, user) + spring_trap(user) return ..() /obj/item/restraints/legcuffs/beartrap/energy/cyborg @@ -554,7 +569,7 @@ /obj/item/restraints/legcuffs/bola/energy/ensnare(atom/hit_atom) var/obj/item/restraints/legcuffs/beartrap/energy/cyborg/B = new (get_turf(hit_atom)) - B.spring_trap(null, hit_atom, TRUE) + B.spring_trap(hit_atom, ignore_movetypes = TRUE) qdel(src) /** diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index e198ff6121d..7a180bc5dbd 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -388,7 +388,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( SIGNAL_HANDLER if(isliving(AM)) var/mob/living/L = AM - if(!(L.movement_type & (FLYING|FLOATING)) || L.buckled) + if(!(L.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || L.buckled) playsound(src, 'sound/effects/footstep/glass_step.ogg', HAS_TRAIT(L, TRAIT_LIGHT_STEP) ? 30 : 50, TRUE) /obj/item/shard/plasma diff --git a/code/game/objects/items/syndie_spraycan.dm b/code/game/objects/items/syndie_spraycan.dm index 78ffb6a4772..deab6229a28 100644 --- a/code/game/objects/items/syndie_spraycan.dm +++ b/code/game/objects/items/syndie_spraycan.dm @@ -181,7 +181,7 @@ * * victim - whoever just slipped, point and laugh at them */ /obj/effect/decal/cleanable/traitor_rune/proc/slip(mob/living/victim) - if(victim.movement_type & FLYING) + if(victim.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return if (!victim.slip(slip_time, src, slip_flags)) return diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index 1b2816d73db..fd4daaeaa18 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -125,6 +125,7 @@ m180.Turn(180) animate(target, transform = m180, time = 3) target.pixel_y = target.base_pixel_y + PIXEL_Y_OFFSET_LYING + ADD_TRAIT(target, TRAIT_MOVE_UPSIDE_DOWN, REF(src)) /obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/user) if(buckled_mob != user) @@ -156,6 +157,7 @@ m180.Turn(180) animate(buckled_mob, transform = m180, time = 3) buckled_mob.pixel_y = buckled_mob.base_pixel_y + PIXEL_Y_OFFSET_LYING + REMOVE_TRAIT(buckled_mob, TRAIT_MOVE_UPSIDE_DOWN, REF(src)) /obj/structure/kitchenspike/deconstruct(disassembled = TRUE) if(disassembled) diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index fa12148d330..5d3c4aee07c 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -121,7 +121,7 @@ /obj/structure/railing/CanPass(atom/movable/mover, border_dir) . = ..() if(border_dir & dir) - return . || mover.throwing || mover.movement_type & (FLYING | FLOATING) + return . || mover.throwing || (mover.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return TRUE /obj/structure/railing/CanAStarPass(to_dir, datum/can_pass_info/pass_info) @@ -144,7 +144,7 @@ if (leaving.throwing) return - if (leaving.movement_type & (PHASING | FLYING | FLOATING)) + if (leaving.movement_type & (PHASING|MOVETYPES_NOT_TOUCHING_GROUND)) return if (leaving.move_force >= MOVE_FORCE_EXTREMELY_STRONG) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index c80e2da85d6..78357a5dd4a 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -450,7 +450,7 @@ check_break(M) /obj/structure/table/glass/proc/check_break(mob/living/M) - if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL && !(M.movement_type & FLYING)) + if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL && !(M.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) table_shatter(M) /obj/structure/table/glass/proc/table_shatter(mob/living/victim) diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm index 657d94d5c5f..6b83427a7b2 100644 --- a/code/game/turfs/open/_open.dm +++ b/code/game/turfs/open/_open.dm @@ -285,7 +285,7 @@ return TRUE /turf/open/handle_slip(mob/living/carbon/slipper, knockdown_amount, obj/slippable, lube, paralyze_amount, force_drop) - if(slipper.movement_type & (FLYING | FLOATING)) + if(slipper.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return FALSE if(!has_gravity(src)) return FALSE @@ -446,4 +446,3 @@ playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE) new /obj/structure/girder/tram(src) - diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index 567aa8710c7..3b382069f58 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -246,7 +246,7 @@ . = TRUE /turf/open/lava/proc/can_burn_stuff(atom/movable/burn_target) - if(burn_target.movement_type & (FLYING|FLOATING)) //you're flying over it. + if(burn_target.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) //you're flying over it. return LAVA_BE_IGNORING if(isobj(burn_target)) @@ -265,7 +265,7 @@ var/mob/living/burn_living = burn_target var/atom/movable/burn_buckled = burn_living.buckled if(burn_buckled) - if(burn_buckled.movement_type & (FLYING|FLOATING)) + if(burn_buckled.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return LAVA_BE_PROCESSING if(isobj(burn_buckled)) var/obj/burn_buckled_obj = burn_buckled diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index e706c6f7598..1f760e29b89 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -189,7 +189,7 @@ if(armed) if(ismob(AM)) var/mob/MM = AM - if(!(MM.movement_type & FLYING)) + if(!(MM.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) if(ishuman(AM)) var/mob/living/carbon/H = AM if(H.move_intent == MOVE_INTENT_RUN) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 32e2a567f63..a176a84dfa4 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -296,7 +296,7 @@ return if(isliving(movable)) var/mob/living/crusher = movable - if(crusher.move_intent != MOVE_INTENT_WALK && (!(crusher.movement_type & (FLYING|FLOATING)) || crusher.buckled)) + if(crusher.move_intent != MOVE_INTENT_WALK && (!(crusher.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || crusher.buckled)) playsound(src, 'sound/effects/footstep/glass_step.ogg', 30, TRUE) visible_message(span_warning("[crusher] steps on [src], damaging it!")) take_damage(100, sound_effect = FALSE) diff --git a/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm b/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm index 6e8ff992891..d82812b62a3 100644 --- a/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm +++ b/code/modules/mob/living/basic/jungle/mega_arachnid/mega_arachnid_abilities.dm @@ -22,7 +22,7 @@ if(!iscarbon(target) || blocked >= 100) return var/obj/item/restraints/legcuffs/beartrap/mega_arachnid/restraint = new(get_turf(target)) - restraint.spring_trap(null, target) + restraint.spring_trap(target) /obj/item/restraints/legcuffs/beartrap/mega_arachnid name = "fleshy restraints" diff --git a/code/modules/mob/living/basic/space_fauna/meteor_heart/spine_traps.dm b/code/modules/mob/living/basic/space_fauna/meteor_heart/spine_traps.dm index 4f7135b1deb..8ddcc1ed9e4 100644 --- a/code/modules/mob/living/basic/space_fauna/meteor_heart/spine_traps.dm +++ b/code/modules/mob/living/basic/space_fauna/meteor_heart/spine_traps.dm @@ -86,7 +86,7 @@ /// Called when something enters our turf, if it is a non-flying mob then give it a stab /obj/effect/temp_visual/thrusting_spines/proc/on_entered(datum/source, atom/movable/arrived) - if (!active || !isliving(arrived) || (arrived.movement_type & (FLYING | FLOATING))) + if (!active || !isliving(arrived) || (arrived.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) return if (!COOLDOWN_FINISHED(src, thrust_delay)) return diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 82bda7c7cd4..d900706f102 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -1,5 +1,5 @@ /mob/living/carbon/slip(knockdown_amount, obj/slipped_on, lube_flags, paralyze, force_drop = FALSE) - if(movement_type & (FLYING | FLOATING)) + if(movement_type & MOVETYPES_NOT_TOUCHING_GROUND) return FALSE if(!(lube_flags & SLIDE_ICE)) log_combat(src, (slipped_on || get_turf(src)), "slipped on the", null, ((lube_flags & SLIDE) ? "(SLIDING)" : null)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 802f8ed1975..6095638318d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1241,6 +1241,7 @@ if(-INFINITY to NEGATIVE_GRAVITY) if(!istype(gravity_alert, /atom/movable/screen/alert/negative)) throw_alert(ALERT_GRAVITY, /atom/movable/screen/alert/negative) + ADD_TRAIT(src, TRAIT_MOVE_UPSIDE_DOWN, NEGATIVE_GRAVITY_TRAIT) var/matrix/flipped_matrix = transform flipped_matrix.b = -flipped_matrix.b flipped_matrix.e = -flipped_matrix.e @@ -1265,6 +1266,7 @@ if(istype(gravity_alert, /atom/movable/screen/alert/weightless)) REMOVE_TRAIT(src, TRAIT_MOVE_FLOATING, NO_GRAVITY_TRAIT) if(istype(gravity_alert, /atom/movable/screen/alert/negative)) + REMOVE_TRAIT(src, TRAIT_MOVE_UPSIDE_DOWN, NEGATIVE_GRAVITY_TRAIT) var/matrix/flipped_matrix = transform flipped_matrix.b = -flipped_matrix.b flipped_matrix.e = -flipped_matrix.e diff --git a/code/modules/mod/modules/modules_maint.dm b/code/modules/mod/modules/modules_maint.dm index f7b53eaa9f0..30889e4f982 100644 --- a/code/modules/mod/modules/modules_maint.dm +++ b/code/modules/mod/modules/modules_maint.dm @@ -288,6 +288,7 @@ RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(check_upstairs)) RegisterSignal(mod.wearer, COMSIG_MOB_SAY, PROC_REF(on_talk)) ADD_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, MOD_TRAIT) + passtable_on(mod.wearer, MOD_TRAIT) check_upstairs() //todo at some point flip your screen around /obj/item/mod/module/atrocinator/on_deactivation(display_message = TRUE, deleting = FALSE) @@ -304,6 +305,7 @@ UnregisterSignal(mod.wearer, COMSIG_MOB_SAY) step_count = 0 REMOVE_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, MOD_TRAIT) + passtable_off(mod.wearer, MOD_TRAIT) var/turf/open/openspace/current_turf = get_turf(mod.wearer) if(istype(current_turf)) current_turf.zFall(mod.wearer, falling_from_move = TRUE) diff --git a/code/modules/power/lighting/light_items.dm b/code/modules/power/lighting/light_items.dm index 9f2bff9cdca..5e9df6ee432 100644 --- a/code/modules/power/lighting/light_items.dm +++ b/code/modules/power/lighting/light_items.dm @@ -116,7 +116,7 @@ if(!isliving(moving_atom)) return var/mob/living/moving_mob = moving_atom - if(!(moving_mob.movement_type & (FLYING|FLOATING)) || moving_mob.buckled) + if(!(moving_mob.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || moving_mob.buckled) playsound(src, 'sound/effects/footstep/glass_step.ogg', HAS_TRAIT(moving_mob, TRAIT_LIGHT_STEP) ? 30 : 50, TRUE) if(status == LIGHT_BURNED || status == LIGHT_OK) shatter(moving_mob) diff --git a/code/modules/projectiles/projectile/energy/net_snare.dm b/code/modules/projectiles/projectile/energy/net_snare.dm index c60c0c35d17..925096f6351 100644 --- a/code/modules/projectiles/projectile/energy/net_snare.dm +++ b/code/modules/projectiles/projectile/energy/net_snare.dm @@ -69,7 +69,7 @@ new/obj/item/restraints/legcuffs/beartrap/energy(get_turf(loc)) else if(iscarbon(target)) var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy(get_turf(target)) - B.spring_trap(null, target) + B.spring_trap(target) . = ..() /obj/projectile/energy/trap/on_range() @@ -88,7 +88,7 @@ qdel(src) if(iscarbon(target)) var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target)) - B.spring_trap(null, target) + B.spring_trap(target) QDEL_IN(src, 10) . = ..()