Skip to content

Commit

Permalink
Psionic events re-introduced, other tweaks (#558)
Browse files Browse the repository at this point in the history
* Psionic events re-introduced, other tweaks

* Fix

* Announce fix

* Fix
  • Loading branch information
EgorDinamit authored Feb 23, 2024
1 parent 0c9213d commit 63de8b4
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 63 deletions.
15 changes: 11 additions & 4 deletions code/modules/events/event_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define ASSIGNMENT_SCIENTIST "Scientist"
#define ASSIGNMENT_EXPLORATION "Exploration"
#define ASSIGNMENT_SECURITY "Security"
#define ASSIGNMENT_MAGIC "Magic"
#define ASSIGNMENT_PSIONIC "Psionic"

var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT_LEVEL_MODERATE = "Moderate", EVENT_LEVEL_MAJOR = "Major", EVENT_LEVEL_CATASTROPHE = "Catastrophe", EVENT_LEVEL_EXO = "Exoplanet")

Expand Down Expand Up @@ -141,7 +143,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta/no_overmap(EVENT_LEVEL_MUNDANE, "Space Dust", /datum/event/dust , 30, list(ASSIGNMENT_ENGINEER = 10)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Sensor Suit Jamming", /datum/event/sensor_suit_jamming, 30, list(ASSIGNMENT_MEDICAL = 20, ASSIGNMENT_AI = 20), 1),
//new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 200),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation", /datum/event/infestation, 100, list(ASSIGNMENT_JANITOR = 50)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation", /datum/event/infestation, 40, list(ASSIGNMENT_JANITOR = 40)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50)),
new /datum/event_meta/no_overmap(EVENT_LEVEL_MUNDANE, "Electrical Storm", /datum/event/electrical_storm, 20, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 50)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Toilet Clog", /datum/event/toilet_clog, 50, list(ASSIGNMENT_JANITOR = 50)),
Expand All @@ -151,6 +153,8 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
//new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mail Delivery", /datum/event/mail, 0, list(ASSIGNMENT_ANY = 5), 1),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Whale Migration", /datum/event/whale_migration, 10),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Disease Outbreak", /datum/event/disease_outbreak, 40, list(ASSIGNMENT_MEDICAL = 20, ASSIGNMENT_SCIENCE = 10)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Psionic Balm", /datum/event/psi/balm, 0, list(ASSIGNMENT_PSIONIC = 5)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Psionic Wail", /datum/event/psi/wail, 0, list(ASSIGNMENT_PSIONIC = 5)),
)

/datum/event_container/moderate
Expand Down Expand Up @@ -184,7 +188,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
/datum/event_container/major
severity = EVENT_LEVEL_MAJOR
available_events = list(
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 200, list(ASSIGNMENT_ANY = -5)), // So higher pop will run events more often
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 200,list(ASSIGNMENT_ANY = -5)), // So higher pop will run events more often
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_MEDICAL = 10, ASSIGNMENT_SECURITY = 20, ASSIGNMENT_EXPLORATION = 10), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Abominable Infestation", /datum/event/abominable_infestation,0, list(ASSIGNMENT_MEDICAL = 10, ASSIGNMENT_SECURITY = 20, ASSIGNMENT_EXPLORATION = 15), 1),
new /datum/event_meta/no_overmap(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 20, ASSIGNMENT_MEDICAL = 10)),
Expand All @@ -193,14 +197,15 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta/no_overmap(EVENT_LEVEL_MAJOR, "Electrical Storm", /datum/event/electrical_storm, 0, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_JANITOR = 5)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Drone Revolution", /datum/event/rogue_maint_drones, 0, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_MEDICAL = 10, ASSIGNMENT_SECURITY = 20, ASSIGNMENT_EXPLORATION = 15)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Disease Outbreak", /datum/event/disease_outbreak, 0, list(ASSIGNMENT_MEDICAL = 20, ASSIGNMENT_SCIENCE = 10)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Drive Instability", /datum/event/bsd_instability, 0,list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_ANY = 5), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Drive Instability", /datum/event/bsd_instability, 0, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_ANY = 5), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Psionic Spasm", /datum/event/minispasm, 0, list(ASSIGNMENT_PSIONIC = 5, ASSIGNMENT_MEDICAL = 3, ASSIGNMENT_SCIENCE = 3, ASSIGNMENT_ANY = 1), 1),
)

