Files
Bubberstation/code/game/objects/items/storage/toolbox.dm
Qustinnus b33d1c49a3 [READY] Floydmats (Datum materials) & custom toolboxes (#45118)
* Initial work

* more

* ass

* wsedfwedff

* asss

* test

* stuff

* fuck

* sss

a

* kms

* asdadwedwdfwefwef

* start

* test

* dwwdew

* ewefwfef

* Redemption machine (#8)

* Redemption machine

* Removes debug messages

* changes

* fuckmyshitup

* coin mint works with new material shenanigans (#10)

* Auto stash before merge of "materials" and "origin/materials"

* woops

* furnace (#11)

* autolathe manufacturing of toolboxes

* eggs in a basket

* some small changes

* matcolors

* documentation

* more documentation and effects

* done

* Color man bad (#12)

* fixes designs

* ass

* more fixes

* fuck me

* firestacks adder

* epic fixes

* fixes designs

* DONE DIDDILY DOO

* removes category macro

* ch-ch-ch-changes

* fixes some stuff

* Fixes display of ore values (#9)

* Redemption machine

* Removes debug messages

* Re-adds value display

* Replaces the fire stacking component with an element instead (#13)

* fixes examine

* fixes ligma bugs

* double ligma boofus

* fix

* misses some defines

* fixes ORM

* Update code/datums/components/material_container.dm

Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com>

* fixes

* Makes glass objects weaker (#14)

* Makes glass objects weaker

* uses correct proc

* fixes shit

* honk honk

* better

* oh shit oh fuck

* fixes

* fuck ORMs

* fixes the biogen

* documentation

* ass (#15)

* component

* changes

* ass

* ass

* doc

* Auto stash before merge of "materials-plasmacomponent" and "origin/materials-plasmacomponent"

* fixes rounding

* fixed
2019-07-24 11:27:01 -04:00

306 lines
9.8 KiB
Plaintext

/obj/item/storage/toolbox
name = "toolbox"
desc = "Danger. Very robust."
icon_state = "toolbox_default"
item_state = "toolbox_default"
lefthand_file = 'icons/mob/inhands/equipment/toolbox_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/toolbox_righthand.dmi'
flags_1 = CONDUCT_1
force = 12
throwforce = 12
throw_speed = 2
throw_range = 7
w_class = WEIGHT_CLASS_BULKY
materials = list(/datum/material/iron = 500)
attack_verb = list("robusted")
hitsound = 'sound/weapons/smash.ogg'
custom_materials = list(/datum/material/iron = 500) //Toolboxes by default use iron as their core, custom material.
var/latches = "single_latch"
var/has_latches = TRUE
/obj/item/storage/toolbox/Initialize()
. = ..()
if(has_latches)
if(prob(10))
latches = "double_latch"
if(prob(1))
latches = "triple_latch"
update_icon()
/obj/item/storage/toolbox/update_icon()
..()
cut_overlays()
if(has_latches)
add_overlay(latches)
/obj/item/storage/toolbox/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] robusts [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/storage/toolbox/emergency
name = "emergency toolbox"
icon_state = "red"
item_state = "toolbox_red"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/emergency/PopulateContents()
new /obj/item/crowbar/red(src)
new /obj/item/weldingtool/mini(src)
new /obj/item/extinguisher/mini(src)
switch(rand(1,3))
if(1)
new /obj/item/flashlight(src)
if(2)
new /obj/item/flashlight/glowstick(src)
if(3)
new /obj/item/flashlight/flare(src)
new /obj/item/radio/off(src)
/obj/item/storage/toolbox/emergency/old
name = "rusty red toolbox"
icon_state = "toolbox_red_old"
has_latches = FALSE
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical
name = "mechanical toolbox"
icon_state = "blue"
item_state = "toolbox_blue"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical/PopulateContents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
new /obj/item/crowbar(src)
new /obj/item/analyzer(src)
new /obj/item/wirecutters(src)
/obj/item/storage/toolbox/mechanical/old
name = "rusty blue toolbox"
icon_state = "toolbox_blue_old"
has_latches = FALSE
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical/old/heirloom
name = "toolbox" //this will be named "X family toolbox"
desc = "It's seen better days."
force = 5
w_class = WEIGHT_CLASS_NORMAL
/obj/item/storage/toolbox/mechanical/old/heirloom/PopulateContents()
return
/obj/item/storage/toolbox/mechanical/old/clean
name = "toolbox"
desc = "A old, blue toolbox, it looks robust."
icon_state = "oldtoolboxclean"
item_state = "toolbox_blue"
has_latches = FALSE
force = 19
throwforce = 22
/obj/item/storage/toolbox/mechanical/old/clean/proc/calc_damage()
var/power = 0
for (var/obj/item/stack/telecrystal/TC in GetAllContents())
power += TC.amount
force = 19 + power
throwforce = 22 + power
/obj/item/storage/toolbox/mechanical/old/clean/attack(mob/target, mob/living/user)
calc_damage()
..()
/obj/item/storage/toolbox/mechanical/old/clean/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
calc_damage()
..()
/obj/item/storage/toolbox/mechanical/old/clean/PopulateContents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
new /obj/item/crowbar(src)
new /obj/item/wirecutters(src)
new /obj/item/multitool(src)
new /obj/item/clothing/gloves/color/yellow(src)
/obj/item/storage/toolbox/electrical
name = "electrical toolbox"
icon_state = "yellow"
item_state = "toolbox_yellow"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/electrical/PopulateContents()
var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white")
new /obj/item/screwdriver(src)
new /obj/item/wirecutters(src)
new /obj/item/t_scanner(src)
new /obj/item/crowbar(src)
new /obj/item/stack/cable_coil(src,MAXCOIL,pickedcolor)
new /obj/item/stack/cable_coil(src,MAXCOIL,pickedcolor)
if(prob(5))
new /obj/item/clothing/gloves/color/yellow(src)
else
new /obj/item/stack/cable_coil(src,MAXCOIL,pickedcolor)
/obj/item/storage/toolbox/syndicate
name = "suspicious looking toolbox"
icon_state = "syndicate"
item_state = "toolbox_syndi"
force = 15
throwforce = 18
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/syndicate/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.silent = TRUE
/obj/item/storage/toolbox/syndicate/PopulateContents()
new /obj/item/screwdriver/nuke(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool/largetank(src)
new /obj/item/crowbar/red(src)
new /obj/item/wirecutters(src, "red")
new /obj/item/multitool(src)
new /obj/item/clothing/gloves/combat(src)
/obj/item/storage/toolbox/drone
name = "mechanical toolbox"
icon_state = "blue"
item_state = "toolbox_blue"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/drone/PopulateContents()
var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white")
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
new /obj/item/crowbar(src)
new /obj/item/stack/cable_coil(src,MAXCOIL,pickedcolor)
new /obj/item/wirecutters(src)
new /obj/item/multitool(src)
/obj/item/storage/toolbox/brass
name = "brass box"
desc = "A huge brass box with several indentations in its surface."
icon_state = "brassbox"
item_state = null
has_latches = FALSE
resistance_flags = FIRE_PROOF | ACID_PROOF
w_class = WEIGHT_CLASS_HUGE
attack_verb = list("robusted", "crushed", "smashed")
material_flags = MATERIAL_NO_COLOR
var/fabricator_type = /obj/item/clockwork/replica_fabricator/scarab
/obj/item/storage/toolbox/brass/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 28
STR.max_items = 28
/obj/item/storage/toolbox/brass/prefilled/PopulateContents()
new fabricator_type(src)
new /obj/item/screwdriver/brass(src)
new /obj/item/wirecutters/brass(src)
new /obj/item/wrench/brass(src)
new /obj/item/crowbar/brass(src)
new /obj/item/weldingtool/experimental/brass(src)
/obj/item/storage/toolbox/brass/prefilled/servant
slot_flags = ITEM_SLOT_BELT
fabricator_type = null
/obj/item/storage/toolbox/brass/prefilled/ratvar
var/slab_type = /obj/item/clockwork/slab
/obj/item/storage/toolbox/brass/prefilled/ratvar/PopulateContents()
..()
new slab_type(src)
/obj/item/storage/toolbox/brass/prefilled/ratvar/admin
slab_type = /obj/item/clockwork/slab/debug
fabricator_type = /obj/item/clockwork/replica_fabricator/scarab/debug
/obj/item/storage/toolbox/artistic
name = "artistic toolbox"
desc = "A toolbox painted bright green. Why anyone would store art supplies in a toolbox is beyond you, but it has plenty of extra space."
icon_state = "green"
item_state = "artistic_toolbox"
w_class = WEIGHT_CLASS_GIGANTIC //Holds more than a regular toolbox!
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/artistic/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 20
STR.max_items = 10
/obj/item/storage/toolbox/artistic/PopulateContents()
new /obj/item/storage/crayons(src)
new /obj/item/crowbar(src)
new /obj/item/stack/pipe_cleaner_coil/red(src)
new /obj/item/stack/pipe_cleaner_coil/yellow(src)
new /obj/item/stack/pipe_cleaner_coil/blue(src)
new /obj/item/stack/pipe_cleaner_coil/green(src)
new /obj/item/stack/pipe_cleaner_coil/pink(src)
new /obj/item/stack/pipe_cleaner_coil/orange(src)
new /obj/item/stack/pipe_cleaner_coil/cyan(src)
new /obj/item/stack/pipe_cleaner_coil/white(src)
/obj/item/storage/toolbox/ammo
name = "ammo box"
desc = "It contains a few clips."
icon_state = "ammobox"
item_state = "ammobox"
/obj/item/storage/toolbox/ammo/PopulateContents()
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
new /obj/item/ammo_box/a762(src)
//floorbot assembly
/obj/item/storage/toolbox/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
var/list/allowed_toolbox = list(/obj/item/storage/toolbox/emergency, //which toolboxes can be made into floorbots
/obj/item/storage/toolbox/electrical,
/obj/item/storage/toolbox/mechanical,
/obj/item/storage/toolbox/artistic,
/obj/item/storage/toolbox/syndicate)
if(!istype(T, /obj/item/stack/tile/plasteel))
..()
return
if(!is_type_in_list(src, allowed_toolbox) && (type != /obj/item/storage/toolbox))
return
if(contents.len >= 1)
to_chat(user, "<span class='warning'>They won't fit in, as there is already stuff inside!</span>")
return
if(T.use(10))
var/obj/item/bot_assembly/floorbot/B = new
B.toolbox = type
switch(B.toolbox)
if(/obj/item/storage/toolbox)
B.toolbox_color = "r"
if(/obj/item/storage/toolbox/emergency)
B.toolbox_color = "r"
if(/obj/item/storage/toolbox/electrical)
B.toolbox_color = "y"
if(/obj/item/storage/toolbox/artistic)
B.toolbox_color = "g"
if(/obj/item/storage/toolbox/syndicate)
B.toolbox_color = "s"
user.put_in_hands(B)
B.update_icon()
to_chat(user, "<span class='notice'>You add the tiles into the empty [name]. They protrude from the top.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need 10 floor tiles to start building a floorbot!</span>")
return