Skip to content

Commit

Permalink
Refactor king visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Oct 7, 2024
1 parent e85c0c6 commit 1afe9c9
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 56 deletions.
13 changes: 13 additions & 0 deletions code/game/objects/effects/heavy_impact.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//-----------------------------------------
//HEAVY IMPACT
//-----------------------------------------

/obj/effect/heavy_impact
icon = 'icons/effects/heavyimpact.dmi'
icon_state = "heavyimpact"
var/duration = 1.3 SECONDS

/obj/effect/heavy_impact/Initialize(mapload)
. = ..()
flick("heavyimpact", src)
AddElement(/datum/element/temporary, duration)
51 changes: 51 additions & 0 deletions code/game/objects/effects/king_leap.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//-----------------------------------------
//KING LEAP
//-----------------------------------------

#define LEAP_HEIGHT 210 //how high up leaps go, in pixels

/obj/effect/king_leap
icon = 'icons/mob/xenos/king.dmi'
icon_state = "Normal King Charging"
layer = 4.7
plane = -4
pixel_x = -32
var/duration = 10

/obj/effect/king_leap/Initialize(mapload, negative, dir)
. = ..()
setDir(dir)
INVOKE_ASYNC(src, PROC_REF(flight), negative)
AddElement(/datum/element/temporary, duration)

/obj/effect/king_leap/proc/flight(negative)
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
else
animate(src, pixel_x = LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
sleep(0.3 SECONDS)
icon_state = "Normal King Charging"
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)
else
animate(src, pixel_x = LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)

/obj/effect/king_leap/end
pixel_x = LEAP_HEIGHT
pixel_z = LEAP_HEIGHT
duration = 10

/obj/effect/king_leap/end/flight(negative)
if(negative)
pixel_x = -LEAP_HEIGHT
animate(src, pixel_x = -16, pixel_z = 0, time = 5)
else
animate(src, pixel_x = -16, pixel_z = 0, time = 5)

/obj/effect/xenomorph/xeno_telegraph/king_attack_template
icon = 'icons/effects/96x96.dmi'
icon_state = "landing2"
layer = BELOW_MOB_LAYER

/obj/effect/xenomorph/xeno_telegraph/king_attack_template/yellow
icon_state = "xenolandingyellow"
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
var/mob/living/carbon/carbon = current_atom
if(xeno.can_not_harm(carbon))
continue

carbon.EyeBlur(daze_length_seconds)
carbon.Daze(daze_length_seconds)
carbon.Superslow(slow_length_seconds)
Expand All @@ -78,7 +78,7 @@

to_chat(carbon, SPAN_HIGHDANGER("[xeno]'s roar overwhelms your entire being!"))
shake_camera(carbon, 6, 1)

if(ishuman(current_atom))
var/mob/living/carbon/human/human = carbon
var/time_to_extinguish = get_dist(owner, human) DECISECONDS
Expand All @@ -89,7 +89,7 @@
for(var/datum/reagent/x in human.reagents.reagent_list)
human.reagents.remove_reagent(x.id, 100)


if(!istype(current_atom, /mob/dead))
var/power = current_atom.light_power
var/range = current_atom.light_range
Expand All @@ -100,7 +100,7 @@
else
current_atom.set_light_range(0)
addtimer(CALLBACK(current_atom, TYPE_PROC_REF(/atom, set_light_range), range), 10 SECONDS)


apply_cooldown()
..()
Expand Down Expand Up @@ -146,7 +146,6 @@
Long cooldown high damage ability, massive damage against cades, highly telegraphed.
*/

#define LEAP_HEIGHT 210 //how high up leaps go, in pixels
#define LEAP_DIRECTION_CHANGE_RANGE 5 //the range our x has to be within to not change the direction we slam from

/datum/action/xeno_action/activable/destroy/use_ability(atom/target)
Expand All @@ -166,7 +165,7 @@
if(istype(target_turf, /turf/open/space))
to_chat(xeno, SPAN_XENONOTICE("It would not be wise to try to leap there..."))
return