/datum/event_container/catastrophe
severity = EVENT_LEVEL_CATASTROPHE
available_events = list(
new /datum/event_meta(EVENT_LEVEL_CATASTROPHE, "Nothing", /datum/event/nothing, 100),
new /datum/event_meta(EVENT_LEVEL_CATASTROPHE, "Leviathan", /datum/event/leviathan_spawn, 0, list(ASSIGNMENT_COMMAND = 5, ASSIGNMENT_EXPLORATION = 5, ASSIGNMENT_SECURITY = 5, ASSIGNMENT_MEDICAL = 5, ASSIGNMENT_ENGINEER = 5))
new /datum/event_meta(EVENT_LEVEL_CATASTROPHE, "Leviathan", /datum/event/leviathan_spawn, 0, list(ASSIGNMENT_COMMAND = 5, ASSIGNMENT_EXPLORATION = 5, ASSIGNMENT_SECURITY = 5, ASSIGNMENT_MEDICAL = 5, ASSIGNMENT_ENGINEER = 5), 1)
)

/datum/event_container/exo
Expand All @@ -221,3 +226,5 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
#undef ASSIGNMENT_SCIENTIST
#undef ASSIGNMENT_EXPLORATION
#undef ASSIGNMENT_SECURITY
#undef ASSIGNMENT_MAGIC
#undef ASSIGNMENT_PSIONIC
11 changes: 10 additions & 1 deletion code/modules/events/event_dynamic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var/list/event_last_fired = list()
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
/proc/number_active_with_role()
var/list/active_with_role = list()
active_with_role["Any"] = 0
active_with_role["Engineer"] = 0
active_with_role["Medical"] = 0
active_with_role["Security"] = 0
Expand All @@ -93,8 +94,10 @@ var/list/event_last_fired = list()
active_with_role["Robot"] = 0
active_with_role["Janitor"] = 0
active_with_role["Gardener"] = 0
active_with_role["Magic"] = 0
active_with_role["Psionic"] = 0

for(var/mob/M in GLOB.player_list)
for(var/mob/living/M in GLOB.player_list)
if(!M.mind || !M.client || M.client.is_afk(10 MINUTES)) // longer than 10 minutes AFK counts them as inactive
continue

Expand Down Expand Up @@ -139,4 +142,10 @@ var/list/event_last_fired = list()
if(M.mind.assigned_role == "Gardener")
active_with_role["Gardener"]++

if(LAZYLEN(M.mind.learned_spells))
active_with_role["Magic"]++

if(M.psi)
active_with_role["Psionic"]++

return active_with_role
11 changes: 6 additions & 5 deletions code/modules/psionics/complexus/complexus_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
owner.client.images |= I

/datum/psi_complexus/proc/backblast(value)

// Can't backblast if you're controlling your power.
if(!owner || suppressed)
return FALSE
Expand All @@ -81,11 +80,12 @@
owner.psi.hide_auras()

sound_to(owner, sound('sound/effects/psi/power_feedback.ogg'))
to_chat(owner, "<span class='danger'><font size=3>Wild energistic feedback blasts across your psyche!</font></span>")
to_chat(owner, SPAN_USERDANGER("Wild energistic feedback blasts across your psyche!"))
stunned(value * 2)
set_cooldown(value * 100)

if(prob(value*10)) owner.emote("scream")
if(prob(value*10))
owner.emote("scream")

// Your head asplode.
owner.adjustBrainLoss(value)
Expand All @@ -96,8 +96,9 @@
if(sponge && sponge.damage >= sponge.max_damage)
var/obj/item/organ/external/affecting = pop.get_organ(sponge.parent_organ)
if(affecting && !affecting.is_stump())
affecting.droplimb(0, DROPLIMB_BLUNT)
if(sponge) qdel(sponge)
affecting.droplimb(FALSE, DROPLIMB_BLUNT)
if(sponge)
QDEL_NULL(sponge)

/datum/psi_complexus/proc/reset()
aura_color = initial(aura_color)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/psionics/complexus/complexus_process.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
owner.client.images |= thing

var/image/aura_image = get_aura_image()
if(rating >= PSI_RANK_PARAMOUNT) // spooky boosters
if(rating >= PSI_RANK_PARAMOUNT * 2)
aura_color = "#000000"
aura_image.blend_mode = BLEND_SUBTRACT
else if(rating >= PSI_RANK_PARAMOUNT)
aura_color = "#aaffaa"
aura_image.blend_mode = BLEND_SUBTRACT
else
Expand Down Expand Up @@ -124,7 +127,6 @@
ui.update_icon()

/datum/psi_complexus/proc/attempt_regeneration()

var/heal_general = FALSE
var/heal_poison = FALSE
var/heal_internal = FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/modules/psionics/equipment/cerebro_enhancers.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Psi-boosting item (antag only)
// Psi-boosting item
/obj/item/clothing/head/helmet/space/psi_amp
name = "cerebro-energetic enhancer"
desc = "A matte-black, eyeless cerebro-energetic enhancement helmet. It uses highly sophisticated, and illegal, techniques to drill into your brain and install psi-infected AIs into the fluid cavities between your lobes."
Expand Down Expand Up @@ -156,7 +156,7 @@

