Files
VMSolidusandGitHub 826aa5bf95 Mech Legs Balance Pass (#21946)
This PR tweaks the stats for several of the mech legs to have fairer
movespeed characteristics and be a lot less punishing for taking damage.
The general complaint I saw from players was that taking enough damage
made the mechs suddenly feel useless, as the extra delays from leg
damage were far too punishing.

I also added a new mechanic for the extremely rare Cult Mech that allows
it to actually GAIN movement speed when damaged, as a sort of "Fragile
Berserker" mechanic that will help make it actually useful as a melee
combatant gimmick. I came up with that idea after watching a round where
an antag managed to get a cult mech, but he was physically incapable of
getting into melee with anyone while driving it.

As a bugfix, this PR fixes glide sizes for mechs so that their smooth
movement correctly reflects how the different directions have different
movement speeds.


https://github.com/user-attachments/assets/0bf63edd-b0db-4257-a6e4-c42e5cf16962
2026-03-04 19:51:27 +00:00

89 lines
3.0 KiB
Plaintext

/obj/item/mech_component/propulsion
name = "legs"
center_of_mass = list("x"=24, "y"=4)
icon_state = "loader_legs"
power_use = 75
/// Movement delay added when moving in any direction.
var/move_delay = 5
/// Movement delay added when turning, cumulative with move_delay.
var/turn_delay = 5
/// Extra movement delay added when using reverse throttle.
var/reverse_delay = 10
/// Extra movement delay added when strafing.
var/strafe_delay_modifier = 1.5
/// Whether or not the legs allow strafing at all.
var/can_strafe = TRUE
/**
* Extra movement delay added based on the ratio of the legs current damage to its maximum damage.
* IE: If your max is 100, and you've taken 50 damage to the legs, this delay should come out to +5.
* At 0 damage, the delay from this is also 0. So it linearly scales with leg damage.
*/
var/damaged_delay = 10
/**
* Linear slope of a mech's damage delay characteristics, EG how "fast" it linearly scales.
* This allows floating points, and can technically be a negative number. EG: "Rage mechanic where being damaged makes the mech faster"
*/
var/damaged_delay_slope = 1.0
var/obj/item/robot_parts/robot_component/actuator/motivator
var/mech_turn_sound = 'sound/mecha/mechturn.ogg'
var/mech_step_sound = 'sound/mecha/mechstep.ogg'
var/trample_damage = 5
var/hover = FALSE // Can this leg allow you to easily travel z-levels?
/obj/item/mech_component/propulsion/Destroy()
QDEL_NULL(motivator)
. = ..()
/obj/item/mech_component/propulsion/get_missing_parts_text()
. = ..()
if(!motivator)
. += SPAN_WARNING("It is missing an <a href='byond://?src=[REF(src)];info=actuator'>actuator</a>.")
/obj/item/mech_component/propulsion/Topic(href, href_list)
. = ..()
if(.)
return
switch(href_list["info"])
if("actuator")
to_chat(usr, SPAN_NOTICE("An actuator can be created at a synthetic fabricator."))
/obj/item/mech_component/propulsion/return_diagnostics(mob/user)
..()
if(motivator)
to_chat(user, SPAN_NOTICE(" - Actuator Integrity: <b>[round(((motivator.max_dam - motivator.total_dam) / motivator.max_dam) * 100, 0.1)]%</b>"))
else
to_chat(user, SPAN_WARNING(" - Actuator Missing or Non-functional."))
/obj/item/mech_component/propulsion/ready_to_install()
return motivator
/obj/item/mech_component/propulsion/update_components()
motivator = locate() in src
/obj/item/mech_component/propulsion/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/robot_parts/robot_component/actuator))
if(motivator)
to_chat(user, SPAN_WARNING("\The [src] already has an actuator installed."))
return
motivator = attacking_item
install_component(attacking_item, user)
else
return ..()
/obj/item/mech_component/propulsion/prebuild()
motivator = new(src)
/obj/item/mech_component/propulsion/proc/can_move_on(var/turf/location, var/turf/target_loc)
if(!istype(location))
return 1 // Inside something, assume you can get out.
if(!istype(target_loc))
return 0 // What are you even doing.
return 1