some tweaks to artifacts, new xenoarch analysis machines, made empulse give a cool whoosh to everyone in range

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-12-27 01:35:13 +10:00
parent 282c07cc2a
commit f4c1cb325a
6 changed files with 209 additions and 96 deletions
+3
View File
@@ -20,6 +20,9 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(heavy_range > light_range)
light_range = heavy_range
for(var/mob/M in range(heavy_range, epicenter))
M << 'sound/effects/EMPulse.ogg'
for(var/atom/T in range(light_range, epicenter))
var/distance = get_dist(epicenter, T)
if(distance < 0)
@@ -23,8 +23,15 @@ obj/machinery/anomaly/hyperspectral/ScanResults()
if(num_reagents == 2 && scanned_sample && carrier)
//all necessary components are present
var/specifity = GetResultSpecifity(scanned_sample, carrier)
results = "Spectral signature over carrier ([carrier], [specifity]):<br>"
results += "<img src=\"http://i.imgur.com/YAcOE.jpg\"></img><br>"
results = "Spectral signature over carrier ([carrier]):<br>"
if(specifity <= 0.25)
results += "<img src=\"http://i.imgur.com/TAQHn.jpg\"></img><br>"
else if(specifity <= 0.5)
results += "<img src=\"http://i.imgur.com/EwOZ7.jpg\"></img><br>"
else if(specifity <= 0.75)
results += "<img src=\"http://i.imgur.com/1qCae.jpg\"></img><br>"
else
results += "<img src=\"http://i.imgur.com/9T9nc.jpg\"></img><br>"
if(scanned_sample.artifact_id && prob(specifity * 100))
results += "Anomalous exotic energy signature detected: [scanned_sample.artifact_id]."
@@ -0,0 +1,51 @@
obj/machinery/anomaly/isotope_ratio
name = "Isotope ratio spectrometer"
desc = "A specialised, complex analysis machine."
icon = 'virology.dmi'
icon_state = "analyser"
obj/machinery/anomaly/isotope_ratio/ScanResults()
var/results = "The scan was inconclusive. Check sample integrity and carrier consistency."
var/datum/geosample/scanned_sample
var/carrier
var/num_reagents = 0
for(var/datum/reagent/A in held_container.reagents.reagent_list)
var/datum/reagent/R = A
if(istype(R, /datum/reagent/analysis_sample))
scanned_sample = R.data
else
carrier = R.id
num_reagents++
if(num_reagents == 2 && scanned_sample && carrier)
var/specifity = GetResultSpecifity(scanned_sample, carrier)
var/accuracy = 0
if(specifity)
accuracy = (specifity / (specifity + 0.2))
else
accuracy = rand(0.01, 0.75)
results = "Isotope decay analysis in carrier ([carrier]) indicates age ([100 * accuracy]% accuracy): <br><br>"
if(scanned_sample.age_billion)
//scramble the results
var/displayed_age_thousands = rand(0, 999)
var/displayed_age_millions = rand(0, 999)
results += "[displayed_age_millions + displayed_age_thousands / 1000] million years.<br>"
else if(scanned_sample.age_million)
var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age_thousand * ((1 - accuracy) * (2 * rand() - 1)), 0)
var/displayed_age_millions = scanned_sample.age_million + max(scanned_sample.age_million * ((1 - accuracy) * (4 * rand() - 2)), 0)
results += "[displayed_age_millions + displayed_age_thousands / 1000] million years.<br>"
else if(scanned_sample.age_thousand)
var/displayed_age = scanned_sample.age + scanned_sample.age * ((1 - accuracy) * (2 * rand() - 1))
var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age_thousand * ((1 - accuracy) * (2 * rand() - 1)), 0)
results += "[displayed_age_thousands + displayed_age / 1000] thousand years.<br>"
else
var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - accuracy) * (2 * rand() - 1)), 0)
results += "[displayed_age] years.<br>"
results += "<br>Warning, results only valid up to ages of one billion years."
return results
@@ -1,10 +1,18 @@
//Part of ISaidNo's public release around July 2011(ish), multiple changes
//many thanks
#define PLASMA_SPAWN 1
#define N2_SPAWN 2
#define CO2_SPAWN 3
#define RADIATE 4
#define VIRUS 5
#define HEAT 6
#define COLD 7
/obj/machinery/artifact
name = "alien artifact"
desc = "A large alien device."
icon = 'anomaly.dmi'
icon = 'xenoarchaeology.dmi'
icon_state = "ano00"
var/icon_num = 0
anchored = 0
@@ -21,55 +29,51 @@
/obj/machinery/artifact/New()
..()
// Origin and appearance randomisation
// cael - need some more icons
my_effect = new()
src.origin = pick("ancient","martian","wizard","eldritch","precursor")
switch(src.origin)
if("ancient") icon_num = pick(2)//src.icon_state = pick("ano2")
if("martian") icon_num = pick(4)//src.icon_state = pick("ano4")
if("wizard") icon_num = pick(0,1)//src.icon_state = pick("ano0","ano1")
if("eldritch") icon_num = pick(3)//src.icon_state = pick("ano3")
if("precursor") icon_num = pick(5)//src.icon_state = pick("ano5")
icon_num = rand(0,5)
icon_state = "ano[icon_num]0"
// Low-ish random chance to not look like it's origin
if(prob(20)) src.icon_state = pick("ano00","ano10","ano20","ano30","ano40","ano50")
// Power randomisation
my_effect.trigger = pick("force","energy","chemical","heat","touch")
if (my_effect.trigger == "chemical") my_effect.triggerX = pick("hydrogen","corrosive","volatile","toxic")
my_effect.trigger = pick("force","energy","chemical","heat","touch","presence")
if (my_effect.trigger == "chemical")
my_effect.triggerX = pick("hydrogen","corrosive","volatile","toxic")
// Ancient Artifacts focus on robotic/technological effects
// Martian Artifacts focus on biological effects
// Wizard Artifacts focus on weird shit
// Eldritch Artifacts are 100% bad news
// Precursor Artifacts do everything
switch(src.origin)
if("ancient") my_effect.effecttype = pick("roboheal","robohurt","cellcharge","celldrain")
if("martian") my_effect.effecttype = pick("healing","injure"/*,"stun"*/,"planthelper")
if("wizard") my_effect.effecttype = pick(/*"stun",*/"forcefield","teleport")
if("eldritch") my_effect.effecttype = pick("injure",/*"stun",*/"robohurt","celldrain")
if("precursor") my_effect.effecttype = pick("healing","injure",/*"stun",*/"roboheal","robohurt","cellcharge","celldrain","planthelper","forcefield","teleport")
my_effect.effecttype = pick("healing","injure","stun","roboheal","robohurt","cellcharge","celldrain","planthelper","forcefield","teleport","dnaswitch","emp","sleepy")
// Select range based on the power
var/canworldpulse = 1
switch(my_effect.effecttype)
if("healing") my_effect.effectmode = pick("aura","pulse","contact")
if("injure") my_effect.effectmode = pick("aura","pulse","contact")
// if("stun") my_effect.effectmode = pick("aura","pulse","contact")
if("roboheal") my_effect.effectmode = pick("aura","pulse","contact")
if("robohurt") my_effect.effectmode = pick("aura","pulse","contact")
if("cellcharge") my_effect.effectmode = pick("aura","pulse")
if("celldrain") my_effect.effectmode = pick("aura","pulse")
if("healing")
my_effect.effectmode = pick("aura","pulse","contact")
if("injure")
my_effect.effectmode = pick("aura","pulse","contact")
if("stun")
my_effect.effectmode = pick("aura","pulse","contact")
if("roboheal")
my_effect.effectmode = pick("aura","pulse","contact")
if("robohurt")
my_effect.effectmode = pick("aura","pulse","contact")
if("sleepy")
my_effect.effectmode = pick("aura","pulse","contact")
if("cellcharge")
my_effect.effectmode = pick("aura","pulse")
if("celldrain")
my_effect.effectmode = pick("aura","pulse")
if("planthelper")
my_effect.effectmode = pick("aura","pulse")
canworldpulse = 0
if("forcefield")
my_effect.effectmode = "contact"
canworldpulse = 0
if("teleport") my_effect.effectmode = pick("pulse","contact")
if("teleport")
my_effect.effectmode = pick("pulse","contact")
if("genderswitch")
my_effect.effectmode = pick("pulse","contact")
if("emp")
my_effect.effectmode = pick("pulse","contact")
// Recharge timer & range setup
if (my_effect.effectmode == "aura")
@@ -191,26 +195,28 @@
src.activated = !src.activated
var/display_msg = ""
if(activated)
switch(rand(4))
if(0)
display_msg = "momentarily glows brightly!"
if(1)
display_msg = "distorts slightly for a moment!"
if(2)
display_msg = "makes a slightly clicking noise!"
if(3)
display_msg = "flickers slightly!"
if(4)
display_msg = "vibrates!"
if(prob(30))
switch(rand(4))
if(0)
display_msg = "momentarily glows brightly!"
if(1)
display_msg = "distorts slightly for a moment!"
if(2)
display_msg = "makes a slightly clicking noise!"
if(3)
display_msg = "flickers slightly!"
if(4)
display_msg = "vibrates!"
else
my_effect.HaltEffect()
switch(rand(2))
if(0)
display_msg = "grows dull!"
if(1)
display_msg = "fades in intensity!"
if(2)
display_msg = "suddenly becomes very quiet!"
if(prob(30))
switch(rand(2))
if(0)
display_msg = "grows dull!"
if(1)
display_msg = "fades in intensity!"
if(2)
display_msg = "suddenly becomes very quiet!"
icon_state = "ano[icon_num][activated]"
for(var/mob/O in viewers(src, null))
@@ -232,17 +238,3 @@
/obj/machinery/artifact/Move()
..()
my_effect.update_move(src, src.loc)
/proc/artifact_checkgood(var/datum/artifact_effect/A)
switch(A.effecttype)
if("healing") return 1
if("injure") return 0
// if("stun") return 0
if("roboheal") return 1
if("robohurt") return 0
if("cellcharge") return 1
if("celldrain") return 1
if("planthelper") return 1
if("forcefield") return 1
if("teleport") return 0
@@ -93,38 +93,38 @@
if("injure")
if (istype(user, /mob/living/carbon/))
user << "\red A painful discharge of energy strikes you!"
user.adjustOxyLoss(25)
user.adjustToxLoss(25)
user.adjustBruteLoss(25)
user.adjustFireLoss(25)
user.adjustBrainLoss(25)
user.adjustOxyLoss(rand(5,25))
user.adjustToxLoss(rand(5,25))
user.adjustBruteLoss(rand(5,25))
user.adjustFireLoss(rand(5,25))
user.adjustBrainLoss(rand(5,25))
user.radiation += 25
user.nutrition -= min(50, user.nutrition)
user.stunned += 6
user.make_dizzy(6)
user.weakened += 6
return 1
else user << "Nothing happens."
if("stun")
if (istype(user, /mob/living/carbon/))
user << "\red A powerful force overwhelms your consciousness."
user.paralysis += 30
user.stunned += 45
user.weakened += 45
user.stuttering += 45
if(prob(50))
user.stunned += rand(1,10)
return 1
else user << "Nothing happens."
if("roboheal")
if (istype(user, /mob/living/silicon/robot))
user << "\blue Your systems report damaged components mending by themselves!"
user.adjustBruteLoss(-30)
user.adjustFireLoss(-30)
user.adjustBruteLoss(rand(-10,-30))
user.adjustFireLoss(rand(-10,-30))
return 1
else user << "Nothing happens."
if("robohurt")
if (istype(user, /mob/living/silicon/robot))
user << "\red Your systems report severe damage has been inflicted!"
user.adjustBruteLoss(40)
user.adjustFireLoss(40)
user.adjustBruteLoss(rand(10,50))
user.adjustFireLoss(rand(10,50))
return 1
else user << "Nothing happens."
if("forcefield")
@@ -133,6 +133,7 @@
created_field.Add(E)
E.strength = 1
E.density = 1
E.anchored = 1
E.invisibility = 0
return 1
if("teleport")
@@ -150,6 +151,11 @@
sparks.set_up(3, 0, get_turf(originator)) //no idea what the 0 is
sparks.start()
return 1
if("sleepy")
user << pick("\blue You feel like taking a nap.","\blue You feel a yawn coming on.","\blue You feel a little tired.")
user.drowsyness = min(user.drowsyness + rand(5,25), 50)
user.eye_blurry = min(user.eye_blurry + rand(1,3), 50)
return 1
else if (src.effectmode == "aura")
switch(src.effecttype)
//caeltodo
@@ -237,6 +243,13 @@
H.weedlevel -= 1
H.lastcycle += 5
return 1
if("sleepy")
for (var/mob/living/carbon/M in range(src.aurarange,originator))
if(prob(10))
M << pick("\blue You feel like taking a nap.","\blue You feel a yawn coming on.","\blue You feel a little tired.")
M.drowsyness = min(M.drowsyness + 1, 25)
M.eye_blurry = min(M.eye_blurry + 1, 25)
return 1
else if (src.effectmode == "pulse")
for(var/mob/O in viewers(originator, null))
O.show_message(text("<b>[]</b> emits a pulse of energy!", originator), 1)
@@ -264,7 +277,7 @@
M.adjustToxLoss(5)
M.adjustOxyLoss(5)
M.adjustBrainLoss(5)
M.stunned += 3
M.make_dizzy(6)
M.weakened += 3
M.updatehealth()
return 1
@@ -274,7 +287,6 @@
continue
M << "\red A wave of energy overwhelms your senses!"
M.paralysis += 3
M.stunned += 4
M.weakened += 4
M.stuttering += 4
return 1
@@ -309,7 +321,7 @@
for (var/obj/machinery/power/smes/S in range (src.aurarange,originator)) S.charge -= 400
for (var/mob/living/silicon/robot/M in range(src.aurarange,originator))
for (var/obj/item/weapon/cell/D in M.contents)
D.charge -= 500
D.charge -= min(D.charge, 500)
M << "\red SYSTEM ALERT: Severe energy drain detected!"
return 1
if("planthelper")
@@ -343,13 +355,40 @@
sparks.set_up(3, 0, get_turf(originator)) //no idea what the 0 is
sparks.start()
return 1
if("dnaswitch")
for(var/mob/living/H in range(src.aurarange,originator))
if(ishuman(H) && istype(H:wear_suit,/obj/item/clothing/suit/bio_suit/anomaly) && istype(H:head,/obj/item/clothing/head/bio_hood/anomaly))
continue
if(prob(30))
H << pick("\green You feel a little different.","\green You feel strange.","\green You feel different.")
//todo
if (H.gender == FEMALE)
H.gender = MALE
else
H.gender = FEMALE
/*H.dna.ready_dna(H)
H.update_body()
H.update_face()*/
return 1
if("emp")
empulse(get_turf(originator), aurarange/2, aurarange)
return 1
if("sleepy")
for (var/mob/living/carbon/M in range(src.aurarange,originator))
if(prob(30))
M << pick("\blue You feel like taking a nap.","\blue You feel a yawn coming on.","\blue You feel a little tired.")
if(prob(50))
M.drowsyness = min(M.drowsyness + rand(1,5), 25)
if(prob(50))
M.eye_blurry = min(M.eye_blurry + rand(1,5), 25)
return 1
else if (src.effectmode == "worldpulse")
for(var/mob/O in viewers(originator, null))
O.show_message(text("<b>[]</b> emits a powerful burst of energy!", originator), 1)
switch(src.effecttype)
//caeltodo
if("healing")
for (var/mob/living/carbon/M in world)
for (var/mob/living/carbon/M in range(200, originator))
if(ishuman(M) && istype(M:wear_suit,/obj/item/clothing/suit/bio_suit/anomaly) && istype(M:head,/obj/item/clothing/head/bio_hood/anomaly))
continue
M << "\blue Waves of soothing energy wash over you."
@@ -361,7 +400,7 @@
M.updatehealth()
return 1
if("injure")
for (var/mob/living/carbon/human/M in world)
for (var/mob/living/carbon/human/M in range(200, originator))
M << "\red A wave of painful energy strikes you!"
M.adjustBruteLoss(3)
M.adjustFireLoss(3)
@@ -371,31 +410,30 @@
M.updatehealth()
return 1
if("stun")
for (var/mob/living/carbon/M in world)
for (var/mob/living/carbon/M in range(200, originator))
if(ishuman(M) && istype(M:wear_suit,/obj/item/clothing/suit/bio_suit/anomaly) && istype(M:head,/obj/item/clothing/head/bio_hood/anomaly))
continue
M << "\red A powerful force causes you to black out momentarily."
M.paralysis += 5
M.stunned += 8
M.weakened += 8
M.stuttering += 8
return 1
if("roboheal")
for (var/mob/living/silicon/robot/M in world)
for (var/mob/living/silicon/robot/M in range(200, originator))
M << "\blue SYSTEM ALERT: Structural damage has been repaired by energy pulse!"
M.adjustBruteLoss(-5)
M.adjustFireLoss(-5)
M.updatehealth()
return 1
if("robohurt")
for (var/mob/living/silicon/robot/M in world)
for (var/mob/living/silicon/robot/M in range(200, originator))
M << "\red SYSTEM ALERT: Structural damage inflicted by energy pulse!"
M.adjustBruteLoss(5)
M.adjustFireLoss(5)
M.updatehealth()
return 1
if("cellcharge")
for (var/obj/machinery/power/apc/C in world)
for (var/obj/machinery/power/apc/C in range(200, originator))
for (var/obj/item/weapon/cell/B in C.contents)
B.charge += 100
for (var/obj/machinery/power/smes/S in range (src.aurarange,src)) S.charge += 250
@@ -405,17 +443,17 @@
M << "\blue SYSTEM ALERT: Energy boost detected!"
return 1
if("celldrain")
for (var/obj/machinery/power/apc/C in world)
for (var/obj/machinery/power/apc/C in range(200, originator))
for (var/obj/item/weapon/cell/B in C.contents)
B.charge -= 250
B.charge -= min(B.charge,250)
for (var/obj/machinery/power/smes/S in range (src.aurarange,src)) S.charge -= 250
for (var/mob/living/silicon/robot/M in world)
for (var/obj/item/weapon/cell/D in M.contents)
D.charge -= 250
D.charge -= min(D.charge,250)
M << "\red SYSTEM ALERT: Energy drain detected!"
return 1
if("teleport")
for (var/mob/living/M in world)
for (var/mob/living/M in range(200, originator))
if(ishuman(M) && istype(M:wear_suit,/obj/item/clothing/suit/bio_suit/anomaly) && istype(M:head,/obj/item/clothing/head/bio_hood/anomaly))
continue
var/list/randomturfs = new/list()
@@ -432,6 +470,27 @@
sparks.set_up(3, 0, get_turf(originator)) //no idea what the 0 is
sparks.start()
return 1
if("dnaswitch")
for(var/mob/living/H in range(200, originator))
if(ishuman(H) && istype(H:wear_suit,/obj/item/clothing/suit/bio_suit/anomaly) && istype(H:head,/obj/item/clothing/head/bio_hood/anomaly))
continue
if(prob(30))
H << pick("\green You feel a little different.","\green You feel strange.","\green You feel different.")
//todo
if (H.gender == FEMALE)
H.gender = MALE
else
H.gender = FEMALE
/*H.dna.ready_dna(H)
H.update_body()
H.update_face()*/
return 1
if("sleepy")
for(var/mob/living/H in range(200, originator))
H.drowsyness = min(H.drowsyness + rand(5,15), 50)
H.eye_blurry = min(H.eye_blurry + rand(5,15), 50)
return 1
//initially for the force field artifact
/datum/artifact_effect/proc/update_move(var/atom/originator)
@@ -443,6 +502,7 @@
created_field.Add(E)
E.strength = 1
E.density = 1
E.anchored = 1
E.invisibility = 0
var/obj/effect/energy_field/E = created_field[1]
@@ -1,7 +1,7 @@
/obj/item/weapon/anobattery
name = "Anomaly power battery"
icon = 'anomaly.dmi'
icon = 'xenoarchaeology.dmi'
icon_state = "anobattery0"
var/datum/artifact_effect/battery_effect
var/capacity = 200
@@ -16,7 +16,7 @@
/obj/item/weapon/anodevice
name = "Anomaly power utilizer"
icon = 'anomaly.dmi'
icon = 'xenoarchaeology.dmi'
icon_state = "anodev"
var/cooldown = 0
var/activated = 0