/obj/item/clothing/head/helmet/space/psi_amp/lesser
name = "psionic amplifier"
desc = "A crown-of-thorns cerebro-energetic enhancer that interfaces directly with the brain, isolating and strengthening psionic signals. It kind of looks like a tiara having sex with an industrial robot."
desc = "A crown-of-thorns cerebro-energetic enhancer that interfaces directly with the brain, isolating and strengthening psionic signals."
icon_state = "amp"

max_boosted_faculties = 2
Expand Down
8 changes: 4 additions & 4 deletions code/modules/psionics/equipment/psimeter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
else
icon_state = "meter_off"

/obj/machinery/psi_meter/interface_interact(var/mob/user)
/obj/machinery/psi_meter/interface_interact(mob/user)
interact(user)
return TRUE

/obj/machinery/psi_meter/interact(var/mob/user)

if(!use_power) return
/obj/machinery/psi_meter/interact(mob/user)
if(!use_power)
return

var/list/dat = list()
if(LAZYLEN(last_assay))
Expand Down
10 changes: 6 additions & 4 deletions code/modules/psionics/events/_psi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
/datum/event/psi/announce()
priority_announcement.Announce( \
"A localized disruption within the neighboring psionic continua has been detected. All psi-operant crewmembers \
are advised to cease any sensitive activities and report to medical personnel in case of damage.", \
"Cuchulain Sensor Array Automated Message" \
are advised to cease any sensitive activities and report to medical personnel in case of damage.",
"[GLOB.using_map.psionic_short] Sensor Array Automated Message",
zlevels = affecting_z,
)

/datum/event/psi/end()
priority_announcement.Announce( \
"The psi-disturbance has ended and baseline normality has been re-asserted. \
Anything you still can't cope with is therefore your own problem.", \
"Cuchulain Sensor Array Automated Message" \
Anything you still can't cope with is therefore your own problem.",
"[GLOB.using_map.psionic_short] Sensor Array Automated Message",
zlevels = affecting_z,
)

/datum/event/psi/tick()
Expand Down
69 changes: 32 additions & 37 deletions code/modules/psionics/events/mini_spasm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,57 @@
"Something is eating your thoughts!",
"You can feel your brain being rewritten!",
"Something is crawling over your frontal lobe!",
"<b>THE SIGNAL THE SIGNAL THE SIGNAL THE SIGNAL THE</b>"
"<b>THE SIGNAL THE SIGNAL THE SIGNAL THE SIGNAL THE...</b>"
)

/datum/event/minispasm/announce()
priority_announcement.Announce( \
"PRIORITY ALERT: SIGMA-[rand(50,80)] PSIONIC SIGNAL LOCAL TRAMISSION DETECTED (97% MATCH, NONVARIANT) \
(SIGNAL SOURCE TRIANGULATED ADJACENT LOCAL SITE): All personnel are advised to avoid \
exposure to active audio transmission equipment including radio headsets and intercoms \
for the duration of the signal broadcast.", \
"Cuchulain Sensor Array Automated Message" \
for the duration of the signal broadcast.",
"[GLOB.using_map.psionic_short] Sensor Array Automated Message",
zlevels = affecting_z,
)

/datum/event/minispasm/start()
var/list/victims = list()
for(var/obj/item/device/radio/radio in GLOB.listening_objects)
if(!(radio.z in affecting_z))
continue
if(radio.on)
for(var/mob/living/victim in range(radio.canhear_range, radio.loc))
if(isnull(victims[victim]) && victim.stat == CONSCIOUS && !victim.ear_deaf)
victims[victim] = radio
for(var/thing in victims)
var/mob/living/victim = thing
var/obj/item/device/radio/source = victims[victim]
do_spasm(victim, source)
if(victim.stat == CONSCIOUS && !victim.ear_deaf)
do_spasm(victim, radio)

/datum/event/minispasm/proc/do_spasm(mob/living/victim, obj/item/device/radio/source)
set waitfor = 0
/datum/event/minispasm/get_skybox_image()
var/image/res = overlay_image('icons/skybox/electrobox.dmi', "lightning", COLOR_PURPLE, RESET_COLOR)
res.blend_mode = BLEND_ADD
return res

