Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wonderland apocolypse fixups + status effect consistency #1868

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
chessmark = GLOB.wonderland_marks["Wonderchess landmark"]
landmark = GLOB.wonderland_marks["Wonderland landmark"]


/datum/action/cooldown/paradox/Activate()
var/turf/owner_turf = get_turf(owner)
if(!is_station_level(owner_turf.z))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
text = "What the heELl is going on?! WEeE have detected massive up-spikes in ##@^^?? coming fr*m yoOourr st!*i@n! GeEeEEET out of THERE NOW!!",
title = Gibberish("[command_name()] Higher Dimensional Affairs", TRUE, 45),
sound = 'monkestation/sound/bloodsuckers/monsterhunterintro.ogg',
encode_title = FALSE, // Gibberish() already sanitizes
color_override = "purple"
)

Expand Down Expand Up @@ -117,6 +118,8 @@
id = "wonderland_district"
alert_type = null
tick_interval = -1
var/static/list/spell_whitelist_typecache
var/static/list/trigger_recoil_typecache

/datum/status_effect/wonderland_district/on_apply()
. = ..()
Expand All @@ -125,10 +128,11 @@
to_chat(owner, span_warning("You feel an ominous pressure fill the air around you..."))
RegisterSignal(owner, COMSIG_ENTER_AREA, PROC_REF(on_enter_area))
RegisterSignal(owner, COMSIG_MOB_AFTER_SPELL_CAST, PROC_REF(after_spell_cast))
RegisterSignal(owner, COMSIG_ACTION_TRIGGER, PROC_REF(on_action_triggered))

/datum/status_effect/wonderland_district/on_remove()
. = ..()
UnregisterSignal(owner, list(COMSIG_ENTER_AREA, COMSIG_MOB_AFTER_SPELL_CAST))
UnregisterSignal(owner, list(COMSIG_ENTER_AREA, COMSIG_MOB_AFTER_SPELL_CAST, COMSIG_ACTION_TRIGGER))

/datum/status_effect/wonderland_district/proc/on_enter_area(datum/source, area/centcom/new_area)
SIGNAL_HANDLER
Expand All @@ -137,15 +141,39 @@

/datum/status_effect/wonderland_district/proc/after_spell_cast(datum/source, datum/action/cooldown/spell/spell, atom/cast_on)
SIGNAL_HANDLER
if(!istype(spell) || QDELING(spell) || !spell.antimagic_flags) // don't affect non-magic spells.
if(!spell_whitelist_typecache)
spell_whitelist_typecache = typecacheof(list(
/datum/action/cooldown/spell/florida_regeneration,
/datum/action/cooldown/spell/florida_cuff_break,
/datum/action/cooldown/spell/florida_doorbuster
))
if(!istype(spell) || QDELING(spell) || !spell.antimagic_flags || is_type_in_typecache(spell, spell_whitelist_typecache)) // don't affect non-magic spells.
return
recoil(span_warning("[owner] doubles over in pain, violently coughing up blood!"), span_userdanger("An overwhelming pressure fills your body as you cast [spell.name || "magic"], filling you with excruciating pain down to the very core of your being!"))

/datum/status_effect/wonderland_district/proc/on_action_triggered(datum/source, datum/action/action)
SIGNAL_HANDLER
if(!trigger_recoil_typecache)
trigger_recoil_typecache = typecacheof(list(
/datum/action/innate/cult/blood_spell,
/datum/action/innate/cult/blood_magic,
/datum/action/innate/cult/master,
/datum/action/innate/clockcult/quick_bind,
/datum/action/cooldown/bloodsucker
))
if(!is_type_in_typecache(action, trigger_recoil_typecache))
return
recoil(span_warning("[owner] doubles over in pain, violently coughing up blood!"), span_userdanger("An overwhelming pressure fills your body as you use [action.name || "your ability"], filling you with excruciating pain down to the very core of your being!"))

/datum/status_effect/wonderland_district/proc/recoil(vis_msg, self_msg)
make_visible()
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob/living, emote), "scream")
owner.visible_message(span_warning("[owner] doubles over in pain, violently coughing up blood!"), span_userdanger("An overwhelming pressure fills your body as you cast [spell.name || "magic"], filling you with excruciating pain down to the very core of your being!"))
if(vis_msg)
owner.visible_message(vis_msg, self_msg)
owner.take_overall_damage(brute = rand(5, 15))
if(iscarbon(owner))
var/mob/living/carbon/carbon_owner = owner
carbon_owner.vomit(lost_nutrition = 0, blood = TRUE, distance = rand(1, 2), message = FALSE)
carbon_owner.vomit(lost_nutrition = 0, blood = TRUE, stun = FALSE, distance = prob(20) + 1, message = FALSE)

/datum/status_effect/wonderland_district/proc/make_visible()
if(alert_type && !QDELETED(linked_alert))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define WONDERLAND_TRAIT "wonderland"

/obj/item/clothing/mask/cursed_rabbit
name = "Damned Rabbit Mask"
desc = "Slip into the wonderland."
Expand Down Expand Up @@ -27,12 +29,28 @@
paradox?.Grant(user)
wonderland?.Grant(user)
user.apply_status_effect(/datum/status_effect/bnuuy_mask)
user.become_area_sensitive(type)
RegisterSignal(user, COMSIG_ENTER_AREA, PROC_REF(on_enter_area))
RegisterSignal(user, COMSIG_EXIT_AREA, PROC_REF(on_exit_area))

/obj/item/clothing/mask/cursed_rabbit/dropped(mob/living/user)
. = ..()
paradox?.Remove(user)
wonderland?.Remove(user)
user.remove_status_effect(/datum/status_effect/bnuuy_mask)
UnregisterSignal(user, list(COMSIG_ENTER_AREA, COMSIG_EXIT_AREA))
user.lose_area_sensitivity(type)
REMOVE_TRAIT(src, TRAIT_NODROP, WONDERLAND_TRAIT)

/obj/item/clothing/mask/cursed_rabbit/proc/on_enter_area(mob/living/user, area/new_area)
SIGNAL_HANDLER
if(istype(new_area, /area/ruin/space/has_grav/wonderland))
ADD_TRAIT(src, TRAIT_NODROP, WONDERLAND_TRAIT)

/obj/item/clothing/mask/cursed_rabbit/proc/on_exit_area(mob/living/user, area/old_area)
SIGNAL_HANDLER
if(istype(old_area, /area/ruin/space/has_grav/wonderland))
REMOVE_TRAIT(src, TRAIT_NODROP, WONDERLAND_TRAIT)

/datum/status_effect/bnuuy_mask
id = "bnuuy_mask"
Expand All @@ -52,3 +70,5 @@

/datum/status_effect/bnuuy_mask/get_examine_text()
return span_warning("[owner.p_they(TRUE)] seem[owner.p_s()] out-of-place, as if [owner.p_they()] were partially detached from reality.")

#undef WONDERLAND_TRAIT
Binary file modified monkestation/icons/hud/screen_alert.dmi
Binary file not shown.
Loading