From 1e4ff8e38980fda4a34841b9df6253a576d61e90 Mon Sep 17 00:00:00 2001 From: kawoppi <94711066+kawoppi@users.noreply.github.com> Date: Sat, 13 May 2023 06:38:25 +0200 Subject: [PATCH 1/3] animates the *jump, *shiver, *sway, *tremble, *twitch and *twitch_s emotes (#75345) ## About The Pull Request Using the *jump, *shiver, *sway, *tremble, *twitch or *twitch_s emote will now animate the position of your character for a little bit. Also the *jump emote plays a sound now. The effects can be seen [here](https://youtu.be/tCoAOrHJbNg). The *jump sound has been changed, it now sounds like this: https://github.com/tgstation/tgstation/assets/94711066/8ee92429-7c94-4a11-a8c1-972b305b1d9f ## Why It's Good For The Game Having these emotes actually display on your character makes them a bit more lively. ## Changelog :cl: add: added animations to the *jump, *shiver, *sway, *tremble, *twitch and *twitch_s emotes add: the *jump emote now plays a sound /:cl: --------- Co-authored-by: san7890 --- code/modules/mob/living/emote.dm | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index c2b7e27c2487..e12f690813bd 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -224,6 +224,16 @@ message = "jumps!" hands_use_check = TRUE +/datum/emote/living/jump/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_y = user.pixel_y + 4, time = 0.1 SECONDS) + animate(pixel_y = user.pixel_y - 4, time = 0.1 SECONDS) + +/datum/emote/living/jump/get_sound(mob/living/user) + return 'sound/weapons/thudswoosh.ogg' + /datum/emote/living/kiss key = "kiss" key_third_person = "kisses" @@ -347,6 +357,18 @@ key_third_person = "shiver" message = "shivers." +#define SHIVER_LOOP_DURATION (1 SECONDS) +/datum/emote/living/shiver/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_x = user.pixel_x + 1, time = 0.1 SECONDS) + for(var/i in 1 to SHIVER_LOOP_DURATION / (0.2 SECONDS)) //desired total duration divided by the iteration duration to give the necessary iteration count + animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS) +#undef SHIVER_LOOP_DURATION + /datum/emote/living/sigh key = "sigh" key_third_person = "sighs" @@ -437,6 +459,16 @@ key_third_person = "sways" message = "sways around dizzily." +/datum/emote/living/sway/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_x = user.pixel_x + 2, time = 0.5 SECONDS) + for(var/i in 1 to 2) + animate(pixel_x = user.pixel_x - 4, time = 1.0 SECONDS) + animate(pixel_x = user.pixel_x + 4, time = 1.0 SECONDS) + animate(pixel_x = user.pixel_x - 2, time = 0.5 SECONDS) + /datum/emote/living/tilt key = "tilt" key_third_person = "tilts" @@ -447,15 +479,44 @@ key_third_person = "trembles" message = "trembles in fear!" +#define TREMBLE_LOOP_DURATION (4.4 SECONDS) +/datum/emote/living/tremble/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_x = user.pixel_x + 2, time = 0.2 SECONDS) + for(var/i in 1 to TREMBLE_LOOP_DURATION / (0.4 SECONDS)) //desired total duration divided by the iteration duration to give the necessary iteration count + animate(pixel_x = user.pixel_x - 2, time = 0.2 SECONDS) + animate(pixel_x = user.pixel_x + 2, time = 0.2 SECONDS) + animate(pixel_x = user.pixel_x - 2, time = 0.2 SECONDS) +#undef TREMBLE_LOOP_DURATION + /datum/emote/living/twitch key = "twitch" key_third_person = "twitches" message = "twitches violently." +/datum/emote/living/twitch/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_x = user.pixel_x - 1, time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS) + animate(time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x - 1, time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS) + /datum/emote/living/twitch_s key = "twitch_s" message = "twitches." +/datum/emote/living/twitch_s/run_emote(mob/living/user, params, type_override, intentional) + . = ..() + if(!.) + return FALSE + animate(user, pixel_x = user.pixel_x - 1, time = 0.1 SECONDS) + animate(pixel_x = user.pixel_x + 1, time = 0.1 SECONDS) + /datum/emote/living/wave key = "wave" key_third_person = "waves" From 7fa71cb0b93f87d79aa74b92f3ecafaa4d2e431c Mon Sep 17 00:00:00 2001 From: itseasytosee <55666666+itseasytosee@users.noreply.github.com> Date: Fri, 21 Jul 2023 00:58:05 -0500 Subject: [PATCH 2/3] The Leaning Update (and Density Refractor) (#76704) WHAT HAS CHANGED MECHANICALLY You can now lean up against walls. https://github.com/tgstation/tgstation/assets/55666666/bf81b7b5-6cab-4fc3-9887-075351511505 To lean against a wall, simply face opposite to it and drag your sprite onto it. Doing so makes you non-dense, just like if you were laying down. This means people can walk through you, but you are still susceptible to melee and ranged attacks. Leaning up against a wall also mitigates your FOV loss by 30 degrees, as you can have a better look at your surrounding when you put more of your surroundings infront of you. Because it seemed thematic to lean up against the wall while smoking and then flick a cigarette away, cigarettes will now say they where "flicked" instead of thrown when you toss them, I also took the time to add a bit of variation into the throw text. A few bugs where you could become non dense and then run straight through people has been patched. NOT PLAYER FACING So basically I've implemented a system that keeps effects that manage a mob's density consistent with eachother. An example of some of the situations that could occur Effect A would render a spaceman undense and turn the player dense again once it was concluded Effect B would render a spaceman undense and then after a timer revert the spaceman to whatever state the spaceman was in before effect B started. Thus if you enabled effect A and then Effect B, setting your previous state of denseness to undense, and then concluded effect A, when Effect B would finish it would put you back into the state of density you were in when you started. This would render the spaceman permanently undense. To solve this, the system has been updated so that all instances of density adjustment to mobs are handled by traits from unique sources (with the exception undensity gained by laying down due to its prevalence.) All effects that handle density will no longer step on each others toes and can now be rain simultaneously without fear. Leaning is cool. Bugs are bad. :cl: itseasytosee add: You can now lean against walls! Simply turn your back to the wall and clickdrag yourself onto it. fix: There should no longer be any instances of spacemen being able to run straight through eachother as if they weren't even there. spellcheck: Added more variance to item throwing text. refactor: Mob density has been refactored /:cl: --- code/__DEFINES/traits.dm | 14 ++++++ code/_globalvars/traits.dm | 2 + code/datums/actions/mobs/lava_swoop.dm | 4 +- code/datums/components/riding/riding_mob.dm | 4 +- code/datums/components/shrink.dm | 9 +++- code/game/objects/items.dm | 2 + code/game/objects/items/cigs_lighters.dm | 1 + code/game/turfs/closed/walls.dm | 46 +++++++++++++++++++ code/modules/mob/living/basic/basic.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 11 ++++- .../mob/living/carbon/carbon_defines.dm | 2 + code/modules/mob/living/init_signals.dm | 6 +++ code/modules/mob/living/living.dm | 16 +++++-- code/modules/mob/living/living_fov.dm | 2 + .../simple_animal/hostile/jungle/leaper.dm | 8 ++-- .../simple_animal/hostile/jungle/mook.dm | 8 ++-- .../hostile/megafauna/hierophant.dm | 4 +- .../mob/living/simple_animal/hostile/mimic.dm | 4 +- .../hostile/mining_mobs/elites/pandora.dm | 4 +- .../mob/living/simple_animal/simple_animal.dm | 4 +- code/modules/pai/shell.dm | 4 +- 21 files changed, 126 insertions(+), 33 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7ef7a0f10c38..b30b96f0662a 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -144,6 +144,10 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_PULL_BLOCKED "pullblocked" /// Abstract condition that prevents movement if being pulled and might be resisted against. Handcuffs and straight jackets, basically. #define TRAIT_RESTRAINED "restrained" +/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! +#define TRAIT_UNDENSE "undense" +/// Expands our FOV by 30 degrees if restricted +#define TRAIT_EXPANDED_FOV "expanded_fov" /// Doesn't miss attacks #define TRAIT_PERFECT_ATTACKER "perfect_attacker" #define TRAIT_INCAPACITATED "incapacitated" @@ -899,6 +903,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define SUIT_TRAIT "suit" /// Trait associated to lying down (having a [lying_angle] of a different value than zero). #define LYING_DOWN_TRAIT "lying-down" +/// A trait gained by leaning against a wall +#define LEANING_TRAIT "leaning" /// Trait associated to lacking electrical power. #define POWER_LACK_TRAIT "power-lack" /// Trait associated to lacking motor movement @@ -968,7 +974,15 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define SPECIES_FLIGHT_TRAIT "species-flight" #define FROSTMINER_ENRAGE_TRAIT "frostminer-enrage" #define NO_GRAVITY_TRAIT "no-gravity" +/// A trait gained from a mob's leap action, like the leaper #define LEAPING_TRAIT "leaping" +/// A trait gained from a mob's vanish action, like the herophant +#define VANISHING_TRAIT "vanishing" +/// A trait gained from a mob's swoop action, like the ash drake +#define SWOOPING_TRAIT "swooping" +/// A trait gained from a mob's mimic ability, like the mimic +#define MIMIC_TRAIT "mimic" +#define SHRUNKEN_TRAIT "shrunken" #define LEAPER_BUBBLE_TRAIT "leaper-bubble" #define DNA_VAULT_TRAIT "dna_vault" /// sticky nodrop sounds like a bad soundcloud rapper's name diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 55326d5633ef..fce0b00572d0 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -192,6 +192,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_MIMING" = TRAIT_MIMING, "TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION" = TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION, "TRAIT_UNOBSERVANT" = TRAIT_UNOBSERVANT, + "TRAIT_UNDENSE" = TRAIT_UNDENSE, + "TRAIT_EXPANDED_FOV" = TRAIT_EXPANDED_FOV, "TRAIT_TENTACLE_IMMUNE" = TRAIT_TENTACLE_IMMUNE, "TRAIT_OVERWATCH_IMMUNE" = TRAIT_OVERWATCH_IMMUNE, ), diff --git a/code/datums/actions/mobs/lava_swoop.dm b/code/datums/actions/mobs/lava_swoop.dm index d23252c73aac..d18ad2f3af3b 100644 --- a/code/datums/actions/mobs/lava_swoop.dm +++ b/code/datums/actions/mobs/lava_swoop.dm @@ -38,7 +38,7 @@ return // stop swooped target movement swooping = TRUE - owner.set_density(FALSE) + ADD_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) owner.visible_message(span_boldwarning("[owner] swoops up high!")) var/negative @@ -115,7 +115,7 @@ for(var/mob/M in range(7, owner)) shake_camera(M, 15, 1) - owner.set_density(TRUE) + REMOVE_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) SLEEP_CHECK_DEATH(1, owner) swooping = FALSE if(!lava_success) diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm index 5a829df75f81..7c182d621183 100644 --- a/code/datums/components/riding/riding_mob.dm +++ b/code/datums/components/riding/riding_mob.dm @@ -203,7 +203,7 @@ human_parent.buckle_lying = 0 // the riding mob is made nondense so they don't bump into any dense atoms the carrier is pulling, // since pulled movables are moved before buckled movables - riding_mob.set_density(FALSE) + ADD_TRAIT(riding_mob, TRAIT_UNDENSE, VEHICLE_TRAIT) else if(ride_check_flags & CARRIER_NEEDS_ARM) // fireman human_parent.buckle_lying = 90 @@ -227,7 +227,7 @@ unequip_buckle_inhands(parent) var/mob/living/carbon/human/H = parent H.remove_movespeed_modifier(/datum/movespeed_modifier/human_carry) - former_rider.set_density(!former_rider.body_position) + REMOVE_TRAIT(H, TRAIT_UNDENSE, VEHICLE_TRAIT) return ..() /// If the carrier shoves the person they're carrying, force the carried mob off diff --git a/code/datums/components/shrink.dm b/code/datums/components/shrink.dm index 9c1c5f76dcde..67cd3d39e23c 100644 --- a/code/datums/components/shrink.dm +++ b/code/datums/components/shrink.dm @@ -10,10 +10,11 @@ parent_atom.transform = parent_atom.transform.Scale(0.5,0.5) olddens = parent_atom.density oldopac = parent_atom.opacity - parent_atom.set_density(FALSE) + parent_atom.set_opacity(FALSE) if(isliving(parent_atom)) var/mob/living/L = parent_atom + ADD_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT) L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray) if(iscarbon(L)) var/mob/living/carbon/C = L @@ -23,6 +24,8 @@ if(ishuman(C)) var/mob/living/carbon/human/H = C H.physiology.damage_resistance -= 100//carbons take double damage while shrunk + else + parent_atom.set_density(FALSE) // this is handled by the UNDENSE trait on mobs parent_atom.visible_message(span_warning("[parent_atom] shrinks down to a tiny size!"), span_userdanger("Everything grows bigger!")) QDEL_IN(src, shrink_time) @@ -30,12 +33,14 @@ /datum/component/shrink/Destroy() var/atom/parent_atom = parent parent_atom.transform = parent_atom.transform.Scale(2,2) - parent_atom.set_density(olddens) parent_atom.set_opacity(oldopac) if(isliving(parent_atom)) var/mob/living/L = parent_atom L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray) + REMOVE_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT) if(ishuman(L)) var/mob/living/carbon/human/H = L H.physiology.damage_resistance += 100 + else + parent_atom.set_density(olddens) // this is handled by the UNDENSE trait on mobs return ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index e3af3614fa1c..84e64497afb5 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -212,6 +212,8 @@ var/offensive_notes /// Used in obj/item/examine to determines whether or not to detail an item's statistics even if it does not meet the force requirements var/override_notes = FALSE + /// Used if we want to have a custom verb text for throwing. "John Spaceman flicks the ciggerate" for example. + var/throw_verb /obj/item/Initialize(mapload) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index eb9444784e21..4fc8935b3d49 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -138,6 +138,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM body_parts_covered = null grind_results = list() heat = 1000 + throw_verb = "flick" /// Whether this cigarette has been lit. var/lit = FALSE /// Whether this cigarette should start lit. diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 4d7595b91895..acac18383a91 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -1,4 +1,5 @@ #define MAX_DENT_DECALS 15 +#define LEANING_OFFSET 11 /turf/closed/wall name = "wall" @@ -33,6 +34,50 @@ var/list/dent_decals +/turf/closed/wall/MouseDrop_T(mob/living/carbon/carbon_mob, mob/user) + ..() + if(carbon_mob != user) + return + if(carbon_mob.is_leaning == TRUE) + return + if(carbon_mob.pulledby) + return + if(!carbon_mob.density) + return + carbon_mob.is_leaning = TRUE + var/turf/checked_turf = get_step(carbon_mob, turn(carbon_mob.dir, 180)) + if(checked_turf == src) + carbon_mob.start_leaning(src) + +/mob/living/carbon/proc/start_leaning(obj/wall) + + switch(dir) + if(SOUTH) + pixel_y += LEANING_OFFSET + if(NORTH) + pixel_y += -LEANING_OFFSET + if(WEST) + pixel_x += LEANING_OFFSET + if(EAST) + pixel_x += -LEANING_OFFSET + + ADD_TRAIT(src, TRAIT_UNDENSE, LEANING_TRAIT) + ADD_TRAIT(src, TRAIT_EXPANDED_FOV, LEANING_TRAIT) + visible_message(span_notice("[src] leans against \the [wall]!"), \ + span_notice("You lean against \the [wall]!")) + RegisterSignals(src, list(COMSIG_MOB_CLIENT_PRE_MOVE, COMSIG_HUMAN_DISARM_HIT, COMSIG_LIVING_GET_PULLED, COMSIG_MOVABLE_TELEPORTING, COMSIG_ATOM_DIR_CHANGE), PROC_REF(stop_leaning)) + update_fov() + +/mob/living/carbon/proc/stop_leaning() + SIGNAL_HANDLER + UnregisterSignal(src, list(COMSIG_MOB_CLIENT_PRE_MOVE, COMSIG_HUMAN_DISARM_HIT, COMSIG_LIVING_GET_PULLED, COMSIG_MOVABLE_TELEPORTING, COMSIG_ATOM_DIR_CHANGE)) + is_leaning = FALSE + pixel_y = base_pixel_y + body_position_pixel_x_offset + pixel_x = base_pixel_y + body_position_pixel_y_offset + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEANING_TRAIT) + REMOVE_TRAIT(src, TRAIT_EXPANDED_FOV, LEANING_TRAIT) + update_fov() + /turf/closed/wall/Initialize(mapload) . = ..() if(!can_engrave) @@ -329,3 +374,4 @@ girder_type = /obj/structure/foamedmetal #undef MAX_DENT_DECALS +#undef LEANING_OFFSET diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index 14ff9c0e5f38..4ba206bd46fa 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -152,7 +152,7 @@ if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) SEND_SIGNAL(src, COMSIG_BASICMOB_LOOK_DEAD) /mob/living/basic/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE) @@ -167,7 +167,7 @@ if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) - set_density(FALSE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) SEND_SIGNAL(src, COMSIG_BASICMOB_LOOK_ALIVE) /mob/living/basic/update_sight() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 337c7e0d7e10..fa850f0a3a8a 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -164,6 +164,9 @@ return FALSE var/atom/movable/thrown_thing var/obj/item/held_item = get_active_held_item() + var/verb_text = pick("throw", "toss", "hurl", "chuck", "fling") + if(prob(0.5)) + verb_text = "yeet" var/neckgrab_throw = FALSE // we can't check for if it's a neckgrab throw when totaling up power_throw since we've already stopped pulling them by then, so get it early if(!held_item) if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE) @@ -194,8 +197,12 @@ power_throw++ if(neckgrab_throw) power_throw++ - visible_message(span_danger("[src] throws [thrown_thing][power_throw ? " really hard!" : "."]"), \ - span_danger("You throw [thrown_thing][power_throw ? " really hard!" : "."]")) + if(isitem(thrown_thing)) + var/obj/item/thrown_item = thrown_thing + if(thrown_item.throw_verb) + verb_text = thrown_item.throw_verb + visible_message(span_danger("[src] [plural_s(verb_text)] [thrown_thing][power_throw ? " really hard!" : "."]"), \ + span_danger("You [verb_text] [thrown_thing][power_throw ? " really hard!" : "."]")) log_message("has thrown [thrown_thing] [power_throw > 0 ? "really hard" : ""]", LOG_ATTACK) var/extra_throw_range = HAS_TRAIT(src, TRAIT_THROWINGARM) ? 2 : 0 newtonian_move(get_dir(target, src)) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index f5cee1ec422c..11c8a62b69b4 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -113,6 +113,8 @@ /// Stores the result of our last known top_offset generation for optimisation purposes when drawing limb icons. var/last_top_offset + var/is_leaning = FALSE + COOLDOWN_DECLARE(bleeding_message_cd) var/next_smell = 0 /// Cooldown for the next smell diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index 6c4d59f93df1..fae78c27fc86 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -44,6 +44,7 @@ RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_SKITTISH), PROC_REF(on_skittish_trait_gain)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_SKITTISH), PROC_REF(on_skittish_trait_loss)) + RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_NEGATES_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_NEGATES_GRAVITY)), PROC_REF(on_negate_gravity)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_IGNORING_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_IGNORING_GRAVITY)), PROC_REF(on_ignore_gravity)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_FORCED_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_FORCED_GRAVITY)), PROC_REF(on_force_gravity)) @@ -245,3 +246,8 @@ /mob/living/proc/on_loc_force_gravity(datum/source) SIGNAL_HANDLER refresh_gravity() + +/// Called when [TRAIT_UNDENSE] is gained or lost +/mob/living/proc/undense_changed(datum/source) + SIGNAL_HANDLER + update_density() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 34155f199a1f..52fd43f9b2e8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -660,8 +660,7 @@ /mob/living/proc/on_lying_down(new_lying_angle) if(layer == initial(layer)) //to avoid things like hiding larvas. layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs - add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), LYING_DOWN_TRAIT) - set_density(FALSE) // We lose density and stop bumping passable dense things. + add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED, TRAIT_UNDENSE), LYING_DOWN_TRAIT) if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) setDir(pick(NORTH, SOUTH)) // We are and look helpless. body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING @@ -672,9 +671,16 @@ /mob/living/proc/on_standing_up() if(layer == LYING_MOB_LAYER) layer = initial(layer) - set_density(initial(density)) // We were prone before, so we become dense and things can bump into us again. - remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), LYING_DOWN_TRAIT) - body_position_pixel_y_offset = 0 + remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED, TRAIT_UNDENSE), LYING_DOWN_TRAIT) + // Make sure it doesn't go out of the southern bounds of the tile when standing. + body_position_pixel_y_offset = 0 // MONKEYSTATION EDIT CHANGE OLD +// body_position_pixel_y_offset = (current_size-1) * world.icon_size/2 MONKEYSTATION EDIT CHANGE NEW - We dont have TG's PR #75892 + +/mob/living/proc/update_density() + if(HAS_TRAIT(src, TRAIT_UNDENSE)) + set_density(FALSE) + else + set_density(TRUE) //Recursive function to find everything a mob is holding. Really shitty proc tbh. /mob/living/get_contents() diff --git a/code/modules/mob/living/living_fov.dm b/code/modules/mob/living/living_fov.dm index 0c5acb7b40e4..279e8bebe328 100644 --- a/code/modules/mob/living/living_fov.dm +++ b/code/modules/mob/living/living_fov.dm @@ -57,6 +57,8 @@ if(fov_type > highest_fov) highest_fov = fov_type fov_view = highest_fov + if(HAS_TRAIT(src, TRAIT_EXPANDED_FOV)) + fov_view += 30 update_fov_client() /// Updates the FOV for the client. diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 73b7f6aa6260..7e7e0b345109 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -215,7 +215,7 @@ if(z != target.z) return hopping = TRUE - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) pass_flags |= PASSMOB notransform = TRUE var/turf/new_turf = locate((target.x + rand(-3,3)),(target.y + rand(-3,3)),target.z) @@ -228,7 +228,7 @@ throw_at(new_turf, max(3,get_dist(src,new_turf)), 1, src, FALSE, callback = CALLBACK(src, PROC_REF(FinishHop))) /mob/living/simple_animal/hostile/jungle/leaper/proc/FinishHop() - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) notransform = FALSE pass_flags &= ~PASSMOB hopping = FALSE @@ -245,12 +245,12 @@ addtimer(CALLBACK(src, PROC_REF(BellyFlopHop), new_turf), 30) /mob/living/simple_animal/hostile/jungle/leaper/proc/BellyFlopHop(turf/T) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) throw_at(T, get_dist(src,T),1,src, FALSE, callback = CALLBACK(src, PROC_REF(Crush))) /mob/living/simple_animal/hostile/jungle/leaper/proc/Crush() hopping = FALSE - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) notransform = FALSE playsound(src, 'sound/effects/meteorimpact.ogg', 200, TRUE) for(var/mob/living/L in orange(1, src)) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm index 2e65ba824568..444635f2dc34 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm @@ -107,7 +107,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/LeapAttack() if(target && !stat && attack_state == MOOK_ATTACK_WARMUP) attack_state = MOOK_ATTACK_ACTIVE - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) melee_damage_lower = 30 melee_damage_upper = 30 update_icons() @@ -123,7 +123,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/AttackRecovery() if(attack_state == MOOK_ATTACK_ACTIVE && !stat) attack_state = MOOK_ATTACK_RECOVERY - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) face_atom(target) if(!struck_target_leap) update_icons() @@ -156,7 +156,7 @@ if(CanAttack(L)) L.attack_animal(src) struck_target_leap = TRUE - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) update_icons() var/mook_under_us = FALSE for(var/A in get_turf(src)) @@ -169,7 +169,7 @@ if(!struck_target_leap && CanAttack(ML))//Check if some joker is attempting to use rest to evade us struck_target_leap = TRUE ML.attack_animal(src) - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) struck_target_leap = TRUE update_icons() continue diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index b9be840b9ae9..d2a99e86793e 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -356,13 +356,13 @@ Difficulty: Hard animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out SLEEP_CHECK_DEATH(1, src) visible_message(span_hierophant_warning("[src] fades out!")) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) SLEEP_CHECK_DEATH(2, src) forceMove(T) SLEEP_CHECK_DEATH(1, src) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN SLEEP_CHECK_DEATH(1, src) - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) visible_message(span_hierophant_warning("[src] fades in!")) SLEEP_CHECK_DEATH(1, src) //at this point the blasts we made detonate blinking = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 207ae7de7149..fcc5af943de2 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -336,14 +336,14 @@ GLOBAL_LIST_INIT(animatable_blacklist, list(/obj/structure/table, /obj/structure if(locked) return if(!opened) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, MIMIC_TRAIT) opened = TRUE icon_state = "crateopen" playsound(src, open_sound, 50, TRUE) for(var/atom/movable/AM in src) AM.forceMove(loc) else - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, MIMIC_TRAIT) opened = FALSE icon_state = "crate" playsound(src, close_sound, 50, TRUE) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index 0fae77d08ceb..b4f171a10ceb 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -147,13 +147,13 @@ new /obj/effect/temp_visual/hierophant/blast/damaging/pandora(t, src) animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out visible_message(span_hierophant_warning("[src] fades out!")) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) addtimer(CALLBACK(src, PROC_REF(pandora_teleport_3), T), 2) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport_3(turf/T) forceMove(T) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) visible_message(span_hierophant_warning("[src] fades in!")) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares(target) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 09e3fe1f2546..ca7a5cd3832d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -463,7 +463,7 @@ icon_state = icon_dead if(flip_on_death) transform = transform.Turn(180) - //ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) + ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) return ..() /mob/living/simple_animal/proc/CanAttack(atom/the_target) @@ -488,7 +488,7 @@ if(!.) return icon_state = icon_living - set_density(initial(density)) + REMOVE_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) /mob/living/simple_animal/proc/make_babies() // <3 <3 <3 if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress()) diff --git a/code/modules/pai/shell.dm b/code/modules/pai/shell.dm index 711e19ead51b..665727705eba 100644 --- a/code/modules/pai/shell.dm +++ b/code/modules/pai/shell.dm @@ -93,7 +93,7 @@ card.forceMove(target) forceMove(card) add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED) - set_density(FALSE) + ADD_TRAIT(src, TRAIT_UNDENSE, PAI_FOLDED) set_light_on(FALSE) holoform = FALSE set_resting(resting) @@ -124,7 +124,7 @@ addtimer(VARSET_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_COOLDOWN) REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) - set_density(TRUE) + REMOVE_TRAIT(src, TRAIT_UNDENSE, PAI_FOLDED) if(istype(card.loc, /obj/item/modular_computer)) var/obj/item/modular_computer/pc = card.loc pc.inserted_pai = null From 56e8ec11e1bf2fa7df3fb17372a64926c19c9434 Mon Sep 17 00:00:00 2001 From: Gboster-0 <82319946+Gboster-0@users.noreply.github.com> Date: Fri, 17 Nov 2023 03:25:57 +0100 Subject: [PATCH 3/3] Revert "The Leaning Update (and Density Refractor) (#76704)" This reverts commit 7fa71cb0b93f87d79aa74b92f3ecafaa4d2e431c. --- code/__DEFINES/traits.dm | 14 ------ code/_globalvars/traits.dm | 2 - code/datums/actions/mobs/lava_swoop.dm | 4 +- code/datums/components/riding/riding_mob.dm | 4 +- code/datums/components/shrink.dm | 9 +--- code/game/objects/items.dm | 2 - code/game/objects/items/cigs_lighters.dm | 1 - code/game/turfs/closed/walls.dm | 46 ------------------- code/modules/mob/living/basic/basic.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 11 +---- .../mob/living/carbon/carbon_defines.dm | 2 - code/modules/mob/living/init_signals.dm | 6 --- code/modules/mob/living/living.dm | 16 ++----- code/modules/mob/living/living_fov.dm | 2 - .../simple_animal/hostile/jungle/leaper.dm | 8 ++-- .../simple_animal/hostile/jungle/mook.dm | 8 ++-- .../hostile/megafauna/hierophant.dm | 4 +- .../mob/living/simple_animal/hostile/mimic.dm | 4 +- .../hostile/mining_mobs/elites/pandora.dm | 4 +- .../mob/living/simple_animal/simple_animal.dm | 4 +- code/modules/pai/shell.dm | 4 +- 21 files changed, 33 insertions(+), 126 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index b30b96f0662a..7ef7a0f10c38 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -144,10 +144,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_PULL_BLOCKED "pullblocked" /// Abstract condition that prevents movement if being pulled and might be resisted against. Handcuffs and straight jackets, basically. #define TRAIT_RESTRAINED "restrained" -/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! -#define TRAIT_UNDENSE "undense" -/// Expands our FOV by 30 degrees if restricted -#define TRAIT_EXPANDED_FOV "expanded_fov" /// Doesn't miss attacks #define TRAIT_PERFECT_ATTACKER "perfect_attacker" #define TRAIT_INCAPACITATED "incapacitated" @@ -903,8 +899,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define SUIT_TRAIT "suit" /// Trait associated to lying down (having a [lying_angle] of a different value than zero). #define LYING_DOWN_TRAIT "lying-down" -/// A trait gained by leaning against a wall -#define LEANING_TRAIT "leaning" /// Trait associated to lacking electrical power. #define POWER_LACK_TRAIT "power-lack" /// Trait associated to lacking motor movement @@ -974,15 +968,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define SPECIES_FLIGHT_TRAIT "species-flight" #define FROSTMINER_ENRAGE_TRAIT "frostminer-enrage" #define NO_GRAVITY_TRAIT "no-gravity" -/// A trait gained from a mob's leap action, like the leaper #define LEAPING_TRAIT "leaping" -/// A trait gained from a mob's vanish action, like the herophant -#define VANISHING_TRAIT "vanishing" -/// A trait gained from a mob's swoop action, like the ash drake -#define SWOOPING_TRAIT "swooping" -/// A trait gained from a mob's mimic ability, like the mimic -#define MIMIC_TRAIT "mimic" -#define SHRUNKEN_TRAIT "shrunken" #define LEAPER_BUBBLE_TRAIT "leaper-bubble" #define DNA_VAULT_TRAIT "dna_vault" /// sticky nodrop sounds like a bad soundcloud rapper's name diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index fce0b00572d0..55326d5633ef 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -192,8 +192,6 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_MIMING" = TRAIT_MIMING, "TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION" = TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION, "TRAIT_UNOBSERVANT" = TRAIT_UNOBSERVANT, - "TRAIT_UNDENSE" = TRAIT_UNDENSE, - "TRAIT_EXPANDED_FOV" = TRAIT_EXPANDED_FOV, "TRAIT_TENTACLE_IMMUNE" = TRAIT_TENTACLE_IMMUNE, "TRAIT_OVERWATCH_IMMUNE" = TRAIT_OVERWATCH_IMMUNE, ), diff --git a/code/datums/actions/mobs/lava_swoop.dm b/code/datums/actions/mobs/lava_swoop.dm index d18ad2f3af3b..d23252c73aac 100644 --- a/code/datums/actions/mobs/lava_swoop.dm +++ b/code/datums/actions/mobs/lava_swoop.dm @@ -38,7 +38,7 @@ return // stop swooped target movement swooping = TRUE - ADD_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) + owner.set_density(FALSE) owner.visible_message(span_boldwarning("[owner] swoops up high!")) var/negative @@ -115,7 +115,7 @@ for(var/mob/M in range(7, owner)) shake_camera(M, 15, 1) - REMOVE_TRAIT(owner, TRAIT_UNDENSE, SWOOPING_TRAIT) + owner.set_density(TRUE) SLEEP_CHECK_DEATH(1, owner) swooping = FALSE if(!lava_success) diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm index 7c182d621183..5a829df75f81 100644 --- a/code/datums/components/riding/riding_mob.dm +++ b/code/datums/components/riding/riding_mob.dm @@ -203,7 +203,7 @@ human_parent.buckle_lying = 0 // the riding mob is made nondense so they don't bump into any dense atoms the carrier is pulling, // since pulled movables are moved before buckled movables - ADD_TRAIT(riding_mob, TRAIT_UNDENSE, VEHICLE_TRAIT) + riding_mob.set_density(FALSE) else if(ride_check_flags & CARRIER_NEEDS_ARM) // fireman human_parent.buckle_lying = 90 @@ -227,7 +227,7 @@ unequip_buckle_inhands(parent) var/mob/living/carbon/human/H = parent H.remove_movespeed_modifier(/datum/movespeed_modifier/human_carry) - REMOVE_TRAIT(H, TRAIT_UNDENSE, VEHICLE_TRAIT) + former_rider.set_density(!former_rider.body_position) return ..() /// If the carrier shoves the person they're carrying, force the carried mob off diff --git a/code/datums/components/shrink.dm b/code/datums/components/shrink.dm index 67cd3d39e23c..9c1c5f76dcde 100644 --- a/code/datums/components/shrink.dm +++ b/code/datums/components/shrink.dm @@ -10,11 +10,10 @@ parent_atom.transform = parent_atom.transform.Scale(0.5,0.5) olddens = parent_atom.density oldopac = parent_atom.opacity - + parent_atom.set_density(FALSE) parent_atom.set_opacity(FALSE) if(isliving(parent_atom)) var/mob/living/L = parent_atom - ADD_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT) L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray) if(iscarbon(L)) var/mob/living/carbon/C = L @@ -24,8 +23,6 @@ if(ishuman(C)) var/mob/living/carbon/human/H = C H.physiology.damage_resistance -= 100//carbons take double damage while shrunk - else - parent_atom.set_density(FALSE) // this is handled by the UNDENSE trait on mobs parent_atom.visible_message(span_warning("[parent_atom] shrinks down to a tiny size!"), span_userdanger("Everything grows bigger!")) QDEL_IN(src, shrink_time) @@ -33,14 +30,12 @@ /datum/component/shrink/Destroy() var/atom/parent_atom = parent parent_atom.transform = parent_atom.transform.Scale(2,2) + parent_atom.set_density(olddens) parent_atom.set_opacity(oldopac) if(isliving(parent_atom)) var/mob/living/L = parent_atom L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray) - REMOVE_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT) if(ishuman(L)) var/mob/living/carbon/human/H = L H.physiology.damage_resistance += 100 - else - parent_atom.set_density(olddens) // this is handled by the UNDENSE trait on mobs return ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 84e64497afb5..e3af3614fa1c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -212,8 +212,6 @@ var/offensive_notes /// Used in obj/item/examine to determines whether or not to detail an item's statistics even if it does not meet the force requirements var/override_notes = FALSE - /// Used if we want to have a custom verb text for throwing. "John Spaceman flicks the ciggerate" for example. - var/throw_verb /obj/item/Initialize(mapload) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 4fc8935b3d49..eb9444784e21 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -138,7 +138,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM body_parts_covered = null grind_results = list() heat = 1000 - throw_verb = "flick" /// Whether this cigarette has been lit. var/lit = FALSE /// Whether this cigarette should start lit. diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index acac18383a91..4d7595b91895 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -1,5 +1,4 @@ #define MAX_DENT_DECALS 15 -#define LEANING_OFFSET 11 /turf/closed/wall name = "wall" @@ -34,50 +33,6 @@ var/list/dent_decals -/turf/closed/wall/MouseDrop_T(mob/living/carbon/carbon_mob, mob/user) - ..() - if(carbon_mob != user) - return - if(carbon_mob.is_leaning == TRUE) - return - if(carbon_mob.pulledby) - return - if(!carbon_mob.density) - return - carbon_mob.is_leaning = TRUE - var/turf/checked_turf = get_step(carbon_mob, turn(carbon_mob.dir, 180)) - if(checked_turf == src) - carbon_mob.start_leaning(src) - -/mob/living/carbon/proc/start_leaning(obj/wall) - - switch(dir) - if(SOUTH) - pixel_y += LEANING_OFFSET - if(NORTH) - pixel_y += -LEANING_OFFSET - if(WEST) - pixel_x += LEANING_OFFSET - if(EAST) - pixel_x += -LEANING_OFFSET - - ADD_TRAIT(src, TRAIT_UNDENSE, LEANING_TRAIT) - ADD_TRAIT(src, TRAIT_EXPANDED_FOV, LEANING_TRAIT) - visible_message(span_notice("[src] leans against \the [wall]!"), \ - span_notice("You lean against \the [wall]!")) - RegisterSignals(src, list(COMSIG_MOB_CLIENT_PRE_MOVE, COMSIG_HUMAN_DISARM_HIT, COMSIG_LIVING_GET_PULLED, COMSIG_MOVABLE_TELEPORTING, COMSIG_ATOM_DIR_CHANGE), PROC_REF(stop_leaning)) - update_fov() - -/mob/living/carbon/proc/stop_leaning() - SIGNAL_HANDLER - UnregisterSignal(src, list(COMSIG_MOB_CLIENT_PRE_MOVE, COMSIG_HUMAN_DISARM_HIT, COMSIG_LIVING_GET_PULLED, COMSIG_MOVABLE_TELEPORTING, COMSIG_ATOM_DIR_CHANGE)) - is_leaning = FALSE - pixel_y = base_pixel_y + body_position_pixel_x_offset - pixel_x = base_pixel_y + body_position_pixel_y_offset - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEANING_TRAIT) - REMOVE_TRAIT(src, TRAIT_EXPANDED_FOV, LEANING_TRAIT) - update_fov() - /turf/closed/wall/Initialize(mapload) . = ..() if(!can_engrave) @@ -374,4 +329,3 @@ girder_type = /obj/structure/foamedmetal #undef MAX_DENT_DECALS -#undef LEANING_OFFSET diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index 4ba206bd46fa..14ff9c0e5f38 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -152,7 +152,7 @@ if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) - ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) + set_density(FALSE) SEND_SIGNAL(src, COMSIG_BASICMOB_LOOK_DEAD) /mob/living/basic/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE) @@ -167,7 +167,7 @@ if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) - REMOVE_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) + set_density(FALSE) SEND_SIGNAL(src, COMSIG_BASICMOB_LOOK_ALIVE) /mob/living/basic/update_sight() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index fa850f0a3a8a..337c7e0d7e10 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -164,9 +164,6 @@ return FALSE var/atom/movable/thrown_thing var/obj/item/held_item = get_active_held_item() - var/verb_text = pick("throw", "toss", "hurl", "chuck", "fling") - if(prob(0.5)) - verb_text = "yeet" var/neckgrab_throw = FALSE // we can't check for if it's a neckgrab throw when totaling up power_throw since we've already stopped pulling them by then, so get it early if(!held_item) if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE) @@ -197,12 +194,8 @@ power_throw++ if(neckgrab_throw) power_throw++ - if(isitem(thrown_thing)) - var/obj/item/thrown_item = thrown_thing - if(thrown_item.throw_verb) - verb_text = thrown_item.throw_verb - visible_message(span_danger("[src] [plural_s(verb_text)] [thrown_thing][power_throw ? " really hard!" : "."]"), \ - span_danger("You [verb_text] [thrown_thing][power_throw ? " really hard!" : "."]")) + visible_message(span_danger("[src] throws [thrown_thing][power_throw ? " really hard!" : "."]"), \ + span_danger("You throw [thrown_thing][power_throw ? " really hard!" : "."]")) log_message("has thrown [thrown_thing] [power_throw > 0 ? "really hard" : ""]", LOG_ATTACK) var/extra_throw_range = HAS_TRAIT(src, TRAIT_THROWINGARM) ? 2 : 0 newtonian_move(get_dir(target, src)) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 11c8a62b69b4..f5cee1ec422c 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -113,8 +113,6 @@ /// Stores the result of our last known top_offset generation for optimisation purposes when drawing limb icons. var/last_top_offset - var/is_leaning = FALSE - COOLDOWN_DECLARE(bleeding_message_cd) var/next_smell = 0 /// Cooldown for the next smell diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index fae78c27fc86..6c4d59f93df1 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -44,7 +44,6 @@ RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_SKITTISH), PROC_REF(on_skittish_trait_gain)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_SKITTISH), PROC_REF(on_skittish_trait_loss)) - RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_NEGATES_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_NEGATES_GRAVITY)), PROC_REF(on_negate_gravity)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_IGNORING_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_IGNORING_GRAVITY)), PROC_REF(on_ignore_gravity)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_FORCED_GRAVITY), SIGNAL_REMOVETRAIT(TRAIT_FORCED_GRAVITY)), PROC_REF(on_force_gravity)) @@ -246,8 +245,3 @@ /mob/living/proc/on_loc_force_gravity(datum/source) SIGNAL_HANDLER refresh_gravity() - -/// Called when [TRAIT_UNDENSE] is gained or lost -/mob/living/proc/undense_changed(datum/source) - SIGNAL_HANDLER - update_density() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 52fd43f9b2e8..34155f199a1f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -660,7 +660,8 @@ /mob/living/proc/on_lying_down(new_lying_angle) if(layer == initial(layer)) //to avoid things like hiding larvas. layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs - add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED, TRAIT_UNDENSE), LYING_DOWN_TRAIT) + add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), LYING_DOWN_TRAIT) + set_density(FALSE) // We lose density and stop bumping passable dense things. if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) setDir(pick(NORTH, SOUTH)) // We are and look helpless. body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING @@ -671,16 +672,9 @@ /mob/living/proc/on_standing_up() if(layer == LYING_MOB_LAYER) layer = initial(layer) - remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED, TRAIT_UNDENSE), LYING_DOWN_TRAIT) - // Make sure it doesn't go out of the southern bounds of the tile when standing. - body_position_pixel_y_offset = 0 // MONKEYSTATION EDIT CHANGE OLD -// body_position_pixel_y_offset = (current_size-1) * world.icon_size/2 MONKEYSTATION EDIT CHANGE NEW - We dont have TG's PR #75892 - -/mob/living/proc/update_density() - if(HAS_TRAIT(src, TRAIT_UNDENSE)) - set_density(FALSE) - else - set_density(TRUE) + set_density(initial(density)) // We were prone before, so we become dense and things can bump into us again. + remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), LYING_DOWN_TRAIT) + body_position_pixel_y_offset = 0 //Recursive function to find everything a mob is holding. Really shitty proc tbh. /mob/living/get_contents() diff --git a/code/modules/mob/living/living_fov.dm b/code/modules/mob/living/living_fov.dm index 279e8bebe328..0c5acb7b40e4 100644 --- a/code/modules/mob/living/living_fov.dm +++ b/code/modules/mob/living/living_fov.dm @@ -57,8 +57,6 @@ if(fov_type > highest_fov) highest_fov = fov_type fov_view = highest_fov - if(HAS_TRAIT(src, TRAIT_EXPANDED_FOV)) - fov_view += 30 update_fov_client() /// Updates the FOV for the client. diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 7e7e0b345109..73b7f6aa6260 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -215,7 +215,7 @@ if(z != target.z) return hopping = TRUE - ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(FALSE) pass_flags |= PASSMOB notransform = TRUE var/turf/new_turf = locate((target.x + rand(-3,3)),(target.y + rand(-3,3)),target.z) @@ -228,7 +228,7 @@ throw_at(new_turf, max(3,get_dist(src,new_turf)), 1, src, FALSE, callback = CALLBACK(src, PROC_REF(FinishHop))) /mob/living/simple_animal/hostile/jungle/leaper/proc/FinishHop() - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(TRUE) notransform = FALSE pass_flags &= ~PASSMOB hopping = FALSE @@ -245,12 +245,12 @@ addtimer(CALLBACK(src, PROC_REF(BellyFlopHop), new_turf), 30) /mob/living/simple_animal/hostile/jungle/leaper/proc/BellyFlopHop(turf/T) - ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(FALSE) throw_at(T, get_dist(src,T),1,src, FALSE, callback = CALLBACK(src, PROC_REF(Crush))) /mob/living/simple_animal/hostile/jungle/leaper/proc/Crush() hopping = FALSE - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(TRUE) notransform = FALSE playsound(src, 'sound/effects/meteorimpact.ogg', 200, TRUE) for(var/mob/living/L in orange(1, src)) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm index 444635f2dc34..2e65ba824568 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm @@ -107,7 +107,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/LeapAttack() if(target && !stat && attack_state == MOOK_ATTACK_WARMUP) attack_state = MOOK_ATTACK_ACTIVE - ADD_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(FALSE) melee_damage_lower = 30 melee_damage_upper = 30 update_icons() @@ -123,7 +123,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/AttackRecovery() if(attack_state == MOOK_ATTACK_ACTIVE && !stat) attack_state = MOOK_ATTACK_RECOVERY - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(TRUE) face_atom(target) if(!struck_target_leap) update_icons() @@ -156,7 +156,7 @@ if(CanAttack(L)) L.attack_animal(src) struck_target_leap = TRUE - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(TRUE) update_icons() var/mook_under_us = FALSE for(var/A in get_turf(src)) @@ -169,7 +169,7 @@ if(!struck_target_leap && CanAttack(ML))//Check if some joker is attempting to use rest to evade us struck_target_leap = TRUE ML.attack_animal(src) - REMOVE_TRAIT(src, TRAIT_UNDENSE, LEAPING_TRAIT) + set_density(TRUE) struck_target_leap = TRUE update_icons() continue diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index d2a99e86793e..b9be840b9ae9 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -356,13 +356,13 @@ Difficulty: Hard animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out SLEEP_CHECK_DEATH(1, src) visible_message(span_hierophant_warning("[src] fades out!")) - ADD_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) + set_density(FALSE) SLEEP_CHECK_DEATH(2, src) forceMove(T) SLEEP_CHECK_DEATH(1, src) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN SLEEP_CHECK_DEATH(1, src) - REMOVE_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) + set_density(TRUE) visible_message(span_hierophant_warning("[src] fades in!")) SLEEP_CHECK_DEATH(1, src) //at this point the blasts we made detonate blinking = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index fcc5af943de2..207ae7de7149 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -336,14 +336,14 @@ GLOBAL_LIST_INIT(animatable_blacklist, list(/obj/structure/table, /obj/structure if(locked) return if(!opened) - ADD_TRAIT(src, TRAIT_UNDENSE, MIMIC_TRAIT) + set_density(FALSE) opened = TRUE icon_state = "crateopen" playsound(src, open_sound, 50, TRUE) for(var/atom/movable/AM in src) AM.forceMove(loc) else - REMOVE_TRAIT(src, TRAIT_UNDENSE, MIMIC_TRAIT) + set_density(TRUE) opened = FALSE icon_state = "crate" playsound(src, close_sound, 50, TRUE) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index b4f171a10ceb..0fae77d08ceb 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -147,13 +147,13 @@ new /obj/effect/temp_visual/hierophant/blast/damaging/pandora(t, src) animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out visible_message(span_hierophant_warning("[src] fades out!")) - ADD_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) + set_density(FALSE) addtimer(CALLBACK(src, PROC_REF(pandora_teleport_3), T), 2) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport_3(turf/T) forceMove(T) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN - REMOVE_TRAIT(src, TRAIT_UNDENSE, VANISHING_TRAIT) + set_density(TRUE) visible_message(span_hierophant_warning("[src] fades in!")) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares(target) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index ca7a5cd3832d..09e3fe1f2546 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -463,7 +463,7 @@ icon_state = icon_dead if(flip_on_death) transform = transform.Turn(180) - ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) + //ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) return ..() /mob/living/simple_animal/proc/CanAttack(atom/the_target) @@ -488,7 +488,7 @@ if(!.) return icon_state = icon_living - REMOVE_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT) + set_density(initial(density)) /mob/living/simple_animal/proc/make_babies() // <3 <3 <3 if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress()) diff --git a/code/modules/pai/shell.dm b/code/modules/pai/shell.dm index 665727705eba..711e19ead51b 100644 --- a/code/modules/pai/shell.dm +++ b/code/modules/pai/shell.dm @@ -93,7 +93,7 @@ card.forceMove(target) forceMove(card) add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED) - ADD_TRAIT(src, TRAIT_UNDENSE, PAI_FOLDED) + set_density(FALSE) set_light_on(FALSE) holoform = FALSE set_resting(resting) @@ -124,7 +124,7 @@ addtimer(VARSET_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_COOLDOWN) REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) - REMOVE_TRAIT(src, TRAIT_UNDENSE, PAI_FOLDED) + set_density(TRUE) if(istype(card.loc, /obj/item/modular_computer)) var/obj/item/modular_computer/pc = card.loc pc.inserted_pai = null