if(iscarbon(victim) && !victim.isSynthetic())
var/list/disabilities = list(NEARSIGHTED, EPILEPSY, TOURETTES, NERVOUS)
for(var/disability in disabilities)
if(victim.disabilities & disability)
disabilities -= disability
if(disabilities.len)
victim.disabilities |= pick(disabilities)
/datum/event/minispasm/end()
priority_announcement.Announce( \
"PRIORITY ALERT: SIGNAL BROADCAST HAS CEASED. Personnel are cleared to resume use of non-hardened radio transmission equipment. Have a nice day.",
"[GLOB.using_map.psionic_short] Sensor Array Automated Message",
zlevels = affecting_z,
)

/datum/event/minispasm/proc/do_spasm(mob/living/victim, obj/item/device/radio/source)
if(victim.psi)
if(victim.psi.suppressed)
return
to_chat(victim, SPAN_DANGER("A hauntingly familiar sound hisses from [icon2html(source, victim)] \the [source], and your vision flickers!"))
victim.psi.backblast(rand(5,15))
victim.Paralyse(5)
victim.make_jittery(100)
else
to_chat(victim, SPAN_DANGER("An indescribable, brain-tearing sound hisses from [icon2html(source, victim)] \the [source], and you collapse in a seizure!"))
victim.seizure()
var/new_latencies = rand(2,4)
var/list/faculties = list(PSI_COERCION, PSI_REDACTION, PSI_ENERGISTICS, PSI_PSYCHOKINESIS)
for(var/i = 1 to new_latencies)
to_chat(victim, SPAN_DANGER("<font size = 3>[pick(psi_operancy_messages)]</font>"))
victim.adjustBrainLoss(rand(10,20))
victim.set_psi_rank(pick_n_take(faculties), 1)
sleep(30)
victim.psi.update()
sleep(45)
victim.psi.check_latency_trigger(100, "a psionic scream", redactive = TRUE)
return

/datum/event/minispasm/end()
priority_announcement.Announce( \
"PRIORITY ALERT: SIGNAL BROADCAST HAS CEASED. Personnel are cleared to resume use of non-hardened radio transmission equipment. Have a nice day.", \
"Cuchulain Sensor Array Automated Message" \
)
to_chat(victim, SPAN_DANGER("An indescribable, brain-tearing sound hisses from [icon2html(source, victim)] \the [source], and you collapse in a seizure!"))
victim.seizure()
var/new_latency = pick(PSI_COERCION, PSI_REDACTION, PSI_ENERGISTICS, PSI_PSYCHOKINESIS)
to_chat(victim, SPAN_USERDANGER("[pick(psi_operancy_messages)]"))
victim.adjustBrainLoss(rand(10,20))
victim.set_psi_rank(new_latency)
victim.psi.update()

if(prob(33))
addtimer(CALLBACK(victim.psi, /datum/psi_complexus/proc/check_latency_trigger, 100, "a psionic scream", TRUE), rand(5 SECONDS, 30 SECONDS))
10 changes: 7 additions & 3 deletions code/modules/psionics/events/psi_balm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
)

/datum/event/psi/balm/apply_psi_effect(datum/psi_complexus/psi)
if(psi.suppressed)
return

var/soothed
if(psi.stun > 1)
if(psi.stun)
psi.stun--
soothed = TRUE
else if(psi.stamina < psi.max_stamina)
psi.stamina = min(psi.max_stamina, psi.stamina + rand(1,3))
soothed = TRUE
else if(psi.owner.getBrainLoss() > 0)
psi.owner.adjustBrainLoss(-1)
else if(psi.owner.getBrainLoss())
psi.owner.adjustBrainLoss(-4)
soothed = TRUE

if(soothed && prob(10))
to_chat(psi.owner, SPAN_NOTICE("<i>[pick(balm_messages)]</i>"))
6 changes: 5 additions & 1 deletion code/modules/psionics/events/psi_wail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
)

/datum/event/psi/wail/apply_psi_effect(datum/psi_complexus/psi)
if(psi.suppressed)
return

var/annoyed
if(prob(1))
psi.stunned(1)
annoyed = TRUE
else if(psi.stamina > 0)
psi.stamina = max(0, psi.stamina - rand(1,3))
annoyed = TRUE

if(annoyed && prob(1))
to_chat(psi.owner, "<span class='notice'><i>[pick(whine_messages)]</i></span>")
to_chat(psi.owner, SPAN_NOTICE("<i>[pick(whine_messages)]</i>"))
2 changes: 2 additions & 0 deletions maps/~mapsystem/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ var/const/MAP_HAS_RANK = 2 //Rank system, also togglable
var/boss_short = "Cap'"
var/company_name = "BadMan"
var/company_short = "BM"
var/psionic_name = "Cuchulain Foundation"
var/psionic_short = "Cuchulain"
var/system_name = "Uncharted System"

var/list/map_admin_faxes = list()
Expand Down

0 comments on commit 63de8b4

Please sign in to comment.