Merge pull request #1115 from DragonTrance/sizecood-thingy

view your bigness as smolness
This commit is contained in:
QuoteFox
2021-05-02 08:29:52 +01:00
committed by GitHub
3 changed files with 44 additions and 0 deletions
@@ -0,0 +1,34 @@
//This action is technically a duplicate of /action/small_sprite
//However, we do our own things...
/datum/action/sizecode_resize
name = "Toggle Giant Sprite"
desc = "Others will continue to see you giant."
icon_icon = 'icons/mob/screen_gen_old.dmi'
button_icon_state = "health1" //You can change this if you want
background_icon_state = "bg_alien" //But keep this as a distinct background
var/small = FALSE
var/image/small_icon
/datum/action/sizecode_resize/Grant(mob/M, safety=FALSE)
if(ishuman(M) && !safety) //this probably gets called before a person gets overlays on roundstart, so try again
if(!LAZYLEN(M.overlays))
addtimer(CALLBACK(src, .proc/Grant, M, TRUE), 5) //https://www.youtube.com/watch?v=QQ-aYZzlDeo
return
..()
if(!owner)
return
var/image/I = image(icon=owner.icon,icon_state=owner.icon_state,loc=owner,layer=owner.layer,pixel_x=owner.pixel_x,pixel_y=owner.pixel_y)
I.overlays += owner.overlays
I.override = TRUE
small_icon = I
/datum/action/sizecode_resize/Trigger()
..()
if(!small)
owner.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic, "sizecode_smallsprite", small_icon)
else
owner.remove_alt_appearance("sizecode_smallsprite")
small = !small
return TRUE
@@ -13,6 +13,8 @@ var/const/RESIZE_MICRO = 0.25
var/size_multiplier = 1 //multiplier for the mob's icon size atm
var/previous_size = 1
//Cyanosis - Action that resizes the sprite for the client but nobody else. Say goodbye to attacking yourself when someone's above you lmao
var/datum/action/sizecode_resize/small_sprite
#define MOVESPEED_ID_SIZE "SIZECODE"
#define MOVESPEED_ID_STOMP "STEPPY"
@@ -60,6 +62,13 @@ mob/living/get_effective_size()
//if(src.size_multiplier >= RESIZE_A_HUGEBIG || src.size_multiplier <= RESIZE_A_TINYMICRO) Will remove clothing when too big or small. Will do later.
previous_size = size_multiplier //And, change this now that we are finally done.
//Now check if the mob can get the size action
if(!small_sprite)
small_sprite = new(src)
small_sprite.Remove(src)
if(size_multiplier >= 1.25) //Anything bigger will start to block things
small_sprite.Grant(src)
//handle the big steppy, except nice
/mob/living/proc/handle_micro_bump_helping(var/mob/living/tmob)
if(ishuman(src))