Files
Paradise/code/game/gamemodes/changeling/powers/biodegrade.dm
T
0f7a8707ef [Ready] Refactors stuns and status effects. (#17579)
* Fixes reviver runtime

* Confusion status effect

* Dizzy status effect

* Drowsiness status effect

* decaying -> transient

* Drunkenness status effect

* why use timer when SSfastprocessing work good

* stuns (mostly)

* weaken and immobalise

* stun/weaken times

* update_flags redundancies.

* Slowed()

* Silence + fixes transient decay

* Jittery

* sleeping

* Paralyze -> weaken

* Cult sluring

* paralyse

* Stammer

* slurring + projectile cleanups

* losebreath

* Hallucination

* forgor this

* eyeblurry

* eye blind

* Druggy

* affected didn't like my spacing

* review pass

* second review pass

* some cleanups

* documentation and signal framework

* confusion fix

* Fixes spec_stun

* rejuv fix

* removes a TODO

* conflicted myself

* fixes

* self review

* review

* removes TODOs

* adminfreeze

* TM fixes

* hallucination fix + others

* tones down alchol and runtime fixes

* confusion overlay suggestion

* more fixes

* runtime fix

* losebreath fix

* clamp => directional bounded sum

* steel review

* oops

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

* reduces the dizziness cycle rate

* borg hotfix

* sanctified decursening

Co-authored-by: mochi <1496804+dearmochi@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
2022-05-24 16:35:26 +01:00

93 lines
4.5 KiB
Plaintext

/datum/action/changeling/biodegrade
name = "Biodegrade"
desc = "Dissolves restraints or other objects preventing free movement. Costs 30 chemicals."
helptext = "This is obvious to nearby people, and can destroy standard restraints and closets, and break you out of grabs."
button_icon_state = "biodegrade"
chemical_cost = 30 //High cost to prevent spam
dna_cost = 2
req_human = 1
/datum/action/changeling/biodegrade/sting_action(mob/living/carbon/human/user)
var/used = FALSE // only one form of shackles removed per use
if(!user.restrained() && !user.legcuffed && !istype(user.loc, /obj/structure/closet) && !istype(user.loc, /obj/structure/spider/cocoon) && !user.grabbed_by)
to_chat(user, "<span class='warning'>We are already free!</span>")
return FALSE
if(user.handcuffed)
var/obj/O = user.get_item_by_slot(slot_handcuffed)
if(!istype(O))
return FALSE
user.visible_message("<span class='warning'>[user] vomits a glob of acid on [user.p_their()] [O.name]!</span>", \
"<span class='warning'>We vomit acidic ooze onto our restraints!</span>")
addtimer(CALLBACK(src, .proc/dissolve_restraint, user, O), 3 SECONDS)
used = TRUE
if(user.legcuffed)
var/obj/O = user.get_item_by_slot(slot_legcuffed)
if(!istype(O))
return FALSE
user.visible_message("<span class='warning'>[user] vomits a glob of acid on [user.p_their()] [O.name]!</span>", \
"<span class='warning'>We vomit acidic ooze onto our leg restraints!</span>")
addtimer(CALLBACK(src, .proc/dissolve_restraint, user, O), 3 SECONDS)
used = TRUE
if(user.wear_suit && user.wear_suit.breakouttime && !used)
var/obj/item/clothing/suit/S = user.get_item_by_slot(slot_wear_suit)
if(!istype(S))
return FALSE
user.visible_message("<span class='warning'>[user] vomits a glob of acid across the front of [user.p_their()] [S.name]!</span>", \
"<span class='warning'>We vomit acidic ooze onto our straight jacket!</span>")
addtimer(CALLBACK(src, .proc/dissolve_restraint, user, S), 3 SECONDS)
used = TRUE
if(istype(user.loc, /obj/structure/closet) && !used)
var/obj/structure/closet/C = user.loc
if(!istype(C))
return FALSE
C.visible_message("<span class='warning'>[C]'s hinges suddenly begin to melt and run!</span>")
to_chat(user, "<span class='warning'>We vomit acidic goop onto the interior of [C]!</span>")
addtimer(CALLBACK(src, .proc/open_closet, user, C), 7 SECONDS)
used = TRUE
if(istype(user.loc, /obj/structure/spider/cocoon) && !used)
var/obj/structure/spider/cocoon/C = user.loc
if(!istype(C))
return FALSE
C.visible_message("<span class='warning'>[src] shifts and starts to fall apart!</span>")
to_chat(user, "<span class='warning'>We secrete acidic enzymes from our skin and begin melting our cocoon...</span>")
addtimer(CALLBACK(src, .proc/dissolve_cocoon, user, C), 2.5 SECONDS) //Very short because it's just webs
used = TRUE
for(var/obj/item/grab/G in user.grabbed_by)
var/mob/living/carbon/M = G.assailant
user.visible_message("<span class='warning'>[user] spits acid at [M]'s face and slips out of their grab!</span>")
M.Stun(2 SECONDS) //Drops the grab
M.apply_damage(5, BURN, "head", M.run_armor_check("head", "melee"))
user.SetStunned(0) //This only triggers if they are grabbed, to have them break out of the grab, without the large stun time. If you use biodegrade as an antistun without being grabbed, it will not work
user.SetWeakened(0)
playsound(user.loc, 'sound/weapons/sear.ogg', 50, TRUE)
used = TRUE
if(used)
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]"))
return TRUE
/datum/action/changeling/biodegrade/proc/dissolve_restraint(mob/living/carbon/human/user, obj/O)
if(O && (user.handcuffed == O || user.legcuffed == O || user.wear_suit == O))
user.unEquip(O)
O.visible_message("<span class='warning'>[O] dissolves into a puddle of sizzling goop.</span>")
O.forceMove(get_turf(user))
qdel(O)
/datum/action/changeling/biodegrade/proc/open_closet(mob/living/carbon/human/user, obj/structure/closet/C)
if(C && user.loc == C)
C.visible_message("<span class='warning'>[C]'s door breaks and opens!</span>")
C.welded = FALSE
C.locked = FALSE
C.broken = TRUE
C.open()
to_chat(user, "<span class='warning'>We open the container restraining us!</span>")
/datum/action/changeling/biodegrade/proc/dissolve_cocoon(mob/living/carbon/human/user, obj/structure/spider/cocoon/C)
if(C && user.loc == C)
qdel(C) //The cocoon's destroy will move the changeling outside of it without interference
to_chat(user, "<span class='warning'>We dissolve the cocoon!</span>")