[MIRROR] Adds new accidents to the omen component and makes it an admin smite (#1219)

* Adds new accidents to the omen component and makes it an admin smite (#54063)

The omen component now has a 15% chance when walking through an airlock to have it try to crush you and a 15% chance when walking next to an open turf to throw yourself into it alongside the existing 15% chance to get crushed by a vending machine and 50% chance when you trip over to crack your skull open.

It is also an admin smite with an option to make it permanent.

Allows airlocks to override safties for a single close() proc call, forcing a crush.

* Adds new accidents to the omen component and makes it an admin smite

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2020-10-09 18:29:54 +02:00
committed by GitHub
co-authored by Timberpoes
parent 0dfdd9f543
commit 380ee5a3d0
4 changed files with 66 additions and 14 deletions
+49 -9
View File
@@ -12,15 +12,25 @@
/// Whatever's causing the omen, if there is one. Destroying the vessel won't stop the omen, but we destroy the vessel (if one exists) upon the omen ending
var/obj/vessel
/datum/component/omen/Initialize(silent=FALSE, vessel)
/// Whether this is a permanent omen that cannot be removed by any non-admin means.
var/permanent = FALSE
/datum/component/omen/Initialize(silent = FALSE, _vessel, _permanent = FALSE)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
var/mob/person = parent
vessel = _vessel
permanent = _permanent
if(!silent)
to_chat(person, "<span class='warning'>You get a bad feeling...</span>")
src.vessel = vessel
var/warning = "You get a bad feeling..."
if(permanent)
warning += " A very bad feeling... As if you are surrounded by a twisted aura of pure malevolence..."
to_chat(parent, "<span class='warning'>[warning]</span>")
/datum/component/omen/Destroy(force, silent)
if(!silent)
var/mob/living/person = parent
to_chat(person, "<span class='nicegreen'>You feel a horrible omen lifted off your shoulders!</span>")
if(vessel)
vessel.visible_message("<span class='warning'>[vessel] burns up in a sinister flash, taking an evil energy with it...</span>")
vessel = null
@@ -43,14 +53,40 @@
/datum/component/omen/proc/check_accident(atom/movable/our_guy)
SIGNAL_HANDLER_DOES_SLEEP
if(!isliving(our_guy))
return
var/mob/living/living_guy = our_guy
if(!prob(15))
return
for(var/t in get_adjacent_open_turfs(our_guy))
var/our_guy_pos = get_turf(living_guy)
for(var/turf_content in our_guy_pos)
if(istype(turf_content, /obj/machinery/door/airlock))
to_chat(living_guy, "<span class='warning'>A malevolent force launches your body to the floor...</span>")
var/obj/machinery/door/airlock/darth_airlock = turf_content
living_guy.apply_status_effect(STATUS_EFFECT_PARALYZED, 10, TRUE)
darth_airlock.close(force_crush = TRUE)
if(!permanent)
qdel(src)
return
for(var/t in get_adjacent_open_turfs(living_guy))
var/turf/the_turf = t
if(the_turf.zPassOut(living_guy, DOWN) && living_guy.can_zFall(the_turf))
to_chat(living_guy, "<span class='warning'>A malevolent force guides you towards the edge...</span>")
living_guy.throw_at(the_turf, 1, 10, force = MOVE_FORCE_EXTREMELY_STRONG)
if(!permanent)
qdel(src)
return
for(var/obj/machinery/vending/darth_vendor in the_turf)
if(darth_vendor.tiltable)
darth_vendor.tilt(our_guy)
qdel(src)
to_chat(living_guy, "<span class='warning'>A malevolent force tugs at the [darth_vendor]...</span>")
darth_vendor.tilt(living_guy)
if(!permanent)
qdel(src)
return
/// If we get knocked down, see if we have a really bad slip and bash our head hard
@@ -68,13 +104,17 @@
our_guy.visible_message("<span class='danger'>[our_guy] hits [our_guy.p_their()] head really badly falling down!</span>", "<span class='userdanger'>You hit your head really badly falling down!</span>")
the_head.receive_damage(75)
our_guy.adjustOrganLoss(ORGAN_SLOT_BRAIN, 100)
qdel(src)
if(!permanent)
qdel(src)
/// Hijack the mood system to see if we get the blessing mood event to cancel the omen
/datum/component/omen/proc/check_bless(mob/living/our_guy, category)
SIGNAL_HANDLER
if(permanent)
return
if(category != "blessing")
return
to_chat(our_guy, "<span class='nicegreen'>You feel a horrible omen lifted off your shoulders!</span>")
qdel(src)