This commit is contained in:
Zuhayr
2014-06-11 09:15:28 +09:30
43 changed files with 1391 additions and 1768 deletions

View File

@@ -1047,14 +1047,6 @@ I said no!
items = list()
result = /obj/item/weapon/reagent_containers/food/snacks/slimesoup
/datum/recipe/clownstears
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
/obj/item/weapon/ore/clown,
)
result = /obj/item/weapon/reagent_containers/food/snacks/clownstears
/datum/recipe/boiledslimeextract
reagents = list("water" = 5)
items = list(

View File

@@ -0,0 +1,27 @@
//Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
//eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
//it would be impossible to produce.
/datum/alloy
var/list/requires
var/product_mod = 1
var/product
var/metaltag
/datum/alloy/plasteel
metaltag = "plasteel"
requires = list(
"platinum" = 1,
"coal" = 2,
"hematite" = 2
)
product_mod = 0.3
product = /obj/item/stack/sheet/plasteel
/datum/alloy/steel
metaltag = "steel"
requires = list(
"coal" = 1,
"hematite" = 1
)
product = /obj/item/stack/sheet/metal

View File

@@ -1,75 +1,3 @@
/**********************Mineral ores**************************/
/obj/item/weapon/ore
name = "Rock"
icon = 'icons/obj/mining.dmi'
icon_state = "ore2"
var/datum/geosample/geologic_data
/obj/item/weapon/ore/uranium
name = "Uranium ore"
icon_state = "Uranium ore"
origin_tech = "materials=5"
/obj/item/weapon/ore/iron
name = "Iron ore"
icon_state = "Iron ore"
origin_tech = "materials=1"
/obj/item/weapon/ore/glass
name = "Sand"
icon_state = "Glass ore"
origin_tech = "materials=1"
attack_self(mob/living/user as mob) //It's magic I ain't gonna explain how instant conversion with no tool works. -- Urist
var/location = get_turf(user)
for(var/obj/item/weapon/ore/glass/sandToConvert in location)
new /obj/item/stack/sheet/mineral/sandstone(location)
del(sandToConvert)
new /obj/item/stack/sheet/mineral/sandstone(location)
del(src)
/obj/item/weapon/ore/phoron
name = "Phoron ore"
icon_state = "Phoron ore"
origin_tech = "materials=2"
/obj/item/weapon/ore/silver
name = "Silver ore"
icon_state = "Silver ore"
origin_tech = "materials=3"
/obj/item/weapon/ore/gold
name = "Gold ore"
icon_state = "Gold ore"
origin_tech = "materials=4"
/obj/item/weapon/ore/diamond
name = "Diamond ore"
icon_state = "Diamond ore"
origin_tech = "materials=6"
/obj/item/weapon/ore/clown
name = "Bananium ore"
icon_state = "Clown ore"
origin_tech = "materials=4"
/obj/item/weapon/ore/slag
name = "Slag"
desc = "Completely useless"
icon_state = "slag"
/obj/item/weapon/ore/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/core_sampler))
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
else
return ..()
/*****************************Coin********************************/
/obj/item/weapon/coin
@@ -111,18 +39,10 @@
name = "uranium coin"
icon_state = "coin_uranium"
/obj/item/weapon/coin/clown
name = "bananaium coin"
icon_state = "coin_clown"
/obj/item/weapon/coin/adamantine
name = "adamantine coin"
/obj/item/weapon/coin/platinum
name = "platinum coin"
icon_state = "coin_adamantine"
/obj/item/weapon/coin/mythril
name = "mythril coin"
icon_state = "coin_mythril"
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/cable_coil) )
var/obj/item/weapon/cable_coil/CC = W

View File

@@ -0,0 +1,248 @@
//If anyone can think of a less shitty way to work out x,y points on a linear string of integers please tell me.
#define MAP_CELL ((y-1)*real_size)+x
#define MAP_CENTRE (((y-1)+size/2)*real_size)+(x+size/2)
#define MAP_TOP_LEFT ((y-1)*real_size)+x
#define MAP_TOP_RIGHT ((y-1)*real_size)+(x+size)
#define MAP_BOTTOM_LEFT (((y+size)-1)*real_size)+x
#define MAP_BOTTOM_RIGHT ((((y+size)-1)*real_size)+(x+size))
#define MAP_MID_TOP MAP_TOP_LEFT + (size/2)
#define MAP_MID_BOTTOM MAP_BOTTOM_LEFT + (size/2)
#define MAP_MID_LEFT (((y-1)+size/2)*real_size)+x
#define MAP_MID_RIGHT (((y-1)+size/2)*real_size)+(x+size)
#define MIN_SURFACE_COUNT 1000
#define MAX_SURFACE_COUNT 5000
#define MIN_RARE_COUNT 1000
#define MAX_RARE_COUNT 5000
#define MIN_DEEP_COUNT 100
#define MAX_DEEP_COUNT 300
#define ITERATE_BEFORE_FAIL 200
#define RESOURCE_HIGH_MAX 8
#define RESOURCE_HIGH_MIN 5
#define RESOURCE_MID_MAX 4
#define RESOURCE_MID_MIN 2
#define RESOURCE_LOW_MAX 1
#define RESOURCE_LOW_MIN 0
/*
Surface minerals:
silicates
iron
gold
silver
Rare minerals:
uranium
diamond
Deep minerals:
phoron
osmium (platinum)
tritium (hydrogen)
*/
/datum/ore_distribution
var/real_size = 65 //Overall map size ((must be power of 2)+1)
var/chunk_size = 4 //Size each cell represents on map (like hell we're generating up to 100 256^2 grids at roundstart)
var/list/map[4225] //The actual map. real_size squared.
var/range = 255 //Max random range of cells in map.
var/random_variance_chance = 25
var/random_element = 0.5
//Called by the drilling rigs each process().
/datum/ore_distribution/proc/get_ore(var/x,var/y)
return "Nope."
/datum/ore_distribution/proc/map_is_sane()
if(!map) return 0
var/rare_count = 0
var/surface_count = 0
var/deep_count = 0
for(var/cell in map)
if(cell>(range*0.60))
deep_count++
else if(cell>(range*0.40))
rare_count++
else
surface_count++
if(surface_count < MIN_SURFACE_COUNT || surface_count > MAX_SURFACE_COUNT) return 0
if(rare_count < MIN_RARE_COUNT || rare_count > MAX_RARE_COUNT) return 0
if(deep_count < MIN_DEEP_COUNT || deep_count > MAX_DEEP_COUNT) return 0
return 1
//Halfassed diamond-square algorithm with some fuckery since it's a single dimension array.
/datum/ore_distribution/proc/populate_distribution_map()
//Seed beginning values.
var/x = 1
var/y = 1
var/size = real_size-1
map[MAP_TOP_LEFT] = (range/3)+rand(range/5)
map[MAP_TOP_RIGHT] = (range/3)+rand(range/5)
map[MAP_BOTTOM_LEFT] = (range/3)+rand(range/5)
map[MAP_BOTTOM_RIGHT] = (range/3)+rand(range/5)
//Fill in and smooth it out.
var/attempts = 0
do
attempts++
generate_distribution_map(1,1,size)
while(attempts < ITERATE_BEFORE_FAIL && !map_is_sane())
if(attempts >= ITERATE_BEFORE_FAIL)
world << "<b><font color='red'>Could not generate a sane distribution map. Aborting.</font></b>"
map = null
return
else
apply_to_asteroid()
/datum/ore_distribution/proc/clear_distribution_map()
for(var/x = 1, x <= real_size, x++)
for(var/y = 1, y <= real_size, y++)
map[MAP_CELL] = 0
/datum/ore_distribution/proc/generate_distribution_map(var/x,var/y,var/input_size)
var/size = input_size
map[MAP_MID_TOP] = (map[MAP_TOP_LEFT] + map[MAP_TOP_RIGHT])/2
map[MAP_MID_RIGHT] = (map[MAP_BOTTOM_RIGHT] + map[MAP_TOP_RIGHT])/2
map[MAP_MID_BOTTOM] = (map[MAP_BOTTOM_LEFT] + map[MAP_BOTTOM_RIGHT])/2
map[MAP_MID_LEFT] = (map[MAP_TOP_LEFT] + map[MAP_BOTTOM_RIGHT])/2
map[MAP_CENTRE] = (map[MAP_MID_LEFT]+map[MAP_MID_RIGHT]+map[MAP_MID_BOTTOM]+map[MAP_MID_TOP])/4
if(prob(random_variance_chance))
map[MAP_CENTRE] *= (rand(1) ? (1.0-random_element) : (1.0+random_element))
map[MAP_CENTRE] = max(0,min(range,map[MAP_CENTRE]))
if(size>3)
generate_distribution_map(x,y,input_size/2)
generate_distribution_map(x+(input_size/2),y,input_size/2)
generate_distribution_map(x,y+(input_size/2),input_size/2)
generate_distribution_map(x+(input_size/2),y+(input_size/2),input_size/2)
/datum/ore_distribution/proc/apply_to_asteroid()
var/origin_x = 13
var/origin_y = 32
var/limit_x = 217
var/limit_y = 223
var/asteroid_z = 5
var/tx = origin_x
var/ty = origin_y
for(var/y = 1, y <= real_size, y++)
for(var/x = 1, x <= real_size, x++)
var/turf/target_turf
for(var/i=0,i<chunk_size,i++)
for(var/j=0,j<chunk_size,j++)
if(tx+j > limit_x || ty+i > limit_y)
continue
target_turf = locate(tx+j, ty+i, asteroid_z)
if(target_turf.has_resources)
var/printcolor
if(map[MAP_CELL] > (range*0.60))
printcolor = "#FF0000"
else if(map[MAP_CELL] > (range*0.40))
printcolor = "#00FF00"
else
printcolor = "#0000FF"
target_turf.color = "#[printcolor]"
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)
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
tx += chunk_size
tx = origin_x
ty += chunk_size
/datum/ore_distribution/proc/print_map()
world << "---"
var/string = ""
for(var/y = 1, y <= real_size, y++)
for(var/x = 1, x <= real_size, x++)
var/printcolor
if(map[MAP_CELL] > (range*0.60))
printcolor = "#FF0000"
else if(map[MAP_CELL] > (range*0.40))
printcolor = "#00FF00"
else
printcolor = "#0000FF"
string += "<font color='[printcolor]'>#</font>"
world << string
string = ""
world << "---"
#undef MAP_CELL
#undef MAP_CENTRE
#undef MAP_TOP_LEFT
#undef MAP_TOP_RIGHT
#undef MAP_BOTTOM_LEFT
#undef MAP_BOTTOM_RIGHT
#undef MAP_MID_TOP
#undef MAP_MID_BOTTOM
#undef MAP_MID_LEFT
#undef MAP_MID_RIGHT
#undef MIN_SURFACE_COUNT
#undef MAX_SURFACE_COUNT
#undef MIN_RARE_COUNT
#undef MAX_RARE_COUNT
#undef MIN_DEEP_COUNT
#undef MAX_DEEP_COUNT
#undef ITERATE_BEFORE_FAIL
#undef RESOURCE_HIGH_MAX
#undef RESOURCE_HIGH_MIN
#undef RESOURCE_MID_MAX
#undef RESOURCE_MID_MIN
#undef RESOURCE_LOW_MAX
#undef RESOURCE_LOW_MIN

