mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Moves material stacks to modules/materials
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'icons/obj/items.dmi'
|
||||
name = "Coin"
|
||||
desc = "A simple coin you can flip."
|
||||
icon_state = "coin"
|
||||
randpixel = 8
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = ITEMSIZE_TINY
|
||||
slot_flags = SLOT_EARS
|
||||
var/string_attached
|
||||
var/sides = 2
|
||||
drop_sound = 'sound/items/drop/ring.ogg'
|
||||
pickup_sound = 'sound/items/pickup/ring.ogg'
|
||||
|
||||
/obj/item/weapon/coin/New()
|
||||
randpixel_xy()
|
||||
|
||||
/obj/item/weapon/coin/gold
|
||||
name = "gold coin"
|
||||
icon_state = "coin_gold"
|
||||
|
||||
/obj/item/weapon/coin/silver
|
||||
name = "silver coin"
|
||||
icon_state = "coin_silver"
|
||||
|
||||
/obj/item/weapon/coin/diamond
|
||||
name = "diamond coin"
|
||||
icon_state = "coin_diamond"
|
||||
|
||||
/obj/item/weapon/coin/iron
|
||||
name = "iron coin"
|
||||
icon_state = "coin_iron"
|
||||
|
||||
/obj/item/weapon/coin/phoron
|
||||
name = "solid phoron coin"
|
||||
icon_state = "coin_phoron"
|
||||
|
||||
/obj/item/weapon/coin/uranium
|
||||
name = "uranium coin"
|
||||
icon_state = "coin_uranium"
|
||||
|
||||
/obj/item/weapon/coin/platinum
|
||||
name = "platinum coin"
|
||||
icon_state = "coin_adamantine"
|
||||
|
||||
/obj/item/weapon/coin/morphium
|
||||
name = "morphium coin"
|
||||
icon_state = "coin_morphium"
|
||||
|
||||
/obj/item/weapon/coin/aluminium
|
||||
name = "aluminium coin"
|
||||
icon_state = "coin_aluminium"
|
||||
|
||||
/obj/item/weapon/coin/verdantium
|
||||
name = "verdantium coin"
|
||||
icon_state = "coin_verdantium"
|
||||
|
||||
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(string_attached)
|
||||
to_chat(user, "<span class='notice'>There already is a string attached to this coin.</span>")
|
||||
return
|
||||
if (CC.use(1))
|
||||
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
|
||||
string_attached = 1
|
||||
to_chat(user, "<span class='notice'>You attach a string to the coin.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>This cable coil appears to be empty.</span>")
|
||||
return
|
||||
else if(W.is_wirecutter())
|
||||
if(!string_attached)
|
||||
..()
|
||||
return
|
||||
|
||||
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
|
||||
CC.amount = 1
|
||||
CC.update_icon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
to_chat(user, "<font color='blue'>You detach the string from the coin.</font>")
|
||||
else ..()
|
||||
|
||||
/obj/item/weapon/coin/attack_self(mob/user as mob)
|
||||
var/result = rand(1, sides)
|
||||
var/comment = ""
|
||||
if(result == 1)
|
||||
comment = "tails"
|
||||
else if(result == 2)
|
||||
comment = "heads"
|
||||
user.visible_message("<span class='notice'>[user] has thrown \the [src]. It lands on [comment]! </span>", \
|
||||
"<span class='notice'>You throw \the [src]. It lands on [comment]! </span>")
|
||||
@@ -1,19 +1,19 @@
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
@@ -1,210 +0,0 @@
|
||||
/**********************Mint**************************/
|
||||
/obj/machinery/mineral/mint
|
||||
name = "Coin press"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_phoron = 0
|
||||
var/amt_uranium = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = DEFAULT_WALL_MATERIAL //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/Initialize()
|
||||
. = ..()
|
||||
for (var/dir in cardinal)
|
||||
input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(input)
|
||||
break
|
||||
for (var/dir in cardinal)
|
||||
output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(output)
|
||||
break
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
if(!input)
|
||||
return
|
||||
|
||||
var/obj/item/stack/O = locate(/obj/item/stack, input.loc)
|
||||
if(!O)
|
||||
return
|
||||
|
||||
var/processed = 1
|
||||
switch(O.get_material_name())
|
||||
if("gold")
|
||||
amt_gold += 100 * O.get_amount()
|
||||
if("silver")
|
||||
amt_silver += 100 * O.get_amount()
|
||||
if("diamond")
|
||||
amt_diamond += 100 * O.get_amount()
|
||||
if("phoron")
|
||||
amt_phoron += 100 * O.get_amount()
|
||||
if("uranium")
|
||||
amt_uranium += 100 * O.get_amount()
|
||||
if(DEFAULT_WALL_MATERIAL)
|
||||
amt_iron += 100 * O.get_amount()
|
||||
else
|
||||
processed = 0
|
||||
if(processed)
|
||||
qdel(O)
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob)
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=gold'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
|
||||
if (chosen == "silver")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=silver'>Choose</A>")
|
||||
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
|
||||
if (chosen == DEFAULT_WALL_MATERIAL)
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=metal'>Choose</A>")
|
||||
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
|
||||
if (chosen == "diamond")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=diamond'>Choose</A>")
|
||||
dat += text("<br><font color='#FF8800'><b>Phoron inserted: </b>[amt_phoron]</font> ")
|
||||
if (chosen == "phoron")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=phoron'>Choose</A>")
|
||||
dat += text("<br><font color='#008800'><b>Uranium inserted: </b>[amt_uranium]</font> ")
|
||||
if (chosen == "uranium")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=uranium'>Choose</A>")
|
||||
|
||||
dat += text("<br><br>Will produce [coinsToProduce] [chosen] coins if enough materials are available.<br>")
|
||||
//dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-10'>-10</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-5'>-5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-1'>-1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=1'>+1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=5'>+5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=10'>+10</A> ")
|
||||
|
||||
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
|
||||
dat += text("<br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
|
||||
user << browse("[dat]", "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
to_chat(usr, "<font color='blue'>The machine is processing.</font>")
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if(DEFAULT_WALL_MATERIAL)
|
||||
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("phoron")
|
||||
while(amt_phoron > 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/phoron(M)
|
||||
amt_phoron -= 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)
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -1,98 +0,0 @@
|
||||
/*****************************Money bag********************************/
|
||||
|
||||
/obj/item/weapon/moneybag
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
name = "Money bag"
|
||||
icon_state = "moneybag"
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
w_class = ITEMSIZE_LARGE
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_phoron = 0
|
||||
var/amt_uranium = 0
|
||||
|
||||
for (var/obj/item/weapon/coin/C in contents)
|
||||
if (istype(C,/obj/item/weapon/coin/diamond))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/coin/phoron))
|
||||
amt_phoron++;
|
||||
if (istype(C,/obj/item/weapon/coin/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/coin/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/coin/gold))
|
||||
amt_gold++;
|
||||
if (istype(C,/obj/item/weapon/coin/uranium))
|
||||
amt_uranium++;
|
||||
|
||||
var/dat = text("<b>The contents of the moneybag reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
dat += text("Gold coins: [amt_gold] <A href='?src=\ref[src];remove=gold'>Remove one</A><br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver coins: [amt_silver] <A href='?src=\ref[src];remove=silver'>Remove one</A><br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal coins: [amt_iron] <A href='?src=\ref[src];remove=iron'>Remove one</A><br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond coins: [amt_diamond] <A href='?src=\ref[src];remove=diamond'>Remove one</A><br>")
|
||||
if (amt_phoron)
|
||||
dat += text("Phoron coins: [amt_phoron] <A href='?src=\ref[src];remove=phoron'>Remove one</A><br>")
|
||||
if (amt_uranium)
|
||||
dat += text("Uranium coins: [amt_uranium] <A href='?src=\ref[src];remove=uranium'>Remove one</A><br>")
|
||||
user << browse("[dat]", "window=moneybag")
|
||||
|
||||
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
to_chat(user, "<font color='blue'>You add the [C.name] into the bag.</font>")
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
to_chat(user, "<font color='blue'>You empty the [C.name] into the bag.</font>")
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/coin/COIN
|
||||
switch(href_list["remove"])
|
||||
if("gold")
|
||||
COIN = locate(/obj/item/weapon/coin/gold,src.contents)
|
||||
if("silver")
|
||||
COIN = locate(/obj/item/weapon/coin/silver,src.contents)
|
||||
if("iron")
|
||||
COIN = locate(/obj/item/weapon/coin/iron,src.contents)
|
||||
if("diamond")
|
||||
COIN = locate(/obj/item/weapon/coin/diamond,src.contents)
|
||||
if("phoron")
|
||||
COIN = locate(/obj/item/weapon/coin/phoron,src.contents)
|
||||
if("uranium")
|
||||
COIN = locate(/obj/item/weapon/coin/uranium,src.contents)
|
||||
if(!COIN)
|
||||
return
|
||||
COIN.loc = src.loc
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
..()
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
Reference in New Issue
Block a user