if(istype(target, /obj/vehicle/multitile))
to_chat(xeno, SPAN_XENONOTICE("It would not be wise to try to leap there..."))
return
Expand Down Expand Up @@ -218,7 +217,7 @@
owner.emote("roar")

//Initial visual
var/obj/effect/temp_visual/king_leap/leap_visual = new(owner.loc, negative, owner.dir)
var/obj/effect/king_leap/leap_visual = new(owner.loc, negative, owner.dir)
new /obj/effect/xenomorph/xeno_telegraph/king_attack_template(template_turf, 20)

negative = !negative //invert it for the descent later
Expand Down Expand Up @@ -255,17 +254,17 @@
if(ISINRANGE(owner.x, initial_x - LEAP_DIRECTION_CHANGE_RANGE, initial_x - 1))
negative = TRUE

new /obj/effect/temp_visual/king_leap/end(owner.loc, negative, owner.dir)
new /obj/effect/king_leap/end(owner.loc, negative, owner.dir)

SLEEP_CHECK_DEATH(descentTime, owner)
animate(owner, alpha = 255, transform = oldtransform, descentTime)
owner.mouse_opacity = initial(owner.mouse_opacity)
playsound(owner.loc, 'sound/effects/meteorimpact.ogg', 200, TRUE)

/// Effects for landing
new /obj/effect/temp_visual/heavy_impact(owner.loc)
new /obj/effect/heavy_impact(owner.loc)
for(var/step in CARDINAL_ALL_DIRS)
new /obj/effect/temp_visual/heavy_impact(get_step(owner.loc, step))
new /obj/effect/heavy_impact(get_step(owner.loc, step))

// Actual Damaging Effects - Add stuff for cades - NEED TELEGRAPHS NEED EFFECTS

Expand Down Expand Up @@ -302,49 +301,3 @@

/datum/action/xeno_action/activable/destroy/proc/second_template(turf/template_turf)
new /obj/effect/xenomorph/xeno_telegraph/king_attack_template(template_turf, 10)

/obj/effect/temp_visual/king_leap
icon = 'icons/mob/xenos/king.dmi'
icon_state = "Normal King Charging"
layer = 4.7
plane = -4
pixel_x = -32
duration = 10
randomdir = FALSE

/obj/effect/temp_visual/king_leap/Initialize(mapload, negative, dir)
. = ..()
setDir(dir)
INVOKE_ASYNC(src, PROC_REF(flight), negative)

/obj/effect/temp_visual/king_leap/proc/flight(negative)
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
else
animate(src, pixel_x = LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
sleep(0.3 SECONDS)
icon_state = "Normal King Charging"
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)
else
animate(src, pixel_x = LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)

/obj/effect/temp_visual/king_leap/end
pixel_x = LEAP_HEIGHT
pixel_z = LEAP_HEIGHT
duration = 10

/obj/effect/temp_visual/king_leap/end/flight(negative)
if(negative)
pixel_x = -LEAP_HEIGHT
animate(src, pixel_x = -16, pixel_z = 0, time = 5)
else
animate(src, pixel_x = -16, pixel_z = 0, time = 5)

/obj/effect/xenomorph/xeno_telegraph/king_attack_template
icon = 'icons/effects/96x96.dmi'
icon_state = "landing2"
layer = BELOW_MOB_LAYER

/obj/effect/xenomorph/xeno_telegraph/king_attack_template/yellow
icon_state = "xenolandingyellow"
2 changes: 2 additions & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@
#include "code\game\objects\effects\effect.dm"
#include "code\game\objects\effects\elevator.dm"
#include "code\game\objects\effects\glowshroom.dm"
#include "code\game\objects\effects\heavy_impact.dm"
#include "code\game\objects\effects\king_leap.dm"
#include "code\game\objects\effects\manifest.dm"
#include "code\game\objects\effects\misc.dm"
#include "code\game\objects\effects\overlays.dm"
Expand Down

0 comments on commit 1afe9c9

Please sign in to comment.