Skip to content

Commit

Permalink
Visual fixes (#15012) & Minor jump tweaks (#15065) (#261)
Browse files Browse the repository at this point in the history
* Visual fixes (#15012)

* Minor jump tweaks (#15065)

---------

Signed-off-by: Helg2 <[email protected]>
Co-authored-by: Lumipharon <[email protected]>
  • Loading branch information
Helg2 and Lumipharon authored Sep 8, 2024
1 parent ed649ad commit c6f1c5a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
#define ABOVE_LYING_MOB_LAYER 3.9 //drone (not the xeno)

//#define MOB_LAYER 4
#define RIVER_OVERLAY_LAYER 4.01

#define MOB_JUMP_LAYER 4.05

#define ABOVE_MOB_LAYER 4.1

Expand Down
14 changes: 7 additions & 7 deletions code/datums/components/jump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
if(jump_sound)
playsound(jumper, jump_sound, 65)

jumper.layer = ABOVE_MOB_LAYER
var/original_layer = jumper.layer
var/original_pass_flags = jumper.pass_flags

SEND_SIGNAL(jumper, COMSIG_ELEMENT_JUMP_STARTED)
jumper.adjustStaminaLoss(stamina_cost)
Expand All @@ -78,22 +79,21 @@
var/spin_number = ROUND_UP(jump_duration * 0.1)
jumper.animation_spin(jump_duration / spin_number, spin_number, jumper.dir == WEST ? FALSE : TRUE)

animate(jumper, pixel_y = jumper.pixel_y + jump_height, layer = ABOVE_MOB_LAYER, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_OUT, flags = ANIMATION_PARALLEL)
animate(pixel_y = jumper.pixel_y - jump_height, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_IN)
animate(jumper, pixel_y = jumper.pixel_y + jump_height, layer = MOB_JUMP_LAYER, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_OUT, flags = ANIMATION_PARALLEL)
animate(pixel_y = jumper.pixel_y - jump_height, layer = original_layer, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_IN)

if(jump_flags & JUMP_SHADOW)
animate(shadow_filter, y = -jump_height, size = 4, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_OUT, flags = ANIMATION_PARALLEL)
animate(y = 0, size = 0.9, time = jump_duration * 0.5, easing = CIRCULAR_EASING|EASE_IN)

addtimer(CALLBACK(src, PROC_REF(end_jump), jumper), jump_duration)
addtimer(CALLBACK(src, PROC_REF(end_jump), jumper, original_pass_flags), jump_duration)

TIMER_COOLDOWN_START(jumper, JUMP_COMPONENT_COOLDOWN, jump_cooldown)

///Ends the jump
/datum/component/jump/proc/end_jump(mob/living/jumper)
/datum/component/jump/proc/end_jump(mob/living/jumper, original_pass_flags)
jumper.remove_filter(JUMP_COMPONENT)
jumper.layer = initial(jumper.layer)
jumper.pass_flags = initial(jumper.pass_flags)
jumper.pass_flags = original_pass_flags
REMOVE_TRAIT(jumper, TRAIT_SILENT_FOOTSTEPS, JUMP_COMPONENT)
SEND_SIGNAL(jumper, COMSIG_ELEMENT_JUMP_ENDED, TRUE, 1.5, 2)
SEND_SIGNAL(jumper.loc, COMSIG_TURF_JUMP_ENDED_HERE, jumper)
Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/structures/campaign_props.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
allow_pass_flags = PASS_AIR
bound_width = 128

/obj/structure/prop/train/Initialize(mapload)
. = ..()
update_icon()

/obj/structure/prop/train/update_overlays()
. = ..()
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_ALL_MOB_LAYER, dir)
. += new_overlay

/obj/structure/prop/train/carriage
name = "rail carriage"
desc = "A heavy duty maglev carriage. I wonder what's inside?."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

/obj/structure/campaign_objective/destruction_objective/mlrs/update_overlays()
. = ..()
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_MOB_LAYER, dir)
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_ALL_MOB_LAYER, dir)
. += new_overlay

/obj/structure/campaign_objective/destruction_objective/mlrs/plastique_act()
Expand Down Expand Up @@ -165,6 +165,15 @@
allow_pass_flags = PASS_PROJECTILE|PASS_AIR
bound_width = 128

/obj/structure/campaign_objective/destruction_objective/supply_objective/train/Initialize(mapload)
. = ..()
update_icon()

/obj/structure/campaign_objective/destruction_objective/supply_objective/train/update_overlays()
. = ..()
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_ALL_MOB_LAYER, dir)
. += new_overlay

/obj/effect/landmark/campaign_structure/train/carriage
name = "carriage objective"
icon_state = "carriage_lit"
Expand Down Expand Up @@ -197,7 +206,7 @@

/obj/structure/campaign_objective/destruction_objective/supply_objective/phoron_stack/update_overlays()
. = ..()
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_MOB_LAYER, dir)
var/image/new_overlay = image(icon, src, "[icon_state]_overlay", ABOVE_ALL_MOB_LAYER, dir)
. += new_overlay

//NT base
Expand Down
Binary file modified icons/obj/structures/train.dmi
Binary file not shown.

0 comments on commit c6f1c5a

Please sign in to comment.