Exosuits 3: It came from Robotics

This commit is contained in:
Mechoid
2020-09-05 07:15:46 -07:00
parent 138bfcb303
commit 0ddefbbadc
3 changed files with 21 additions and 7 deletions

View File

@@ -17,6 +17,8 @@
max_special_equip = 1
cargo_capacity = 1
encumberence_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
encumberence_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/encumberence_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
@@ -195,6 +198,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()
..()
@@ -644,18 +648,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 <= encumberence_gap) // If the total is less than our encumberence gap, ignore equipment weight.
tally = 0
else // Otherwise, start the tally after cutting that gap out.
tally -= encumberence_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.
@@ -677,7 +684,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)