From 6de44caeed332210922c55255cfe343c8d66b534 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Fri, 12 Apr 2024 21:55:07 -0400 Subject: [PATCH 01/15] throttles mouse movement calls --- code/_onclick/drag_drop.dm | 4 ++++ code/modules/client/client_defines.dm | 3 +++ 2 files changed, 7 insertions(+) diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index bd1509d88b..c474be82af 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -92,7 +92,11 @@ . = 1 //Please don't roast me too hard +//Oh don't worry, We Will. /client/MouseMove(object, location, control, params) + if(next_mousemove > world.time) + return + next_mousemove = world.time + world.tick_lag mouseParams = params mouse_location_ref = WEAKREF(location) mouse_object_ref = WEAKREF(object) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 14224cf02e..4f5624578c 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -189,3 +189,6 @@ /// AFK tracking var/last_activity = 0 + + /// The next point in time at which the client is allowed to send a mousemove() + var/next_mousemove = 0 From 19c436e99403a9f8690b3da4a1166b25318b7927 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Tue, 17 Sep 2024 16:52:54 -0300 Subject: [PATCH 02/15] push --- code/modules/client/preferences.dm | 17 +++++++++++++++-- code/modules/client/preferences_savefile.dm | 15 +++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f2a9c131cc..4a8460635c 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -229,7 +229,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ///loadout stuff var/gear_points = 10 var/list/gear_categories - var/list/loadout_data = list() + var/list/loadout_data[MAXIMUM_LOADOUT_SAVES] var/list/unlockable_loadout_data = list() var/loadout_slot = 1 //goes from 1 to MAXIMUM_LOADOUT_SAVES var/gear_category @@ -367,7 +367,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) //calculate your gear points from the chosen item gear_points = CONFIG_GET(number/initial_gear_points) var/list/chosen_gear = loadout_data["SAVE_[loadout_slot]"] - if(chosen_gear) + if(islist(chosen_gear)) loadout_errors = 0 for(var/loadout_item in chosen_gear) var/loadout_item_path = loadout_item[LOADOUT_ITEM] @@ -910,6 +910,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "" if(LOADOUT_CHAR_TAB) dat += "" + dat += "" + dat += "" dat += "" dat += "
Loadout slot
" + for(var/iteration in 1 to MAXIMUM_LOADOUT_SAVES) + dat += "[iteration]" + dat += "
You can only choose one item per category, unless it's an item that spawns in your backpack or hands.
" @@ -3240,6 +3245,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) preferences_tab = text2num(href_list["tab"]) if(href_list["preference"] == "gear") + if(href_list["select_slot"]) + var/chosen = text2num(href_list["select_slot"]) + if(!chosen) + return + chosen = floor(chosen) + if(chosen > MAXIMUM_LOADOUT_SAVES || chosen < 1) + return + loadout_slot = chosen if(href_list["clear_loadout"]) loadout_data["SAVE_[loadout_slot]"] = list() save_preferences() diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 6c65cc0720..d457f85e07 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -911,10 +911,13 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car belly_prefs = json_from_file["belly_prefs"] //gear loadout - if(S["loadout"]) + if(istext(S["loadout"])) loadout_data = safe_json_decode(S["loadout"]) else - loadout_data = list() + var/list/make_new[MAXIMUM_LOADOUT_SAVES] + loadout_data = make_new + //let's remember their last used slot, i'm sure "oops i brought the wrong stuff" will be an issue now + S["loadout_slot"] >> loadout_slot //try to fix any outdated data if necessary //preference updating will handle saving the updated data for us. @@ -1094,6 +1097,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car vore_smell = copytext(vore_smell, 1, MAX_TASTE_LEN) belly_prefs = SANITIZE_LIST(belly_prefs) + loadout_slot = sanitize_num_clamp(loadout_slot, 1, MAXIMUM_LOADOUT_SAVES, 1, TRUE) + cit_character_pref_load(S) return TRUE @@ -1278,10 +1283,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //gear loadout - if(length(loadout_data)) + if(islist(loadout_data)) S["loadout"] << safe_json_encode(loadout_data) else - S["loadout"] << safe_json_encode(list()) + var/list/make_new[MAXIMUM_LOADOUT_SAVES] + S["loadout"] << safe_json_encode(make_new) + WRITE_FILE(S["loadout_slot"], loadout_slot) if(length(tcg_cards)) S["tcg_cards"] << safe_json_encode(tcg_cards) From b0dd5b48ed340b271fa3f1087996360aa81475ab Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 25 Sep 2024 03:42:51 -0300 Subject: [PATCH 03/15] uh oh --- .github/workflows/ci_suite.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 46871b3852..7e9650f98e 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -8,7 +8,7 @@ on: - master jobs: run_linters: - if: !contains(github.event.head_commit.message, '[ci skip]') + if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Run Linters runs-on: ubuntu-22.04 steps: @@ -51,7 +51,7 @@ jobs: outputFile: output-annotations.txt compile_all_maps: - if: !contains(github.event.head_commit.message, '[ci skip]') + if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Compile Maps runs-on: ubuntu-22.04 steps: @@ -67,7 +67,7 @@ jobs: source $HOME/BYOND/byond/bin/byondsetup tools/build/build --ci dm -DCIBUILDING -DCITESTING -DALL_MAPS run_all_tests: - if: !contains(github.event.head_commit.message, '[ci skip]') + if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Integration Tests runs-on: ubuntu-22.04 services: @@ -118,7 +118,7 @@ jobs: tools/build/build --ci -DCIBUILDING bash tools/ci/run_server.sh test_windows: - if: !contains(github.event.head_commit.message, '[ci skip]') + if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Windows Build runs-on: windows-latest steps: From b65df409d748879514f58888a2062a79647eab09 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 29 Sep 2024 17:11:32 -0300 Subject: [PATCH 04/15] that was weird --- code/modules/client/preferences.dm | 2 +- code/modules/client/preferences_savefile.dm | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4a8460635c..ddf2d71cec 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -229,7 +229,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ///loadout stuff var/gear_points = 10 var/list/gear_categories - var/list/loadout_data[MAXIMUM_LOADOUT_SAVES] + var/list/loadout_data var/list/unlockable_loadout_data = list() var/loadout_slot = 1 //goes from 1 to MAXIMUM_LOADOUT_SAVES var/gear_category diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index d457f85e07..1f74ca9031 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -914,8 +914,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(istext(S["loadout"])) loadout_data = safe_json_decode(S["loadout"]) else - var/list/make_new[MAXIMUM_LOADOUT_SAVES] - loadout_data = make_new + loadout_data = list() //let's remember their last used slot, i'm sure "oops i brought the wrong stuff" will be an issue now S["loadout_slot"] >> loadout_slot @@ -1286,8 +1285,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(islist(loadout_data)) S["loadout"] << safe_json_encode(loadout_data) else - var/list/make_new[MAXIMUM_LOADOUT_SAVES] - S["loadout"] << safe_json_encode(make_new) + S["loadout"] << safe_json_encode(list()) WRITE_FILE(S["loadout_slot"], loadout_slot) if(length(tcg_cards)) From 52b9c3b246d88bdc5e0419a218da19ace64b2d5b Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:15:09 -0400 Subject: [PATCH 05/15] Update grinder_chemical.dm --- .../plumbing/plumbers/grinder_chemical.dm | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index 1907fb91fa..9c7c6babb7 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -17,29 +17,15 @@ if(anchored) to_chat(user, "It is fastened to the floor!") return FALSE - switch(eat_dir) - if(WEST) - eat_dir = NORTH - return TRUE - if(EAST) - eat_dir = SOUTH - return TRUE - if(NORTH) - eat_dir = EAST - return TRUE - if(SOUTH) - eat_dir = WEST - return TRUE /obj/machinery/plumbing/grinder_chemical/CanAllowThrough(atom/movable/AM) . = ..() if(!anchored) return - var/move_dir = get_dir(loc, AM.loc) - if(move_dir == eat_dir) - return TRUE -/obj/machinery/plumbing/grinder_chemical/Crossed(atom/movable/AM) + return TRUE + +rinder_chemical/Crossed(atom/movable/AM) . = ..() grind(AM) @@ -61,4 +47,8 @@ return I.on_grind() reagents.add_reagent_list(I.grind_results) + + if(I.reagents) //If the thing has any reagents inside of it, grind them up. + I.reagents.trans_to(reagents, I.reagents.total_volume) + qdel(I) From a28c282158d89e9b107f92d1cffbf98d390ef1f9 Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:16:19 -0400 Subject: [PATCH 06/15] Update grinder_chemical.dm --- code/modules/plumbing/plumbers/grinder_chemical.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index 9c7c6babb7..bd341cde00 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -25,7 +25,7 @@ return TRUE -rinder_chemical/Crossed(atom/movable/AM) +/obj/machinery/plumbing/grinder_chemical/Crossed(atom/movable/AM) . = ..() grind(AM) From 61b0b62f2d28c153de297d351fe36d8e003ed3c4 Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:21:24 -0400 Subject: [PATCH 07/15] Update grinder_chemical.dm --- code/modules/plumbing/plumbers/grinder_chemical.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index bd341cde00..94c55c2b62 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -18,6 +18,8 @@ to_chat(user, "It is fastened to the floor!") return FALSE + return TRUE + /obj/machinery/plumbing/grinder_chemical/CanAllowThrough(atom/movable/AM) . = ..() if(!anchored) From 01841576cba5b25c5138d31d15d6ed5b68596c2e Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:21:42 -0400 Subject: [PATCH 08/15] Update grinder_chemical.dm --- code/modules/plumbing/plumbers/grinder_chemical.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index 94c55c2b62..9782ac3d28 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -7,7 +7,6 @@ rcd_cost = 30 rcd_delay = 30 buffer = 400 - var/eat_dir = NORTH /obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt) . = ..() From c04d889e8b2a289fedc20d7d0839247f35ccbbcf Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:36:26 -0400 Subject: [PATCH 09/15] Update grinder_chemical.dm --- .../plumbing/plumbers/grinder_chemical.dm | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index 9782ac3d28..5d01c973c1 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -7,16 +7,39 @@ rcd_cost = 30 rcd_delay = 30 buffer = 400 + var/eat_dir = NORTH /obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt) . = ..() AddComponent(/datum/component/plumbing/simple_supply, bolt) -/obj/machinery/plumbing/grinder_chemical/can_be_rotated(mob/user,rotation_type) +/obj/machinery/plumbing/grinder_chemical/examine(mob/user) + . = ..() + . += span_notice("The input direction for this item can be rotated by using CTRL+SHIFT+CLICK") + +/obj/machinery/plumbing/grinder_chemical/CtrlShiftClick(mob/user) if(anchored) to_chat(user, "It is fastened to the floor!") return FALSE + switch(eat_dir) + if(WEST) + balloon_alert(user, "set to north") + eat_dir = NORTH + return TRUE + if(EAST) + balloon_alert(user, "set to south") + eat_dir = SOUTH + return TRUE + if(NORTH) + balloon_alert(user, "set to east") + eat_dir = EAST + return TRUE + if(SOUTH) + balloon_alert(user, "set to west") + eat_dir = WEST + return TRUE + return TRUE /obj/machinery/plumbing/grinder_chemical/CanAllowThrough(atom/movable/AM) @@ -24,7 +47,9 @@ if(!anchored) return - return TRUE + var/move_dir = get_dir(loc, AM.loc) + if(move_dir == eat_dir) + return TRUE /obj/machinery/plumbing/grinder_chemical/Crossed(atom/movable/AM) . = ..() From 2099a76fc7afe92a6280d393b8e12c1c297646a2 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 20 Oct 2024 22:33:23 -0300 Subject: [PATCH 10/15] push --- .../machinery/components/binary_devices/relief_valve.dm | 4 +++- .../components/unary_devices/portables_connector.dm | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm index d0b663e4ad..3acf61b3f9 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm @@ -6,10 +6,12 @@ can_unwrench = TRUE construction_type = /obj/item/pipe/binary interaction_flags_machine = INTERACT_MACHINE_OFFLINE | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE + pipe_state = "relief_valve-t" + shift_underlay_only = FALSE + var/opened = FALSE var/open_pressure = ONE_ATMOSPHERE * 3 var/close_pressure = ONE_ATMOSPHERE - pipe_state = "relief_valve-t" /obj/machinery/atmospherics/components/binary/relief_valve/layer1 piping_layer = PIPING_LAYER_MIN diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm index 6188c919ac..cf0de33bc9 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -24,11 +24,13 @@ return ..() /obj/machinery/atmospherics/components/unary/portables_connector/update_icon_nopipes() - icon_state = "connector" + cut_overlays() if(showpipe) var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions, piping_layer = piping_layer) add_overlay(cap) + icon_state = "connector" + /obj/machinery/atmospherics/components/unary/portables_connector/process_atmos() if(!connected_device) return @@ -37,7 +39,7 @@ /obj/machinery/atmospherics/components/unary/portables_connector/can_unwrench(mob/user) . = ..() if(. && connected_device) - to_chat(user, "You cannot unwrench [src], detach [connected_device] first!") + to_chat(user, span_warning("You cannot unwrench [src], detach [connected_device] first!")) return FALSE /obj/machinery/atmospherics/components/unary/portables_connector/portableConnectorReturnAir() From 51a264c9a711e925d5a1aa6d978184d69c43f657 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 23 Oct 2024 19:51:18 -0400 Subject: [PATCH 11/15] Replaces throttle with cooldown define and also adds it to mousedrag --- code/_onclick/drag_drop.dm | 7 +++++-- code/modules/client/client_defines.dm | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index c474be82af..7672bcf452 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -94,9 +94,9 @@ //Please don't roast me too hard //Oh don't worry, We Will. /client/MouseMove(object, location, control, params) - if(next_mousemove > world.time) + if(!COOLDOWN_FINISHED(src, next_mousemove)) return - next_mousemove = world.time + world.tick_lag + COOLDOWN_START(src, next_mousemove, 0) //COOLDOWN_FINISHED() sees the world tick and cooldown timer being equal as a state wherein the cooldown has not finished. So the cooldown timer here is 0 to throttle only for the rest of the tick. mouseParams = params mouse_location_ref = WEAKREF(location) mouse_object_ref = WEAKREF(object) @@ -110,6 +110,9 @@ ..() /client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params) + if(!COOLDOWN_FINISHED(src, next_mousedrag)) + return + COOLDOWN_START(src, next_mousedrag, 0) //See comment in MouseMove() for why this is 0. mouseParams = params mouse_location_ref = WEAKREF(over_location) mouse_object_ref = WEAKREF(over_object) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 4f5624578c..65db62abf9 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -190,5 +190,6 @@ /// AFK tracking var/last_activity = 0 - /// The next point in time at which the client is allowed to send a mousemove() - var/next_mousemove = 0 + /// The next point in time at which the client is allowed to send a mousemove() or mousedrag() + COOLDOWN_DECLARE(next_mousemove) + COOLDOWN_DECLARE(next_mousedrag) From a003e7947d8a3bd0d1cbf08543b7b7d6c8f65304 Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:24:20 -0400 Subject: [PATCH 12/15] admin smites --- .../code/__HELPERS/transformation.dm | 57 +++++++++++++++++++ GainStation13/code/mechanics/fatness.dm | 3 + code/__DEFINES/admin.dm | 5 ++ code/__DEFINES/misc.dm | 1 + code/modules/admin/verbs/randomverbs.dm | 35 ++++++++++++ tgstation.dme | 1 + 6 files changed, 102 insertions(+) create mode 100644 GainStation13/code/__HELPERS/transformation.dm diff --git a/GainStation13/code/__HELPERS/transformation.dm b/GainStation13/code/__HELPERS/transformation.dm new file mode 100644 index 0000000000..9b34efdd74 --- /dev/null +++ b/GainStation13/code/__HELPERS/transformation.dm @@ -0,0 +1,57 @@ +/client/proc/breadify(atom/movable/target) + var/obj/item/reagent_containers/food/snacks/store/bread/plain/funnyBread = new(get_turf(target)) + target.forceMove(funnyBread) + +GLOBAL_LIST_EMPTY(transformation_animation_objects) +/* + * Creates animation that turns current icon into result appearance from top down. + * + * result_appearance - End result appearance/atom/image + * time - Animation duration + * transform_overlay - Appearance/atom/image of effect that moves along the animation - should be horizonatally centered + * reset_after - If FALSE, filters won't be reset and helper vis_objects will not be removed after animation duration expires. Cleanup must be handled by the caller! + */ +/atom/movable/proc/transformation_animation(result_appearance,time = 3 SECONDS,transform_overlay,reset_after=TRUE) + var/list/transformation_objects = GLOB.transformation_animation_objects[src] || list() + //Disappearing part + var/top_part_filter = filter(type="alpha",icon=icon('icons/effects/alphacolors.dmi',"white"),y=0) + filters += top_part_filter + var/filter_index = length(filters) + animate(filters[filter_index],y=-32,time=time) + //Appearing part + var/obj/effect/overlay/appearing_part = new + appearing_part.appearance = result_appearance + appearing_part.appearance_flags |= KEEP_TOGETHER | KEEP_APART + appearing_part.vis_flags = VIS_INHERIT_ID + appearing_part.filters = filter(type="alpha",icon=icon('icons/effects/alphacolors.dmi',"white"),y=0,flags=MASK_INVERSE) + animate(appearing_part.filters[1],y=-32,time=time) + transformation_objects += appearing_part + //Transform effect thing - todo make appearance passed in + if(transform_overlay) + var/obj/transform_effect = new + transform_effect.appearance = transform_overlay + transform_effect.vis_flags = VIS_INHERIT_ID + transform_effect.pixel_y = 16 + transform_effect.alpha = 255 + transformation_objects += transform_effect + animate(transform_effect,pixel_y=-16,time=time) + animate(alpha=0) + GLOB.transformation_animation_objects[src] = transformation_objects + for(var/A in transformation_objects) + vis_contents += A + if(reset_after) + addtimer(CALLBACK(src,.proc/_reset_transformation_animation,filter_index),time) +/* + * Resets filters and removes transformation animations helper objects from vis contents. +*/ +/atom/movable/proc/_reset_transformation_animation(filter_index) + var/list/transformation_objects = GLOB.transformation_animation_objects[src] + for(var/A in transformation_objects) + vis_contents -= A + qdel(A) + transformation_objects.Cut() + GLOB.transformation_animation_objects -= src + if(filters && length(filters) >= filter_index) + filters -= filters[filter_index] + //else + // filters = null diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm index 95cda6e4f3..f845f50b68 100644 --- a/GainStation13/code/mechanics/fatness.dm +++ b/GainStation13/code/mechanics/fatness.dm @@ -93,6 +93,9 @@ GLOBAL_LIST_INIT(uncapped_resize_areas, list(/area/command/bridge, /area/mainten return FALSE switch(type_of_fattening) + if(FATTENING_TYPE_ALMIGHTY) + return TRUE + if(FATTENING_TYPE_ITEM) if(!client?.prefs?.weight_gain_items) return FALSE diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index c58e111f26..ae5ba7bd15 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -87,6 +87,11 @@ #define ADMIN_PUNISHMENT_FRY "Fry" #define ADMIN_PUNISHMENT_PERFORATE ":B:erforate" #define ADMIN_PUNISHMENT_CLUWNE "Cluwne" +// GS13 PUNISHMENTS +#define ADMIN_PUNISHMENT_BONK "Bonk" +#define ADMIN_PUNISHMENT_BREADIFY "Breadify" +#define ADMIN_PUNISHMENT_FATTEN "Fatten" +#define ADMIN_PUNISHMENT_FATTEN_EVIL "Fatten (Permafat)" #define AHELP_ACTIVE 1 #define AHELP_CLOSED 2 diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 3933856d4d..a6d3686fa8 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -588,5 +588,6 @@ GLOBAL_LIST_INIT(pda_reskins, list( #define FATTENING_TYPE_NANITES "nanites" #define FATTENING_TYPE_RADIATIONS "radiations" #define FATTENING_TYPE_WEIGHT_LOSS "weight_loss" +#define FATTENING_TYPE_ALMIGHTY "almighty" //This ignores prefs, please only use this for smites and other admin controlled instances. #define FATNESS_TO_WEIGHT_RATIO 0.25 diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index bf296f0aeb..2c72ebd446 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1335,6 +1335,12 @@ Traitors and the like can also be revived with the previous role mostly intact. ADMIN_PUNISHMENT_FRY, ADMIN_PUNISHMENT_CRACK, ADMIN_PUNISHMENT_BLEED, + //GS13 EDIT START + ADMIN_PUNISHMENT_BONK, + ADMIN_PUNISHMENT_BREADIFY, + ADMIN_PUNISHMENT_FATTEN, + ADMIN_PUNISHMENT_FATTEN_EVIL, + //GS13 EDIT END ADMIN_PUNISHMENT_SCARIFY, ADMIN_PUNISHMENT_CLUWNE) @@ -1507,6 +1513,35 @@ Traitors and the like can also be revived with the previous role mostly intact. to_chat(usr,"This must be used on a carbon mob.") return target.cluwneify() + // GS13 EDIT START + if(ADMIN_PUNISHMENT_BONK) + playsound(target, 'hyperstation/sound/misc/bonk.ogg', 100, 1) + target.AddElement(/datum/element/squish, 60 SECONDS) + to_chat(target, "Bonk.") + if(ADMIN_PUNISHMENT_BREADIFY) + #define BREADIFY_TIME (5 SECONDS) + var/mutable_appearance/bread_appearance = mutable_appearance('icons/obj/food/burgerbread.dmi', "bread") + var/mutable_appearance/transform_scanline = mutable_appearance('icons/effects/effects.dmi', "transform_effect") + target.transformation_animation(bread_appearance, time = BREADIFY_TIME, transform_overlay=transform_scanline, reset_after=TRUE) + addtimer(CALLBACK(src, PROC_REF(breadify), target), BREADIFY_TIME) + #undef BREADIFY_TIME + if(ADMIN_PUNISHMENT_FATTEN) + var/mob/living/carbon/human/human_target = target + if(!istype(human_target)) + to_chat(usr,"This must be used on a carbon mob.") + return + human_target.adjust_fatness(10000, FATTENING_TYPE_ALMIGHTY, TRUE) // MR ELECTRIC, SEND HIM TO THE ADMIN JAIL AND HAVE HIM FATTENED! + to_chat(target, span_boldwarning("You suddenly feel incredibly fat.")) + if(ADMIN_PUNISHMENT_FATTEN_EVIL) + var/mob/living/carbon/human/human_target = target + if(!istype(human_target)) + to_chat(usr,"This must be used on a carbon mob.") + return + if(!human_target?.client?.prefs?.weight_gain_permanent) + return FALSE + human_target.fatness_perma += 10000 // Good luck getting this off, fatass. + to_chat(target, span_boldwarning("You suddenly feel incredibly fat.")) + // GS13 EDIT END punish_log(target, punishment) diff --git a/tgstation.dme b/tgstation.dme index 9a03dfd2cd..146bbc947f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3904,6 +3904,7 @@ #include "code\modules\zombie\items.dm" #include "code\modules\zombie\organs.dm" #include "GainStation13\code\__HELPERS\global_lists.dm" +#include "GainStation13\code\__HELPERS\transformation.dm" #include "GainStation13\code\clothing\accessory.dm" #include "GainStation13\code\clothing\backpacks.dm" #include "GainStation13\code\clothing\calorite_collar.dm" From 87c85712cbb7601a17e750a2f0838683778076dd Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:20:57 -0400 Subject: [PATCH 13/15] fat mood --- .../code/datums/mood_events/needs_events.dm | 7 +++++++ code/datums/components/mood.dm | 14 ++++++++++++++ tgstation.dme | 1 + 3 files changed, 22 insertions(+) create mode 100644 GainStation13/code/datums/mood_events/needs_events.dm diff --git a/GainStation13/code/datums/mood_events/needs_events.dm b/GainStation13/code/datums/mood_events/needs_events.dm new file mode 100644 index 0000000000..880b45f95f --- /dev/null +++ b/GainStation13/code/datums/mood_events/needs_events.dm @@ -0,0 +1,7 @@ +/datum/mood_event/fat_bad + description = "I'm so fat...\n" + mood_change = -4 + +/datum/mood_event/fat_good + description = "I'm so fat!\n" + mood_change = 4 diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index e28e108677..2a64b54407 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -169,6 +169,7 @@ setSanity(sanity+0.4, maximum=SANITY_AMAZING) HandleNutrition(owner) + HandleFatness(owner) //GS13 EDIT /datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_NEUTRAL)//I'm sure bunging this in here will have no negative repercussions. var/mob/living/master = parent @@ -315,6 +316,19 @@ /datum/component/mood/proc/hud_click(datum/source, location, control, params, mob/user) print_mood(user) +//GS13 EDIT START +/datum/component/mood/proc/HandleFatness(mob/living/carbon/L) // GS13 + if(!L) + return FALSE + + switch(L.fatness) + if(FATNESS_LEVEL_FAT to INFINITY) + if(HAS_TRAIT(L, TRAIT_FAT_GOOD)) + add_event(null, "fatness", /datum/mood_event/fat_good) + else if(HAS_TRAIT(L, TRAIT_FAT_BAD)) + add_event(null, "fatness", /datum/mood_event/fat_bad) + +//GS13 EDIT END /datum/component/mood/proc/HandleNutrition(mob/living/L) if(isethereal(L)) diff --git a/tgstation.dme b/tgstation.dme index 146bbc947f..4664a21096 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3924,6 +3924,7 @@ #include "GainStation13\code\datums\diseases\advance\presets.dm" #include "GainStation13\code\datums\diseases\advance\symptoms\berry.dm" #include "GainStation13\code\datums\diseases\advance\symptoms\weight_gain.dm" +#include "GainStation13\code\datums\mood_events\needs_events.dm" #include "GainStation13\code\datums\mutations\fatfang.dm" #include "GainStation13\code\datums\mutations\radfat.dm" #include "GainStation13\code\datums\status_effects\fatstun.dm" From b34fa8b6b0b26f947a24b15fe04084f65f3b208f Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:26:00 -0400 Subject: [PATCH 14/15] Update species.dm --- GainStation13/code/modules/mob/living/species.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GainStation13/code/modules/mob/living/species.dm b/GainStation13/code/modules/mob/living/species.dm index ca3e099e30..72327692ef 100644 --- a/GainStation13/code/modules/mob/living/species.dm +++ b/GainStation13/code/modules/mob/living/species.dm @@ -239,7 +239,10 @@ fatness_delay += (H.fatness / FATNESS_LEVEL_IMMOBILE) * FATNESS_WEAKLEGS_MODIFIER fatness_delay = min(fatness_delay, 60) - H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/fatness, TRUE, fatness_delay) + if(fatness_delay) + H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/fatness, TRUE, fatness_delay) + else + H.remove_movespeed_modifier(/datum/movespeed_modifier/fatness) if(HAS_TRAIT(H, TRAIT_BLOB)) handle_fatness_trait( From d5637089b5da600c61c45dc04f26d98c265926ba Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:28:10 -0400 Subject: [PATCH 15/15] Update teleporter.dm --- code/game/machinery/teleporter.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index ebe172d2d7..e44b1b7191 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -74,6 +74,8 @@ if(do_teleport(M, com.target, channel = TELEPORT_CHANNEL_BLUESPACE)) use_power(5000) + //GS13 EDIT + /* if(!calibrated && iscarbon(M) && prob(30 - ((accuracy) * 10))) //oh dear a problem var/mob/living/carbon/C = M if(C.dna?.species && C.dna.species.id != "fly" && !HAS_TRAIT(C, TRAIT_RADIMMUNE)) @@ -81,6 +83,7 @@ C.set_species(/datum/species/fly) log_game("[C] ([key_name(C)]) was turned into a fly person") C.apply_effect((rand(120 - accuracy * 40, 180 - accuracy * 60)), EFFECT_IRRADIATE, 0) + */ calibrated = FALSE return