[READY FOR REVIEW] Adds more xenoarch large artifact triggers, adds manual trigger picking to the admin spawn option (#14448)

* manual trigger picking for admin spawned artifacts

* adds in a light based trigger

* misc fixes

* adds in pressure trigger

* quick electricity prototype, needs more refining

* unfuck dme

* SPEED trigger and misc fixes

* not visible trigger D E V I L I S H edition

* prototype pay2use trigger

* finalise everything before testing

* bug fixes

* requested changes

* misc tweaks
This commit is contained in:
BobdaBiscuit
2017-04-02 22:12:38 +01:00
committed by Probe1
parent 164d090fa2
commit ca58878c3a
19 changed files with 483 additions and 55 deletions

View File

@@ -3052,25 +3052,50 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","CA")
var/answer = alert("Are you sure you want to create a custom artifact?",,"Yes","No")
if(answer == "Yes")
//Either have them as all random, or have custom artifacts
var/list/effects = typesof(/datum/artifact_effect)
var/list/triggers = typesof(/datum/artifact_trigger)
effects.Remove(/datum/artifact_effect)
triggers.Remove(/datum/artifact_trigger)
var/answer1 = alert("Just a primary, or primary and secondary effects?",,"Primary only","Primary and Secondary")
var/primary_effect = input(usr, "Which primary effect would you like?", "Primary effect") as null|anything in effects
var/secondary_effect
var/answer2 = alert("Randomly generated triggers (safer), or manually picked (might break certain effects)?",,"Random","Manual")
var/custom_primary_effect = input(usr, "Which primary effect would you like?", "Primary effect") as null|anything in effects
var/custom_primary_trigger
if(answer2 == "Manual")
custom_primary_trigger = input(usr, "Which trigger would you like for the primary effect?", "Primary trigger") as null|anything in triggers
var/custom_secondary_effect
var/custom_secondary_trigger
if(answer1 == "Primary and Secondary")
secondary_effect = input(usr, "Which secondary effect would you like?", "Secondary effect") as null|anything in effects
var/obj/machinery/artifact/custom = new /obj/machinery/artifact(get_turf(usr))
qdel(custom.primary_effect); custom.primary_effect = null
custom.primary_effect = new primary_effect(custom)
custom.primary_effect.GenerateTrigger()
qdel(custom.secondary_effect); custom.secondary_effect = null
if(secondary_effect)
custom.secondary_effect = new secondary_effect(custom)
custom.secondary_effect.GenerateTrigger()
custom_secondary_effect = input(usr, "Which secondary effect would you like?", "Secondary effect") as null|anything in effects
if(answer2 == "Manual")
custom_secondary_trigger = input(usr, "Which trigger would you like for the secondary effect?", "Secondary trigger") as null|anything in triggers
var/obj/machinery/artifact/custom = new /obj/machinery/artifact(get_turf(usr), null, 0)
custom.primary_effect = new custom_primary_effect(custom)
if(answer2 == "Random")
custom.primary_effect.GenerateTrigger()
else
custom.primary_effect.trigger = new custom_primary_trigger(custom.primary_effect)
custom.investigation_log(I_ARTIFACT, "|| admin-spawned by [key_name_admin(usr)] with a primary effect [custom.primary_effect.artifact_id]: [custom.primary_effect] || range: [custom.primary_effect.effectrange] || charge time: [custom.primary_effect.chargelevelmax] || trigger: [custom.primary_effect.trigger].")
if(custom_secondary_effect)
custom.secondary_effect = new custom_secondary_effect(custom)
if(answer2 == "Random")
custom.secondary_effect.GenerateTrigger()
else
custom.secondary_effect.trigger = new custom_secondary_trigger(custom.secondary_effect)
custom.investigation_log(I_ARTIFACT, "|| admin-spawned by [key_name_admin(usr)] with a secondary effect [custom.secondary_effect.artifact_id]: [custom.secondary_effect] || range: [custom.secondary_effect.effectrange] || charge time: [custom.secondary_effect.chargelevelmax] || trigger: [custom.secondary_effect.trigger].")
message_admins("[key_name_admin(usr)] has created a custom artifact")
if("schoolgirl")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SG")

View File

@@ -22,7 +22,7 @@
var/event/on_explode
var/event/on_projectile
/obj/machinery/artifact/New(location, find_id)
/obj/machinery/artifact/New(location, find_id, generate_effect = 1)
..()
if(find_id)
artifact_id = find_id
@@ -35,24 +35,25 @@
on_projectile = new(owner = src)
//event arguement list format (user, "context", item)
//setup primary effect - these are the main ones (mixed)
var/effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
primary_effect = new effecttype(src, 1) //pass the 1 so that the effect knows to generate a trigger
primary_effect.artifact_id = "[artifact_id]a"
spawn(1) //delay logging so if admin tools override/other fuckery occurs the logs still end up correct
src.investigation_log(I_ARTIFACT, "|| spawned with a primary effect [primary_effect.artifact_id]: [primary_effect] || range: [primary_effect.effectrange] || charge time: [primary_effect.chargelevelmax] || trigger: [primary_effect.trigger].")
if(generate_effect)
//setup primary effect
var/effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
primary_effect = new effecttype(src, 1) //pass the 1 so that the effect knows to generate a trigger
primary_effect.artifact_id = "[artifact_id]a"
spawn(1) //delay logging so if admin tools override/other fuckery occurs the logs still end up correct
src.investigation_log(I_ARTIFACT, "|| spawned with a primary effect [primary_effect.artifact_id]: [primary_effect] || range: [primary_effect.effectrange] || charge time: [primary_effect.chargelevelmax] || trigger: [primary_effect.trigger].")
//75% chance to have a secondary effect
if(prob(75))
effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
secondary_effect = new effecttype(src, 1)
secondary_effect.artifact_id = "[artifact_id]b"
spawn(1)
if(secondary_effect) //incase admin tools or something deleted the secondary
src.investigation_log(I_ARTIFACT, "|| spawned with a secondary effect [secondary_effect.artifact_id]: [secondary_effect] || range: [secondary_effect.effectrange] || charge time: [secondary_effect.chargelevelmax] || trigger: [secondary_effect.trigger].")
if(prob(75) && secondary_effect.effect != EFFECT_TOUCH)
src.investigation_log(I_ARTIFACT, "|| secondary effect [secondary_effect.artifact_id] starts triggered by default.")
secondary_effect.ToggleActivate(2)
//75% chance to have a secondary effect
if(prob(75))
effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
secondary_effect = new effecttype(src, 1)
secondary_effect.artifact_id = "[artifact_id]b"
spawn(1)
if(secondary_effect) //incase admin tools or something deleted the secondary
src.investigation_log(I_ARTIFACT, "|| spawned with a secondary effect [secondary_effect.artifact_id]: [secondary_effect] || range: [secondary_effect.effectrange] || charge time: [secondary_effect.chargelevelmax] || trigger: [secondary_effect.trigger].")
if(prob(75) && secondary_effect.effect != EFFECT_TOUCH)
src.investigation_log(I_ARTIFACT, "|| secondary effect [secondary_effect.artifact_id] starts triggered by default.")
secondary_effect.ToggleActivate(2)
icon_num = rand(0,11)
icon_state = "ano[icon_num]0"

View File

@@ -57,6 +57,9 @@
activated = 0
else
activated = 1
isolated = 1
spawn(20 SECONDS)
isolated = 0
if(reveal_toggle == 1 && holder)
if(istype(holder, /obj/machinery/artifact))
@@ -126,7 +129,7 @@ proc/GetAnomalySusceptibility(var/mob/living/carbon/human/H)
var/atom/toplevelholder = get_holder_at_turf_level(holder)
toplevelholder.visible_message("<span class='warning'>[bicon(toplevelholder)] [toplevelholder] expells energy which is blocked by the containment field!</span>")
isolated = 1
spawn(10 SECONDS)
spawn(20 SECONDS)
isolated = 0
/datum/artifact_effect/proc/IsPrimary()

View File

@@ -5,6 +5,7 @@
/datum/artifact_effect/darkness/New()
..()
effect = rand(1,2)
effect_type = pick(0,3,4)
effectrange = rand(2,12)
dark_level = rand(2,7)

View File

@@ -4,9 +4,22 @@
#define TRIGGER_REAGENT "reagent"
#define TRIGGER_GAS "gas"
#define TRIGGER_TEMPERATURE "temperature"
#define TRIGGER_LIGHT "light"
#define TRIGGER_PRESSURE "pressure"
#define TRIGGER_ELECTRIC "electric"
#define TRIGGER_SPEED "speed"
#define TRIGGER_NOT_VISIBLE "not_visible"
#define TRIGGER_PAY2USE "pay2use"
#define SCAN_PHYSICAL 0
#define SCAN_PHYSICAL_ENERGETIC 1
#define SCAN_CONSTANT_ENERGETIC 2
#define SCAN_ATMOS 3
#define SCAN_OCULAR 4
/datum/artifact_trigger
var/triggertype = ""
var/scanned_trigger = ""
var/obj/machinery/artifact/my_artifact
var/datum/artifact_effect/my_effect
@@ -54,3 +67,7 @@
/datum/artifact_trigger/Destroy()
my_artifact = null
my_effect = null
/datum/artifact_trigger/Topic(href, href_list)
return my_artifact.Topic(href, href_list)

View File

@@ -0,0 +1,32 @@
/datum/artifact_trigger/electricity
triggertype = TRIGGER_ELECTRIC
scanned_trigger = SCAN_CONSTANT_ENERGETIC
var/power_load = 7500
/datum/artifact_trigger/electricity/New()
..()
/datum/artifact_trigger/electricity/CheckTrigger()
var/turf/T = get_turf(my_artifact)
var/obj/structure/cable/cable = locate() in T
if(!cable || !istype(cable))
if(my_effect.activated)
Triggered(0, "NOCABLE", 0)
return
var/datum/powernet/PN = cable.get_powernet()
if(!PN) //Powernet is dead
if(my_effect.activated)
Triggered(0, "NOPOWERNET", 0)
return
else if(PN.avail < power_load) //Cannot drain enough power
if(my_effect.activated)
Triggered(0, "NOTENOUGHELECTRICITY", 0)
return
else if(!my_effect.activated)
PN.load += power_load
Triggered(0, "ELECTRICITY", 0)
return
else //makes sure the powernet stays under load if the artifact is moving
PN.load += power_load

View File

@@ -1,5 +1,6 @@
/datum/artifact_trigger/energy
triggertype = TRIGGER_ENERGY
scanned_trigger = SCAN_PHYSICAL_ENERGETIC
var/key_attackby
var/key_projectile

View File

@@ -2,6 +2,7 @@
/datum/artifact_trigger/force
triggertype = TRIGGER_FORCE
scanned_trigger = SCAN_PHYSICAL_ENERGETIC
var/key_attackby
var/key_explode
var/key_projectile

View File

@@ -2,6 +2,7 @@
/datum/artifact_trigger/gas
triggertype = TRIGGER_GAS
scanned_trigger = SCAN_ATMOS
var/trigger_gas = 0
/datum/artifact_trigger/gas/New()

View File

@@ -0,0 +1,26 @@
/datum/artifact_trigger/light
triggertype = TRIGGER_LIGHT
scanned_trigger = SCAN_OCULAR
var/dark_triggered = 0
var/lum_trigger = 5
/datum/artifact_trigger/light/New()
..()
dark_triggered = prob(50)
lum_trigger = rand(1,9)
/datum/artifact_trigger/light/CheckTrigger()
var/turf/T = get_turf(my_artifact)
var/light_available = 5
if(T.dynamic_lighting)
light_available = T.get_lumcount() * 10
if(!my_effect.activated)
if(!dark_triggered && light_available >= lum_trigger)
Triggered(0, "LIGHT", 0)
else if(dark_triggered && light_available <= lum_trigger)
Triggered(0, "DARK", 0)
else
if(!dark_triggered && light_available <= lum_trigger)
Triggered(0, "DARK", 0)
else if(dark_triggered && light_available >= lum_trigger)
Triggered(0, "LIGHT", 0)

View File

@@ -0,0 +1,196 @@
#define COIN 0
#define CREDIT 1
#define BANK_CARD 2
/datum/artifact_trigger/pay2use
triggertype = TRIGGER_PAY2USE
scanned_trigger = SCAN_PHYSICAL
var/mode
var/key_attackhand
var/key_attackby
var/time_left = 0
var/obj/machinery/account_database/linked_db
/datum/artifact_trigger/pay2use/New()
..()
key_attackhand = my_artifact.on_attackhand.Add(src, "owner_attackhand")
key_attackby = my_artifact.on_attackby.Add(src, "owner_attackby")
mode = rand(0,2)
reconnect_database()
/datum/artifact_trigger/pay2use/proc/reconnect_database()
for(var/obj/machinery/account_database/DB in account_DBs)
//Checks for a database on its Z-level, else it checks for a database at the main Station.
if((my_artifact.loc && (DB.z == my_artifact.loc.z)) || (DB.z == STATION_Z))
if((DB.stat == 0) && DB.activated )//If the database if damaged or not powered, people won't be able to use the app anymore.
linked_db = DB
break
/datum/artifact_trigger/pay2use/CheckTrigger()
if(time_left < 0)
time_left = 0
if(time_left)
if(!my_effect.activated)
Triggered(0, "MONEY", 0)
time_left--
else
if(my_effect.activated)
Triggered(0, "NOMONEY", 0)
/datum/artifact_trigger/pay2use/proc/owner_attackhand(var/list/event_args, var/source)
var/toucher = event_args[1]
var/context = event_args[2]
if(context != "TOUCH" || mode != BANK_CARD)
return
else if(mode == BANK_CARD)
var/dat = "<TT><center><b>[my_artifact.artifact_id]</b></center><hr /><br>" //display the name, and added a horizontal rule
dat += "<b>Select an item: </b><br><br>" //the rest is just general spacing and bolding
dat += "1 Minute - $10 - "
dat += "<A href='?src=\ref[src];pay1m=1'>Pay</a><BR>"
dat += "2 Minutes - $19 - "
dat += "<A href='?src=\ref[src];pay2m=1'>Pay</a><BR>"
dat += "5 Minutes - $45 - "
dat += "<A href='?src=\ref[src];pay5m=1'>Pay</a><BR>"
dat += "10 Minutes - $85 - "
dat += "<A href='?src=\ref[src];pay10m=1'>Pay</a><BR>"
dat += "BEST VALUE FOR MONEY<BR>"
dat += "1 Hour - $500 - "
dat += "<A href='?src=\ref[src];pay1h=1'>Pay</a><BR>"
var/datum/browser/popup = new(toucher, "\ref[src]", "[my_artifact.artifact_id]", 575, 400, src)
popup.set_content(dat)
popup.open()
/datum/artifact_trigger/pay2use/proc/owner_attackby(var/list/event_args, var/source)
var/toucher = event_args[1]
var/context = event_args[2]
var/obj/item/weapon/item = event_args[3]
if(context == "MELEE")
if(iscoin(item))
if(mode == COIN)
my_artifact.investigation_log(I_ARTIFACT, "|| effect [my_effect.artifact_id]([my_effect]) || [item] inserted to ([my_effect.trigger]) || used by [key_name(toucher)].")
my_artifact.visible_message("<span class='info'>[toucher] inserts a coin into [my_artifact].</span>")
if(istype(item, /obj/item/weapon/coin/clown))
playsound(get_turf(my_artifact), 'sound/items/bikehorn.ogg', 50, 1)
time_left += 150
else if(istype(item, /obj/item/weapon/coin/iron))
time_left += 10
else if(istype(item, /obj/item/weapon/coin/silver))
time_left += 30
else if(istype(item, /obj/item/weapon/coin/gold))
time_left += 60
else if(istype(item, /obj/item/weapon/coin/plasma))
time_left += 45
else if(istype(item, /obj/item/weapon/coin/uranium))
time_left += 50
else if(istype(item, /obj/item/weapon/coin/diamond))
time_left += 100
else if(istype(item, /obj/item/weapon/coin/phazon))
time_left += 150
else if(istype(item, /obj/item/weapon/coin/adamantine))
time_left += 150
else if(istype(item, /obj/item/weapon/coin/mythril))
time_left += 150
qdel(item)
else
to_chat(toucher, "[bicon(my_artifact)]<span class='warning'>[my_artifact] does not accept coins!</span>")
else if(istype(item, /obj/item/weapon/spacecash))
if(mode == CREDIT)
var/obj/item/weapon/spacecash/dosh = item
my_artifact.visible_message("<span class='info'>[toucher] inserts a credit chip into [my_artifact].</span>")
my_artifact.investigation_log(I_ARTIFACT, "|| effect [my_effect.artifact_id]([my_effect]) || $[dosh.get_total()] [dosh] inserted to ([my_effect.trigger]) || used by [key_name(toucher)].")
time_left += (dosh.get_total() * 3) //6 seconds per credit
qdel(dosh)
else
to_chat(toucher, "[bicon(my_artifact)]<span class='warning'>[my_artifact] does not accept credits!</span>")
/datum/artifact_trigger/pay2use/proc/payviacard(var/dosh = 0, var/time = 0, var/mob)
if(mode == BANK_CARD)
var/mob/living/M = mob
var/obj/item/weapon/card/I = M.get_id_card()
var/bought_time = time / 2
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
my_artifact.visible_message("<span class='info'>[M] swipes a card through [my_artifact].</span>")
//we start by checking the ID card's virtual wallet
var/datum/money_account/D = C.virtual_wallet
var/using_account = "Virtual Wallet"
//if there isn't one for some reason we create it, that should never happen but oh well.
if(!D)
C.update_virtual_wallet()
D = C.virtual_wallet
var/transaction_amount = dosh
//if there isn't enough money in the virtual wallet, then we check the bank account connected to the ID
if(D.money < transaction_amount)
if(linked_db)
D = linked_db.attempt_account_access(C.associated_account_number, 0, 2, 0)
else
D = null
using_account = "Bank Account"
if(!D) //first we check if there IS a bank account in the first place
to_chat(M, "[bicon(my_artifact)]<span class='warning'>You don't have that much money on your virtual wallet!</span>")
to_chat(M, "[bicon(my_artifact)]<span class='warning'>Unable to access your bank account.</span>")
return 0
else if(D.security_level > 0) //next we check if the security is low enough to pay directly from it
to_chat(M, "[bicon(my_artifact)]<span class='warning'>You don't have that much money on your virtual wallet!</span>")
to_chat(M, "[bicon(my_artifact)]<span class='warning'>Lower your bank account's security settings if you wish to pay directly from it.</span>")
return 0
else if(D.money < transaction_amount)//and lastly we check if there's enough money on it, duh
to_chat(M, "[bicon(my_artifact)]<span class='warning'>You don't have that much money on your bank account!</span>")
return 0
//transfer the money
D.money -= transaction_amount
to_chat(M, "[bicon(my_artifact)]<span class='notice'>Remaining balance ([using_account]): [D.money]$</span>")
//create an entry on the buy's account's transaction log
var/datum/transaction/T = new()
T.target_name = "[my_artifact.artifact_id]"
T.purpose = "Purchase of [dosh * 2] seconds of activation."
T.amount = "-[transaction_amount]"
T.source_terminal = my_artifact.artifact_id
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
// Vend the item
time_left += bought_time
my_artifact.investigation_log(I_ARTIFACT, "|| effect [my_effect.artifact_id]([my_effect]) || [C] used to deposit $[dosh] and activate ([my_effect.trigger]) || used by [key_name(M)].")
/datum/artifact_trigger/pay2use/Topic(href, href_list)
if(..())
return
if(href_list["pay1m"])
payviacard(10, 60, usr) //(credits paid, time given in seconds, usr)
if(href_list["pay2m"])
payviacard(19, 120, usr)
if(href_list["pay5m"])
payviacard(45, 300, usr)
if(href_list["pay10m"])
payviacard(85, 600, usr)
if(href_list["pay1h"])
payviacard(500, 3600, usr)
/datum/artifact_trigger/pay2use/Destroy()
my_artifact.on_attackhand.Remove(key_attackhand)
my_artifact.on_attackby.Remove(key_attackby)
linked_db = null
..()

View File

@@ -0,0 +1,37 @@
#define HIGH_PRESSURE_TRIGGER 150
#define LOW_PRESSURE_TRIGGER 50
/datum/artifact_trigger/pressure
triggertype = TRIGGER_PRESSURE
scanned_trigger = SCAN_ATMOS
var/high_triggered = 0
//possibly make the required pressure random in the futurem, when better facilities are added
var/key_explode
/datum/artifact_trigger/pressure/New()
..()
high_triggered = prob(50)
key_explode = my_artifact.on_explode.Add(src, "owner_explode")
/datum/artifact_trigger/pressure/CheckTrigger()
var/turf/T = get_turf(my_artifact)
var/datum/gas_mixture/env = T.return_air()
if(env)
if(!my_effect.activated)
if(!high_triggered && env.pressure < LOW_PRESSURE_TRIGGER)
Triggered(0, "LOWPRESSURE", 0)
else if(high_triggered && env.pressure > HIGH_PRESSURE_TRIGGER)
Triggered(0, "HIGHPRESSURE", 0)
else
if(!high_triggered && env.pressure > LOW_PRESSURE_TRIGGER)
Triggered(0, "HIGHPRESSURE", 0)
else if(high_triggered && env.pressure < HIGH_PRESSURE_TRIGGER)
Triggered(0, "LOWPRESSURE", 0)
/datum/artifact_trigger/pressure/proc/owner_explode(var/list/event_args, var/source)
var/context = event_args[2]
Triggered(0, context, 0)
/datum/artifact_trigger/pressure/Destroy()
my_artifact.on_explode.Remove(key_explode)
..()

View File

@@ -1,5 +1,6 @@
/datum/artifact_trigger/reagent
triggertype = TRIGGER_REAGENT
scanned_trigger = SCAN_PHYSICAL
var/reagent_group = 0
var/key_attackby

View File

@@ -0,0 +1,40 @@
/datum/artifact_trigger/speed
triggertype = TRIGGER_SPEED
scanned_trigger = SCAN_CONSTANT_ENERGETIC
var/needed_distance
var/toggles = 0
var/turf/old_T
var/cooldown = 10
var/last_moved
/datum/artifact_trigger/speed/New()
..()
needed_distance = rand(1,9) //needed distance to traverse per process()
old_T = get_turf(my_artifact)
toggles = prob(80)
last_moved = world.time
/datum/artifact_trigger/speed/CheckTrigger()
var/turf/T = get_turf(my_artifact)
if(T)
var/distance = get_dist(T, old_T)
if(toggles) //moving at speed toggles it, it can then stopped until it needs to be toggled again
if((world.time - last_moved) > cooldown && distance >= needed_distance)
if(!my_effect.activated)
Triggered(0, "SPEEDTOGGLE", 0)
else
Triggered(0, "SLOWTOGGLE", 0)
last_moved = world.time
else //has to be constantly moving to be active
if(distance >= needed_distance && !my_effect.activated)
Triggered(0, "SPEED", 0)
else if(distance < needed_distance && my_effect.activated)
Triggered(0, "SLOW", 0)
old_T = T
/datum/artifact_trigger/speed/Destroy()
..()

View File

@@ -3,14 +3,17 @@
/datum/artifact_trigger/temperature
triggertype = TRIGGER_TEMPERATURE
scanned_trigger = SCAN_ATMOS
var/heat_triggered = 0
var/key_attackby
var/key_explode
/datum/artifact_trigger/temperature/New()
..()
heat_triggered = prob(50)
key_attackby = my_artifact.on_attackby.Add(src, "owner_attackby")
key_explode = my_artifact.on_explode.Add(src, "owner_explode")
/datum/artifact_trigger/temperature/CheckTrigger()
var/turf/T = get_turf(my_artifact)
@@ -38,8 +41,8 @@
/datum/artifact_trigger/temperature/proc/owner_explode(var/list/event_args, var/source)
var/context = event_args[2]
Triggered(0, context, 0)
my_artifact.investigation_log(I_ARTIFACT, "|| effect [my_effect.artifact_id]([my_effect]) triggered by [context]([my_effect.trigger]).")
/datum/artifact_trigger/temperature/Destroy()
my_artifact.on_attackby.Remove(key_attackby)
my_artifact.on_explode.Remove(key_explode)
..()

View File

@@ -1,5 +1,6 @@
/datum/artifact_trigger/touch
triggertype = TRIGGER_TOUCH
scanned_trigger = SCAN_PHYSICAL
var/key_attackhand
/datum/artifact_trigger/touch/New()
@@ -10,11 +11,7 @@
var/toucher = event_args[1]
var/context = event_args[2]
if(my_effect.IsPrimary())
Triggered(toucher, context, 0)
else if(!my_effect.IsPrimary())
Triggered(toucher, context, 0)
..()
Triggered(toucher, context, 0)
if(my_effect.effect == EFFECT_TOUCH)
if (my_effect.IsContained())

View File

@@ -0,0 +1,29 @@
/datum/artifact_trigger/notvisible
triggertype = TRIGGER_NOT_VISIBLE
scanned_trigger = SCAN_OCULAR
var/visible = 0
var/dir_trigger = 0
/datum/artifact_trigger/notvisible/New()
..()
dir_trigger = prob(40)
/datum/artifact_trigger/notvisible/CheckTrigger()
visible = FALSE
for (var/mob/living/M in viewers(my_artifact))
if(!M.isUnconscious() && !is_blind(M))
if(dir_trigger && (M.dir == get_cardinal_dir(M, my_artifact)))
visible = TRUE
else if(!dir_trigger)
visible = TRUE
break
if(!my_effect.activated && !visible)
Triggered(0, "NOTVISIBLE", 0)
else if(my_effect.activated && visible)
Triggered(0, "VISIBLE", 0)
/datum/artifact_trigger/notvisible/Destroy()
..()

View File

@@ -203,14 +203,20 @@
else
out += " interspersed throughout substructure and shell."
if(A.primary_effect.trigger.triggertype == TRIGGER_TOUCH || A.primary_effect.trigger.triggertype == TRIGGER_REAGENT)
out += " Activation index involves physical interaction with artifact surface."
else if(A.primary_effect.trigger.triggertype == TRIGGER_FORCE || A.primary_effect.trigger.triggertype == TRIGGER_ENERGY || A.primary_effect.trigger.triggertype == TRIGGER_TEMPERATURE)
out += " Activation index involves energetic interaction with artifact surface."
else if(A.primary_effect.trigger.triggertype == TRIGGER_GAS)
out += " Activation index involves precise local atmospheric conditions."
else
out += " Unable to determine any data about activation trigger."
//effect's trigger
switch(A.primary_effect.trigger.scanned_trigger)
if(SCAN_PHYSICAL)
out += " Activation index involves physical interaction with artifact surface."
if(SCAN_PHYSICAL_ENERGETIC)
out += " Activation index involves energetic interaction with artifact surface."
if(SCAN_CONSTANT_ENERGETIC)
out += " Activation index involves prolonged energetic interaction with artifact surface."
if(SCAN_ATMOS)
out += " Activation index involves precise local atmospheric conditions."
if(SCAN_OCULAR)
out += " Activation index involves specific ocular conditions around the artifact."
else
out += " Unable to determine any data about activation trigger."
//secondary:
if(A.secondary_effect)
@@ -246,17 +252,22 @@
else
out += " interspersed throughout substructure and shell."
if(A.secondary_effect.trigger.triggertype == TRIGGER_TOUCH || A.secondary_effect.trigger.triggertype == TRIGGER_REAGENT)
out += " Activation index involves physical interaction with artifact surface, but subsystems indicate \
anomalous interference with standard attempts at triggering."
else if(A.secondary_effect.trigger.triggertype == TRIGGER_FORCE || A.secondary_effect.trigger.triggertype == TRIGGER_ENERGY || A.secondary_effect.trigger.triggertype == TRIGGER_TEMPERATURE)
out += " Activation index involves energetic interaction with artifact surface, but subsystems indicate \
anomalous interference with standard attempts at triggering."
else if(A.secondary_effect.trigger.triggertype == TRIGGER_GAS)
out += " Activation index involves precise local atmospheric conditions, but subsystems indicate \
anomalous interference with standard attempts at triggering."
else
out += " Unable to determine any data about activation trigger."
//effect's trigger
switch(A.secondary_effect.trigger.scanned_trigger)
if(SCAN_PHYSICAL)
out += " Activation index involves physical interaction with artifact surface."
if(SCAN_PHYSICAL_ENERGETIC)
out += " Activation index involves energetic interaction with artifact surface."
if(SCAN_CONSTANT_ENERGETIC)
out += " Activation index involves prolonged energetic interaction with artifact surface."
if(SCAN_ATMOS)
out += " Activation index involves precise local atmospheric conditions."
if(SCAN_OCULAR)
out += " Activation index involves specific ocular conditions around the artifact."
else
out += " Unable to determine any data about activation trigger."
out+= " Subsystems indicate anomalous interference with standard attempts at triggering."
return out
else
//it was an ordinary item

View File

@@ -1968,12 +1968,18 @@
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_stun.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_teleport.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_timestop.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_electricity.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_energy.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_force.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_gas.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_light.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_pay2use.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_pressure.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_reagent.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_speed.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_temperature.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_touch.dm"
#include "code\modules\research\xenoarchaeology\artifact\triggers\unknown_trigger_visible.dm"
#include "code\modules\research\xenoarchaeology\finds\finds.dm"
#include "code\modules\research\xenoarchaeology\finds\finds_defines.dm"
#include "code\modules\research\xenoarchaeology\finds\finds_fossils.dm"