mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-29 19:43:52 +00:00
Ironed out some bugs. Everything should be working for testing purposes.
This commit is contained in:
@@ -148,7 +148,11 @@
|
||||
else
|
||||
if(!open || active) return ..()
|
||||
if(istype(W,/obj/item/weapon/crowbar))
|
||||
if(storage)
|
||||
if(cell)
|
||||
user << "You pry out \the [cell]."
|
||||
cell.loc = get_turf(src)
|
||||
cell = null
|
||||
else if(storage)
|
||||
user << "You slip the bolt and pry out \the [storage]."
|
||||
storage.loc = get_turf(src)
|
||||
storage = null
|
||||
@@ -159,11 +163,7 @@
|
||||
else if(cellmount)
|
||||
user << "You yank out a few wires and pry out \the [cellmount]."
|
||||
cellmount.loc = get_turf(src)
|
||||
cellmount.loc = null
|
||||
else if(cell)
|
||||
user << "You pry out \the [cell]."
|
||||
cell.loc = get_turf(src)
|
||||
cell = null
|
||||
cellmount = null
|
||||
else
|
||||
user << "There's nothing inside the drilling rig to remove."
|
||||
return
|
||||
@@ -171,6 +171,7 @@
|
||||
if(storage)
|
||||
user << "The drill already has a matter bin installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
storage = W
|
||||
user << "You install \the [W]."
|
||||
@@ -179,6 +180,7 @@
|
||||
if(cutter)
|
||||
user << "The drill already has a cutting head installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cutter = W
|
||||
user << "You install \the [W]."
|
||||
@@ -187,6 +189,7 @@
|
||||
if(cellmount)
|
||||
user << "The drill already has a cell capacitor installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cellmount = W
|
||||
user << "You install \the [W]."
|
||||
@@ -195,6 +198,7 @@
|
||||
if(cell)
|
||||
user << "The drill already has a cell installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cell = W
|
||||
user << "You install \the [W]."
|
||||
|
||||
@@ -159,47 +159,37 @@
|
||||
if(!O) continue
|
||||
|
||||
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
|
||||
var/can_make_alloy = 0
|
||||
var/datum/alloy/alloying
|
||||
|
||||
for(var/datum/alloy/A in alloy_data)
|
||||
if(A.metaltag in tick_alloys) continue
|
||||
|
||||
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.
|
||||
alloying = A
|
||||
can_make_alloy = 0
|
||||
var/enough_metal = 1
|
||||
|
||||
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)
|
||||
can_make_alloy = 0
|
||||
else
|
||||
can_make_alloy = 1
|
||||
break
|
||||
|
||||
if(!alloying)
|
||||
sheets++
|
||||
return
|
||||
|
||||
if(!can_make_alloy)
|
||||
if(!enough_metal)
|
||||
continue
|
||||
else
|
||||
var/total
|
||||
for(var/needs_metal in alloying.requires)
|
||||
ores_stored[needs_metal] -= alloying.requires[needs_metal]
|
||||
total += alloying.requires[needs_metal]
|
||||
total = round(total*alloying.product_mod)
|
||||
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 alloying.product(output.loc)
|
||||
for(var/i=0,i<total,i++)
|
||||
new A.product(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 2 && O.compresses_to) //Compressing.
|
||||
|
||||
@@ -230,6 +220,7 @@
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
else
|
||||
continue
|
||||
|
||||
//Grab some more ore to process next tick.
|
||||
for(var/i = 0,i<sheets_per_tick,i++)
|
||||
var/obj/item/weapon/ore/O = locate() in input.loc
|
||||
|
||||
Reference in New Issue
Block a user