View File

@@ -0,0 +1,386 @@
/obj/machinery/mining
icon = 'icons/obj/mining_drill.dmi'
anchored = 0
use_power = 0 //The drill takes power directly from a cell.
density = 1
layer = MOB_LAYER+0.1 //So it draws over mobs in the tile north of it.
/obj/machinery/mining/drill
name = "mining drill head"
desc = "An enormous drill."
icon_state = "mining_drill"
var/braces_needed = 2
var/list/supports = list()
var/supported = 0
var/active = 0
var/list/resource_field = list()
var/open = 0
var/ore_types = list(
"iron" = /obj/item/weapon/ore/iron,
"uranium" = /obj/item/weapon/ore/uranium,
"gold" = /obj/item/weapon/ore/gold,
"silver" = /obj/item/weapon/ore/silver,
"diamond" = /obj/item/weapon/ore/diamond,
"phoron" = /obj/item/weapon/ore/phoron,
"osmium" = /obj/item/weapon/ore/osmium,
"hydrogen" = /obj/item/weapon/ore/hydrogen,
"silicates" = /obj/item/weapon/ore/glass,
"carbonaceous rock" = /obj/item/weapon/ore/coal
)
//Upgrades
var/obj/item/weapon/stock_parts/matter_bin/storage
var/obj/item/weapon/stock_parts/micro_laser/cutter
var/obj/item/weapon/stock_parts/capacitor/cellmount
var/obj/item/weapon/cell/cell
//Flags
var/need_update_field = 0
var/need_player_check = 0
/obj/machinery/mining/drill/New()
..()
storage = new(src)
cutter = new(src)
cellmount = new(src)
cell = new(src)
cell.maxcharge = 10000
cell.charge = cell.maxcharge
/obj/machinery/mining/drill/process()
if(need_player_check)
return
check_supports()
if(!active) return
if(!anchored || !use_cell_power())
system_error("system configuration or charge error")
return
if(need_update_field)
get_resource_field()
if(world.time % 10 == 0)
update_icon()
if(!active)
return
//Drill through the flooring, if any.
if(istype(get_turf(src),/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = get_turf(src)
if(!T.dug)
T.gets_dug()
else if(istype(get_turf(src),/turf/simulated/floor))
var/turf/simulated/floor/T = get_turf(src)
T.ex_act(2.0)
//Dig out the tasty ores.
if(resource_field.len)
var/turf/harvesting = pick(resource_field)
while(resource_field.len && !harvesting.resources)
harvesting.has_resources = 0
harvesting.resources = null
resource_field -= harvesting
harvesting = pick(resource_field)
if(!harvesting) return
var/total_harvest = get_harvest_capacity() //Ore harvest-per-tick.
var/found_resource = 0 //If this doesn't get set, the area is depleted and the drill errors out.
for(var/metal in ore_types)
if(contents.len >= get_storage_capacity())
active = 0
need_player_check = 1
update_icon()
return
if(contents.len + total_harvest >= get_storage_capacity())
total_harvest = get_storage_capacity() - contents.len
if(total_harvest <= 0) break
if(harvesting.resources[metal])
found_resource = 1
var/create_ore = 0
if(harvesting.resources[metal] >= total_harvest)
harvesting.resources[metal] -= total_harvest
create_ore = total_harvest
total_harvest = 0
else
total_harvest -= harvesting.resources[metal]
create_ore = harvesting.resources[metal]
harvesting.resources[metal] = 0
for(var/i=1,i<=create_ore,i++)
var/oretype = ore_types[metal]
new oretype(src)
if(!found_resource)
harvesting.has_resources = 0
harvesting.resources = null
resource_field -= harvesting
else
active = 0
need_player_check = 1
update_icon()
/obj/machinery/mining/drill/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/mining/drill/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
if(active) return
open = !open
user << "\blue You [open ? "open" : "close"] the maintenance panel." //TODO: Sprite.
return
else
if(!open || active) return ..()
if(istype(W,/obj/item/weapon/crowbar))
if(cell)
user << "You pry out \the [cell]."
cell.loc = get_turf(src)
cell = null
else if(storage)
user << "You slip the bolt and pry out \the [storage]."
storage.loc = get_turf(src)
storage = null
else if(cutter)
user << "You carefully detatch and pry out \the [cutter]."
cutter.loc = get_turf(src)
cutter = null
else if(cellmount)
user << "You yank out a few wires and pry out \the [cellmount]."
cellmount.loc = get_turf(src)
cellmount = null
else
user << "There's nothing inside the drilling rig to remove."
return
else if(istype(W,/obj/item/weapon/stock_parts/matter_bin))
if(storage)
user << "The drill already has a matter bin installed."
else
user.drop_item()
W.loc = src
storage = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/stock_parts/micro_laser))
if(cutter)
user << "The drill already has a cutting head installed."
else
user.drop_item()
W.loc = src
cutter = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/stock_parts/capacitor))
if(cellmount)
user << "The drill already has a cell capacitor installed."
else
user.drop_item()
W.loc = src
cellmount = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/cell))
if(cell)
user << "The drill already has a cell installed."
else
user.drop_item()
W.loc = src
cell = W
user << "You install \the [W]."
return
..()
/obj/machinery/mining/drill/attack_hand(mob/user as mob)
check_supports()
if(need_player_check)
user << "You hit the manual override and reset the drill's error checking."
need_player_check = 0
if(anchored) get_resource_field()
update_icon()
return
else if(supported)
if(use_cell_power())
active = !active
if(active)
user << "\blue You engage \the [src] and it lurches downwards, grinding noisily."
need_update_field = 1
else
user << "\blue You disengage \the [src] and it shudders to a grinding halt."
else
user << "\blue The drill is unpowered."
else
user << "\blue Turning on a piece of industrial machinery without sufficient bracing is a bad idea."
update_icon()
/obj/machinery/mining/drill/update_icon()
if(need_player_check)
icon_state = "mining_drill_error"
else if(active)
icon_state = "mining_drill_active"
else if(supported)
icon_state = "mining_drill_braced"
else
icon_state = "mining_drill"
return
/obj/machinery/mining/drill/proc/check_supports()
supported = 0
if((!supports || !supports.len) && initial(anchored) == 0)
icon_state = "mining_drill"
anchored = 0
active = 0
else
anchored = 1
if(supports && supports.len >= braces_needed)
supported = 1
update_icon()
/obj/machinery/mining/drill/proc/system_error(var/error)
if(error) src.visible_message("\red \The [src] flashes a '[error]' warning.")
need_player_check = 1
active = 0
update_icon()
/obj/machinery/mining/drill/proc/get_harvest_capacity()
return 3 * (cutter ? cutter.rating : 0)
/obj/machinery/mining/drill/proc/get_storage_capacity()
return 100 * (storage ? storage.rating : 0)
/obj/machinery/mining/drill/proc/get_charge_use()
return 100 - (20 * (cellmount ? cellmount.rating : 0))
/obj/machinery/mining/drill/proc/get_resource_field()
resource_field = list()
need_update_field = 0
var/turf/T = get_turf(src)
if(!istype(T)) return
var/tx = T.x-2
var/ty = T.y-2
var/turf/mine_turf
for(var/iy=0,iy<5,iy++)
for(var/ix=0,ix<5,ix++)
mine_turf = locate(tx+ix,ty+iy,T.z)
if(mine_turf && istype(mine_turf) && mine_turf.has_resources)
resource_field += mine_turf
if(!resource_field.len)
system_error("resources depleted")
/obj/machinery/mining/drill/proc/use_cell_power()
if(!cell) return 0
var/req = get_charge_use()
if(cell.charge >= req)
cell.use(req)
return 1
return 0
/obj/machinery/mining/drill/verb/unload()
set name = "Unload Drill"
set category = "Object"
set src in oview(1)
if(usr.stat) return
var/obj/structure/ore_box/B = locate() in orange(1)
if(B)
for(var/obj/item/weapon/ore/O in contents)
O.loc = B
usr << "\red You unload the drill's storage cache into the ore box."
else
usr << "\red You must move an ore box up to the drill before you can unload it."
/obj/machinery/mining/brace
name = "mining drill brace"
desc = "A machinery brace for an industrial drill. It looks easily two feet thick."
icon_state = "mining_brace"
var/obj/machinery/mining/drill/connected
/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/wrench))
if(istype(get_turf(src),/turf/space))
user << "\blue You can't anchor something to empty space. Idiot."
return
if(connected && connected.active)
user << "\blue You can't unanchor the brace of a running drill!"
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue You [anchored ? "un" : ""]anchor the brace."
anchored = !anchored
if(anchored)
connect()
else
disconnect()
/obj/machinery/mining/brace/proc/connect()
var/turf/T = get_step(get_turf(src), src.dir)
for(var/thing in T.contents)
if(istype(thing,/obj/machinery/mining/drill))
connected = thing
break
if(!connected) return
if(!connected.supports) connected.supports = list()
icon_state = "mining_brace_active"
connected.supports += src
connected.check_supports()
/obj/machinery/mining/brace/proc/disconnect()
if(!connected) return
if(!connected.supports) connected.supports = list()
icon_state = "mining_brace"
connected.supports -= src
connected.check_supports()
connected = null
/obj/machinery/mining/brace/verb/rotate()
set name = "Rotate"
set category = "Object"
set src in oview(1)
if(usr.stat) return
if (src.anchored)
usr << "It is anchored in place!"
return 0
src.dir = turn(src.dir, 90)
return 1

