From 95c86c5bfcedad514629531cdfd4aa55406111ca Mon Sep 17 00:00:00 2001 From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:29:10 -0500 Subject: [PATCH] Converts no slip into a trait (#23140) * makes noslips work * trait part * THE REST * it didnt conflict too much actually * this was intended, whoops lol * no more processing * consistency * lewc review * Apply suggestions from code review --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> --- code/__HELPERS/trait_helpers.dm | 1 + code/_globalvars/traits.dm | 1 + code/modules/clothing/chameleon.dm | 2 +- code/modules/clothing/clothing.dm | 15 +++++++++++++++ code/modules/clothing/shoes/magboots.dm | 12 ++++++++---- code/modules/clothing/shoes/misc_shoes.dm | 4 ++-- code/modules/clothing/spacesuits/alien_suits.dm | 13 +++++-------- code/modules/mob/living/carbon/carbon.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 6 ++---- code/modules/mod/modules/modules_antag.dm | 4 ++-- code/modules/mod/modules/modules_engineering.dm | 4 ++-- code/modules/ninja/suit/ninja_shoes.dm | 2 +- 12 files changed, 41 insertions(+), 25 deletions(-) diff --git a/code/__HELPERS/trait_helpers.dm b/code/__HELPERS/trait_helpers.dm index 71e15c25375..758d18401fa 100644 --- a/code/__HELPERS/trait_helpers.dm +++ b/code/__HELPERS/trait_helpers.dm @@ -222,6 +222,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_HAS_GPS "has_gps" // used for /Stat #define TRAIT_CAN_VIEW_HEALTH "can_view_health" // Also used for /Stat #define TRAIT_MAGPULSE "magnetificent" // Used for anything that is magboot related +#define TRAIT_NOSLIP "noslip" //***** MIND TRAITS *****/ #define TRAIT_HOLY "is_holy" // The mob is holy in regards to religion diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 361f75b4846..6e5ea7ed4cb 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -86,6 +86,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_SUPERMATTER_IMMUNE" = TRAIT_SUPERMATTER_IMMUNE, "TRAIT_BADASS" = TRAIT_BADASS, "TRAIT_FORCED_STANDING" = TRAIT_FORCED_STANDING, + "TRAIT_NOSLIP" = TRAIT_NOSLIP, "TRAIT_MAGPULSE" = TRAIT_MAGPULSE ), diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 9b1028c82a6..d1695082d25 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -525,7 +525,7 @@ icon_state = "black" item_color = "black" desc = "A pair of black shoes." - flags = NOSLIP + no_slip = TRUE /obj/item/clothing/shoes/chameleon/noslip/broken/Initialize(mapload) . = ..() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index efdaafea15f..3c3ceea9d34 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -466,6 +466,7 @@ var/chained = FALSE var/can_cut_open = FALSE var/cut_open = FALSE + var/no_slip = FALSE body_parts_covered = FEET slot_flags = SLOT_FLAG_FEET @@ -480,6 +481,20 @@ "Drask" = 'icons/mob/clothing/species/drask/shoes.dmi' ) +/obj/item/clothing/shoes/equipped(mob/user, slot) + . = ..() + if(!no_slip || slot != SLOT_HUD_SHOES) + return + ADD_TRAIT(user, TRAIT_NOSLIP, UID()) + +/obj/item/clothing/shoes/dropped(mob/user) + ..() + if(!no_slip) + return + var/mob/living/carbon/human/H = user + if(H.get_item_by_slot(SLOT_HUD_SHOES) == src) + REMOVE_TRAIT(H, TRAIT_NOSLIP, UID()) + /obj/item/clothing/shoes/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/match) && src.loc == user) var/obj/item/match/M = I diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 88b9be267c5..ce849a5016f 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -8,6 +8,8 @@ var/slowdown_active = 2 var/slowdown_passive = SHOES_SLOWDOWN var/magpulse_name = "mag-pulse traction system" + ///If a pair of magboots has different icons for being on or off + var/multiple_icons = TRUE actions_types = list(/datum/action/item_action/toggle) strip_delay = 70 put_on_delay = 70 @@ -34,14 +36,16 @@ toggle_magpulse(user, forced) /obj/item/clothing/shoes/magboots/proc/toggle_magpulse(mob/user, forced) - if(magpulse) - flags &= ~NOSLIP + if(magpulse) //magpulse and no_slip will always be the same value unless VV happens + REMOVE_TRAIT(user, TRAIT_NOSLIP, UID()) slowdown = slowdown_passive else - flags |= NOSLIP + ADD_TRAIT(user, TRAIT_NOSLIP, UID()) slowdown = slowdown_active magpulse = !magpulse - icon_state = "[magboot_state][magpulse]" + no_slip = !no_slip + if(multiple_icons) + icon_state = "[magboot_state][magpulse]" if(!forced) to_chat(user, "You [magpulse ? "enable" : "disable"] the [magpulse_name].") user.update_inv_shoes() //so our mob-overlays update diff --git a/code/modules/clothing/shoes/misc_shoes.dm b/code/modules/clothing/shoes/misc_shoes.dm index a6925603b28..86b85ccb40f 100644 --- a/code/modules/clothing/shoes/misc_shoes.dm +++ b/code/modules/clothing/shoes/misc_shoes.dm @@ -19,7 +19,7 @@ desc = "High speed, no drag combat boots." permeability_coefficient = 0.01 armor = list(MELEE = 35, BULLET = 20, LASER = 15, ENERGY = 15, BOMB = 50, RAD = 20, FIRE = 450, ACID = 50) - flags = NOSLIP + no_slip = TRUE /obj/item/clothing/shoes/sandal name = "sandals" @@ -45,7 +45,7 @@ desc = "A pair of yellow rubber boots, designed to prevent slipping on wet surfaces." icon_state = "galoshes" permeability_coefficient = 0.05 - flags = NOSLIP + no_slip = TRUE slowdown = SHOES_SLOWDOWN+1 strip_delay = 50 put_on_delay = 50 diff --git a/code/modules/clothing/spacesuits/alien_suits.dm b/code/modules/clothing/spacesuits/alien_suits.dm index 40e84a3e1e3..5713d1ff5fd 100644 --- a/code/modules/clothing/spacesuits/alien_suits.dm +++ b/code/modules/clothing/spacesuits/alien_suits.dm @@ -207,12 +207,11 @@ species_restricted = list("Vox") sprite_sheets = list( "Vox" = 'icons/mob/clothing/species/vox/feet.dmi') + multiple_icons = FALSE /obj/item/clothing/shoes/magboots/vox/attack_self(mob/user) if(magpulse) - flags &= ~NOSLIP - magpulse = FALSE - flags |= NODROP + flags &= ~NODROP to_chat(user, "You relax your deathgrip on the flooring.") else //make sure these can only be used when equipped. @@ -222,20 +221,18 @@ if(H.shoes != src) to_chat(user, "