Skip to content

Commit

Permalink
minute adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 9, 2023
1 parent e503e46 commit fe450ec
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
3 changes: 0 additions & 3 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,3 @@

/// For any additional things that should happen when a xeno's melee_attack_additional_effects_self() proc is called
#define COMSIG_XENO_SLASH_ADDITIONAL_EFFECTS_SELF "xeno_slash_additional_effects_self"

/// Cancels all running cloaking effects on target
#define COMSIG_MOB_EFFECT_CLOAK_CANCEL "mob_effect_cloak_cancel"
11 changes: 6 additions & 5 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,13 @@
* Mobs that do now follow these conventions due to unusual sprites should require a special handling or redefinition of this proc, due to the density and layer changes.
* The return of this proc is the previous value of the modified lying_angle if a change was successful (might include zero), or null if no change was made.
*/
/mob/living/proc/set_lying_angle(new_lying)
/mob/living/proc/set_lying_angle(new_lying, on_movement = FALSE)
if(new_lying == lying_angle)
return
. = lying_angle
lying_angle = new_lying
if(lying_angle != lying_prev)
update_transform()
update_transform(instant_update = on_movement) // Don't use transition for eg. crawling movement, because we already have the movement glide
lying_prev = lying_angle

///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling.
Expand Down Expand Up @@ -623,7 +623,7 @@
/mob/living/proc/on_floored_start()
if(body_position == STANDING_UP) //force them on the ground
set_body_position(LYING_DOWN)
set_lying_angle(pick(90, 270))
set_lying_angle(pick(90, 270), on_movement = TRUE)
// on_fall()


Expand All @@ -633,7 +633,7 @@
get_up()


/mob/living/update_transform()
/mob/living/update_transform(instant_update = FALSE)
var/visual_angle = lying_angle
if(!rotate_on_lying)
return
Expand All @@ -642,7 +642,8 @@
visual_angle = 90 // CM code - for fireman carry
else if(lying_angle)
base.Translate(rand(-10,10), rand(-10,10))
apply_transform(base.Turn(visual_angle), UPDATE_TRANSFORM_ANIMATION_TIME)
var/update_time = instant_update && UPDATE_TRANSFORM_ANIMATION_TIME
apply_transform(base.Turn(visual_angle), update_time)


// legacy procs
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/hostile/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
icon_living = "Normal [caste_name] Running"
icon_dead = "Normal [caste_name] Dead"

/mob/living/simple_animal/hostile/alien/update_transform()
/mob/living/simple_animal/hostile/alien/update_transform(instant_update = FALSE)
// TODO: Move all this mess outside of update_transform
if(stat == DEAD)
icon_state = "Normal [caste_name] Dead"
Expand Down
27 changes: 25 additions & 2 deletions code/modules/mob/mob_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,32 @@



/mob/verb/stop_pulling_verb()
/mob/verb/stop_pulling()

set name = "Stop Pulling"
set category = "IC"

stop_pulling()
if(pulling)
REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT)
var/mob/M = pulling
pulling.pulledby = null
pulling = null

grab_level = 0
if(client)
client.recalculate_move_delay()
// When you stop pulling a mob after you move a tile with it your next movement will still include
// the grab delay so we have to fix it here (we love code)
client.next_movement = world.time + client.move_delay
if(hud_used && hud_used.pull_icon)
hud_used.pull_icon.icon_state = "pull0"
if(istype(r_hand, /obj/item/grab))
temp_drop_inv_item(r_hand)
else if(istype(l_hand, /obj/item/grab))
temp_drop_inv_item(l_hand)
if(istype(M))
if(M.client)
//resist_grab uses long movement cooldown durations to prevent message spam
//so we must undo it here so the victim can move right away
M.client.next_movement = world.time
M.update_transform(TRUE)

0 comments on commit fe450ec

Please sign in to comment.