First pass on porting Baymining. Compiles, not playable, do not merge alone.

This commit is contained in:
Zuhayr
2015-01-09 12:42:34 +10:30
parent 530fed426d
commit 2d92b592ca
27 changed files with 2068 additions and 1798 deletions
+25 -145
View File
@@ -10,7 +10,6 @@
locked = 1
var/min = 1
var/max = 10
// var/tampered = 0
/obj/structure/closet/crate/secure/loot/New()
..()
@@ -27,151 +26,31 @@
new/obj/item/weapon/pickaxe/plasmacutter(src)
if(7 to 8)
for(var/i = 0, i < 2, i++)
new/obj/item/weapon/ore/diamond(src)
new/obj/item/weapon/pickaxe/drill(src)
if(9)
new/obj/item/weapon/pickaxe/drill(src)
if(10 to 12)
for(var/i = 0, i < 5, i++)
new/obj/item/seeds/lemonseed(src)
if(13 to 16)
var/seeds = rand(1,15)
switch(seeds)
if(1 to 3)
new/obj/item/seeds/nettleseed(src)
if(4 to 8)
new/obj/item/seeds/berryseed(src)
new/obj/item/seeds/berryseed(src)
new/obj/item/seeds/berryseed(src)
if(9 to 12)
new/obj/item/seeds/appleseed(src)
new/obj/item/seeds/appleseed(src)
new/obj/item/seeds/appleseed(src)
if(13)
new/obj/item/seeds/bluespacetomatoseed(src)
if(14)
new/obj/item/seeds/sugarcaneseed(src)
if(15)
new/obj/item/seeds/plastiseed(src)
if(17)
new/obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
if(18)
new/obj/item/bluespace_crystal(src)
if(prob(10))
new/obj/item/bluespace_crystal(src)
if(19)
new/obj/item/seeds/kudzuseed(src)
if(20)
new/obj/item/weapon/shield/energy(src)
if(21)
new/obj/item/weapon/coin/iron(src)
if(prob(25))
new/obj/item/weapon/coin/silver(src)
if(22)
if(prob(10))
new/obj/item/weapon/coin/adamantine(src)
new/obj/item/weapon/coin/gold(src)
else
new/obj/item/weapon/paper/crumpled(src)
if(23 to 25)
var/nutrient = rand(1,3)
switch(nutrient)
if(1)
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src)
if(2)
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src)
if(3)
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src)
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src)
if(26 to 30)
for(var/i = 0, i < 5, i++)
new/obj/item/stack/sheet/metal(src)
if(31 to 35)
for(var/i = 0, i < 5, i++)
new/obj/item/stack/sheet/glass(src)
if(36 to 37)
new/obj/item/stack/sheet/glass/plasmaglass(src)
new/obj/item/stack/sheet/glass/plasmaglass(src)
if(38 to 39)
new/obj/item/stack/sheet/plasteel(src)
new/obj/item/stack/sheet/plasteel(src)
if(40 to 45)
new/obj/item/stack/rods(src)
new/obj/item/stack/rods(src)
new/obj/item/stack/rods(src)
new/obj/item/weapon/shard(src)
new/obj/item/weapon/shard(src)
new/obj/item/weapon/shard(src)
if(46)
new/obj/item/weapon/storage/belt/champion(src)
if(47)
new/obj/item/weapon/rcd_ammo(src)
new/obj/item/weapon/rcd_ammo(src)
new/obj/item/weapon/rcd_ammo(src)
if(prob(10))
new/obj/item/weapon/rcd(src)
if(48)
var/pills = rand(1,15)
switch(pills)
if(1 to 4)
new/obj/item/weapon/storage/pill_bottle/antitox(src)
if(5 to 8)
new/obj/item/weapon/storage/pill_bottle/inaprovaline(src)
if(9 to 12)
new/obj/item/weapon/storage/pill_bottle/kelotane(src)
if(13)
new/obj/item/weapon/storage/pill_bottle/dice(src)
if(14)
new/obj/item/weapon/storage/pill_bottle/happy(src)
if(15)
new/obj/item/weapon/storage/pill_bottle/zoom(src)
if(49 to 52)
var/cash = rand(1,7)
switch(cash)
if(1 to 3)
new/obj/item/weapon/spacecash/c10(src)
new/obj/item/weapon/spacecash/c1(src)
new/obj/item/weapon/spacecash/c1(src)
new/obj/item/weapon/spacecash/c1(src)
if(4 to 6)
new/obj/item/weapon/spacecash/c20(src)
if(7)
new/obj/item/weapon/spacecash/c50(src)
if(53)
if(prob(15))
new/obj/item/weapon/spacecash/c500(src)
else
new/obj/item/weapon/spacecash/c1(src)
if(54 to 60)
if(prob(50))
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/slag(src)
new/obj/item/weapon/ore/slag(src)
else
new/obj/item/weapon/ore/gold(src)
new/obj/item/weapon/shard(src)
if(61 to 62)
new/obj/item/weapon/paper/crumpled/bloody(src)
var/gibs = rand(1,4)
switch(gibs)
if(1)
new/obj/item/weapon/organ/r_leg(src)
new/obj/item/weapon/organ/l_arm(src)
if(2)
new/obj/item/weapon/organ/head(src)
new/obj/item/weapon/organ/l_hand(src)
if(3)
new/obj/item/weapon/organ/r_foot(src)
new/obj/item/weapon/organ/r_arm(src)
if(4)
new/obj/item/weapon/organ/l_leg(src)
new/obj/item/weapon/organ/head(src)
for(var/i = 0, i < 3, i++)
new/obj/machinery/portable_atmospherics/hydroponics(src)
if(10)
for(var/i = 0, i < 3, i++)
new/obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
if(11 to 13)
new/obj/item/weapon/melee/classic_baton(src)
if(14)
return
if(15)
new/obj/item/clothing/under/chameleon(src)
for(var/i = 0, i < 7, i++)
new/obj/item/clothing/tie/horrible(src)
if(16)
new/obj/item/clothing/under/shorts(src)
new/obj/item/clothing/under/shorts/red(src)
new/obj/item/clothing/under/shorts/blue(src)
//Dummy crates start here.
if(17 to 29)
return
//Dummy crates end here.
if(30)
new/obj/item/weapon/melee/baton(src)
//Code modified to make things less boomy, and offer more chances with more difficulty.
/obj/structure/closet/crate/secure/loot/togglelock(mob/user as mob)
@@ -202,6 +81,7 @@
// tampered = 1
if (attempts < 0)
user << "<span class='notice'>The crate's anti-tamper system is activated, and the crate is locked down.</span>"
else
user << "<span class='notice'>You attempt to interact with the device using a hand gesture, but it appears this crate is from before the DECANECT came out.</span>"
return
+27
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
+92
View File
@@ -0,0 +1,92 @@
/*****************************Coin********************************/
/obj/item/weapon/coin
icon = 'icons/obj/items.dmi'
name = "Coin"
icon_state = "coin"
flags = FPRINT | TABLEPASS| CONDUCT
force = 0.0
throwforce = 0.0
w_class = 1.0
var/string_attached
var/sides = 2
/obj/item/weapon/coin/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/coin/gold
name = "gold coin"
icon_state = "coin_gold"
/obj/item/weapon/coin/silver
name = "silver coin"
icon_state = "coin_silver"
/obj/item/weapon/coin/diamond
name = "diamond coin"
icon_state = "coin_diamond"
/obj/item/weapon/coin/iron
name = "iron coin"
icon_state = "coin_iron"
/obj/item/weapon/coin/plasma
name = "solid plasma coin"
icon_state = "coin_plasma"
/obj/item/weapon/coin/uranium
name = "uranium coin"
icon_state = "coin_uranium"
/obj/item/weapon/coin/platinum
name = "platinum coin"
icon_state = "coin_adamantine"
/obj/item/weapon/coin/clown
name = "bananaium coin"
icon_state = "coin_clown"
/obj/item/weapon/coin/adamantine
name = "adamantine 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
if(string_attached)
user << "<span class='notice'>There already is a string attached to this coin.</span>"
return
if (CC.use(1))
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
string_attached = 1
user << "<span class='notice'>You attach a string to the coin.</span>"
else
user << "<span class='notice'>This cable coil appears to be empty.</span>"
return
else if(istype(W,/obj/item/weapon/wirecutters))
if(!string_attached)
..()
return
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(user.loc)
CC.amount = 1
CC.update_icon()
overlays = list()
string_attached = null
user << "\blue You detach the string from the coin."
else ..()
/obj/item/weapon/coin/attack_self(mob/user as mob)
var/result = rand(1, sides)
var/comment = ""
if(result == 1)
comment = "tails"
else if(result == 2)
comment = "heads"
user.visible_message("<span class='notice'>[user] has thrown \the [src]. It lands on [comment]! </span>", \
"<span class='notice'>You throw \the [src]. It lands on [comment]! </span>")
@@ -0,0 +1,233 @@
//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 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
/*
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
/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/print_distribution_map(var/mob/usr)
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))
if(usr)
usr << line
else
world << line
line = ""
/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()
// THESE VALUES DETERMINE THE AREA THAT THE DISTRIBUTION MAP IS APPLIED TO.
// IF YOU DO NOT RUN OFFICIAL BAYCODE ASTEROID MAP YOU NEED TO CHANGE THEM.
// ORIGIN IS THE BOTTOM LEFT CORNER OF THE SQUARE CONTAINING ALL ASTEROID
// TILES YOU WISH TO APPLY THE DISTRIBUTION MAP TO.
var/origin_x = 13 //We start here...
var/origin_y = 32 //...and here...
var/limit_x = 217 //...and iterate until here...
var/limit_y = 223 //...and here...
var/asteroid_z = 5 //...on this Z-level.
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 && target_turf.has_resources)
target_turf.resources = list()
target_turf.resources["silicates"] = rand(3,5)
target_turf.resources["carbonaceous rock"] = rand(3,5)
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
ty += chunk_size
world << "<b><font color='red'>Resource map generation complete.</font></b>"
return
#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
+392
View File
@@ -0,0 +1,392 @@
/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,
"plasma" = /obj/item/weapon/ore/plasma,
"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())
system_error("insufficient storage space")
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 (cutter ? cutter.rating : 0)
/obj/machinery/mining/drill/proc/get_storage_capacity()
return 200 * (storage ? storage.rating : 0)
/obj/machinery/mining/drill/proc/get_charge_use()
return 50 - (10 * (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)
if(!T.has_resources)
src.visible_message("\red The terrain near the brace is unsuitable!")
return
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
+54
View File
@@ -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("plasma" || "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]."
+162 -389
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_PLASMA 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_plasma || 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
//plasma
if(machine.ore_plasma)
if (machine.selected & ORE_PROC_PLASMA)
dat += text("<A href='?src=\ref[src];sel_plasma=no'><font color='green'>Smelting</font></A> ")
else
dat += text("<A href='?src=\ref[src];sel_plasma=yes'><font color='red'>Not smelting</font></A> ")
dat += text("Plasma: [machine.ore_plasma]<br>")
else
machine.selected &= ~ORE_PROC_PLASMA
//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, "processor_console")
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_plasma"])
if (href_list["sel_plasma"] == "yes")
machine.selected |= ORE_PROC_PLASMA
else
machine.selected &= ~ORE_PROC_PLASMA
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,136 @@
/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_plasma = 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 (!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_PLASMA)
if (ore_plasma > 0)
ore_plasma--;
new /obj/item/stack/sheet/mineral/plasma(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_PLASMA)
if (ore_iron > 0 && ore_plasma > 0)
ore_iron--;
ore_plasma--;
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_PLASMA)
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_PLASMA)
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
*/
//Grab some more ore to process this 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
if(!active)
return
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)
//Process our stored ores and spit out sheets.
var/sheets = 0
for(var/metal in ores_stored)
if(sheets >= sheets_per_tick) break
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_PLASMA)
if (ore_silver >= 1 && ore_plasma >= 3)
ore_silver -= 1
ore_plasma -= 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_PLASMA)
if (ore_plasma <= 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_PLASMA)
ore_plasma--
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/plasma))
ore_plasma++
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
console.updateUsrDialog()
+64 -388
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_plasma)
dat += text("Plasma: [machine.ore_plasma] <A href='?src=\ref[src];release=plasma'>Release</A><br>")
if(machine.ore_plasmaglass)
dat += text("Plasma Glass: [machine.ore_plasmaglass] <A href='?src=\ref[src];release=plasmaglass'>Release</A><br>")
if(machine.ore_plasmarglass)
dat += text("Reinforced Plasma Glass: [machine.ore_plasmarglass] <A href='?src=\ref[src];release=plasmarglass'>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 ("plasma")
if (machine.ore_plasma > 0)
var/obj/item/stack/sheet/mineral/plasma/G = new /obj/item/stack/sheet/mineral/plasma
G.amount = machine.ore_plasma
G.loc = machine.output.loc
machine.ore_plasma = 0
if ("plasmaglass")
if (machine.ore_plasmaglass > 0)
var/obj/item/stack/sheet/glass/plasmaglass/G = new /obj/item/stack/sheet/glass/plasmaglass
G.amount = machine.ore_plasmaglass
G.loc = machine.output.loc
machine.ore_plasmaglass = 0
if ("plasmarglass")
if (machine.ore_plasmarglass > 0)
var/obj/item/stack/sheet/glass/plasmarglass/G = new /obj/item/stack/sheet/glass/plasmarglass
G.amount = machine.ore_plasmarglass
G.loc = machine.output.loc
machine.ore_plasmarglass = 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_plasma = 0;
var/ore_plasmaglass = 0;
var/ore_plasmarglass = 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/plasma))
ore_plasma+= 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/plasmaglass))
ore_plasmaglass+= O.amount
O.loc = null
//del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/plasmarglass))
ore_plasmarglass+= 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_plasma >= stack_amt)
var/obj/item/stack/sheet/mineral/plasma/G = new /obj/item/stack/sheet/mineral/plasma
G.amount = stack_amt
G.loc = output.loc
ore_plasma -= 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_plasmaglass >= stack_amt)
var/obj/item/stack/sheet/glass/plasmaglass/G = new /obj/item/stack/sheet/glass/plasmaglass
G.amount = stack_amt
G.loc = output.loc
ore_plasmaglass -= stack_amt
return
if (ore_plasmarglass >= stack_amt)
var/obj/item/stack/sheet/glass/plasmarglass/G = new /obj/item/stack/sheet/glass/plasmarglass
G.amount = stack_amt
G.loc = output.loc
ore_plasmarglass -= 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
+2
View File
@@ -7,10 +7,12 @@
/area/mine/explored
name = "Mine"
icon_state = "explored"
ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
/area/mine/unexplored
name = "Mine"
icon_state = "unexplored"
ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
/area/mine/lobby
name = "Mining station"
+135 -192
View File
@@ -38,132 +38,6 @@
new /obj/item/clothing/glasses/meson(src)
/**********************Shuttle Computer**************************/
var/mining_shuttle_tickstomove = 10
var/mining_shuttle_moving = 0
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
proc/move_mining_shuttle()
if(mining_shuttle_moving) return
mining_shuttle_moving = 1
spawn(mining_shuttle_tickstomove*10)
var/area/fromArea
var/area/toArea
if (mining_shuttle_location == 1)
fromArea = locate(/area/shuttle/mining/outpost)
toArea = locate(/area/shuttle/mining/station)
else
fromArea = locate(/area/shuttle/mining/station)
toArea = locate(/area/shuttle/mining/outpost)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in toArea)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
// NOTE: Commenting this out to avoid recreating mass driver glitch
/*
spawn(0)
AM.throw_at(E, 1, 1)
return
*/
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
pest.gib()
fromArea.move_contents_to(toArea)
if (mining_shuttle_location)
mining_shuttle_location = 0
else
mining_shuttle_location = 1
for(var/mob/M in toArea)
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 3, 1) // buckled, not a lot of shaking
else
shake_camera(M, 10, 1) // unbuckled, HOLY SHIT SHAKE THE ROOM
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)
mining_shuttle_moving = 0
return
/obj/machinery/computer/mining_shuttle
name = "mining shuttle console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
req_access = list(access_mining)
circuit = "/obj/item/weapon/circuitboard/mining_shuttle"
var/hacked = 0
var/location = 0 //0 = station, 1 = mining base
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
if(..(user))
return
src.add_fingerprint(usr)
var/dat
dat = "<center>Mining Shuttle Control<hr>"
if(mining_shuttle_moving)
dat += "Location: <font color='red'>Moving</font> <br>"
else
dat += "Location: [mining_shuttle_location ? "Outpost" : "Station"] <br>"
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
user << browse("[dat]", "window=miningshuttle;size=200x150")
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["move"])
//if(ticker.mode.name == "blob")
// if(ticker.mode:declared)
// usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
// return
if (!mining_shuttle_moving)
usr << "\blue Shuttle recieved message and will be sent shortly."
move_mining_shuttle()
else
usr << "\blue Shuttle is already moving."
updateUsrDialog()
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/card/emag))
src.req_access = list()
hacked = 1
usr << "You fried the consoles ID checking system. It's now available to everyone!"
else
..()
/******************************Lantern*******************************/
/obj/item/device/flashlight/lantern
@@ -195,80 +69,80 @@ proc/move_mining_shuttle()
var/excavation_amount = 100
hammer
name = "sledgehammer"
//icon_state = "sledgehammer" Waiting on sprite
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
/obj/item/weapon/pickaxe/hammer
name = "sledgehammer"
//icon_state = "sledgehammer" Waiting on sprite
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
silver
name = "silver pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
digspeed = 30
origin_tech = "materials=3"
desc = "This makes no metallurgic sense."
/obj/item/weapon/pickaxe/silver
name = "silver pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
digspeed = 30
origin_tech = "materials=3"
desc = "This makes no metallurgic sense."
drill
name = "mining drill" // Can dig sand as well!
icon_state = "handdrill"
item_state = "jackhammer"
digspeed = 30
origin_tech = "materials=2;powerstorage=3;engineering=2"
desc = "Yours is the drill that will pierce through the rock walls."
drill_verb = "drilling"
/obj/item/weapon/pickaxe/drill
name = "mining drill" // Can dig sand as well!
icon_state = "handdrill"
item_state = "jackhammer"
digspeed = 30
origin_tech = "materials=2;powerstorage=3;engineering=2"
desc = "Yours is the drill that will pierce through the rock walls."
drill_verb = "drilling"
jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 20 //faster than drill, but cannot dig
origin_tech = "materials=3;powerstorage=2;engineering=2"
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
drill_verb = "hammering"
/obj/item/weapon/pickaxe/jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 20 //faster than drill, but cannot dig
origin_tech = "materials=3;powerstorage=2;engineering=2"
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
drill_verb = "hammering"
gold
name = "golden pickaxe"
icon_state = "gpickaxe"
item_state = "gpickaxe"
digspeed = 20
origin_tech = "materials=4"
desc = "This makes no metallurgic sense."
/obj/item/weapon/pickaxe/gold
name = "golden pickaxe"
icon_state = "gpickaxe"
item_state = "gpickaxe"
digspeed = 20
origin_tech = "materials=4"
desc = "This makes no metallurgic sense."
plasmacutter
name = "plasma cutter"
icon_state = "plasmacutter"
item_state = "gun"
w_class = 3.0 //it is smaller than the pickaxe
damtype = "fire"
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
origin_tech = "materials=4;plasmatech=3;engineering=3"
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
drill_verb = "cutting"
/obj/item/weapon/pickaxe/plasmacutter
name = "plasma cutter"
icon_state = "plasmacutter"
item_state = "gun"
w_class = 3.0 //it is smaller than the pickaxe
damtype = "fire"
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
origin_tech = "materials=4;phorontech=3;engineering=3"
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
drill_verb = "cutting"
diamond
name = "diamond pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
digspeed = 10
origin_tech = "materials=6;engineering=4"
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
/obj/item/weapon/pickaxe/diamond
name = "diamond pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
digspeed = 10
origin_tech = "materials=6;engineering=4"
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
name = "diamond mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 5 //Digs through walls, girders, and can dig up sand
origin_tech = "materials=6;powerstorage=4;engineering=5"
desc = "Yours is the drill that will pierce the heavens!"
drill_verb = "drilling"
/obj/item/weapon/pickaxe/diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
name = "diamond mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 5 //Digs through walls, girders, and can dig up sand
origin_tech = "materials=6;powerstorage=4;engineering=5"
desc = "Yours is the drill that will pierce the heavens!"
drill_verb = "drilling"
borgdrill
name = "cyborg mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 15
desc = ""
drill_verb = "drilling"
/obj/item/weapon/pickaxe/borgdrill
name = "cyborg mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 15
desc = ""
drill_verb = "drilling"
/*****************************Shovel********************************/
@@ -286,6 +160,8 @@ proc/move_mining_shuttle()
matter = list("metal" = 50)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
sharp = 0
edge = 1
/obj/item/weapon/shovel/spade
name = "spade"
@@ -308,3 +184,70 @@ proc/move_mining_shuttle()
icon_opened = "miningcaropen"
icon_closed = "miningcar"
// Flags.
/obj/item/stack/flag
name = "flags"
desc = "Some colourful flags."
singular_name = "flag"
amount = 10
max_amount = 10
icon = 'icons/obj/mining.dmi'
var/upright = 0
var/base_state
/obj/item/stack/flag/New()
..()
base_state = icon_state
/obj/item/stack/flag/red
name = "red flags"
singular_name = "red flag"
icon_state = "redflag"
/obj/item/stack/flag/yellow
name = "yellow flags"
singular_name = "yellow flag"
icon_state = "yellowflag"
/obj/item/stack/flag/green
name = "green flags"
singular_name = "green flag"
icon_state = "greenflag"
/obj/item/stack/flag/attackby(obj/item/W as obj, mob/user as mob)
if(upright && istype(W,src.type))
src.attack_hand(user)
else
..()
/obj/item/stack/flag/attack_hand(user as mob)
if(upright)
upright = 0
icon_state = base_state
anchored = 0
src.visible_message("<b>[user]</b> knocks down [src].")
else
..()
/obj/item/stack/flag/attack_self(mob/user as mob)
var/obj/item/stack/flag/F = locate() in get_turf(src)
var/turf/T = get_turf(src)
if(!T || !istype(T,/turf/simulated/floor/plating/airless/asteroid))
user << "The flag won't stand up in this terrain."
return
if(F && F.upright)
user << "There is already a flag here."
return
var/obj/item/stack/flag/newflag = new src.type(T)
newflag.amount = 1
newflag.upright = 1
anchored = 1
newflag.name = newflag.singular_name
newflag.icon_state = "[newflag.base_state]_open"
newflag.visible_message("<b>[user]</b> plants [newflag] firmly in the ground.")
src.use(1)
+347 -387
View File
@@ -1,9 +1,9 @@
/**********************Mineral deposits**************************/
datum/controller/game_controller/var/list/artifact_spawning_turfs = list()
var/list/artifact_spawn = list() // Runtime fix for geometry loading before controller is instantiated.
/**********************Mineral deposits**************************/
/turf/simulated/mineral //wall piece
name = "Rock"
icon = 'icons/turf/walls.dmi'
@@ -17,6 +17,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
var/mineral/mineral
var/mined_ore = 0
var/last_act = 0
var/emitter_blasts_taken = 0 // EMITTER MINING! Muhehe.
var/datum/geosample/geologic_data
var/excavation_level = 0
@@ -27,364 +28,369 @@ 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()
. = ..()
/turf/simulated/mineral/New()
MineralSpread()
MineralSpread()
spawn(1)
var/turf/T
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)) || (istype(get_step(src, NORTH), /turf/simulated/shuttle/floor)))
T = get_step(src, NORTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_s")
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)) || (istype(get_step(src, SOUTH), /turf/simulated/shuttle/floor)))
T = get_step(src, SOUTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_n", layer=6)
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)) || (istype(get_step(src, EAST), /turf/simulated/shuttle/floor)))
T = get_step(src, EAST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=6)
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)) || (istype(get_step(src, WEST), /turf/simulated/shuttle/floor)))
T = get_step(src, WEST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
spawn(2)
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
for(var/direction in step_overlays)
var/turf/turf_to_check = get_step(src,step_overlays[direction])
if(istype(turf_to_check,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = turf_to_check
T.updateMineralOverlays()
ex_act(severity)
switch(severity)
if(2.0)
if (prob(70))
mined_ore = 1 //some of the stuff gets blown up
GetDrilled()
if(1.0)
mined_ore = 2 //some of the stuff gets blown up
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
/turf/simulated/mineral/ex_act(severity)
switch(severity)
if(2.0)
if (prob(70))
mined_ore = 1 //some of the stuff gets blown up
GetDrilled()
if(1.0)
mined_ore = 2 //some of the stuff gets blown up
GetDrilled()
/turf/simulated/mineral/bullet_act(var/obj/item/projectile/Proj)
// Emitter blasts
if(istype(Proj, /obj/item/projectile/beam/emitter))
emitter_blasts_taken++
if(emitter_blasts_taken > 2) // 3 blasts per tile
mined_ore = 1
GetDrilled()
/turf/simulated/mineral/Bumped(AM)
. = ..()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
attackby(H.l_hand,H)
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
attackby(H.r_hand,H)
else if(istype(AM,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = AM
if(istype(R.module_active,/obj/item/weapon/pickaxe))
attackby(R.module_active,R)
else if(istype(AM,/obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
M.selected.action(src)
/turf/simulated/mineral/proc/MineralSpread()
if(mineral && mineral.spread)
for(var/trydir in cardinal)
if(prob(mineral.spread_chance))
var/turf/simulated/mineral/random/target_turf = get_step(src, trydir)
if(istype(target_turf) && !target_turf.mineral)
target_turf.mineral = mineral
target_turf.UpdateMineral()
target_turf.MineralSpread()
Bumped(AM)
. = ..()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
attackby(H.l_hand,H)
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
attackby(H.r_hand,H)
/turf/simulated/mineral/proc/UpdateMineral()
if(!mineral)
name = "\improper Rock"
icon_state = "rock"
return
name = "\improper [mineral.display_name] deposit"
overlays.Cut()
overlays += "rock_[mineral.name]"
else if(istype(AM,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = AM
if(istype(R.module_active,/obj/item/weapon/pickaxe))
attackby(R.module_active,R)
//Not even going to touch this pile of spaghetti
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
else if(istype(AM,/obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
M.selected.action(src)
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
usr << "\red You don't have the dexterity to do this!"
return
if (istype(W, /obj/item/device/core_sampler))
geologic_data.UpdateNearbyArtifactInfo(src)
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
return
proc/MineralSpread()
if(mineral && mineral.spread)
for(var/trydir in cardinal)
if(prob(mineral.spread_chance))
var/turf/simulated/mineral/random/target_turf = get_step(src, trydir)
if(istype(target_turf) && !target_turf.mineral)
target_turf.mineral = mineral
target_turf.UpdateMineral()
target_turf.MineralSpread()
if (istype(W, /obj/item/device/depth_scanner))
var/obj/item/device/depth_scanner/C = W
C.scan_atom(user, src)
return
if (istype(W, /obj/item/device/measuring_tape))
var/obj/item/device/measuring_tape/P = W
user.visible_message("\blue[user] extends [P] towards [src].","\blue You extend [P] towards [src].")
if(do_after(user,25))
user << "\blue \icon[P] [src] has been excavated to a depth of [2*excavation_level]cm."
return
proc/UpdateMineral()
if(!mineral)
name = "\improper Rock"
icon_state = "rock"
return
name = "\improper [mineral.display_name] deposit"
icon_state = "rock_[mineral.name]"
//Not even going to touch this pile of spaghetti
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
usr << "\red You don't have the dexterity to do this!"
if (istype(W, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
if (istype(W, /obj/item/device/core_sampler))
geologic_data.UpdateNearbyArtifactInfo(src)
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
var/obj/item/weapon/pickaxe/P = W
if(last_act + P.digspeed > world.time)//prevents message spam
return
last_act = world.time
if (istype(W, /obj/item/device/depth_scanner))
var/obj/item/device/depth_scanner/C = W
C.scan_atom(user, src)
return
playsound(user, P.drill_sound, 20, 1)
if (istype(W, /obj/item/device/measuring_tape))
var/obj/item/device/measuring_tape/P = W
user.visible_message("\blue[user] extends [P] towards [src].","\blue You extend [P] towards [src].")
if(do_after(user,25))
user << "\blue \icon[P] [src] has been excavated to a depth of [2*excavation_level]cm."
return
//handle any archaeological finds we might uncover
var/fail_message
if(finds && finds.len)
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
fail_message = ". <b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
if (istype(W, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
var/obj/item/weapon/pickaxe/P = W
if(last_act + P.digspeed > world.time)//prevents message spam
return
last_act = world.time
if(fail_message && prob(90))
if(prob(25))
excavate_find(5, finds[1])
else if(prob(50))
finds.Remove(finds[1])
if(prob(50))
artifact_debris()
playsound(user, P.drill_sound, 20, 1)
if(do_after(user,P.digspeed))
user << "\blue You finish [P.drill_verb] the rock."
//handle any archaeological finds we might uncover
var/fail_message
if(finds && finds.len)
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
fail_message = ", <b>[pick("there is a crunching noise","[W] collides with some different rock","part of the rock face crumbles away","something breaks under [W]")]</b>"
user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
if(fail_message && prob(90))
if(prob(25))
excavate_find(5, finds[1])
else if(prob(50))
finds.Remove(finds[1])
if(prob(50))
artifact_debris()
if(do_after(user,P.digspeed))
user << "\blue You finish [P.drill_verb] the rock."
if(finds && finds.len)
var/datum/find/F = finds[1]
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
if(excavation_level + P.excavation_amount > F.excavation_required)
//if you can get slightly over, perfect extraction
excavate_find(100, F)
else
excavate_find(80, F)
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
//just pull the surrounding rock out
excavate_find(0, F)
if( excavation_level + P.excavation_amount >= 100 )
//if players have been excavating this turf, leave some rocky debris behind
var/obj/structure/boulder/B
if(artifact_find)
if( excavation_level > 0 || prob(15) )
//boulder with an artifact inside
B = new(src)
if(artifact_find)
B.artifact_find = artifact_find
else
artifact_debris(1)
else if(prob(15))
//empty boulder
B = new(src)
if(B)
GetDrilled(0)
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
if(excavation_level + P.excavation_amount > F.excavation_required)
//if you can get slightly over, perfect extraction
excavate_find(100, F)
else
GetDrilled(1)
return
excavate_find(80, F)
excavation_level += P.excavation_amount
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
//just pull the surrounding rock out
excavate_find(0, F)
//archaeo overlays
if(!archaeo_overlay && finds && finds.len)
var/datum/find/F = finds[1]
if(F.excavation_required <= excavation_level + F.view_range)
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
overlays += archaeo_overlay
if( excavation_level + P.excavation_amount >= 100 )
//if players have been excavating this turf, leave some rocky debris behind
var/obj/structure/boulder/B
if(artifact_find)
if( excavation_level > 0 || prob(15) )
//boulder with an artifact inside
B = new(src)
if(artifact_find)
B.artifact_find = artifact_find
else
artifact_debris(1)
else if(prob(15))
//empty boulder
B = new(src)
//there's got to be a better way to do this
var/update_excav_overlay = 0
if(excavation_level >= 75)
if(excavation_level - P.excavation_amount < 75)
update_excav_overlay = 1
else if(excavation_level >= 50)
if(excavation_level - P.excavation_amount < 50)
update_excav_overlay = 1
else if(excavation_level >= 25)
if(excavation_level - P.excavation_amount < 25)
update_excav_overlay = 1
//update overlays displaying excavation level
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
var/excav_quadrant = round(excavation_level / 25) + 1
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
overlays += excav_overlay
/* Nope.
//extract pesky minerals while we're excavating
while(excavation_minerals.len && excavation_level > excavation_minerals[excavation_minerals.len])
DropMineral()
pop(excavation_minerals)
mineralAmt-- */
//drop some rocks
next_rock += P.excavation_amount * 10
while(next_rock > 100)
next_rock -= 100
var/obj/item/weapon/ore/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
else
return attack_hand(user)
proc/DropMineral()
if(!mineral)
return
var/obj/item/weapon/ore/O = new mineral.ore (src)
if(istype(O))
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
return O
proc/GetDrilled(var/artifact_fail = 0)
//var/destroyed = 0 //used for breaking strange rocks
if (mineral && mineral.result_amount)
//if the turf has already been excavated, some of it's ore has been removed
for (var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
//destroyed artifacts have weird, unpleasant effects
//make sure to destroy them before changing the turf though
if(artifact_find && artifact_fail)
var/pain = 0
if(prob(50))
pain = 1
for(var/mob/living/M in range(src, 200))
M << "<font color='red'><b>[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</b></font>"
if(pain)
flick("pain",M.pain)
if(prob(50))
M.adjustBruteLoss(5)
if(B)
GetDrilled(0)
else
flick("flash",M.flash)
if(prob(50))
M.Stun(5)
M.apply_effect(25, IRRADIATE)
GetDrilled(1)
return
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
N.fullUpdateMineralOverlays()
excavation_level += P.excavation_amount
if(rand(1,75) == 1)
visible_message("<span class='notice'>An old dusty crate was buried within!</span>")
new /obj/structure/closet/crate/secure/loot(src)
//archaeo overlays
if(!archaeo_overlay && finds && finds.len)
var/datum/find/F = finds[1]
if(F.excavation_required <= excavation_level + F.view_range)
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
overlays += archaeo_overlay
//there's got to be a better way to do this
var/update_excav_overlay = 0
if(excavation_level >= 75)
if(excavation_level - P.excavation_amount < 75)
update_excav_overlay = 1
else if(excavation_level >= 50)
if(excavation_level - P.excavation_amount < 50)
update_excav_overlay = 1
else if(excavation_level >= 25)
if(excavation_level - P.excavation_amount < 25)
update_excav_overlay = 1
//update overlays displaying excavation level
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
var/excav_quadrant = round(excavation_level / 25) + 1
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
overlays += excav_overlay
//drop some rocks
next_rock += P.excavation_amount * 10
while(next_rock > 100)
next_rock -= 100
var/obj/item/weapon/ore/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
else
return attack_hand(user)
/turf/simulated/mineral/proc/DropMineral()
if(!mineral)
return
var/obj/item/weapon/ore/O = new mineral.ore (src)
if(istype(O))
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
return O
/turf/simulated/mineral/proc/GetDrilled(var/artifact_fail = 0)
//var/destroyed = 0 //used for breaking strange rocks
if (mineral && mineral.result_amount)
//if the turf has already been excavated, some of it's ore has been removed
for (var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
//destroyed artifacts have weird, unpleasant effects
//make sure to destroy them before changing the turf though
if(artifact_find && artifact_fail)
var/pain = 0
if(prob(50))
pain = 1
for(var/mob/living/M in range(src, 200))
M << "<font color='red'><b>[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</b></font>"
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)
proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
//with skill and luck, players can cleanly extract finds
//otherwise, they come out inside a chunk of rock
var/obj/item/weapon/X
if(prob_clean)
X = new /obj/item/weapon/archaeological_find(src, new_item_type = F.find_type)
else
X = new /obj/item/weapon/ore/strangerock(src, inside_item_type = F.find_type)
geologic_data.UpdateNearbyArtifactInfo(src)
X:geologic_data = geologic_data
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
//yuck
var/display_name = "something"
if(!X)
X = last_find
if(X)
display_name = X.name
//Add some rubble, you did just clear out a big chunk of rock.
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
N.overlay_detail = "asteroid[rand(0,9)]"
//many finds are ancient and thus very delicate - luckily there is a specialised energy suspension field which protects them when they're being extracted
if(prob(F.prob_delicate))
var/obj/effect/suspension_field/S = locate() in src
if(!S || S.field_type != get_responsive_reagent(F.find_type))
if(X)
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
del(X)
// Kill and update the space overlays around us.
for(var/direction in step_overlays)
var/turf/space/T = get_step(src, step_overlays[direction])
if(istype(T))
T.overlays.Cut()
for(var/next_direction in step_overlays)
if(istype(get_step(T, step_overlays[next_direction]),/turf/simulated/mineral))
T.overlays += image('icons/turf/walls.dmi', "rock_side_[next_direction]")
finds.Remove(F)
// Update the
N.updateMineralOverlays(1)
if(rand(1,500) == 1)
visible_message("<span class='notice'>An old dusty crate was buried within!</span>")
new /obj/structure/closet/crate/secure/loot(src)
proc/artifact_debris(var/severity = 0)
//cael's patented random limited drop componentized loot system!
//sky's patented not-fucking-retarded overhaul!
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
//with skill and luck, players can cleanly extract finds
//otherwise, they come out inside a chunk of rock
var/obj/item/weapon/X
if(prob_clean)
X = new /obj/item/weapon/archaeological_find(src, new_item_type = F.find_type)
else
X = new /obj/item/weapon/ore/strangerock(src, inside_item_type = F.find_type)
geologic_data.UpdateNearbyArtifactInfo(src)
X:geologic_data = geologic_data
//Give a random amount of loot from 1 to 3 or 5, varying on severity.
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
switch(rand(1,7))
if(1)
var/obj/item/stack/rods/R = new(src)
R.amount = rand(5,25)
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
//yuck
var/display_name = "something"
if(!X)
X = last_find
if(X)
display_name = X.name
if(2)
var/obj/item/stack/tile/R = new(src)
R.amount = rand(1,5)
//many finds are ancient and thus very delicate - luckily there is a specialised energy suspension field which protects them when they're being extracted
if(prob(F.prob_delicate))
var/obj/effect/suspension_field/S = locate() in src
if(!S || S.field_type != get_responsive_reagent(F.find_type))
if(X)
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
del(X)
if(3)
var/obj/item/stack/sheet/metal/R = new(src)
R.amount = rand(5,25)
finds.Remove(F)
if(4)
var/obj/item/stack/sheet/plasteel/R = new(src)
R.amount = rand(5,25)
if(5)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard(src)
/turf/simulated/mineral/proc/artifact_debris(var/severity = 0)
//cael's patented random limited drop componentized loot system!
//sky's patented not-fucking-retarded overhaul!
if(6)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard/plasma(src)
//Give a random amount of loot from 1 to 3 or 5, varying on severity.
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
switch(rand(1,7))
if(1)
var/obj/item/stack/rods/R = new(src)
R.amount = rand(5,25)
if(7)
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
R.amount = rand(5,25)
if(2)
var/obj/item/stack/tile/R = new(src)
R.amount = rand(1,5)
if(3)
var/obj/item/stack/sheet/metal/R = new(src)
R.amount = rand(5,25)
if(4)
var/obj/item/stack/sheet/plasteel/R = new(src)
R.amount = rand(5,25)
if(5)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard(src)
if(6)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard/plasma(src)
if(7)
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
R.amount = rand(5,25)
/turf/simulated/mineral/random
name = "Mineral deposit"
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25)//Currently, Adamantine won't spawn as it has no uses. -Durandan
var/mineralSpawnChanceList = list("Uranium" = 5, "Platinum" = 5, "Iron" = 35, "Coal" = 35, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 10)
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
New()
if (prob(mineralChance) && !mineral)
var/mineral_name = pickweight(mineralSpawnChanceList) //temp mineral name
/turf/simulated/mineral/random/New()
if (prob(mineralChance) && !mineral)
var/mineral_name = pickweight(mineralSpawnChanceList) //temp mineral name
if(!name_to_mineral)
SetupMinerals()
if(!name_to_mineral)
SetupMinerals()
if (mineral_name && mineral_name in name_to_mineral)
mineral = name_to_mineral[mineral_name]
UpdateMineral()
. = ..()
if (mineral_name && mineral_name in name_to_mineral)
mineral = name_to_mineral[mineral_name]
UpdateMineral()
. = ..()
/turf/simulated/mineral/random/high_chance
mineralChance = 25
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 25)
mineralSpawnChanceList = list("Uranium" = 10, "Platinum" = 10, "Iron" = 20, "Coal" = 20, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 20)
/**********************Asteroid**************************/
/turf/simulated/floor/plating/airless/asteroid //floor piece
name = "Asteroid"
name = "asteroid"
icon = 'icons/turf/floors.dmi'
icon_state = "asteroid"
oxygen = 0.01
@@ -392,18 +398,13 @@ 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
var/overlay_detail
has_resources = 1
/turf/simulated/floor/plating/airless/asteroid/New()
var/proper_name = name
..()
name = proper_name
//if (prob(50))
// seedName = pick(list("1","2","3","4"))
// seedAmt = rand(1,4)
if(prob(20))
icon_state = "asteroid[rand(0,12)]"
spawn(2)
updateMineralOverlays()
overlay_detail = "asteroid[rand(0,9)]"
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
switch(severity)
@@ -421,58 +422,37 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
if(!W || !user)
return 0
if ((istype(W, /obj/item/weapon/shovel)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
var/list/usable_tools = list(
/obj/item/weapon/shovel,
/obj/item/weapon/pickaxe/diamonddrill,
/obj/item/weapon/pickaxe/drill,
/obj/item/weapon/pickaxe/borgdrill
)
var/valid_tool
for(var/valid_type in usable_tools)
if(istype(W,valid_type))
valid_tool = 1
break
if(valid_tool)
if (dug)
user << "\red This area has already been dug"
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(40)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
if (dug)
user << "\red This area has already been dug"
if (!(istype(T)))
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
playsound(user.loc, 'sound/effects/rustle1.ogg', 50, 1)
sleep(30)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if(!do_after(user,40)) return
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)) || (istype(W,/obj/item/weapon/pickaxe/borgdrill)))
var/turf/T = user.loc
if (!( istype(T, /turf) ))
return
user << "\blue You dug a hole."
gets_dug()
if (dug)
user << "\red This area has already been dug"
return
user << "\red You start digging."
playsound(loc, 'sound/effects/rustle1.ogg', 50, 1) //russle sounds sounded better
sleep(0)
if ((user.loc == T && user.get_active_hand() == W))
user << "\blue You dug a hole."
gets_dug()
if(istype(W,/obj/item/weapon/storage/bag/ore))
else if(istype(W,/obj/item/weapon/storage/bag/ore))
var/obj/item/weapon/storage/bag/ore/S = W
if(S.collection_mode)
for(var/obj/item/weapon/ore/O in contents)
@@ -484,60 +464,40 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
return
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
if(dug)
return
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
new/obj/item/weapon/ore/glass(src)
for(var/i=0;i<(rand(3)+2);i++)
new/obj/item/weapon/ore/glass(src)
dug = 1
icon_plating = "asteroid_dug"
icon_state = "asteroid_dug"
return
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays(var/update_neighbors)
overlays.Cut()
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_n")
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_s", layer=6)
if(istype(get_step(src, EAST), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
if(istype(get_step(src, WEST), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=6)
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
for(var/direction in step_overlays)
/turf/simulated/floor/plating/airless/asteroid/proc/fullUpdateMineralOverlays()
var/turf/simulated/floor/plating/airless/asteroid/A
if(istype(get_step(src, WEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, WEST)
A.updateMineralOverlays()
if(istype(get_step(src, EAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, EAST)
A.updateMineralOverlays()
if(istype(get_step(src, NORTH), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTH)
A.updateMineralOverlays()
if(istype(get_step(src, NORTHWEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTHWEST)
A.updateMineralOverlays()
if(istype(get_step(src, NORTHEAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, NORTHEAST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTHWEST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTHWEST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTHEAST), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTHEAST)
A.updateMineralOverlays()
if(istype(get_step(src, SOUTH), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, SOUTH)
A.updateMineralOverlays()
updateMineralOverlays()
if(istype(get_step(src, step_overlays[direction]), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_[direction]")
if(istype(get_step(src, step_overlays[direction]), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
if(overlay_detail) overlays += overlay_detail
if(update_neighbors)
var/list/all_step_directions = list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,SOUTHWEST,WEST,NORTHWEST)
for(var/direction in all_step_directions)
var/turf/simulated/floor/plating/airless/asteroid/A
if(istype(get_step(src, direction), /turf/simulated/floor/plating/airless/asteroid))
A = get_step(src, direction)
A.updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/Entered(atom/movable/M as mob|obj)
..()
+35 -29
View File
@@ -1,6 +1,6 @@
var/list/name_to_mineral
proc/SetupMinerals()
/proc/SetupMinerals()
name_to_mineral = list()
for(var/type in typesof(/mineral) - /mineral)
var/mineral/new_mineral = new type
@@ -9,64 +9,70 @@ proc/SetupMinerals()
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
/mineral
var/name // Tag for use in overlay generation/list population .
var/display_name // What am I called?
var/result_amount // How much ore?
var/spread = 1 // Does this type of deposit spread?
var/spread_chance // Chance of spreading in any direction
var/ore // Path to the ore produced when tile is mined.
///Path to the resultant ore.
var/ore
New()
. = ..()
if(!display_name)
display_name = name
/mineral/New()
. = ..()
if(!display_name)
display_name = name
mineral/uranium
/mineral/uranium
name = "Uranium"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/uranium
mineral/iron
/mineral/platinum
name = "Platinum"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/osmium
/mineral/iron
name = "Iron"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/iron
mineral/diamond
/mineral/coal
name = "Coal"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/coal
/mineral/diamond
name = "Diamond"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/diamond
mineral/gold
/mineral/gold
name = "Gold"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/gold
mineral/silver
/mineral/silver
name = "Silver"
result_amount = 5
spread_chance = 10
ore = /obj/item/weapon/ore/silver
mineral/plasma
name = "Plasma"
/mineral/phoron
name = "Phoron"
result_amount = 5
spread_chance = 25
ore = /obj/item/weapon/ore/plasma
mineral/clown
display_name = "Bananium"
name = "Clown"
/mineral/clown
name = "Bananium"
result_amount = 3
spread = 0
ore = /obj/item/weapon/ore/clown
spread_chance = 0
ore = /obj/item/weapon/ore/clown
+125
View File
@@ -0,0 +1,125 @@
/**********************Shuttle Computer**************************/
var/mining_shuttle_tickstomove = 10
var/mining_shuttle_moving = 0
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
proc/move_mining_shuttle()
if(mining_shuttle_moving) return
mining_shuttle_moving = 1
spawn(mining_shuttle_tickstomove*10)
var/area/fromArea
var/area/toArea
if (mining_shuttle_location == 1)
fromArea = locate(/area/shuttle/mining/outpost)
toArea = locate(/area/shuttle/mining/station)
else
fromArea = locate(/area/shuttle/mining/station)
toArea = locate(/area/shuttle/mining/outpost)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in toArea)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
// NOTE: Commenting this out to avoid recreating mass driver glitch
/*
spawn(0)
AM.throw_at(E, 1, 1)
return
*/
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
pest.gib()
fromArea.move_contents_to(toArea)
if (mining_shuttle_location)
mining_shuttle_location = 0
else
mining_shuttle_location = 1
for(var/mob/M in toArea)
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 3, 1) // buckled, not a lot of shaking
else
shake_camera(M, 10, 1) // unbuckled, HOLY SHIT SHAKE THE ROOM
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)
mining_shuttle_moving = 0
return
/obj/machinery/computer/mining_shuttle
name = "mining shuttle console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
req_access = list(access_mining)
circuit = "/obj/item/weapon/circuitboard/mining_shuttle"
var/hacked = 0
var/location = 0 //0 = station, 1 = mining base
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
if(..(user))
return
src.add_fingerprint(usr)
var/dat
dat = "<center>Mining Shuttle Control<hr>"
if(mining_shuttle_moving)
dat += "Location: <font color='red'>Moving</font> <br>"
else
dat += "Location: [mining_shuttle_location ? "Outpost" : "Station"] <br>"
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
user << browse("[dat]", "window=miningshuttle;size=200x150")
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["move"])
//if(ticker.mode.name == "blob")
// if(ticker.mode:declared)
// usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
// return
if (!mining_shuttle_moving)
usr << "\blue Shuttle recieved message and will be sent shortly."
move_mining_shuttle()
else
usr << "\blue Shuttle is already moving."
updateUsrDialog()
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/card/emag))
src.req_access = list()
hacked = 1
usr << "You fried the consoles ID checking system. It's now available to everyone!"
else
..()
+9 -20
View File
@@ -24,6 +24,7 @@
var/coinsToProduce = 10
/obj/machinery/mineral/mint/New()
..()
spawn( 5 )
@@ -44,22 +45,22 @@
O = locate(/obj/item/stack/sheet, input.loc)
if(O)
if (istype(O,/obj/item/stack/sheet/mineral/gold))
amt_gold += 100 * O.amount
amt_gold += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/silver))
amt_silver += 100 * O.amount
amt_silver += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
amt_diamond += 100 * O.amount
amt_diamond += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/plasma))
amt_plasma += 100 * O.amount
amt_plasma += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
amt_uranium += 100 * O.amount
amt_uranium += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
amt_iron += 100 * O.get_amount()
del(O)
if (istype(O,/obj/item/stack/sheet/mineral/clown))
amt_clown += 100 * O.amount
@@ -68,8 +69,7 @@
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 +105,11 @@
dat += text("chosen")
else
dat += text("<A href='?src=\ref[src];choose=plasma'>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.")
+1 -16
View File
@@ -16,8 +16,6 @@
var/amt_iron = 0
var/amt_plasma = 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("Plasma coins: [amt_plasma] <A href='?src=\ref[src];remove=plasma'>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/plasma,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)
+86
View File
@@ -0,0 +1,86 @@
/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/clown
name = "Bananium ore"
icon_state = "Clown ore"
origin_tech = "materials=4"
/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 = "Coal ore"
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/plasma
name = "plasma crystals"
icon_state = "Plasma ore"
origin_tech = "materials=2"
oretag = "plasma"
/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 = "Platinum ore"
oretag = "platinum"
/obj/item/weapon/ore/hydrogen
name = "raw hydrogen"
icon_state = "Phazon"
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 ..()
+52
View File
@@ -0,0 +1,52 @@
/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 = something that explodes violently on the conveyor, huhuhuhu
compresses_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"
-163
View File
@@ -1,163 +0,0 @@
/**********************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/plasma
name = "Plasma ore"
icon_state = "Plasma 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
icon = 'icons/obj/items.dmi'
name = "Coin"
icon_state = "coin"
flags = FPRINT | TABLEPASS| CONDUCT
force = 0.0
throwforce = 0.0
w_class = 1.0
var/string_attached
var/sides = 2
/obj/item/weapon/coin/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/coin/gold
name = "gold coin"
icon_state = "coin_gold"
/obj/item/weapon/coin/silver
name = "silver coin"
icon_state = "coin_silver"
/obj/item/weapon/coin/diamond
name = "diamond coin"
icon_state = "coin_diamond"
/obj/item/weapon/coin/iron
name = "iron coin"
icon_state = "coin_iron"
/obj/item/weapon/coin/plasma
name = "solid plasma coin"
icon_state = "coin_plasma"
/obj/item/weapon/coin/uranium
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"
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
if(string_attached)
user << "\blue There already is a string attached to this coin."
return
if(CC.amount <= 0)
user << "\blue This cable coil appears to be empty."
del(CC)
return
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
string_attached = 1
user << "\blue You attach a string to the coin."
CC.use(1)
else if(istype(W,/obj/item/weapon/wirecutters) )
if(!string_attached)
..()
return
var/obj/item/weapon/cable_coil/CC = new/obj/item/weapon/cable_coil(user.loc)
CC.amount = 1
CC.updateicon()
overlays = list()
string_attached = null
user << "\blue You detach the string from the coin."
else ..()
/obj/item/weapon/coin/attack_self(mob/user as mob)
var/result = rand(1, sides)
var/comment = ""
if(result == 1)
comment = "tails"
else if(result == 2)
comment = "heads"
user.visible_message("<span class='notice'>[user] has thrown \the [src]. It lands on [comment]! </span>", \
"<span class='notice'>You throw \the [src]. It lands on [comment]! </span>")
+72 -62
View File
@@ -4,9 +4,11 @@
/obj/structure/ore_box
icon = 'icons/obj/mining.dmi'
icon_state = "orebox0"
name = "Ore Box"
name = "ore box"
desc = "A heavy box used for storing ore."
density = 1
var/last_update = 0
var/list/stored_ore = list()
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/ore))
@@ -18,74 +20,82 @@
for(var/obj/item/weapon/ore/O in S.contents)
S.remove_from_storage(O, src) //This will move the item to this item's contents
user << "\blue You empty the satchel into the box."
update_ore_count()
return
/obj/structure/ore_box/attack_hand(obj, mob/user as mob)
var/amt_gold = 0
var/amt_silver = 0
var/amt_diamond = 0
var/amt_glass = 0
var/amt_iron = 0
var/amt_plasma = 0
var/amt_uranium = 0
var/amt_clown = 0
var/amt_strange = 0
/obj/structure/ore_box/proc/update_ore_count()
stored_ore = list()
for (var/obj/item/weapon/ore/C in contents)
if (istype(C,/obj/item/weapon/ore/diamond))
amt_diamond++;
if (istype(C,/obj/item/weapon/ore/glass))
amt_glass++;
if (istype(C,/obj/item/weapon/ore/plasma))
amt_plasma++;
if (istype(C,/obj/item/weapon/ore/iron))
amt_iron++;
if (istype(C,/obj/item/weapon/ore/silver))
amt_silver++;
if (istype(C,/obj/item/weapon/ore/gold))
amt_gold++;
if (istype(C,/obj/item/weapon/ore/uranium))
amt_uranium++;
if (istype(C,/obj/item/weapon/ore/clown))
amt_clown++;
if (istype(C,/obj/item/weapon/ore/strangerock))
amt_strange++;
for(var/obj/item/weapon/ore/O in contents)
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
if (amt_gold)
dat += text("Gold ore: [amt_gold]<br>")
if (amt_silver)
dat += text("Silver ore: [amt_silver]<br>")
if (amt_iron)
dat += text("Metal ore: [amt_iron]<br>")
if (amt_glass)
dat += text("Sand: [amt_glass]<br>")
if (amt_diamond)
dat += text("Diamond ore: [amt_diamond]<br>")
if (amt_plasma)
dat += text("Plasma ore: [amt_plasma]<br>")
if (amt_uranium)
dat += text("Uranium ore: [amt_uranium]<br>")
if (amt_clown)
dat += text("Bananium ore: [amt_clown]<br>")
if (amt_strange)
dat += text("Strange rocks: [amt_strange]<br>")
if(stored_ore[O.name])
stored_ore[O.name]++
else
stored_ore[O.name] = 1
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
user << browse("[dat]", "window=orebox")
return
/obj/structure/ore_box/examine(mob/user)
user << "That's an [src]."
user << desc
/obj/structure/ore_box/Topic(href, href_list)
if(..())
// Borgs can now check contents too.
if((!istype(user, /mob/living/carbon/human)) && (!istype(user, /mob/living/silicon/robot)))
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["removeall"])
for (var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
usr << "\blue You empty the box"
src.updateUsrDialog()
if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them.
return
add_fingerprint(user)
if(!contents.len)
user << "It is empty."
return
if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
user << "It holds:"
for(var/ore in stored_ore)
user << "- [stored_ore[ore]] [ore]"
return
/obj/structure/ore_box/verb/empty_box()
set name = "Empty Ore Box"
set category = "Object"
set src in view(1)
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
usr << "\red You are physically incapable of emptying the ore box."
return
if( usr.stat || usr.restrained() )
return
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
usr << "You cannot reach the ore box."
return
add_fingerprint(usr)
if(contents.len < 1)
usr << "\red The ore box is empty"
return
for (var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
usr << "\blue You empty the ore box"
return
/obj/structure/ore_box/ex_act(severity)
if(severity == 1.0 || (severity < 3.0 && prob(50)))
for (var/obj/item/weapon/ore/O in contents)
O.loc = src.loc
O.ex_act(severity++)
del(src)
return