mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 01:53:35 +01:00
Initial Commit for -tg- Mining
I can guarantee this will not compile, very much a WIP and currently consists of mostly copy+pasting -tg-'s modules/mining folder over ours, and unticking a few of our own files.
This commit is contained in:
@@ -74,6 +74,16 @@
|
||||
sideslist = list("heads")
|
||||
credits = 20
|
||||
|
||||
/obj/item/weapon/coin/antagtoken
|
||||
name = "antag token"
|
||||
icon_state = "coin_valid_valid"
|
||||
cmineral = "valid"
|
||||
desc = "A novelty coin that helps the heart know what hard evidence cannot prove."
|
||||
sideslist = list("valid", "salad")
|
||||
value = 20
|
||||
|
||||
/obj/item/weapon/coin/antagtoken/New()
|
||||
return
|
||||
|
||||
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
icon_state = "ore_redemption"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
input_dir = NORTH
|
||||
output_dir = SOUTH
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
req_one_access = list(
|
||||
@@ -15,51 +17,116 @@
|
||||
access_chemistry,
|
||||
access_bar,
|
||||
access_research,
|
||||
access_ce,
|
||||
access_virology
|
||||
access_ce
|
||||
)
|
||||
var/datum/materials/materials = new
|
||||
var/stack_amt = 50; //amount to stack before releasing
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/points = 0
|
||||
var/ore_pickup_rate = 15
|
||||
var/sheet_per_ore = 1
|
||||
var/point_upgrade = 1
|
||||
var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("gold" = 20), ("silver" = 20), ("uranium" = 20), ("bananium" = 30), ("diamond" = 40), ("plasma" = 40))
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/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
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/ore_redemption(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
component_parts += new /obj/item/device/assembly/igniter(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/RefreshParts()
|
||||
var/ore_pickup_rate_temp = 15
|
||||
var/point_upgrade_temp = 1
|
||||
var/sheet_per_ore_temp = 1
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
sheet_per_ore_temp = B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
ore_pickup_rate_temp = 15 * M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts)
|
||||
point_upgrade_temp = L.rating
|
||||
ore_pickup_rate = ore_pickup_rate_temp
|
||||
point_upgrade = point_upgrade_temp
|
||||
sheet_per_ore = sheet_per_ore_temp
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/process_sheet(obj/item/weapon/ore/O)
|
||||
var/obj/item/stack/sheet/processed_sheet = SmeltMineral(O)
|
||||
if(processed_sheet)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
mat.stored += processed_sheet.amount //Stack the sheets
|
||||
O.loc = null //Let the old sheet garbage collect
|
||||
while(mat.stored > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype(output.loc)
|
||||
out.amount = stack_amt-mat.stored
|
||||
mat.stored -= out.amount
|
||||
if(!(processed_sheet in stack_list)) //It's the first of this sheet added
|
||||
var/obj/item/stack/sheet/s = new processed_sheet(src,0)
|
||||
s.amount = 0
|
||||
stack_list[processed_sheet] = s
|
||||
if(s.name != "glass" && s.name != "metal") //we can get these from cargo anyway
|
||||
var/msg = "[capitalize(s.name)] sheets are now available in the Cargo Bay."
|
||||
for(var/obj/machinery/requests_console/D in allConsoles)
|
||||
if(D.department == "Science" || D.department == "Robotics" || D.department == "Research Director's Desk" || (D.department == "Chemistry" && s.name == "uranium"))
|
||||
D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1, 0)
|
||||
var/obj/item/stack/sheet/storage = stack_list[processed_sheet]
|
||||
storage.amount += sheet_per_ore //Stack the sheets
|
||||
O.loc = null //Let the old sheet...
|
||||
qdel(O) //... garbage collect
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/process()
|
||||
var/turf/T = get_turf(input)
|
||||
if(T)
|
||||
var/obj/item/weapon/ore/O
|
||||
for(O in T)
|
||||
process_sheet(O)
|
||||
for(var/obj/structure/ore_box/B in T)
|
||||
for(O in B.contents)
|
||||
process_sheet(O)
|
||||
if(!panel_open) //If the machine is partially dissassembled, it should not process minerals
|
||||
var/turf/T = get_turf(get_step(src, input_dir))
|
||||
var/i
|
||||
if(T)
|
||||
if(locate(/obj/item/weapon/ore) in T)
|
||||
for (i = 0; i < ore_pickup_rate; i++)
|
||||
var/obj/item/weapon/ore/O = locate() in T
|
||||
if(O)
|
||||
process_sheet(O)
|
||||
else
|
||||
break
|
||||
else
|
||||
var/obj/structure/ore_box/B = locate() in T
|
||||
if(B)
|
||||
for (i = 0; i < ore_pickup_rate; i++)
|
||||
var/obj/item/weapon/ore/O = locate() in B.contents
|
||||
if(O)
|
||||
process_sheet(O)
|
||||
else
|
||||
break
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params)
|
||||
if(istype(W,/obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I) && !istype(inserted_id))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
interact(user)
|
||||
return
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
if(default_pry_open(W))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, W))
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
empty_content()
|
||||
default_deconstruction_crowbar(W)
|
||||
return 1
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O)
|
||||
if(O.oretag)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
var/obj/item/stack/sheet/M = new mat.sheettype(src)
|
||||
points += mat.value
|
||||
if(O.refined_type)
|
||||
var/obj/item/stack/sheet/M = O.refined_type
|
||||
points += O.points * point_upgrade
|
||||
return M
|
||||
del(O)//No refined type? Purge it.
|
||||
qdel(O)//No refined type? Purge it.
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/attack_hand(user as mob)
|
||||
@@ -68,9 +135,9 @@
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/interact(mob/user)
|
||||
var/obj/item/stack/sheet/s
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Ore Redemption Machine</b><br><br>")
|
||||
dat += text("This machine only accepts ore. Gibtonite and Slag are not accepted.<br><br>")
|
||||
dat += text("Current unclaimed points: [points]<br>")
|
||||
|
||||
@@ -80,24 +147,31 @@
|
||||
else
|
||||
dat += text("No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>")
|
||||
|
||||
for(var/O in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(O)
|
||||
if(mat.stored > 0)
|
||||
dat += text("[capitalize(mat.processed_name)]: [mat.stored] <A href='?src=\ref[src];release=[mat.id]'>Release</A><br>")
|
||||
for(var/O in stack_list)
|
||||
s = stack_list[O]
|
||||
if(s.amount > 0)
|
||||
if(O == stack_list[1])
|
||||
dat += "<br>" //just looks nicer
|
||||
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>This unit can hold stacks of [stack_amt] sheets of each mineral type.<br><br>")
|
||||
if((/obj/item/stack/sheet/metal in stack_list) && (/obj/item/stack/sheet/mineral/plasma in stack_list))
|
||||
var/obj/item/stack/sheet/metalstack = stack_list[/obj/item/stack/sheet/metal]
|
||||
var/obj/item/stack/sheet/plasmastack = stack_list[/obj/item/stack/sheet/mineral/plasma]
|
||||
if(min(metalstack.amount, plasmastack.amount))
|
||||
dat += text("Plasteel Alloy (Metal + Plasma): <A href='?src=\ref[src];plasteel=1'>Smelt</A><BR>")
|
||||
|
||||
dat += text("<HR><b>Mineral Value List:</b><BR>[get_ore_values()]")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
dat += text("<br><div class='statusDisplay'><b>Mineral Value List:</b><BR>[get_ore_values()]</div>")
|
||||
|
||||
var/datum/browser/popup = new(user, "console_stacking_machine", "Ore Redemption Machine", 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/get_ore_values()
|
||||
var/dat = "<table border='0' width='300'>"
|
||||
for(var/mat_id in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(mat_id)
|
||||
dat += "<tr><td>[capitalize(mat.processed_name)]</td><td>[mat.value]</td></tr>"
|
||||
for(var/ore in ore_values)
|
||||
var/value = ore_values[ore]
|
||||
dat += "<tr><td>[capitalize(ore)]</td><td>[value * point_upgrade]</td></tr>"
|
||||
dat += "</table>"
|
||||
return dat
|
||||
|
||||
@@ -111,35 +185,80 @@
|
||||
inserted_id.verb_pickup()
|
||||
inserted_id = null
|
||||
if(href_list["choice"] == "claim")
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
src << "Points transferred."
|
||||
if(access_mining_station in inserted_id.access)
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
if(href_list["release"] && istype(inserted_id))
|
||||
if(check_access(inserted_id))
|
||||
var/release=href_list["release"]
|
||||
var/datum/material/mat = materials.getMaterial(release)
|
||||
if(!mat) return
|
||||
var/desired = input("How much?","How much [mat.processed_name] to eject?",mat.stored) as num
|
||||
if(desired==0) return
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype()
|
||||
out.amount = min(mat.stored,desired)
|
||||
mat.stored=desired
|
||||
else usr << "<span class='warning'>No valid ID.</span>"
|
||||
if(href_list["release"])
|
||||
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user.
|
||||
if(!(text2path(href_list["release"]) in stack_list)) return
|
||||
var/obj/item/stack/sheet/inp = stack_list[text2path(href_list["release"])]
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
var/desired = input("How much?", "How much to eject?", 1) as num
|
||||
out.amount = min(desired,50,inp.amount)
|
||||
if(out.amount >= 1)
|
||||
inp.amount -= out.amount
|
||||
unload_mineral(out)
|
||||
if(inp.amount < 1)
|
||||
stack_list -= text2path(href_list["release"])
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
if(href_list["plasteel"])
|
||||
if(check_access(inserted_id) || allowed(usr))
|
||||
if(!(/obj/item/stack/sheet/metal in stack_list)) return
|
||||
if(!(/obj/item/stack/sheet/mineral/plasma in stack_list)) return
|
||||
var/obj/item/stack/sheet/metalstack = stack_list[/obj/item/stack/sheet/metal]
|
||||
var/obj/item/stack/sheet/plasmastack = stack_list[/obj/item/stack/sheet/mineral/plasma]
|
||||
|
||||
var/desired = input("How much?", "How much would you like to smelt?", 1) as num
|
||||
var/obj/item/stack/sheet/plasteel/plasteelout = new
|
||||
plasteelout.amount = min(desired,50,metalstack.amount,plasmastack.amount)
|
||||
if(plasteelout.amount >= 1)
|
||||
metalstack.amount -= plasteelout.amount
|
||||
plasmastack.amount -= plasteelout.amount
|
||||
unload_mineral(plasteelout)
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ex_act()
|
||||
return //So some chucklefuck doesn't ruin miners reward with an explosion
|
||||
/obj/machinery/mineral/ore_redemption/ex_act(severity, target)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(severity == 1)
|
||||
if(prob(50))
|
||||
empty_content()
|
||||
qdel(src)
|
||||
else if(severity == 2)
|
||||
if(prob(25))
|
||||
empty_content()
|
||||
qdel(src)
|
||||
|
||||
//empty the redemption machine by stacks of at most max_amount (50 at this time) size
|
||||
/obj/machinery/mineral/ore_redemption/proc/empty_content()
|
||||
var/obj/item/stack/sheet/s
|
||||
|
||||
for(var/O in stack_list)
|
||||
s = stack_list[O]
|
||||
while(s.amount > s.max_amount)
|
||||
new s.type(loc,s.max_amount)
|
||||
s.use(s.max_amount)
|
||||
s.loc = loc
|
||||
s.layer = initial(s.layer)
|
||||
|
||||
/**********************Mining Equipment Locker**************************/
|
||||
|
||||
/obj/machinery/mineral/equipment_locker
|
||||
/obj/machinery/mineral/equipment_vendor
|
||||
name = "mining equipment vendor"
|
||||
desc = "An equipment vendor for miners, points collected at an ore redemption machine can be spent here."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
@@ -148,24 +267,24 @@
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/list/prize_list = list(
|
||||
new /datum/data/mining_equipment("Stimpack MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/stimpack, 50),
|
||||
new /datum/data/mining_equipment("Teporone MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/teporone, 50),
|
||||
new /datum/data/mining_equipment("MediPen Bundle", /obj/item/weapon/storage/box/autoinjector/utility, 200),
|
||||
new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 100),
|
||||
new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150),
|
||||
new /datum/data/mining_equipment("Soap", /obj/item/weapon/soap/nanotrasen, 200),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
new /datum/data/mining_equipment("Advanced Scanner", /obj/item/device/t_scanner/adv_mining_scanner, 300),
|
||||
new /datum/data/mining_equipment("Laser Pointer", /obj/item/device/laser_pointer, 400),
|
||||
new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 450),
|
||||
new /datum/data/mining_equipment("Mining Drone", /mob/living/simple_animal/hostile/mining_drone/, 500),
|
||||
new /datum/data/mining_equipment("Resonator", /obj/item/weapon/resonator, 650),
|
||||
new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 650),
|
||||
new /datum/data/mining_equipment("Sonic Jackhammer", /obj/item/weapon/pickaxe/jackhammer, 800),
|
||||
new /datum/data/mining_equipment("Lazarus Injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide/mining, 2000),
|
||||
new /datum/data/mining_equipment("Space Cash", /obj/item/weapon/spacecash/c1000, 5000),
|
||||
new /datum/data/mining_equipment("Point Card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
new /datum/data/mining_equipment("Stimpack", /obj/item/weapon/reagent_containers/hypospray/autoinjector/stimpack, 50),
|
||||
new /datum/data/mining_equipment("Teporone MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/teporone, 50),
|
||||
new /datum/data/mining_equipment("MediPen Bundle", /obj/item/weapon/storage/box/autoinjector/utility, 200),
|
||||
new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 100),
|
||||
new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150),
|
||||
new /datum/data/mining_equipment("Soap", /obj/item/weapon/soap/nanotrasen, 200),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
new /datum/data/mining_equipment("Laser Pointer", /obj/item/device/laser_pointer, 300),
|
||||
new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 300),
|
||||
new /datum/data/mining_equipment("Advanced Scanner", /obj/item/device/t_scanner/adv_mining_scanner, 400),
|
||||
new /datum/data/mining_equipment("Mining Drone", /mob/living/simple_animal/hostile/mining_drone, 500),
|
||||
new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 750),
|
||||
new /datum/data/mining_equipment("Resonator", /obj/item/weapon/resonator, 800),
|
||||
new /datum/data/mining_equipment("Lazarus Injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Diamond Pickaxe", /obj/item/weapon/pickaxe/diamond, 1200),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide/mining, 1500),
|
||||
new /datum/data/mining_equipment("Space Cash", /obj/item/stack/spacecash/c1000, 2000),
|
||||
new /datum/data/mining_equipment("Point Transfer Card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
)
|
||||
|
||||
|
||||
@@ -174,17 +293,22 @@
|
||||
var/equipment_path = null
|
||||
var/cost = 0
|
||||
|
||||
/datum/data/mining_equipment/New(name, path, cost)
|
||||
src.equipment_name = name
|
||||
src.equipment_path = path
|
||||
src.cost = cost
|
||||
/obj/machinery/mineral/equipment_vendor/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mining_equipment_vendor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/interact(mob/user)
|
||||
/obj/machinery/mineral/equipment_vendor/interact(mob/user)
|
||||
var/dat
|
||||
dat +="<div class='statusDisplay'>"
|
||||
if(istype(inserted_id))
|
||||
@@ -192,15 +316,16 @@
|
||||
else
|
||||
dat += "No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>"
|
||||
dat += "</div>"
|
||||
dat += "<HR><b>Equipment point cost list:</b><BR><table border='0' width='200'>"
|
||||
dat += "<br><b>Equipment point cost list:</b><BR><table border='0' width='200'>"
|
||||
for(var/datum/data/mining_equipment/prize in prize_list)
|
||||
dat += "<tr><td>[prize.equipment_name]</td><td>[prize.cost]</td><td><A href='?src=\ref[src];purchase=\ref[prize]'>Purchase</A></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
user << browse("[dat]", "window=mining_equipment_locker")
|
||||
var/datum/browser/popup = new(user, "miningvendor", "Mining Equipment Vendor", 400, 350)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/Topic(href, href_list)
|
||||
/obj/machinery/mineral/equipment_vendor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["choice"])
|
||||
@@ -212,10 +337,11 @@
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
else usr << "<span class='danger'>No valid ID.</span>"
|
||||
if(href_list["purchase"])
|
||||
if(istype(inserted_id))
|
||||
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
|
||||
@@ -228,38 +354,45 @@
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
/obj/machinery/mineral/equipment_vendor/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/mining_voucher))
|
||||
RedeemVoucher(I, user)
|
||||
return
|
||||
if(istype(I,/obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = usr.get_active_hand()
|
||||
if(istype(C) && !istype(inserted_id))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
C.loc = src
|
||||
inserted_id = C
|
||||
interact(user)
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
default_deconstruction_crowbar(I)
|
||||
return 1
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/proc/RedeemVoucher(voucher, redeemer)
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") in list("Mining Drill", "Kinetic Accelerator", "Mining Drone", "Advanced Scanner", "Cancel")
|
||||
if(!selection || !Adjacent(redeemer))
|
||||
/obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer)
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in list("Kinetic Accelerator", "Resonator", "Mining Drone", "Advanced Scanner")
|
||||
if(!selection || !Adjacent(redeemer) || voucher.gc_destroyed || voucher.loc != redeemer)
|
||||
return
|
||||
switch(selection)
|
||||
if("Mining Drill")
|
||||
new /obj/item/weapon/pickaxe/drill(src.loc)
|
||||
if("Kinetic Accelerator")
|
||||
new /obj/item/weapon/gun/energy/kinetic_accelerator(src.loc)
|
||||
if("Resonator")
|
||||
new /obj/item/weapon/resonator(src.loc)
|
||||
if("Mining Drone")
|
||||
new /mob/living/simple_animal/hostile/mining_drone(src.loc)
|
||||
new /obj/item/weapon/weldingtool/hugetank(src.loc)
|
||||
if("Advanced Scanner")
|
||||
new /obj/item/device/t_scanner/adv_mining_scanner(src.loc)
|
||||
if("Cancel")
|
||||
return
|
||||
del(voucher)
|
||||
qdel(voucher)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/ex_act(severity)
|
||||
/obj/machinery/mineral/equipment_vendor/ex_act(severity, target)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -324,7 +457,7 @@
|
||||
var/list/L = list()
|
||||
for(var/obj/item/device/radio/beacon/B in world)
|
||||
var/turf/T = get_turf(B)
|
||||
if((T.z in config.station_levels))
|
||||
if(T.z == ZLEVEL_STATION)
|
||||
L += B
|
||||
if(!L.len)
|
||||
user << "<span class='notice'>The [src.name] failed to create a wormhole.</span>"
|
||||
@@ -334,7 +467,7 @@
|
||||
J.target = chosen_beacon
|
||||
try_move_adjacent(J)
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/portal/wormhole/jaunt_tunnel
|
||||
name = "jaunt tunnel"
|
||||
@@ -346,19 +479,20 @@
|
||||
if(istype(M, /obj/effect))
|
||||
return
|
||||
if(istype(M, /atom/movable))
|
||||
do_teleport(M, target, 6)
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Weaken(3)
|
||||
if(ishuman(L))
|
||||
shake_camera(L, 20, 1)
|
||||
spawn(20)
|
||||
L.visible_message("<span class='danger'>[L.name] vomits from travelling through the [src.name]!</span>")
|
||||
L.nutrition -= 20
|
||||
L.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(L)
|
||||
T.add_vomit_floor(L)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, 1)
|
||||
if(do_teleport(M, target, 6))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Weaken(3)
|
||||
if(ishuman(L))
|
||||
shake_camera(L, 20, 1)
|
||||
spawn(20)
|
||||
if(L)
|
||||
L.visible_message("<span class='danger'>[L.name] vomits from travelling through the [src.name]!</span>", "<span class='userdanger'>You throw up from travelling through the [src.name]!</span>")
|
||||
L.nutrition -= 20
|
||||
L.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(L)
|
||||
T.add_vomit_floor(L)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, 1)
|
||||
|
||||
/**********************Resonator**********************/
|
||||
|
||||
@@ -369,27 +503,35 @@
|
||||
item_state = "resonator"
|
||||
desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in a vaccuum."
|
||||
w_class = 3
|
||||
force = 10
|
||||
force = 8
|
||||
throwforce = 10
|
||||
var/cooldown = 0
|
||||
var/fieldsactive = 0
|
||||
var/burst_time = 50
|
||||
var/fieldlimit = 3
|
||||
|
||||
/obj/item/weapon/resonator/proc/CreateResonance(var/target, var/creator)
|
||||
if(cooldown <= 0)
|
||||
var/turf/T = get_turf(target)
|
||||
if(locate(/obj/effect/resonance) in T)
|
||||
return
|
||||
if(fieldsactive < fieldlimit)
|
||||
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
|
||||
var/obj/effect/resonance/R = new /obj/effect/resonance(get_turf(target))
|
||||
R.creator = creator
|
||||
cooldown = 1
|
||||
spawn(20)
|
||||
cooldown = 0
|
||||
new /obj/effect/resonance(T, creator, burst_time)
|
||||
fieldsactive++
|
||||
spawn(burst_time)
|
||||
fieldsactive--
|
||||
|
||||
/obj/item/weapon/resonator/attack_self(mob/user as mob)
|
||||
CreateResonance(src, user)
|
||||
..()
|
||||
if(burst_time == 50)
|
||||
burst_time = 30
|
||||
user << "<span class='info'>You set the resonator's fields to detonate after 3 seconds.</span>"
|
||||
else
|
||||
burst_time = 50
|
||||
user << "<span class='info'>You set the resonator's fields to detonate after 5 seconds.</span>"
|
||||
|
||||
/obj/item/weapon/resonator/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(target in user.contents)
|
||||
return
|
||||
if(proximity_flag)
|
||||
if(!check_allowed_items(target, 1)) return
|
||||
CreateResonance(target, user)
|
||||
|
||||
/obj/effect/resonance
|
||||
@@ -400,36 +542,35 @@
|
||||
layer = 4.1
|
||||
mouse_opacity = 0
|
||||
var/resonance_damage = 20
|
||||
var/creator = null
|
||||
|
||||
/obj/effect/resonance/New()
|
||||
/obj/effect/resonance/New(loc, var/creator = null, var/timetoburst)
|
||||
var/turf/proj_turf = get_turf(src)
|
||||
if(!istype(proj_turf))
|
||||
return
|
||||
if(istype(proj_turf, /turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = proj_turf
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
M.GetDrilled()
|
||||
spawn(5)
|
||||
del(src)
|
||||
spawn(timetoburst)
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
M.gets_drilled(creator)
|
||||
qdel(src)
|
||||
else
|
||||
var/datum/gas_mixture/environment = proj_turf.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
if(pressure < 50)
|
||||
name = "strong resonance field"
|
||||
resonance_damage = 45
|
||||
spawn(50)
|
||||
resonance_damage = 50
|
||||
spawn(timetoburst)
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
if(creator)
|
||||
for(var/mob/living/L in src.loc)
|
||||
add_logs(L, creator, "used a resonator field on", object="resonator")
|
||||
add_logs(creator, L, "used a resonator field on", object="resonator")
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
else
|
||||
for(var/mob/living/L in src.loc)
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/**********************Facehugger toy**********************/
|
||||
|
||||
@@ -438,6 +579,7 @@
|
||||
throwforce = 0
|
||||
real = 0
|
||||
sterile = 1
|
||||
tint = 3 //Makes it feel more authentic when it latches on
|
||||
|
||||
/obj/item/clothing/mask/facehugger/toy/Die()
|
||||
return
|
||||
@@ -445,7 +587,7 @@
|
||||
|
||||
/**********************Mining drone**********************/
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/
|
||||
/mob/living/simple_animal/hostile/mining_drone
|
||||
name = "nanotrasen minebot"
|
||||
desc = "The instructions printed on the side read: This is a small robot used to support miners, can be set to search and collect loose ore, or to help fend off wildlife. A mining scanner can instruct it to drop loose ore. Field repairs can be done with a welder."
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
@@ -456,14 +598,7 @@
|
||||
mouse_opacity = 1
|
||||
faction = list("neutral")
|
||||
a_intent = "harm"
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
|
||||
minbodytemp = 0
|
||||
wander = 0
|
||||
idle_vision_range = 5
|
||||
@@ -482,7 +617,10 @@
|
||||
ranged_cooldown_cap = 3
|
||||
projectiletype = /obj/item/projectile/kinetic
|
||||
projectilesound = 'sound/weapons/Gunshot4.ogg'
|
||||
wanted_objects = list(/obj/item/weapon/ore)
|
||||
speak_emote = list("states")
|
||||
wanted_objects = list(/obj/item/weapon/ore/diamond, /obj/item/weapon/ore/gold, /obj/item/weapon/ore/silver,
|
||||
/obj/item/weapon/ore/plasma, /obj/item/weapon/ore/uranium, /obj/item/weapon/ore/iron,
|
||||
/obj/item/weapon/ore/bananium)
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
@@ -503,12 +641,12 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/Die()
|
||||
/mob/living/simple_animal/hostile/mining_drone/death()
|
||||
..()
|
||||
visible_message("<span class='danger'>[src] is destroyed!</span>")
|
||||
new /obj/effect/decal/remains/robot(src.loc)
|
||||
new /obj/effect/decal/cleanable/robot_debris(src.loc)
|
||||
DropOre()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/New()
|
||||
@@ -633,6 +771,7 @@
|
||||
user << "<span class='info'>The display on [src] seems to be flickering.</span>"
|
||||
|
||||
/**********************Mining Scanner**********************/
|
||||
|
||||
/obj/item/device/mining_scanner
|
||||
desc = "A scanner that checks surrounding rock for useful minerals, it can also be used to stop gibtonite detonations. Requires you to wear mesons to work properly."
|
||||
name = "mining scanner"
|
||||
@@ -650,23 +789,9 @@
|
||||
cooldown = 1
|
||||
spawn(40)
|
||||
cooldown = 0
|
||||
var/client/C = user.client
|
||||
var/list/L = list()
|
||||
var/turf/simulated/mineral/M
|
||||
for(M in range(7, user))
|
||||
if(M.scan_state)
|
||||
L += M
|
||||
if(!L.len)
|
||||
user << "<span class='info'>[src] reports that nothing was detected nearby.</span>"
|
||||
return
|
||||
else
|
||||
for(M in L)
|
||||
var/turf/T = get_turf(M)
|
||||
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
var/list/mobs = list()
|
||||
mobs |= user
|
||||
mineral_scan_pulse(mobs, get_turf(user))
|
||||
|
||||
|
||||
//Debug item to identify all ore spread quickly
|
||||
@@ -676,7 +801,7 @@
|
||||
for(var/turf/simulated/mineral/M in world)
|
||||
if(M.scan_state)
|
||||
M.icon_state = M.scan_state
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Requires you to wear mesons to function properly."
|
||||
@@ -691,28 +816,30 @@
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/scan()
|
||||
if(!cooldown)
|
||||
cooldown = 1
|
||||
spawn(80)
|
||||
spawn(35)
|
||||
cooldown = 0
|
||||
var/turf/t = get_turf(src)
|
||||
var/list/mobs = recursive_mob_check(t, 1,0,0)
|
||||
if(!mobs.len)
|
||||
return
|
||||
var/list/L = list()
|
||||
var/turf/simulated/mineral/M
|
||||
for(M in range(7, t))
|
||||
if(M.scan_state)
|
||||
L += M
|
||||
if(L.len)
|
||||
for(var/mob/user in mobs)
|
||||
if(user.client)
|
||||
var/client/C = user.client
|
||||
for(M in L)
|
||||
var/turf/T = get_turf(M)
|
||||
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
mineral_scan_pulse(mobs, t)
|
||||
|
||||
/proc/mineral_scan_pulse(list/mobs, turf/T, range = world.view)
|
||||
var/list/minerals = list()
|
||||
for(var/turf/simulated/mineral/M in range(range, T))
|
||||
if(M.scan_state)
|
||||
minerals += M
|
||||
if(minerals.len)
|
||||
for(var/mob/user in mobs)
|
||||
if(user.client)
|
||||
var/client/C = user.client
|
||||
for(var/turf/simulated/mineral/M in minerals)
|
||||
var/turf/F = get_turf(M)
|
||||
var/image/I = image('icons/turf/mining.dmi', loc = F, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
|
||||
/**********************Xeno Warning Sign**********************/
|
||||
/obj/structure/sign/xeno_warning_mining
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
/turf/simulated/mineral/random/labormineral
|
||||
mineralSpawnChanceList = list("Uranium" = 1, "Iron" = 100, "Diamond" = 1, "Gold" = 1, "Silver" = 1, "Plasma" = 1/*, "Adamantine" =5, "Cave" = 1 */) //Don't suffocate the prisoners with caves
|
||||
mineralSpawnChanceList = list("Uranium" = 1, "Iron" = 100, "Diamond" = 1, "Gold" = 1, "Silver" = 1, "Plasma" = 1)
|
||||
|
||||
/turf/simulated/mineral/random/labormineral/New()
|
||||
icon_state = "rock"
|
||||
..()
|
||||
@@ -16,4 +16,14 @@
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral
|
||||
var/input_dir = NORTH
|
||||
var/output_dir = SOUTH
|
||||
|
||||
/obj/machinery/mineral/proc/unload_mineral(var/atom/movable/S)
|
||||
S.loc = loc
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
if(T)
|
||||
S.loc = T
|
||||
@@ -6,92 +6,165 @@
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
var/show_all_ores = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/New()
|
||||
..()
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
|
||||
if (machine)
|
||||
machine.console = src
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/interact(mob/user)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<h1>Ore processor console</h1>"
|
||||
|
||||
dat += "<hr><table>"
|
||||
|
||||
for(var/ore in machine.ores_processing)
|
||||
|
||||
if(!machine.ores_stored[ore] && !show_all_ores) continue
|
||||
|
||||
dat += "<tr><td width = 40><b>[capitalize(ore)]</b></td><td width = 30>[machine.ores_stored[ore]]</td><td width = 100><font color='"
|
||||
if(machine.ores_processing[ore])
|
||||
switch(machine.ores_processing[ore])
|
||||
if(0)
|
||||
dat += "red'>not processing"
|
||||
if(1)
|
||||
dat += "orange'>smelting"
|
||||
if(2)
|
||||
dat += "blue'>compressing"
|
||||
if(3)
|
||||
dat += "gray'>alloying"
|
||||
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
|
||||
dat += "red'>not processing"
|
||||
dat += "</font>.</td><td width = 30><a href='?src=\ref[src];toggle_smelting=[ore]'>\[change\]</a></td></tr>"
|
||||
machine.selected_iron = 0
|
||||
|
||||
dat += "</table><hr>"
|
||||
dat += "Currently displaying [show_all_ores ? "all ore types" : "only available ore types"]. <A href='?src=\ref[src];toggle_ores=1'>\[[show_all_ores ? "show less" : "show more"]\]</a></br>"
|
||||
dat += "The ore processor is currently <A href='?src=\ref[src];toggle_power=1'>[(machine.active ? "<font color='green'>processing</font>" : "<font color='red'>disabled</font>")]</a>."
|
||||
user << browse(dat, "window=processor_console;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
//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
|
||||
|
||||
|
||||
//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.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if(href_list["toggle_smelting"])
|
||||
|
||||
var/choice = input("What setting do you wish to use for processing [href_list["toggle_smelting"]]?") as null|anything in list("Smelting","Compressing","Alloying","Nothing")
|
||||
if(!choice) return
|
||||
|
||||
switch(choice)
|
||||
if("Nothing") choice = 0
|
||||
if("Smelting") choice = 1
|
||||
if("Compressing") choice = 2
|
||||
if("Alloying") choice = 3
|
||||
|
||||
machine.ores_processing[href_list["toggle_smelting"]] = choice
|
||||
|
||||
if(href_list["toggle_power"])
|
||||
|
||||
machine.active = !machine.active
|
||||
|
||||
if(href_list["toggle_ores"])
|
||||
|
||||
show_all_ores = !show_all_ores
|
||||
|
||||
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["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -99,136 +172,223 @@
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable plasma...
|
||||
name = "furnace"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1
|
||||
light_range = 3
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/obj/machinery/mineral/console = null
|
||||
var/sheets_per_tick = 10
|
||||
var/list/ores_processing[0]
|
||||
var/list/ores_stored[0]
|
||||
var/list/ore_data[0]
|
||||
var/list/alloy_data[0]
|
||||
var/active = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
|
||||
..()
|
||||
|
||||
//TODO: Ore and alloy global storage datum.
|
||||
for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
|
||||
alloy_data += new alloytype()
|
||||
|
||||
for(var/oretype in typesof(/datum/ore)-/datum/ore)
|
||||
var/datum/ore/OD = new oretype()
|
||||
ore_data[OD.oretag] = OD
|
||||
ores_processing[OD.oretag] = 0
|
||||
ores_stored[OD.oretag] = 0
|
||||
|
||||
//Locate our output and input machinery.
|
||||
spawn(5)
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
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/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
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)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
generate_mineral(/obj/item/stack/sheet/glass)
|
||||
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)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
generate_mineral(/obj/item/stack/sheet/rglass)
|
||||
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)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/gold)
|
||||
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)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/silver)
|
||||
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)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/diamond)
|
||||
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)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/plasma)
|
||||
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)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/uranium)
|
||||
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)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
generate_mineral(/obj/item/stack/sheet/metal)
|
||||
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)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
generate_mineral(/obj/item/stack/sheet/plasteel)
|
||||
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)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/bananium)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
|
||||
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
|
||||
/*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_uranium >= 2 && ore_diamond >= 1)
|
||||
ore_uranium -= 2
|
||||
ore_diamond -= 1
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/adamantine)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_silver >= 1 && ore_plasma >= 3)
|
||||
ore_silver -= 1
|
||||
ore_plasma -= 3
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
|
||||
else
|
||||
on = 0
|
||||
continue*/
|
||||
|
||||
if (!src.output || !src.input) return
|
||||
|
||||
var/list/tick_alloys = list()
|
||||
//if a non valid combination is selected
|
||||
|
||||
//Grab some more ore to process this tick.
|
||||
for(var/i = 0,i<sheets_per_tick,i++)
|
||||
var/obj/item/weapon/ore/O = locate() in input.loc
|
||||
if(!O) break
|
||||
if(!isnull(ores_stored[O.oretag])) ores_stored[O.oretag]++
|
||||
O.loc = null
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if(!active)
|
||||
return
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
//Process our stored ores and spit out sheets.
|
||||
var/sheets = 0
|
||||
for(var/metal in ores_stored)
|
||||
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(sheets >= sheets_per_tick) break
|
||||
|
||||
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
|
||||
|
||||
var/datum/ore/O = ore_data[metal]
|
||||
|
||||
if(!O) continue
|
||||
|
||||
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
|
||||
|
||||
for(var/datum/alloy/A in alloy_data)
|
||||
|
||||
if(A.metaltag in tick_alloys)
|
||||
continue
|
||||
|
||||
tick_alloys += A.metaltag
|
||||
var/enough_metal
|
||||
|
||||
if(!isnull(A.requires[metal]) && ores_stored[metal] >= A.requires[metal]) //We have enough of our first metal, we're off to a good start.
|
||||
|
||||
enough_metal = 1
|
||||
|
||||
for(var/needs_metal in A.requires)
|
||||
//Check if we're alloying the needed metal and have it stored.
|
||||
if(ores_processing[needs_metal] != 3 || ores_stored[needs_metal] < A.requires[needs_metal])
|
||||
enough_metal = 0
|
||||
break
|
||||
|
||||
if(!enough_metal)
|
||||
continue
|
||||
else
|
||||
var/total
|
||||
for(var/needs_metal in A.requires)
|
||||
ores_stored[needs_metal] -= A.requires[needs_metal]
|
||||
total += A.requires[needs_metal]
|
||||
total = max(1,round(total*A.product_mod)) //Always get at least one sheet.
|
||||
sheets += total-1
|
||||
|
||||
for(var/i=0,i<total,i++)
|
||||
new A.product(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 2 && O.compresses_to) //Compressing.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(can_make%2>0) can_make--
|
||||
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i+=2)
|
||||
ores_stored[metal]-=2
|
||||
sheets+=2
|
||||
new O.compresses_to(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 1 && O.smelts_to) //Smelting.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i++)
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new O.smelts_to(output.loc)
|
||||
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--
|
||||
generate_mineral(/obj/item/weapon/ore/slag)
|
||||
on = 0
|
||||
else
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
else
|
||||
continue
|
||||
break
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
if(T)
|
||||
var/n = 0
|
||||
for(var/obj/item/O in T)
|
||||
n++
|
||||
if(n>10)
|
||||
break
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
ore_iron++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/bananium))
|
||||
ore_clown++
|
||||
O.loc = null
|
||||
continue
|
||||
unload_mineral(O)
|
||||
|
||||
console.updateUsrDialog()
|
||||
/obj/machinery/mineral/processing_unit/proc/generate_mineral(var/P)
|
||||
var/O = new P(src)
|
||||
unload_mineral(O)
|
||||
@@ -4,62 +4,53 @@
|
||||
name = "stacking machine console"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
density = 0
|
||||
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
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/obj/item/stack/sheet/s
|
||||
var/dat
|
||||
|
||||
dat += text("<h1>Stacking unit console</h1><hr><table>")
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
for(var/stacktype in machine.stack_storage)
|
||||
if(machine.stack_storage[stacktype] > 0)
|
||||
dat += "<tr><td width = 150><b>[capitalize(stacktype)]:</b></td><td width = 30>[machine.stack_storage[stacktype]]</td><td width = 50><A href='?src=\ref[src];release_stack=[stacktype]'>\[release\]</a></td></tr>"
|
||||
dat += "</table><hr>"
|
||||
dat += text("<br>Stacking: [machine.stack_amt] <A href='?src=\ref[src];change_stack=1'>\[change\]</a><br><br>")
|
||||
for(var/O in machine.stack_list)
|
||||
s = machine.stack_list[O]
|
||||
if(s.amount > 0)
|
||||
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
onclose(user, "console_stacking_machine")
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["change_stack"])
|
||||
var/choice = input("What would you like to set the stack amount to?") as null|anything in list(1,5,10,20,50)
|
||||
if(!choice) return
|
||||
machine.stack_amt = choice
|
||||
|
||||
if(href_list["release_stack"])
|
||||
if(machine.stack_storage[href_list["release_stack"]] > 0)
|
||||
var/stacktype = machine.stack_paths[href_list["release_stack"]]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(machine.output))
|
||||
S.amount = machine.stack_storage[href_list["release_stack"]]
|
||||
machine.stack_storage[href_list["release_stack"]] = 0
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
if(href_list["release"])
|
||||
if(!(text2path(href_list["release"]) in machine.stack_list)) return //someone tried to spawn materials by spoofing hrefs
|
||||
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = inp.amount
|
||||
inp.amount = 0
|
||||
machine.unload_mineral(out)
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
@@ -71,61 +62,31 @@
|
||||
icon_state = "stacker"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/stacking_unit_console/console
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/list/stack_storage[0]
|
||||
var/list/stack_paths[0]
|
||||
var/stack_amt = 50; // Amount to stack before releassing
|
||||
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
input_dir = EAST
|
||||
output_dir = WEST
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
|
||||
for(var/stacktype in typesof(/obj/item/stack/sheet/mineral)-/obj/item/stack/sheet/mineral)
|
||||
var/obj/item/stack/S = new stacktype(src)
|
||||
stack_storage[S.name] = 0
|
||||
stack_paths[S.name] = stacktype
|
||||
del(S)
|
||||
|
||||
stack_storage["glass"] = 0
|
||||
stack_paths["glass"] = /obj/item/stack/sheet/glass
|
||||
stack_storage["metal"] = 0
|
||||
stack_paths["metal"] = /obj/item/stack/sheet/metal
|
||||
stack_storage["plasteel"] = 0
|
||||
stack_paths["plasteel"] = /obj/item/stack/sheet/plasteel
|
||||
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
||||
var/obj/item/stack/sheet/s = new inp.type(src,0)
|
||||
s.amount = 0
|
||||
stack_list[inp.type] = s
|
||||
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
||||
storage.amount += inp.amount //Stack the sheets
|
||||
inp.loc = null //Let the old sheet garbage collect
|
||||
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = stack_amt
|
||||
unload_mineral(out)
|
||||
storage.amount -= stack_amt
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/turf/T = get_turf(input)
|
||||
for(var/obj/item/O in T.contents)
|
||||
if(!O) return
|
||||
if(istype(O,/obj/item/stack))
|
||||
if(!isnull(stack_storage[O.name]))
|
||||
stack_storage[O.name]++
|
||||
O.loc = null
|
||||
else
|
||||
O.loc = output.loc
|
||||
else
|
||||
O.loc = output.loc
|
||||
|
||||
//Output amounts that are past stack_amt.
|
||||
for(var/sheet in stack_storage)
|
||||
if(stack_storage[sheet] >= stack_amt)
|
||||
var/stacktype = stack_paths[sheet]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
|
||||
S.amount = stack_amt
|
||||
stack_storage[sheet] -= stack_amt
|
||||
|
||||
console.updateUsrDialog()
|
||||
return
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
if(T)
|
||||
for(var/obj/item/stack/sheet/S in T)
|
||||
process_sheet(S)
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
input_dir = WEST
|
||||
output_dir = EAST
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
|
||||
@@ -6,11 +6,25 @@
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
always_unpowered = 1
|
||||
requires_power = 1
|
||||
poweralm = 0
|
||||
power_environ = 0
|
||||
power_equip = 0
|
||||
power_light = 0
|
||||
ambientsounds = list('sound/ambience/ambimine.ogg')
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
always_unpowered = 1
|
||||
requires_power = 1
|
||||
poweralm = 0
|
||||
power_environ = 0
|
||||
power_equip = 0
|
||||
power_light = 0
|
||||
ambientsounds = list('sound/ambience/ambimine.ogg')
|
||||
|
||||
/area/mine/lobby
|
||||
|
||||
@@ -68,96 +68,76 @@
|
||||
|
||||
var/excavation_amount = 100
|
||||
|
||||
proc/playDigSound()
|
||||
/obj/item/weapon/pickaxe/proc/playDigSound()
|
||||
playsound(src, pick(digsound),20,1)
|
||||
|
||||
hammer
|
||||
name = "sledgehammer"
|
||||
//icon_state = "sledgehammer" Waiting on sprite
|
||||
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
|
||||
/obj/item/weapon/pickaxe/diamond
|
||||
name = "diamond-tipped pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 20 //mines twice as fast as a normal pickaxe, bought from mining vendor
|
||||
origin_tech = "materials=4;engineering=3"
|
||||
desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt."
|
||||
|
||||
silver
|
||||
name = "silver pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/obj/item/weapon/pickaxe/drill
|
||||
name = "mining drill"
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 25 //available from roundstart, faster than a pickaxe.
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "An electric mining drill for the especially scrawny."
|
||||
|
||||
drill
|
||||
name = "mining drill" // Can dig sand as well!
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 30
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
/obj/item/weapon/pickaxe/drill/cyborg
|
||||
name = "cyborg mining drill"
|
||||
desc = "An integrated electric mining drill."
|
||||
flags = NODROP
|
||||
|
||||
jackhammer
|
||||
name = "sonic jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15 //faster than drill, but cannot dig
|
||||
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
digsound = list('sound/weapons/sonic_jackhammer.ogg')
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
|
||||
/obj/item/weapon/pickaxe/drill/diamonddrill
|
||||
name = "diamond-tipped mining drill"
|
||||
icon_state = "diamonddrill"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
gold
|
||||
name = "golden pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/obj/item/weapon/pickaxe/diamonddrill/traitor //Pocket-sized traitor diamond drill.
|
||||
name = "supermatter drill"
|
||||
icon_state = "smdrill"
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5;syndicate=3"
|
||||
desc = "Microscopic supermatter crystals cover the head of this tiny drill."
|
||||
w_class = 2.0
|
||||
|
||||
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
|
||||
hitsound = 'sound/weapons/plasma_cutter.ogg'
|
||||
digsound = list('sound/weapons/plasma_cutter.ogg')
|
||||
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."
|
||||
/obj/item/weapon/pickaxe/drill/cyborg/diamond //This is the BORG version!
|
||||
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP flag, and easier to change borg specific drill mechanics.
|
||||
icon_state = "diamonddrill"
|
||||
digspeed = 10
|
||||
|
||||
diamond
|
||||
name = "diamond pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;engineering=4"
|
||||
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
|
||||
/obj/item/weapon/pickaxe/drill/jackhammer
|
||||
name = "sonic jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 5 //the epitome of powertools. extremely fast mining, laughs at puny walls
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
digsound = list('sound/weapons/sonic_jackhammer.ogg')
|
||||
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
|
||||
|
||||
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
|
||||
name = "diamond mining drill"
|
||||
icon_state = "diamonddrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 5 //Digs through walls, girders, and can dig up sand
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
traitor //Pocket-sized traitor diamond drill.
|
||||
name = "supermatter drill"
|
||||
icon_state = "smdrill"
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5;syndicate=3"
|
||||
desc = "Microscopic supermatter crystals cover the head of this tiny drill."
|
||||
w_class = 2.0
|
||||
|
||||
borgdrill
|
||||
name = "cyborg mining drill"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
desc = ""
|
||||
/obj/item/weapon/pickaxe/silver
|
||||
name = "silver pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
/obj/item/weapon/pickaxe/gold
|
||||
name = "golden pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
|
||||
+431
-455
File diff suppressed because it is too large
Load Diff
+119
-137
@@ -7,8 +7,6 @@
|
||||
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
|
||||
@@ -16,65 +14,48 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
var/amt_mythril = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
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/mineral/gold))
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
if(T)
|
||||
for(var/obj/item/stack/sheet/O in T)
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/silver))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/plasma))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/clown))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/bananium))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/adamantine))
|
||||
amt_adamantine += 100 * O.amount
|
||||
O.loc = null //Commented out for now. -Durandan
|
||||
return
|
||||
|
||||
|
||||
/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")
|
||||
@@ -111,6 +92,11 @@
|
||||
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.")
|
||||
@@ -131,105 +117,101 @@
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
usr << "<span class='notice'>The machine is processing.</span>"
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 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);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/iron)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/gold)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/silver)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/diamond)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/plasma)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/uranium)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/clown)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("adamantine")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/adamantine)
|
||||
amt_adamantine -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("mythril")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/mythril)
|
||||
amt_mythril -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/mint/proc/create_coins(var/P)
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
if(T)
|
||||
var/obj/item/O = new P(src)
|
||||
var/obj/item/weapon/moneybag/M = locate(/obj/item/weapon/moneybag/, T)
|
||||
if(!M)
|
||||
M = new /obj/item/weapon/moneybag(src)
|
||||
unload_mineral(M)
|
||||
O.loc = M
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "moneybag"
|
||||
flags = CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
throwforce = 0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
@@ -17,6 +17,7 @@
|
||||
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))
|
||||
@@ -33,6 +34,8 @@
|
||||
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)
|
||||
@@ -49,41 +52,23 @@
|
||||
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>")
|
||||
/*
|
||||
var/credits=0
|
||||
var/list/ore=list()
|
||||
for(var/oredata in typesof(/datum/material) - /datum/material)
|
||||
var/datum/material/ore_datum = new oredata
|
||||
ore[ore_datum.id]=ore_datum
|
||||
|
||||
for (var/obj/item/weapon/coin/C in contents)
|
||||
if (istype(C,/obj/item/weapon/coin))
|
||||
var/datum/material/ore_info=ore[C.material]
|
||||
ore_info.stored++
|
||||
ore[C.material]=ore_info
|
||||
credits += C.credits
|
||||
|
||||
var/dat = "<b>The contents of the moneybag reveal...</b><ul>"
|
||||
for(var/ore_id in ore)
|
||||
var/datum/material/ore_info=ore[ore_id]
|
||||
if(ore_info.stored)
|
||||
dat += "<li>[ore_info.processed_name] coins: [ore_info.stored] <A href='?src=\ref[src];remove=[ore_id]'>Remove one</A></li>"
|
||||
dat += "</ul><b>Total haul:</b> $[credits]"
|
||||
*/
|
||||
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, params)
|
||||
..()
|
||||
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()
|
||||
if(!user.drop_item())
|
||||
return
|
||||
user << "<span class='notice'>You add the [C.name] into the bag.</span>"
|
||||
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."
|
||||
user << "<span class='notice'>You empty the [C.name] into the bag.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
@@ -108,13 +93,13 @@
|
||||
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()
|
||||
@@ -124,4 +109,5 @@
|
||||
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/gold(src)
|
||||
new /obj/item/weapon/coin/adamantine(src)
|
||||
+159
-51
@@ -1,94 +1,202 @@
|
||||
/obj/item/weapon/ore
|
||||
name = "rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore2"
|
||||
var/datum/geosample/geologic_data
|
||||
var/oretag
|
||||
icon_state = "ore"
|
||||
var/points = 0 //How many points this ore gets you from the ore redemption machine
|
||||
var/refined_type = null //What this ore defaults to being refined into
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(15))
|
||||
new refined_type(get_turf(src.loc))
|
||||
qdel(src)
|
||||
else if(W.isOn())
|
||||
user << "<span class='info'>Not enough fuel to smelt [src].</span>"
|
||||
..()
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "pitchblende"
|
||||
name = "uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
oretag = "uranium"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/uranium
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "hematite"
|
||||
name = "iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "hematite"
|
||||
|
||||
/obj/item/weapon/ore/coal
|
||||
name = "carbonaceous rock"
|
||||
icon_state = "Iron ore" //TODO
|
||||
origin_tech = "materials=1"
|
||||
oretag = "coal"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/metal
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "impure silicates"
|
||||
name = "sand pile"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "sand"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/glass
|
||||
|
||||
/obj/item/weapon/ore/glass/attack_self(mob/living/user as mob)
|
||||
user << "<span class='notice'>You use the sand to make sandstone.</span>"
|
||||
var/sandAmt = 1
|
||||
for(var/obj/item/weapon/ore/glass/G in user.loc) // The sand on the floor
|
||||
sandAmt += 1
|
||||
qdel(G)
|
||||
while(sandAmt > 0)
|
||||
var/obj/item/stack/sheet/mineral/sandstone/SS = new /obj/item/stack/sheet/mineral/sandstone(user.loc)
|
||||
if(sandAmt >= SS.max_amount)
|
||||
SS.amount = SS.max_amount
|
||||
else
|
||||
SS.amount = sandAmt
|
||||
for(var/obj/item/stack/sheet/mineral/sandstone/SA in user.loc)
|
||||
if(SA != SS && SA.amount < SA.max_amount)
|
||||
SA.attackby(SS, user) //we try to transfer all old unfinished stacks to the new stack we created.
|
||||
sandAmt -= SS.max_amount
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "plasma crystals"
|
||||
name = "plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
oretag = "plasma"
|
||||
points = 36
|
||||
refined_type = /obj/item/stack/sheet/mineral/plasma
|
||||
|
||||
/obj/item/weapon/ore/plasma/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.welding)
|
||||
user << "<span class='warning'>You can't hit a high enough temperature to smelt [src] properly!</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "native silver ore"
|
||||
name = "silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
oretag = "silver"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/silver
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "native gold ore"
|
||||
name = "gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag = "gold"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/gold
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "diamonds"
|
||||
name = "diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
oretag = "diamond"
|
||||
points = 36
|
||||
refined_type = /obj/item/stack/sheet/mineral/diamond
|
||||
|
||||
/obj/item/weapon/ore/osmium
|
||||
name = "raw platinum"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "platinum"
|
||||
|
||||
/obj/item/weapon/ore/hydrogen
|
||||
name = "raw hydrogen"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "hydrogen"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
/obj/item/weapon/ore/bananium
|
||||
name = "bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag="clown"
|
||||
|
||||
/obj/item/weapon/ore/fabric
|
||||
name = "fabric"
|
||||
icon_state = "fabric"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "fabric"
|
||||
points = 27
|
||||
refined_type = /obj/item/stack/sheet/mineral/bananium
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
name = "slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
oretag = "slag"
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite
|
||||
name = "gibtonite ore"
|
||||
desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "Gibtonite ore"
|
||||
item_state = "Gibtonite ore"
|
||||
w_class = 4
|
||||
throw_range = 0
|
||||
anchored = 1 //Forces people to carry it by hand, no pulling!
|
||||
var/primed = 0
|
||||
var/det_time = 100
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/attacher = "UNKNOWN"
|
||||
var/datum/wires/explosive/gibtonite/wires
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
|
||||
if(!wires && istype(I, /obj/item/device/assembly/igniter))
|
||||
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
|
||||
wires = new(src)
|
||||
attacher = key_name(user)
|
||||
qdel(I)
|
||||
overlays += "Gibtonite_igniter"
|
||||
return
|
||||
|
||||
if(wires && !primed)
|
||||
if(istype(I, /obj/item/weapon/wirecutters) || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler))
|
||||
wires.Interact(user)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/pickaxe) || istype(I, /obj/item/weapon/resonator) || I.force >= 10)
|
||||
GibtoniteReaction(user)
|
||||
return
|
||||
if(primed)
|
||||
if(istype(I, /obj/item/device/mining_scanner) || istype(I, /obj/item/device/t_scanner/adv_mining_scanner) || istype(I, /obj/item/device/multitool))
|
||||
primed = 0
|
||||
user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attack_self(user)
|
||||
if(wires)
|
||||
wires.Interact(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/bullet_act(var/obj/item/projectile/P)
|
||||
GibtoniteReaction(P.firer)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/ex_act()
|
||||
GibtoniteReaction(null, 1)
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
||||
if(!primed)
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/notify_admins = 0
|
||||
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
||||
notify_admins = 1
|
||||
|
||||
if(notify_admins)
|
||||
if(triggered_by == 1)
|
||||
message_admins("An explosion has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
else if(triggered_by == 2)
|
||||
message_admins("A signal has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>. Igniter attacher: [key_name_admin(attacher)]<A HREF='?_src_=holder;adminmoreinfo=\ref[attacher]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[attacher]'>FLW</A>)")
|
||||
else
|
||||
message_admins("[key_name_admin(user)]<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
if(triggered_by == 1)
|
||||
log_game("An explosion has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
else if(triggered_by == 2)
|
||||
log_game("A signal has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z]). Igniter attacher: [key_name(attacher)].")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes \the [src], causing a chain reaction!</span>", "<span class='danger'>You strike \the [src], causing a chain reaction.</span>")
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
spawn(det_time)
|
||||
if(primed)
|
||||
if(quality == 3)
|
||||
explosion(src.loc,2,4,9,adminlog = notify_admins)
|
||||
if(quality == 2)
|
||||
explosion(src.loc,1,2,5,adminlog = notify_admins)
|
||||
if(quality == 1)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
if(src.z == ZLEVEL_ASTEROID) score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
if(src.z == ZLEVEL_ASTEROID)
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
else
|
||||
return ..()
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
return
|
||||
|
||||
@@ -4,9 +4,25 @@
|
||||
/obj/structure/ore_box
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "orebox0"
|
||||
name = "Ore Box"
|
||||
desc = "A heavy box used for storing ore."
|
||||
name = "ore box"
|
||||
desc = "A heavy wooden box, which can be filled with a lot of ores."
|
||||
density = 1
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
W.loc = src
|
||||
if (istype(W, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = W
|
||||
S.hide_from(usr)
|
||||
for(var/obj/item/weapon/ore/O in S.contents)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "<span class='notice'>You empty the satchel into the box.</span>"
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
@@ -15,71 +31,64 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_strange = 0
|
||||
var/last_update = 0
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
user.unEquip(W)
|
||||
src.contents += W
|
||||
if (istype(W, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = W
|
||||
S.hide_from(usr)
|
||||
for(var/obj/item/weapon/ore/O in S.contents)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
return
|
||||
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/bananium))
|
||||
amt_clown++;
|
||||
|
||||
/obj/structure/ore_box/examine()
|
||||
set name = "Examine"
|
||||
set category = "IC"
|
||||
set src in view(usr.client) //If it can be seen, it can be examined.
|
||||
|
||||
if (!( usr ))
|
||||
return
|
||||
usr << "That's an [src]."
|
||||
usr << desc
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can check the contents of ore boxes.
|
||||
return
|
||||
|
||||
if(!Adjacent(usr)) //Can only check the contents of ore boxes if you can physically reach them.
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "It is empty."
|
||||
return
|
||||
|
||||
if(world.time > last_update + 10)
|
||||
update_orecount()
|
||||
last_update = world.time
|
||||
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b>")
|
||||
if (amt_iron)
|
||||
dat += text("<br>Metal ore: [amt_iron]")
|
||||
if (amt_glass)
|
||||
dat += text("<br>Sand: [amt_glass]")
|
||||
if (amt_plasma)
|
||||
dat += text("<br>Plasma ore: [amt_plasma]")
|
||||
if (amt_uranium)
|
||||
dat += text("<br>Uranium ore: [amt_uranium]")
|
||||
if (amt_silver)
|
||||
dat += text("<br>Silver ore: [amt_silver]")
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
dat += text("<br>Gold ore: [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("<br>Diamond ore: [amt_diamond]")
|
||||
if (amt_strange)
|
||||
dat += text("<br>Strange rocks: [amt_strange]")
|
||||
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("<br>Bananium ore: [amt_clown]")
|
||||
|
||||
usr << dat
|
||||
dat += text("Bananium ore: [amt_clown]<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.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["removeall"])
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "<span class='notice'>You empty the box.</span>"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
obj/structure/ore_box/ex_act(severity, target)
|
||||
if(prob(100 / severity) && severity < 3)
|
||||
qdel(src) //nothing but ores can get inside unless its a bug and ores just return nothing on ex_act, not point in calling it on them
|
||||
|
||||
|
||||
/obj/structure/ore_box/verb/empty_box()
|
||||
set name = "Empty Ore Box"
|
||||
@@ -87,7 +96,7 @@
|
||||
set src in view(1)
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
|
||||
usr << "\red You are physically incapable of emptying the ore box."
|
||||
usr << "<span class='warning'>You are physically incapable of emptying the ore box.</span>"
|
||||
return
|
||||
|
||||
if( usr.stat || usr.restrained() )
|
||||
@@ -100,58 +109,12 @@
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "\red The ore box is empty"
|
||||
usr << "<span class='warning'>The ore box is empty.</span>"
|
||||
return
|
||||
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "\blue You empty the ore box"
|
||||
usr << "<span class='notice'>You empty the ore box.</span>"
|
||||
|
||||
return
|
||||
|
||||
|
||||
// Updates ore tally
|
||||
/obj/structure/ore_box/proc/update_orecount()
|
||||
amt_iron = 0
|
||||
amt_glass = 0
|
||||
amt_plasma = 0
|
||||
amt_uranium = 0
|
||||
amt_silver = 0
|
||||
amt_gold = 0
|
||||
amt_diamond = 0
|
||||
amt_strange = 0
|
||||
amt_clown = 0
|
||||
|
||||
for(var/obj/item/weapon/ore/O in contents)
|
||||
if(!istype(O))
|
||||
continue
|
||||
|
||||
if (istype(O, /obj/item/weapon/ore/iron))
|
||||
amt_iron++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/glass))
|
||||
amt_glass++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/plasma))
|
||||
amt_plasma++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/uranium))
|
||||
amt_uranium++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/silver))
|
||||
amt_silver++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/gold))
|
||||
amt_gold++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/diamond))
|
||||
amt_diamond++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/strangerock))
|
||||
amt_strange++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/clown))
|
||||
amt_clown++
|
||||
continue
|
||||
return
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
src.modules += new /obj/item/weapon/wrench(src)
|
||||
src.modules += new /obj/item/weapon/screwdriver(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/ore(src)
|
||||
src.modules += new /obj/item/weapon/pickaxe/borgdrill(src)
|
||||
src.modules += new /obj/item/weapon/pickaxe/drill/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
|
||||
src.emag = new /obj/item/borg/stun(src)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user