diff --git a/code/__defines/misc_vr.dm b/code/__defines/misc_vr.dm index 0465c196a0..a7bd4df318 100644 --- a/code/__defines/misc_vr.dm +++ b/code/__defines/misc_vr.dm @@ -65,4 +65,35 @@ #define MAT_PLASTITANIUM "plastitanium" #define MAT_PLASTITANIUMHULL "plastitanium hull" #define MAT_PLASTITANIUMGLASS "plastitanium glass" -#define MAT_GOLDHULL "gold hull" \ No newline at end of file +<<<<<<< HEAD +#define MAT_GOLDHULL "gold hull" +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref +#define MAT_GOLDHULL "gold hull" + +#define RESIZE_HUGE 2 +#define RESIZE_BIG 1.5 +#define RESIZE_NORMAL 1 +#define RESIZE_SMALL 0.5 +#define RESIZE_TINY 0.25 +#define RESIZE_A_HUGEBIG (RESIZE_HUGE + RESIZE_BIG) / 2 +#define RESIZE_A_BIGNORMAL (RESIZE_BIG + RESIZE_NORMAL) / 2 +#define RESIZE_A_NORMALSMALL (RESIZE_NORMAL + RESIZE_SMALL) / 2 +#define RESIZE_A_SMALLTINY (RESIZE_SMALL + RESIZE_TINY) / 2 +======= +#define MAT_GOLDHULL "gold hull" + +#define RESIZE_MINIMUM 0.25 +#define RESIZE_MAXIMUM 2 +#define RESIZE_MINIMUM_DORMS 0.01 +#define RESIZE_MAXIMUM_DORMS 6 + +#define RESIZE_HUGE 2 +#define RESIZE_BIG 1.5 +#define RESIZE_NORMAL 1 +#define RESIZE_SMALL 0.5 +#define RESIZE_TINY 0.25 +#define RESIZE_A_HUGEBIG (RESIZE_HUGE + RESIZE_BIG) / 2 +#define RESIZE_A_BIGNORMAL (RESIZE_BIG + RESIZE_NORMAL) / 2 +#define RESIZE_A_NORMALSMALL (RESIZE_NORMAL + RESIZE_SMALL) / 2 +#define RESIZE_A_SMALLTINY (RESIZE_SMALL + RESIZE_TINY) / 2 +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index d250c441ad..c905db0bce 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -222,7 +222,13 @@ // Playerscale var/size = dna.GetUIValueRange(DNA_UI_PLAYERSCALE, player_sizes_list.len) if((0 < size) && (size <= player_sizes_list.len)) +<<<<<<< HEAD H.resize(player_sizes_list[player_sizes_list[size]], FALSE) +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref + H.resize(player_sizes_list[player_sizes_list[size]], TRUE) +======= + H.resize(player_sizes_list[player_sizes_list[size]], TRUE, ignore_prefs = TRUE) +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref // Tail/Taur Color H.r_tail = dna.GetUIValueRange(DNA_UI_TAIL_R, 255) diff --git a/code/modules/admin/verbs/resize.dm b/code/modules/admin/verbs/resize.dm new file mode 100644 index 0000000000..fc723c5278 --- /dev/null +++ b/code/modules/admin/verbs/resize.dm @@ -0,0 +1,28 @@ +/client/proc/resize(var/mob/living/L in mob_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) as num|null + if(!size_multiplier) + return //cancelled + + size_multiplier = clamp(size_multiplier, 0.01, 1000) + var/can_be_big = L.has_large_resize_bounds() + var/very_big = is_extreme_size(size_multiplier) + + if(very_big && can_be_big) // made an extreme size in an area that allows it, don't assume adminbuse + to_chat(src,"[L] will lose this size upon moving into an area where this size is not allowed.") + else if(very_big) // made an extreme size in an area that doesn't allow it, assume adminbuse + to_chat(src,"[L] will retain this normally unallowed size outside this area.") + L.size_uncapped = TRUE + else if(L.size_uncapped) // made a normal size after having been an extreme adminbuse size + to_chat(src,"[L] now returned to normal area-based size limitations.") + L.size_uncapped = FALSE + + L.resize(size_multiplier, animate = TRUE, uncapped = TRUE, ignore_prefs = TRUE) + + log_and_message_admins("has changed [key_name(L)]'s size multiplier to [size_multiplier].") + feedback_add_details("admin_verb","RESIZE") \ No newline at end of file diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index a1149821d2..5af5db28b2 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -45,7 +45,7 @@ character.weight_gain = pref.weight_gain character.weight_loss = pref.weight_loss character.fuzzy = pref.fuzzy - character.resize(pref.size_multiplier, animate = FALSE) + character.resize(pref.size_multiplier, animate = FALSE, ignore_prefs = TRUE) /datum/category_item/player_setup_item/vore/size/content(var/mob/user) . += "
" diff --git a/code/modules/clothing/under/miscellaneous_vr.dm b/code/modules/clothing/under/miscellaneous_vr.dm index 075b3daece..4c581d728b 100644 --- a/code/modules/clothing/under/miscellaneous_vr.dm +++ b/code/modules/clothing/under/miscellaneous_vr.dm @@ -79,6 +79,8 @@ return var/new_size = input("Put the desired size (25-200%), or (1-600%) in dormitory areas.", "Set Size", 200) as num|null + if(!new_size) + return //cancelled //Check AGAIN because we accepted user input which is blocking. if (src != H.w_uniform) @@ -88,9 +90,9 @@ if (H.stat || H.restrained()) return - if (isnull(H.size_multiplier)) + if (isnull(H.size_multiplier)) // Why would this ever be the case? to_chat(H,"The uniform panics and corrects your apparently microscopic size.") - H.resize(RESIZE_NORMAL) + H.resize(RESIZE_NORMAL, ignore_prefs = TRUE) H.update_icons() //Just want the matrix transform return @@ -102,7 +104,7 @@ if(new_size != H.size_multiplier) if(!original_size) original_size = H.size_multiplier - H.resize(new_size/100) + H.resize(new_size/100, ignore_prefs = TRUE) // Ignores prefs because you can only resize yourself H.visible_message("The space around [H] distorts as they change size!","The space around you distorts as you change size!") else //They chose their current size. return @@ -111,7 +113,7 @@ . = ..() if(. && ishuman(M) && original_size) var/mob/living/carbon/human/H = M - H.resize(original_size) + H.resize(original_size, ignore_prefs = TRUE) original_size = null H.visible_message("The space around [H] distorts as they return to their original size!","The space around you distorts as you return to your original size!") diff --git a/code/modules/mob/living/carbon/human/emote_vr.dm b/code/modules/mob/living/carbon/human/emote_vr.dm index 5eeda3a8e4..e8df964590 100644 --- a/code/modules/mob/living/carbon/human/emote_vr.dm +++ b/code/modules/mob/living/carbon/human/emote_vr.dm @@ -207,15 +207,6 @@ return FALSE -/mob/living/carbon/human/verb/toggle_resizing_immunity() - set name = "Toggle Resizing Immunity" - set desc = "Toggles your ability to resist resizing attempts" - set category = "IC" - - resizable = !resizable - to_chat(src, "You are now [resizable ? "susceptible" : "immune"] to being resized.") - - /mob/living/carbon/human/proc/handle_flip_vr() var/original_density = density var/original_passflags = pass_flags diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm index 07d6d070f4..b797fe7c16 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm @@ -502,7 +502,7 @@ var/global/list/disallowed_protean_accessories = list( var/atom/reform_spot = blob.drop_location() //Size update - resize(blob.size_multiplier, FALSE) + resize(blob.size_multiplier, FALSE, ignore_prefs = TRUE) //Move them back where the blob was forceMove(reform_spot) diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm index 4efff07b39..a27319b51b 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm @@ -396,14 +396,14 @@ //Sizing up if(cost > 0) if(refactory.use_stored_material(MAT_STEEL,cost)) - user.resize(size_factor) + user.resize(size_factor, ignore_prefs = TRUE) else to_chat(user,"That size change would cost [cost] steel, which you don't have.") //Sizing down (or not at all) else if(cost <= 0) cost = abs(cost) var/actually_added = refactory.add_stored_material(MAT_STEEL,cost) - user.resize(size_factor) + user.resize(size_factor, ignore_prefs = TRUE) if(actually_added != cost) to_chat(user,"Unfortunately, [cost-actually_added] steel was lost due to lack of storage space.") diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm index 7b2da46008..4a843eed80 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm @@ -121,7 +121,7 @@ else if(ismob(target)) var/mob/living/M = target - resize(M.size_multiplier) + resize(M.size_multiplier, ignore_prefs = TRUE) //Morphed is weaker melee_damage_lower = melee_damage_disguised @@ -165,7 +165,7 @@ maptext = null size_multiplier = our_size_multiplier - resize(size_multiplier) + resize(size_multiplier, ignore_prefs = TRUE) //Baseline stats melee_damage_lower = initial(melee_damage_lower) @@ -183,7 +183,7 @@ /mob/living/simple_mob/vore/hostile/morph/will_show_tooltip() return (!morphed) -/mob/living/simple_mob/vore/hostile/morph/resize(var/new_size, var/animate = TRUE) +/mob/living/simple_mob/vore/hostile/morph/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE) if(morphed && !ismob(form)) return return ..() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index bd7c1d0d49..fc0c3bebdd 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -192,7 +192,7 @@ var/datum/preferences/B = O.client.prefs for(var/language in B.alternate_languages) O.add_language(language) - O.resize(B.size_multiplier, animate = TRUE) //VOREStation Addition: add size prefs to borgs + O.resize(B.size_multiplier, animate = TRUE, ignore_prefs = TRUE) //VOREStation Addition: add size prefs to borgs O.fuzzy = B.fuzzy //VOREStation Addition: add size prefs to borgs callHook("borgify", list(O)) diff --git a/code/modules/nifsoft/software/15_misc.dm b/code/modules/nifsoft/software/15_misc.dm index 2b173346ce..dede84b0d9 100644 --- a/code/modules/nifsoft/software/15_misc.dm +++ b/code/modules/nifsoft/software/15_misc.dm @@ -134,7 +134,7 @@ to_chat(nif.human,"The safety features of the NIF Program prevent you from choosing this size.") return else - if(nif.human.resize(new_size/100)) + if(nif.human.resize(new_size/100, ignore_prefs = TRUE)) to_chat(nif.human,"You set the size to [new_size]%") nif.human.visible_message("Swirling grey mist envelops [nif.human] as they change size!","Swirling streams of nanites wrap around you as you change size!") spawn(0) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Vore_vr.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Vore_vr.dm index 02334afe15..c688b4ad75 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Vore_vr.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Vore_vr.dm @@ -13,8 +13,15 @@ mrate_static = TRUE /datum/reagent/macrocillin/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) +<<<<<<< HEAD if(M.size_range_check(M.size_multiplier)) M.resize(M.size_multiplier+0.01, FALSE)//Incrrease 1% per tick. //CHOMP Edit: don't do fancy animates. Unnecessary on 1% changes. Laggy. +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref + if(M.size_range_check(M.size_multiplier)) + M.resize(M.size_multiplier+0.01)//Incrrease 1% per tick. +======= + M.resize(M.size_multiplier+0.01, uncapped = M.has_large_resize_bounds()) //Incrrease 1% per tick. +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref return /datum/reagent/microcillin @@ -27,8 +34,15 @@ mrate_static = TRUE /datum/reagent/microcillin/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) +<<<<<<< HEAD if(M.size_range_check(M.size_multiplier)) M.resize(M.size_multiplier-0.01, FALSE) //Decrease 1% per tick. //CHOMP Edit: don't do fancy animates. Unnecessary on 1% changes. Laggy. +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref + if(M.size_range_check(M.size_multiplier)) + M.resize(M.size_multiplier-0.01) //Decrease 1% per tick. +======= + M.resize(M.size_multiplier-0.01, uncapped = M.has_large_resize_bounds()) //Decrease 1% per tick. +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref return diff --git a/code/modules/vore/eating/vore_vr.dm b/code/modules/vore/eating/vore_vr.dm index 5a69bc9dc9..cc6adaf633 100644 --- a/code/modules/vore/eating/vore_vr.dm +++ b/code/modules/vore/eating/vore_vr.dm @@ -45,6 +45,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE //Actual preferences var/digestable = TRUE var/devourable = TRUE + var/resizable = TRUE var/feeding = TRUE var/absorbable = TRUE //TFF 14/12/19 - choose whether allowing absorbing var/digest_leave_remains = FALSE @@ -129,6 +130,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE digestable = json_from_file["digestable"] devourable = json_from_file["devourable"] + resizable = json_from_file["resizable"] feeding = json_from_file["feeding"] absorbable = json_from_file["absorbable"] //TFF 14/12/19 - choose whether allowing absorbing digest_leave_remains = json_from_file["digest_leave_remains"] @@ -155,6 +157,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE digestable = TRUE if(isnull(devourable)) devourable = TRUE + if(isnull(resizable)) + resizable = TRUE if(isnull(feeding)) feeding = TRUE if(isnull(absorbable)) @@ -197,6 +201,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE "version" = version, "digestable" = digestable, "devourable" = devourable, + "resizable" = resizable, "absorbable" = absorbable, "feeding" = feeding, "digest_leave_remains" = digest_leave_remains, diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 6a892c65d1..9d9f190c61 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -254,6 +254,7 @@ data["prefs"] = list( "digestable" = host.digestable, "devourable" = host.devourable, + "resizable" = host.resizable, "feeding" = host.feeding, "absorbable" = host.absorbable, "digest_leave_remains" = host.digest_leave_remains, @@ -415,6 +416,12 @@ host.client.prefs_vr.devourable = host.devourable unsaved_changes = TRUE return TRUE + if("toggle_resize") + host.resizable = !host.resizable + if(host.client.prefs_vr) + host.client.prefs_vr.resizable = host.resizable + unsaved_changes = TRUE + return TRUE if("toggle_feed") host.feeding = !host.feeding if(host.client.prefs_vr) diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 703706483f..ed9974fc49 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -60,6 +60,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 /mob/living/get_effective_size() return size_multiplier +<<<<<<< HEAD /** * Resizes the mob immediately to the desired mod, animating it growing/shrinking. * It can be used by anything that calls it. @@ -68,12 +69,120 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 var/area/A = get_area(src) return istype(A, /area/crew_quarters/sleep) +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref +/** + * Resizes the mob immediately to the desired mod, animating it growing/shrinking. + * It can be used by anything that calls it. + */ + +======= +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref /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)) return FALSE return TRUE +<<<<<<< HEAD /mob/living/proc/resize(var/new_size, var/animate = TRUE, var/mark_unnatural_size = TRUE) +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref +/proc/add_to_uncapped_list(var/mob/living/L) + if(L.size_uncapped) + return + if(!GLOB.size_uncapped_mobs.len) + GLOB.size_uncapped_mobs_timer = addtimer(CALLBACK(GLOBAL_PROC, .check_uncapped_list), 2 SECONDS, TIMER_LOOP | TIMER_UNIQUE | TIMER_STOPPABLE) + GLOB.size_uncapped_mobs |= weakref(L) + +/proc/remove_from_uncapped_list(var/mob/living/L) + if(!GLOB.size_uncapped_mobs.len) + return + + GLOB.size_uncapped_mobs -= weakref(L) + + if(!GLOB.size_uncapped_mobs.len) + deltimer(GLOB.size_uncapped_mobs_timer) + GLOB.size_uncapped_mobs_timer = null + +/proc/check_uncapped_list() + for(var/weakref/wr in GLOB.size_uncapped_mobs) + var/mob/living/L = wr.resolve() + var/area/A = get_area(L) + if(!istype(L)) + GLOB.size_uncapped_mobs -= wr + continue + + if((A.limit_mob_size && !L.size_uncapped) && (L.size_multiplier <= RESIZE_TINY || L.size_multiplier >= RESIZE_HUGE)) + L.resize(L.size_multiplier) + GLOB.size_uncapped_mobs -= wr + + if(!GLOB.size_uncapped_mobs.len) + deltimer(GLOB.size_uncapped_mobs_timer) + GLOB.size_uncapped_mobs_timer = null + +/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 + remove_from_uncapped_list(src) + else + add_to_uncapped_list(src) +======= +/atom/movable/proc/has_large_resize_bounds() + var/area/A = get_area(src) //Get the atom's area to check for size limit. + return !A.limit_mob_size + +/proc/is_extreme_size(size) + return (size < RESIZE_MINIMUM || size > RESIZE_MAXIMUM) + +/proc/add_to_uncapped_list(var/mob/living/L) + if(L.size_uncapped) + return + if(!GLOB.size_uncapped_mobs.len) + //Could be a subsystem but arguably a giant waste of time to make into a subsystem. A subsystem that is paused on and off all the time? Eh. + //If you're that worried, make metrics for how often this even runs and then decide. + GLOB.size_uncapped_mobs_timer = addtimer(CALLBACK(GLOBAL_PROC, .check_uncapped_list), 2 SECONDS, TIMER_LOOP | TIMER_UNIQUE | TIMER_STOPPABLE) + GLOB.size_uncapped_mobs |= weakref(L) + +/proc/remove_from_uncapped_list(var/mob/living/L) + if(!GLOB.size_uncapped_mobs.len) + return + + GLOB.size_uncapped_mobs -= weakref(L) + + if(!GLOB.size_uncapped_mobs.len) + deltimer(GLOB.size_uncapped_mobs_timer) + GLOB.size_uncapped_mobs_timer = null + +/proc/check_uncapped_list() + for(var/weakref/wr in GLOB.size_uncapped_mobs) + var/mob/living/L = wr.resolve() + if(!istype(L) || L.size_uncapped) + GLOB.size_uncapped_mobs -= wr + continue + + // If we get here, you're a mob, and you don't have admin exclusion (size_uncapped) to being big, and you're very likely big. + // If you're not abnormally big, the below will do nothing, so it's fine to run anyway. + if(!L.has_large_resize_bounds()) + L.resize(L.size_multiplier, ignore_prefs = TRUE) //Calling this will have resize() clamp it + GLOB.size_uncapped_mobs -= wr + + if(!GLOB.size_uncapped_mobs.len) + deltimer(GLOB.size_uncapped_mobs_timer) + GLOB.size_uncapped_mobs_timer = null + +/** + * Resizes the mob immediately to the desired mod, animating it growing/shrinking. + * It can be used by anything that calls it. + */ + + +/mob/living/proc/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE) + if(!uncapped) + new_size = clamp(new_size, RESIZE_MINIMUM, RESIZE_MAXIMUM) + remove_from_uncapped_list(src) + else if(is_extreme_size(new_size)) + add_to_uncapped_list(src) + +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref if(size_multiplier == new_size) return 1 @@ -111,8 +220,8 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 else update_transform() //Lame way -/mob/living/carbon/human/resize(var/new_size, var/animate = TRUE) - if(!resizable) +/mob/living/carbon/human/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE) + if(!resizable && !ignore_prefs) return 1 if(species) vis_height = species.icon_height @@ -125,7 +234,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 apply_hud(index, HI) // Optimize mannequins - never a point to animating or doing HUDs on these. -/mob/living/carbon/human/dummy/mannequin/resize(var/new_size, var/animate = TRUE) +/mob/living/carbon/human/dummy/mannequin/resize(var/new_size, var/animate = TRUE, var/uncapped = FALSE, var/ignore_prefs = FALSE) size_multiplier = new_size /** diff --git a/code/modules/vore/resizing/sizegun_vr.dm b/code/modules/vore/resizing/sizegun_vr.dm index e30c218fbb..9596b1d4d3 100644 --- a/code/modules/vore/resizing/sizegun_vr.dm +++ b/code/modules/vore/resizing/sizegun_vr.dm @@ -44,12 +44,15 @@ set category = "Object" set src in view(1) - var/size_select = input("Put the desired size (25-200%), (1-600%) in dormitory areas.", "Set Size", size_set_to * 100) as num - if(!size_range_check(size_select)) - to_chat(usr, "Invalid size.") - return - size_set_to = (size_select/100) + var/size_select = input("Put the desired size (25-200%), (1-600%) in dormitory areas.", "Set Size", size_set_to * 100) as num|null + if(!size_select) + return //cancelled + //We do valid resize testing in actual firings because people move after setting these things. + //Just a basic clamp here to the valid ranges. + size_set_to = clamp((size_select/100), RESIZE_MINIMUM_DORMS, RESIZE_MAXIMUM_DORMS) to_chat(usr, "You set the size to [size_select]%") + if(size_set_to < RESIZE_MINIMUM || size_set_to > RESIZE_MAXIMUM) + to_chat(usr, "Note: Resizing limited to 25-200% automatically while outside dormatory areas.") //hint that we clamp it in resize /obj/item/weapon/gun/energy/sizegun/examine(mob/user) . = ..() @@ -66,8 +69,10 @@ set category = "Object" set src in view(1) - var/size_select = input("Put the desired size", "Set Size", size_set_to * 100) as num - size_set_to = max(1,size_select/100) //No negative numbers + var/size_select = input("Put the desired size (1-600%)", "Set Size", size_set_to * 100) as num|null + if(!size_select) + return //cancelled + size_set_to = clamp((size_select/100), 0, 1000) //eheh to_chat(usr, "You set the size to [size_select]%") // @@ -88,21 +93,55 @@ /obj/item/projectile/beam/sizelaser/on_hit(var/atom/target) var/mob/living/M = target + var/ignoring_prefs = (target == firer ? TRUE : FALSE) // Resizing yourself + if(istype(M)) +<<<<<<< HEAD if(!M.in_dorms() || !istype(M, /mob/living/carbon/human)) if(!M.resize(clamp(set_size,0.25,2))) to_chat(M, "The beam fires into your body, changing your size!") else if(!M.resize(clamp(set_size,0.01,6))) to_chat(M, "The beam fires into your body, changing your size!") +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref + if(!M.resize(set_size)) + to_chat(M, "The beam fires into your body, changing your size!") +======= + if(!M.resize(set_size, uncapped = M.has_large_resize_bounds(), ignore_prefs = ignoring_prefs)) + to_chat(M, "The beam fires into your body, changing your size!") +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref M.updateicon() return return 1 /obj/item/projectile/beam/sizelaser/admin/on_hit(var/atom/target) var/mob/living/M = target + if(istype(M)) +<<<<<<< HEAD M.resize(set_size, TRUE, FALSE) +||||||| parent of 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref + M.resize(set_size, TRUE, TRUE) + if(set_size >= RESIZE_TINY && set_size <= RESIZE_HUGE) + M.size_uncapped = FALSE + M.size_uncapped = TRUE +======= + + var/can_be_big = M.has_large_resize_bounds() + var/very_big = is_extreme_size(set_size) + + if(very_big && can_be_big) // made an extreme size in an area that allows it, don't assume adminbuse + to_chat(firer, "[M] will lose this size upon moving into an area where this size is not allowed.") + else if(very_big) // made an extreme size in an area that doesn't allow it, assume adminbuse + to_chat(firer, "[M] will retain this normally unallowed size outside this area.") + M.size_uncapped = TRUE + else if(M.size_uncapped) // made a normal size after having been an extreme adminbuse size + to_chat(firer, "[M] now returned to normal area-based size limitations.") + M.size_uncapped = FALSE + + M.resize(set_size, uncapped = TRUE, ignoring_prefs = TRUE) // Always ignores prefs, caution is advisable + +>>>>>>> 44088ebce8... Merge pull request #10092 from VOREStation/Arokha/resizepref to_chat(M, "The beam fires into your body, changing your size!") M.updateicon() return diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index 9725685f75..845e896969 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -908,6 +908,7 @@ const VoreUserPreferences = (props, context) => { const { digestable, devourable, + resizable, feeding, absorbable, digest_leave_remains, @@ -1055,6 +1056,44 @@ const VoreUserPreferences = (props, context) => { : "Click here to turn on hunger noises.")} content={noisy ? "Hunger Noises Enabled" : "Hunger Noises Disabled"} /> + +