View File

@@ -1,12 +1,3 @@
#define ORE_PROC_GOLD 1
#define ORE_PROC_SILVER 2
#define ORE_PROC_DIAMOND 4
#define ORE_PROC_GLASS 8
#define ORE_PROC_PHORON 16
#define ORE_PROC_URANIUM 32
#define ORE_PROC_IRON 64
#define ORE_PROC_CLOWN 128
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral/processing_unit_console
@@ -15,175 +6,92 @@
icon_state = "console"
density = 1
anchored = 1
var/obj/machinery/mineral/processing_unit/machine = null
var/machinedir = EAST
var/show_all_ores = 0
/obj/machinery/mineral/processing_unit_console/New()
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
machine.console = src
else
del(src)
/obj/machinery/mineral/processing_unit_console/process()
updateDialog()
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
/obj/machinery/mineral/processing_unit_console/interact(mob/user)
if(..())
return
if(!allowed(user))
user << "\red Access denied."
return
user.set_machine(src)
var/dat = "<b>Smelter control console</b><br><br>"
//iron
if(machine.ore_iron || machine.ore_glass || machine.ore_phoron || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_adamantine)
if(machine.ore_iron)
if (machine.selected & ORE_PROC_IRON)
dat += text("<A href='?src=\ref[src];sel_iron=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_iron=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Iron: [machine.ore_iron]<br>")
var/dat = "<h1>Ore processor console</h1>"
dat += "<hr><table>"
for(var/ore in machine.ores_processing)
if(!machine.ores_stored[ore] && !show_all_ores) continue
dat += "<tr><td width = 40><b>[capitalize(ore)]</b></td><td width = 30>[machine.ores_stored[ore]]</td><td width = 100><font color='"
if(machine.ores_processing[ore])
switch(machine.ores_processing[ore])
if(0)
dat += "red'>not processing"
if(1)
dat += "orange'>smelting"
if(2)
dat += "blue'>compressing"
if(3)
dat += "gray'>alloying"
else
machine.selected &= ~ORE_PROC_IRON
//sand - glass
if(machine.ore_glass)
if (machine.selected & ORE_PROC_GLASS)
dat += text("<A href='?src=\ref[src];sel_glass=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_glass=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Sand: [machine.ore_glass]<br>")
else
machine.selected &= ~ORE_PROC_GLASS
//phoron
if(machine.ore_phoron)
if (machine.selected & ORE_PROC_PHORON)
dat += text("<A href='?src=\ref[src];sel_phoron=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_phoron=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Phoron: [machine.ore_phoron]<br>")
else
machine.selected &= ~ORE_PROC_PHORON
//uranium
if(machine.ore_uranium)
if (machine.selected & ORE_PROC_URANIUM)
dat += text("<A href='?src=\ref[src];sel_uranium=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_uranium=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Uranium: [machine.ore_uranium]<br>")
else
machine.selected &= ~ORE_PROC_URANIUM
//gold
if(machine.ore_gold)
if (machine.selected & ORE_PROC_GOLD)
dat += text("<A href='?src=\ref[src];sel_gold=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_gold=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Gold: [machine.ore_gold]<br>")
else
machine.selected &= ~ORE_PROC_GOLD
//silver
if(machine.ore_silver)
if (machine.selected & ORE_PROC_SILVER)
dat += text("<A href='?src=\ref[src];sel_silver=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_silver=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Silver: [machine.ore_silver]<br>")
else
machine.selected &= ~ORE_PROC_SILVER
//diamond
if(machine.ore_diamond)
if (machine.selected & ORE_PROC_DIAMOND)
dat += text("<A href='?src=\ref[src];sel_diamond=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_diamond=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Diamond: [machine.ore_diamond]<br>")
else
machine.selected &= ~ORE_PROC_DIAMOND
//bananium
if(machine.ore_clown)
if (machine.selected & ORE_PROC_CLOWN)
dat += text("<A href='?src=\ref[src];sel_clown=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_clown=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Bananium: [machine.ore_clown]<br>")
else
machine.selected &= ~ORE_PROC_CLOWN
//On or off
dat += text("Machine is currently ")
if (machine.on==1)
dat += text("<A href='?src=\ref[src];set_on=off'>On</A> ")
else
dat += text("<A href='?src=\ref[src];set_on=on'>Off</A> ")
else
dat+="---No Materials Loaded---"
user << browse("[dat]", "window=console_processing_unit")
onclose(user, "console_processing_unit")
dat += "red'>not processing"
dat += "</font>.</td><td width = 30><a href='?src=\ref[src];toggle_smelting=[ore]'>\[change\]</a></td></tr>"
dat += "</table><hr>"
dat += "Currently displaying [show_all_ores ? "all ore types" : "only available ore types"]. <A href='?src=\ref[src];toggle_ores=1'>\[[show_all_ores ? "show less" : "show more"]\]</a></br>"
dat += "The ore processor is currently <A href='?src=\ref[src];toggle_power=1'>[(machine.active ? "<font color='green'>processing</font>" : "<font color='red'>disabled</font>")]</a>."
user << browse(dat, "window=processor_console;size=400x500")
onclose(user, "computer")
return
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["sel_iron"])
if (href_list["sel_iron"] == "yes")
machine.selected |= ORE_PROC_IRON
else
machine.selected &= ~ORE_PROC_IRON
if(href_list["sel_glass"])
if (href_list["sel_glass"] == "yes")
machine.selected |= ORE_PROC_GLASS
else
machine.selected &= ~ORE_PROC_GLASS
if(href_list["sel_phoron"])
if (href_list["sel_phoron"] == "yes")
machine.selected |= ORE_PROC_PHORON
else
machine.selected &= ~ORE_PROC_PHORON
if(href_list["sel_uranium"])
if (href_list["sel_uranium"] == "yes")
machine.selected |= ORE_PROC_URANIUM
else
machine.selected &= ~ORE_PROC_URANIUM
if(href_list["sel_gold"])
if (href_list["sel_gold"] == "yes")
machine.selected |= ORE_PROC_GOLD
else
machine.selected &= ~ORE_PROC_GOLD
if(href_list["sel_silver"])
if (href_list["sel_silver"] == "yes")
machine.selected |= ORE_PROC_SILVER
else
machine.selected &= ~ORE_PROC_SILVER
if(href_list["sel_diamond"])
if (href_list["sel_diamond"] == "yes")
machine.selected |= ORE_PROC_DIAMOND
else
machine.selected &= ~ORE_PROC_DIAMOND
if(href_list["sel_clown"])
if (href_list["sel_clown"] == "yes")
machine.selected |= ORE_PROC_CLOWN
else
machine.selected &= ~ORE_PROC_CLOWN
if(href_list["set_on"])
if (href_list["set_on"] == "on")
machine.on = 1
else
machine.on = 0
if(href_list["toggle_smelting"])
var/choice = input("What setting do you wish to use for processing [href_list["toggle_smelting"]]?") as null|anything in list("Smelting","Compressing","Alloying","Nothing")
if(!choice) return
switch(choice)
if("Nothing") choice = 0
if("Smelting") choice = 1
if("Compressing") choice = 2
if("Alloying") choice = 3
machine.ores_processing[href_list["toggle_smelting"]] = choice
if(href_list["toggle_power"])
machine.active = !machine.active
if(href_list["toggle_ores"])
show_all_ores = !show_all_ores
src.updateUsrDialog()
return
@@ -191,271 +99,133 @@
/obj/machinery/mineral/processing_unit
name = "furnace"
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron...
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = 1
anchored = 1.0
luminosity = 3 //Big fire with window, yeah it puts out a little light.
anchored = 1
luminosity = 3
var/obj/machinery/mineral/input = null
var/obj/machinery/mineral/output = null
var/obj/machinery/mineral/CONSOLE = null
var/ore_gold = 0;
var/ore_silver = 0;
var/ore_diamond = 0;
var/ore_glass = 0;
var/ore_phoron = 0;
var/ore_uranium = 0;
var/ore_iron = 0;
var/ore_clown = 0;
var/ore_adamantine = 0;
var/selected = 0
/*
var/selected_gold = 0
var/selected_silver = 0
var/selected_diamond = 0
var/selected_glass = 0
var/selected_plasma = 0
var/selected_uranium = 0
var/selected_iron = 0
var/selected_clown = 0
*/
var/on = 0 //0 = off, 1 =... oh you know!
var/obj/machinery/mineral/console = null
var/sheets_per_tick = 10
var/list/ores_processing[0]
var/list/ores_stored[0]
var/list/ore_data[0]
var/list/alloy_data[0]
var/active = 0
/obj/machinery/mineral/processing_unit/New()
..()
spawn( 5 )
//TODO: Ore and alloy global storage datum.
for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
alloy_data += new alloytype()
for(var/oretype in typesof(/datum/ore)-/datum/ore)
var/datum/ore/OD = new oretype()
ore_data[OD.oretag] = OD
ores_processing[OD.oretag] = 0
ores_stored[OD.oretag] = 0
//Locate our output and input machinery.
spawn(5)
for (var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(src.input) break
for (var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(src.output) break
processing_objects.Add(src)
return
return
/obj/machinery/mineral/processing_unit/process()
if (src.output && src.input)
var/i
for (i = 0; i < 10; i++)
if (on)
if (!active || !src.output || !src.input) return
var/list/tick_alloys = list()
if (selected == ORE_PROC_GLASS)
if (ore_glass > 0)
ore_glass--;
new /obj/item/stack/sheet/glass(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_GLASS + ORE_PROC_IRON)
if (ore_glass > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
new /obj/item/stack/sheet/rglass(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_GOLD)
if (ore_gold > 0)
ore_gold--;
new /obj/item/stack/sheet/mineral/gold(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_SILVER)
if (ore_silver > 0)
ore_silver--;
new /obj/item/stack/sheet/mineral/silver(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_DIAMOND)
if (ore_diamond > 0)
ore_diamond--;
new /obj/item/stack/sheet/mineral/diamond(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_PHORON)
if (ore_phoron > 0)
ore_phoron--;
new /obj/item/stack/sheet/mineral/phoron(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_URANIUM)
if (ore_uranium > 0)
ore_uranium--;
new /obj/item/stack/sheet/mineral/uranium(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_IRON)
if (ore_iron > 0)
ore_iron--;
new /obj/item/stack/sheet/metal(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_IRON + ORE_PROC_PHORON)
if (ore_iron > 0 && ore_phoron > 0)
ore_iron--;
ore_phoron--;
new /obj/item/stack/sheet/plasteel(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_CLOWN)
if (ore_clown > 0)
ore_clown--;
new /obj/item/stack/sheet/mineral/clown(output.loc)
else
on = 0
continue
/*
if (selected == ORE_PROC_GLASS + ORE_PROC_PHORON)
if (ore_glass > 0 && ore_plasma > 0)
ore_glass--;
ore_plasma--;
new /obj/item/stack/sheet/glass/plasmaglass(output.loc)
else
on = 0
continue
if (selected == ORE_PROC_GLASS + ORE_PROC_IRON + ORE_PROC_PHORON)
if (ore_glass > 0 && ore_plasma > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
ore_plasma--;
new /obj/item/stack/sheet/glass/plasmarglass(output.loc)
else
on = 0
continue
*/
//Process our stored ores and spit out sheets.
var/sheets = 0
for(var/metal in ores_stored)
if(sheets >= sheets_per_tick) break
if (selected == ORE_PROC_URANIUM + ORE_PROC_DIAMOND)
if (ore_uranium >= 2 && ore_diamond >= 1)
ore_uranium -= 2
ore_diamond -= 1
new /obj/item/stack/sheet/mineral/adamantine(output.loc)
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
var/datum/ore/O = ore_data[metal]
if(!O) continue
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
for(var/datum/alloy/A in alloy_data)
if(A.metaltag in tick_alloys)
continue
tick_alloys += A.metaltag
var/enough_metal
if(!isnull(A.requires[metal]) && ores_stored[metal] >= A.requires[metal]) //We have enough of our first metal, we're off to a good start.
enough_metal = 1
for(var/needs_metal in A.requires)
//Check if we're alloying the needed metal and have it stored.
if(ores_processing[needs_metal] != 3 || ores_stored[needs_metal] < A.requires[needs_metal])
enough_metal = 0
break
if(!enough_metal)
continue
else
on = 0
continue
if (selected == ORE_PROC_SILVER + ORE_PROC_PHORON)
if (ore_silver >= 1 && ore_phoron >= 3)
ore_silver -= 1
ore_phoron -= 3
new /obj/item/stack/sheet/mineral/mythril(output.loc)
else
on = 0
var/total
for(var/needs_metal in A.requires)
ores_stored[needs_metal] -= A.requires[needs_metal]
total += A.requires[needs_metal]
total = max(1,round(total*A.product_mod)) //Always get at least one sheet.
sheets += total-1
for(var/i=0,i<total,i++)
new A.product(output.loc)
else if(ores_processing[metal] == 2 && O.compresses_to) //Compressing.
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
if(can_make%2>0) can_make--
if(!can_make || ores_stored[metal] < 1)
continue
for(var/i=0,i<can_make,i+=2)
ores_stored[metal]-=2
sheets+=2
new O.compresses_to(output.loc)
else if(ores_processing[metal] == 1 && O.smelts_to) //Smelting.
//if a non valid combination is selected
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
if(!can_make || ores_stored[metal] < 1)
continue
var/b = 1 //this part checks if all required ores are available
if (!selected)
b = 0
if (selected & ORE_PROC_GOLD)
if (ore_gold <= 0)
b = 0
if (selected & ORE_PROC_SILVER)
if (ore_silver <= 0)
b = 0
if (selected & ORE_PROC_DIAMOND)
if (ore_diamond <= 0)
b = 0
if (selected & ORE_PROC_URANIUM)
if (ore_uranium <= 0)
b = 0
if (selected & ORE_PROC_PHORON)
if (ore_phoron <= 0)
b = 0
if (selected & ORE_PROC_IRON)
if (ore_iron <= 0)
b = 0
if (selected & ORE_PROC_GLASS)
if (ore_glass <= 0)
b = 0
if (selected & ORE_PROC_CLOWN)
if (ore_clown <= 0)
b = 0
if (b) //if they are, deduct one from each, produce slag and shut the machine off
if (selected & ORE_PROC_GOLD)
ore_gold--
if (selected & ORE_PROC_SILVER)
ore_silver--
if (selected & ORE_PROC_DIAMOND)
ore_diamond--
if (selected & ORE_PROC_URANIUM)
ore_uranium--
if (selected & ORE_PROC_PHORON)
ore_phoron--
if (selected & ORE_PROC_IRON)
ore_iron--
if (selected & ORE_PROC_CLOWN)
ore_clown--
new /obj/item/weapon/ore/slag(output.loc)
on = 0
else
on = 0
break
break
for(var/i=0,i<can_make,i++)
ores_stored[metal]--
sheets++
new O.smelts_to(output.loc)
else
break
for (i = 0; i < 10; i++)
var/obj/item/O
O = locate(/obj/item, input.loc)
if (O)
if (istype(O,/obj/item/weapon/ore/iron))
ore_iron++;
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/glass))
ore_glass++;
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/diamond))
ore_diamond++;
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/phoron))
ore_phoron++
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/gold))
ore_gold++
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/silver))
ore_silver++
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/uranium))
ore_uranium++
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/weapon/ore/clown))
ore_clown++
O.loc = null
//del(O)
continue
O.loc = src.output.loc
else
break
return
ores_stored[metal]--
sheets++
new /obj/item/weapon/ore/slag(output.loc)
else
continue
//Grab some more ore to process next tick.
for(var/i = 0,i<sheets_per_tick,i++)
var/obj/item/weapon/ore/O = locate() in input.loc
if(!O) break
if(!isnull(ores_stored[O.oretag])) ores_stored[O.oretag]++
O.loc = null
console.updateUsrDialog()

