diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index d618d276c3..7661bb3255 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -17,6 +17,8 @@ max_special_equip = 1 cargo_capacity = 1 + encumbrance_gap = 1.5 + starting_components = list( /obj/item/mecha_parts/component/hull/durable, /obj/item/mecha_parts/component/actuator, diff --git a/code/game/mecha/combat/phazon.dm b/code/game/mecha/combat/phazon.dm index 17aea92345..3ae3e41e13 100644 --- a/code/game/mecha/combat/phazon.dm +++ b/code/game/mecha/combat/phazon.dm @@ -25,6 +25,8 @@ max_universal_equip = 3 max_special_equip = 4 + encumbrance_gap = 2 + starting_components = list( /obj/item/mecha_parts/component/hull/durable, /obj/item/mecha_parts/component/actuator, diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index b1aa1fb888..e9e3397bba 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -31,7 +31,10 @@ var/initial_icon = null //Mech type for resetting icon. Only used for reskinning kits (see custom items) var/can_move = 1 var/mob/living/carbon/occupant = null + var/step_in = 10 //Make a step in step_in/10 sec. + var/encumbrance_gap = 1 //How many points of slowdown are negated from equipment? Added to the mech's base step_in. + var/dir_in = 2 //What direction will the mech face when entered/powered on? Defaults to South. var/step_energy_drain = 10 var/health = 300 //Health is health @@ -193,6 +196,7 @@ var/datum/action/innate/mecha/mech_toggle_cloaking/cloak_action = new var/weapons_only_cycle = FALSE //So combat mechs don't switch to their equipment at times. + /obj/mecha/Initialize() ..() @@ -641,18 +645,21 @@ /obj/mecha/proc/get_step_delay() var/tally = 0 - if(overload) - tally = min(1, round(step_in/2)) + if(LAZYLEN(equipment)) + for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment) + if(ME.get_step_delay()) + tally += ME.get_step_delay() + + if(tally <= encumbrance_gap) // If the total is less than our encumbrance gap, ignore equipment weight. + tally = 0 + else // Otherwise, start the tally after cutting that gap out. + tally -= encumbrance_gap for(var/slot in internal_components) var/obj/item/mecha_parts/component/C = internal_components[slot] if(C && C.get_step_delay()) tally += C.get_step_delay() - for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment) - if(ME.get_step_delay()) - tally += ME.get_step_delay() - var/obj/item/mecha_parts/component/actuator/actuator = internal_components[MECH_ACTUATOR] if(!actuator) // Relying purely on hydraulic pumps. You're going nowhere fast. @@ -674,7 +681,10 @@ break break - return max(1, round(tally, 0.1)) + if(overload) // At the end, because this would normally just make the mech *slower* since tally wasn't starting at 0. + tally = min(1, round(tally/2)) + + return max(1, round(tally, 0.1)) // Round the total to the nearest 10th. Can't go lower than 1 tick. Even humans have a delay longer than that. /obj/mecha/proc/dyndomove(direction) if(!can_move) diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 86405b6934..aff19e301d 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -14,6 +14,8 @@ minimum_penetration = 10 + encumbrance_gap = 2 + starting_components = list( /obj/item/mecha_parts/component/hull/durable, /obj/item/mecha_parts/component/actuator, diff --git a/html/changelogs/Mechoid - Encumbrance.yml b/html/changelogs/Mechoid - Encumbrance.yml new file mode 100644 index 0000000000..f013a3bcad --- /dev/null +++ b/html/changelogs/Mechoid - Encumbrance.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Mechoid + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added system for exosuit over-encumbrance. Combat mechs and Ripleys have higher than default."