mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
* A preface to my madness Travis failed one of my PR's because I copied old code that used /red /blue /green. Because of this, I am going to find and replace every instance of it that I find. Also this is a test commit to make sure I'm comitting to the correct branch. * /blue /green /red replacements Dear god. A slow and painful death from acid is more fun than this. I wouldn't wish this torture on my worst enemy. And this is only the beginning * Replace part 2. Time to fix the human error. * Fixes mismatches * Sets macro count to 220 One above the current number of macros in the code. * Fixes last of the mismatches. * Removes spaces, replaces \black Removes spaces Replaces \black in a few areas where seen Replaces \bold with <B> </B> where seen * Updating macro count again * More fixes! * Issues fixed! For real this time! I swear! * Fixing all the merge conflict files.
101 lines
2.5 KiB
Plaintext
101 lines
2.5 KiB
Plaintext
|
|
/**********************Ore box**************************/
|
|
//Why the hell is this file called satchel_ore_boxdm.dm? -CK
|
|
/obj/structure/ore_box
|
|
icon = 'icons/obj/mining.dmi'
|
|
icon_state = "orebox0"
|
|
name = "ore box"
|
|
desc = "A heavy box used for storing ore."
|
|
density = 1
|
|
var/last_update = 0
|
|
var/list/stored_ore = list()
|
|
|
|
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if (istype(W, /obj/item/weapon/ore))
|
|
user.remove_from_mob(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 << "<font color='blue'>You empty the satchel into the box.</font>"
|
|
|
|
update_ore_count()
|
|
|
|
return
|
|
|
|
/obj/structure/ore_box/proc/update_ore_count()
|
|
|
|
stored_ore = list()
|
|
|
|
for(var/obj/item/weapon/ore/O in contents)
|
|
|
|
if(stored_ore[O.name])
|
|
stored_ore[O.name]++
|
|
else
|
|
stored_ore[O.name] = 1
|
|
|
|
/obj/structure/ore_box/examine(mob/user)
|
|
user << "That's an [src]."
|
|
user << desc
|
|
|
|
// Borgs can now check contents too.
|
|
if((!istype(user, /mob/living/carbon/human)) && (!istype(user, /mob/living/silicon/robot)))
|
|
return
|
|
|
|
if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them.
|
|
return
|
|
|
|
add_fingerprint(user)
|
|
|
|
if(!contents.len)
|
|
user << "It is empty."
|
|
return
|
|
|
|
if(world.time > last_update + 10)
|
|
update_ore_count()
|
|
last_update = world.time
|
|
|
|
user << "It holds:"
|
|
for(var/ore in stored_ore)
|
|
user << "- [stored_ore[ore]] [ore]"
|
|
return
|
|
|
|
|
|
/obj/structure/ore_box/verb/empty_box()
|
|
set name = "Empty Ore Box"
|
|
set category = "Object"
|
|
set src in view(1)
|
|
|
|
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
|
|
usr << "<font color='red'>You are physically incapable of emptying the ore box.</font>"
|
|
return
|
|
|
|
if( usr.stat || usr.restrained() )
|
|
return
|
|
|
|
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
|
|
usr << "You cannot reach the ore box."
|
|
return
|
|
|
|
add_fingerprint(usr)
|
|
|
|
if(contents.len < 1)
|
|
usr << "<font color='red'>The ore box is empty.</font>"
|
|
return
|
|
|
|
for (var/obj/item/weapon/ore/O in contents)
|
|
contents -= O
|
|
O.loc = src.loc
|
|
usr << "<font color='blue'>You empty the ore box.</font>"
|
|
|
|
return
|
|
|
|
/obj/structure/ore_box/ex_act(severity)
|
|
if(severity == 1.0 || (severity < 3.0 && prob(50)))
|
|
for (var/obj/item/weapon/ore/O in contents)
|
|
O.loc = src.loc
|
|
O.ex_act(severity++)
|
|
qdel(src)
|
|
return |