Merge pull request #7630 from Mechoid/ExoEncumberence

Exo Encumberence
This commit is contained in:
Atermonera
2020-09-23 22:55:33 -07:00
committed by VirgoBot
parent 41c8e4a671
commit 03f7a2ad58
5 changed files with 59 additions and 7 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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)

View File

@@ -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,

View File

@@ -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."