Fixes resizing for icons taller than 32p

-Taller icons no longer sink into the tile below on the resize mechanics.
-Living mobs now have a var (vis_height) for their icon height, and humanmob species have a new var (icon_height) that overrides the vis_height for the resize proc.
-Also earlyports some tweaks to ambient occlusion. The new filter system took the old filter's settings as "make the shadows megathick and dummy intense" and that was ugly.
This commit is contained in:
Verkister
2019-12-21 18:35:45 +02:00
parent 373fc8143c
commit adc1eb2cf6
16 changed files with 20 additions and 3 deletions
+1
View File
@@ -29,6 +29,7 @@
var/can_be_drop_pred = TRUE // Mobs are pred by default.
var/next_preyloop // For Fancy sound internal loop
var/adminbus_trash = FALSE // For abusing trash eater for event shenanigans.
var/vis_height = 32 // Sprite height used for resize features.
//
// Hook for generic creation of stuff on new creatures
+4 -2
View File
@@ -71,7 +71,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
var/duration = (abs(change)+0.25) SECONDS
var/matrix/resize = matrix() // Defines the matrix to change the player's size
resize.Scale(new_size) //Change the size of the matrix
resize.Translate(0, 16 * (new_size - 1)) //Move the player up in the tile so their feet align with the bottom
resize.Translate(0, (vis_height/2) * (new_size - 1)) //Move the player up in the tile so their feet align with the bottom
animate(src, transform = resize, time = duration) //Animate the player resizing
var/aura_grow_to = change > 0 ? 2 : 0.5
@@ -85,9 +85,11 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
update_transform() //Lame way
/mob/living/carbon/human/resize(var/new_size, var/animate = TRUE)
if(species)
vis_height = species.icon_height
. = ..()
if(LAZYLEN(hud_list) && has_huds)
var/new_y_offset = 32 * (size_multiplier - 1)
var/new_y_offset = vis_height * (size_multiplier - 1)
for(var/index = 1 to hud_list.len)
var/image/HI = grab_hud(index)
HI.pixel_y = new_y_offset