Supermatter cascade round-end (#66659)

This PR adds the resonance cascade to the SM (idea ported from vg but with total rewrite)

The resonance cascade will turn reality into crystals that devours and destroy everything.
It can be triggered by delaminating the SM when is in contact with hypernoblium and antinoblium, both at over 40% and with as many moles to trigger a singulo delamination. The cascade can't be triggered if the SM is already under 80% integrity and if at any point any of the gases gets under 40% or the total gets lower than the amount for singulo, it will stop the cascade and can't be retriggered unless you reset the SM to over 80% integrity.
This commit is contained in:
Ghilker
2022-05-08 10:27:49 -07:00
committed by GitHub
parent e5909ce738
commit c8f27896c0
19 changed files with 759 additions and 283 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
//Endgame Results
/// Nuke was detonated in space on same z-level as station
#define NUKE_NEAR_MISS 1
/// Nuke was detonated on another z-level
/// Nuke was detonated on another z-level
#define NUKE_MISS_STATION 2
/// Nuke was detonated on the syndicate base
#define NUKE_SYNDICATE_BASE 3
@@ -35,9 +35,11 @@
#define WIZARD_KILLED 19
/// The station was destroyed by it's own self-destruct nuclear device
#define STATION_NUKED 20
/// The station was destroyed by the supermatter cascade
#define SUPERMATTER_CASCADE 21
/// The emergency shuttle was successfully hijacked
#define SHUTTLE_HIJACK 24
/// The gangs on the station were thwarted
#define GANG_DESTROYED 25 // Looks like it was deprecated at some point - Jan 2022
/// The gangs on the station still exist
#define GANG_OPERATING 26
#define GANG_OPERATING 26
+4
View File
@@ -11,6 +11,8 @@
#define HEALIUM_HEAT_PENALTY 4
#define PROTO_NITRATE_HEAT_PENALTY -3
#define ZAUKER_HEAT_PENALTY 8
#define HYPERNOBLIUM_HEAT_PENALTY -5
#define ANTINOBLIUM_HEAT_PENALTY 20
//All of these get divided by 10-bzcomp * 5 before having 1 added and being multiplied with power to determine rads
//Keep the negative values here above -10 and we won't get negative rads
@@ -114,3 +116,5 @@
#define OVER_9000_ZAP_ICON_STATE "sm_arc_dbz_referance" //Witty I know
#define MAX_SPACE_EXPOSURE_DAMAGE 10
#define SUPERMATTER_CASCADE_PERCENT 80
+3 -1
View File
@@ -132,6 +132,8 @@ SUBSYSTEM_DEF(shuttle)
/// Are we currently in the process of loading a shuttle? Useful to ensure we don't load more than one at once, to avoid weird inconsistencies and possible runtimes.
var/shuttle_loading
/// Did the supermatter start an end of the universe event?
var/universal_cascade = FALSE
/datum/controller/subsystem/shuttle/Initialize(timeofday)
order_number = rand(1, 9000)
@@ -388,7 +390,7 @@ SUBSYSTEM_DEF(shuttle)
return 1
/datum/controller/subsystem/shuttle/proc/autoEvac()
if (!SSticker.IsRoundInProgress())
if (!SSticker.IsRoundInProgress() || universal_cascade)
return
var/callShuttle = TRUE
+2
View File
@@ -597,6 +597,8 @@ SUBSYSTEM_DEF(ticker)
news_message = "The company would like to state that any rumors of criminal organizing on board stations such as [decoded_station_name] are falsehoods, and not to be emulated."
if(GANG_DESTROYED)
news_message = "The crew of [decoded_station_name] would like to thank the Spinward Stellar Coalition Police Department for quickly resolving a minor terror threat to the station."
if(SUPERMATTER_CASCADE)
news_message = "Universal reboot initiated on [decoded_station_name] following a major supermatter cascade."
if(news_message)
send2otherserver(news_source, news_message,"News_Report")
@@ -0,0 +1,326 @@
/datum/component/supermatter_crystal
///Callback for the wrench act call
var/datum/callback/tool_act_callback
///Callback used by the SM to get the damage and matter power increase/decrease
var/datum/callback/consume_callback
/datum/component/supermatter_crystal/Initialize(datum/callback/tool_act_callback, datum/callback/consume_callback)
RegisterSignal(parent, COMSIG_ATOM_BLOB_ACT, .proc/blob_hit)
RegisterSignal(parent, COMSIG_ATOM_ATTACK_PAW, .proc/paw_hit)
RegisterSignal(parent, COMSIG_ATOM_ATTACK_ANIMAL, .proc/animal_hit)
RegisterSignal(parent, COMSIG_ATOM_HULK_ATTACK, .proc/hulk_hit)
RegisterSignal(parent, COMSIG_LIVING_UNARMED_ATTACK, .proc/unarmed_hit)
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, .proc/hand_hit)
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/attackby_hit)
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_WRENCH), .proc/tool_hit)
RegisterSignal(parent, COMSIG_ATOM_BUMPED, .proc/bumped_hit)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/bump_hit)
RegisterSignal(parent, COMSIG_ATOM_INTERCEPT_Z_FALL, .proc/intercept_z_fall)
src.tool_act_callback = tool_act_callback
src.consume_callback = consume_callback
/datum/component/supermatter_crystal/UnregisterFromParent(force, silent)
var/list/signals_to_remove = list(
COMSIG_ATOM_BLOB_ACT,
COMSIG_ATOM_ATTACK_PAW,
COMSIG_ATOM_ATTACK_ANIMAL,
COMSIG_ATOM_HULK_ATTACK,
COMSIG_LIVING_UNARMED_ATTACK,
COMSIG_ATOM_ATTACK_HAND,
COMSIG_PARENT_ATTACKBY,
COMSIG_ATOM_TOOL_ACT(TOOL_WRENCH),
COMSIG_ATOM_BUMPED,
COMSIG_MOVABLE_BUMP,
COMSIG_ATOM_INTERCEPT_Z_FALL,
)
UnregisterSignal(parent, signals_to_remove)
/datum/component/supermatter_crystal/proc/blob_hit(datum/source, obj/structure/blob/blob)
SIGNAL_HANDLER
var/atom/atom_source = source
if(!blob || isspaceturf(atom_source)) //does nothing in space
return
playsound(get_turf(atom_source), 'sound/effects/supermatter.ogg', 50, TRUE)
consume_returns(damage_increase = blob.get_integrity() * 0.5)
if(blob.get_integrity() > 100)
blob.visible_message(span_danger("\The [blob] strikes at \the [atom_source] and flinches away!"),
span_hear("You hear a loud crack as you are washed with a wave of heat."))
blob.take_damage(100, BURN)
else
blob.visible_message(span_danger("\The [blob] strikes at \the [atom_source] and rapidly flashes to ash."),
span_hear("You hear a loud crack as you are washed with a wave of heat."))
consume(atom_source, blob)
/datum/component/supermatter_crystal/proc/paw_hit(datum/source, mob/user, list/modifiers)
SIGNAL_HANDLER
if(isalien(user))
dust_mob(source, user, cause = "alien attack")
return
dust_mob(source, user, cause = "monkey attack")
/datum/component/supermatter_crystal/proc/animal_hit(datum/source, mob/living/simple_animal/user, list/modifiers)
SIGNAL_HANDLER
var/atom/atom_source = source
var/murder
if(!user.melee_damage_upper && !user.melee_damage_lower)
murder = user.friendly_verb_continuous
else
murder = user.attack_verb_continuous
dust_mob(source, user, \
span_danger("[user] unwisely [murder] [atom_source], and [user.p_their()] body burns brilliantly before flashing into ash!"), \
span_userdanger("You unwisely touch [atom_source], and your vision glows brightly as your body crumbles to dust. Oops."), \
"simple animal attack")
/datum/component/supermatter_crystal/proc/hulk_hit(datum/source, mob/user)
SIGNAL_HANDLER
dust_mob(source, user, cause = "hulk attack")
/datum/component/supermatter_crystal/proc/unarmed_hit(datum/source, mob/user, list/modifiers)
SIGNAL_HANDLER
var/atom/atom_source = source
if(iscyborg(user) && atom_source.Adjacent(user))
dust_mob(source, user, cause = "cyborg attack")
return
if(isaicamera(user))
return
if(islarva(user))
dust_mob(source, user, cause = "larva attack")
return
/datum/component/supermatter_crystal/proc/hand_hit(datum/source, mob/living/user, list/modifiers)
SIGNAL_HANDLER
var/atom/atom_source = source
if(user.incorporeal_move || user.status_flags & GODMODE)
return
if(user.zone_selected != BODY_ZONE_PRECISE_MOUTH)
dust_mob(source, user, cause = "hand")
return
if(!user.is_mouth_covered())
if(user.combat_mode)
dust_mob(source, user,
span_danger("As [user] tries to take a bite out of [atom_source] everything goes silent before [user.p_their()] body starts to glow and burst into flames before flashing to ash."),
span_userdanger("You try to take a bite out of [atom_source], but find [p_them()] far too hard to get anywhere before everything starts burning and your ears fill with ringing!"),
"attempted bite"
)
return
var/obj/item/organ/tongue/licking_tongue = user.getorganslot(ORGAN_SLOT_TONGUE)
if(licking_tongue)
dust_mob(source, user,
span_danger("As [user] hesitantly leans in and licks [atom_source] everything goes silent before [user.p_their()] body starts to glow and burst into flames before flashing to ash!"),
span_userdanger("You tentatively lick [atom_source], but you can't figure out what it tastes like before everything starts burning and your ears fill with ringing!"),
"attempted lick"
)
return
var/obj/item/bodypart/head/forehead = user.get_bodypart(BODY_ZONE_HEAD)
if(forehead)
dust_mob(source, user,
span_danger("As [user]'s forehead bumps into [atom_source], inducing a resonance... Everything goes silent before [user.p_their()] [forehead] flashes to ash!"),
span_userdanger("You feel your forehead bump into [atom_source] and everything suddenly goes silent. As your head fills with ringing you come to realize that that was not a wise decision."),
"failed lick"
)
return
dust_mob(source, user,
span_danger("[user] leans in and tries to lick [atom_source], inducing a resonance... [user.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("You lean in and try to lick [atom_source]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\""),
"failed lick"
)
/datum/component/supermatter_crystal/proc/attackby_hit(datum/source, obj/item/item, mob/living/user, params)
SIGNAL_HANDLER
var/atom/atom_source = source
if(!istype(item) || (item.item_flags & ABSTRACT) || !istype(user))
return
if(istype(item, /obj/item/melee/roastingstick))
return FALSE
if(istype(item, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/cig = item
var/clumsy = HAS_TRAIT(user, TRAIT_CLUMSY)
if(clumsy)
var/which_hand = BODY_ZONE_L_ARM
if(!(user.active_hand_index % 2))
which_hand = BODY_ZONE_R_ARM
var/obj/item/bodypart/dust_arm = user.get_bodypart(which_hand)
dust_arm.dismember()
user.visible_message(span_danger("The [item] flashes out of existence on contact with \the [atom_source], resonating with a horrible sound..."),\
span_danger("Oops! The [item] flashes out of existence on contact with \the [atom_source], taking your arm with it! That was clumsy of you!"))
playsound(atom_source, 'sound/effects/supermatter.ogg', 150, TRUE)
consume(atom_source, dust_arm)
qdel(item)
return
if(cig.lit || user.combat_mode)
user.visible_message(span_danger("A hideous sound echoes as [item] is ashed out on contact with \the [atom_source]. That didn't seem like a good idea..."))
playsound(atom_source, 'sound/effects/supermatter.ogg', 150, TRUE)
consume(atom_source, item)
radiation_pulse(atom_source, max_range = 3, threshold = 0.1, chance = 50)
return
else
cig.light()
user.visible_message(span_danger("As [user] lights \their [item] on \the [atom_source], silence fills the room..."),\
span_danger("Time seems to slow to a crawl as you touch \the [atom_source] with \the [item].</span>\n<span class='notice'>\The [item] flashes alight with an eerie energy as you nonchalantly lift your hand away from \the [atom_source]. Damn."))
playsound(atom_source, 'sound/effects/supermatter.ogg', 50, TRUE)
radiation_pulse(atom_source, max_range = 1, threshold = 0, chance = 100)
return
if(user.dropItemToGround(item))
user.visible_message(span_danger("As [user] touches \the [atom_source] with \a [item], silence fills the room..."),\
span_userdanger("You touch \the [atom_source] with \the [item], and everything suddenly goes silent.</span>\n<span class='notice'>\The [item] flashes into dust as you flinch away from \the [atom_source]."),\
span_hear("Everything suddenly goes silent."))
user.investigate_log("has been attacked ([item]) by [key_name(user)]", INVESTIGATE_ENGINE)
consume(atom_source, item)
playsound(get_turf(atom_source), 'sound/effects/supermatter.ogg', 50, TRUE)
radiation_pulse(atom_source, max_range = 3, threshold = 0.1, chance = 50)
return
if(atom_source.Adjacent(user)) //if the item is stuck to the person, kill the person too instead of eating just the item.
var/vis_msg = span_danger("[user] reaches out and touches [atom_source] with [item], inducing a resonance... [item] starts to glow briefly before the light continues up to [user]'s body. [user.p_they(TRUE)] bursts into flames before flashing into dust!")
var/mob_msg = span_userdanger("You reach out and touch [atom_source] with [item]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"")
dust_mob(source, user, vis_msg, mob_msg)
/datum/component/supermatter_crystal/proc/tool_hit(datum/source, mob/user, obj/item/tool)
SIGNAL_HANDLER
if(tool_act_callback)
tool_act_callback.Invoke(user, tool)
return
attackby_hit(source, tool, user)
/datum/component/supermatter_crystal/proc/bumped_hit(datum/source, atom/movable/hit_object)
SIGNAL_HANDLER
var/atom/atom_source = source
if(isliving(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] slams into \the [atom_source] inducing a resonance... [hit_object.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("You slam into \the [atom_source] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),
span_hear("You hear an unearthly noise as a wave of heat washes over you."))
else if(isobj(hit_object) && !iseffect(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] smacks into \the [atom_source] and rapidly flashes to ash."), null,
span_hear("You hear a loud crack as you are washed with a wave of heat."))
else
return
playsound(get_turf(atom_source), 'sound/effects/supermatter.ogg', 50, TRUE)
consume(atom_source, hit_object)
/datum/component/supermatter_crystal/proc/bump_hit(datum/source, atom/bumped_atom)
SIGNAL_HANDLER
var/atom/atom_source = source
if(isturf(bumped_atom))
var/turf/bumped_turf = bumped_atom
var/bumped_name = "\the [bumped_atom]"
var/bumped_text = span_danger("\The [atom_source] smacks into [bumped_name] and [bumped_atom.p_they()] rapidly flashes to ash!")
if(!bumped_turf.Melt())
return
atom_source.visible_message(
bumped_text,
null,
span_hear("You hear a loud crack as you are washed with a wave of heat.")
)
playsound(atom_source, 'sound/effects/supermatter.ogg', 50, TRUE)
var/suspicion = null
if (atom_source.fingerprintslast)
suspicion = "- and was last touched by [atom_source.fingerprintslast]"
message_admins("\The [atom_source] has consumed [bumped_name][suspicion].")
atom_source.investigate_log("has consumed [bumped_name][suspicion].")
radiation_pulse(atom_source, max_range = 6, threshold = 0.2, chance = 50)
return
if(isliving(bumped_atom))
atom_source.visible_message(
span_danger("\The [atom_source] slams into \the [bumped_atom] inducing a resonance... [bumped_atom.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("\The [atom_source] slams into you as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),
span_hear("You hear an unearthly noise as a wave of heat washes over you.")
)
else if(isobj(bumped_atom) && !iseffect(bumped_atom))
atom_source.visible_message(
span_danger("\The [atom_source] smacks into \the [bumped_atom] and [bumped_atom.p_they()] rapidly flashes to ash."),
null,
span_hear("You hear a loud crack as you are washed with a wave of heat.")
)
else
return
playsound(atom_source, 'sound/effects/supermatter.ogg', 50, TRUE)
consume(atom_source, bumped_atom)
/datum/component/supermatter_crystal/proc/intercept_z_fall(datum/source, list/falling_movables, levels)
SIGNAL_HANDLER
for(var/atom/movable/hit_object as anything in falling_movables)
bumped_hit(hit_object)
/datum/component/supermatter_crystal/proc/dust_mob(datum/source, mob/living/nom, vis_msg, mob_msg, cause)
var/atom/atom_source = source
if(nom.incorporeal_move || nom.status_flags & GODMODE) //try to keep supermatter sliver's + hemostat's dust conditions in sync with this too
return
if(!vis_msg)
vis_msg = span_danger("[nom] reaches out and touches [atom_source], inducing a resonance... [nom.p_their()] body starts to glow and burst into flames before flashing into dust!")
if(!mob_msg)
mob_msg = span_userdanger("You reach out and touch [atom_source]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"")
if(!cause)
cause = "contact"
nom.visible_message(vis_msg, mob_msg, span_hear("You hear an unearthly noise as a wave of heat washes over you."))
atom_source.investigate_log("has been attacked ([cause]) by [key_name(nom)]", INVESTIGATE_ENGINE)
add_memory_in_range(atom_source, 7, MEMORY_SUPERMATTER_DUSTED, list(DETAIL_PROTAGONIST = nom, DETAIL_WHAT_BY = atom_source), story_value = STORY_VALUE_OKAY, memory_flags = MEMORY_CHECK_BLIND_AND_DEAF)
playsound(get_turf(atom_source), 'sound/effects/supermatter.ogg', 50, TRUE)
consume(atom_source, nom)
/datum/component/supermatter_crystal/proc/consume(atom/source, atom/movable/consumed_object)
var/atom/atom_source = source
var/object_size = 0
var/matter_increase = 0
var/damage_increase = 0
if(isliving(consumed_object))
var/mob/living/consumed_mob = consumed_object
object_size = consumed_mob.mob_size + 2
if(consumed_mob.status_flags & GODMODE)
return
message_admins("[atom_source] has consumed [key_name_admin(consumed_mob)] [ADMIN_JMP(atom_source)].")
atom_source.investigate_log("has consumed [key_name(consumed_mob)].", INVESTIGATE_ENGINE)
consumed_mob.dust(force = TRUE)
matter_increase += 100 * object_size
if(is_clown_job(consumed_mob.mind?.assigned_role))
damage_increase += rand(-300, 300) // HONK
consume_returns(matter_increase, damage_increase)
else if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1)
return
else if(isobj(consumed_object))
if(!iseffect(consumed_object))
var/suspicion = ""
if(consumed_object.fingerprintslast)
suspicion = "last touched by [consumed_object.fingerprintslast]"
message_admins("[atom_source] has consumed [consumed_object], [suspicion] [ADMIN_JMP(atom_source)].")
atom_source.investigate_log("has consumed [consumed_object] - [suspicion].", INVESTIGATE_ENGINE)
qdel(consumed_object)
if(!iseffect(consumed_object) && isitem(consumed_object))
var/obj/item/consumed_item = consumed_object
object_size = consumed_item.w_class
matter_increase += 70 * object_size
//Some poor sod got eaten, go ahead and irradiate people nearby.
radiation_pulse(atom_source, max_range = 6, threshold = 1.2 / max(object_size, 1), chance = 10 * object_size)
for(var/mob/living/near_mob in range(10))
atom_source.investigate_log("has irradiated [key_name(near_mob)] after consuming [consumed_object].", INVESTIGATE_ENGINE)
if (HAS_TRAIT(near_mob, TRAIT_RADIMMUNE) || issilicon(near_mob))
continue
if(ishuman(near_mob) && SSradiation.wearing_rad_protected_clothing(near_mob))
continue
if(near_mob in view())
near_mob.show_message(span_danger("As \the [atom_source] slowly stops resonating, you find your skin covered in new radiation burns."), MSG_VISUAL,
span_danger("The unearthly ringing subsides and you find your skin covered in new radiation burns."), MSG_AUDIBLE)
else
near_mob.show_message(span_hear("An unearthly ringing fills your ears, and you find your skin covered in new radiation burns."), MSG_AUDIBLE)
consume_returns(matter_increase, damage_increase)
/datum/component/supermatter_crystal/proc/consume_returns(matter_increase = 0, damage_increase = 0)
if(consume_callback)
consume_callback.Invoke(matter_increase, damage_increase)
@@ -0,0 +1,11 @@
/obj/item/destabilizing_crystal
name = "destabilizing crystal"
desc = "A crystal that can be used to destabilize the supermatter to cause a resonance cascade. Apply on fully stable supermatter and start the delamination. Prevent anyone from stopping you."
icon = 'icons/obj/supermatter.dmi'
icon_state = "destabilizing_crystal"
w_class = WEIGHT_CLASS_NORMAL
flags_1 = CONDUCT_1
item_flags = NO_PIXEL_RANDOM_DROP
throwforce = 5
throw_speed = 1
throw_range = 2
+2 -2
View File
@@ -252,7 +252,7 @@
/obj/item/melee/supermatter_sword/proc/consume_everything(target)
if(isnull(target))
shard.Consume()
shard.Bump(target)
else if(!isturf(target))
shard.Bumped(target)
else
@@ -268,7 +268,7 @@
span_danger("[turf] smacks into [src] and rapidly flashes to ash."),
span_hear("You hear a loud crack as you are washed with a wave of heat."),
)
shard.Consume()
shard.Bump(turf)
/obj/item/melee/supermatter_sword/add_blood_DNA(list/blood_dna)
return FALSE
@@ -0,0 +1,44 @@
/datum/traitor_objective/final/end_reality
name = "end reality as we know it by causing a crystallizing resonance cascade"
description = "End this known reality by causing a supermatter cascade. Go to %AREA% to retrieve the destabilizing crystal \
and use it on the SM."
///area type the objective owner must be in to recieve the destabilizing crystal
var/area/dest_crystal_area_pickup
///checker on whether we have sent the crystal yet.
var/sent_crystal = FALSE
/datum/traitor_objective/final/end_reality/generate_objective(datum/mind/generating_for, list/possible_duplicates)
if(!can_take_final_objective())
return
var/list/possible_areas = GLOB.the_station_areas.Copy()
for(var/area/possible_area as anything in possible_areas)
//remove areas too close to the destination, too obvious for our poor shmuck, or just unfair
if(istype(possible_area, /area/station/hallway) || istype(possible_area, /area/station/security))
possible_areas -= possible_area
dest_crystal_area_pickup = pick(possible_areas)
replace_in_name("%AREA%", initial(dest_crystal_area_pickup.name))
return TRUE
/datum/traitor_objective/final/end_reality/generate_ui_buttons(mob/user)
var/list/buttons = list()
if(!sent_crystal)
buttons += add_ui_button("", "Pressing this will call down a pod with the universe ending kit.", "biohazard", "destabilizing_crystal")
return buttons
/datum/traitor_objective/final/end_reality/ui_perform_action(mob/living/user, action)
. = ..()
switch(action)
if("destabilizing_crystal")
if(sent_crystal)
return
var/area/delivery_area = get_area(user)
if(delivery_area.type != dest_crystal_area_pickup)
to_chat(user, span_warning("You must be in [initial(dest_crystal_area_pickup.name)] to recieve the bioterror agent."))
return
sent_crystal = TRUE
podspawn(list(
"target" = get_turf(user),
"style" = STYLE_SYNDICATE,
"spawn" = /obj/item/destabilizing_crystal,
))
@@ -4,6 +4,7 @@
/datum/traitor_objective/final/romerol = 1,
/datum/traitor_objective/final/battlecruiser = 1,
/datum/traitor_objective/final/space_dragon = 1,
/datum/traitor_objective/final/end_reality = 1,
)
weight = 100
+57 -2
View File
@@ -83,7 +83,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/datum/gas/healium,
/datum/gas/proto_nitrate,
/datum/gas/zauker,
/datum/gas/miasma
/datum/gas/miasma,
/datum/gas/hypernoblium,
/datum/gas/antinoblium,
)
///The list of gases mapped against their current comp. We use this to calculate different values the supermatter uses, like power or heat resistance. It doesn't perfectly match the air around the sm, instead moving up at a rate determined by gas_change_rate per call. Ranges from 0 to 1
var/list/gas_comp = list(
@@ -101,6 +103,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/datum/gas/healium = 0,
/datum/gas/proto_nitrate = 0,
/datum/gas/zauker = 0,
/datum/gas/hypernoblium = 0,
/datum/gas/antinoblium = 0,
)
///The list of gases mapped against their transmit values. We use it to determine the effect different gases have on the zaps
var/list/gas_trans = list(
@@ -130,6 +134,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/datum/gas/healium = HEALIUM_HEAT_PENALTY,
/datum/gas/proto_nitrate = PROTO_NITRATE_HEAT_PENALTY,
/datum/gas/zauker = ZAUKER_HEAT_PENALTY,
/datum/gas/hypernoblium = HYPERNOBLIUM_HEAT_PENALTY,
/datum/gas/antinoblium = ANTINOBLIUM_HEAT_PENALTY,
)
///The list of gases mapped against their heat resistance. We use it to moderate heat damage.
var/list/gas_resist = list(
@@ -250,6 +256,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/freonbonus = 0
///Can the crystal trigger the station wide anomaly spawn?
var/anomaly_event = TRUE
///If an admin wants a sure cascade with the delamination just set this to true (don't be a badmin)
var/admin_cascade = FALSE
///Do we have a destabilizing crystal attached?
var/has_destabilizing_crystal = FALSE
///Has the cascade been triggered?
var/cascade_initiated = FALSE
///Reference to the warp effect
var/atom/movable/supermatter_warp_effect/warp
/obj/machinery/power/supermatter_crystal/Initialize(mapload)
. = ..()
@@ -274,6 +288,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
)
AddElement(/datum/element/connect_loc, loc_connections) //Speficially for the tram, hacky
AddComponent(/datum/component/supermatter_crystal, CALLBACK(src, .proc/wrench_act_callback), CALLBACK(src, .proc/consume_callback))
soundloop = new(src, TRUE)
if(ispath(psyOverlay))
psyOverlay = new psyOverlay()
@@ -287,6 +303,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
update_constants()
/obj/machinery/power/supermatter_crystal/Destroy()
if(warp)
vis_contents -= warp
warp = null
investigate_log("has been destroyed.", INVESTIGATE_ENGINE)
SSair.stop_processing_machine(src)
QDEL_NULL(radio)
@@ -437,7 +456,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/machinery/power/supermatter_crystal/proc/delamination_event()
var/can_spawn_anomalies = is_station_level(loc.z) && is_main_engine && anomaly_event
new /datum/supermatter_delamination(power, combined_gas, get_turf(src), explosion_power, gasmix_power_ratio, can_spawn_anomalies)
var/is_cascading = check_cascade_requirements(anomaly_event)
new /datum/supermatter_delamination(power, combined_gas, get_turf(src), explosion_power, gasmix_power_ratio, can_spawn_anomalies, is_cascading)
qdel(src)
//this is here to eat arguments
@@ -445,6 +467,31 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
SIGNAL_HANDLER
delamination_event()
/**
* Checks if the supermatter is in a state where it can cascade
*
* Arguments: can_trigger = TRUE if the supermatter can trigger the cascade
* Returns: TRUE if the supermatter can cascade
*/
/obj/machinery/power/supermatter_crystal/proc/check_cascade_requirements(can_trigger)
if(get_integrity_percent() < SUPERMATTER_CASCADE_PERCENT && !cascade_initiated && !admin_cascade && can_trigger)
return FALSE
var/supermatter_cascade = can_trigger
var/list/required_gases = list(/datum/gas/hypernoblium, /datum/gas/antinoblium)
for(var/gas_path in required_gases)
if(has_destabilizing_crystal)
break // We have a destabilizing crystal, we're good
if(gas_comp[gas_path] < 0.4 || combined_gas < MOLE_PENALTY_THRESHOLD)
supermatter_cascade = FALSE
break
if(admin_cascade)
supermatter_cascade = TRUE
return supermatter_cascade
/obj/machinery/power/supermatter_crystal/proc/supermatter_pull(turf/center, pull_range = 3)
playsound(center, 'sound/weapons/marauder.ogg', 100, TRUE, extrarange = pull_range - world.view)
for(var/atom/movable/movable_atom in orange(pull_range,center))
@@ -663,6 +710,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/overlay/psy/shard
icon_state = "psy_shard"
/atom/movable/supermatter_warp_effect
plane = GRAVITY_PULSE_PLANE
appearance_flags = PIXEL_SCALE // no tile bound so you can see it around corners and so
icon = 'icons/effects/light_overlays/light_352.dmi'
icon_state = "light"
pixel_x = -176
pixel_y = -176
#undef BIKE
#undef COIL
#undef ROD
@@ -0,0 +1,125 @@
/turf/closed/indestructible/supermatter_wall
name = "wall"
desc = "Effectively impervious any methods of destruction."
icon = 'icons/turf/walls.dmi'
icon_state = "crystal_cascade_1"
layer = AREA_LAYER
plane = ABOVE_LIGHTING_PLANE
opacity = FALSE
light_power = 1
light_range = 7
light_color = COLOR_VIVID_YELLOW
///All dirs we can expand to
var/list/available_dirs = list(NORTH,SOUTH,EAST,WEST,UP,DOWN)
///Cooldown on the expansion process
COOLDOWN_DECLARE(sm_wall_cooldown)
/turf/closed/indestructible/supermatter_wall/Initialize(mapload)
. = ..()
icon_state = "crystal_cascade_[rand(1,6)]"
START_PROCESSING(SSmachines, src)
AddComponent(/datum/component/supermatter_crystal, null, null)
playsound(src, 'sound/misc/cracking_crystal.ogg', 20, TRUE)
/turf/closed/indestructible/supermatter_wall/process()
if(!COOLDOWN_FINISHED(src, sm_wall_cooldown))
return
if(!available_dirs || available_dirs.len <= 0)
light_range = 0
return PROCESS_KILL
COOLDOWN_START(src, sm_wall_cooldown, rand(0, 5 SECONDS))
var/picked_dir = pick_n_take(available_dirs)
var/turf/next_turf = get_step_multiz(src, picked_dir)
if(!istype(next_turf) || istype(next_turf, /turf/closed/indestructible/supermatter_wall))
return
icon_state = "crystal_cascade_[rand(1,6)]"
for(var/atom/movable/checked_atom as anything in next_turf)
if(isliving(checked_atom))
qdel(checked_atom)
else if(ismob(checked_atom)) // Observers, AI cameras.
continue
else if(istype(checked_atom, /obj/cascade_portal))
continue
else
qdel(checked_atom)
next_turf.ChangeTurf(type)
var/turf/closed/indestructible/supermatter_wall/sm_wall = next_turf
if(sm_wall.available_dirs)
sm_wall.available_dirs -= get_dir(next_turf, src)
/turf/closed/indestructible/supermatter_wall/bullet_act(obj/projectile/projectile)
visible_message(span_notice("[src] is unscathed!"))
return BULLET_ACT_HIT
/turf/closed/indestructible/supermatter_wall/singularity_act()
return
/turf/closed/indestructible/supermatter_wall/attack_tk(mob/user)
if(!iscarbon(user))
return
var/mob/living/carbon/jedi = user
to_chat(jedi, span_userdanger("That was a really dense idea."))
jedi.ghostize()
var/obj/item/organ/brain/rip_u = locate(/obj/item/organ/brain) in jedi.internal_organs
if(rip_u)
rip_u.Remove(jedi)
qdel(rip_u)
return COMPONENT_CANCEL_ATTACK_CHAIN
/obj/cascade_portal
name = "Bluespace Rift"
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
icon = 'icons/effects/224x224.dmi'
icon_state = "reality"
anchored = TRUE
appearance_flags = LONG_GLIDE
density = TRUE
plane = MASSIVE_OBJ_PLANE
light_color = COLOR_RED
light_power = 0.7
light_range = 15
move_resist = INFINITY
pixel_x = -96
pixel_y = -96
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
/obj/cascade_portal/Bumped(atom/movable/hit_object)
if(isliving(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] slams into \the [src] inducing a resonance... [hit_object.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),
span_hear("You hear an unearthly noise as a wave of heat washes over you."))
else if(isobj(hit_object) && !iseffect(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] smacks into \the [src] and rapidly flashes to ash."), null,
span_hear("You hear a loud crack as you are washed with a wave of heat."))
else
return
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
consume(hit_object)
/**
* Proc to consume the objects colliding with the portal
*
* Arguments: atom/movable/consumed_object is the object hitting the portal
*/
/obj/cascade_portal/proc/consume(atom/movable/consumed_object)
if(isliving(consumed_object))
var/mob/living/consumed_mob = consumed_object
if(consumed_mob.status_flags & GODMODE)
return
message_admins("[src] has consumed [key_name_admin(consumed_mob)] [ADMIN_JMP(src)].")
investigate_log("has consumed [key_name(consumed_mob)].", INVESTIGATE_ENGINE)
consumed_mob.dust(force = TRUE)
else if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1)
return
else if(isobj(consumed_object))
qdel(consumed_object)
@@ -13,8 +13,12 @@
var/supermatter_explosion_power = 0
///Amount the gasmix will affect the explosion size
var/supermatter_gasmix_power_ratio = 0
///Are we triggering an universal endgame?
var/supermatter_cascade = FALSE
///The rift in space that will be created by the cascade
var/obj/cascade_portal/cascade_rift
/datum/supermatter_delamination/New(supermatter_power, supermatter_gas_amount, turf/supermatter_turf, supermatter_explosion_power, supermatter_gasmix_power_ratio, can_spawn_anomalies)
/datum/supermatter_delamination/New(supermatter_power, supermatter_gas_amount, turf/supermatter_turf, supermatter_explosion_power, supermatter_gasmix_power_ratio, can_spawn_anomalies, supermatter_cascade)
. = ..()
src.supermatter_power = supermatter_power
@@ -23,6 +27,10 @@
src.supermatter_explosion_power = supermatter_explosion_power
src.supermatter_gasmix_power_ratio = supermatter_gasmix_power_ratio
if(supermatter_cascade)
start_universe_ending_cascade()
return
setup_mob_interaction()
setup_delamination_type()
@@ -32,6 +40,9 @@
setup_anomalies()
/**
* What the mobs should deal with when a delamination happens
*/
/datum/supermatter_delamination/proc/setup_mob_interaction()
for(var/mob/living/victim as anything in GLOB.alive_mob_list)
if(!istype(victim) || victim.z != supermatter_turf.z)
@@ -59,6 +70,9 @@
to_chat(victim, span_boldannounce("You feel reality distort for a moment..."))
SEND_SIGNAL(victim, COMSIG_ADD_MOOD_EVENT, "delam", /datum/mood_event/delam)
/**
* Setup for the types of possible delaminations and their effects (singulo, tesla or normal)
*/
/datum/supermatter_delamination/proc/setup_delamination_type()
if(supermatter_gas_amount > MOLE_PENALTY_THRESHOLD)
call_singulo()
@@ -69,6 +83,9 @@
call_explosion()
/**
* Spawns the singularity
*/
/datum/supermatter_delamination/proc/call_singulo()
if(!supermatter_turf) //If something fucks up we blow anyhow. This fix is 4 years old and none ever said why it's here. help.
call_explosion()
@@ -78,6 +95,9 @@
created_singularity.consume(src)
should_spawn_anomalies = FALSE
/**
* Spawns the tesla
*/
/datum/supermatter_delamination/proc/call_tesla()
if(supermatter_turf)
var/obj/energy_ball/created_tesla = new(supermatter_turf)
@@ -85,6 +105,9 @@
call_explosion()
should_spawn_anomalies = FALSE
/**
* Spawns the explosion
*/
/datum/supermatter_delamination/proc/call_explosion()
//Dear mappers, balance the sm max explosion radius to 17.5, 37, 39, 41
explosion(origin = supermatter_turf,
@@ -96,10 +119,16 @@
ignorecap = TRUE
)
/**
* Setups how many anomalies to spawn
*/
/datum/supermatter_delamination/proc/setup_anomalies()
anomalies_to_spawn = max(round(0.004 * supermatter_power, 1) + rand(-2, 2), 1)
spawn_anomalies()
/**
* Spawns the first half anomalies instantly and calls the second half
*/
/datum/supermatter_delamination/proc/spawn_anomalies()
var/list/anomaly_types = list(GRAVITATIONAL_ANOMALY = 55, HALLUCINATION_ANOMALY = 45, FLUX_ANOMALY = 35, PYRO_ANOMALY = 5, VORTEX_ANOMALY = 1)
var/list/anomaly_places = GLOB.generic_event_spawns
@@ -112,6 +141,9 @@
spawn_overtime()
/**
* Spawns the second half anomalies after a delay
*/
/datum/supermatter_delamination/proc/spawn_overtime()
var/list/anomaly_types = list(GRAVITATIONAL_ANOMALY = 55, HALLUCINATION_ANOMALY = 45, FLUX_ANOMALY = 35, PYRO_ANOMALY = 5, VORTEX_ANOMALY = 1)
@@ -128,5 +160,70 @@
addtimer(CALLBACK(src, .proc/spawn_anomaly, anomaly_location, anomaly_to_spawn), current_spawn + extended_spawn)
current_spawn += next_spawn
/**
* Callback for the anomalies to spawn after some time
*/
/datum/supermatter_delamination/proc/spawn_anomaly(location, type)
supermatter_anomaly_gen(location, type, has_changed_lifespan = FALSE)
/**
* Setup for the cascade delamination
*/
/datum/supermatter_delamination/proc/start_universe_ending_cascade()
SSshuttle.registerHostileEnvironment(src)
SSshuttle.universal_cascade = TRUE
SSair.can_fire = FALSE
call_explosion()
pick_rift_location()
warn_crew()
supermatter_turf.ChangeTurf(/turf/closed/indestructible/supermatter_wall)
for(var/i in 1 to rand(1,3))
var/turf/crystal_cascade_location = get_turf(pick(GLOB.generic_event_spawns))
crystal_cascade_location.ChangeTurf(/turf/closed/indestructible/supermatter_wall)
/**
* Picks a random location for the rift
*/
/datum/supermatter_delamination/proc/pick_rift_location()
var/turf/rift_location = get_turf(pick(GLOB.generic_event_spawns))
cascade_rift = new /obj/cascade_portal(rift_location)
/**
* Warns the crew about the cascade start and the rift location
*/
/datum/supermatter_delamination/proc/warn_crew()
for(var/mob/player as anything in GLOB.alive_player_list)
to_chat(player, span_boldannounce("You feel a strange presence in the air around you. You feel unsafe."))
priority_announce("Unknown harmonance affecting universal substructure, all nearby matter is starting to crystallize.", "The universe is collapsing.", 'sound/misc/bloblarm.ogg')
priority_announce("There's been a universe-wide electromagnetic pulse. All of our systems are heavily damaged and many personnel are dead or dying. \
We are seeing increasing indications of the universe itself beginning to unravel. \
[station_name()], you are the only facility nearby a bluespace rift of unkown origin, which is near the [get_area_name(cascade_rift)]. \
You are hereby directed to enter the rift using all means necessary, quite possibly as the last humans alive. \
Five minutes before the universe collapses. Good l\[\[###!!!-")
addtimer(CALLBACK(src, .proc/delta), 10 SECONDS)
addtimer(CALLBACK(src, .proc/last_message), 4 MINUTES)
addtimer(CALLBACK(src, .proc/the_end), 5 MINUTES)
/**
* Increases the security level to the highest level
*/
/datum/supermatter_delamination/proc/delta()
set_security_level("delta")
sound_to_playing_players('sound/misc/notice1.ogg')
/**
* Announces the last message to the station
*/
/datum/supermatter_delamination/proc/last_message()
priority_announce("To the remaining humans alive, I hope it was worth it.", " ", 'sound/misc/bloop.ogg')
/**
* Ends the round
*/
/datum/supermatter_delamination/proc/the_end()
SSticker.news_report = SUPERMATTER_CASCADE
SSticker.force_ending = 1
@@ -56,20 +56,6 @@
qdel(src)
return gain
/obj/machinery/power/supermatter_crystal/blob_act(obj/structure/blob/blob)
if(!blob || isspaceturf(loc)) //does nothing in space
return
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
damage += blob.get_integrity() * 0.5 //take damage equal to 50% of remaining blob health before it tried to eat us
if(blob.get_integrity() > 100)
blob.visible_message(span_danger("\The [blob] strikes at \the [src] and flinches away!"),
span_hear("You hear a loud crack as you are washed with a wave of heat."))
blob.take_damage(100, BURN)
else
blob.visible_message(span_danger("\The [blob] strikes at \the [src] and rapidly flashes to ash."),
span_hear("You hear a loud crack as you are washed with a wave of heat."))
Consume(blob)
/obj/machinery/power/supermatter_crystal/attack_tk(mob/user)
if(!iscarbon(user))
return
@@ -82,271 +68,57 @@
qdel(rip_u)
return COMPONENT_CANCEL_ATTACK_CHAIN
/obj/machinery/power/supermatter_crystal/attack_paw(mob/user, list/modifiers)
dust_mob(user, cause = "monkey attack")
/obj/machinery/power/supermatter_crystal/attack_alien(mob/user, list/modifiers)
dust_mob(user, cause = "alien attack")
/obj/machinery/power/supermatter_crystal/attack_animal(mob/living/simple_animal/user, list/modifiers)
var/murder
if(!user.melee_damage_upper && !user.melee_damage_lower)
murder = user.friendly_verb_continuous
else
murder = user.attack_verb_continuous
dust_mob(user, \
span_danger("[user] unwisely [murder] [src], and [user.p_their()] body burns brilliantly before flashing into ash!"), \
span_userdanger("You unwisely touch [src], and your vision glows brightly as your body crumbles to dust. Oops."), \
"simple animal attack")
/obj/machinery/power/supermatter_crystal/attack_robot(mob/user)
if(Adjacent(user))
dust_mob(user, cause = "cyborg attack")
/obj/machinery/power/supermatter_crystal/attack_ai(mob/user)
return
/obj/machinery/power/supermatter_crystal/attack_hulk(mob/user)
dust_mob(user, cause = "hulk attack")
/obj/machinery/power/supermatter_crystal/attack_larva(mob/user)
dust_mob(user, cause = "larva attack")
/obj/machinery/power/supermatter_crystal/attack_hand(mob/living/user, list/modifiers)
. = ..()
if(.)
return
if(user.incorporeal_move || user.status_flags & GODMODE)
return
. = TRUE
if(user.zone_selected != BODY_ZONE_PRECISE_MOUTH)
dust_mob(user, cause = "hand")
return
if(!user.is_mouth_covered())
if(user.combat_mode)
dust_mob(user,
span_danger("As [user] tries to take a bite out of [src] everything goes silent before [user.p_their()] body starts to glow and burst into flames before flashing to ash."),
span_userdanger("You try to take a bite out of [src], but find [p_them()] far too hard to get anywhere before everything starts burning and your ears fill with ringing!"),
"attempted bite"
)
return
var/obj/item/organ/tongue/licking_tongue = user.getorganslot(ORGAN_SLOT_TONGUE)
if(licking_tongue)
dust_mob(user,
span_danger("As [user] hesitantly leans in and licks [src] everything goes silent before [user.p_their()] body starts to glow and burst into flames before flashing to ash!"),
span_userdanger("You tentatively lick [src], but you can't figure out what it tastes like before everything starts burning and your ears fill with ringing!"),
"attempted lick"
)
return
var/obj/item/bodypart/head/forehead = user.get_bodypart(BODY_ZONE_HEAD)
if(forehead)
dust_mob(user,
span_danger("As [user]'s forehead bumps into [src], inducing a resonance... Everything goes silent before [user.p_their()] [forehead] flashes to ash!"),
span_userdanger("You feel your forehead bump into [src] and everything suddenly goes silent. As your head fills with ringing you come to realize that that was not a wise decision."),
"failed lick"
)
return
dust_mob(user,
span_danger("[user] leans in and tries to lick [src], inducing a resonance... [user.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("You lean in and try to lick [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\""),
"failed lick"
)
/obj/machinery/power/supermatter_crystal/proc/dust_mob(mob/living/nom, vis_msg, mob_msg, cause)
if(nom.incorporeal_move || nom.status_flags & GODMODE) //try to keep supermatter sliver's + hemostat's dust conditions in sync with this too
return
if(!vis_msg)
vis_msg = span_danger("[nom] reaches out and touches [src], inducing a resonance... [nom.p_their()] body starts to glow and burst into flames before flashing into dust!")
if(!mob_msg)
mob_msg = span_userdanger("You reach out and touch [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"")
if(!cause)
cause = "contact"
nom.visible_message(vis_msg, mob_msg, span_hear("You hear an unearthly noise as a wave of heat washes over you."))
investigate_log("has been attacked ([cause]) by [key_name(nom)]", INVESTIGATE_ENGINE)
add_memory_in_range(src, 7, MEMORY_SUPERMATTER_DUSTED, list(DETAIL_PROTAGONIST = nom, DETAIL_WHAT_BY = src), story_value = STORY_VALUE_OKAY, memory_flags = MEMORY_CHECK_BLIND_AND_DEAF)
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
Consume(nom)
/obj/machinery/power/supermatter_crystal/attackby(obj/item/item, mob/living/user, params)
if(!istype(item) || (item.item_flags & ABSTRACT) || !istype(user))
return
if(istype(item, /obj/item/melee/roastingstick))
return FALSE
if(istype(item, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/cig = item
var/clumsy = HAS_TRAIT(user, TRAIT_CLUMSY)
if(clumsy)
var/which_hand = BODY_ZONE_L_ARM
if(!(user.active_hand_index % 2))
which_hand = BODY_ZONE_R_ARM
var/obj/item/bodypart/dust_arm = user.get_bodypart(which_hand)
dust_arm.dismember()
user.visible_message(span_danger("The [item] flashes out of existence on contact with \the [src], resonating with a horrible sound..."),\
span_danger("Oops! The [item] flashes out of existence on contact with \the [src], taking your arm with it! That was clumsy of you!"))
playsound(src, 'sound/effects/supermatter.ogg', 150, TRUE)
Consume(dust_arm)
qdel(item)
return
if(cig.lit || user.combat_mode)
user.visible_message(span_danger("A hideous sound echoes as [item] is ashed out on contact with \the [src]. That didn't seem like a good idea..."))
playsound(src, 'sound/effects/supermatter.ogg', 150, TRUE)
Consume(item)
radiation_pulse(src, max_range = 3, threshold = 0.1, chance = 50)
return ..()
else
cig.light()
user.visible_message(span_danger("As [user] lights \their [item] on \the [src], silence fills the room..."),\
span_danger("Time seems to slow to a crawl as you touch \the [src] with \the [item].</span>\n<span class='notice'>\The [item] flashes alight with an eerie energy as you nonchalantly lift your hand away from \the [src]. Damn."))
playsound(src, 'sound/effects/supermatter.ogg', 50, TRUE)
radiation_pulse(src, max_range = 1, threshold = 0, chance = 100)
return
/obj/machinery/power/supermatter_crystal/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/scalpel/supermatter))
var/obj/item/scalpel/supermatter/scalpel = item
to_chat(user, span_notice("You carefully begin to scrape \the [src] with \the [item]..."))
if(item.use_tool(src, user, 60, volume=100))
if (scalpel.usesLeft)
to_chat(user, span_danger("You extract a sliver from \the [src]. \The [src] begins to react violently!"))
new /obj/item/nuke_core/supermatter_sliver(drop_location())
matter_power += 800
scalpel.usesLeft--
if (!scalpel.usesLeft)
to_chat(user, span_notice("A tiny piece of \the [item] falls off, rendering it useless!"))
else
to_chat(user, span_warning("You fail to extract a sliver from \The [src]! \the [item] isn't sharp enough anymore."))
else if(user.dropItemToGround(item))
user.visible_message(span_danger("As [user] touches \the [src] with \a [item], silence fills the room..."),\
span_userdanger("You touch \the [src] with \the [item], and everything suddenly goes silent.</span>\n<span class='notice'>\The [item] flashes into dust as you flinch away from \the [src]."),\
span_hear("Everything suddenly goes silent."))
investigate_log("has been attacked ([item]) by [key_name(user)]", INVESTIGATE_ENGINE)
Consume(item)
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
radiation_pulse(src, max_range = 3, threshold = 0.1, chance = 50)
else if(Adjacent(user)) //if the item is stuck to the person, kill the person too instead of eating just the item.
var/vis_msg = span_danger("[user] reaches out and touches [src] with [item], inducing a resonance... [item] starts to glow briefly before the light continues up to [user]'s body. [user.p_they(TRUE)] bursts into flames before flashing into dust!")
var/mob_msg = span_userdanger("You reach out and touch [src] with [item]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"")
dust_mob(user, vis_msg, mob_msg)
/obj/machinery/power/supermatter_crystal/wrench_act(mob/user, obj/item/tool)
. = ..()
if (moveable)
default_unfasten_wrench(user, tool)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/machinery/power/supermatter_crystal/Bumped(atom/movable/hit_object)
if(isliving(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] slams into \the [src] inducing a resonance... [hit_object.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),
span_hear("You hear an unearthly noise as a wave of heat washes over you."))
else if(isobj(hit_object) && !iseffect(hit_object))
hit_object.visible_message(span_danger("\The [hit_object] smacks into \the [src] and rapidly flashes to ash."), null,
span_hear("You hear a loud crack as you are washed with a wave of heat."))
else
return
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
Consume(hit_object)
/obj/machinery/power/supermatter_crystal/Bump(atom/bumped_atom)
. = ..()
if(isturf(bumped_atom))
var/turf/bumped_turf = bumped_atom
var/bumped_name = "\the [bumped_atom]"
var/bumped_text = span_danger("\The [src] smacks into [bumped_name] and [bumped_atom.p_they()] rapidly flashes to ash!")
if(!bumped_turf.Melt())
to_chat(user, span_notice("You carefully begin to scrape \the [src] with \the [scalpel]..."))
if(!scalpel.use_tool(src, user, 60, volume=100))
return
visible_message(
bumped_text,
null,
span_hear("You hear a loud crack as you are washed with a wave of heat.")
)
playsound(src, 'sound/effects/supermatter.ogg', 50, TRUE)
var/suspicion = null
if (fingerprintslast)
suspicion = "- and was last touched by [fingerprintslast]"
message_admins("\The [src] has consumed [bumped_name][suspicion].")
investigate_log("has consumed [bumped_name][suspicion].")
radiation_pulse(src, max_range = 6, threshold = 0.2, chance = 50)
return
if(isliving(bumped_atom))
visible_message(
span_danger("\The [src] slams into \the [bumped_atom] inducing a resonance... [bumped_atom.p_their()] body starts to glow and burst into flames before flashing into dust!"),
span_userdanger("\The [src] slams into you as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),
span_hear("You hear an unearthly noise as a wave of heat washes over you.")
)
else if(isobj(bumped_atom) && !iseffect(bumped_atom))
visible_message(
span_danger("\The [src] smacks into \the [bumped_atom] and [bumped_atom.p_they()] rapidly flashes to ash."),
null,
span_hear("You hear a loud crack as you are washed with a wave of heat.")
)
else
return
playsound(src, 'sound/effects/supermatter.ogg', 50, TRUE)
Consume(bumped_atom)
/obj/machinery/power/supermatter_crystal/intercept_zImpact(list/falling_movables, levels)
. = ..()
for(var/atom/movable/hit_object as anything in falling_movables)
Bumped(hit_object)
. |= FALL_STOP_INTERCEPTING | FALL_INTERCEPTED
/obj/machinery/power/supermatter_crystal/proc/Consume(atom/movable/consumed_object)
var/object_size
if(isliving(consumed_object))
var/mob/living/consumed_mob = consumed_object
object_size = consumed_mob.mob_size + 2
if(consumed_mob.status_flags & GODMODE)
return
message_admins("[src] has consumed [key_name_admin(consumed_mob)] [ADMIN_JMP(src)].")
investigate_log("has consumed [key_name(consumed_mob)].", INVESTIGATE_ENGINE)
consumed_mob.dust(force = TRUE)
if(power_changes)
matter_power += 100 * object_size
if(takes_damage && is_clown_job(consumed_mob.mind?.assigned_role))
damage += rand(-300, 300) // HONK
damage = max(damage, 0)
else if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1)
return
else if(isobj(consumed_object))
if(!iseffect(consumed_object))
var/suspicion = ""
if(consumed_object.fingerprintslast)
suspicion = "last touched by [consumed_object.fingerprintslast]"
message_admins("[src] has consumed [consumed_object], [suspicion] [ADMIN_JMP(src)].")
investigate_log("has consumed [consumed_object] - [suspicion].", INVESTIGATE_ENGINE)
qdel(consumed_object)
if(!iseffect(consumed_object) && isitem(consumed_object) && power_changes)
var/obj/item/consumed_item = consumed_object
object_size = consumed_item.w_class
matter_power += 70 * object_size
//Some poor sod got eaten, go ahead and irradiate people nearby.
radiation_pulse(src, max_range = 6, threshold = 1.2 / object_size, chance = 10 * object_size)
for(var/mob/living/near_mob in range(10))
investigate_log("has irradiated [key_name(near_mob)] after consuming [consumed_object].", INVESTIGATE_ENGINE)
if (HAS_TRAIT(near_mob, TRAIT_RADIMMUNE) || issilicon(near_mob))
continue
if(ishuman(near_mob) && SSradiation.wearing_rad_protected_clothing(near_mob))
continue
if(near_mob in view())
near_mob.show_message(span_danger("As \the [src] slowly stops resonating, you find your skin covered in new radiation burns."), MSG_VISUAL,
span_danger("The unearthly ringing subsides and you find your skin covered in new radiation burns."), MSG_AUDIBLE)
if (scalpel.usesLeft)
to_chat(user, span_danger("You extract a sliver from \the [src]. \The [src] begins to react violently!"))
new /obj/item/nuke_core/supermatter_sliver(src.drop_location())
matter_power += 800
scalpel.usesLeft--
if (!scalpel.usesLeft)
to_chat(user, span_notice("A tiny piece of \the [scalpel] falls off, rendering it useless!"))
else
near_mob.show_message(span_hear("An unearthly ringing fills your ears, and you find your skin covered in new radiation burns."), MSG_AUDIBLE)
to_chat(user, span_warning("You fail to extract a sliver from \The [src]! \the [scalpel] isn't sharp enough anymore."))
return
if(istype(item, /obj/item/destabilizing_crystal))
var/obj/item/destabilizing_crystal/destabilizing_crystal = item
if(!anomaly_event)
to_chat(user, span_warning("You can't use \the [destabilizing_crystal] on a Shard."))
return
if(get_integrity_percent() < SUPERMATTER_CASCADE_PERCENT)
to_chat(user, span_warning("You can only apply \the [destabilizing_crystal] to a Supermatter src that is at least [SUPERMATTER_CASCADE_PERCENT]% intact."))
return
to_chat(user, span_notice("You begin to attach \the [destabilizing_crystal] to \the [src]..."))
if(do_after(user, 3 SECONDS, src))
to_chat(user, span_notice("You attach \the [destabilizing_crystal] to \the [src]."))
has_destabilizing_crystal = TRUE
cascade_initiated = TRUE
damage += 100
matter_power += 500
qdel(destabilizing_crystal)
return
return ..()
//Do not blow up our internal radio
/obj/machinery/power/supermatter_crystal/contents_explosion(severity, target)
return
/obj/machinery/power/supermatter_crystal/proc/wrench_act_callback(mob/user, obj/item/tool)
if(moveable)
default_unfasten_wrench(user, tool)
/obj/machinery/power/supermatter_crystal/proc/consume_callback(matter_increase, damage_increase)
if(matter_increase && power_changes)
matter_power += matter_increase
if(damage_increase && takes_damage)
damage += damage_increase
damage = max(damage, 0)
@@ -68,6 +68,20 @@
//handles temperature increase and gases made by the crystal
temperature_gas_production(env, removed)
if(check_cascade_requirements(anomaly_event))
cascade_initiated = TRUE
if(!warp)
warp = new(src)
vis_contents += warp
animate(warp, time = 1, transform = matrix().Scale(0.5,0.5))
animate(time = 9, transform = matrix())
else
if(warp)
vis_contents -= warp
warp = null
cascade_initiated = FALSE
//handles hallucinations and the presence of a psychiatrist
psychological_examination()
@@ -86,6 +100,9 @@
//Tells the engi team to get their butt in gear
handle_emergency_alerts()
if(damage == 0 && has_destabilizing_crystal)
has_destabilizing_crystal = FALSE
return TRUE
/obj/machinery/power/supermatter_crystal/proc/handle_crystal_sounds()
@@ -405,6 +422,20 @@
if(combined_gas > MOLE_PENALTY_THRESHOLD)
radio.talk_into(src, "Warning: Critical coolant mass reached.", engineering_channel)
if(check_cascade_requirements(anomaly_event))
var/channel_to_talk_to = damage > emergency_point ? common_channel : engineering_channel
radio.talk_into(src, "DANGER: RESONANCE CASCADE INITIATED.", channel_to_talk_to)
for(var/mob/victim as anything in GLOB.player_list)
var/list/messages = list(
"You feel a strange presence in the air coming from engineering.",
"Something is wrong, there are weird sounds coming from engineering.",
"You don't like the smell of the SM.",
"The SM is emitting strange noises.",
"Crystals sounds are echoing through the station.",
)
to_chat(victim, span_boldannounce(pick(messages)))
//Boom (Mind blown)
if(damage > explosion_point)
countdown()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 MiB

After

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.
+4
View File
@@ -791,6 +791,7 @@
#include "code\datums\components\strong_pull.dm"
#include "code\datums\components\subtype_picker.dm"
#include "code\datums\components\summoning.dm"
#include "code\datums\components\supermatter_crystal.dm"
#include "code\datums\components\surgery_initiator.dm"
#include "code\datums\components\swabbing.dm"
#include "code\datums\components\swarming.dm"
@@ -1527,6 +1528,7 @@
#include "code\game\objects\items\devices\beacon.dm"
#include "code\game\objects\items\devices\camera_bug.dm"
#include "code\game\objects\items\devices\chameleonproj.dm"
#include "code\game\objects\items\devices\destabilizing_crystal.dm"
#include "code\game\objects\items\devices\desynchronizer.dm"
#include "code\game\objects\items\devices\electroadaptive_pseudocircuit.dm"
#include "code\game\objects\items\devices\flashlight.dm"
@@ -2211,6 +2213,7 @@
#include "code\modules\antagonists\traitor\objectives\smuggling.dm"
#include "code\modules\antagonists\traitor\objectives\steal.dm"
#include "code\modules\antagonists\traitor\objectives\final_objective\battlecruiser.dm"
#include "code\modules\antagonists\traitor\objectives\final_objective\end_reality.dm"
#include "code\modules\antagonists\traitor\objectives\final_objective\final_objective.dm"
#include "code\modules\antagonists\traitor\objectives\final_objective\romerol.dm"
#include "code\modules\antagonists\traitor\objectives\final_objective\space_dragon.dm"
@@ -3733,6 +3736,7 @@
#include "code\modules\power\singularity\narsie.dm"
#include "code\modules\power\singularity\singularity.dm"
#include "code\modules\power\supermatter\supermatter.dm"
#include "code\modules\power\supermatter\supermatter_cascade_components.dm"
#include "code\modules\power\supermatter\supermatter_delamination.dm"
#include "code\modules\power\supermatter\supermatter_hit_procs.dm"
#include "code\modules\power\supermatter\supermatter_process.dm"