From 9acd05dae1400805e5db2b73dcad50d5d80f7dda Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Sat, 24 Aug 2024 00:50:48 -0400 Subject: [PATCH 01/31] Probably all working More testing required however. --- code/__DEFINES/~monkestation/artifact.dm | 8 +- .../art_sci_overrides/activators/_base.dm | 3 +- .../art_sci_overrides/activators/range.dm | 4 + .../art_sci_overrides/activators/touch.dm | 3 + .../artifact_components/_artifact_effect.dm | 51 ++++++++++ .../artifact_components/_base_component.dm | 92 ++++++++++++------ .../_base_component_signal_procs.dm | 18 +++- .../artifact_components/bomb.dm | 86 ++++++++--------- .../artifact_components/bonk.dm | 27 +++--- .../artifact_components/borger.dm | 20 ++-- .../artifact_components/cell.dm | 31 +++--- .../artifact_components/emoter.dm | 28 +++--- .../artifact_components/forcegen.dm | 28 +++--- .../artifact_components/gun.dm | 21 ++-- .../artifact_components/heal.dm | 14 +-- .../artifact_components/injector.dm | 24 ++--- .../artifact_components/lamp.dm | 27 +++--- .../artifact_components/melee.dm | 29 ++---- .../artifact_components/repulsor.dm | 35 +++---- .../artifact_components/smoke_artifacts.dm | 24 +++-- .../artifact_components/surgery.dm | 12 +-- .../artifact_components/vomit.dm | 19 ++-- .../artifact_items/artifact_cell.dm | 3 +- .../artifact_items/artifact_gun.dm | 5 +- .../artifact_items/artifact_melee.dm | 3 +- .../artifact_objects/artifact_powergen.dm | 40 ++++---- .../artifact_testers/analysis_form.dm | 96 +++++++++---------- .../artifact_testers/xray.dm | 20 +++- .../art_sci_overrides/faults/_fault.dm | 4 +- .../art_sci_overrides/faults/explosion.dm | 2 +- .../art_sci_overrides/faults/ignite.dm | 2 +- .../art_sci_overrides/faults/just_death.dm | 4 +- .../art_sci_overrides/faults/reagents.dm | 2 +- .../modules/art_sci_overrides/faults/say.dm | 2 +- .../art_sci_overrides/faults/size_change.dm | 4 +- .../modules/art_sci_overrides/faults/warps.dm | 2 +- .../art_sci_overrides/faults/whispers.dm | 2 +- .../modules/art_sci_overrides/faults/zap.dm | 2 +- .../generic_artifact_objects.dm | 37 +++---- .../code/modules/art_sci_overrides/globals.dm | 2 +- .../modules/art_sci_overrides/new_procs.dm | 32 +++---- tgstation.dme | 1 + .../packages/tgui/interfaces/ArtifactForm.jsx | 4 +- 43 files changed, 479 insertions(+), 394 deletions(-) create mode 100644 monkestation/code/modules/art_sci_overrides/artifact_components/_artifact_effect.dm diff --git a/code/__DEFINES/~monkestation/artifact.dm b/code/__DEFINES/~monkestation/artifact.dm index e4fcd4ff9c4f..cfb391a3111a 100644 --- a/code/__DEFINES/~monkestation/artifact.dm +++ b/code/__DEFINES/~monkestation/artifact.dm @@ -18,11 +18,11 @@ #define ARTIFACT_VERYRARE 140 //cuts down on boiler plate code -#define ARTIFACT_SETUP(X,subsystem) ##X/Initialize(mapload, var/forced_origin = null){\ +#define ARTIFACT_SETUP(X,subsystem) ##X/Initialize(mapload, var/forced_origin = null,var/forced_effect = null){\ . = ..();\ START_PROCESSING(subsystem, src);\ if(assoc_comp) {\ - assoc_comp = AddComponent(assoc_comp, forced_origin);\ + assoc_comp = AddComponent(assoc_comp, forced_origin, forced_effect);\ RegisterSignal(src, COMSIG_QDELETING, PROC_REF(on_delete));\ }\ } \ @@ -33,7 +33,9 @@ ##X/process(){\ assoc_comp?.stimulate_from_turf_heat(get_turf(src));\ if(assoc_comp?.active) {\ - assoc_comp.effect_process();\ + for(var/datum/artifact_effect/eff in assoc_comp.artifact_effects) {\ + eff.effect_process();\ + }\ }\ } \ ##X/rad_act(intensity){\ diff --git a/monkestation/code/modules/art_sci_overrides/activators/_base.dm b/monkestation/code/modules/art_sci_overrides/activators/_base.dm index 57c25345fc73..f1d8a783c777 100644 --- a/monkestation/code/modules/art_sci_overrides/activators/_base.dm +++ b/monkestation/code/modules/art_sci_overrides/activators/_base.dm @@ -5,12 +5,13 @@ var/required_stimuli = NONE /// our baseline amount needed to even think about triggering (do this in setup otherwise its gonna be static) var/base_trigger_amount = 0 - ///the highest number our trigger can be + ///the highest number our trigger can be var/highest_trigger_amount = 0 ///the end goal of the amount we need set by setup below var/amount = 0 ///the hint we want to pass into the componenet for when we hit hint triggers var/list/hint_texts = list("emits a faint noise..") + var/discovered_text = "Activated by ... coderbus" /datum/artifact_activator/proc/setup(potency) amount = round(max(base_trigger_amount, base_trigger_amount + (highest_trigger_amount - base_trigger_amount) * (potency/100))) diff --git a/monkestation/code/modules/art_sci_overrides/activators/range.dm b/monkestation/code/modules/art_sci_overrides/activators/range.dm index dd946af80fbe..d8aea127c86b 100644 --- a/monkestation/code/modules/art_sci_overrides/activators/range.dm +++ b/monkestation/code/modules/art_sci_overrides/activators/range.dm @@ -21,6 +21,7 @@ hint_prob = 50 hint_range = 10 hint_texts = list("you almost want to start hitting things.", "a good whack might fix this.") + discovered_text = "Activated by Kinetic Energy" /datum/artifact_activator/range/heat name = "Heat Sensisty" @@ -28,6 +29,7 @@ hint_range = 20 highest_trigger_amount = 15000 hint_texts = list("it feels like someone messed with the thermostat.", "it feels unpleasent being near") + discovered_text = "Activated by Thermal Energy" /datum/artifact_activator/range/heat/New() base_trigger_amount = rand(350, 1000) @@ -38,6 +40,7 @@ highest_trigger_amount = 10000 // requires atleast t2 parts to trigger a max roll one hint_range = 500 hint_texts = list("you can feel the static in the air", "your hairs stand on their ends") + discovered_text = "Activated by Electrical Energy" /datum/artifact_activator/range/shock/New() base_trigger_amount = rand(400, 1200) @@ -49,3 +52,4 @@ hint_range = 2 base_trigger_amount = 1 //x-ray machine goes from 1-10 hint_texts = list("emits a hum that resembles the Super Matter", "you could swear you saw your bones for a second") + discovered_text = "Activated by Radiation" diff --git a/monkestation/code/modules/art_sci_overrides/activators/touch.dm b/monkestation/code/modules/art_sci_overrides/activators/touch.dm index 4cdee177fd24..7d365b6f94b8 100644 --- a/monkestation/code/modules/art_sci_overrides/activators/touch.dm +++ b/monkestation/code/modules/art_sci_overrides/activators/touch.dm @@ -8,13 +8,16 @@ name = "Data" required_stimuli = STIMULUS_DATA hint_texts = list("It yearns for information") + discovered_text = "Activated by Information" /datum/artifact_activator/touch/carbon name = "Carbon Touch" required_stimuli = STIMULUS_CARBON_TOUCH hint_texts = list("You swear you hear the artifact saying it yearns for flesh.", "One touch couldn't hurt could it?") + discovered_text = "Activated by Organic Contact" /datum/artifact_activator/touch/silicon name = "Silicon Touch" required_stimuli = STIMULUS_SILICON_TOUCH hint_texts = list("It feels like it's malfunctioning") + discovered_text = "Activated by Silicon Contact" diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/_artifact_effect.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/_artifact_effect.dm new file mode 100644 index 000000000000..2fa1d49af048 --- /dev/null +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/_artifact_effect.dm @@ -0,0 +1,51 @@ +/datum/artifact_effect + //string added to artifact desc, if not discovered. + var/examine_hint + //string added to artifact desc, if the effect has been discovered + var/examine_discovered + //When you discover this, how many credits does it add to the sell price? + var/discovered_credits = CARGO_CRATE_VALUE*0.75 + //how likely is it that this effect is added to an artifact? + var/weight = 1 + //if defined, artifact must be this size to roll + var/artifact_size + //how strong is this effect,1-100 + var/potency + //If the artifact doesnt have the right activator, cant be put on. If null, assume any + var/list/valid_activators + //If the artifact doesnt have this origin, cant be put on. If null, assume any + var/list/valid_origins + //sent/played on [de]activation + var/activation_message + var/activation_sound + var/deactivation_message + var/deactivation_sound + + //The artifact we're on. + var/datum/component/artifact/our_artifact + //Type of effect, shows up in Xray Machine + var/type_name = "Generic Artifact Effect" + +/datum/artifact_effect/New() + . = ..() + potency = rand(1,100) + + +//Called when the artifact has been created +/datum/artifact_effect/proc/setup() + return +//Called when the artifact has been activated +/datum/artifact_effect/proc/effect_activate(silent) + return +//Called when the artifact has been de-activated +/datum/artifact_effect/proc/effect_deactivate(silent) + return +//Called when the artifact has been touched by a living mob. +/datum/artifact_effect/proc/effect_touched(mob/living/user) + return +//Called on every artifact subsystem tick. +/datum/artifact_effect/proc/effect_process() + return +//Called when the artifact is destroyed +/datum/artifact_effect/proc/on_destroy(atom/source) + return diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component.dm index 1e0520de7d1d..010ad9abb626 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component.dm @@ -1,13 +1,10 @@ #define BASE_MAX_ACTIVATORS 2 +#define BASE_MAX_EFFECTS 2 /datum/component/artifact dupe_mode = COMPONENT_DUPE_UNIQUE - ///object related to this datum for spawning - var/obj/associated_object - ///actual specific object for this instance - var/obj/holder - ///list weight for picking this artifact datum (0 = never) - var/weight = 0 + //The object we are attached to + var/obj/structure/artifact/holder ///size class for visuals (ARTIFACT_SIZE_TINY,ARTIFACT_SIZE_SMALL,ARTIFACT_SIZE_LARGE) var/artifact_size = ARTIFACT_SIZE_LARGE ///type name for displaying on analysis forms @@ -50,33 +47,36 @@ /datum/artifact_origin/wizard, /datum/artifact_origin/silicon, /datum/artifact_origin/precursor, - /datum/artifact_origin/martian, + /datum/artifact_origin/martian ) var/activation_message var/activation_sound var/deactivation_message var/deactivation_sound - var/hint_text = "emits a faint noise.." - var/examine_hint var/mutable_appearance/act_effect - /// Potency in percentage, used for making more strong artifacts need more stimulus. (1% - 100%) 100 is strongest. - var/potency = 1 - ///structure description from x-ray machines - var/xray_result = "NONE" ///we store our analysis form var here var/obj/item/sticker/analysis_form/analysis var/mutable_appearance/extra_effect - ///the fault we picked from the listed ones + ///the fault we picked from the listed ones. Can be null! var/datum/artifact_fault/chosen_fault - ///the amount of freebies we get + ///the amount of times an artifact WONT do something bad, even though it should have var/freebies = 3 ///if we have a special examine IE borgers var/explict_examine -/datum/component/artifact/Initialize(forced_origin = null) - . = ..() + //The activators we have discovered. + var/list/datum/artifact_activator/discovered_activators = list() + //Have we discovered what the bad is? + var/fault_discovered = FALSE + //A list of effects the artifact has + var/list/datum/artifact_effect/artifact_effects = list() + //A list of effects that have been discovered + var/list/datum/artifact_effect/discovered_effects = list() + +/datum/component/artifact/Initialize(forced_origin,forced_effect) + . = ..(forced_origin,forced_effect) if(!isobj(parent)) return COMPONENT_INCOMPATIBLE @@ -88,15 +88,16 @@ var/picked_origin = pick(valid_origins) artifact_origin = new picked_origin fake_name = "[pick(artifact_origin.name_vars["adjectives"])] [pick(isitem(holder) ? artifact_origin.name_vars["small-nouns"] : artifact_origin.name_vars["large-nouns"])]" - var/picked_fault = pick_weight(valid_faults) - chosen_fault = new picked_fault + if(rand(0,100)<95) + var/picked_fault = pick_weight(valid_faults) + chosen_fault = new picked_fault generated_name = artifact_origin.generate_name() if(!generated_name) generated_name = "[pick(artifact_origin.name_vars["adjectives"])] [pick(isitem(holder) ? artifact_origin.name_vars["small-nouns"] : artifact_origin.name_vars["large-nouns"])]" holder.name = fake_name - holder.desc = "You have absolutely no clue what this thing is or how it got here." + holder.desc = "Some sort of artifact from a time long past." var/dat_icon switch(artifact_size) @@ -131,13 +132,46 @@ valid_activators -= selection activators += new selection() activator_amount-- - + var/effect_amount = rand(1,BASE_MAX_EFFECTS) + var/list/datum/artifact_effect/all_possible_effects = GLOB.artifact_effect_rarity["all"]// We need all of them as we check later if ifs a valid origin + while(effect_amount >0) + if(length(all_possible_effects) <= 0) + logger.Log(LOG_CATEGORY_ARTIFACT, "[src] has ran out of possible artifact effects! It may not have any at all!") + effect_amount = 0 + continue + var/datum/artifact_effect/effect = pick_weight(all_possible_effects) + if(effect.valid_origins) + if(!effect.valid_origins.Find(picked_origin)) + all_possible_effects -= effect + continue + if(effect.valid_activators) + var/good_activators = FALSE + for(var/datum/artifact_activator/activator in activators) //Only need one to be correct. + if(effect.valid_activators.Find(activator)) + good_activators = TRUE + break + if(good_activators) + all_possible_effects -= effect + continue + if(effect.artifact_size) + if(artifact_size != effect.artifact_size) + all_possible_effects -=effect + continue + var/datum/artifact_effect/added = new effect + artifact_effects += added + added.setup() + effect_amount-- + all_possible_effects -= effect + if(forced_effect) + var/datum/artifact_effect/added_boogaloo = new forced_effect + artifact_effects += added_boogaloo + added_boogaloo.setup() ADD_TRAIT(holder, TRAIT_HIDDEN_EXPORT_VALUE, INNATE_TRAIT) setup() - potency = clamp(potency, 0, 100) for(var/datum/artifact_activator/activator in activators) + var/potency = rand(0,100) + activators += list(activator.type = potency) activator.setup(potency) - hint_text = activator.grab_hint() /datum/component/artifact/RegisterWithParent() RegisterSignals(parent, list(COMSIG_ATOM_DESTRUCTION, COMSIG_QDELETING), PROC_REF(on_destroy)) @@ -183,7 +217,8 @@ active = TRUE holder.add_overlay(act_effect) logger.Log(LOG_CATEGORY_ARTIFACT, "[parent] has been activated") - effect_activate(silent) + for(var/datum/artifact_effect/effect in artifact_effects) + effect.effect_activate(silent) return TRUE /datum/component/artifact/proc/artifact_deactivate(silent) @@ -196,14 +231,15 @@ active = FALSE holder.cut_overlay(act_effect) logger.Log(LOG_CATEGORY_ARTIFACT, "[parent] has been deactivated") - effect_deactivate(silent) + for(var/datum/artifact_effect/effect in artifact_effects) + effect.effect_deactivate(silent) /datum/component/artifact/proc/process_stimuli(stimuli, stimuli_value, triggers_faults = TRUE) if(!stimuli || active) // if called without a stimuli dont bother, if active we dont wanna reactivate return var/checked_fault = FALSE for(var/datum/artifact_activator/listed_activator in activators) - if(!(listed_activator.required_stimuli & stimuli)) + if(!(listed_activator.required_stimuli & stimuli) && chosen_fault) if(!triggers_faults) continue if(freebies >= 1) @@ -223,11 +259,10 @@ var/datum/artifact_activator/range/ranged_activator = listed_activator //if we fail the range check check if we are in hint range to send out the hint if(!ISINRANGE(stimuli_value, ranged_activator.amount, ranged_activator.upper_range)) - if(hint_text && !ISINRANGE(stimuli_value, ranged_activator.amount - ranged_activator.hint_range, ranged_activator.upper_range + ranged_activator.hint_range)) + if(!ISINRANGE(stimuli_value, ranged_activator.amount - ranged_activator.hint_range, ranged_activator.upper_range + ranged_activator.hint_range)) continue if(!prob(ranged_activator.hint_prob)) continue - holder.visible_message(span_notice("[hint_text]")) continue artifact_activate() @@ -239,3 +274,4 @@ process_stimuli(STIMULUS_RADIATION, intensity) #undef BASE_MAX_ACTIVATORS +#undef BASE_MAX_EFFECTS diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component_signal_procs.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component_signal_procs.dm index 03874852ae2a..a7e5b06d6773 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component_signal_procs.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/_base_component_signal_procs.dm @@ -4,15 +4,26 @@ if(!QDELETED(holder)) holder.loc.visible_message(span_warning("[holder] [artifact_origin.destroy_message]")) artifact_deactivate(TRUE) + for(var/datum/artifact_effect/effect in artifact_effects) + effect.on_destroy(source) if(!QDELETED(holder)) qdel(holder) /datum/component/artifact/proc/on_examine(atom/source, mob/user, list/examine_list) SIGNAL_HANDLER - if(examine_hint) - examine_list += examine_hint if(explict_examine) examine_list += explict_examine + for(var/datum/artifact_effect/effect in artifact_effects) + if(discovered_effects.Find(effect.type)) + examine_list += effect.examine_discovered + else + examine_list += effect.examine_hint + + for(var/datum/artifact_activator/act in activators) + if(discovered_activators.Find(act.type)) + examine_list += act.discovered_text + else + examine_list += pick(act.hint_texts) /datum/component/artifact/proc/on_sticker(atom/source, obj/item/sticker/sticker, mob/user) SIGNAL_HANDLER @@ -75,7 +86,8 @@ logger.Log(LOG_CATEGORY_ARTIFACT, "[user] has touched [parent]") if(active) - effect_touched(user) + for(var/datum/artifact_effect/effect in artifact_effects) + effect.effect_touched(user) return if(LAZYLEN(artifact_origin.touch_descriptors)) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), user, span_notice("[pick(artifact_origin.touch_descriptors)]")), 0.5 SECONDS) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/bomb.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/bomb.dm index 476af7185a04..af6d7d00eb5d 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/bomb.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/bomb.dm @@ -1,4 +1,4 @@ -/datum/component/artifact/bomb +/datum/artifact_effect/bomb examine_hint = span_warning("It is covered in very conspicuous markings.") valid_activators = list( /datum/artifact_activator/range/force, @@ -6,8 +6,11 @@ /datum/artifact_activator/range/shock, /datum/artifact_activator/range/radiation ) - deactivation_message = "sputters a bit, and falls silent once more." - xray_result = "COMPLEX" + + type_name = "Explosive Effect" + examine_discovered = span_warning("It appears to explode.") + + var/dud = FALSE var/dud_message = "sputters, failing to activate! Its a dud!" var/initial_warning = "begins overloading, rattling violenty!" @@ -23,88 +26,85 @@ var/timer_id var/do_alert = FALSE //do we send an announcement on activation -/datum/component/artifact/bomb/setup() +/datum/artifact_effect/bomb/setup() if(prob(20)) dud = TRUE -/datum/component/artifact/bomb/effect_activate() +/datum/artifact_effect/bomb/effect_activate() if(!COOLDOWN_FINISHED(src,explode_cooldown_time)) - holder.visible_message(span_warning("[holder] [deactivation_message]")) //rekt - addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), 1 SECONDS) + our_artifact.holder.visible_message(span_warning("[our_artifact] [deactivation_message]")) //rekt + addtimer(CALLBACK(src.our_artifact, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), 1 SECONDS) return - holder.visible_message(span_bolddanger("[holder] [initial_warning]")) + our_artifact.holder.visible_message(span_bolddanger("[our_artifact] [initial_warning]")) COOLDOWN_START(src,activation_cooldown,explode_cooldown_time) timer_id = addtimer(CALLBACK(src, PROC_REF(finale)), explode_delay, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE) - if(do_alert && is_station_level(holder.z)) - priority_announce("A highly unstable object of type [type_name] has been activated at [get_area(holder)]. It has been marked on GPS, The crew is advised to get rid of it IMMEDIATELY.", null, SSstation.announcer.get_rand_report_sound(), has_important_message = TRUE) - holder.AddComponent(/datum/component/gps, "Unstable Object") + if(do_alert && is_station_level(our_artifact.holder.z)) + priority_announce("A highly unstable object of type [type_name] has been activated at [get_area(our_artifact)]. It has been marked on GPS, The crew is advised to get rid of it IMMEDIATELY.", null, SSstation.announcer.get_rand_report_sound(), has_important_message = TRUE) + our_artifact.AddComponent(/datum/component/gps, "Unstable Object") -/datum/component/artifact/bomb/effect_deactivate() +/datum/artifact_effect/bomb/effect_deactivate() deltimer(timer_id) -/datum/component/artifact/bomb/effect_process() +/datum/artifact_effect/bomb/effect_process() . = ..() - if(active && COOLDOWN_FINISHED(src,alarm_cooldown) && (COOLDOWN_TIMELEFT(src,alarm_cooldown) <= finale_delay)) - playsound(holder, active_alarm, 30, 1) - holder.Shake(duration = 1 SECONDS, shake_interval = 0.08 SECONDS) + if(our_artifact.active && COOLDOWN_FINISHED(src,alarm_cooldown) && (COOLDOWN_TIMELEFT(src,alarm_cooldown) <= finale_delay)) + playsound(our_artifact, active_alarm, 30, 1) + our_artifact.holder.Shake(duration = 1 SECONDS, shake_interval = 0.08 SECONDS) COOLDOWN_START(src,alarm_cooldown, alarm_cooldown_time) -/datum/component/artifact/bomb/proc/finale() +/datum/artifact_effect/bomb/proc/finale() if(final_sound) - playsound(holder.loc, final_sound, 100, 1, -1) + playsound(our_artifact.holder.loc, final_sound, 100, 1, -1) if(finale_delay) - holder.visible_message(span_bolddanger("[holder] [final_message]")) + our_artifact.holder.visible_message(span_bolddanger("[our_artifact.holder] [final_message]")) addtimer(CALLBACK(src, PROC_REF(payload)), finale_delay) else payload() -/datum/component/artifact/bomb/on_destroy(/datum/source) +/datum/artifact_effect/bomb/on_destroy(/datum/source) . = ..() - if(active) + if(our_artifact.active) payload() deltimer(timer_id) - -/datum/component/artifact/bomb/proc/payload() + +/datum/artifact_effect/bomb/proc/payload() . = TRUE - if(dud || !active) - holder.visible_message(span_notice("[holder] [dud_message]")) - artifact_deactivate(TRUE) + if(dud || !our_artifact.active) + our_artifact.holder.visible_message(span_notice("[our_artifact.holder] [dud_message]")) + our_artifact.artifact_deactivate(TRUE) return FALSE /// EXPLOSIVE BOMB -/datum/component/artifact/bomb/explosive - associated_object = /obj/structure/artifact/bomb +/datum/artifact_effect/bomb/explosive type_name = "Bomb (explosive)" weight = ARTIFACT_RARE var/devast var/heavy var/light -/datum/component/artifact/bomb/explosive/New() +/datum/artifact_effect/bomb/explosive/New() . = ..() devast = rand(1,3) heavy = rand(2,4) light = rand(3,10) potency = (light + heavy + devast) * 2 -/datum/component/artifact/bomb/explosive/payload() +/datum/artifact_effect/bomb/explosive/payload() if(!..()) return FALSE - explosion(holder, devast,heavy,light,light*1.5) + explosion(our_artifact, devast,heavy,light,light*1.5) on_destroy() /// DEVESTATING BOMB -/datum/component/artifact/bomb/explosive/devastating - associated_object = /obj/structure/artifact/bomb/devastating +/datum/artifact_effect/bomb/explosive/devastating type_name = "Bomb (explosive, devastating)" do_alert = TRUE weight = ARTIFACT_VERYRARE - xray_result = "DENSE" explode_delay = 2 MINUTES -/datum/component/artifact/bomb/explosive/devastating/New() +/datum/artifact_effect/bomb/explosive/devastating/New() ..() devast = rand(3,7) heavy = rand(7,12) @@ -113,11 +113,9 @@ /// GAS BOMB -/datum/component/artifact/bomb/gas - associated_object = /obj/structure/artifact/bomb/gas +/datum/artifact_effect/bomb/gas type_name = "Bomb (gas)" weight = ARTIFACT_RARE - xray_result = "POROUS" initial_warning = "begins rattling violenty!" final_message = "reaches a critical pressure, cracks forming at its surface!" var/datum/gas/payload_gas @@ -130,17 +128,17 @@ /datum/gas/zauker = 2, ) -/datum/component/artifact/bomb/gas/setup() +/datum/artifact_effect/bomb/gas/setup() . = ..() payload_gas = pick_weight(weighted_gas) -/datum/component/artifact/bomb/gas/payload() +/datum/artifact_effect/bomb/gas/payload() if(!..()) - artifact_deactivate() + our_artifact.artifact_deactivate() return FALSE - var/turf/open/O = get_turf(holder) + var/turf/open/O = get_turf(our_artifact) if(!isopenturf(O)) - artifact_deactivate() + our_artifact.artifact_deactivate() return FALSE var/datum/gas_mixture/merger = new merger.assert_gas(payload_gas) @@ -149,4 +147,4 @@ merger.gases[/datum/gas/oxygen][MOLES] = 350 merger.temperature = rand(200,3000) O.assume_air(merger) - qdel(holder) + qdel(our_artifact) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/bonk.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/bonk.dm index 39b6136e894d..ab9ad5c2c366 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/bonk.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/bonk.dm @@ -1,7 +1,6 @@ -/datum/component/artifact/bonk - associated_object = /obj/structure/artifact/bonk +/datum/artifact_effect/bonk weight = ARTIFACT_UNCOMMON - type_name = "Slammer" + type_name = "Slammer Effect" activation_message = "opens up!" deactivation_message = "closes up." valid_activators = list( @@ -12,27 +11,29 @@ var/hit_power = 1 COOLDOWN_DECLARE(bonk_cooldown) -/datum/component/artifact/bonk/setup() + examine_discovered = span_warning("It appears to bonk those with heads on said head.") + +/datum/artifact_effect/bonk/setup() hit_power = rand(0,35) potency += hit_power -/datum/component/artifact/bonk/effect_touched(mob/living/user) +/datum/artifact_effect/bonk/effect_touched(mob/living/user) if(!COOLDOWN_FINISHED(src, bonk_cooldown)) return - + if(iscarbon(user)) var/mob/living/carbon/carbon = user if(!carbon.get_bodypart(BODY_ZONE_HEAD)) - holder.say("My condolences to your missing head.") //they can speak uhh galactic common because alien tech idk - holder.visible_message(span_notice("[holder] shakes [user][p_s()] hands with an apparatus.")) - playsound(get_turf(holder), 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1) - artifact_deactivate() + our_artifact.holder.say("My condolences to your missing head.") //they can speak uhh galactic common because alien tech idk + our_artifact.holder.visible_message(span_notice("[our_artifact.holder] shakes [user][p_s()] hands with an apparatus.")) + playsound(get_turf(our_artifact.holder), 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1) + our_artifact.artifact_deactivate() return else carbon.apply_damage(hit_power, BRUTE, BODY_ZONE_HEAD, carbon.run_armor_check(BODY_ZONE_HEAD, MELEE)) - holder.visible_message(span_danger("[holder] hits [carbon] over the head!")) + our_artifact.holder.visible_message(span_danger("[our_artifact.holder] hits [carbon] over the head!")) else - holder.visible_message(span_danger("[holder] slams [user]!")) + our_artifact.holder.visible_message(span_danger("[our_artifact.holder] slams [user]!")) user.adjustBruteLoss(hit_power) - playsound(get_turf(holder), 'sound/misc/bonk.ogg', 80, FALSE) + playsound(get_turf(our_artifact.holder), 'sound/misc/bonk.ogg', 80, FALSE) COOLDOWN_START(src, bonk_cooldown, 1.5 SECONDS) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/borger.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/borger.dm index e87a58fbe398..a5cdd31cd487 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/borger.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/borger.dm @@ -1,14 +1,14 @@ -/datum/component/artifact/borger - associated_object = /obj/structure/artifact/borger +/datum/artifact_effect/borger weight = ARTIFACT_UNCOMMON - type_name = "Borger" + type_name = "Borger Effect" activation_message = "opens up!" deactivation_message = "closes up." valid_activators = list( /datum/artifact_activator/touch/carbon, /datum/artifact_activator/touch/silicon ) - explict_examine = span_bolddanger("It is vaguely forboding, touching this might be a bad idea...") + examine_hint = span_bolddanger("It is vaguely forboding, touching this might be a bad idea...") + examine_discovered = span_bolddanger("It will turn a random limb robotic if touched, touching this might be a bad idea...") /// The time between each limb replacement var/limb_replace_time = 1 SECONDS /// People who've already touched it once. Touching it again will cause it to react. @@ -16,9 +16,9 @@ /// The cooldown between borgings. COOLDOWN_DECLARE(borg_cooldown) -/datum/component/artifact/borger/effect_touched(mob/living/user) +/datum/artifact_effect/borger/effect_touched(mob/living/user) if(!iscarbon(user) || !COOLDOWN_FINISHED(src, borg_cooldown) || QDELETED(user.client) || did_robot_touch(user)) - holder.visible_message(span_smallnoticeital("[holder] does not react to [user].")) + our_artifact.holder.visible_message(span_smallnoticeital("[our_artifact.holder] does not react to [user].")) return if(!LAZYACCESS(first_touched, user)) @@ -54,14 +54,14 @@ addtimer(CALLBACK(carbon_target, TYPE_PROC_REF(/mob/, Robotize)), timer + 5) COOLDOWN_START(src, borg_cooldown, 10 SECONDS) -/datum/component/artifact/borger/proc/eat_limb(mob/living/carbon/victim) +/datum/artifact_effect/borger/proc/eat_limb(mob/living/carbon/victim) var/arm_name = victim.get_held_index_name(victim.active_hand_index) - victim.visible_message(span_warning("[holder] lashes out and clamps down on [victim], rapidly transmuting [victim.p_their()] [arm_name]!"), \ - span_userdanger("[holder] lashes out and clamps down onto your [arm_name], rapidly transmuting it into cold metal!")) + victim.visible_message(span_warning("[our_artifact.holder] lashes out and clamps down on [victim], rapidly transmuting [victim.p_their()] [arm_name]!"), \ + span_userdanger("[our_artifact.holder] lashes out and clamps down onto your [arm_name], rapidly transmuting it into cold metal!")) var/new_arm_type = (victim.active_hand_index % 2) ? /obj/item/bodypart/arm/left/robot : /obj/item/bodypart/arm/right/robot victim.del_and_replace_bodypart(new new_arm_type) victim.emote("scream") -/datum/component/artifact/borger/proc/did_robot_touch(mob/living/carbon/user) +/datum/artifact_effect/borger/proc/did_robot_touch(mob/living/carbon/user) var/obj/item/bodypart/arm/active_arm = user.get_active_hand() return istype(active_arm) && (active_arm.bodytype & BODYTYPE_ROBOTIC) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/cell.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/cell.dm index 2c3ee53a1886..e76179fa6d8c 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/cell.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/cell.dm @@ -1,26 +1,17 @@ -/datum/component/artifact/cell - associated_object = /obj/item/stock_parts/cell/artifact - artifact_size = ARTIFACT_SIZE_TINY - type_name = "Power Cell" +/datum/artifact_effect/cell + type_name = "Power Cell Effect" weight = ARTIFACT_UNCOMMON - xray_result = "SEGMENTED" + artifact_size = ARTIFACT_SIZE_TINY valid_activators = list( /datum/artifact_activator/range/heat, /datum/artifact_activator/range/shock, /datum/artifact_activator/range/radiation ) - valid_faults = list( - /datum/artifact_fault/ignite = 10, - /datum/artifact_fault/warp = 10, - /datum/artifact_fault/reagent/poison = 10, - /datum/artifact_fault/death = 2, - /datum/artifact_fault/tesla_zap = 5, - /datum/artifact_fault/grow = 10, - /datum/artifact_fault/explosion = 2, - ) -/datum/component/artifact/cell/setup() - var/obj/item/stock_parts/cell/artifact/cell = holder + examine_discovered = span_warning("It appears to hold power") + +/datum/artifact_effect/cell/setup() + var/obj/item/stock_parts/cell/artifact/cell = our_artifact.holder cell.corrupted = prob(10) //trolled cell.maxcharge = rand(5 KW, 500 MW) // the heavenly battery cell.charge = cell.maxcharge / 2 @@ -28,10 +19,10 @@ potency += cell.maxcharge / 900 potency += cell.chargerate / 4000 -/datum/component/artifact/cell/effect_activate() - var/obj/item/stock_parts/cell/artifact/cell = holder +/datum/artifact_effect/cell/effect_activate() + var/obj/item/stock_parts/cell/artifact/cell = our_artifact.holder cell.ratingdesc = TRUE -/datum/component/artifact/cell/effect_deactivate() - var/obj/item/stock_parts/cell/artifact/cell = holder +/datum/artifact_effect/cell/effect_deactivate() + var/obj/item/stock_parts/cell/artifact/cell = our_artifact.holder cell.ratingdesc = FALSE diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/emoter.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/emoter.dm index 88c88d374bb0..03492b44971e 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/emoter.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/emoter.dm @@ -1,7 +1,6 @@ -/datum/component/artifact/emotegen - associated_object = /obj/structure/artifact/emotegen +/datum/artifact_effect/emotegen weight = ARTIFACT_UNCOMMON - type_name = "Emote Forcefield" + type_name = "Emote Forcefield Effect" activation_message = "springs to life and starts emitting a forcefield!" deactivation_message = "shuts down, its forcefields shutting down with it." valid_activators = list( @@ -25,10 +24,13 @@ "snore", "cry", ) + + examine_discovered = span_warning("It appears to radiate an emotional field") + var/list/picked_emotes = list() COOLDOWN_DECLARE(cooldown) -/datum/component/artifact/emotegen/setup() +/datum/artifact_effect/emotegen/setup() for(var/i = 1 to rand(3,4)) picked_emotes += pick(all_emotes) @@ -39,24 +41,24 @@ cooldown_time = shield_time / 3 potency += radius * 3 + shield_time / 30 -/datum/component/artifact/emotegen/effect_activate(silent) +/datum/artifact_effect/emotegen/effect_activate(silent) if(!COOLDOWN_FINISHED(src,cooldown)) - holder.visible_message(span_notice("[holder] wheezes, shutting down.")) - artifact_deactivate(TRUE) + our_artifact.holder.visible_message(span_notice("[our_artifact.holder] wheezes, shutting down.")) + our_artifact.artifact_deactivate(TRUE) return addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), shield_time) COOLDOWN_START(src,cooldown,shield_time + cooldown_time) -/datum/component/artifact/emotegen/effect_process() +/datum/artifact_effect/emotegen/effect_process() var/current_emote = pick(picked_emotes) - holder.anchored = TRUE - var/turf/our_turf = get_turf(holder) - for(var/turf/open/floor in range(radius,holder)) + our_artifact.holder.anchored = TRUE + var/turf/our_turf = get_turf(our_artifact.holder) + for(var/turf/open/floor in range(radius,our_artifact.holder)) if(floor == our_turf) continue for(var/mob/living/living in floor) living.emote(current_emote, intentional = FALSE) -/datum/component/artifact/emotegen/effect_deactivate() - holder.anchored = FALSE +/datum/artifact_effect/emotegen/effect_deactivate() + our_artifact.holder.anchored = FALSE diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/forcegen.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/forcegen.dm index 95be5fbb3305..58598048327c 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/forcegen.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/forcegen.dm @@ -14,10 +14,9 @@ /obj/structure/artifact_forcefield/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) playsound(loc, 'sound/weapons/egloves.ogg', 80, TRUE) -/datum/component/artifact/forcegen - associated_object = /obj/structure/artifact/forcegen +/datum/artifact_effect/forcegen weight = ARTIFACT_UNCOMMON - type_name = "Forcefield Generator" + type_name = "Forcefield Generator Effect" activation_message = "springs to life and starts emitting a forcefield!" deactivation_message = "shuts down, its forcefields shutting down with it." valid_activators = list( @@ -25,6 +24,9 @@ /datum/artifact_activator/touch/silicon, /datum/artifact_activator/range/force ) + + examine_discovered = span_warning("It appears to generate some kind of forcefield") + var/cooldown_time //cooldown AFTER the shield lowers var/shield_iconstate var/list/projected_forcefields = list() @@ -32,7 +34,7 @@ var/shield_time COOLDOWN_DECLARE(cooldown) -/datum/component/artifact/forcegen/setup() +/datum/artifact_effect/forcegen/setup() shield_iconstate = pick("shieldsparkles","empdisable","shield2","shield-old","shield-red","shield-green","shield-yellow") activation_sound = pick('sound/mecha/mech_shield_drop.ogg') deactivation_sound = pick('sound/mecha/mech_shield_raise.ogg','sound/magic/forcewall.ogg') @@ -41,17 +43,17 @@ cooldown_time = shield_time / 3 potency += radius * 3 + shield_time / 30 -/datum/component/artifact/forcegen/effect_activate() +/datum/artifact_effect/forcegen/effect_activate() if(!COOLDOWN_FINISHED(src,cooldown)) - holder.visible_message(span_notice("[holder] wheezes, shutting down.")) - artifact_deactivate(TRUE) + our_artifact.holder.visible_message(span_notice("[our_artifact.holder] wheezes, shutting down.")) + our_artifact.artifact_deactivate(TRUE) return - holder.anchored = TRUE - var/turf/our_turf = get_turf(holder) + our_artifact.holder.anchored = TRUE + var/turf/our_turf = get_turf(our_artifact.holder) var/list/bad_turfs if(radius > 1) - bad_turfs = range(radius - 1, holder) - for(var/turf/open/floor in range(radius,holder)) + bad_turfs = range(radius - 1, our_artifact.holder) + for(var/turf/open/floor in range(radius,our_artifact.holder)) if(floor in bad_turfs) continue if(floor == our_turf) @@ -62,8 +64,8 @@ addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), shield_time) COOLDOWN_START(src,cooldown,shield_time + cooldown_time) -/datum/component/artifact/forcegen/effect_deactivate() - holder.anchored = FALSE +/datum/artifact_effect/forcegen/effect_deactivate() + our_artifact.holder.anchored = FALSE for(var/obj/field in projected_forcefields) projected_forcefields -= field qdel(field) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/gun.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/gun.dm index 7425c524e47a..9d4b4c7f9d1a 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/gun.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/gun.dm @@ -1,26 +1,17 @@ #define LOWEST_POSSIBLE_CLICK_CD 3 #define HIGHEST_POSSIBLE_CLICK_CD 15 -/datum/component/artifact/gun - associated_object = /obj/item/gun/magic/artifact +/datum/artifact_effect/gun artifact_size = ARTIFACT_SIZE_SMALL - type_name = "Ranged Weapon" + type_name = "Ranged Weapon Effect" weight = ARTIFACT_VERYUNCOMMON //rare - xray_result = "COMPLEX" valid_activators = list( /datum/artifact_activator/range/heat, /datum/artifact_activator/range/shock, /datum/artifact_activator/range/radiation ) - valid_faults = list( - /datum/artifact_fault/ignite = 10, - /datum/artifact_fault/warp = 10, - /datum/artifact_fault/reagent/poison = 10, - /datum/artifact_fault/death = 2, - /datum/artifact_fault/tesla_zap = 5, - /datum/artifact_fault/grow = 10, - /datum/artifact_fault/explosion = 2, - ) + + examine_discovered = span_warning("It appears to be some sort of projectile weapon") //list of projectile exclusive projectiles ///damage each shot does @@ -52,8 +43,8 @@ STAMINA ) -/datum/component/artifact/gun/setup() - var/obj/item/gun/magic/artifact/our_wand = holder +/datum/artifact_effect/gun/setup() + var/obj/item/gun/magic/artifact/our_wand = our_artifact.holder var/obj/item/ammo_casing/casing = our_wand.chambered //randomize our casing casing.click_cooldown_override = rand(LOWEST_POSSIBLE_CLICK_CD, HIGHEST_POSSIBLE_CLICK_CD) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/heal.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/heal.dm index 9177d7dea38e..3b6be292e8ca 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/heal.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/heal.dm @@ -1,14 +1,16 @@ #define PROCESSES_PER_HEAL 5 -/datum/component/artifact/heal - associated_object = /obj/structure/artifact/heal +/datum/artifact_effect/heal weight = ARTIFACT_VERYUNCOMMON - type_name = "Single Healer" + type_name = "Single Healer Effect" activation_message = "starts emitting a soothing aura!" deactivation_message = "becomes silent." valid_activators = list( /datum/artifact_activator/touch/carbon, /datum/artifact_activator/touch/silicon ) + + examine_discovered = span_warning("It appears to heal those who touch it.") + ///list of damage types we heal, this is randomly removed from at setup var/list/damage_types = list( BRUTE, @@ -24,7 +26,7 @@ var/process_count = 0 COOLDOWN_DECLARE(heal_cooldown) -/datum/component/artifact/heal/setup() +/datum/artifact_effect/heal/setup() heal_amount = rand(1,15) potency += heal_amount var/type_amount = prob(75) ? 4 : rand(2,4) //75% to remove 4 types for 1 heal type or 25% for 2 or 4 types removed @@ -33,7 +35,7 @@ damage_types -= pick(damage_types) potency += 5 * (length(damage_types) - 1) -/datum/component/artifact/heal/effect_touched(mob/living/user) +/datum/artifact_effect/heal/effect_touched(mob/living/user) if(!COOLDOWN_FINISHED(src, heal_cooldown)) return var/damage_length = length(damage_types) @@ -43,7 +45,7 @@ new /obj/effect/temp_visual/heal(get_turf(user), COLOR_HEALING_CYAN) COOLDOWN_START(src, heal_cooldown, 5 SECONDS) -/datum/component/artifact/heal/effect_process() +/datum/artifact_effect/heal/effect_process() if(potency < 75) return diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/injector.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/injector.dm index dc30a0192443..668491c31890 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/injector.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/injector.dm @@ -1,18 +1,18 @@ -/datum/component/artifact/injector - associated_object = /obj/structure/artifact/injector +/datum/artifact_effect/injector weight = ARTIFACT_UNCOMMON - type_name = "Injector" + type_name = "Injector Effect" activation_message = "opens up to reveal a large needle!" deactivation_message = "pulls its needle inside, closing itself up." - xray_result = "SEGMENTED" var/max_reagents // the total amount to dose the victim with var/reagent_amount var/list/reagent_datums = list() var/cooldown_time = 10 SECONDS COOLDOWN_DECLARE(activation_cooldown) -/datum/component/artifact/injector/setup() - holder.create_reagents(200, NO_REACT | SEALED_CONTAINER) + examine_discovered = span_warning("It appears to be some sort of chemical injector") + +/datum/artifact_effect/injector/setup() + our_artifact.holder.create_reagents(200, NO_REACT | SEALED_CONTAINER) reagent_amount = rand(10,25) max_reagents = rand(1,2) var/static/list/poisons_and_medicines = list() @@ -20,7 +20,7 @@ for(var/datum/reagent/reagent as anything in (subtypesof(/datum/reagent/toxin) + subtypesof(/datum/reagent/medicine))) if(initial(reagent.chemical_flags) & REAGENT_CAN_BE_SYNTHESIZED) poisons_and_medicines += reagent - switch(artifact_origin.type_name) + switch(our_artifact.artifact_origin.type_name) if(ORIGIN_NARSIE) for(var/i in 1 to max_reagents) reagent_datums += pick(poisons_and_medicines) //cult likes killing people ok @@ -36,12 +36,12 @@ reagent_datums += pick(silicon_reagents) potency += reagent_amount + max_reagents -/datum/component/artifact/injector/effect_touched(mob/living/user) +/datum/artifact_effect/injector/effect_touched(mob/living/user) if(!ishuman(user) || !COOLDOWN_FINISHED(src,activation_cooldown)) - holder.visible_message(span_smallnoticeital("[holder] does not react to [user].")) + our_artifact.holder.visible_message(span_smallnoticeital("[our_artifact.holder] does not react to [user].")) return for(var/reagent in reagent_datums) - holder.reagents.add_reagent(reagent, reagent_amount / reagent_datums.len) - holder.visible_message(span_danger("[holder] pricks [user] with its needle!"), span_userdanger("OW! You are pricked by [holder]!")) - holder.reagents.trans_to(user, holder.reagents.total_volume, transfered_by = holder, methods = INJECT) + our_artifact.holder.reagents.add_reagent(reagent, reagent_amount / reagent_datums.len) + our_artifact.holder.visible_message(span_danger("[our_artifact.holder] pricks [user] with its needle!"), span_userdanger("OW! You are pricked by [our_artifact.holder]!")) + our_artifact.holder.reagents.trans_to(user, our_artifact.holder.reagents.total_volume, transfered_by = our_artifact.holder, methods = INJECT) COOLDOWN_START(src,activation_cooldown,cooldown_time) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/lamp.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/lamp.dm index c62124f20c62..afcd88ee2a83 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/lamp.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/lamp.dm @@ -1,12 +1,13 @@ -/datum/component/artifact/lamp - associated_object = /obj/structure/artifact/lamp +/datum/artifact_effect/lamp weight = ARTIFACT_COMMON type_name = "Lamp" activation_message = "starts shining!" deactivation_message = "stops shining." -/datum/component/artifact/lamp/setup() + examine_discovered = span_warning("It appears to be some sort of light source") + +/datum/artifact_effect/lamp/setup() var/power var/color = pick(COLOR_RED, COLOR_BLUE, COLOR_YELLOW, COLOR_GREEN, COLOR_PURPLE, COLOR_ORANGE) var/range @@ -17,18 +18,18 @@ if(76 to 100) range = rand(4,10) power = rand(2,10) // the sun - - if(artifact_origin.type_name == ORIGIN_NARSIE && prob(40)) + + if(our_artifact.artifact_origin.type_name == ORIGIN_NARSIE && prob(40)) color = COLOR_BLACK - holder.set_light_range_power_color(range, power, color) + our_artifact.holder.set_light_range_power_color(range, power, color) potency += (range + power) * 2 -/datum/component/artifact/lamp/effect_touched(mob/user) - holder.set_light_on(!holder.light_on) //toggle - to_chat(user, span_hear("[holder] clicks.")) +/datum/artifact_effect/lamp/effect_touched(mob/user) + our_artifact.holder.set_light_on(!our_artifact.holder.light_on) //toggle + to_chat(user, span_hear("[our_artifact.holder] clicks.")) -/datum/component/artifact/lamp/effect_activate() - holder.set_light_on(TRUE) +/datum/artifact_effect/lamp/effect_activate() + our_artifact.holder.set_light_on(TRUE) -/datum/component/artifact/lamp/effect_deactivate() - holder.set_light_on(FALSE) +/datum/artifact_effect/lamp/effect_deactivate() + our_artifact.holder.set_light_on(FALSE) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/melee.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/melee.dm index ea9e5a93e826..2f53bbc350d4 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/melee.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/melee.dm @@ -2,33 +2,24 @@ #define SPECIAL_IGNITE "ignite" #define SPECIAL_TELEPORT "teleport" -/datum/component/artifact/melee - associated_object = /obj/item/melee/artifact +/datum/artifact_effect/melee artifact_size = ARTIFACT_SIZE_SMALL - type_name = "Melee Weapon" + type_name = "Melee Weapon Effect" weight = ARTIFACT_VERYUNCOMMON //rare - xray_result = "DENSE" valid_activators = list( /datum/artifact_activator/touch/silicon, /datum/artifact_activator/range/heat, /datum/artifact_activator/range/shock, /datum/artifact_activator/range/radiation ) - valid_faults = list( - /datum/artifact_fault/ignite = 10, - /datum/artifact_fault/warp = 10, - /datum/artifact_fault/reagent/poison = 10, - /datum/artifact_fault/death = 2, - /datum/artifact_fault/tesla_zap = 5, - /datum/artifact_fault/grow = 10, - /datum/artifact_fault/explosion = 2, - ) var/active_force //force when active var/active_reach var/active_woundbonus = 0 -/datum/component/artifact/melee/setup() //RNG incarnate - var/obj/item/melee/artifact/weapon = holder + examine_discovered = span_warning("It appears to be some sort of melee weapon") + +/datum/artifact_effect/melee/setup() //RNG incarnate + var/obj/item/melee/artifact/weapon = our_artifact.holder weapon.special_cooldown_time = rand(3,8) SECONDS active_force = rand(-10,30) weapon.demolition_mod = rand(-1.0, 2.0) @@ -58,15 +49,15 @@ potency += 15 weapon.special = pick(SPECIAL_LAUNCH, SPECIAL_IGNITE, SPECIAL_TELEPORT) -/datum/component/artifact/melee/effect_activate() - var/obj/item/melee/artifact/weapon = holder +/datum/artifact_effect/melee/effect_activate() + var/obj/item/melee/artifact/weapon = our_artifact.holder weapon.reach = active_reach weapon.force = active_force weapon.wound_bonus = active_woundbonus weapon.throwforce = weapon.force -/datum/component/artifact/melee/effect_deactivate() - var/obj/item/melee/artifact/weapon = holder +/datum/artifact_effect/melee/effect_deactivate() + var/obj/item/melee/artifact/weapon = our_artifact.holder weapon.force = active_force / 3 weapon.throwforce = weapon.force weapon.reach = 1 diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm index 412b52123822..2999d240e7ab 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm @@ -1,18 +1,17 @@ -/datum/component/artifact/repulsor - associated_object = /obj/structure/artifact/repulsor +/datum/artifact_effect/repulsor weight = ARTIFACT_COMMON - type_name = "Repulsor/Impulsor" + type_name = "Repulsor/Impulsor Effect" activation_message = "opens up, a weird aura starts emitting from it!" deactivation_message = "closes up." - xray_result = "SEGMENTED" var/attract = FALSE //if FALSE, repulse, otherwise, attract var/strength var/range var/cooldown_time COOLDOWN_DECLARE(cooldown) -/datum/component/artifact/repulsor/setup() + examine_discovered = span_warning("It appears to be some object mover") +/datum/artifact_effect/repulsor/setup() attract = prob(40) range = rand(1,3) cooldown_time = rand(3,5) SECONDS @@ -20,40 +19,32 @@ potency += cooldown_time / 4 + strength / 3000 addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), round(20 * (potency * 10) SECONDS)) -/datum/component/artifact/repulsor/effect_touched(mob/user) +/datum/artifact_effect/repulsor/effect_touched(mob/user) if(!COOLDOWN_FINISHED(src,cooldown)) return pulse() COOLDOWN_START(src,cooldown,cooldown_time) -/datum/component/artifact/repulsor/effect_process() +/datum/artifact_effect/repulsor/effect_process() . = ..() if(prob(100 - potency)) return pulse() -/datum/component/artifact/repulsor/RegisterWithParent() - . = ..() - RegisterSignal(parent, COMSIG_ATOM_HITBY, PROC_REF(pulse)) - -/datum/component/artifact/repulsor/UnregisterFromParent() - . = ..() - UnregisterSignal(parent, COMSIG_ATOM_HITBY) - -/datum/component/artifact/repulsor/proc/pulse(datum/source,atom/movable/thrown, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +/datum/artifact_effect/repulsor/proc/pulse(datum/source,atom/movable/thrown, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) SIGNAL_HANDLER - if(!active) + if(!our_artifact.active) return - holder.visible_message(span_warning("[holder] emits a pulse of energy, throwing things [attract ? "towards it!" : "away from it!"]")) - var/owner_turf = get_turf(holder) + our_artifact.holder.visible_message(span_warning("[our_artifact.holder] emits a pulse of energy, throwing things [attract ? "towards it!" : "away from it!"]")) + var/owner_turf = get_turf(our_artifact.holder) if(isnull(thrown)) - for(var/atom/movable/throwee in oview(range,holder)) + for(var/atom/movable/throwee in oview(range,our_artifact.holder)) if(throwee.anchored) continue if(attract) - throwee.safe_throw_at(holder, strength / 3000, 1, force = strength) + throwee.safe_throw_at(our_artifact.holder, strength / 3000, 1, force = strength) else var/throwtarget = get_edge_target_turf(get_turf(throwee), get_dir(owner_turf, get_step_away(throwee, owner_turf))) throwee.safe_throw_at(throwtarget, strength / 3000, 1, force = strength) else if(throwingdatum?.thrower) - thrown.safe_throw_at(throwingdatum.thrower, get_dist(holder, throwingdatum.thrower), 1, force = strength) + thrown.safe_throw_at(throwingdatum.thrower, get_dist(our_artifact.holder, throwingdatum.thrower), 1, force = strength) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/smoke_artifacts.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/smoke_artifacts.dm index 9255e0a53706..7c8f9206e4a8 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/smoke_artifacts.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/smoke_artifacts.dm @@ -1,10 +1,11 @@ -/datum/component/artifact/smoke - associated_object = /obj/structure/artifact/smoke +/datum/artifact_effect/smoke weight = ARTIFACT_UNCOMMON - type_name = "Smoke Machine" + type_name = "Smoke Machine Effect" activation_message = "starts spewing out smoke!" deactivation_message = "becomes silent." + examine_discovered = span_warning("It appears to be some sort of checmical aerolyzer") + var/list/valid_chemicals = list( /datum/reagent/colorful_reagent, /datum/reagent/colorful_reagent/powder/black, @@ -19,7 +20,7 @@ var/list/chemicals = list() var/smoke_range = 3 -/datum/component/artifact/smoke/setup() +/datum/artifact_effect/smoke/setup() per_chemical_amount = rand(5, 10) chemicals_chosen = rand(1, 5) smoke_range = rand(1, 5) @@ -28,13 +29,12 @@ for(var/i = 1 to chemicals_chosen) chemicals += pick(valid_chemicals) -/datum/component/artifact/smoke/effect_activate(silent) +/datum/artifact_effect/smoke/effect_activate(silent) for(var/chemical in chemicals) - do_chem_smoke(smoke_range, holder = holder, location = get_turf(holder), reagent_type = chemical, reagent_volume = per_chemical_amount, log = TRUE) - artifact_deactivate() + do_chem_smoke(smoke_range, holder = our_artifact.holder, location = get_turf(our_artifact.holder), reagent_type = chemical, reagent_volume = per_chemical_amount, log = TRUE) + our_artifact.artifact_deactivate() -/datum/component/artifact/smoke/toxin - associated_object = /obj/structure/artifact/smoke/toxin +/datum/artifact_effect/smoke/toxin weight = ARTIFACT_RARE activation_message = "starts spewing out toxic smoke!" valid_chemicals = list( @@ -44,16 +44,14 @@ /datum/reagent/toxin/spewium, ) -/datum/component/artifact/smoke/flesh - associated_object = /obj/structure/artifact/smoke/flesh +/datum/artifact_effect/smoke/flesh weight = ARTIFACT_RARE activation_message = "starts spewing out flesh mending smoke!" valid_chemicals = list( /datum/reagent/medicine/c2/synthflesh ) -/datum/component/artifact/smoke/exotic - associated_object = /obj/structure/artifact/smoke/exotic +/datum/artifact_effect/smoke/exotic weight = ARTIFACT_RARE activation_message = "starts spewing out exotic smoke!" valid_chemicals = list( diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/surgery.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/surgery.dm index 8164e16fce72..f62b94cb2dc4 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/surgery.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/surgery.dm @@ -1,7 +1,6 @@ -/datum/component/artifact/surgery - associated_object = /obj/structure/artifact/surgery +/datum/artifact_effect/surgery weight = ARTIFACT_VERYUNCOMMON - type_name = "Surgery Object" + type_name = "Surgery Object Effect" activation_message = "springs to life!" deactivation_message = "becomes silent." valid_activators = list( @@ -10,14 +9,15 @@ ) COOLDOWN_DECLARE(surgery_cooldown) + examine_discovered = span_warning("It appears to be some sort of automated surgery device") -/datum/component/artifact/surgery/effect_touched(mob/living/user) +/datum/artifact_effect/surgery/effect_touched(mob/living/user) if(!COOLDOWN_FINISHED(src, surgery_cooldown)) - holder.visible_message(span_notice("[holder] wheezes, shutting down.")) + our_artifact.holder.visible_message(span_notice("[our_artifact.holder] wheezes, shutting down.")) return if(!ishuman(user)) return var/mob/living/carbon/human/human = user - human.bioscramble(holder.name) + human.bioscramble(our_artifact.holder.name) COOLDOWN_START(src,surgery_cooldown, 5 SECONDS) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/vomit.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/vomit.dm index 24b901492867..dd2b17c65c2a 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/vomit.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/vomit.dm @@ -1,7 +1,6 @@ -/datum/component/artifact/vomit - associated_object = /obj/structure/artifact/vomit +/datum/artifact_effect/vomit weight = ARTIFACT_UNCOMMON - type_name = "Vomiting Inducer" + type_name = "Vomiting Inducer Effect" activation_message = "starts emitting disgusting imagery!" deactivation_message = "falls silent, its aura dissipating!" valid_origins = list( @@ -15,7 +14,9 @@ var/bloody_vomit = FALSE COOLDOWN_DECLARE(cooldown) -/datum/component/artifact/vomit/setup() + examine_discovered = span_warning("It appears to be some sort of sick prank") + +/datum/artifact_effect/vomit/setup() switch(rand(1,100)) if(1 to 84) range = rand(2,3) @@ -31,16 +32,8 @@ potency += (range) * 4 addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/component/artifact, artifact_deactivate)), round(30 * (potency * 10) SECONDS)) -/datum/component/artifact/vomit/on_examine(atom/source, mob/user, list/examine_list) - . = ..() - var/mob/living/carbon/carbon = user - if(active && istype(carbon) && carbon.stat < UNCONSCIOUS) - examine_list += span_warning("It has an [spew_organs ? "extremely" : ""] disgusting aura! [prob(20) ? "..is that a felinid?" : ""]") - carbon.vomit(blood = bloody_vomit, stun = (spew_organs ? TRUE : prob(25)), distance = spew_range) - if(spew_organs && prob(40)) - carbon.spew_organ() -/datum/component/artifact/vomit/effect_process() +/datum/artifact_effect/vomit/effect_process() for(var/mob/living/carbon/viewed in view(range, src)) if(prob(100 - potency)) continue diff --git a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_cell.dm b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_cell.dm index 5f20f628b830..548893c6eaca 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_cell.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_cell.dm @@ -4,7 +4,8 @@ resistance_flags = LAVA_PROOF | ACID_PROOF | INDESTRUCTIBLE ratingdesc = FALSE charge_light_type = null - var/datum/component/artifact/assoc_comp = /datum/component/artifact/cell + var/forced_effect = /datum/artifact_effect/cell + var/datum/component/artifact/assoc_comp = /datum/component/artifact ARTIFACT_SETUP(/obj/item/stock_parts/cell/artifact, SSobj) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_gun.dm b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_gun.dm index 37c02bba1e0d..567b619e2446 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_gun.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_gun.dm @@ -4,7 +4,7 @@ /obj/item/ammo_casing/magic/artifact/ready_proj(atom/target, mob/living/user, quiet, zone_override = "", atom/fired_from) if(!loaded_projectile) return - var/datum/component/artifact/gun/gun = fired_from.GetComponent(/datum/component/artifact/gun) + var/datum/artifact_effect/gun/gun = fired_from.GetComponent(/datum/artifact_effect/gun)//todo: this wont work loaded_projectile.damage = gun.damage / pellets loaded_projectile.icon_state = gun.projectile_icon loaded_projectile.damage_type = gun.dam_type @@ -39,7 +39,8 @@ pinless = TRUE recharge_rate = 1 antimagic_flags = null - var/datum/component/artifact/assoc_comp = /datum/component/artifact/gun + var/forced_effect = /datum/artifact_effect/gun + var/datum/component/artifact/assoc_comp = /datum/component/artifact ARTIFACT_SETUP(/obj/item/gun/magic/artifact, SSobj) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_melee.dm b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_melee.dm index 3ad1b89385d4..b79739573a28 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_melee.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_items/artifact_melee.dm @@ -12,7 +12,8 @@ righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' var/special_cooldown_time var/special - var/datum/component/artifact/assoc_comp = /datum/component/artifact/melee + var/forced_effect = /datum/artifact_effect/melee + var/datum/component/artifact/assoc_comp = /datum/component/artifact COOLDOWN_DECLARE(special_cooldown) ARTIFACT_SETUP(/obj/item/melee/artifact, SSobj) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_objects/artifact_powergen.dm b/monkestation/code/modules/art_sci_overrides/artifact_objects/artifact_powergen.dm index b2a37bb18adc..d6cad2df8636 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_objects/artifact_powergen.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_objects/artifact_powergen.dm @@ -10,12 +10,11 @@ circuit = null density = TRUE anchored = FALSE - var/datum/component/artifact/assoc_comp = /datum/component/artifact/generator - + var/forced_effect = /datum/artifact_effect/generator + var/datum/component/artifact/assoc_comp = /datum/component/artifact ARTIFACT_SETUP(/obj/machinery/power/generator_artifact, SSmachines) -/datum/component/artifact/generator - associated_object = /obj/machinery/power/generator_artifact +/datum/artifact_effect/generator type_name = "Power Generator" weight = ARTIFACT_RARE valid_activators = list( @@ -31,14 +30,13 @@ ARTIFACT_SETUP(/obj/machinery/power/generator_artifact, SSmachines) ) //narnar doesnt need power activation_message = "begins emitting a faint, droning hum." deactivation_message = "shortcircuits!" - xray_result = "COMPLEX" COOLDOWN_DECLARE(sideeffect_cooldown) var/power_gen = 0 ///does the power output fluctuate var/unstable_generation = FALSE -/datum/component/artifact/generator/setup() //TODO: Make this use some weird scaling math to have it pick higher numbers at lower odds +/datum/artifact_effect/generator/setup() //TODO: Make this use some weird scaling math to have it pick higher numbers at lower odds if(prob(65)) power_gen = rand(1 KW, MAX_POSSIBLE_GEN / 2) else @@ -46,42 +44,42 @@ ARTIFACT_SETUP(/obj/machinery/power/generator_artifact, SSmachines) unstable_generation = prob(40) potency = power_gen / (6 KW) // 100 potency at 600kw generation -/datum/component/artifact/generator/effect_touched(mob/living/user) - var/obj/machinery/power/generator_artifact/powerholder = holder +/datum/artifact_effect/generator/effect_touched(mob/living/user) + var/obj/machinery/power/generator_artifact/powerholder = our_artifact.holder //if on cable and not setup, connect and setup if(!powerholder.anchored && locate(/obj/structure/cable) in get_turf(powerholder)) - powerholder.visible_message(span_warning("[holder] seems to snap to the cable!")) + powerholder.visible_message(span_warning("[our_artifact.holder] seems to snap to the cable!")) playsound(get_turf(powerholder), 'sound/items/deconstruct.ogg', 50, TRUE) powerholder.anchored = TRUE powerholder.connect_to_network() return - holder.Beam(user, icon_state = "lightning[rand(1,12)]", time = 0.5 SECONDS) + our_artifact.holder.Beam(user, icon_state = "lightning[rand(1,12)]", time = 0.5 SECONDS) playsound(get_turf(powerholder), 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) var/damage = user.electrocute_act(power_gen / 2 KW, powerholder, flags = SHOCK_NOSTUN) - to_chat(user, span_userdanger("You are hit by a burst of electricity from [holder]!")) + to_chat(user, span_userdanger("You are hit by a burst of electricity from [our_artifact.holder]!")) if(damage > 80) - var/turf/owner_turf = get_turf(holder) + var/turf/owner_turf = get_turf(our_artifact.holder) var/throwtarget = get_edge_target_turf(get_turf(user), get_dir(owner_turf, get_step_away(user, owner_turf))) user.safe_throw_at(throwtarget, power_gen / 38 KW, 1, force = MOVE_FORCE_EXTREMELY_STRONG) if(damage > 400 && prob(50)) user.dust(just_ash = TRUE, drop_items = TRUE) - artifact_deactivate() //shortcircuit + our_artifact.artifact_deactivate() //shortcircuit if(prob(20)) //try to get yourself shocked with insuls many times to shortcircuit it (in retrospect this sucks) - artifact_deactivate() + our_artifact.artifact_deactivate() -/datum/component/artifact/generator/effect_process() //todo add more - if(!holder.anchored) +/datum/artifact_effect/generator/effect_process() //todo add more + if(!our_artifact.holder.anchored) return - var/obj/machinery/power/generator_artifact/powerholder = holder + var/obj/machinery/power/generator_artifact/powerholder = our_artifact.holder powerholder.add_avail(power_gen * (unstable_generation ? rand(0.1, 1) : 1)) if(power_gen < SIDEEFFECT_THRESHOLD || !COOLDOWN_FINISHED(src,sideeffect_cooldown)) //sorry boss no can do return COOLDOWN_START(src,sideeffect_cooldown,rand(4,8) SECONDS) //minor to medium side effects if(power_gen >= (SHITFUCK_THRESHOLD / 3)) - powerholder.visible_message(span_danger("\The [holder] lets out a shower of thunder!"), span_hear("You hear a loud electrical crack!")) + powerholder.visible_message(span_danger("\The [our_artifact.holder] lets out a shower of thunder!"), span_hear("You hear a loud electrical crack!")) playsound(get_turf(powerholder), 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) tesla_zap(powerholder, rand(2,3), power_gen / 3500) @@ -97,12 +95,12 @@ ARTIFACT_SETUP(/obj/machinery/power/generator_artifact, SSmachines) merger.assert_gas(/datum/gas/carbon_dioxide) merger.gases[/datum/gas/carbon_dioxide][MOLES] = rand(10,120) merger.temperature = rand(200,1000) - var/turf/holder_turf = get_turf(holder) + var/turf/holder_turf = get_turf(our_artifact.holder) holder_turf.assume_air(merger) -/datum/component/artifact/generator/effect_deactivate() - var/obj/machinery/power/generator_artifact/powerholder = holder +/datum/artifact_effect/generator/effect_deactivate() + var/obj/machinery/power/generator_artifact/powerholder = our_artifact.holder powerholder.disconnect_from_network() powerholder.anchored = FALSE playsound(get_turf(powerholder), 'sound/items/deconstruct.ogg', 50, TRUE) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_testers/analysis_form.dm b/monkestation/code/modules/art_sci_overrides/artifact_testers/analysis_form.dm index 871bd0f8eb03..eddce11ce3f2 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_testers/analysis_form.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_testers/analysis_form.dm @@ -34,7 +34,7 @@ contraband = STICKER_NOSPAWN var/chosen_origin = "" var/list/chosentriggers = list() - var/chosentype = "" + var/list/chosen_effects = list() /obj/item/sticker/analysis_form/attackby(obj/item/item, mob/living/user, params) if(istype(item, /obj/item/pen)) @@ -59,13 +59,17 @@ if("origin") chosen_origin = params["origin"] if("type") - chosentype = params["type"] + var/trig_type = params["type"] + if(trig_type in chosen_effects) + chosen_effects-= trig_type + else + chosen_effects += trig_type if("trigger") - var/trig = params["trigger"] - if(trig in chosentriggers) - chosentriggers -= trig + var/trig_act = params["trigger"] + if(trig_act in chosentriggers) + chosentriggers -= trig_act else - chosentriggers += trig + chosentriggers += trig_act if(attached) analyze_attached() @@ -80,7 +84,7 @@ trigger_names += initial(subtype.name) var/list/artifact_names = list() - for(var/datum/component/artifact/subtype as anything in subtypesof(/datum/component/artifact)) + for(var/datum/artifact_effect/subtype as anything in subtypesof(/datum/artifact_effect)) artifact_names += initial(subtype.type_name) .["allorigins"] = origins_names @@ -91,7 +95,7 @@ /obj/item/sticker/analysis_form/ui_data(mob/user) . = ..() .["chosenorigin"] = chosen_origin - .["chosentype"] = chosentype + .["chosentype"] = chosen_effects .["chosentriggers"] = chosentriggers return . @@ -154,8 +158,8 @@ return if(chosen_origin) to_analyze.holder.name = to_analyze.generated_name - if(chosentype) - to_analyze.holder.name += " ([chosentype])" + if(chosen_effects) + to_analyze.holder.name += " ([chosen_effects])" /obj/item/sticker/analysis_form/proc/deanalyze_attached() var/datum/component/artifact/to_analyze = attached.GetComponent(/datum/component/artifact) @@ -164,31 +168,37 @@ to_analyze.holder.name = to_analyze.fake_name /obj/item/sticker/analysis_form/proc/get_export_value(datum/component/artifact/art) - var/correct = 0 - var/total_guesses = 0 - + var/baseval = CARGO_CRATE_VALUE + var/labeling_bonus = round(CARGO_CRATE_VALUE * 0.5) + var/bonus = 0 + for(var/datum/artifact_effect/discovered in art.discovered_effects) + if(discovered.discovered_credits) + bonus += round(discovered.discovered_credits * (discovered.potency/50)) + if(art.chosen_fault && art.fault_discovered) + bonus += art.chosen_fault.discovered_credits if(art.artifact_origin.type_name == chosen_origin) - correct ++ - if(chosen_origin) - total_guesses ++ - if(chosentype) - total_guesses ++ - if(art.type_name == chosentype) - correct ++ - for(var/name in chosentriggers) - total_guesses++ - - for(var/datum/artifact_activator/listed in art.activators) - if(listed.name != name) - continue - correct++ - - var/incorrect = total_guesses - correct - return round((CARGO_CRATE_VALUE/4) * art.potency * (max((ARTIFACT_COMMON - art.weight) * 0.01, 0.01) * max(correct - incorrect, 0.01))) + bonus += labeling_bonus + else + bonus -= labeling_bonus + if(chosen_effects) + for(var/name_effect in chosen_effects) + for(var/datum/artifact_effect/effect in art.artifact_effects) + if(effect.type_name != name_effect) + bonus -= labeling_bonus + else + bonus += labeling_bonus + if(chosentriggers) + for(var/name_trigger in chosentriggers) + for(var/datum/artifact_activator/activator in art.activators) + if(activator.name != name_trigger) + bonus -= labeling_bonus + else + bonus += labeling_bonus + return round(baseval + bonus) /obj/item/analysis_bin name = "analysis bin" - desc = "A bin made out of material to resist adhesion, for artifact analysis forms." + desc = "A bin containing a seemingly endless supply of fourms for artifact labeling. Correctly labeled artifacts sell for more!" icon = 'icons/obj/service/bureaucracy.dmi' icon_state = "analysisbin1" base_icon_state = "analysisbin" @@ -196,33 +206,24 @@ lefthand_file = 'icons/mob/inhands/items/sheets_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/sheets_righthand.dmi' w_class = WEIGHT_CLASS_NORMAL - var/forms = 15 - var/form_type = /obj/item/sticker/analysis_form + var/form_type = /obj/item/sticker/analysis_form /obj/item/analysis_bin/Initialize(mapload) . = ..() interaction_flags_item &= ~INTERACT_ITEM_ATTACK_HAND_PICKUP AddElement(/datum/element/drag_pickup) -/obj/item/analysis_bin/update_icon_state() - icon_state = "[base_icon_state][forms > 0]" - return ..() - /obj/item/analysis_bin/attack_hand(mob/user, list/modifiers) if(isliving(user)) var/mob/living/living_mob = user if(!(living_mob.mobility_flags & MOBILITY_PICKUP)) return - if(forms) - forms-- - var/obj/item/form = new form_type - form.add_fingerprint(user) - form.forceMove(user.loc) - user.put_in_hands(form) - balloon_alert(user, "took form") - update_appearance() - else - balloon_alert(user, "empty!") + var/obj/item/form = new form_type + form.add_fingerprint(user) + form.forceMove(user.loc) + user.put_in_hands(form) + balloon_alert(user, "took form") + update_appearance() add_fingerprint(user) return ..() @@ -232,7 +233,6 @@ return qdel(item) balloon_alert(user, "form returned") - forms++ update_appearance() else return ..() diff --git a/monkestation/code/modules/art_sci_overrides/artifact_testers/xray.dm b/monkestation/code/modules/art_sci_overrides/artifact_testers/xray.dm index 70d25ee3243d..b1876ed02c45 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_testers/xray.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_testers/xray.dm @@ -107,7 +107,25 @@ COOLDOWN_START(src,pulse_cooldown,pulse_cooldown_time) pulsing = FALSE if(artifact) - last_results = list("STRUCTURAL ABNORMALITY ANALYSIS: [artifact.xray_result]", "SIZE: [artifact.artifact_size < ARTIFACT_SIZE_LARGE ? "SMALL" : "LARGE" ]") + if(!artifact.fault_discovered) + artifact.freebies = 0 //No more freebies, you know what it does now. + artifact.fault_discovered = TRUE + if(artifact.chosen_fault) + last_results = list("ARTIFACT FAULT DISCOVERED: [artifact.chosen_fault.name]", "SIZE: [artifact.artifact_size < ARTIFACT_SIZE_LARGE ? "SMALL" : "LARGE" ]") + else + last_results = list("FLAWLESS ARTIFACT. NO FAULTS.", "SIZE: [artifact.artifact_size < ARTIFACT_SIZE_LARGE ? "SMALL" : "LARGE" ]") + if(length(artifact.discovered_effects) != length(artifact.artifact_effects)) + for(var/datum/artifact_effect/eff in artifact.artifact_effects) + artifact.discovered_effects += eff.type + last_results += "ARTIFACT EFFECTS REVEALED." + if(!length(artifact.artifact_effects)) + last_results += "MUNDANE ARTIFACT DETECTED. NO NOTEABLE EFFECTS." + if(length(artifact.artifact_effects) != length(artifact.activators)) + for(var/datum/artifact_activator/activator in artifact.activators) + artifact.discovered_activators += activator.type + last_results += "ARTIFACT ACTIVATORS REVEALED." + last_results+= "WARNING: ARTIFACT FAULT NOW ACTIVE." + else last_results = list("INCONCLUSIVE;", "NO SPECIAL PROPERTIES DETECTED") diff --git a/monkestation/code/modules/art_sci_overrides/faults/_fault.dm b/monkestation/code/modules/art_sci_overrides/faults/_fault.dm index 607340139449..d19361620900 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/_fault.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/_fault.dm @@ -4,12 +4,14 @@ var/visible_message ///the chance of us triggering on bad info var/trigger_chance = 0 + //how many credits do we get for discovering this? Should be negative. + var/discovered_credits = 0 /datum/artifact_fault/proc/on_trigger(datum/component/artifact/component) return /datum/artifact_fault/shutdown - name = "Generic Shutdown Fault" + name = "Random Shutdown Fault" /datum/artifact_fault/on_trigger(datum/component/artifact/component) if(component.active) diff --git a/monkestation/code/modules/art_sci_overrides/faults/explosion.dm b/monkestation/code/modules/art_sci_overrides/faults/explosion.dm index f7c028e58860..80d934963ba6 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/explosion.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/explosion.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/explosion - name = "Explode" + name = "Exploding Fault" trigger_chance = 3 visible_message = "reaches a catastrophic overload, cracks forming at its surface!" diff --git a/monkestation/code/modules/art_sci_overrides/faults/ignite.dm b/monkestation/code/modules/art_sci_overrides/faults/ignite.dm index 631f17f850ae..cdf93985d02d 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/ignite.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/ignite.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/ignite - name = "Combust" + name = "Combustion Fault" trigger_chance = 9 visible_message = "starts rapidly heating up while covering everything around it in something that seems to be oil." diff --git a/monkestation/code/modules/art_sci_overrides/faults/just_death.dm b/monkestation/code/modules/art_sci_overrides/faults/just_death.dm index 8b7b2f8d3c45..5cee026da6d7 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/just_death.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/just_death.dm @@ -1,6 +1,6 @@ /datum/artifact_fault/death - name = "Instant Death" - trigger_chance = 1 + name = "Instant Death Fault" + trigger_chance = 0.5 visible_message = "blows someone up with mind." /datum/artifact_fault/death/on_trigger(datum/component/artifact/component) diff --git a/monkestation/code/modules/art_sci_overrides/faults/reagents.dm b/monkestation/code/modules/art_sci_overrides/faults/reagents.dm index c2ab103e18cb..e8bde1bec05e 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/reagents.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/reagents.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/reagent - name = "Generic Reagent Injector" + name = "Chemical Force Injector Fault" trigger_chance = 15 visible_message = "shoots a syringe out." var/list/reagents = list() diff --git a/monkestation/code/modules/art_sci_overrides/faults/say.dm b/monkestation/code/modules/art_sci_overrides/faults/say.dm index fca9f1d6e653..4facf5679628 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/say.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/say.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/speech - name = "Generic Speech" + name = "Talkative Fault" trigger_chance = 30 var/list/speech = list() diff --git a/monkestation/code/modules/art_sci_overrides/faults/size_change.dm b/monkestation/code/modules/art_sci_overrides/faults/size_change.dm index 847a555801ef..76f762177aad 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/size_change.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/size_change.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/shrink - name = "Shrink" + name = "Shrinking Fault" trigger_chance = 13 visible_message = "starts to shrink." @@ -14,7 +14,7 @@ qdel(component.holder) /datum/artifact_fault/grow - name = "Grow" + name = "Growing Fault" trigger_chance = 13 visible_message = "starts to grow." diff --git a/monkestation/code/modules/art_sci_overrides/faults/warps.dm b/monkestation/code/modules/art_sci_overrides/faults/warps.dm index 6014fc2a03eb..2929b8c8b561 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/warps.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/warps.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/warp - name = "Generic Warp Artifact" + name = "Warping Fault" trigger_chance = 12 visible_message = "warps space sending everyone away." var/list/warp_areas = list() diff --git a/monkestation/code/modules/art_sci_overrides/faults/whispers.dm b/monkestation/code/modules/art_sci_overrides/faults/whispers.dm index b85fd5b57427..36bd6702d4b8 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/whispers.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/whispers.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/whisper - name = "Generic Whisper" + name = "Wispering Fault" trigger_chance = 30 var/list/whispers = list() diff --git a/monkestation/code/modules/art_sci_overrides/faults/zap.dm b/monkestation/code/modules/art_sci_overrides/faults/zap.dm index 303bb44c248c..dfdafe8260b0 100644 --- a/monkestation/code/modules/art_sci_overrides/faults/zap.dm +++ b/monkestation/code/modules/art_sci_overrides/faults/zap.dm @@ -1,5 +1,5 @@ /datum/artifact_fault/tesla_zap - name = "Tesla Zap" + name = "Energetic Discharge Fault" trigger_chance = 12 visible_message = "discharges a large amount of electricity." diff --git a/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm b/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm index 6443ef06db38..05b7a53ffe0e 100644 --- a/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm +++ b/monkestation/code/modules/art_sci_overrides/generic_artifact_objects.dm @@ -6,7 +6,8 @@ resistance_flags = LAVA_PROOF | ACID_PROOF | INDESTRUCTIBLE anchored = FALSE density = TRUE - var/datum/component/artifact/assoc_comp + var/datum/artifact_effect/forced_effect + var/datum/component/artifact/assoc_comp = /datum/component/artifact var/mutable_appearance/extra_effect ARTIFACT_SETUP(/obj/structure/artifact, SSobj) @@ -22,54 +23,54 @@ ARTIFACT_SETUP(/obj/structure/artifact, SSobj) qdel(src) /obj/structure/artifact/bonk - assoc_comp = /datum/component/artifact/bonk + forced_effect = /datum/artifact_effect/bonk /obj/structure/artifact/bomb - assoc_comp = /datum/component/artifact/bomb/explosive + forced_effect = /datum/artifact_effect/bomb/explosive /obj/structure/artifact/bomb/devastating - assoc_comp = /datum/component/artifact/bomb/explosive/devastating + forced_effect = /datum/artifact_effect/bomb/explosive/devastating /obj/structure/artifact/bomb/gas - assoc_comp = /datum/component/artifact/bomb/gas + forced_effect = /datum/artifact_effect/bomb/gas /obj/structure/artifact/forcegen - assoc_comp = /datum/component/artifact/forcegen + forced_effect = /datum/artifact_effect/forcegen /obj/structure/artifact/heal - assoc_comp = /datum/component/artifact/heal + forced_effect = /datum/artifact_effect/heal /obj/structure/artifact/injector - assoc_comp = /datum/component/artifact/injector + forced_effect = /datum/artifact_effect/injector /obj/structure/artifact/lamp - assoc_comp = /datum/component/artifact/lamp + forced_effect = /datum/artifact_effect/lamp light_system = OVERLAY_LIGHT light_on = FALSE /obj/structure/artifact/repulsor - assoc_comp = /datum/component/artifact/repulsor + forced_effect = /datum/artifact_effect/repulsor /obj/structure/artifact/vomit - assoc_comp = /datum/component/artifact/vomit + forced_effect = /datum/artifact_effect/vomit /obj/structure/artifact/borger - assoc_comp = /datum/component/artifact/borger + forced_effect = /datum/artifact_effect/borger /obj/structure/artifact/emotegen - assoc_comp = /datum/component/artifact/emotegen + forced_effect = /datum/artifact_effect/emotegen /obj/structure/artifact/surgery - assoc_comp = /datum/component/artifact/surgery + forced_effect = /datum/artifact_effect/surgery /obj/structure/artifact/smoke - assoc_comp = /datum/component/artifact/smoke + forced_effect = /datum/artifact_effect/smoke /obj/structure/artifact/smoke/toxin - assoc_comp = /datum/component/artifact/smoke/toxin + forced_effect = /datum/artifact_effect/smoke/toxin /obj/structure/artifact/smoke/flesh - assoc_comp = /datum/component/artifact/smoke/flesh + forced_effect = /datum/artifact_effect/smoke/flesh /obj/structure/artifact/smoke/exotic - assoc_comp = /datum/component/artifact/smoke/exotic + forced_effect = /datum/artifact_effect/smoke/exotic diff --git a/monkestation/code/modules/art_sci_overrides/globals.dm b/monkestation/code/modules/art_sci_overrides/globals.dm index 25627d3e71a6..c8353234392e 100644 --- a/monkestation/code/modules/art_sci_overrides/globals.dm +++ b/monkestation/code/modules/art_sci_overrides/globals.dm @@ -1,2 +1,2 @@ -GLOBAL_LIST_INIT(artifact_rarity, list()) +GLOBAL_LIST_INIT(artifact_effect_rarity, list()) GLOBAL_LIST_INIT(running_artifact_list, list()) diff --git a/monkestation/code/modules/art_sci_overrides/new_procs.dm b/monkestation/code/modules/art_sci_overrides/new_procs.dm index 18826afdf0db..1baee5b1f909 100644 --- a/monkestation/code/modules/art_sci_overrides/new_procs.dm +++ b/monkestation/code/modules/art_sci_overrides/new_procs.dm @@ -1,7 +1,7 @@ /proc/random_rgb_pairlists(list/red_pairs, list/green_pairs, list/blue_pairs, list/alpha_pairs) if(!length(red_pairs) || !length(blue_pairs) || !length(green_pairs) || !length(alpha_pairs)) return COLOR_CULT_RED - + if(!length(red_pairs) >= 2) red_pairs[2] = 255 if(!length(blue_pairs) >= 2) @@ -22,31 +22,23 @@ /proc/spawn_artifact(turf/loc, forced_origin) if (!loc) return - if(!length(GLOB.artifact_rarity)) + if(!length(GLOB.artifact_effect_rarity)) build_weighted_rarities() - var/list/weighted_list - - if(forced_origin) - weighted_list = GLOB.artifact_rarity[forced_origin] - else - weighted_list = GLOB.artifact_rarity["all"] - - var/datum/component/artifact/picked = pick_weight(weighted_list) - var/type = initial(picked.associated_object) - return new type(loc) + var/obj/structure/artifact/A = new(loc,forced_origin) + return A /proc/build_weighted_rarities() - GLOB.artifact_rarity["all"] = list() ///this needs to be created first for indexing sake + GLOB.artifact_effect_rarity["all"] = list() ///this needs to be created first for indexing sake for(var/datum/artifact_origin/origin as anything in subtypesof(/datum/artifact_origin)) - GLOB.artifact_rarity[initial(origin.type_name)] = list() + GLOB.artifact_effect_rarity[initial(origin.type_name)] = list() - for(var/datum/component/artifact/artifact_type as anything in subtypesof(/datum/component/artifact)) - var/weight = initial(artifact_type.weight) + for(var/datum/artifact_effect/artifact_effect as anything in subtypesof(/datum/artifact_effect)) + var/weight = initial(artifact_effect.weight) if(!weight) continue - GLOB.artifact_rarity["all"][artifact_type] = weight - for(var/origin in GLOB.artifact_rarity) - if(origin in initial(artifact_type.valid_origins)) - GLOB.artifact_rarity[origin][artifact_type] = weight + GLOB.artifact_effect_rarity["all"][artifact_effect] = weight + for(var/origin in GLOB.artifact_effect_rarity) + if(origin in initial(artifact_effect.valid_origins)) + GLOB.artifact_effect_rarity[origin][artifact_effect] = weight diff --git a/tgstation.dme b/tgstation.dme index 28f3d64a634f..1e2b729114e5 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6193,6 +6193,7 @@ #include "monkestation\code\modules\art_sci_overrides\activators\_base.dm" #include "monkestation\code\modules\art_sci_overrides\activators\range.dm" #include "monkestation\code\modules\art_sci_overrides\activators\touch.dm" +#include "monkestation\code\modules\art_sci_overrides\artifact_components\_artifact_effect.dm" #include "monkestation\code\modules\art_sci_overrides\artifact_components\_base_component.dm" #include "monkestation\code\modules\art_sci_overrides\artifact_components\_base_component_signal_procs.dm" #include "monkestation\code\modules\art_sci_overrides\artifact_components\_base_subtype_helpers.dm" diff --git a/tgui/packages/tgui/interfaces/ArtifactForm.jsx b/tgui/packages/tgui/interfaces/ArtifactForm.jsx index 6da89c9386e4..95c701697613 100644 --- a/tgui/packages/tgui/interfaces/ArtifactForm.jsx +++ b/tgui/packages/tgui/interfaces/ArtifactForm.jsx @@ -35,9 +35,9 @@ export const ArtifactForm = (props) => { {alltypes.map((x) => (