From 040cf2f8d50c4caf2f086b64d3c5f21cfe476e1f Mon Sep 17 00:00:00 2001 From: Cael_Aislinn Date: Tue, 19 Feb 2013 02:07:25 +1000 Subject: [PATCH] tweaked artifact extraction, artifacts Signed-off-by: Cael_Aislinn --- code/modules/mining/mine_turfs.dm | 104 +++++++++++++++--- .../analysis/analysis_fourier_transform.dm | 5 +- .../analysis/analysis_hyperspectral.dm | 14 ++- .../xenoarchaeology/artifact/artifact.dm | 4 +- .../artifact/artifact_hoverpod.dm | 17 ++- .../tools/tools_depthscanner.dm | 6 +- .../xenoarchaeology/unknown/unknown.dm | 7 +- 7 files changed, 129 insertions(+), 28 deletions(-) diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 66a1422bd8a..357bf0b7fc0 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -18,7 +18,6 @@ var/mineralAmt = 0 var/spread = 0 //will the seam spread? var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles - var/artifactChance = 0.3 //percent chance to spawn a xenoarchaelogical artifact var/last_act = 0 var/datum/geosample/geological_data @@ -128,7 +127,6 @@ //dont create artifact machinery in animal or plant digsites, or if we already have one if(!artifact_find && digsite != 1 && digsite != 2 && prob(ARTIFACT_SPAWN_CHANCE)) artifact_find = new() - //world << "[artifact_find.artifact_find_type] [src.x], [src.y], [src.z]" artifact_spawning_turfs.Add(src) if(!src.geological_data) @@ -370,25 +368,30 @@ commented out in r5061, I left it because of the shroom thingies //just pull the surrounding rock out excavate_find(0, F) - if(src.excavation_level + P.excavation_amount >= 100) + if( src.excavation_level + P.excavation_amount >= 100 || (!finds.len && !excavation_minerals.len) ) //if players have been excavating this turf, have a chance to leave some rocky debris behind var/boulder_prob = 0 + var/obj/structure/boulder/B + if(src.excavation_level > 15) - boulder_prob = 50 + boulder_prob = 10 if(artifact_find) - boulder_prob += 10 - if(src.excavation_level == 100) + boulder_prob += 25 + if(src.excavation_level >= 100) boulder_prob += 40 else if(src.excavation_level > 95) boulder_prob += 25 else if(src.excavation_level > 90) boulder_prob += 10 if(prob(boulder_prob)) - var/obj/structure/boulder/B = new(src) + B = new(src) if(artifact_find) B.artifact_find = artifact_find + else if(src.excavation_level + P.excavation_amount >= 100) + spawn(0) + artifact_debris() - gets_drilled() + gets_drilled(B ? 0 : 1) return else src.excavation_level += P.excavation_amount @@ -466,7 +469,7 @@ commented out in r5061, I left it because of the shroom thingies O.geological_data = src.geological_data return O -/turf/simulated/mineral/proc/gets_drilled() +/turf/simulated/mineral/proc/gets_drilled(var/artifact_fail = 0) //var/destroyed = 0 //used for breaking strange rocks if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11)) @@ -485,10 +488,22 @@ commented out in r5061, I left it because of the shroom thingies var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid) N.fullUpdateMineralOverlays() - /*if(src.contents) - [src.contents ? pick(" There is a crunching noise."," [W] hits something."," Part of the rock face crumbles away.","Something breaks under [W].") : ""]" - var/atom/A = pick(src.contents) - del(A)*/ + //destroyed artifacts have weird, unpleasant effects + if(artifact_find && artifact_fail) + var/pain = 0 + if(prob(50)) + pain = 1 + for(var/mob/living/M in range(src, 200)) + M << "[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fadaing away!" + if(pain) + flick("pain",M.pain) + if(prob(50)) + M.adjustBruteLoss(5) + else + flick("flash",M.flash) + if(prob(50)) + M.Stun(5) + M.apply_effect(25, IRRADIATE) /*if(destroyed) //Display message about being a terrible miner usr << "\red You destroy some of the rocks!"*/ @@ -523,6 +538,69 @@ commented out in r5061, I left it because of the shroom thingies src.finds.Remove(F) +/turf/simulated/mineral/proc/artifact_debris() + //cael's patented random limited drop componentized loot system! + var/materials = 0 + var/list/viable_materials = list(1,2,4,8,16,32,64,128,256) + + var/num_materials = rand(1,5) + for(var/i=0, i 0) - if(accuracy > 0.6) - distance += (2 * rand() - 1) * distance * 0.01 + if(prob(accuracy)) + distance += (2 * rand() - 1) * distance * 0.05 + accuracy = 0.95 + 0.05 * (2 * rand() - 1) else var/offset = 1 - accuracy distance += (2 * rand() - 1) * distance * offset diff --git a/code/modules/research/xenoarchaeology/analysis/analysis_hyperspectral.dm b/code/modules/research/xenoarchaeology/analysis/analysis_hyperspectral.dm index 0b745ce0993..7825d935904 100644 --- a/code/modules/research/xenoarchaeology/analysis/analysis_hyperspectral.dm +++ b/code/modules/research/xenoarchaeology/analysis/analysis_hyperspectral.dm @@ -2,8 +2,8 @@ obj/machinery/anomaly/hyperspectral name = "Hyperspectral Imager" desc = "A specialised, complex analysis machine." - icon = 'icons/obj/computer.dmi' - icon_state = "rdcomp" + //icon = 'icons/obj/computer.dmi' + //icon_state = "rdcomp" obj/machinery/anomaly/hyperspectral/ScanResults() var/results = "The scan was inconclusive. Check sample integrity and carrier consistency." @@ -32,7 +32,13 @@ obj/machinery/anomaly/hyperspectral/ScanResults() results += "
" else results += "
" - if(scanned_sample.artifact_id && prob(specifity * 100)) - results += "Anomalous exotic energy signature detected: [scanned_sample.artifact_id]." + + results += "
" + if(scanned_sample.artifact_id) + results += "Detected energy signatures [100 * (1 - specifity)]% consistent with standard background readings.
" + if(prob( (specifity + 0.5 * (1 - specifity)) * 100)) + results += "Anomalous exotic energy signature isolated: [scanned_sample.artifact_id]." + else + results += "Detected energy signatures [95 + 5 * (2 * rand() - 1) * (1 - specifity)]% consistent with standard background readings." return results diff --git a/code/modules/research/xenoarchaeology/artifact/artifact.dm b/code/modules/research/xenoarchaeology/artifact/artifact.dm index 60f6fc7fb96..1ff8a220f32 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact.dm @@ -10,7 +10,7 @@ /datum/artifact_find/New() artifact_detect_range = rand(5,300) - artifact_id = "[pick("kappa","sigma","antaeres","beta","omicron","iota","upsilon","omega","gamma","delta","tau","alpha")]-[rand(100,999)]" + artifact_id = "[pick("kappa","sigma","antaeres","beta","omicron","iota","epsilon","omega","gamma","delta","tau","alpha")]-[rand(100,999)]" artifact_find_type = pick(\ 5;/obj/machinery/power/supermatter,\ @@ -23,7 +23,7 @@ 100;/obj/mecha/working/hoverpod,\ 100;/obj/machinery/replicator,\ 150;/obj/structure/crystal,\ - 500;/obj/machinery/artifact) + 1000;/obj/machinery/artifact) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Boulders - sometimes turn up after excavating turf - excavate further to try and find large xenoarch finds diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm b/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm index 04b68a3dbd3..a21b8181f74 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm @@ -1,9 +1,9 @@ /obj/mecha/working/hoverpod name = "hover pod" - icon = 'icons/obj/vehicles.dmi' icon_state = "engineering_pod" desc = "Stubby and round, it has a human sized access hatch on the top." + wreckage = /obj/effect/decal/mecha_wreckage/hoverpod //duplicate of parent proc, but without space drifting /obj/mecha/working/hoverpod/dyndomove(direction) @@ -50,3 +50,18 @@ if(result) playsound(src,'sound/machines/hiss.ogg',40,1) return result + +/obj/effect/decal/mecha_wreckage/hoverpod + name = "Hover pod wreckage" + icon_state = "engineering_pod-broken" + + /*New() + ..() + var/list/parts = list( + + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return*/ diff --git a/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm b/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm index cfb651a036e..ff934222977 100644 --- a/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm +++ b/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm @@ -27,7 +27,7 @@ user.visible_message("\blue [user] scans [A], the air around them humming gently.") if(istype(A,/turf/simulated/mineral)) var/turf/simulated/mineral/M = A - if(M.excavation_minerals.len || M.finds.len) + if(M.excavation_minerals.len || M.finds.len || M.artifact_find) //create a new scanlog entry var/datum/depth_scan/D = new() @@ -79,8 +79,8 @@ if(current) dat += "Time: [current.time]
" dat += "Coords: [current.coords]
" - dat += "Anomaly depth: [current.depth]
" - dat += "Clearance: [current.clearance]
" + dat += "Anomaly depth: [current.depth] cm
" + dat += "Clearance above anomaly depth: [current.clearance] cm
" dat += "Dissonance spread: [current.dissonance_spread]
" dat += "clear entry
" else diff --git a/code/modules/research/xenoarchaeology/unknown/unknown.dm b/code/modules/research/xenoarchaeology/unknown/unknown.dm index 52f7e2c772e..ecfd75289de 100644 --- a/code/modules/research/xenoarchaeology/unknown/unknown.dm +++ b/code/modules/research/xenoarchaeology/unknown/unknown.dm @@ -18,7 +18,7 @@ #define TRIGGER_CO2 11 #define TRIGGER_NITRO 12 #define MAX_TRIGGER 12 - +/* //sleeping gas appears to be bugged, currently var/list/valid_primary_effect_types = list(\ /datum/artifact_effect/cellcharge,\ @@ -55,6 +55,7 @@ var/list/valid_secondary_effect_types = list(\ /datum/artifact_effect/sleepy,\ /datum/artifact_effect/stun,\ /datum/artifact_effect/teleport) + */ /obj/machinery/artifact name = "alien artifact" @@ -71,12 +72,12 @@ var/list/valid_secondary_effect_types = list(\ ..() //setup primary effect - these are the main ones (mixed) - var/effecttype = pick(valid_primary_effect_types) + var/effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect) my_effect = new effecttype(src) //75% chance to have a secondary stealthy (and mostly bad) effect if(prob(75)) - effecttype = pick(valid_secondary_effect_types) + effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect) secondary_effect = new effecttype(src) if(prob(75)) secondary_effect.ToggleActivate(0)