View File

@@ -10,17 +10,16 @@
var/machinedir = SOUTHEAST
/obj/machinery/mineral/stacking_unit_console/New()
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
machine.console = src
else
del(src)
/obj/machinery/mineral/stacking_unit_console/process()
updateDialog()
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
add_fingerprint(user)
interact(user)
@@ -30,168 +29,38 @@
var/dat
dat += text("<b>Stacking unit console</b><br><br>")
dat += text("<h1>Stacking unit console</h1><hr><table>")
if(machine.ore_iron)
dat += text("Iron: [machine.ore_iron] <A href='?src=\ref[src];release=iron'>Release</A><br>")
if(machine.ore_plasteel)
dat += text("Plasteel: [machine.ore_plasteel] <A href='?src=\ref[src];release=plasteel'>Release</A><br>")
if(machine.ore_glass)
dat += text("Glass: [machine.ore_glass] <A href='?src=\ref[src];release=glass'>Release</A><br>")
if(machine.ore_rglass)
dat += text("Reinforced Glass: [machine.ore_rglass] <A href='?src=\ref[src];release=rglass'>Release</A><br>")
if(machine.ore_phoron)
dat += text("Phoron: [machine.ore_phoron] <A href='?src=\ref[src];release=phoron'>Release</A><br>")
if(machine.ore_phoronglass)
dat += text("Phoron Glass: [machine.ore_phoronglass] <A href='?src=\ref[src];release=phoronglass'>Release</A><br>")
if(machine.ore_phoronrglass)
dat += text("Reinforced Phoron Glass: [machine.ore_phoronrglass] <A href='?src=\ref[src];release=phoronrglass'>Release</A><br>")
if(machine.ore_gold)
dat += text("Gold: [machine.ore_gold] <A href='?src=\ref[src];release=gold'>Release</A><br>")
if(machine.ore_silver)
dat += text("Silver: [machine.ore_silver] <A href='?src=\ref[src];release=silver'>Release</A><br>")
if(machine.ore_uranium)
dat += text("Uranium: [machine.ore_uranium] <A href='?src=\ref[src];release=uranium'>Release</A><br>")
if(machine.ore_diamond)
dat += text("Diamond: [machine.ore_diamond] <A href='?src=\ref[src];release=diamond'>Release</A><br>")
if(machine.ore_wood)
dat += text("Wood: [machine.ore_wood] <A href='?src=\ref[src];release=wood'>Release</A><br>")
if(machine.ore_cardboard)
dat += text("Cardboard: [machine.ore_cardboard] <A href='?src=\ref[src];release=cardboard'>Release</A><br>")
if(machine.ore_cloth)
dat += text("Cloth: [machine.ore_cloth] <A href='?src=\ref[src];release=cloth'>Release</A><br>")
if(machine.ore_leather)
dat += text("Leather: [machine.ore_leather] <A href='?src=\ref[src];release=leather'>Release</A><br>")
if(machine.ore_clown)
dat += text("Bananium: [machine.ore_clown] <A href='?src=\ref[src];release=clown'>Release</A><br>")
if(machine.ore_adamantine)
dat += text ("Adamantine: [machine.ore_adamantine] <A href='?src=\ref[src];release=adamantine'>Release</A><br>")
if(machine.ore_mythril)
dat += text ("Mythril: [machine.ore_mythril] <A href='?src=\ref[src];release=adamantine'>Release</A><br>")
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
for(var/stacktype in machine.stack_storage)
if(machine.stack_storage[stacktype] > 0)
dat += "<tr><td width = 150><b>[capitalize(stacktype)]:</b></td><td width = 30>[machine.stack_storage[stacktype]]</td><td width = 50><A href='?src=\ref[src];release_stack=[stacktype]'>\[release\]</a></td></tr>"
dat += "</table><hr>"
dat += text("<br>Stacking: [machine.stack_amt] <A href='?src=\ref[src];change_stack=1'>\[change\]</a><br><br>")
user << browse("[dat]", "window=console_stacking_machine")
onclose(user, "console_stacking_machine")
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["release"])
switch(href_list["release"])
if ("phoron")
if (machine.ore_phoron > 0)
var/obj/item/stack/sheet/mineral/phoron/G = new /obj/item/stack/sheet/mineral/phoron
G.amount = machine.ore_phoron
G.loc = machine.output.loc
machine.ore_phoron = 0
if ("phoronglass")
if (machine.ore_phoronglass > 0)
var/obj/item/stack/sheet/glass/phoronglass/G = new /obj/item/stack/sheet/glass/phoronglass
G.amount = machine.ore_phoronglass
G.loc = machine.output.loc
machine.ore_phoronglass = 0
if ("phoronrglass")
if (machine.ore_phoronrglass > 0)
var/obj/item/stack/sheet/glass/phoronrglass/G = new /obj/item/stack/sheet/glass/phoronrglass
G.amount = machine.ore_phoronrglass
G.loc = machine.output.loc
machine.ore_phoronrglass = 0
if ("uranium")
if (machine.ore_uranium > 0)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium
G.amount = machine.ore_uranium
G.loc = machine.output.loc
machine.ore_uranium = 0
if ("glass")
if (machine.ore_glass > 0)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
G.amount = machine.ore_glass
G.loc = machine.output.loc
machine.ore_glass = 0
if ("rglass")
if (machine.ore_rglass > 0)
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
G.amount = machine.ore_rglass
G.loc = machine.output.loc
machine.ore_rglass = 0
if ("gold")
if (machine.ore_gold > 0)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold
G.amount = machine.ore_gold
G.loc = machine.output.loc
machine.ore_gold = 0
if ("silver")
if (machine.ore_silver > 0)
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver
G.amount = machine.ore_silver
G.loc = machine.output.loc
machine.ore_silver = 0
if ("diamond")
if (machine.ore_diamond > 0)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond
G.amount = machine.ore_diamond
G.loc = machine.output.loc
machine.ore_diamond = 0
if ("iron")
if (machine.ore_iron > 0)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
G.amount = machine.ore_iron
G.loc = machine.output.loc
machine.ore_iron = 0
if ("plasteel")
if (machine.ore_plasteel > 0)
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
G.amount = machine.ore_plasteel
G.loc = machine.output.loc
machine.ore_plasteel = 0
if ("wood")
if (machine.ore_wood > 0)
var/obj/item/stack/sheet/wood/G = new /obj/item/stack/sheet/wood
G.amount = machine.ore_wood
G.loc = machine.output.loc
machine.ore_wood = 0
if ("cardboard")
if (machine.ore_cardboard > 0)
var/obj/item/stack/sheet/cardboard/G = new /obj/item/stack/sheet/cardboard
G.amount = machine.ore_cardboard
G.loc = machine.output.loc
machine.ore_cardboard = 0
if ("cloth")
if (machine.ore_cloth > 0)
var/obj/item/stack/sheet/cloth/G = new /obj/item/stack/sheet/cloth
G.amount = machine.ore_cloth
G.loc = machine.output.loc
machine.ore_cloth = 0
if ("leather")
if (machine.ore_leather > 0)
var/obj/item/stack/sheet/leather/G = new /obj/item/stack/sheet/leather
G.amount = machine.ore_diamond
G.loc = machine.output.loc
machine.ore_leather = 0
if ("clown")
if (machine.ore_clown > 0)
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown
G.amount = machine.ore_clown
G.loc = machine.output.loc
machine.ore_clown = 0
if ("adamantine")
if (machine.ore_adamantine > 0)
var/obj/item/stack/sheet/mineral/adamantine/G = new /obj/item/stack/sheet/mineral/adamantine
G.amount = machine.ore_adamantine
G.loc = machine.output.loc
machine.ore_adamantine = 0
if ("mythril")
if (machine.ore_mythril > 0)
var/obj/item/stack/sheet/mineral/mythril/G = new /obj/item/stack/sheet/mineral/mythril
G.amount = machine.ore_mythril
G.loc = machine.output.loc
machine.ore_mythril = 0
src.updateUsrDialog()
return
if(href_list["change_stack"])
var/choice = input("What would you like to set the stack amount to?") as null|anything in list(1,5,10,20,50)
if(!choice) return
machine.stack_amt = choice
if(href_list["release_stack"])
if(machine.stack_storage[href_list["release_stack"]] > 0)
var/stacktype = machine.stack_paths[href_list["release_stack"]]
var/obj/item/stack/sheet/S = new stacktype (get_turf(machine.output))
S.amount = machine.stack_storage[href_list["release_stack"]]
machine.stack_storage[href_list["release_stack"]] = 0
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/**********************Mineral stacking unit**************************/
@@ -202,33 +71,29 @@
icon_state = "stacker"
density = 1
anchored = 1.0
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
var/obj/machinery/mineral/stacking_unit_console/console
var/obj/machinery/mineral/input = null
var/obj/machinery/mineral/output = null
var/ore_gold = 0;
var/ore_silver = 0;
var/ore_diamond = 0;
var/ore_phoron = 0;
var/ore_phoronglass = 0;
var/ore_phoronrglass = 0;
var/ore_iron = 0;
var/ore_uranium = 0;
var/ore_clown = 0;
var/ore_glass = 0;
var/ore_rglass = 0;
var/ore_plasteel = 0;
var/ore_wood = 0
var/ore_cardboard = 0
var/ore_cloth = 0;
var/ore_leather = 0;
var/ore_adamantine = 0;
var/ore_mythril = 0;
var/stack_amt = 50; //ammount to stack before releassing
var/list/stack_storage[0]
var/list/stack_paths[0]
var/stack_amt = 50; // Amount to stack before releassing
/obj/machinery/mineral/stacking_machine/New()
..()
for(var/stacktype in typesof(/obj/item/stack/sheet/mineral)-/obj/item/stack/sheet/mineral)
var/obj/item/stack/S = new stacktype(src)
stack_storage[S.name] = 0
stack_paths[S.name] = stacktype
del(S)
stack_storage["glass"] = 0
stack_paths["glass"] = /obj/item/stack/sheet/glass
stack_storage["metal"] = 0
stack_paths["metal"] = /obj/item/stack/sheet/metal
stack_storage["plasteel"] = 0
stack_paths["plasteel"] = /obj/item/stack/sheet/plasteel
spawn( 5 )
for (var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
@@ -236,220 +101,31 @@
for (var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(src.output) break
processing_objects.Add(src)
return
return
/obj/machinery/mineral/stacking_machine/process()
if (src.output && src.input)
var/obj/item/stack/O
while (locate(/obj/item, input.loc))
O = locate(/obj/item/stack, input.loc)
if(isnull(O))
var/obj/item/I = locate(/obj/item, input.loc)
if (istype(I,/obj/item/weapon/ore/slag))
I.loc = null
var/turf/T = get_turf(input)
for(var/obj/item/O in T.contents)
if(!O) return
if(istype(O,/obj/item/stack))
if(!isnull(stack_storage[O.name]))
stack_storage[O.name]++
O.loc = null
else
I.loc = output.loc
continue
if (istype(O,/obj/item/stack/sheet/metal))
ore_iron+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
ore_diamond+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/phoron))
ore_phoron+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/gold))
ore_gold+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/silver))
ore_silver+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/clown))
ore_clown+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
ore_uranium+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/phoronglass))
ore_phoronglass+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/phoronrglass))
ore_phoronrglass+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass))
ore_glass+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/rglass))
ore_rglass+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/plasteel))
ore_plasteel+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/adamantine))
ore_adamantine+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/mineral/mythril))
ore_mythril+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/cardboard))
ore_cardboard+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/wood))
ore_wood+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/cloth))
ore_cloth+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/leather))
ore_leather+= O.amount
O.loc = null
//del(O)
continue
O.loc = src.output.loc
O.loc = output.loc
else
O.loc = output.loc
if (ore_gold >= stack_amt)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold
G.amount = stack_amt
G.loc = output.loc
ore_gold -= stack_amt
return
if (ore_silver >= stack_amt)
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver
G.amount = stack_amt
G.loc = output.loc
ore_silver -= stack_amt
return
if (ore_diamond >= stack_amt)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond
G.amount = stack_amt
G.loc = output.loc
ore_diamond -= stack_amt
return
if (ore_phoron >= stack_amt)
var/obj/item/stack/sheet/mineral/phoron/G = new /obj/item/stack/sheet/mineral/phoron
G.amount = stack_amt
G.loc = output.loc
ore_phoron -= stack_amt
return
if (ore_iron >= stack_amt)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
G.amount = stack_amt
G.loc = output.loc
ore_iron -= stack_amt
return
if (ore_clown >= stack_amt)
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown
G.amount = stack_amt
G.loc = output.loc
ore_clown -= stack_amt
return
if (ore_uranium >= stack_amt)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium
G.amount = stack_amt
G.loc = output.loc
ore_uranium -= stack_amt
return
if (ore_glass >= stack_amt)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
G.amount = stack_amt
G.loc = output.loc
ore_glass -= stack_amt
return
if (ore_rglass >= stack_amt)
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
G.amount = stack_amt
G.loc = output.loc
ore_rglass -= stack_amt
return
if (ore_phoronglass >= stack_amt)
var/obj/item/stack/sheet/glass/phoronglass/G = new /obj/item/stack/sheet/glass/phoronglass
G.amount = stack_amt
G.loc = output.loc
ore_phoronglass -= stack_amt
return
if (ore_phoronrglass >= stack_amt)
var/obj/item/stack/sheet/glass/phoronrglass/G = new /obj/item/stack/sheet/glass/phoronrglass
G.amount = stack_amt
G.loc = output.loc
ore_phoronrglass -= stack_amt
return
if (ore_plasteel >= stack_amt)
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
G.amount = stack_amt
G.loc = output.loc
ore_plasteel -= stack_amt
return
if (ore_wood >= stack_amt)
var/obj/item/stack/sheet/wood/G = new /obj/item/stack/sheet/wood
G.amount = stack_amt
G.loc = output.loc
ore_wood -= stack_amt
return
if (ore_cardboard >= stack_amt)
var/obj/item/stack/sheet/cardboard/G = new /obj/item/stack/sheet/cardboard
G.amount = stack_amt
G.loc = output.loc
ore_cardboard -= stack_amt
return
if (ore_cloth >= stack_amt)
var/obj/item/stack/sheet/cloth/G = new /obj/item/stack/sheet/cloth
G.amount = stack_amt
G.loc = output.loc
ore_cloth -= stack_amt
return
if (ore_leather >= stack_amt)
var/obj/item/stack/sheet/leather/G = new /obj/item/stack/sheet/leather
G.amount = stack_amt
G.loc = output.loc
ore_leather -= stack_amt
return
if (ore_adamantine >= stack_amt)
var/obj/item/stack/sheet/mineral/adamantine/G = new /obj/item/stack/sheet/mineral/adamantine
G.amount = stack_amt
G.loc = output.loc
ore_adamantine -= stack_amt
return
if (ore_mythril >= stack_amt)
var/obj/item/stack/sheet/mineral/mythril/G = new /obj/item/stack/sheet/mineral/mythril
G.amount = stack_amt
G.loc = output.loc
ore_mythril -= stack_amt
return
//Output amounts that are past stack_amt.
for(var/sheet in stack_storage)
if(stack_storage[sheet] >= stack_amt)
var/stacktype = stack_paths[sheet]
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
S.amount = stack_amt
stack_storage[sheet] -= stack_amt
console.updateUsrDialog()
return

