make robots resizeable (#29684)

This commit is contained in:
Toastical
2025-07-07 16:34:29 +00:00
committed by GitHub
parent dc529f084f
commit 7cbaeada1d
@@ -12,6 +12,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
bubble_icon = "robot"
universal_understand = TRUE
deathgasp_on_death = TRUE
appearance_flags = LONG_GLIDE | PIXEL_SCALE | KEEP_TOGETHER | TILE_BOUND
blocks_emissive = EMISSIVE_BLOCK_UNIQUE
hud_type = /datum/hud/robot
@@ -1827,6 +1828,22 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
return FALSE
return TRUE
/mob/living/silicon/robot/update_transform()
var/matrix/ntransform = matrix(transform)
var/final_pixel_y = pixel_y
var/final_dir = dir
var/changed = 0
if(resize != RESIZE_DEFAULT_SIZE)
changed++
ntransform.Scale(resize)
ntransform.Translate(0, (resize - 1) * 16) // Pixel Y shift: 1.25 = 4, 1.5 = 8, 2 -> 16, 3 -> 32, 4 -> 48, 5 -> 64
resize = RESIZE_DEFAULT_SIZE
if(changed)
floating = FALSE
animate(src, transform = ntransform, time = (lying_prev == 0 || lying_angle == 0) ? 2 : 0, pixel_y = final_pixel_y, dir = final_dir, easing = (EASE_IN|EASE_OUT))
/mob/living/silicon/robot/plushify(plushie_override, curse_time)
if(curse_time == -1)
QDEL_NULL(mmi)