Artifact Tweaks (#17077)

* fixes a critical bug with artifact triggers

* Gets rid of gas activated anomalies

Feedback has been overwhelming negative for gas trigger anomalies, so they have been removed. (I expected this. See: My coder comments) but wanted to give it a chance since more xenoarch players were coming into the scene.

* Adds more anomaly batteries.

Adds them to the protolathe

* Some more xenoarch tweaks

- Makes scanpads and harvesters craftable
- Makes harvesters upgradable
- Fixes typo in the battery ID & desc
- Fixes harvester charge logic to NOT be garbage

* whoopsies

* clarification

* more effect->trigger fixes

this one didnt matter since both were 0 but still

* Better logic

* Obey gloves
This commit is contained in:
Cameron Lennox
2025-02-08 14:09:03 -05:00
committed by GitHub
parent 59586cecb3
commit bbc50e3ea6
9 changed files with 139 additions and 74 deletions

View File

@@ -29,3 +29,39 @@
materials = list(MAT_STEEL = 4000, MAT_GLASS = 4000)
build_path = /obj/item/pickaxe/excavationdrill
sort_string = "GAAAC"
/datum/design/obj/item/anobattery
name = "Anomaly power battery - Basic"
id = "anobattery-basic"
req_tech = list(TECH_MATERIAL = 2, TECH_POWER = 4, TECH_ENGINEERING = 2)
build_type = PROTOLATHE
materials = list(MAT_STEEL = 6000, MAT_GLASS = 6000)
build_path = /obj/item/anobattery
sort_string = "GAAAD"
/datum/design/obj/item/anobattery_mid
name = "Anomaly power battery - Moderate"
id = "anobattery-moderate"
req_tech = list(TECH_MATERIAL = 5, TECH_POWER = 4, TECH_ENGINEERING = 4)
build_type = PROTOLATHE
materials = list(MAT_STEEL = 5000, MAT_GLASS = 5000, MAT_SILVER = 2000) //Same object, different materials
build_path = /obj/item/anobattery/moderate
sort_string = "GAAAE"
/datum/design/obj/item/anobattery_advanced
name = "Anomaly power battery - Advanced"
id = "anobattery-advanced"
req_tech = list(TECH_MATERIAL = 6, TECH_POWER = 6, TECH_ENGINEERING = 5, TECH_BLUESPACE = 5, TECH_DATA = 4)
build_type = PROTOLATHE
materials = list(MAT_STEEL = 2500, MAT_GLASS = 2500, MAT_SILVER = 2000, MAT_GOLD = 2500, MAT_PHORON = 2500)
build_path = /obj/item/anobattery/advanced
sort_string = "GAAAF"
/datum/design/obj/item/anobattery_exotic
name = "Anomaly power battery - Exotic"
id = "anobattery-exotic"
req_tech = list(TECH_MATERIAL = 8, TECH_POWER = 7, TECH_ENGINEERING = 6, TECH_BLUESPACE = 6, TECH_DATA = 6, TECH_PRECURSOR = 2)
build_type = PROTOLATHE
materials = list(MAT_STEEL = 1500, MAT_GLASS = 1500, MAT_SILVER = 1500, MAT_GOLD = 1500, MAT_PHORON = 2000, MAT_DIAMOND = 2000, MAT_MORPHIUM = 2000)
build_path = /obj/item/anobattery/exotic
sort_string = "GAAAG"

View File

@@ -69,7 +69,7 @@
my_effect.trigger = TRIGGER_TOUCH
else if(icon_num == 10)
desc = "A large alien device, there appear to be some kind of vents in the side."
my_effect.trigger = pick(TRIGGER_ENERGY, TRIGGER_HEAT, TRIGGER_COLD, TRIGGER_PHORON, TRIGGER_OXY, TRIGGER_CO2, TRIGGER_NITRO)
my_effect.trigger = pick(TRIGGER_ENERGY, TRIGGER_HEAT, TRIGGER_COLD)
else if(icon_num == 11)
name = "sealed alien pod"
desc = "A strange alien device."
@@ -77,7 +77,7 @@
else if(icon_num == 12 || icon_num == 14)
name = "intricately carved statue"
desc = "A strange statue."
my_effect.trigger = pick(TRIGGER_TOUCH, TRIGGER_HEAT, TRIGGER_COLD, TRIGGER_PHORON, TRIGGER_OXY, TRIGGER_CO2, TRIGGER_NITRO)
my_effect.trigger = pick(TRIGGER_TOUCH, TRIGGER_HEAT, TRIGGER_COLD)
/obj/machinery/artifact/update_icon()
..()

View File

@@ -183,25 +183,13 @@
if(TRIGGER_TOUCH) //This one should be self explanatory.
. += "Activation index involves " + span_bold("physical interaction") + " with artifact surface."
if(TRIGGER_WATER, TRIGGER_ACID, TRIGGER_VOLATILE, TRIGGER_TOXIN) //No xenoarch would know how to activate these without code digging.
. += " Activation index involves " + span_bold("chemical interaction with artifact surface.") + " Water/Hydrogen, sulfuric acid, Thermite/Phoron, and toxin/toxic substances are potential triggers."
. += " Activation index involves " + span_bold("chemical interaction with artifact surface.") + " Water/Hydrogen, sulfuric acid, Thermite/Phoron, and toxin/toxic substances (such as lead, phoron, fertilizers, among others) are potential triggers."
if(TRIGGER_FORCE, TRIGGER_ENERGY) //Did you know multitools can activate energy artifacts?
. += " Activation index involves " + span_bold("forceful or energetic interaction with artifact surface.") + " Potential triggers are a pulse from a multitool or battering the artifact with a strong object."
if(TRIGGER_HEAT, TRIGGER_COLD) //Heat is easy to activate. Smack it with a welder. Cold? Have to cool the area.
. += " Activation index involves " + span_bold("precise temperature conditions.") + " Heating/Cooling the atmosphere (>[ARTIFACT_HEAT_TRIGGER]K or <[ARTIFACT_COLD_TRIGGER]K) or using a welder are potential triggers."
//Gases are separate since they are a pain in the rear to get activated and might as well let you know exactly what to do.
//I've been playing this game since the dawn of man and I've never seen someone bother to actually TRY to set up atmos to get these activated.
//Honestly, I'm slating these for removal.
if(TRIGGER_PHORON)
. += " Activation index involves "+ span_bold("precise local atmospheric conditions.") + " Phoron is a potential trigger. (Atmosphere must be >[ARTIFACT_GAS_TRIGGER] MOL of gas to activate device)"
if(TRIGGER_OXY)
. += " Activation index involves "+ span_bold("precise local atmospheric conditions.") + " Oxygen is a potential trigger. (Atmosphere must be >[ARTIFACT_GAS_TRIGGER] MOL of gas to activate device)"
if(TRIGGER_CO2)
. += " Activation index involves "+ span_bold("precise local atmospheric conditions.") + " Carbon Dioxide, is a potential trigger. (Atmosphere must be >[ARTIFACT_GAS_TRIGGER] MOL of gas to activate device)"
if(TRIGGER_NITRO)
. += " Activation index involves "+ span_bold("precise local atmospheric conditions.") + " Nitrous Oxide is a potential trigger. (Atmosphere must be >[ARTIFACT_GAS_TRIGGER] MOL of gas to activate device)"
else
. += " Unable to determine any data about activation trigger."

View File

@@ -269,10 +269,8 @@ var/list/toxic_reagents = list(TOXIN_PATH)
else if(ishuman(bumped) && GetAnomalySusceptibility(bumped) >= 0.5)
if (my_effect.trigger == TRIGGER_TOUCH)
my_effect.ToggleActivate()
warn = 1
if (my_effect.effect == EFFECT_TOUCH)
my_effect.DoEffectTouch(bumped)
if(my_effect.activated && my_effect.effect == EFFECT_TOUCH)
my_effect.DoEffectTouch(bumped)
warn = 1
if(warn && isliving(bumped))
@@ -289,11 +287,9 @@ var/list/toxic_reagents = list(TOXIN_PATH)
else if(ishuman(M) && !istype(M:gloves,/obj/item/clothing/gloves))
if (my_effect.trigger == TRIGGER_TOUCH)
my_effect.ToggleActivate()
warn = 1
if (my_effect.effect == EFFECT_TOUCH)
my_effect.DoEffectTouch(M)
my_effect.ToggleActivate(M)
if(my_effect.activated && my_effect.effect == EFFECT_TOUCH)
my_effect.DoEffectTouch(M)
warn = 1
if(warn && isliving(M))
@@ -310,15 +306,13 @@ var/list/toxic_reagents = list(TOXIN_PATH)
var/triggered = FALSE
for(var/datum/artifact_effect/my_effect in my_effects)
if(my_effect.trigger == TRIGGER_TOUCH)
triggered = TRUE
my_effect.ToggleActivate()
if (my_effect.effect == EFFECT_TOUCH)
triggered = TRUE
my_effect.DoEffectTouch(user)
if(ishuman(user) && !istype(user:gloves,/obj/item/clothing/gloves))
for(var/datum/artifact_effect/my_effect in my_effects)
if(my_effect.trigger == TRIGGER_TOUCH)
triggered = TRUE
my_effect.ToggleActivate()
if(my_effect.activated && my_effect.effect == EFFECT_TOUCH)
my_effect.DoEffectTouch(user)
if(triggered)
to_chat(user, span_filter_notice(span_bold("You touch [holder].")))
@@ -427,10 +421,6 @@ var/list/toxic_reagents = list(TOXIN_PATH)
//if any of our effects rely on environmental factors, work that out
var/trigger_cold = 0
var/trigger_hot = 0
var/trigger_phoron = 0
var/trigger_oxy = 0
var/trigger_co2 = 0
var/trigger_nitro = 0
var/turf/T = get_turf(holder)
var/datum/gas_mixture/env = T.return_air()
@@ -440,15 +430,6 @@ var/list/toxic_reagents = list(TOXIN_PATH)
else if(env.temperature > ARTIFACT_HEAT_TRIGGER)
trigger_hot = 1
if(env.gas[GAS_PHORON] >= ARTIFACT_GAS_TRIGGER)
trigger_phoron = 1
if(env.gas[GAS_O2] >= ARTIFACT_GAS_TRIGGER)
trigger_oxy = 1
if(env.gas[GAS_CO2] >= ARTIFACT_GAS_TRIGGER)
trigger_co2 = 1
if(env.gas[GAS_N2] >= ARTIFACT_GAS_TRIGGER)
trigger_nitro = 1
for(var/datum/artifact_effect/my_effect in my_effects)
my_effect.artifact_id = artifact_id
@@ -462,22 +443,6 @@ var/list/toxic_reagents = list(TOXIN_PATH)
if(my_effect.trigger == TRIGGER_HEAT && (trigger_hot ^ my_effect.activated))
my_effect.ToggleActivate()
//PHORON GAS ACTIVATION
if(my_effect.trigger == TRIGGER_PHORON && (trigger_phoron ^ my_effect.activated))
my_effect.ToggleActivate()
//OXYGEN GAS ACTIVATION
if(my_effect.trigger == TRIGGER_OXY && (trigger_oxy ^ my_effect.activated))
my_effect.ToggleActivate()
//CO2 GAS ACTIVATION
if(my_effect.trigger == TRIGGER_CO2 && (trigger_co2 ^ my_effect.activated))
my_effect.ToggleActivate()
//NITROGEN GAS ACTIVATION
if(my_effect.trigger == TRIGGER_NITRO && (trigger_nitro ^ my_effect.activated))
my_effect.ToggleActivate()
#undef HYDROGEN_PATH
#undef WATER_PATH
#undef ACID_PATH

View File

@@ -4,20 +4,37 @@
/obj/item/anobattery
name = "Anomaly power battery"
desc = "A device that is able to harness the power of anomalies!"
icon = 'icons/obj/xenoarchaeology.dmi'
icon_state = "anobattery0"
var/datum/artifact_effect/battery_effect
var/capacity = 500
var/stored_charge = 0
/obj/item/anobattery/examine(mob/user)
. = ..()
if(Adjacent(user))
. += "It currently has a charge of [stored_charge] out of [capacity]"
/obj/item/anobattery/Destroy()
battery_effect = null
..()
/obj/item/anobattery/moderate
name = "moderate anomaly battery"
capacity = 1000
/obj/item/anobattery/advanced
name = "advanced anomaly battery"
capacity = 3000
/obj/item/anobattery/exotic
name = "exotic anomaly battery"
capacity = 10000
/obj/item/anobattery/adminbus //Adminspawn only. Do not make this accessible or I will gnaw you.
name = "godly anomaly battery"
capacity = 100000000
/*
/obj/item/anobattery/New()
battery_effect = new()

View File

@@ -8,11 +8,13 @@
active_power_usage = 750
use_power = USE_POWER_IDLE
var/harvesting = 0
var/harvesting_speed = 0
var/obj/item/anobattery/inserted_battery
var/obj/cur_artifact
var/obj/machinery/artifact_scanpad/owned_scanner = null
var/last_process = 0
bubble_icon = "science"
circuit = /obj/item/circuitboard/artifact_harvester
/// If you want it to load smoothly, set it's dir to wherever the scanpad is!
/obj/machinery/artifact_harvester/Initialize()
@@ -20,6 +22,30 @@
owned_scanner = locate(/obj/machinery/artifact_scanpad) in get_step(src, dir)
if(!owned_scanner)
owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src)
default_apply_parts()
update_icon()
/obj/machinery/artifact_harvester/RefreshParts(var/limited = 0)
harvesting_speed = 0
// Rating goes from 1 to 5 and this bad boy has 5 caps. Let's say we want a normal one to charge a battery in 100 seconds.
// Every machine process happens every 2 seconds. So, we should have it do 5 charge every second. So 10 charge a process.
// Tier 3 is commonly availabe. Tier 4/5 is much harder to get.
// Applying a straight rating * X resultes in either being too strong early or too weak late. So we do a switch depending on rating.
// This means for a base 500 battery: Tier 1 takes 100 seconds, tier 2 takes 40 seconds, tier 3 takes 20 seconds, tier 4 takes 4 seconds, tier 5 takes 1 second.
// Tier 4 and 5 may seem overkill, but when you get to the REALLY strong batteries, you'll want them.
for(var/obj/item/stock_parts/P in component_parts)
if(istype(P, /obj/item/stock_parts/capacitor))
switch(P.rating)
if(1)
harvesting_speed += 2
if(2)
harvesting_speed += 5
if(3)
harvesting_speed += 10
if(4)
harvesting_speed += 50
if(5)
harvesting_speed += 100
/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I,/obj/item/anobattery))
@@ -31,10 +57,19 @@
SStgui.update_uis(src)
else
to_chat(user, span_red("There is already a battery in [src]."))
if(default_part_replacement(user, I))
return
if(!inserted_battery)
if(default_deconstruction_screwdriver(user, I))
return
if(default_deconstruction_crowbar(user, I))
return
else
return..()
/obj/machinery/artifact_harvester/attack_hand(var/mob/user as mob)
if(..())
return 1
add_fingerprint(user)
if(stat & (NOPOWER|BROKEN))
return
@@ -106,7 +141,6 @@
if(tgui_alert(ui.user, "This action will dump all charge, safety gear is recommended before proceeding","Warning",list("Continue","Cancel")) == "Continue")
if(!inserted_battery.battery_effect.activated)
inserted_battery.battery_effect.ToggleActivate(1)
last_process = world.time
harvesting = -1
update_use_power(USE_POWER_ACTIVE)
icon_state = "incubator_on"
@@ -205,7 +239,6 @@
cur_artifact.being_used = 1
icon_state = "incubator_on"
atom_say("Beginning energy harvesting.")
last_process = world.time
//duplicate the artifact's effect datum
if(!inserted_battery.battery_effect)
@@ -228,8 +261,7 @@
if(harvesting > 0)
//charge at 33% consumption rate
inserted_battery.stored_charge += (world.time - last_process) / 3
last_process = world.time
inserted_battery.stored_charge += harvesting_speed
//check if we've finished
if(inserted_battery.stored_charge >= inserted_battery.capacity)
@@ -243,7 +275,7 @@
else if(harvesting < 0)
//dump some charge
inserted_battery.stored_charge -= (world.time - last_process) / 3
inserted_battery.stored_charge -= harvesting_speed
//do the effect
if(inserted_battery.battery_effect)

View File

@@ -5,3 +5,17 @@
icon_state = "tele0"
anchored = TRUE
density = FALSE
circuit = /obj/item/circuitboard/artifact_scanpad
/obj/machinery/artifact_scanpad/attackby(var/obj/I as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, I))
return
if(default_deconstruction_crowbar(user, I))
return
if(default_part_replacement(user, I))
return
/obj/machinery/artifact_scanpad/Initialize()
. = ..()
default_apply_parts()
update_icon()