View File

@@ -27,6 +27,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
var/obj/item/weapon/last_find
var/datum/artifact_find/artifact_find
has_resources = 1
New()
. = ..()
@@ -358,7 +359,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
/turf/simulated/mineral/random
name = "Mineral deposit"
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 25)//Currently, Adamantine won't spawn as it has no uses. -Durandan
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 25)
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
New()
@@ -392,6 +393,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
temperature = T0C
icon_plating = "asteroid"
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
has_resources = 1
/turf/simulated/floor/plating/airless/asteroid/New()
var/proper_name = name

View File

@@ -62,11 +62,4 @@ mineral/phoron
name = "Phoron"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/phoron
mineral/clown
display_name = "Bananium"
name = "Clown"
result_amount = 3
spread = 0
ore = /obj/item/weapon/ore/clown
ore = /obj/item/weapon/ore/phoron

View File

@@ -15,9 +15,6 @@
var/amt_iron = 0
var/amt_phoron = 0
var/amt_uranium = 0
var/amt_clown = 0
var/amt_adamantine = 0
var/amt_mythril = 0
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = 0
var/chosen = "metal" //which material will be used to make coins
@@ -61,15 +58,8 @@
if (istype(O,/obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/clown))
amt_clown += 100 * O.amount
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/adamantine))
amt_adamantine += 100 * O.amount
del(O) //Commented out for now. -Durandan
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
/obj/machinery/mineral/mint/attack_hand(user as mob)
var/dat = "<b>Coin Press</b><br>"
@@ -105,22 +95,11 @@
dat += text("chosen")
else
dat += text("<A href='?src=\ref[src];choose=phoron'>Choose</A>")
dat += text("<br><font color='#008800'><b>uranium inserted: </b>[amt_uranium]</font> ")
dat += text("<br><font color='#008800'><b>Uranium inserted: </b>[amt_uranium]</font> ")
if (chosen == "uranium")
dat += text("chosen")
else
dat += text("<A href='?src=\ref[src];choose=uranium'>Choose</A>")
if(amt_clown > 0)
dat += text("<br><font color='#AAAA00'><b>Bananium inserted: </b>[amt_clown]</font> ")
if (chosen == "clown")
dat += text("chosen")
else
dat += text("<A href='?src=\ref[src];choose=clown'>Choose</A>")
dat += text("<br><font color='#888888'><b>Adamantine inserted: </b>[amt_adamantine]</font> ")//I don't even know these color codes, so fuck it.
if (chosen == "adamantine")
dat += text("chosen")
else
dat += text("<A href='?src=\ref[src];choose=adamantine'>Choose</A>")
dat += text("<br><br>Will produce [coinsToProduce] [chosen] coins if enough materials are available.<br>")
//dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
@@ -226,42 +205,6 @@
newCoins++
src.updateUsrDialog()
sleep(5)
if("clown")
while(amt_clown > 0 && coinsToProduce > 0)
if (locate(/obj/item/weapon/moneybag,output.loc))
M = locate(/obj/item/weapon/moneybag,output.loc)
else
M = new/obj/item/weapon/moneybag(output.loc)
new /obj/item/weapon/coin/clown(M)
amt_clown -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5);
if("adamantine")
while(amt_adamantine > 0 && coinsToProduce > 0)
if (locate(/obj/item/weapon/moneybag,output.loc))
M = locate(/obj/item/weapon/moneybag,output.loc)
else
M = new/obj/item/weapon/moneybag(output.loc)
new /obj/item/weapon/coin/adamantine(M)
amt_adamantine -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5);
if("mythril")
while(amt_adamantine > 0 && coinsToProduce > 0)
if (locate(/obj/item/weapon/moneybag,output.loc))
M = locate(/obj/item/weapon/moneybag,output.loc)
else
M = new/obj/item/weapon/moneybag(output.loc)
new /obj/item/weapon/coin/mythril(M)
amt_mythril -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5);
icon_state = "coinpress0"
processing = 0;
coinsToProduce = temp_coins

