mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Mining rework. Added ore scanner, adjusted values for spawn, added debug verbs.
Conflicts: baystation12.dme code/modules/admin/admin_verbs.dm maps/tgstation2.dmm
This commit is contained in:
@@ -33,7 +33,9 @@ datum/controller/game_controller
|
||||
|
||||
var/last_thing_processed
|
||||
|
||||
var/list/shuttle_list //for debugging and VV
|
||||
var/list/shuttle_list // For debugging and VV
|
||||
var/datum/ore_distribution/asteroid_ore_map // For debugging and VV.
|
||||
|
||||
|
||||
datum/controller/game_controller/New()
|
||||
//There can be only one master_controller. Out with the old and in with the new.
|
||||
@@ -84,8 +86,8 @@ datum/controller/game_controller/proc/setup()
|
||||
color_windows_init()
|
||||
|
||||
//Create the mining ore distribution map.
|
||||
var/datum/ore_distribution/O = new()
|
||||
O.populate_distribution_map()
|
||||
asteroid_ore_map = new /datum/ore_distribution()
|
||||
asteroid_ore_map.populate_distribution_map()
|
||||
|
||||
spawn(0)
|
||||
if(ticker)
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
//TODO: rewrite and standardise all controller datums to the datum/controller type
|
||||
//TODO: allow all controllers to be deleted for clean restarts (see WIP master controller stuff) - MC done - lighting done
|
||||
|
||||
/client/proc/show_distribution_map()
|
||||
set category = "Debug"
|
||||
set name = "Show Distribution Map"
|
||||
set desc = "Print the asteroid ore distribution map to the world."
|
||||
|
||||
if(!holder) return
|
||||
|
||||
if(master_controller && master_controller.asteroid_ore_map)
|
||||
master_controller.asteroid_ore_map.print_distribution_map()
|
||||
|
||||
/client/proc/remake_distribution_map()
|
||||
set category = "Debug"
|
||||
set name = "Remake Distribution Map"
|
||||
set desc = "Rebuild the asteroid ore distribution map."
|
||||
|
||||
if(!holder) return
|
||||
|
||||
if(master_controller && master_controller.asteroid_ore_map)
|
||||
master_controller.asteroid_ore_map = new /datum/ore_distribution()
|
||||
master_controller.asteroid_ore_map.populate_distribution_map()
|
||||
|
||||
/client/proc/restart_controller(controller in list("Master","Failsafe","Lighting","Supply"))
|
||||
set category = "Debug"
|
||||
set name = "Restart Controller"
|
||||
|
||||
@@ -145,6 +145,8 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/cmd_debug_tog_aliens,
|
||||
/client/proc/reload_admins,
|
||||
/client/proc/restart_controller,
|
||||
/client/proc/remake_distribution_map,
|
||||
/client/proc/show_distribution_map,
|
||||
/client/proc/enable_debug_verbs,
|
||||
/client/proc/callproc,
|
||||
/client/proc/toggledebuglogs,
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#define MAX_DEEP_COUNT 300
|
||||
#define ITERATE_BEFORE_FAIL 200
|
||||
|
||||
#define RESOURCE_HIGH_MAX 3
|
||||
#define RESOURCE_HIGH_MIN 0
|
||||
#define RESOURCE_MID_MAX 2
|
||||
#define RESOURCE_HIGH_MAX 4
|
||||
#define RESOURCE_HIGH_MIN 2
|
||||
#define RESOURCE_MID_MAX 3
|
||||
#define RESOURCE_MID_MIN 1
|
||||
#define RESOURCE_LOW_MAX 1
|
||||
#define RESOURCE_LOW_MIN 0
|
||||
@@ -106,6 +106,14 @@ Deep minerals:
|
||||
for(var/y = 1, y <= real_size, y++)
|
||||
map[MAP_CELL] = 0
|
||||
|
||||
/datum/ore_distribution/proc/print_distribution_map()
|
||||
var/line = ""
|
||||
for(var/x = 1, x <= real_size, x++)
|
||||
for(var/y = 1, y <= real_size, y++)
|
||||
line += num2text(round(map[MAP_CELL]/25.5))
|
||||
world << line
|
||||
line = ""
|
||||
|
||||
/datum/ore_distribution/proc/generate_distribution_map(var/x,var/y,var/input_size)
|
||||
|
||||
var/size = input_size
|
||||
@@ -160,36 +168,37 @@ Deep minerals:
|
||||
if(target_turf && target_turf.has_resources)
|
||||
|
||||
target_turf.resources = list()
|
||||
target_turf.resources["silicates"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["carbonaceous rock"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["silicates"] = rand(3,5)
|
||||
target_turf.resources["carbonaceous rock"] = rand(3,5)
|
||||
|
||||
if(map[MAP_CELL] > (range*0.60))
|
||||
target_turf.resources["iron"] = 0
|
||||
target_turf.resources["gold"] = 0
|
||||
target_turf.resources["silver"] = 0
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["hydrogen"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
else if(map[MAP_CELL] > (range*0.40))
|
||||
target_turf.resources["iron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["gold"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["hydrogen"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
else
|
||||
target_turf.resources["iron"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["gold"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["phoron"] = 0
|
||||
target_turf.resources["osmium"] = 0
|
||||
target_turf.resources["hydrogen"] = 0
|
||||
switch(map[MAP_CELL])
|
||||
if(0 to 100)
|
||||
target_turf.resources["iron"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["gold"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["diamond"] = 0
|
||||
target_turf.resources["phoron"] = 0
|
||||
target_turf.resources["osmium"] = 0
|
||||
target_turf.resources["hydrogen"] = 0
|
||||
if(100 to 124)
|
||||
target_turf.resources["iron"] = 0
|
||||
target_turf.resources["gold"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["diamond"] = 0
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["hydrogen"] = 0
|
||||
if(125 to 255)
|
||||
target_turf.resources["iron"] = 0
|
||||
target_turf.resources["gold"] = 0
|
||||
target_turf.resources["silver"] = 0
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["hydrogen"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
|
||||
tx += chunk_size
|
||||
tx = origin_x
|
||||
|
||||
@@ -265,13 +265,13 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_harvest_capacity()
|
||||
return 3 * (cutter ? cutter.rating : 0)
|
||||
return (cutter ? cutter.rating : 0)
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_storage_capacity()
|
||||
return 100 * (storage ? storage.rating : 0)
|
||||
return 200 * (storage ? storage.rating : 0)
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_charge_use()
|
||||
return 100 - (20 * (cellmount ? cellmount.rating : 0))
|
||||
return 50 - (10 * (cellmount ? cellmount.rating : 0))
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_resource_field()
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/obj/item/weapon/mining_scanner
|
||||
name = "ore detector"
|
||||
desc = "A complex device used to locate ore deep underground."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "forensic0-old" //GET A BETTER SPRITE.
|
||||
item_state = "electronic"
|
||||
// matter = list("metal" = 150)
|
||||
|
||||
origin_tech = "magnets=1;engineering=1"
|
||||
|
||||
/obj/item/weapon/mining_scanner/attack_self(mob/user as mob)
|
||||
|
||||
user << "You begin sweeping \the [src] about, scanning for metal deposits."
|
||||
|
||||
if(!do_after(user,50)) return
|
||||
|
||||
if(!user || !src) return
|
||||
|
||||
var/list/metals = list(
|
||||
"surface minerals" = 0,
|
||||
"precious metals" = 0,
|
||||
"nuclear fuel" = 0,
|
||||
"exotic matter" = 0
|
||||
)
|
||||
|
||||
for(var/turf/T in oview(3,get_turf(user)))
|
||||
|
||||
if(!T.has_resources)
|
||||
continue
|
||||
|
||||
for(var/metal in T.resources)
|
||||
|
||||
var/ore_type
|
||||
|
||||
switch(metal)
|
||||
if("silicates" || "carbonaceous rock" || "iron") ore_type = "surface minerals"
|
||||
if("gold" || "silver" || "diamond") ore_type = "precious metals"
|
||||
if("uranium") ore_type = "nuclear fuel"
|
||||
if("phoron" || "osmium" || "hydrogen") ore_type = "exotic matter"
|
||||
|
||||
if(ore_type) metals[ore_type] += T.resources[metal]
|
||||
|
||||
user << "\icon[src] \blue The scanner beeps and displays a readout."
|
||||
|
||||
for(var/ore_type in metals)
|
||||
|
||||
var/result = "no sign"
|
||||
|
||||
switch(metals[ore_type])
|
||||
if(1 to 50) result = "trace amounts"
|
||||
if(51 to 150) result = "significant amounts"
|
||||
if(151 to INFINITY) result = "huge quantities"
|
||||
|
||||
user << "- [result] of [ore_type]."
|
||||
Reference in New Issue
Block a user