Skip to content

Commit

Permalink
Icewing watcher fixes (#10297)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeeLover66 authored Dec 12, 2023
1 parent 8f537b3 commit 912265f
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions code/datums/status_effects/gas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,36 @@
if(!.)
return
ADD_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_STATUS_EFFECT(id))
RegisterSignal(owner, COMSIG_LIVING_RESIST, PROC_REF(owner_resist))
if(!owner.stat)
to_chat(owner, "<span class='userdanger'>You become frozen in a cube!</span>")
cube = icon('icons/effects/freeze.dmi', "ice_cube")
owner.add_overlay(cube)
owner.update_mobility()

/datum/status_effect/freon/on_remove()
if(!owner.stat)
to_chat(owner, "The cube melts!")
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
REMOVE_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_STATUS_EFFECT(id))
owner.cut_overlay(cube)
owner.adjust_bodytemperature(100)
owner.update_mobility()
return ..()

/atom/movable/screen/alert/status_effect/freon
name = "Frozen Solid"
desc = "You're frozen inside an ice cube, and cannot move! You can still do stuff, like shooting. Resist out of the cube!"
icon_state = "frozen"

/datum/status_effect/freon/on_apply()
RegisterSignal(owner, COMSIG_LIVING_RESIST, PROC_REF(owner_resist))
if(!owner.stat)
to_chat(owner, "<span class='userdanger'>You become frozen in a cube!</span>")
cube = icon('icons/effects/freeze.dmi', "ice_cube")
owner.add_overlay(cube)
owner.update_mobility()
return ..()
/atom/movable/screen/alert/status_effect/freon/Click(location, control, params)
. = ..()
var/mob/living/L = usr
if(!istype(L) || !L.can_resist() || L != owner)
return
if(L.last_special <= world.time)
return L.resist()


/datum/status_effect/freon/tick()
owner.update_mobility()
Expand All @@ -42,20 +54,12 @@

/datum/status_effect/freon/proc/do_resist()
to_chat(owner, "You start breaking out of the ice cube!")
if(do_after(owner, 40))
if(do_after(owner, 4 SECONDS))
if(!QDELETED(src))
to_chat(owner, "You break out of the ice cube!")
owner.remove_status_effect(/datum/status_effect/freon)
owner.update_mobility()

/datum/status_effect/freon/on_remove()
if(!owner.stat)
to_chat(owner, "The cube melts!")
owner.cut_overlay(cube)
owner.adjust_bodytemperature(100)
owner.update_mobility()
UnregisterSignal(owner, COMSIG_LIVING_RESIST)

/datum/status_effect/freon/watcher
duration = 8
duration = 8 SECONDS
can_melt = FALSE

0 comments on commit 912265f

Please sign in to comment.