View File

@@ -16,8 +16,6 @@
var/amt_iron = 0
var/amt_phoron = 0
var/amt_uranium = 0
var/amt_clown = 0
var/amt_adamantine = 0
for (var/obj/item/weapon/coin/C in contents)
if (istype(C,/obj/item/weapon/coin/diamond))
@@ -32,10 +30,6 @@
amt_gold++;
if (istype(C,/obj/item/weapon/coin/uranium))
amt_uranium++;
if (istype(C,/obj/item/weapon/coin/clown))
amt_clown++;
if (istype(C,/obj/item/weapon/coin/adamantine))
amt_adamantine++;
var/dat = text("<b>The contents of the moneybag reveal...</b><br>")
if (amt_gold)
@@ -50,10 +44,6 @@
dat += text("Phoron coins: [amt_phoron] <A href='?src=\ref[src];remove=phoron'>Remove one</A><br>")
if (amt_uranium)
dat += text("Uranium coins: [amt_uranium] <A href='?src=\ref[src];remove=uranium'>Remove one</A><br>")
if (amt_clown)
dat += text("Bananium coins: [amt_clown] <A href='?src=\ref[src];remove=clown'>Remove one</A><br>")
if (amt_adamantine)
dat += text("Adamantine coins: [amt_adamantine] <A href='?src=\ref[src];remove=adamantine'>Remove one</A><br>")
user << browse("[dat]", "window=moneybag")
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -90,10 +80,6 @@
COIN = locate(/obj/item/weapon/coin/phoron,src.contents)
if("uranium")
COIN = locate(/obj/item/weapon/coin/uranium,src.contents)
if("clown")
COIN = locate(/obj/item/weapon/coin/clown,src.contents)
if("adamantine")
COIN = locate(/obj/item/weapon/coin/adamantine,src.contents)
if(!COIN)
return
COIN.loc = src.loc
@@ -110,5 +96,4 @@
new /obj/item/weapon/coin/silver(src)
new /obj/item/weapon/coin/silver(src)
new /obj/item/weapon/coin/gold(src)
new /obj/item/weapon/coin/gold(src)
new /obj/item/weapon/coin/adamantine(src)
new /obj/item/weapon/coin/gold(src)

