Files
Paradise/code/modules/admin/verbs/freeze.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

104 lines
3.3 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////Freeze Mob/Mech Verb -- Ported from NSS Pheonix (Unbound Travels)/////////
////////////////////////////////////////////////////////////////////////////////
//////Allows admin's to right click on any mob/mech and freeze them in place.///
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
GLOBAL_LIST_EMPTY(frozen_atom_list) // A list of admin-frozen atoms.
/client/proc/freeze(atom/movable/M)
set name = "\[Admin\] Freeze"
set category = null
if(!check_rights(R_ADMIN))
return
M.admin_Freeze(src)
/// Created here as a base proc. Override as needed for any type of object or mob you want able to be frozen.
/atom/movable/proc/admin_Freeze(client/admin)
to_chat(admin, "<span class='warning'>Freeze is not able to be called on this type of object.</span")
return
///mob freeze procs
/mob/living
/// Used for preventing attacks on admin-frozen mobs.
var/frozen = null
/// Used for keeping track of previous sleeping value with admin freeze.
var/admin_prev_sleeping = 0
/mob/living/admin_Freeze(client/admin, skip_overlays = FALSE, mech = null)
if(!istype(admin))
return
if(!(src in GLOB.frozen_atom_list))
GLOB.frozen_atom_list += src
var/obj/effect/overlay/adminoverlay/AO = new
if(skip_overlays)
overlays += AO
anchored = TRUE
canmove = FALSE
admin_prev_sleeping = AmountSleeping()
PermaSleeping()
frozen = AO
else
GLOB.frozen_atom_list -= src
if(skip_overlays)
overlays -= frozen
anchored = FALSE
canmove = TRUE
frozen = null
SetSleeping(admin_prev_sleeping, TRUE)
admin_prev_sleeping = null
to_chat(src, "<b><font color= red>You have been [frozen ? "frozen" : "unfrozen"] by [admin]</b></font>")
message_admins("<span class='notice'>[key_name_admin(admin)] [frozen ? "froze" : "unfroze"] [key_name_admin(src)] [mech ? "in a [mech]" : ""]</span>")
log_admin("[key_name(admin)] [frozen ? "froze" : "unfroze"] [key_name(src)] [mech ? "in a [mech]" : ""]")
update_icons()
return frozen
/mob/living/simple_animal/slime/admin_Freeze(admin)
if(..()) // The result of the parent call here will be the value of the mob's `frozen` variable after they get (un)frozen.
adjustHealth(1000) //arbitrary large value
else
revive()
/mob/living/simple_animal/var/admin_prev_health = null
/mob/living/simple_animal/admin_Freeze(admin)
if(..()) // The result of the parent call here will be the value of the mob's `frozen` variable after they get (un)frozen.
admin_prev_health = health
health = 0
else
revive()
overlays.Cut()
//////////////////////////Freeze Mech
/obj/mecha/admin_Freeze(client/admin)
var/obj/effect/overlay/adminoverlay/freeze_overlay = new
if(!frozen)
GLOB.frozen_atom_list += src
frozen = TRUE
overlays += freeze_overlay
else
GLOB.frozen_atom_list -= src
frozen = FALSE
overlays -= freeze_overlay
if(occupant)
occupant.admin_Freeze(admin, mech = name) // We also want to freeze the driver of the mech.
else
message_admins("<span class='notice'>[key_name_admin(admin)] [frozen ? "froze" : "unfroze"] an empty [name]</span>")
log_admin("[key_name(admin)] [frozen ? "froze" : "unfroze"] an empty [name]")