Skip to content

Commit

Permalink
Revert "The Leaning Update (and Density Refractor) (#76704)"
Browse files Browse the repository at this point in the history
This reverts commit 7fa71cb.
  • Loading branch information
Gboster-0 committed Nov 17, 2023
1 parent 7fa71cb commit 56e8ec1
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 126 deletions.
14 changes: 0 additions & 14 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
4 changes: 2 additions & 2 deletions code/datums/actions/mobs/lava_swoop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/riding/riding_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
9 changes: 2 additions & 7 deletions code/datums/components/shrink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,23 +23,19 @@
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)

/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 ..()
2 changes: 0 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
46 changes: 0 additions & 46 deletions code/game/turfs/closed/walls.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#define MAX_DENT_DECALS 15
#define LEANING_OFFSET 11

/turf/closed/wall
name = "wall"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -374,4 +329,3 @@
girder_type = /obj/structure/foamedmetal

#undef MAX_DENT_DECALS
#undef LEANING_OFFSET
4 changes: 2 additions & 2 deletions code/modules/mob/living/basic/basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
11 changes: 2 additions & 9 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions code/modules/mob/living/init_signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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()
16 changes: 5 additions & 11 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/living_fov.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/simple_animal/hostile/jungle/mook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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))
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 56e8ec1

Please sign in to comment.