View File

@@ -0,0 +1,81 @@
/obj/item/weapon/ore
name = "rock"
icon = 'icons/obj/mining.dmi'
icon_state = "ore2"
var/datum/geosample/geologic_data
var/oretag
/obj/item/weapon/ore/uranium
name = "pitchblende"
icon_state = "Uranium ore"
origin_tech = "materials=5"
oretag = "uranium"
/obj/item/weapon/ore/iron
name = "hematite"
icon_state = "Iron ore"
origin_tech = "materials=1"
oretag = "hematite"
/obj/item/weapon/ore/coal
name = "carbonaceous rock"
icon_state = "Iron ore" //TODO
origin_tech = "materials=1"
oretag = "coal"
/obj/item/weapon/ore/glass
name = "impure silicates"
icon_state = "Glass ore"
origin_tech = "materials=1"
oretag = "sand"
/obj/item/weapon/ore/phoron
name = "phoron crystals"
icon_state = "Phoron ore"
origin_tech = "materials=2"
oretag = "phoron"
/obj/item/weapon/ore/silver
name = "native silver ore"
icon_state = "Silver ore"
origin_tech = "materials=3"
oretag = "silver"
/obj/item/weapon/ore/gold
name = "native gold ore"
icon_state = "Gold ore"
origin_tech = "materials=4"
oretag = "gold"
/obj/item/weapon/ore/diamond
name = "diamonds"
icon_state = "Diamond ore"
origin_tech = "materials=6"
oretag = "diamond"
/obj/item/weapon/ore/osmium
name = "raw platinum"
icon_state = "slag" //TODO
oretag = "platinum"
/obj/item/weapon/ore/hydrogen
name = "raw hydrogen"
icon_state = "slag" //TODO
oretag = "hydrogen"
/obj/item/weapon/ore/slag
name = "Slag"
desc = "Completely useless"
icon_state = "slag"
oretag = "slag"
/obj/item/weapon/ore/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/core_sampler))
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
else
return ..()

