mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
moving all the git stuff over to this so people who don't want to spend 8 years figuring out the bass ackward git system can actually run our server code
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2983 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
/**********************Ore to material recipes datum**************************/
|
||||
|
||||
var/list/AVAILABLE_ORES = typesof(/obj/item/weapon/ore)
|
||||
|
||||
/datum/material_recipe
|
||||
var/name
|
||||
var/list/obj/item/weapon/ore/recipe
|
||||
var/obj/prod_type //produced material/object type
|
||||
|
||||
New(var/param_name, var/param_recipe, var/param_prod_type)
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
prod_type = param_prod_type
|
||||
|
||||
var/list/datum/material_recipe/MATERIAL_RECIPES = list(
|
||||
new/datum/material_recipe("Metal",list(/obj/item/weapon/ore/iron),/obj/item/stack/sheet/metal),
|
||||
new/datum/material_recipe("Glass",list(/obj/item/weapon/ore/glass),/obj/item/stack/sheet/glass),
|
||||
new/datum/material_recipe("Gold",list(/obj/item/weapon/ore/gold),/obj/item/stack/sheet/gold),
|
||||
new/datum/material_recipe("Silver",list(/obj/item/weapon/ore/silver),/obj/item/stack/sheet/silver),
|
||||
new/datum/material_recipe("Diamond",list(/obj/item/weapon/ore/diamond),/obj/item/stack/sheet/diamond),
|
||||
new/datum/material_recipe("Plasma",list(/obj/item/weapon/ore/plasma),/obj/item/stack/sheet/plasma),
|
||||
new/datum/material_recipe("Bananium",list(/obj/item/weapon/ore/clown),/obj/item/stack/sheet/clown),
|
||||
new/datum/material_recipe("Adamantine",list(/obj/item/weapon/ore/adamantine),/obj/item/stack/sheet/adamantine)
|
||||
/**********************Ore to material recipes datum**************************/
|
||||
|
||||
var/list/AVAILABLE_ORES = typesof(/obj/item/weapon/ore)
|
||||
|
||||
/datum/material_recipe
|
||||
var/name
|
||||
var/list/obj/item/weapon/ore/recipe
|
||||
var/obj/prod_type //produced material/object type
|
||||
|
||||
New(var/param_name, var/param_recipe, var/param_prod_type)
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
prod_type = param_prod_type
|
||||
|
||||
var/list/datum/material_recipe/MATERIAL_RECIPES = list(
|
||||
new/datum/material_recipe("Metal",list(/obj/item/weapon/ore/iron),/obj/item/stack/sheet/metal),
|
||||
new/datum/material_recipe("Glass",list(/obj/item/weapon/ore/glass),/obj/item/stack/sheet/glass),
|
||||
new/datum/material_recipe("Gold",list(/obj/item/weapon/ore/gold),/obj/item/stack/sheet/gold),
|
||||
new/datum/material_recipe("Silver",list(/obj/item/weapon/ore/silver),/obj/item/stack/sheet/silver),
|
||||
new/datum/material_recipe("Diamond",list(/obj/item/weapon/ore/diamond),/obj/item/stack/sheet/diamond),
|
||||
new/datum/material_recipe("Plasma",list(/obj/item/weapon/ore/plasma),/obj/item/stack/sheet/plasma),
|
||||
new/datum/material_recipe("Bananium",list(/obj/item/weapon/ore/clown),/obj/item/stack/sheet/clown),
|
||||
new/datum/material_recipe("Adamantine",list(/obj/item/weapon/ore/adamantine),/obj/item/stack/sheet/adamantine)
|
||||
)
|
||||
@@ -1,19 +1,19 @@
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
@@ -1,432 +1,432 @@
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "Produciton machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
|
||||
/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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
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_iron==1)
|
||||
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>")
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
|
||||
//sand - glass
|
||||
if(machine.ore_glass)
|
||||
if (machine.selected_glass==1)
|
||||
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_glass = 0
|
||||
|
||||
//plasma
|
||||
if(machine.ore_plasma)
|
||||
if (machine.selected_plasma==1)
|
||||
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_plasma = 0
|
||||
|
||||
//uranium
|
||||
if(machine.ore_uranium)
|
||||
if (machine.selected_uranium==1)
|
||||
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_uranium = 0
|
||||
|
||||
//gold
|
||||
if(machine.ore_gold)
|
||||
if (machine.selected_gold==1)
|
||||
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_gold = 0
|
||||
|
||||
//silver
|
||||
if(machine.ore_silver)
|
||||
if (machine.selected_silver==1)
|
||||
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_silver = 0
|
||||
|
||||
//diamond
|
||||
if(machine.ore_diamond)
|
||||
if (machine.selected_diamond==1)
|
||||
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_diamond = 0
|
||||
|
||||
//bananium
|
||||
if(machine.ore_clown)
|
||||
if (machine.selected_clown==1)
|
||||
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_clown = 0
|
||||
|
||||
//adamantine
|
||||
if(machine.ore_adamantine)
|
||||
if (machine.selected_adamantine==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Adamantine: [machine.ore_adamantine]<br>")
|
||||
else
|
||||
machine.selected_adamantine = 0
|
||||
|
||||
|
||||
//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")
|
||||
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["sel_iron"])
|
||||
if (href_list["sel_iron"] == "yes")
|
||||
machine.selected_iron = 1
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
if(href_list["sel_glass"])
|
||||
if (href_list["sel_glass"] == "yes")
|
||||
machine.selected_glass = 1
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
if(href_list["sel_plasma"])
|
||||
if (href_list["sel_plasma"] == "yes")
|
||||
machine.selected_plasma = 1
|
||||
else
|
||||
machine.selected_plasma = 0
|
||||
if(href_list["sel_uranium"])
|
||||
if (href_list["sel_uranium"] == "yes")
|
||||
machine.selected_uranium = 1
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
if(href_list["sel_gold"])
|
||||
if (href_list["sel_gold"] == "yes")
|
||||
machine.selected_gold = 1
|
||||
else
|
||||
machine.selected_gold = 0
|
||||
if(href_list["sel_silver"])
|
||||
if (href_list["sel_silver"] == "yes")
|
||||
machine.selected_silver = 1
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
if(href_list["sel_diamond"])
|
||||
if (href_list["sel_diamond"] == "yes")
|
||||
machine.selected_diamond = 1
|
||||
else
|
||||
machine.selected_diamond = 0
|
||||
if(href_list["sel_clown"])
|
||||
if (href_list["sel_clown"] == "yes")
|
||||
machine.selected_clown = 1
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
if(href_list["sel_adamantine"])
|
||||
if (href_list["sel_adamantine"] == "yes")
|
||||
machine.selected_adamantine = 1
|
||||
else
|
||||
machine.selected_adamantine =0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "Furnace"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
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_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/selected_adamantine = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
..()
|
||||
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 (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
new /obj/item/stack/sheet/glass(output.loc)
|
||||
feedback_inc("mining_glass_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/rglass(output.loc)
|
||||
feedback_inc("mining_rglass_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
feedback_inc("mining_gold_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
feedback_inc("mining_silver_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
feedback_inc("mining_diamond_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
feedback_inc("mining_plasma_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
new /obj/item/stack/sheet/uranium(output.loc)
|
||||
feedback_inc("mining_uranium_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
feedback_inc("mining_iron_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasteel(output.loc)
|
||||
feedback_inc("mining_steel_produced",1) //should be plasteel, but that'd break Erro's stat logging -- Urist
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_adamantine == 0)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
new /obj/item/stack/sheet/clown(output.loc)
|
||||
feedback_inc("mining_clown_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 1)
|
||||
if (ore_adamantine > 0)
|
||||
ore_adamantine--;
|
||||
new /obj/item/stack/sheet/adamantine(output.loc)
|
||||
feedback_inc("mining_adamantine_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
|
||||
//if a non valid combination is selected
|
||||
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
if (selected_gold == 1)
|
||||
if (ore_gold <= 0)
|
||||
b = 0
|
||||
if (selected_silver == 1)
|
||||
if (ore_silver <= 0)
|
||||
b = 0
|
||||
if (selected_diamond == 1)
|
||||
if (ore_diamond <= 0)
|
||||
b = 0
|
||||
if (selected_uranium == 1)
|
||||
if (ore_uranium <= 0)
|
||||
b = 0
|
||||
if (selected_plasma == 1)
|
||||
if (ore_plasma <= 0)
|
||||
b = 0
|
||||
if (selected_iron == 1)
|
||||
if (ore_iron <= 0)
|
||||
b = 0
|
||||
if (selected_glass == 1)
|
||||
if (ore_glass <= 0)
|
||||
b = 0
|
||||
if (selected_clown == 1)
|
||||
if (ore_clown <= 0)
|
||||
b = 0
|
||||
if (selected_adamantine == 1)
|
||||
if (ore_adamantine <= 0)
|
||||
b = 0
|
||||
|
||||
if (b) //if they are, deduct one from each, produce slag and shut the machine off
|
||||
if (selected_gold == 1)
|
||||
ore_gold--
|
||||
if (selected_silver == 1)
|
||||
ore_silver--
|
||||
if (selected_diamond == 1)
|
||||
ore_diamond--
|
||||
if (selected_uranium == 1)
|
||||
ore_uranium--
|
||||
if (selected_plasma == 1)
|
||||
ore_plasma--
|
||||
if (selected_iron == 1)
|
||||
ore_iron--
|
||||
if (selected_clown == 1)
|
||||
ore_clown--
|
||||
if (selected_adamantine == 1)
|
||||
ore_adamantine--
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
else
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
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++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/clown))
|
||||
ore_clown++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
ore_adamantine++
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
break
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "Produciton machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
|
||||
/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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
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_iron==1)
|
||||
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>")
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
|
||||
//sand - glass
|
||||
if(machine.ore_glass)
|
||||
if (machine.selected_glass==1)
|
||||
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_glass = 0
|
||||
|
||||
//plasma
|
||||
if(machine.ore_plasma)
|
||||
if (machine.selected_plasma==1)
|
||||
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_plasma = 0
|
||||
|
||||
//uranium
|
||||
if(machine.ore_uranium)
|
||||
if (machine.selected_uranium==1)
|
||||
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_uranium = 0
|
||||
|
||||
//gold
|
||||
if(machine.ore_gold)
|
||||
if (machine.selected_gold==1)
|
||||
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_gold = 0
|
||||
|
||||
//silver
|
||||
if(machine.ore_silver)
|
||||
if (machine.selected_silver==1)
|
||||
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_silver = 0
|
||||
|
||||
//diamond
|
||||
if(machine.ore_diamond)
|
||||
if (machine.selected_diamond==1)
|
||||
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_diamond = 0
|
||||
|
||||
//bananium
|
||||
if(machine.ore_clown)
|
||||
if (machine.selected_clown==1)
|
||||
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_clown = 0
|
||||
|
||||
//adamantine
|
||||
if(machine.ore_adamantine)
|
||||
if (machine.selected_adamantine==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Adamantine: [machine.ore_adamantine]<br>")
|
||||
else
|
||||
machine.selected_adamantine = 0
|
||||
|
||||
|
||||
//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")
|
||||
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["sel_iron"])
|
||||
if (href_list["sel_iron"] == "yes")
|
||||
machine.selected_iron = 1
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
if(href_list["sel_glass"])
|
||||
if (href_list["sel_glass"] == "yes")
|
||||
machine.selected_glass = 1
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
if(href_list["sel_plasma"])
|
||||
if (href_list["sel_plasma"] == "yes")
|
||||
machine.selected_plasma = 1
|
||||
else
|
||||
machine.selected_plasma = 0
|
||||
if(href_list["sel_uranium"])
|
||||
if (href_list["sel_uranium"] == "yes")
|
||||
machine.selected_uranium = 1
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
if(href_list["sel_gold"])
|
||||
if (href_list["sel_gold"] == "yes")
|
||||
machine.selected_gold = 1
|
||||
else
|
||||
machine.selected_gold = 0
|
||||
if(href_list["sel_silver"])
|
||||
if (href_list["sel_silver"] == "yes")
|
||||
machine.selected_silver = 1
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
if(href_list["sel_diamond"])
|
||||
if (href_list["sel_diamond"] == "yes")
|
||||
machine.selected_diamond = 1
|
||||
else
|
||||
machine.selected_diamond = 0
|
||||
if(href_list["sel_clown"])
|
||||
if (href_list["sel_clown"] == "yes")
|
||||
machine.selected_clown = 1
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
if(href_list["sel_adamantine"])
|
||||
if (href_list["sel_adamantine"] == "yes")
|
||||
machine.selected_adamantine = 1
|
||||
else
|
||||
machine.selected_adamantine =0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "Furnace"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
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_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/selected_adamantine = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
..()
|
||||
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 (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
new /obj/item/stack/sheet/glass(output.loc)
|
||||
feedback_inc("mining_glass_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/rglass(output.loc)
|
||||
feedback_inc("mining_rglass_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
feedback_inc("mining_gold_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
feedback_inc("mining_silver_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
feedback_inc("mining_diamond_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
feedback_inc("mining_plasma_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
new /obj/item/stack/sheet/uranium(output.loc)
|
||||
feedback_inc("mining_uranium_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
feedback_inc("mining_iron_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_adamantine == 0)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasteel(output.loc)
|
||||
feedback_inc("mining_steel_produced",1) //should be plasteel, but that'd break Erro's stat logging -- Urist
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_adamantine == 0)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
new /obj/item/stack/sheet/clown(output.loc)
|
||||
feedback_inc("mining_clown_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_adamantine == 1)
|
||||
if (ore_adamantine > 0)
|
||||
ore_adamantine--;
|
||||
new /obj/item/stack/sheet/adamantine(output.loc)
|
||||
feedback_inc("mining_adamantine_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
|
||||
//if a non valid combination is selected
|
||||
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
if (selected_gold == 1)
|
||||
if (ore_gold <= 0)
|
||||
b = 0
|
||||
if (selected_silver == 1)
|
||||
if (ore_silver <= 0)
|
||||
b = 0
|
||||
if (selected_diamond == 1)
|
||||
if (ore_diamond <= 0)
|
||||
b = 0
|
||||
if (selected_uranium == 1)
|
||||
if (ore_uranium <= 0)
|
||||
b = 0
|
||||
if (selected_plasma == 1)
|
||||
if (ore_plasma <= 0)
|
||||
b = 0
|
||||
if (selected_iron == 1)
|
||||
if (ore_iron <= 0)
|
||||
b = 0
|
||||
if (selected_glass == 1)
|
||||
if (ore_glass <= 0)
|
||||
b = 0
|
||||
if (selected_clown == 1)
|
||||
if (ore_clown <= 0)
|
||||
b = 0
|
||||
if (selected_adamantine == 1)
|
||||
if (ore_adamantine <= 0)
|
||||
b = 0
|
||||
|
||||
if (b) //if they are, deduct one from each, produce slag and shut the machine off
|
||||
if (selected_gold == 1)
|
||||
ore_gold--
|
||||
if (selected_silver == 1)
|
||||
ore_silver--
|
||||
if (selected_diamond == 1)
|
||||
ore_diamond--
|
||||
if (selected_uranium == 1)
|
||||
ore_uranium--
|
||||
if (selected_plasma == 1)
|
||||
ore_plasma--
|
||||
if (selected_iron == 1)
|
||||
ore_iron--
|
||||
if (selected_clown == 1)
|
||||
ore_clown--
|
||||
if (selected_adamantine == 1)
|
||||
ore_adamantine--
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
else
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
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++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/clown))
|
||||
ore_clown++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
ore_adamantine++
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
break
|
||||
return
|
||||
@@ -1,290 +1,290 @@
|
||||
/**********************Mineral stacking unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console
|
||||
name = "Stacking machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/stacking_machine/machine = null
|
||||
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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
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_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_clown)
|
||||
dat += text("Bananium: [machine.ore_clown] <A href='?src=\ref[src];release=clown'>Release</A><br><br>")
|
||||
if(machine.ore_adamantine)
|
||||
dat += text ("Adamantine: [machine.ore_adamantine] <A href='?src=\ref[src];release=adamantine'>Release</A><br><br>")
|
||||
|
||||
dat += text("Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = machine.ore_plasma
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasma = 0
|
||||
if ("uranium")
|
||||
if (machine.ore_uranium > 0)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/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/gold/G = new /obj/item/stack/sheet/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/silver/G = new /obj/item/stack/sheet/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/diamond/G = new /obj/item/stack/sheet/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 ("clown")
|
||||
if (machine.ore_clown > 0)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/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/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = machine.ore_adamantine
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_adamantine = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine
|
||||
name = "Stacking machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
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/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_iron = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_rglass = 0;
|
||||
var/ore_plasteel = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
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/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/obj/item/O
|
||||
while (locate(/obj/item, input.loc))
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
ore_iron+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
ore_diamond+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
ore_plasma+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
ore_gold+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
ore_silver+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
ore_clown+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
ore_uranium+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/glass))
|
||||
ore_glass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/rglass))
|
||||
ore_rglass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasteel))
|
||||
ore_plasteel+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
ore_adamantine+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/slag))
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
if (ore_gold >= stack_amt)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_gold -= stack_amt
|
||||
return
|
||||
if (ore_silver >= stack_amt)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_silver -= stack_amt
|
||||
return
|
||||
if (ore_diamond >= stack_amt)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_diamond -= stack_amt
|
||||
return
|
||||
if (ore_plasma >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/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/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_clown -= stack_amt
|
||||
return
|
||||
if (ore_uranium >= stack_amt)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/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_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_adamantine >= stack_amt)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_adamantine -= stack_amt
|
||||
return
|
||||
return
|
||||
/**********************Mineral stacking unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console
|
||||
name = "Stacking machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/stacking_machine/machine = null
|
||||
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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
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_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_clown)
|
||||
dat += text("Bananium: [machine.ore_clown] <A href='?src=\ref[src];release=clown'>Release</A><br><br>")
|
||||
if(machine.ore_adamantine)
|
||||
dat += text ("Adamantine: [machine.ore_adamantine] <A href='?src=\ref[src];release=adamantine'>Release</A><br><br>")
|
||||
|
||||
dat += text("Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = machine.ore_plasma
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasma = 0
|
||||
if ("uranium")
|
||||
if (machine.ore_uranium > 0)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/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/gold/G = new /obj/item/stack/sheet/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/silver/G = new /obj/item/stack/sheet/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/diamond/G = new /obj/item/stack/sheet/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 ("clown")
|
||||
if (machine.ore_clown > 0)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/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/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = machine.ore_adamantine
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_adamantine = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine
|
||||
name = "Stacking machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
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/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_iron = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_rglass = 0;
|
||||
var/ore_plasteel = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
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/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/obj/item/O
|
||||
while (locate(/obj/item, input.loc))
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
ore_iron+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
ore_diamond+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
ore_plasma+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
ore_gold+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
ore_silver+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
ore_clown+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
ore_uranium+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/glass))
|
||||
ore_glass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/rglass))
|
||||
ore_rglass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasteel))
|
||||
ore_plasteel+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
ore_adamantine+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/slag))
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
if (ore_gold >= stack_amt)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_gold -= stack_amt
|
||||
return
|
||||
if (ore_silver >= stack_amt)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_silver -= stack_amt
|
||||
return
|
||||
if (ore_diamond >= stack_amt)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_diamond -= stack_amt
|
||||
return
|
||||
if (ore_plasma >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/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/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_clown -= stack_amt
|
||||
return
|
||||
if (ore_uranium >= stack_amt)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/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_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_adamantine >= stack_amt)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_adamantine -= stack_amt
|
||||
return
|
||||
return
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/**********************Unloading unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine
|
||||
name = "Unloading machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
..()
|
||||
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/unloading_machine/process()
|
||||
if (src.output && src.input)
|
||||
if (locate(/obj/structure/ore_box, input.loc))
|
||||
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
|
||||
var/i = 0
|
||||
for (var/obj/item/weapon/ore/O in BOX.contents)
|
||||
BOX.contents -= O
|
||||
O.loc = output.loc
|
||||
i++
|
||||
if (i>=10)
|
||||
return
|
||||
if (locate(/obj/item, input.loc))
|
||||
var/obj/item/O
|
||||
var/i
|
||||
for (i = 0; i<10; i++)
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
return
|
||||
/**********************Unloading unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine
|
||||
name = "Unloading machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
..()
|
||||
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/unloading_machine/process()
|
||||
if (src.output && src.input)
|
||||
if (locate(/obj/structure/ore_box, input.loc))
|
||||
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
|
||||
var/i = 0
|
||||
for (var/obj/item/weapon/ore/O in BOX.contents)
|
||||
BOX.contents -= O
|
||||
O.loc = output.loc
|
||||
i++
|
||||
if (i>=10)
|
||||
return
|
||||
if (locate(/obj/item, input.loc))
|
||||
var/obj/item/O
|
||||
var/i
|
||||
for (i = 0; i<10; i++)
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
return
|
||||
return
|
||||
@@ -1,53 +1,53 @@
|
||||
/**********************Mine areas**************************/
|
||||
|
||||
/area/mine
|
||||
icon_state = "mining"
|
||||
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
|
||||
/area/mine/lobby
|
||||
name = "Mining station"
|
||||
|
||||
/area/mine/storage
|
||||
name = "Mining station Storage"
|
||||
|
||||
/area/mine/production
|
||||
name = "Mining station Production Area"
|
||||
icon_state = "mining_production"
|
||||
|
||||
/area/mine/abandoned
|
||||
name = "Abandoned Mining Station"
|
||||
|
||||
/area/mine/living_quarters
|
||||
name = "Mining Station Living Quarters"
|
||||
icon_state = "mining_living"
|
||||
|
||||
/area/mine/eva
|
||||
name = "Mining station EVA"
|
||||
icon_state = "mining_eva"
|
||||
|
||||
/area/mine/maintenance
|
||||
name = "Mining station Maintenance"
|
||||
|
||||
/area/mine/cafeteria
|
||||
name = "Mining station Cafeteria"
|
||||
|
||||
/area/mine/hydroponics
|
||||
name = "Mining station Hydroponics"
|
||||
|
||||
/area/mine/sleeper
|
||||
name = "Mining station Emergency Sleeper"
|
||||
|
||||
/area/mine/north_outpost
|
||||
name = "North Mining Outpost"
|
||||
|
||||
/area/mine/west_outpost
|
||||
/**********************Mine areas**************************/
|
||||
|
||||
/area/mine
|
||||
icon_state = "mining"
|
||||
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
|
||||
/area/mine/lobby
|
||||
name = "Mining station"
|
||||
|
||||
/area/mine/storage
|
||||
name = "Mining station Storage"
|
||||
|
||||
/area/mine/production
|
||||
name = "Mining station Production Area"
|
||||
icon_state = "mining_production"
|
||||
|
||||
/area/mine/abandoned
|
||||
name = "Abandoned Mining Station"
|
||||
|
||||
/area/mine/living_quarters
|
||||
name = "Mining Station Living Quarters"
|
||||
icon_state = "mining_living"
|
||||
|
||||
/area/mine/eva
|
||||
name = "Mining station EVA"
|
||||
icon_state = "mining_eva"
|
||||
|
||||
/area/mine/maintenance
|
||||
name = "Mining station Maintenance"
|
||||
|
||||
/area/mine/cafeteria
|
||||
name = "Mining station Cafeteria"
|
||||
|
||||
/area/mine/hydroponics
|
||||
name = "Mining station Hydroponics"
|
||||
|
||||
/area/mine/sleeper
|
||||
name = "Mining station Emergency Sleeper"
|
||||
|
||||
/area/mine/north_outpost
|
||||
name = "North Mining Outpost"
|
||||
|
||||
/area/mine/west_outpost
|
||||
name = "West Mining Outpost"
|
||||
@@ -1,234 +1,234 @@
|
||||
/**********************Light************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/light_emitter
|
||||
name = "Light-emtter"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
luminosity = 8
|
||||
|
||||
/**********************Miner Lockers**************************/
|
||||
|
||||
/obj/structure/closet/secure_closet/miner
|
||||
name = "Miner's Equipment"
|
||||
icon_state = "miningsec1"
|
||||
icon_closed = "miningsec"
|
||||
icon_locked = "miningsec1"
|
||||
icon_broken = "miningsecbroken"
|
||||
icon_off = "miningsecoff"
|
||||
req_access = list(access_mining)
|
||||
|
||||
/obj/structure/closet/secure_closet/miner/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
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)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "Mining Shuttle Console"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
dat = text("<center>Mining shuttle:<br> <b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>")
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x100")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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."
|
||||
|
||||
/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!"
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
name = "Mining Lantern"
|
||||
icon = 'lighting.dmi'
|
||||
icon_state = "lantern-off"
|
||||
desc = "A miner's lantern"
|
||||
anchored = 0
|
||||
var/brightness = 12 // luminosity when on
|
||||
|
||||
/obj/item/device/flashlight/lantern/New()
|
||||
luminosity = 0
|
||||
on = 0
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/lantern/attack_self(mob/user)
|
||||
..()
|
||||
if (on == 1)
|
||||
icon_state = "lantern-on"
|
||||
else
|
||||
icon_state = "lantern-off"
|
||||
|
||||
|
||||
/*****************************Pickaxe********************************/
|
||||
|
||||
/obj/item/weapon/pickaxe
|
||||
name = "Miner's pickaxe"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "pickaxe"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 15.0
|
||||
throwforce = 4.0
|
||||
item_state = "pickaxe"
|
||||
w_class = 4.0
|
||||
m_amt = 3750 //one sheet, but where can you make them?
|
||||
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
hammer
|
||||
name = "Mining Sledge Hammer"
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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 = 0 //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!"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
name = "Shovel"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "shovel"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 8.0
|
||||
throwforce = 4.0
|
||||
item_state = "shovel"
|
||||
w_class = 3.0
|
||||
m_amt = 50
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Mining car (Crate like thing, not the rail car)**************************/
|
||||
|
||||
/obj/structure/closet/crate/miningcar
|
||||
desc = "A mining car. This one doesn't work on rails, but has to be dragged."
|
||||
name = "Mining car (not for rails)"
|
||||
icon = 'storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
density = 1
|
||||
icon_opened = "miningcaropen"
|
||||
icon_closed = "miningcar"
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Light************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/light_emitter
|
||||
name = "Light-emtter"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
luminosity = 8
|
||||
|
||||
/**********************Miner Lockers**************************/
|
||||
|
||||
/obj/structure/closet/secure_closet/miner
|
||||
name = "Miner's Equipment"
|
||||
icon_state = "miningsec1"
|
||||
icon_closed = "miningsec"
|
||||
icon_locked = "miningsec1"
|
||||
icon_broken = "miningsecbroken"
|
||||
icon_off = "miningsecoff"
|
||||
req_access = list(access_mining)
|
||||
|
||||
/obj/structure/closet/secure_closet/miner/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
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)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "Mining Shuttle Console"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
dat = text("<center>Mining shuttle:<br> <b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>")
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x100")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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."
|
||||
|
||||
/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!"
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
name = "Mining Lantern"
|
||||
icon = 'lighting.dmi'
|
||||
icon_state = "lantern-off"
|
||||
desc = "A miner's lantern"
|
||||
anchored = 0
|
||||
var/brightness = 12 // luminosity when on
|
||||
|
||||
/obj/item/device/flashlight/lantern/New()
|
||||
luminosity = 0
|
||||
on = 0
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/lantern/attack_self(mob/user)
|
||||
..()
|
||||
if (on == 1)
|
||||
icon_state = "lantern-on"
|
||||
else
|
||||
icon_state = "lantern-off"
|
||||
|
||||
|
||||
/*****************************Pickaxe********************************/
|
||||
|
||||
/obj/item/weapon/pickaxe
|
||||
name = "Miner's pickaxe"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "pickaxe"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 15.0
|
||||
throwforce = 4.0
|
||||
item_state = "pickaxe"
|
||||
w_class = 4.0
|
||||
m_amt = 3750 //one sheet, but where can you make them?
|
||||
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
hammer
|
||||
name = "Mining Sledge Hammer"
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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."
|
||||
|
||||
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 = 0 //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!"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
name = "Shovel"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "shovel"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 8.0
|
||||
throwforce = 4.0
|
||||
item_state = "shovel"
|
||||
w_class = 3.0
|
||||
m_amt = 50
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Mining car (Crate like thing, not the rail car)**************************/
|
||||
|
||||
/obj/structure/closet/crate/miningcar
|
||||
desc = "A mining car. This one doesn't work on rails, but has to be dragged."
|
||||
name = "Mining car (not for rails)"
|
||||
icon = 'storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
density = 1
|
||||
icon_opened = "miningcaropen"
|
||||
icon_closed = "miningcar"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,425 +1,425 @@
|
||||
/**********************Mineral deposits**************************/
|
||||
|
||||
/turf/simulated/mineral //wall piece
|
||||
name = "Rock"
|
||||
icon = 'walls.dmi'
|
||||
icon_state = "rock"
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
opacity = 1
|
||||
density = 1
|
||||
blocks_air = 1
|
||||
temperature = TCMB
|
||||
var/mineralName = ""
|
||||
var/mineralAmt = 0
|
||||
var/spread = 0 //will the seam spread?
|
||||
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
|
||||
|
||||
/turf/simulated/mineral/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/ex_act(severity)
|
||||
switch(severity)
|
||||
if(3.0)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(70))
|
||||
src.mineralAmt -= 1 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
if(1.0)
|
||||
src.mineralAmt -= 2 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/New()
|
||||
|
||||
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('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('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('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('walls.dmi', "rock_side_e", layer=6)
|
||||
|
||||
if (mineralName && mineralAmt && spread && spreadChance)
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, SOUTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, NORTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, WEST))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, EAST))
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
/turf/simulated/mineral/random/New()
|
||||
..()
|
||||
if (prob(mineralChance))
|
||||
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
|
||||
|
||||
if (mName)
|
||||
var/turf/simulated/mineral/M
|
||||
switch(mName)
|
||||
if("Uranium")
|
||||
M = new/turf/simulated/mineral/uranium(src)
|
||||
if("Iron")
|
||||
M = new/turf/simulated/mineral/iron(src)
|
||||
if("Diamond")
|
||||
M = new/turf/simulated/mineral/diamond(src)
|
||||
if("Gold")
|
||||
M = new/turf/simulated/mineral/gold(src)
|
||||
if("Silver")
|
||||
M = new/turf/simulated/mineral/silver(src)
|
||||
if("Plasma")
|
||||
M = new/turf/simulated/mineral/plasma(src)
|
||||
/*if("Adamantine")
|
||||
M = new/turf/simulated/mineral/adamantine(src)*/
|
||||
if(M)
|
||||
src = M
|
||||
M.levelupdate()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
mineralChance = 25
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 25)
|
||||
|
||||
/turf/simulated/mineral/random/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/uranium
|
||||
name = "Uranium deposit"
|
||||
icon_state = "rock_Uranium"
|
||||
mineralName = "Uranium"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
|
||||
/turf/simulated/mineral/iron
|
||||
name = "Iron deposit"
|
||||
icon_state = "rock_Iron"
|
||||
mineralName = "Iron"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/diamond
|
||||
name = "Diamond deposit"
|
||||
icon_state = "rock_Diamond"
|
||||
mineralName = "Diamond"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/gold
|
||||
name = "Gold deposit"
|
||||
icon_state = "rock_Gold"
|
||||
mineralName = "Gold"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/silver
|
||||
name = "Silver deposit"
|
||||
icon_state = "rock_Silver"
|
||||
mineralName = "Silver"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/plasma
|
||||
name = "Plasma deposit"
|
||||
icon_state = "rock_Plasma"
|
||||
mineralName = "Plasma"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/adamantine
|
||||
name = "Adamantine deposit"
|
||||
icon_state = "rock_Adamantine"
|
||||
mineralName = "Adamantine"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0 //It shouldn't spawn yet; will change these to match diamond once it's fully implemented. -Durandan
|
||||
|
||||
|
||||
/turf/simulated/mineral/clown
|
||||
name = "Bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
mineralName = "Clown"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0
|
||||
|
||||
|
||||
/turf/simulated/mineral/ReplaceWithFloor()
|
||||
if(!icon_old) icon_old = icon_state
|
||||
var/turf/simulated/floor/plating/airless/asteroid/W
|
||||
var/old_dir = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
W = new /turf/simulated/floor/plating/airless/asteroid( locate(src.x, src.y, src.z) )
|
||||
W.dir = old_dir
|
||||
W.fullUpdateMineralOverlays()
|
||||
|
||||
/*
|
||||
W.icon_old = old_icon
|
||||
if(old_icon) W.icon_state = old_icon
|
||||
*/
|
||||
W.opacity = 1
|
||||
W.sd_SetOpacity(0)
|
||||
W.sd_LumReset()
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
|
||||
/turf/simulated/mineral/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!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
/*
|
||||
if (istype(W, /obj/item/weapon/pickaxe/radius))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
*/
|
||||
//Watch your tabbing, microwave. --NEO
|
||||
|
||||
user << "\red You start picking."
|
||||
playsound(user, 'Genhit.ogg', 20, 1)
|
||||
|
||||
if(do_after(user,W:digspeed))
|
||||
user << "\blue You finish cutting into the rock."
|
||||
gets_drilled()
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled()
|
||||
if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11))
|
||||
var/i
|
||||
for (i=0;i<mineralAmt;i++)
|
||||
if (src.mineralName == "Uranium")
|
||||
new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
new /obj/item/weapon/ore/diamond(src)
|
||||
if (src.mineralName == "Clown")
|
||||
new /obj/item/weapon/ore/clown(src)
|
||||
if (src.mineralName == "Adamantine")
|
||||
new /obj/item/weapon/ore/adamantine(src)
|
||||
ReplaceWithFloor()
|
||||
return
|
||||
|
||||
/*
|
||||
/turf/simulated/mineral/proc/setRandomMinerals()
|
||||
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
|
||||
if (s)
|
||||
mineralName = s
|
||||
|
||||
var/N = text2path("/turf/simulated/mineral/[s]")
|
||||
if (N)
|
||||
var/turf/simulated/mineral/M = new N
|
||||
src = M
|
||||
if (src.mineralName)
|
||||
mineralAmt = 5
|
||||
return*/
|
||||
|
||||
|
||||
/**********************Asteroid**************************/
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid //floor piece
|
||||
name = "Asteroid"
|
||||
icon = 'floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
|
||||
/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,8)]"
|
||||
spawn(2)
|
||||
updateMineralOverlays()
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(!W || !user)
|
||||
return 0
|
||||
|
||||
if ((istype(W, /obj/item/weapon/shovel)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(40)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(30)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(0)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
|
||||
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)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
|
||||
|
||||
src.overlays = null
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_n")
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_s", layer=6)
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
|
||||
|
||||
/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()
|
||||
/**********************Mineral deposits**************************/
|
||||
|
||||
/turf/simulated/mineral //wall piece
|
||||
name = "Rock"
|
||||
icon = 'walls.dmi'
|
||||
icon_state = "rock"
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
opacity = 1
|
||||
density = 1
|
||||
blocks_air = 1
|
||||
temperature = TCMB
|
||||
var/mineralName = ""
|
||||
var/mineralAmt = 0
|
||||
var/spread = 0 //will the seam spread?
|
||||
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
|
||||
|
||||
/turf/simulated/mineral/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/ex_act(severity)
|
||||
switch(severity)
|
||||
if(3.0)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(70))
|
||||
src.mineralAmt -= 1 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
if(1.0)
|
||||
src.mineralAmt -= 2 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/New()
|
||||
|
||||
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('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('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('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('walls.dmi', "rock_side_e", layer=6)
|
||||
|
||||
if (mineralName && mineralAmt && spread && spreadChance)
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, SOUTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, NORTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, WEST))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, EAST))
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
/turf/simulated/mineral/random/New()
|
||||
..()
|
||||
if (prob(mineralChance))
|
||||
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
|
||||
|
||||
if (mName)
|
||||
var/turf/simulated/mineral/M
|
||||
switch(mName)
|
||||
if("Uranium")
|
||||
M = new/turf/simulated/mineral/uranium(src)
|
||||
if("Iron")
|
||||
M = new/turf/simulated/mineral/iron(src)
|
||||
if("Diamond")
|
||||
M = new/turf/simulated/mineral/diamond(src)
|
||||
if("Gold")
|
||||
M = new/turf/simulated/mineral/gold(src)
|
||||
if("Silver")
|
||||
M = new/turf/simulated/mineral/silver(src)
|
||||
if("Plasma")
|
||||
M = new/turf/simulated/mineral/plasma(src)
|
||||
/*if("Adamantine")
|
||||
M = new/turf/simulated/mineral/adamantine(src)*/
|
||||
if(M)
|
||||
src = M
|
||||
M.levelupdate()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
mineralChance = 25
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 25)
|
||||
|
||||
/turf/simulated/mineral/random/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/uranium
|
||||
name = "Uranium deposit"
|
||||
icon_state = "rock_Uranium"
|
||||
mineralName = "Uranium"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
|
||||
/turf/simulated/mineral/iron
|
||||
name = "Iron deposit"
|
||||
icon_state = "rock_Iron"
|
||||
mineralName = "Iron"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/diamond
|
||||
name = "Diamond deposit"
|
||||
icon_state = "rock_Diamond"
|
||||
mineralName = "Diamond"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/gold
|
||||
name = "Gold deposit"
|
||||
icon_state = "rock_Gold"
|
||||
mineralName = "Gold"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/silver
|
||||
name = "Silver deposit"
|
||||
icon_state = "rock_Silver"
|
||||
mineralName = "Silver"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/plasma
|
||||
name = "Plasma deposit"
|
||||
icon_state = "rock_Plasma"
|
||||
mineralName = "Plasma"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/adamantine
|
||||
name = "Adamantine deposit"
|
||||
icon_state = "rock_Adamantine"
|
||||
mineralName = "Adamantine"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0 //It shouldn't spawn yet; will change these to match diamond once it's fully implemented. -Durandan
|
||||
|
||||
|
||||
/turf/simulated/mineral/clown
|
||||
name = "Bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
mineralName = "Clown"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0
|
||||
|
||||
|
||||
/turf/simulated/mineral/ReplaceWithFloor()
|
||||
if(!icon_old) icon_old = icon_state
|
||||
var/turf/simulated/floor/plating/airless/asteroid/W
|
||||
var/old_dir = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
W = new /turf/simulated/floor/plating/airless/asteroid( locate(src.x, src.y, src.z) )
|
||||
W.dir = old_dir
|
||||
W.fullUpdateMineralOverlays()
|
||||
|
||||
/*
|
||||
W.icon_old = old_icon
|
||||
if(old_icon) W.icon_state = old_icon
|
||||
*/
|
||||
W.opacity = 1
|
||||
W.sd_SetOpacity(0)
|
||||
W.sd_LumReset()
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
|
||||
/turf/simulated/mineral/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!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
/*
|
||||
if (istype(W, /obj/item/weapon/pickaxe/radius))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
*/
|
||||
//Watch your tabbing, microwave. --NEO
|
||||
|
||||
user << "\red You start picking."
|
||||
playsound(user, 'Genhit.ogg', 20, 1)
|
||||
|
||||
if(do_after(user,W:digspeed))
|
||||
user << "\blue You finish cutting into the rock."
|
||||
gets_drilled()
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled()
|
||||
if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11))
|
||||
var/i
|
||||
for (i=0;i<mineralAmt;i++)
|
||||
if (src.mineralName == "Uranium")
|
||||
new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
new /obj/item/weapon/ore/diamond(src)
|
||||
if (src.mineralName == "Clown")
|
||||
new /obj/item/weapon/ore/clown(src)
|
||||
if (src.mineralName == "Adamantine")
|
||||
new /obj/item/weapon/ore/adamantine(src)
|
||||
ReplaceWithFloor()
|
||||
return
|
||||
|
||||
/*
|
||||
/turf/simulated/mineral/proc/setRandomMinerals()
|
||||
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
|
||||
if (s)
|
||||
mineralName = s
|
||||
|
||||
var/N = text2path("/turf/simulated/mineral/[s]")
|
||||
if (N)
|
||||
var/turf/simulated/mineral/M = new N
|
||||
src = M
|
||||
if (src.mineralName)
|
||||
mineralAmt = 5
|
||||
return*/
|
||||
|
||||
|
||||
/**********************Asteroid**************************/
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid //floor piece
|
||||
name = "Asteroid"
|
||||
icon = 'floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
|
||||
/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,8)]"
|
||||
spawn(2)
|
||||
updateMineralOverlays()
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(!W || !user)
|
||||
return 0
|
||||
|
||||
if ((istype(W, /obj/item/weapon/shovel)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(40)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(30)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(0)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
|
||||
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)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
|
||||
|
||||
src.overlays = null
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_n")
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_s", layer=6)
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
|
||||
|
||||
/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()
|
||||
src.updateMineralOverlays()
|
||||
@@ -1,256 +1,256 @@
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "Coin press"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/New()
|
||||
..()
|
||||
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/mint/process()
|
||||
if ( src.input)
|
||||
var/obj/item/stack/sheet/O
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
amt_adamantine += 100 * O.amount
|
||||
del(O) //Commented out for now. -Durandan
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=gold'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
|
||||
if (chosen == "silver")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=silver'>Choose</A>")
|
||||
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
|
||||
if (chosen == "metal")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=metal'>Choose</A>")
|
||||
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
|
||||
if (chosen == "diamond")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=diamond'>Choose</A>")
|
||||
dat += text("<br><font color='#FF8800'><b>Plasma inserted: </b>[amt_plasma]</font> ")
|
||||
if (chosen == "plasma")
|
||||
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> ")
|
||||
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.")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-10'>-10</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-5'>-5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-1'>-1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=1'>+1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=5'>+5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=10'>+10</A> ")
|
||||
|
||||
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
|
||||
dat += text("<br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
|
||||
user << browse("[dat]", "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new/obj/item/weapon/coin/iron(M)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/gold(M)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/silver(M)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/diamond(M)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/plasma(M)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/uranium(M)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/clown(M)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("adamantine")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/adamantine(M)
|
||||
amt_adamantine -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "Coin press"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/New()
|
||||
..()
|
||||
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/mint/process()
|
||||
if ( src.input)
|
||||
var/obj/item/stack/sheet/O
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
amt_adamantine += 100 * O.amount
|
||||
del(O) //Commented out for now. -Durandan
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=gold'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
|
||||
if (chosen == "silver")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=silver'>Choose</A>")
|
||||
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
|
||||
if (chosen == "metal")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=metal'>Choose</A>")
|
||||
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
|
||||
if (chosen == "diamond")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=diamond'>Choose</A>")
|
||||
dat += text("<br><font color='#FF8800'><b>Plasma inserted: </b>[amt_plasma]</font> ")
|
||||
if (chosen == "plasma")
|
||||
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> ")
|
||||
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.")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-10'>-10</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-5'>-5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-1'>-1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=1'>+1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=5'>+5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=10'>+10</A> ")
|
||||
|
||||
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
|
||||
dat += text("<br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
|
||||
user << browse("[dat]", "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new/obj/item/weapon/coin/iron(M)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/gold(M)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/silver(M)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/diamond(M)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/plasma(M)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/uranium(M)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/clown(M)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("adamantine")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/adamantine(M)
|
||||
amt_adamantine -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -1,114 +1,114 @@
|
||||
/*****************************Money bag********************************/
|
||||
|
||||
/obj/item/weapon/moneybag
|
||||
icon = 'storage.dmi'
|
||||
name = "Money bag"
|
||||
icon_state = "moneybag"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
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))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/coin/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/coin/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/coin/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/coin/gold))
|
||||
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)
|
||||
dat += text("Gold coins: [amt_gold] <A href='?src=\ref[src];remove=gold'>Remove one</A><br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver coins: [amt_silver] <A href='?src=\ref[src];remove=silver'>Remove one</A><br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal coins: [amt_iron] <A href='?src=\ref[src];remove=iron'>Remove one</A><br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond coins: [amt_diamond] <A href='?src=\ref[src];remove=diamond'>Remove one</A><br>")
|
||||
if (amt_plasma)
|
||||
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)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/coin/COIN
|
||||
switch(href_list["remove"])
|
||||
if("gold")
|
||||
COIN = locate(/obj/item/weapon/coin/gold,src.contents)
|
||||
if("silver")
|
||||
COIN = locate(/obj/item/weapon/coin/silver,src.contents)
|
||||
if("iron")
|
||||
COIN = locate(/obj/item/weapon/coin/iron,src.contents)
|
||||
if("diamond")
|
||||
COIN = locate(/obj/item/weapon/coin/diamond,src.contents)
|
||||
if("plasma")
|
||||
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
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
..()
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
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)
|
||||
/*****************************Money bag********************************/
|
||||
|
||||
/obj/item/weapon/moneybag
|
||||
icon = 'storage.dmi'
|
||||
name = "Money bag"
|
||||
icon_state = "moneybag"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
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))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/coin/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/coin/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/coin/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/coin/gold))
|
||||
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)
|
||||
dat += text("Gold coins: [amt_gold] <A href='?src=\ref[src];remove=gold'>Remove one</A><br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver coins: [amt_silver] <A href='?src=\ref[src];remove=silver'>Remove one</A><br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal coins: [amt_iron] <A href='?src=\ref[src];remove=iron'>Remove one</A><br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond coins: [amt_diamond] <A href='?src=\ref[src];remove=diamond'>Remove one</A><br>")
|
||||
if (amt_plasma)
|
||||
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)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/coin/COIN
|
||||
switch(href_list["remove"])
|
||||
if("gold")
|
||||
COIN = locate(/obj/item/weapon/coin/gold,src.contents)
|
||||
if("silver")
|
||||
COIN = locate(/obj/item/weapon/coin/silver,src.contents)
|
||||
if("iron")
|
||||
COIN = locate(/obj/item/weapon/coin/iron,src.contents)
|
||||
if("diamond")
|
||||
COIN = locate(/obj/item/weapon/coin/diamond,src.contents)
|
||||
if("plasma")
|
||||
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
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
..()
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
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)
|
||||
@@ -1,281 +1,281 @@
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "ore"
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
var/obj/item/weapon/satchel/S = W
|
||||
if (S.mode == 1)
|
||||
for (var/obj/item/weapon/ore/O in locate(src.x,src.y,src.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += O;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
user << "\blue You pick up all the ores."
|
||||
else
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += src;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
|
||||
|
||||
/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/sandstone(location)
|
||||
del(sandToConvert)
|
||||
new /obj/item/stack/sheet/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/adamantine
|
||||
name = "Adamantine ore"
|
||||
icon_state = "Adamantine ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/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
|
||||
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
|
||||
/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/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('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 ..()
|
||||
|
||||
/******************************Materials****************************/
|
||||
|
||||
/obj/item/stack/sheet/gold
|
||||
name = "gold"
|
||||
icon_state = "sheet-gold"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/gold/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
/* recipes = gold_recipes //Commenting out until there's a proper sprite. The golden plaque is supposed to be a special item dedicated to a really good player. -Agouri
|
||||
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("Plaque", /obj/item/weapon/plaque_assembly, 2), \
|
||||
)*/
|
||||
|
||||
|
||||
/obj/item/stack/sheet/silver
|
||||
name = "silver"
|
||||
icon_state = "sheet-silver"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/silver/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/diamond
|
||||
name = "diamond"
|
||||
icon_state = "sheet-diamond"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_range = 3
|
||||
origin_tech = "materials=6"
|
||||
perunit = 3750
|
||||
|
||||
/obj/item/stack/sheet/diamond/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/uranium
|
||||
name = "Uranium block"
|
||||
icon_state = "sheet-uranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/enruranium
|
||||
name = "Enriched Uranium block"
|
||||
icon_state = "sheet-enruranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 1000
|
||||
|
||||
/obj/item/stack/sheet/plasma
|
||||
name = "solid plasma"
|
||||
icon_state = "sheet-plasma"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/adamantine
|
||||
name = "adamantine"
|
||||
icon_state = "sheet-adamantine"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/clown
|
||||
name = "bananium"
|
||||
icon_state = "sheet-clown"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/clown/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "ore"
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
var/obj/item/weapon/satchel/S = W
|
||||
if (S.mode == 1)
|
||||
for (var/obj/item/weapon/ore/O in locate(src.x,src.y,src.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += O;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
user << "\blue You pick up all the ores."
|
||||
else
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += src;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
|
||||
|
||||
/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/sandstone(location)
|
||||
del(sandToConvert)
|
||||
new /obj/item/stack/sheet/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/adamantine
|
||||
name = "Adamantine ore"
|
||||
icon_state = "Adamantine ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/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
|
||||
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
|
||||
/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/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('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 ..()
|
||||
|
||||
/******************************Materials****************************/
|
||||
|
||||
/obj/item/stack/sheet/gold
|
||||
name = "gold"
|
||||
icon_state = "sheet-gold"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/gold/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
/* recipes = gold_recipes //Commenting out until there's a proper sprite. The golden plaque is supposed to be a special item dedicated to a really good player. -Agouri
|
||||
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("Plaque", /obj/item/weapon/plaque_assembly, 2), \
|
||||
)*/
|
||||
|
||||
|
||||
/obj/item/stack/sheet/silver
|
||||
name = "silver"
|
||||
icon_state = "sheet-silver"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/silver/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/diamond
|
||||
name = "diamond"
|
||||
icon_state = "sheet-diamond"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_range = 3
|
||||
origin_tech = "materials=6"
|
||||
perunit = 3750
|
||||
|
||||
/obj/item/stack/sheet/diamond/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/uranium
|
||||
name = "Uranium block"
|
||||
icon_state = "sheet-uranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/enruranium
|
||||
name = "Enriched Uranium block"
|
||||
icon_state = "sheet-enruranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 1000
|
||||
|
||||
/obj/item/stack/sheet/plasma
|
||||
name = "solid plasma"
|
||||
icon_state = "sheet-plasma"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/adamantine
|
||||
name = "adamantine"
|
||||
icon_state = "sheet-adamantine"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/clown
|
||||
name = "bananium"
|
||||
icon_state = "sheet-clown"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/clown/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
@@ -1,121 +1,121 @@
|
||||
/**********************Satchel**************************/
|
||||
|
||||
/obj/item/weapon/satchel
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "satchel"
|
||||
name = "Mining Satchel"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of ore pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/satchel/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the satchel."
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
var/obj/item/weapon/ore/O = W
|
||||
src.contents += O;
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/verb/toggle_mode()
|
||||
set name = "Switch Satchel Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The satchel now picks up all ore in a tile at once."
|
||||
if(0)
|
||||
usr << "The satchel now picks up one ore at a time."
|
||||
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "Ore Box"
|
||||
desc = "It's heavy"
|
||||
density = 1
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
src.contents += W;
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
src.contents += W.contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
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_adamantine = 0
|
||||
|
||||
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/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
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_adamantine)
|
||||
dat += text("Adamantine ore: [amt_adamantine]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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()
|
||||
/**********************Satchel**************************/
|
||||
|
||||
/obj/item/weapon/satchel
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "satchel"
|
||||
name = "Mining Satchel"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of ore pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/satchel/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the satchel."
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
var/obj/item/weapon/ore/O = W
|
||||
src.contents += O;
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/verb/toggle_mode()
|
||||
set name = "Switch Satchel Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The satchel now picks up all ore in a tile at once."
|
||||
if(0)
|
||||
usr << "The satchel now picks up one ore at a time."
|
||||
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "Ore Box"
|
||||
desc = "It's heavy"
|
||||
density = 1
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
src.contents += W;
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
src.contents += W.contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
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_adamantine = 0
|
||||
|
||||
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/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
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_adamantine)
|
||||
dat += text("Adamantine ore: [amt_adamantine]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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()
|
||||
return
|
||||
Reference in New Issue
Block a user