Mining fixes as it was annoying as fuck. Also a random object with nothing in it removed.

This commit is contained in:
SkyMarshal
2014-01-08 21:33:17 -07:00
parent d43b2fa492
commit 2308e71157
13 changed files with 522 additions and 633 deletions
File diff suppressed because it is too large Load Diff
+72
View File
@@ -0,0 +1,72 @@
var/list/name_to_mineral
proc/SetupMinerals()
name_to_mineral = list()
for(var/type in typesof(/mineral) - /mineral)
var/mineral/new_mineral = new type
if(!new_mineral.name)
continue
name_to_mineral[new_mineral.name] = new_mineral
return 1
mineral
///What am I called?
var/name
var/display_name
///How much ore?
var/result_amount
///Does this type of deposit spread?
var/spread = 1
///Chance of spreading in any direction
var/spread_chance
///Path to the resultant ore.
var/ore
New()
. = ..()
if(!display_name)
display_name = name
mineral/uranium
name = "Uranium"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/uranium
mineral/iron
name = "Iron"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/iron
mineral/diamond
name = "Diamond"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/diamond
mineral/gold
name = "Gold"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/gold
mineral/silver
name = "Silver"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/silver
mineral/plasma
name = "Plasma"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/plasma
mineral/clown
display_name = "Bananium"
name = "Clown"
result_amount = 3
spread = 0
ore = /obj/item/weapon/ore/clown
+1 -1
View File
@@ -4,7 +4,7 @@
name = "Rock"
icon = 'icons/obj/mining.dmi'
icon_state = "ore2"
var/datum/geosample/geological_data
var/datum/geosample/geologic_data
/obj/item/weapon/ore/uranium
name = "Uranium ore"
@@ -1,5 +1,3 @@
Methylphenidate
#define ANTIDEPRESSANT_MESSAGE_DELAY 5*60*10
/datum/reagent/antidepressant/methylphenidate
@@ -29,7 +29,7 @@
anchored = 1
spawn(drill_time)
if(get_turf(src) == drilling_turf && active)
M.gets_drilled()
M.GetDrilled()
src.loc = M
drilling_turf = null
anchored = 0
@@ -57,44 +57,45 @@
age = rand(1,999)
switch(container.mineralName)
if("Uranium")
age_million = rand(1, 704)
age_thousand = rand(1,999)
find_presence["potassium"] = rand(1,1000) / 100
source_mineral = "potassium"
if("Iron")
age_thousand = rand(1, 999)
age_million = rand(1, 999)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Diamond")
age_thousand = rand(1,999)
age_million = rand(1,999)
find_presence["nitrogen"] = rand(1,1000) / 100
source_mineral = "nitrogen"
if("Gold")
age_thousand = rand(1,999)
age_million = rand(1,999)
age_billion = rand(3,4)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Silver")
age_thousand = rand(1,999)
age_million = rand(1,999)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Plasma")
age_thousand = rand(1,999)
age_million = rand(1,999)
age_billion = rand(10, 13)
find_presence["plasma"] = rand(1,1000) / 100
source_mineral = "plasma"
if("Clown")
age = rand(-1,-999) //thats the joke
age_thousand = rand(-1,-999)
find_presence["plasma"] = rand(1,1000) / 100
source_mineral = "plasma"
if(container.mineral)
switch(container.mineral.name)
if("Uranium")
age_million = rand(1, 704)
age_thousand = rand(1,999)
find_presence["potassium"] = rand(1,1000) / 100
source_mineral = "potassium"
if("Iron")
age_thousand = rand(1, 999)
age_million = rand(1, 999)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Diamond")
age_thousand = rand(1,999)
age_million = rand(1,999)
find_presence["nitrogen"] = rand(1,1000) / 100
source_mineral = "nitrogen"
if("Gold")
age_thousand = rand(1,999)
age_million = rand(1,999)
age_billion = rand(3,4)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Silver")
age_thousand = rand(1,999)
age_million = rand(1,999)
find_presence["iron"] = rand(1,1000) / 100
source_mineral = "iron"
if("Plasma")
age_thousand = rand(1,999)
age_million = rand(1,999)
age_billion = rand(10, 13)
find_presence["plasma"] = rand(1,1000) / 100
source_mineral = "plasma"
if("Clown")
age = rand(-1,-999) //thats the joke
age_thousand = rand(-1,-999)
find_presence["plasma"] = rand(1,1000) / 100
source_mineral = "plasma"
if(prob(75))
find_presence["phosphorus"] = rand(1,500) / 100
@@ -274,8 +274,8 @@
switch(scanned_item.type)
if(/obj/item/weapon/ore)
var/obj/item/weapon/ore/O = scanned_item
if(O.geological_data)
G = O.geological_data
if(O.geologic_data)
G = O.geologic_data
if(/obj/item/weapon/rocksliver)
var/obj/item/weapon/rocksliver/O = scanned_item
@@ -1,3 +1,52 @@
#define XENOARCH_SPAWN_CHANCE 0.5
#define XENOARCH_SPREAD_CHANCE 15
#define ARTIFACT_SPAWN_CHANCE 20
proc/SetupXenoarch()
for(var/turf/simulated/mineral/M in block(locate(1,1,1), locate(world.maxx, world.maxy, world.maxz)))
if(!M.geologic_data)
M.geologic_data = new/datum/geosample(M)
if(!prob(XENOARCH_SPAWN_CHANCE))
continue
var/digsite = get_random_digsite_type()
var/list/processed_turfs = list()
var/list/turfs_to_process = list(M)
for(var/turf/simulated/mineral/archeo_turf in turfs_to_process)
for(var/turf/simulated/mineral/T in orange(1, archeo_turf))
if(T.finds)
continue
if(T in processed_turfs)
continue
if(prob(XENOARCH_SPREAD_CHANCE))
turfs_to_process.Add(T)
processed_turfs.Add(archeo_turf)
if(!archeo_turf.finds)
archeo_turf.finds = list()
if(prob(50))
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,95)))
else if(prob(75))
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,45)))
archeo_turf.finds.Add(new /datum/find(digsite, rand(55,95)))
else
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,30)))
archeo_turf.finds.Add(new /datum/find(digsite, rand(35,75)))
archeo_turf.finds.Add(new /datum/find(digsite, rand(75,95)))
//sometimes a find will be close enough to the surface to show
var/datum/find/F = archeo_turf.finds[1]
if(F.excavation_required <= F.view_range)
archeo_turf.archaeo_overlay = "overlay_archaeo[rand(1,3)]"
archeo_turf.overlays += archeo_turf.archaeo_overlay
//dont create artifact machinery in animal or plant digsites, or if we already have one
if(!M.artifact_find && digsite != 1 && digsite != 2 && prob(ARTIFACT_SPAWN_CHANCE))
M.artifact_find = new()
artifact_spawn.Add(src)
//---- Noticeboard
@@ -51,11 +51,11 @@
var/datum/geosample/geo_data
if(istype(item_to_sample, /turf/simulated/mineral))
var/turf/simulated/mineral/T = item_to_sample
T.geological_data.UpdateNearbyArtifactInfo(T)
geo_data = T.geological_data
T.geologic_data.UpdateNearbyArtifactInfo(T)
geo_data = T.geologic_data
else if(istype(item_to_sample, /obj/item/weapon/ore))
var/obj/item/weapon/ore/O = item_to_sample
geo_data = O.geological_data
geo_data = O.geologic_data
if(geo_data)
if(filled_bag)
@@ -28,14 +28,14 @@
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 || M.artifact_find)
if(M.finds.len || M.artifact_find)
//create a new scanlog entry
var/datum/depth_scan/D = new()
D.coords = "[M.x].[rand(0,9)]:[M.y].[rand(0,9)]:[10 * M.z].[rand(0,9)]"
D.time = worldtime2text()
D.record_index = positive_locations.len + 1
D.material = M.mineralName
D.material = M.mineral ? M.mineral.display_name : "Rock"
//find the first artifact and store it
if(M.finds.len)
@@ -44,13 +44,6 @@
D.clearance = F.clearance_range * 2
D.material = get_responsive_reagent(F.find_type)
//check if there are minerals interfering with the scan
if(M.excavation_minerals.len)
if(!D.depth || M.excavation_minerals[1] < D.depth)
D.depth = M.excavation_minerals[1]
D.clearance = rand() * 4 + 1
D.material = M.mineralName
positive_locations.Add(D)
for(var/mob/L in range(src, 1))