View File

@@ -0,0 +1,51 @@
/datum/ore
var/oretag
var/alloy
var/smelts_to
var/compresses_to
/datum/ore/uranium
smelts_to = /obj/item/stack/sheet/mineral/uranium
oretag = "uranium"
/datum/ore/iron
smelts_to = /obj/item/stack/sheet/mineral/iron
alloy = 1
oretag = "hematite"
/datum/ore/coal
smelts_to = /obj/item/stack/sheet/mineral/plastic
alloy = 1
oretag = "coal"
/datum/ore/glass
smelts_to = /obj/item/stack/sheet/glass
compresses_to = /obj/item/stack/sheet/mineral/sandstone
oretag = "sand"
/datum/ore/phoron
smelts_to = /obj/item/stack/sheet/mineral/phoron
oretag = "phoron"
/datum/ore/silver
smelts_to = /obj/item/stack/sheet/mineral/silver
oretag = "silver"
/datum/ore/gold
smelts_to = /obj/item/stack/sheet/mineral/gold
oretag = "gold"
/datum/ore/diamond
compresses_to = /obj/item/stack/sheet/mineral/diamond
oretag = "diamond"
/datum/ore/osmium
smelts_to = /obj/item/stack/sheet/mineral/platinum
compresses_to = /obj/item/stack/sheet/mineral/osmium
alloy = 1
oretag = "platinum"
/datum/ore/hydrogen
smelts_to = /obj/item/stack/sheet/mineral/tritium
compresses_to = /obj/item/stack/sheet/mineral/mhydrogen
oretag = "hydrogen"

View File

@@ -73,8 +73,6 @@
dat += text("<br>Diamond ore: [amt_diamond]")
if (amt_strange)
dat += text("<br>Strange rocks: [amt_strange]")
if (amt_clown)
dat += text("<br>Bananium ore: [amt_clown]")
usr << dat
@@ -151,8 +149,4 @@
if (istype(O, /obj/item/weapon/ore/strangerock))
amt_strange++
continue
if (istype(O, /obj/item/weapon/ore/clown))
amt_clown++
continue
return

View File

@@ -338,7 +338,7 @@ display round(lastgen) and phorontank amount
/obj/machinery/power/port_gen/pacman/mrs
name = "M.R.S.P.A.C.M.A.N.-type Portable Generator"
icon_state = "portgen2"
sheet_path = /obj/item/stack/sheet/mineral/diamond
sheet_path = /obj/item/stack/sheet/mineral/tritium
power_gen = 40000
time_per_sheet = 80
board_path = "/obj/item/weapon/circuitboard/pacman/mrs"

View File

@@ -867,7 +867,6 @@
//Sheets
/obj/item/stack/sheet/mineral/phoron = list("phoron" = 20),
/obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
/obj/item/stack/sheet/mineral/clown = list("banana" = 20),
/obj/item/stack/sheet/mineral/silver = list("silver" = 20),
/obj/item/stack/sheet/mineral/gold = list("gold" = 20),
/obj/item/weapon/grown/nettle = list("sacid" = 0),

View File

@@ -16,7 +16,6 @@ The currently supporting non-reagent materials:
- $gold (/obj/item/stack/gold). One sheet = 3750 units.
- $uranium (/obj/item/stack/uranium). One sheet = 3750 units.
- $diamond (/obj/item/stack/diamond). One sheet = 3750 units.
- $clown (/obj/item/stack/clown). One sheet = 3750 units. ("Bananium")
(Insert new ones here)
Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials.

View File

@@ -20,9 +20,6 @@ Note: Must be placed west/left of and R&D console to function.
var/phoron_amount = 0.0
var/uranium_amount = 0.0
var/diamond_amount = 0.0
var/clown_amount = 0.0
var/adamantine_amount = 0.0
/obj/machinery/r_n_d/protolathe/New()
..()
@@ -37,7 +34,7 @@ Note: Must be placed west/left of and R&D console to function.
RefreshParts()
/obj/machinery/r_n_d/protolathe/proc/TotalMaterials() //returns the total of all the stored materials. Makes code neater.
return m_amount + g_amount + gold_amount + silver_amount + phoron_amount + uranium_amount + diamond_amount + clown_amount
return m_amount + g_amount + gold_amount + silver_amount + phoron_amount + uranium_amount + diamond_amount
/obj/machinery/r_n_d/protolathe/RefreshParts()
var/T = 0
@@ -102,12 +99,6 @@ Note: Must be placed west/left of and R&D console to function.
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / G.perunit)
if(clown_amount >= 2000)
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc)
G.amount = round(clown_amount / G.perunit)
if(adamantine_amount >= 2000)
var/obj/item/stack/sheet/mineral/adamantine/G = new /obj/item/stack/sheet/mineral/adamantine(src.loc)
G.amount = round(adamantine_amount / G.perunit)
del(src)
return 1
else
@@ -172,10 +163,6 @@ Note: Must be placed west/left of and R&D console to function.
uranium_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/clown)
clown_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/adamantine)
adamantine_amount += amount * 2000
else
new stacktype(src.loc, amount)
busy = 0

View File

@@ -84,8 +84,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
return_name = "Uranium"
if("diamond")
return_name = "Diamond"
if("clown")
return_name = "Bananium"
else
for(var/R in typesof(/datum/reagent) - /datum/reagent)
temp_reagent = null
@@ -163,7 +161,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else
//The construction/deconstruction of the console code.
..()
src.updateUsrDialog()
return
@@ -361,8 +359,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]))
if("$diamond")
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]))
if("$clown")
linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-being_built.materials[M]))
else
linked_lathe.reagents.remove_reagent(M, being_built.materials[M])
@@ -456,9 +452,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if("diamond")
type = /obj/item/stack/sheet/mineral/diamond
res_amount = "diamond_amount"
if("clown")
type = /obj/item/stack/sheet/mineral/clown
res_amount = "clown_amount"
if(ispath(type) && hasvar(linked_lathe, res_amount))
var/obj/item/stack/sheet/sheet = new type(linked_lathe.loc)
var/available_num_sheets = round(linked_lathe.vars[res_amount]/sheet.perunit)
@@ -723,8 +717,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0
if("$diamond")
if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0
if("$clown")
if(D.materials[M] > linked_lathe.clown_amount) check_materials = 0
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]))
check_materials = 0
if (check_materials)
@@ -785,12 +777,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(linked_lathe.diamond_amount >= 10000) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
if(linked_lathe.diamond_amount >= 2000) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
dat += "<BR>"
//Bananium
dat += "* [linked_lathe.clown_amount] cm<sup>3</sup> of Bananium || "
dat += "Eject: "
if(linked_lathe.clown_amount >= 2000) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
if(linked_lathe.clown_amount >= 10000) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
if(linked_lathe.clown_amount >= 2000) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
if(3.3) //Protolathe Chemical Storage Submenu
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A> || "

View File

@@ -225,7 +225,6 @@
possible_spawns += /obj/item/stack/sheet/glass
possible_spawns += /obj/item/stack/sheet/rglass
possible_spawns += /obj/item/stack/sheet/mineral/phoron
possible_spawns += /obj/item/stack/sheet/mineral/mythril
possible_spawns += /obj/item/stack/sheet/mineral/gold
possible_spawns += /obj/item/stack/sheet/mineral/silver
possible_spawns += /obj/item/stack/sheet/mineral/enruranium