Fixes mobility bug (#28877)

This commit is contained in:
PollardTheDragon
2025-04-02 23:42:48 -04:00
committed by GitHub
parent 05c4ce3c83
commit 8cdbf46019
2 changed files with 24 additions and 9 deletions
+4
View File
@@ -772,6 +772,10 @@
var/insert_max = 1
/// Currently applied inserts
var/list/inserts = list()
/// Is there a mobility mesh inserted?
var/mobility_meshed = FALSE
/// What's the total slowdown from inserts?
var/insert_slowdown = 0
/obj/item/clothing/suit/Initialize(mapload)
+20 -9
View File
@@ -213,8 +213,6 @@
var/explosive_armor = 0
/// Movement speed
var/movement_speed_mod = 0
/// Used in the mobility insert - does this negate slowdown
var/no_more_slowdown = FALSE
/// Heat insulation
var/heat_insulation = 0
/// Electrical insulation
@@ -240,18 +238,20 @@
return
attached_suit = target
attached_suit.armor = attached_suit.armor.attachArmor(armor)
attached_suit.slowdown -= movement_speed_mod
attached_suit.insert_slowdown -= movement_speed_mod
attached_suit.slowdown = initial(attached_suit.slowdown) + attached_suit.insert_slowdown
if(attached_suit.mobility_meshed)
attached_suit.slowdown = 0
attached_suit.siemens_coefficient -= siemens_coeff
attached_suit.min_cold_protection_temperature -= heat_insulation
attached_suit.max_heat_protection_temperature += heat_insulation
if(no_more_slowdown)
attached_suit.slowdown = 0
/obj/item/smithed_item/insert/on_detached(mob/user)
attached_suit.armor = attached_suit.armor.detachArmor(armor)
if(no_more_slowdown)
attached_suit.slowdown = initial(attached_suit.slowdown)
attached_suit.slowdown += movement_speed_mod
attached_suit.insert_slowdown += movement_speed_mod
attached_suit.slowdown = initial(attached_suit.slowdown) + attached_suit.insert_slowdown
if(attached_suit.mobility_meshed)
attached_suit.slowdown = 0
attached_suit.siemens_coefficient += siemens_coeff
attached_suit.min_cold_protection_temperature += heat_insulation
attached_suit.max_heat_protection_temperature -= heat_insulation
@@ -337,7 +337,18 @@
burn_armor = -5
laser_armor = -5
heat_insulation = 10
no_more_slowdown = TRUE
/// Attached suit slowdown when the mobility mesh was applied
var/initial_slowdown = 0
/obj/item/smithed_item/insert/mobility/on_attached(obj/item/clothing/suit/target)
. = ..()
attached_suit.mobility_meshed = TRUE
attached_suit.slowdown = 0
/obj/item/smithed_item/insert/mobility/on_detached(mob/user)
attached_suit.mobility_meshed = FALSE
. = ..()
/obj/item/smithed_item/insert/admin
name = "adminium mesh"