Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deathclaw Megafauna but draft #2014

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
27 changes: 20 additions & 7 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1314,10 +1314,23 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)

///Perform a shake on an atom, resets its position afterwards
/atom/proc/Shake(pixelshiftx = 15, pixelshifty = 15, duration = 250)
var/initialpixelx = pixel_x
var/initialpixely = pixel_y
var/shiftx = rand(-pixelshiftx,pixelshiftx)
var/shifty = rand(-pixelshifty,pixelshifty)
animate(src, pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2, loop = duration)
pixel_x = initialpixelx
pixel_y = initialpixely
var/list/transforms
if(!transforms)
var/matrix/first_translation = matrix()
var/matrix/second_translation = matrix()
var/matrix/third_translation = matrix()
var/matrix/fourth_translation = matrix()
first_translation.Translate(-pixelshiftx, 0)
second_translation.Translate(0, pixelshifty)
third_translation.Translate(pixelshiftx, 0)
fourth_translation.Translate(0, -pixelshifty)
transforms = list(first_translation, second_translation, third_translation, fourth_translation)
animate(src, transform = transforms[1], time=0.4, loop=-1)
animate(transform = transforms[2], time=0.2)
animate(transform = transforms[3], time=0.4)
animate(transform = transforms[4], time=0.6)
addtimer(CALLBACK(src, .proc/Stop_Shaking), duration)

/atom/proc/Stop_Shaking()
update_appearance()
animate(src, transform = matrix())
2 changes: 2 additions & 0 deletions mojave/code/datums/components/generic_animal_patrol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
if(!new_node_target)
return
nodes_to_walk = get_path(starting_atom = current_node, goal_atom = new_node_target, pathing_type = NODE_PATHING)
if(!length(nodes_to_walk)) //We're already there
return
target_node = nodes_to_walk[length(nodes_to_walk)]
var/mob/living/simple_animal/animal = source
animal.Goto(target = target_node, delay = move_delay, minimum_distance = 0)
Expand Down
Loading