Fixes Ice Slipping, Refactors noslip mechanics, Allows magboots to prevent slip slides (but not the slip itself) (#73948)

## About The Pull Request

Code changes: 

- Fixes #73946 , Ice Slipping not going forever as intended
- Detailed in the issue report. Ice slide slip was replaced from a stun
to a knockdown, but it relied on it being a stun to function. I replaced
it back with an immobilize and incapacitate, reduced to 1 second to
prevent cheese.

- Refactors noslip mechanics
- Changes noslip and noslip_ice from a clothing flag to a clothing
trait, as the trait already existed and was used by MODsuits. Also added
noslip_slide, which prevents all sliding from slips like lube.

- Refactors magboots
- Refactored and modernized magboot code. Mostly cleanup, like using
base icon state, updating appearance, etc.

- Fixes speed potioned magboots not maintaining the speed boost after a
toggle

- Adds a helper for adding or removing clothing traits from existing,
(potentially) worn items.

- `TRAIT_NEGATE_GRAVITY` now always updates gravity on signal, no longer
requiring a manual call after.

Balance change: 

- Magboots now prevent sliding on permafrost (outside icebox).  
   - This is mainly to give them more of a purpose on Icebox. 
- Magboot snow prevent sliding on ice (or lube). You will still slip. 
- Slipping over ice or lube will knock you down as before, but will not
send you across the room.
   - See https://tgstation13.org/phpBB/viewtopic.php?t=33217. 

## Why It's Good For The Game

Magboots justification: 

This makes Magboots much less of a "noob trab" for engineers
fire-fighting in the Supermatter room. Most engineers believe themselves
to be completely save to the Supermatter's pull with magboots, however
"wet ice" will still send you flying into the crystal.

I think it is an inconsistency, seeing as it protects you from other
forms of forced movement like gravitational pulls. However making them
pure no-slip seemed a bit too far to me, so the knockdown still occurs.

## Changelog

🆑 Melbert
balance: Magboots will now protect you from sliding on ice. It will not
stop the slip, though.
fix: "Ice sliding" (from patches of permafrost ice) will now correctly
slide you until you reach a non-ice patch.
fix: Speed potioned magboots maintain their speed booster after toggling
them
refactor: Refactored magboots. 
refactor: Refactored noslip mechanics. 
/🆑
This commit is contained in:
MrMelbert
2023-03-14 19:51:34 -05:00
committed by GitHub
parent 9f2356d30b
commit 48ff6a6e65
25 changed files with 244 additions and 144 deletions
+2 -2
View File
@@ -239,10 +239,10 @@
incompatible_modules = list(/obj/item/mod/module/noslip)
/obj/item/mod/module/noslip/on_suit_activation()
ADD_TRAIT(mod.wearer, TRAIT_NOSLIPWATER, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_NO_SLIP_WATER, MOD_TRAIT)
/obj/item/mod/module/noslip/on_suit_deactivation(deleting = FALSE)
REMOVE_TRAIT(mod.wearer, TRAIT_NOSLIPWATER, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_NO_SLIP_WATER, MOD_TRAIT)
//Bite of 87 Springlock - Equips faster, disguised as DNA lock.
/obj/item/mod/module/springlock/bite_of_87
@@ -52,25 +52,25 @@
cooldown_time = 0.5 SECONDS
/// Slowdown added onto the suit.
var/slowdown_active = 0.5
/// A list of traits to add to the wearer when we're active (see: Magboots)
var/list/active_traits = list(TRAIT_NO_SLIP_WATER, TRAIT_NO_SLIP_ICE, TRAIT_NO_SLIP_SLIDE, TRAIT_NEGATES_GRAVITY)
/obj/item/mod/module/magboot/on_activation()
. = ..()
if(!.)
return
ADD_TRAIT(mod.wearer, TRAIT_NEGATES_GRAVITY, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_NOSLIPWATER, MOD_TRAIT)
for(var/new_trait in active_traits)
ADD_TRAIT(mod.wearer, new_trait, MOD_TRAIT)
mod.slowdown += slowdown_active
mod.wearer.update_gravity(mod.wearer.has_gravity())
mod.wearer.update_equipment_speed_mods()
/obj/item/mod/module/magboot/on_deactivation(display_message = TRUE, deleting = FALSE)
. = ..()
if(!.)
return
REMOVE_TRAIT(mod.wearer, TRAIT_NEGATES_GRAVITY, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_NOSLIPWATER, MOD_TRAIT)
for(var/old_trait in active_traits)
REMOVE_TRAIT(mod.wearer, old_trait, MOD_TRAIT)
mod.slowdown -= slowdown_active
mod.wearer.update_gravity(mod.wearer.has_gravity())
mod.wearer.update_equipment_speed_mods()
/obj/item/mod/module/magboot/advanced
+2 -2
View File
@@ -498,7 +498,7 @@
ADD_TRAIT(mod.wearer, TRAIT_LAVA_IMMUNE, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_HANDS_BLOCKED, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_FORCED_STANDING, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_NOSLIPALL, MOD_TRAIT)
ADD_TRAIT(mod.wearer, TRAIT_NO_SLIP_ALL, MOD_TRAIT)
mod.wearer.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6)
mod.wearer.AddElement(/datum/element/footstep, FOOTSTEP_OBJ_ROBOT, 1, -6, sound_vary = TRUE)
mod.wearer.add_movespeed_modifier(/datum/movespeed_modifier/sphere)
@@ -516,7 +516,7 @@
REMOVE_TRAIT(mod.wearer, TRAIT_LAVA_IMMUNE, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_HANDS_BLOCKED, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_FORCED_STANDING, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_NOSLIPALL, MOD_TRAIT)
REMOVE_TRAIT(mod.wearer, TRAIT_NO_SLIP_ALL, MOD_TRAIT)
mod.wearer.remove_movespeed_mod_immunities(MOD_TRAIT, /datum/movespeed_modifier/damage_slowdown)
mod.wearer.RemoveElement(/datum/element/footstep, FOOTSTEP_OBJ_ROBOT, 1, -6, sound_vary = TRUE)
mod.wearer.AddElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6)