From 890609c0abe3e088845e597a52552a393e58eb39 Mon Sep 17 00:00:00 2001 From: Dahlular Date: Mon, 3 Aug 2020 10:54:02 -0600 Subject: [PATCH] mobs have holder sizes respective to size multiplier --- hyperstation/code/modules/resize/holder_micro.dm | 5 +++-- hyperstation/code/modules/resize/resizing.dm | 16 +++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hyperstation/code/modules/resize/holder_micro.dm b/hyperstation/code/modules/resize/holder_micro.dm index 31193594..203cf5d8 100644 --- a/hyperstation/code/modules/resize/holder_micro.dm +++ b/hyperstation/code/modules/resize/holder_micro.dm @@ -6,7 +6,7 @@ icon = null icon_state = "" slot_flags = ITEM_SLOT_FEET | ITEM_SLOT_HEAD | ITEM_SLOT_ID | ITEM_SLOT_BACK | ITEM_SLOT_NECK - w_class = WEIGHT_CLASS_NORMAL + w_class = null //handled by their size can_head = TRUE /obj/item/clothing/head/mob_holder/micro/Initialize(mapload, mob/living/M, _worn_state, alt_worn, lh_icon, rh_icon, _can_head_override = FALSE) @@ -39,6 +39,8 @@ w_class = WEIGHT_CLASS_TINY if(MOB_SIZE_SMALL) w_class = WEIGHT_CLASS_SMALL + if(MOB_SIZE_HUMAN) + w_class = WEIGHT_CLASS_BULKY if(MOB_SIZE_LARGE) w_class = WEIGHT_CLASS_HUGE @@ -76,7 +78,6 @@ var/obj/item/clothing/head/mob_holder/micro/holder = generate_mob_holder() if(!holder) return - drop_all_held_items() L.equip_to_slot(holder, SLOT_SHOES) return diff --git a/hyperstation/code/modules/resize/resizing.dm b/hyperstation/code/modules/resize/resizing.dm index d09327ba..11d1f1a3 100644 --- a/hyperstation/code/modules/resize/resizing.dm +++ b/hyperstation/code/modules/resize/resizing.dm @@ -25,7 +25,6 @@ var/const/RESIZE_A_TINYMICRO = (RESIZE_TINY + RESIZE_MICRO) / 2 M.Scale(size_multiplier) M.Translate(0, 16*(size_multiplier-1)) //translate by 16 * size_multiplier - 1 on Y axis src.transform = M //the source of transform is M - src.update_mobsize() //Doesn't work yet /mob/proc/get_effective_size() return 100000 @@ -38,6 +37,7 @@ mob/living/get_effective_size() if(size_multiplier == previous_size) return 1 src.update_transform() //WORK DAMN YOU + src.update_mobsize() //Doesn't work yet //Going to change the health and speed values too src.remove_movespeed_modifier(MOVESPEED_ID_SIZE) src.add_movespeed_modifier(MOVESPEED_ID_SIZE, multiplicative_slowdown = (abs(size_multiplier - 1) * 0.8 )) @@ -191,13 +191,15 @@ mob/living/get_effective_size() tmob.adjustBruteLoss(B) //final result in brute loss //Proc for changing mob_size to be grabbed for item weight classes -/mob/living/proc/update_mobsize() +/mob/living/proc/update_mobsize(var/mob/living/tmob) if(size_multiplier <= 0.50) - mob_size = MOB_SIZE_TINY - if(size_multiplier <= 1) - mob_size = MOB_SIZE_SMALL - if(size_multiplier >= 2) - mob_size = MOB_SIZE_LARGE + mob_size = 0 + if(size_multiplier < 1) + mob_size = 1 + if(size_multiplier == 1) + mob_size = 2 //the default human size + if(size_multiplier > 1) + mob_size = 3 //Proc for instantly grabbing valid size difference. Code optimizations soon(TM) /*