From eeda42bfa791377b3c22a5a23669d40587768431 Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:50:59 -0400 Subject: [PATCH] Reworks cling speed legs --- code/__DEFINES/status_effects.dm | 2 + code/datums/status_effects/buffs.dm | 40 ++++++++++++++++ .../changeling/powers/strained_muscles.dm | 47 ++++--------------- 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index aa4b044ed0f..6df74ad5fc0 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -34,6 +34,8 @@ #define STATUS_EFFECT_BLOODDRUNK /datum/status_effect/blooddrunk //Stun immunity and greatly reduced damage taken +#define STATUS_EFFECT_SPEEDLEGS /datum/status_effect/speedlegs //Handles cling speed boost and chemical cost. + ///////////// // DEBUFFS // ///////////// diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 54735988b9c..75fd2bf0ca5 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -294,3 +294,43 @@ /datum/status_effect/regenerative_core/on_remove() REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id) + + +/datum/status_effect/speedlegs + duration = -1 + status_type = STATUS_EFFECT_UNIQUE + tick_interval = 4 SECONDS + alert_type = null + var/stacks = 0 + +/datum/status_effect/speedlegs/on_apply() + ADD_TRAIT(owner, TRAIT_GOTTAGOFAST, "changeling") + return TRUE + +/datum/status_effect/speedlegs/tick() + if(owner.stat || owner.staminaloss >= 90 || owner.mind.changeling.chem_charges <= (stacks + 1) * 3) + to_chat(owner, "Our muscles relax without the energy to strengthen them.") + owner.Weaken(3) + owner.remove_status_effect(STATUS_EFFECT_SPEEDLEGS) + else + stacks++ + message_admins("stacks increased to [stacks]") + owner.mind.changeling.chem_charges -= stacks * 3 //At first the changeling may regenerate chemicals fast enough to nullify fatigue, but it will stack + if(stacks == 7) //Warning message that the stacks are getting too high + to_chat(owner, "Our legs are really starting to hurt...") + +/datum/status_effect/speedlegs/before_remove() + if(stacks < 3 && !(owner.stat || owner.staminaloss >= 90 || owner.mind.changeling.chem_charges <= (stacks + 1) * 3)) //We don't want people to turn it on and off fast, however, we need it forced off if the 3 later conditions are met. + to_chat(owner, "Our muscles just tensed up, they will not relax so fast.") + return FALSE + return TRUE + +/datum/status_effect/speedlegs/on_remove() + REMOVE_TRAIT(owner, TRAIT_GOTTAGOFAST, "changeling") + if(!owner.weakened) + to_chat(owner, "Our muscles relax.") + if(stacks >= 7) + to_chat(owner, "We collapse in exhaustion.") + owner.Weaken(3) + owner.emote("gasp") + owner.mind.changeling.geneticdamage += stacks diff --git a/code/game/gamemodes/changeling/powers/strained_muscles.dm b/code/game/gamemodes/changeling/powers/strained_muscles.dm index a89daed095f..8c9b6009179 100644 --- a/code/game/gamemodes/changeling/powers/strained_muscles.dm +++ b/code/game/gamemodes/changeling/powers/strained_muscles.dm @@ -1,52 +1,25 @@ -//Strained Muscles: Temporary speed boost at the cost of rapid damage +//Strained Muscles: Temporary speed boost at the cost of chemicals //Limited because of hardsuits and such; ideally, used for a quick getaway /datum/action/changeling/strained_muscles name = "Strained Muscles" desc = "We evolve the ability to reduce the acid buildup in our muscles, allowing us to move much faster." - helptext = "The strain will make us tired, and we will rapidly become fatigued. Standard weight restrictions, like hardsuits, still apply. Cannot be used in lesser form." + helptext = "The strain will use up our chemicals faster over time, and is not sustainable. Causes slight genetic damage to our genome. Can not be used in lesser form." button_icon_state = "strained_muscles" chemical_cost = 0 dna_cost = 1 req_human = 1 - var/stacks = 0 //Increments every 5 seconds; damage increases over time - var/enabled = 0 //Whether or not you are a hedgehog + max_genetic_damage = 0 /datum/action/changeling/strained_muscles/sting_action(mob/living/carbon/user) - enabled = !enabled - if(enabled) - to_chat(user, "Our muscles tense and strengthen.") + if(!user.has_status_effect(STATUS_EFFECT_SPEEDLEGS)) + if(user.dna.species.speed_mod < 0) + to_chat(user, "We are moving as fast as we can, we can not go faster.") + else + to_chat(user, "Our muscles tense and strengthen.") + user.apply_status_effect(STATUS_EFFECT_SPEEDLEGS) else - REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling") - to_chat(user, "Our muscles relax.") - if(stacks >= 10) - to_chat(user, "We collapse in exhaustion.") - user.Weaken(3) - user.emote("gasp") - - while(enabled) - ADD_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling") - if(user.stat || user.staminaloss >= 90) - enabled = 0 //Let's use something exact instead of !enabled where we can. - to_chat(user, "Our muscles relax without the energy to strengthen them.") - REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling") - user.Weaken(2) - user.emote("gasp") - break - - stacks++ - //user.take_organ_damage(stacks * 0.03, 0) - user.staminaloss += stacks * 1.3 //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack - - if(stacks == 11) //Warning message that the stacks are getting too high - to_chat(user, "Our legs are really starting to hurt...") - - sleep(40) - - while(!enabled) //Damage stacks decrease fairly rapidly while not in sanic mode - if(stacks >= 1) - stacks-- - sleep(20) + user.remove_status_effect(STATUS_EFFECT_SPEEDLEGS) SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]")) return 1