Resize proc polish and fixing

This commit is contained in:
Nyks
2021-04-07 02:01:33 +03:00
parent ea2a523ba8
commit 5b3a00a2dc
10 changed files with 34 additions and 29 deletions
@@ -1,5 +1,14 @@
//TFF 28/8/19 - cleanup of areas placement - removes all but rogueminer_vr stuff.
/area
var/limit_mob_size = TRUE //If mob size is limited in the area.
/area/Entered(mob/living/H, oldLoc)
//Clamps mob size when entering a new area that has size limit.
//Mobs with size_uncapped set to TRUE or 1 will be ignored.
. = ..()
if (src.limit_mob_size && !H.size_uncapped)
H.resize(H.size_multiplier)
/area/shuttle/belter
name = "Belter Shuttle"
icon_state = "shuttle2"
+1 -1
View File
@@ -222,7 +222,7 @@
// Playerscale
var/size = dna.GetUIValueRange(DNA_UI_PLAYERSCALE, player_sizes_list.len)
if((0 < size) && (size <= player_sizes_list.len))
H.resize(player_sizes_list[player_sizes_list[size]], FALSE)
H.resize(player_sizes_list[player_sizes_list[size]], TRUE)
// Tail/Taur Color
H.r_tail = dna.GetUIValueRange(DNA_UI_TAIL_R, 255)
@@ -155,6 +155,7 @@ var/list/admin_verbs_fun = list(
/client/proc/smite,
/client/proc/smite_vr, //VOREStation Add,
/client/proc/admin_lightning_strike,
/client/proc/resize //VOREStation Add,
)
var/list/admin_verbs_spawn = list(
+13
View File
@@ -0,0 +1,13 @@
/client/proc/resize(var/mob/living/L in player_list)
set name = "Resize"
set desc = "Resizes any living mob without any restrictions on size."
set category = "Fun"
if(!check_rights(R_ADMIN, R_FUN))
return
var/size_multiplier = input(usr, "Input size multiplier.", "Resize", 1)
L.resize(size_multiplier, TRUE, TRUE)
L.size_uncapped = TRUE
log_and_message_admins("has changed [key_name(L)]'s size multiplier to [size_multiplier].")
feedback_add_details("admin_verb","RESIZE")
@@ -7,7 +7,6 @@
var/impersonate_bodytype //For impersonating a bodytype
var/ability_flags = 0 //Shadekin abilities/potentially other species-based?
var/sensorpref = 5 //Suit sensor loadout pref
var/unnaturally_resized = FALSE //If one became larger than 200%, or smaller than 25%. This flag is needed for the case when admins want someone to be very big or very small outside of dorms.
var/wings_hidden = FALSE
/mob/living/carbon/human/proc/shadekin_get_energy()
@@ -62,8 +62,6 @@
//No need to update all of these procs if the guy is dead.
fall() //VORESTATION EDIT. Prevents people from floating
if(unnaturally_resized) //VORESTATION EDIT.
handle_unnatural_size()
if(stat != DEAD && !stasis)
//Updates the number of stored chemicals for powers
handle_changeling()
@@ -78,10 +78,3 @@
// Moving around increases germ_level faster
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
germ_level++
/mob/living/carbon/human/proc/handle_unnatural_size()
if(!in_dorms())
if(src.size_multiplier > 2)
src.resize(2)
else if (src.size_multiplier < 0.25)
src.resize(0.25)
+1
View File
@@ -1,4 +1,5 @@
/mob
var/size_uncapped = FALSE //Determines if a mob's size obedies the resize cap, used for adminbus resize.
var/vantag_hud = 0 // Do I have the HUD enabled?
var/mob/temporary_form // For holding onto a temporary form
+7 -12
View File
@@ -64,28 +64,23 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
* Resizes the mob immediately to the desired mod, animating it growing/shrinking.
* It can be used by anything that calls it.
*/
/atom/movable/proc/in_dorms()
var/area/A = get_area(src)
return istype(A, /area/crew_quarters/sleep)
/atom/movable/proc/size_range_check(size_select) //both objects and mobs needs to have that
if((!in_dorms() && (size_select > 200 || size_select < 25)) || (size_select > 600 || size_select <1))
var/area/A = get_area(src) //Get the atom's area to check for size limit.
if((A.limit_mob_size && (size_select > 200 || size_select < 25)) || (size_select > 600 || size_select <1))
return FALSE
return TRUE
/mob/living/proc/resize(var/new_size, var/animate = TRUE, var/mark_unnatural_size = TRUE)
/mob/living/proc/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE)
if(!uncapped)
new_size = clamp(new_size, RESIZE_TINY, RESIZE_HUGE)
src.size_uncapped = FALSE
if(size_multiplier == new_size)
return 1
size_multiplier = new_size //Change size_multiplier so that other items can interact with them
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(new_size > 2 || new_size < 0.25)
if(mark_unnatural_size) //Will target size be reverted to ordinary bounds when out of dorms or not?
H.unnaturally_resized = TRUE
else
H.unnaturally_resized = FALSE
if(animate)
var/change = new_size - size_multiplier
var/duration = (abs(change)+0.25) SECONDS
+2 -6
View File
@@ -89,12 +89,8 @@
/obj/item/projectile/beam/sizelaser/on_hit(var/atom/target)
var/mob/living/M = target
if(istype(M))
if(!M.in_dorms() || !istype(M, /mob/living/carbon/human))
if(!M.resize(clamp(set_size,0.25,2)))
to_chat(M, "<font color='blue'>The beam fires into your body, changing your size!</font>")
else
if(!M.resize(clamp(set_size,0.01,6)))
to_chat(M, "<font color='blue'>The beam fires into your body, changing your size!</font>")
if(!M.resize(set_size))
to_chat(M, "<font color='blue'>The beam fires into your body, changing your size!</font>")
M.updateicon()
return
return 1