diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm
index 0f7ed8d5b1a..e8162ac7e5f 100644
--- a/_maps/map_files/MetaStation/MetaStation.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.dmm
@@ -78759,16 +78759,13 @@
icon_state = "4-8"
},
/obj/structure/rack,
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
/obj/item/healthanalyzer{
diff --git a/_maps/map_files/RandomZLevels/moonoutpost19.dmm b/_maps/map_files/RandomZLevels/moonoutpost19.dmm
index acec675d0d1..cfe208e1557 100644
--- a/_maps/map_files/RandomZLevels/moonoutpost19.dmm
+++ b/_maps/map_files/RandomZLevels/moonoutpost19.dmm
@@ -5349,8 +5349,7 @@
/obj/effect/decal/cleanable/blood/oil{
color = "black"
},
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
/obj/item/healthanalyzer{
diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm
index b2c4a4162ad..332f6a22e6c 100644
--- a/_maps/map_files/cyberiad/cyberiad.dmm
+++ b/_maps/map_files/cyberiad/cyberiad.dmm
@@ -46977,16 +46977,13 @@
/area/assembly/robotics)
"bRm" = (
/obj/structure/table,
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
-/obj/item/storage/firstaid/regular{
- empty = 1;
+/obj/item/storage/firstaid/regular/empty{
name = "First-Aid (empty)"
},
/obj/item/healthanalyzer,
diff --git a/code/game/objects/items/weapons/implants/implant_storage.dm b/code/game/objects/items/weapons/implants/implant_storage.dm
index b530fd860fa..813d0272ff6 100644
--- a/code/game/objects/items/weapons/implants/implant_storage.dm
+++ b/code/game/objects/items/weapons/implants/implant_storage.dm
@@ -5,7 +5,7 @@
max_combined_w_class = WEIGHT_CLASS_GIGANTIC
w_class = WEIGHT_CLASS_BULKY
cant_hold = list(/obj/item/disk/nuclear)
- silent = 1
+ silent = TRUE
/obj/item/implant/storage
diff --git a/code/game/objects/items/weapons/stock_parts.dm b/code/game/objects/items/weapons/stock_parts.dm
index 7df47345bae..3934121365b 100644
--- a/code/game/objects/items/weapons/stock_parts.dm
+++ b/code/game/objects/items/weapons/stock_parts.dm
@@ -8,14 +8,14 @@
w_class = WEIGHT_CLASS_HUGE
can_hold = list(/obj/item/stock_parts)
storage_slots = 50
- use_to_pickup = 1
- allow_quick_gather = 1
- allow_quick_empty = 1
+ use_to_pickup = TRUE
+ allow_quick_gather = TRUE
+ allow_quick_empty = TRUE
pickup_all_on_tile = TRUE
- display_contents_with_number = 1
+ display_contents_with_number = TRUE
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 100
- var/works_from_distance = 0
+ var/works_from_distance = FALSE
var/primary_sound = 'sound/items/rped.ogg'
var/alt_sound = null
toolspeed = 1
@@ -39,7 +39,7 @@
storage_slots = 400
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 800
- works_from_distance = 1
+ works_from_distance = TRUE
primary_sound = 'sound/items/pshoom.ogg'
alt_sound = 'sound/items/pshoom_2.ogg'
usesound = 'sound/items/pshoom.ogg'
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index 9caa87d8a4b..3466773007b 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -36,9 +36,9 @@
space_used += I.w_class
if(!space_used)
. += " [src] is empty."
- else if(space_used <= max_combined_w_class*0.6)
+ else if(space_used <= max_combined_w_class * 0.6)
. += " [src] still has plenty of remaining space."
- else if(space_used <= max_combined_w_class*0.8)
+ else if(space_used <= max_combined_w_class * 0.8)
. += " [src] is beginning to run out of space."
else if(space_used < max_combined_w_class)
. += " [src] doesn't have much space left."
@@ -82,8 +82,8 @@
. = ..()
/obj/item/storage/backpack/holding/singularity_act(current_size)
- var/dist = max((current_size - 2),1)
- explosion(src.loc,(dist),(dist*2),(dist*4))
+ var/dist = max((current_size - 2), 1)
+ explosion(loc, dist, (dist * 2), (dist * 4))
/obj/item/storage/backpack/santabag
name = "Santa's Gift Bag"
@@ -107,8 +107,7 @@
/obj/item/storage/backpack/clown/syndie
-/obj/item/storage/backpack/clown/syndie/New()
- ..()
+/obj/item/storage/backpack/clown/syndie/populate_contents()
new /obj/item/clothing/under/rank/clown(src)
new /obj/item/clothing/shoes/magboots/clown(src)
new /obj/item/clothing/mask/chameleon(src)
@@ -236,8 +235,7 @@
desc = "A handbag made out of what appears to be supple green Unathi skin. A face can be vaguely seen on the front."
icon_state = "satchel-lizard"
-/obj/item/storage/backpack/satchel/withwallet/New()
- ..()
+/obj/item/storage/backpack/satchel/withwallet/populate_contents()
new /obj/item/storage/wallet/random(src)
/obj/item/storage/backpack/satchel_norm
@@ -313,18 +311,17 @@
level = 1
cant_hold = list(/obj/item/storage/backpack/satchel_flat) //muh recursive backpacks
-/obj/item/storage/backpack/satchel_flat/hide(var/intact)
+/obj/item/storage/backpack/satchel_flat/hide(intact)
if(intact)
invisibility = INVISIBILITY_MAXIMUM
anchored = 1 //otherwise you can start pulling, cover it, and drag around an invisible backpack.
icon_state = "[initial(icon_state)]2"
else
invisibility = initial(invisibility)
- anchored = 0
+ anchored = FALSE
icon_state = initial(icon_state)
-/obj/item/storage/backpack/satchel_flat/New()
- ..()
+/obj/item/storage/backpack/satchel_flat/populate_contents()
new /obj/item/stack/tile/plasteel(src)
new /obj/item/crowbar(src)
@@ -346,7 +343,7 @@
icon_state = "duffel-syndie"
item_state = "duffel-syndimed"
origin_tech = "syndicate=1"
- silent = 1
+ silent = TRUE
slowdown = 0
resistance_flags = FIRE_PROOF
@@ -365,8 +362,7 @@
/obj/item/storage/backpack/duffel/syndie/ammo/shotgun
desc = "A large duffelbag, packed to the brim with Bulldog shotgun ammo."
-/obj/item/storage/backpack/duffel/syndie/ammo/shotgun/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/ammo/shotgun/populate_contents()
for(var/i in 1 to 6)
new /obj/item/ammo_box/magazine/m12g(src)
new /obj/item/ammo_box/magazine/m12g/buckshot(src)
@@ -376,8 +372,7 @@
/obj/item/storage/backpack/duffel/syndie/ammo/shotgunXLmags
desc = "A large duffelbag, containing three types of extended drum magazines."
-/obj/item/storage/backpack/duffel/syndie/ammo/shotgunXLmags/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/ammo/shotgunXLmags/populate_contents()
new /obj/item/ammo_box/magazine/m12g/XtrLrg(src)
new /obj/item/ammo_box/magazine/m12g/XtrLrg/buckshot(src)
new /obj/item/ammo_box/magazine/m12g/XtrLrg/dragon(src)
@@ -386,8 +381,7 @@
name = "mining conscription kit"
desc = "A kit containing everything a crewmember needs to support a shaft miner in the field."
-/obj/item/storage/backpack/duffel/mining_conscript/New()
- ..()
+/obj/item/storage/backpack/duffel/mining_conscript/populate_contents()
new /obj/item/pickaxe(src)
new /obj/item/clothing/glasses/meson(src)
new /obj/item/t_scanner/adv_mining_scanner/lesser(src)
@@ -404,16 +398,14 @@
/obj/item/storage/backpack/duffel/syndie/ammo/smg
desc = "A large duffel bag, packed to the brim with C-20r magazines."
-/obj/item/storage/backpack/duffel/syndie/ammo/smg/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/ammo/smg/populate_contents()
for(var/i in 1 to 10)
new /obj/item/ammo_box/magazine/smgm45(src)
/obj/item/storage/backpack/duffel/syndie/c20rbundle
desc = "A large duffel bag containing a C-20r, some magazines, and a cheap looking suppressor."
-/obj/item/storage/backpack/duffel/syndie/c20rbundle/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/c20rbundle/populate_contents()
new /obj/item/ammo_box/magazine/smgm45(src)
new /obj/item/ammo_box/magazine/smgm45(src)
new /obj/item/ammo_box/magazine/smgm45(src)
@@ -423,8 +415,7 @@
/obj/item/storage/backpack/duffel/syndie/bulldogbundle
desc = "A large duffel bag containing a Bulldog, some drums, and a pair of thermal imaging glasses."
-/obj/item/storage/backpack/duffel/syndie/bulldogbundle/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/bulldogbundle/populate_contents()
new /obj/item/gun/projectile/automatic/shotgun/bulldog(src)
new /obj/item/ammo_box/magazine/m12g(src)
new /obj/item/ammo_box/magazine/m12g(src)
@@ -433,19 +424,16 @@
/obj/item/storage/backpack/duffel/syndie/med/medicalbundle
desc = "A large duffel bag containing a tactical medkit, a medical beam gun and a pair of syndicate magboots."
-/obj/item/storage/backpack/duffel/syndie/med/medicalbundle/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/med/medicalbundle/populate_contents()
new /obj/item/storage/firstaid/tactical(src)
new /obj/item/clothing/shoes/magboots/syndie(src)
new /obj/item/gun/medbeam(src)
-/obj/item/storage/backpack/duffel/syndie/c4/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/c4/populate_contents()
for(var/i in 1 to 10)
new /obj/item/grenade/plastic/c4(src)
-/obj/item/storage/backpack/duffel/syndie/x4/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/x4/populate_contents()
for(var/i in 1 to 3)
new /obj/item/grenade/plastic/x4(src)
@@ -455,8 +443,7 @@
icon_state = "duffel-syndimed"
item_state = "duffel-syndimed"
-/obj/item/storage/backpack/duffel/syndie/surgery/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/surgery/populate_contents()
new /obj/item/scalpel(src)
new /obj/item/hemostat(src)
new /obj/item/retractor(src)
@@ -475,8 +462,7 @@
icon_state = "duffel-syndimed"
item_state = "duffel-syndimed"
-/obj/item/storage/backpack/duffel/syndie/surgery_fake/New()
- ..()
+/obj/item/storage/backpack/duffel/syndie/surgery_fake/populate_contents()
new /obj/item/scalpel(src)
new /obj/item/hemostat(src)
new /obj/item/retractor(src)
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 4a3072a6374..f2b0b475e30 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -107,7 +107,7 @@
return ..()
-/obj/item/storage/bag/plasticbag/equipped(var/mob/user, var/slot)
+/obj/item/storage/bag/plasticbag/equipped(mob/user, slot)
if(slot==slot_head)
storage_slots = 0
START_PROCESSING(SSobj, src)
@@ -200,7 +200,7 @@
// Because it stacks stacks, this doesn't operate normally.
// However, making it a storage/bag allows us to reuse existing code in some places. -Sayu
-/obj/item/storage/bag/sheetsnatcher
+/obj/item/storage/bag/sheetsnatcher // what is this even used for
icon = 'icons/obj/mining.dmi'
icon_state = "sheetsnatcher"
name = "Sheet Snatcher"
@@ -210,10 +210,6 @@
w_class = WEIGHT_CLASS_NORMAL
allow_quick_empty = 1 // this function is superceded
-/obj/item/storage/bag/sheetsnatcher/New()
- ..()
- //verbs -= /obj/item/storage/verb/quick_empty
- //verbs += /obj/item/storage/bag/sheetsnatcher/quick_empty
/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W as obj, stop_messages = 0)
if(!istype(W,/obj/item/stack/sheet) || istype(W,/obj/item/stack/sheet/mineral/sandstone) || istype(W,/obj/item/stack/sheet/wood))
@@ -289,7 +285,7 @@
var/col_count = min(7,storage_slots) -1
if(adjusted_contents > 7)
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
- src.standard_orient_objs(row_num, col_count, numbered_contents)
+ standard_orient_objs(row_num, col_count, numbered_contents)
return
@@ -376,7 +372,7 @@
icon_state = "tray"
desc = "A metal tray to lay food on."
force = 5
- throwforce = 10.0
+ throwforce = 10
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_BULKY
@@ -465,8 +461,7 @@
/obj/item/storage/bag/tray/cookies_tray
var/cookie = /obj/item/reagent_containers/food/snacks/cookie
-/obj/item/storage/bag/tray/cookies_tray/New() /// By Azule Utama, thank you a lot!
- ..()
+/obj/item/storage/bag/tray/cookies_tray/populate_contents() // By Azule Utama, thank you a lot!
for(var/i in 1 to 6)
var/obj/item/C = new cookie(src)
handle_item_insertion(C) // Done this way so the tray actually has the cookies visible when spawned
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index c4db289130f..301b43403f6 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -10,7 +10,8 @@
attack_verb = list("whipped", "lashed", "disciplined")
max_integrity = 300
equip_sound = 'sound/items/equip/toolbelt_equip.ogg'
- var/use_item_overlays = 0 // Do we have overlays for items held inside the belt?
+ /// Do we have overlays for items held inside the belt?
+ var/use_item_overlays = FALSE
/obj/item/storage/belt/update_icon()
if(use_item_overlays)
@@ -22,11 +23,11 @@
/obj/item/storage/belt/proc/can_use()
return is_equipped()
-/obj/item/storage/belt/MouseDrop(obj/over_object as obj, src_location, over_location)
+/obj/item/storage/belt/MouseDrop(obj/over_object, src_location, over_location)
var/mob/M = usr
if(!istype(over_object, /obj/screen))
return ..()
- playsound(src.loc, "rustle", 50, 1, -5)
+ playsound(loc, "rustle", 50, TRUE, -5)
if(!M.restrained() && !M.stat && can_use())
switch(over_object.name)
if("r_hand")
@@ -35,7 +36,7 @@
if("l_hand")
M.unEquip(src, silent = TRUE)
M.put_in_l_hand(src)
- src.add_fingerprint(usr)
+ add_fingerprint(usr)
return
/obj/item/storage/belt/deserialize(list/data)
@@ -47,9 +48,9 @@
desc = "Can hold various tools."
icon_state = "utilitybelt"
item_state = "utility"
- use_item_overlays = 1
+ use_item_overlays = TRUE
drop_sound = 'sound/items/handling/toolbelt_drop.ogg'
- pickup_sound = 'sound/items/handling/toolbelt_pickup.ogg'
+ pickup_sound = 'sound/items/handling/toolbelt_pickup.ogg'
can_hold = list(
/obj/item/crowbar,
/obj/item/screwdriver,
@@ -65,8 +66,7 @@
/obj/item/extinguisher/mini,
/obj/item/holosign_creator)
-/obj/item/storage/belt/utility/full/New()
- ..()
+/obj/item/storage/belt/utility/full/populate_contents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
@@ -75,13 +75,12 @@
new /obj/item/stack/cable_coil/random(src, 30)
update_icon()
-/obj/item/storage/belt/utility/full/multitool/New()
+/obj/item/storage/belt/utility/full/multitool/populate_contents()
..()
new /obj/item/multitool(src)
update_icon()
-/obj/item/storage/belt/utility/atmostech/New()
- ..()
+/obj/item/storage/belt/utility/atmostech/populate_contents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
@@ -97,8 +96,7 @@
icon_state = "utilitybelt_ce"
item_state = "utility_ce"
-/obj/item/storage/belt/utility/chief/full/New()
- ..()
+/obj/item/storage/belt/utility/chief/full/populate_contents()
new /obj/item/screwdriver/power(src)
new /obj/item/crowbar/power(src)
new /obj/item/weldingtool/experimental(src)//This can be changed if this is too much
@@ -110,12 +108,12 @@
//much roomier now that we've managed to remove two tools
/obj/item/storage/belt/medical
- use_to_pickup = 1 //Allow medical belt to pick up medicine
name = "medical belt"
desc = "Can hold various medical equipment."
icon_state = "medicalbelt"
item_state = "medical"
- use_item_overlays = 1
+ use_to_pickup = TRUE //Allow medical belt to pick up medicine
+ use_item_overlays = TRUE
max_w_class = WEIGHT_CLASS_NORMAL
can_hold = list(
/obj/item/healthanalyzer,
@@ -146,11 +144,11 @@
/obj/item/storage/belt/medical/surgery
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 17
- use_to_pickup = 1
+ use_to_pickup = TRUE
name = "surgical belt"
desc = "Can hold various surgical tools."
storage_slots = 9
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
/obj/item/scalpel,
/obj/item/hemostat,
@@ -163,10 +161,7 @@
/obj/item/cautery,
)
-/obj/item/storage/belt/medical/surgery/loaded
-
-/obj/item/storage/belt/medical/surgery/loaded/New()
- ..()
+/obj/item/storage/belt/medical/surgery/loaded/populate_contents()
new /obj/item/scalpel(src)
new /obj/item/hemostat(src)
new /obj/item/retractor(src)
@@ -177,10 +172,7 @@
new /obj/item/surgicaldrill(src)
new /obj/item/cautery(src)
-/obj/item/storage/belt/medical/response_team
-
-/obj/item/storage/belt/medical/response_team/New()
- ..()
+/obj/item/storage/belt/medical/response_team/populate_contents()
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/reagent_containers/food/pill/charcoal(src)
@@ -195,7 +187,7 @@
desc = "Can hold various botanical supplies."
icon_state = "botanybelt"
item_state = "botany"
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
/obj/item/plant_analyzer,
/obj/item/cultivator,
@@ -221,7 +213,7 @@
item_state = "security"//Could likely use a better one.
storage_slots = 5
max_w_class = WEIGHT_CLASS_NORMAL
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
/obj/item/grenade/flashbang,
/obj/item/grenade/chem_grenade/teargas,
@@ -240,13 +232,11 @@
/obj/item/melee/classic_baton/telescopic,
/obj/item/restraints/legcuffs/bola)
-/obj/item/storage/belt/security/sec/New()
- ..()
+/obj/item/storage/belt/security/sec/populate_contents()
new /obj/item/flashlight/seclite(src)
update_icon()
-/obj/item/storage/belt/security/response_team/New()
- ..()
+/obj/item/storage/belt/security/response_team/populate_contents()
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/melee/baton/loaded(src)
new /obj/item/flash(src)
@@ -254,8 +244,7 @@
new /obj/item/grenade/flashbang(src)
update_icon()
-/obj/item/storage/belt/security/response_team_gamma/New()
- ..()
+/obj/item/storage/belt/security/response_team_gamma/populate_contents()
new /obj/item/melee/baton/loaded(src)
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/flash(src)
@@ -277,19 +266,14 @@
icon_state = "soulstonebelt"
item_state = "soulstonebelt"
storage_slots = 6
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
"/obj/item/soulstone"
)
-/obj/item/storage/belt/soulstone/full/New()
- ..()
- new /obj/item/soulstone(src)
- new /obj/item/soulstone(src)
- new /obj/item/soulstone(src)
- new /obj/item/soulstone(src)
- new /obj/item/soulstone(src)
- new /obj/item/soulstone(src)
+/obj/item/storage/belt/soulstone/full/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/soulstone(src)
update_icon()
@@ -299,7 +283,7 @@
icon_state = "championbelt"
item_state = "champion"
materials = list(MAT_GOLD=400)
- storage_slots = 1
+ storage_slots = TRUE
can_hold = list(
"/obj/item/clothing/mask/luchador"
)
@@ -321,12 +305,9 @@
desc = "Can hold various tools. This model seems to have additional compartments."
icon_state = "utilitybelt"
item_state = "utility"
- use_item_overlays = 1 // So it will still show tools in it in case sec get lazy and just glance at it.
+ use_item_overlays = TRUE // So it will still show tools in it in case sec get lazy and just glance at it.
-/obj/item/storage/belt/military/traitor/hacker
-
-/obj/item/storage/belt/military/traitor/hacker/New()
- ..()
+/obj/item/storage/belt/military/traitor/hacker/populate_contents()
new /obj/item/screwdriver(src, "red")
new /obj/item/wrench(src)
new /obj/item/weldingtool/largetank(src)
@@ -342,41 +323,25 @@
item_state = "assault"
storage_slots = 30
max_combined_w_class = 60
- display_contents_with_number = 1
+ display_contents_with_number = TRUE
can_hold = list(
/obj/item/grenade,
/obj/item/lighter,
/obj/item/reagent_containers/food/drinks/bottle/molotov
)
-/obj/item/storage/belt/grenade/full/New()
- ..()
- new /obj/item/grenade/smokebomb(src) //4
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/empgrenade(src) //2
- new /obj/item/grenade/empgrenade(src)
- new /obj/item/grenade/gluon(src) //4
- new /obj/item/grenade/gluon(src)
- new /obj/item/grenade/gluon(src)
- new /obj/item/grenade/gluon(src)
+/obj/item/storage/belt/grenade/full/populate_contents()
+ for(var/I in 1 to 4)
+ new /obj/item/grenade/smokebomb(src) // Four of each
+ new /obj/item/grenade/gluon(src)
+ for(var/I in 1 to 10)
+ new /obj/item/grenade/frag(src)
+ for(var/I in 1 to 2)
+ new /obj/item/grenade/gas/plasma(src)
+ new /obj/item/grenade/empgrenade(src)
+ new /obj/item/grenade/syndieminibomb(src)
new /obj/item/grenade/chem_grenade/facid(src) //1
new /obj/item/grenade/chem_grenade/saringas(src) //1
- new /obj/item/grenade/gas/plasma(src) //2
- new /obj/item/grenade/gas/plasma(src)
- new /obj/item/grenade/frag(src) //10
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/frag(src)
- new /obj/item/grenade/syndieminibomb(src) //2
- new /obj/item/grenade/syndieminibomb(src)
/obj/item/storage/belt/military/abductor
name = "agent belt"
@@ -385,8 +350,7 @@
icon_state = "belt"
item_state = "security"
-/obj/item/storage/belt/military/abductor/full/New()
- ..()
+/obj/item/storage/belt/military/abductor/full/populate_contents()
new /obj/item/screwdriver/abductor(src)
new /obj/item/wrench/abductor(src)
new /obj/item/weldingtool/abductor(src)
@@ -409,7 +373,7 @@
item_state = "janibelt"
storage_slots = 6
max_w_class = WEIGHT_CLASS_BULKY // Set to this so the light replacer can fit.
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
/obj/item/grenade/chem_grenade/cleaner,
/obj/item/lightreplacer,
@@ -420,8 +384,7 @@
/obj/item/melee/flyswatter,
)
-/obj/item/storage/belt/janitor/full/New()
- ..()
+/obj/item/storage/belt/janitor/full/populate_contents()
new /obj/item/lightreplacer(src)
new /obj/item/holosign_creator(src)
new /obj/item/reagent_containers/spray/cleaner(src)
@@ -442,22 +405,21 @@
storage_slots = 6
can_hold = list(/obj/item/mobcapsule)
-/obj/item/storage/belt/lazarus/New()
- ..()
+/obj/item/storage/belt/lazarus/Initialize(mapload)
+ . = ..()
update_icon()
-
/obj/item/storage/belt/lazarus/update_icon()
..()
- icon_state = "[initial(icon_state)]_[contents.len]"
+ icon_state = "[initial(icon_state)]_[length(contents)]"
-/obj/item/storage/belt/lazarus/attackby(obj/item/W, mob/user)
- var/amount = contents.len
+/obj/item/storage/belt/lazarus/attackby(obj/item/I, mob/user)
+ var/amount = length(contents)
. = ..()
- if(amount != contents.len)
+ if(amount != length(contents))
update_icon()
-/obj/item/storage/belt/lazarus/remove_from_storage(obj/item/W as obj, atom/new_location)
+/obj/item/storage/belt/lazarus/remove_from_storage(obj/item/I, atom/new_location)
..()
update_icon()
@@ -468,39 +430,25 @@
icon_state = "bandolier"
item_state = "bandolier"
storage_slots = 8
- can_hold = list(
- /obj/item/ammo_casing/shotgun
- )
+ can_hold = list(/obj/item/ammo_casing/shotgun)
-/obj/item/storage/belt/bandolier/New()
- ..()
+/obj/item/storage/belt/bandolier/Initialize(mapload)
+ . = ..()
update_icon()
-/obj/item/storage/belt/bandolier/full/New()
- ..()
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- new /obj/item/ammo_casing/shotgun/beanbag(src)
- update_icon()
+/obj/item/storage/belt/bandolier/full/populate_contents()
+ for(var/I in 1 to 8)
+ new /obj/item/ammo_casing/shotgun/beanbag(src)
/obj/item/storage/belt/bandolier/update_icon()
..()
- icon_state = "[initial(icon_state)]_[contents.len]"
+ icon_state = "[initial(icon_state)]_[length(contents)]"
-/obj/item/storage/belt/bandolier/attackby(obj/item/W, mob/user)
- var/amount = contents.len
- . = ..()
- if(amount != contents.len)
- update_icon()
-
-/obj/item/storage/belt/bandolier/remove_from_storage(obj/item/W as obj, atom/new_location)
+/obj/item/storage/belt/bandolier/attackby(obj/item/I, mob/user)
+ var/amount = length(contents)
..()
- update_icon()
+ if(amount != length(contents))
+ update_icon()
/obj/item/storage/belt/holster
name = "shoulder holster"
@@ -520,13 +468,12 @@
icon_state = "soulstonebelt"
item_state = "soulstonebelt"
storage_slots = 6
- use_item_overlays = 1
+ use_item_overlays = TRUE
can_hold = list(
/obj/item/gun/magic/wand
)
-/obj/item/storage/belt/wands/full/New()
- ..()
+/obj/item/storage/belt/wands/full/populate_contents()
new /obj/item/gun/magic/wand/death(src)
new /obj/item/gun/magic/wand/resurrection(src)
new /obj/item/gun/magic/wand/polymorph(src)
@@ -607,8 +554,7 @@
max_w_class = WEIGHT_CLASS_BULKY
can_hold = list(/obj/item/melee/rapier)
-/obj/item/storage/belt/rapier/New()
- ..()
+/obj/item/storage/belt/rapier/populate_contents()
new /obj/item/melee/rapier(src)
update_icon()
@@ -676,7 +622,7 @@
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 18
origin_tech = "bluespace=5;materials=4;engineering=4;plasmatech=5"
- allow_quick_empty = 1
+ allow_quick_empty = TRUE
can_hold = list(
/obj/item/grenade/smokebomb,
/obj/item/restraints/legcuffs/bola
@@ -687,17 +633,17 @@
var/bolacount = 0
var/cooldown = 0
-/obj/item/storage/belt/bluespace/owlman/New()
- ..()
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/grenade/smokebomb(src)
- new /obj/item/restraints/legcuffs/bola(src)
- new /obj/item/restraints/legcuffs/bola(src)
+/obj/item/storage/belt/bluespace/owlman/Initialize(mapload)
+ . = ..()
START_PROCESSING(SSobj, src)
cooldown = world.time
+/obj/item/storage/belt/bluespace/owlman/populate_contents()
+ for(var/I in 1 to 4)
+ new /obj/item/grenade/smokebomb(src)
+ new /obj/item/restraints/legcuffs/bola(src)
+ new /obj/item/restraints/legcuffs/bola(src)
+
/obj/item/storage/belt/bluespace/owlman/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
@@ -728,7 +674,7 @@
if(H.s_active && H.s_active == src)
H.s_active.show_to(H)
-/obj/item/storage/belt/bluespace/attack(mob/M as mob, mob/user as mob, def_zone)
+/obj/item/storage/belt/bluespace/attack(mob/M, mob/user, def_zone)
return
/obj/item/storage/belt/bluespace/admin
@@ -742,8 +688,7 @@
max_combined_w_class = 280
can_hold = list()
-/obj/item/storage/belt/bluespace/admin/New()
- ..()
+/obj/item/storage/belt/bluespace/admin/populate_contents()
new /obj/item/crowbar(src)
new /obj/item/screwdriver(src)
new /obj/item/weldingtool/hugetank(src)
@@ -771,8 +716,7 @@
max_combined_w_class = 280
can_hold = list()
-/obj/item/storage/belt/bluespace/sandbox/New()
- ..()
+/obj/item/storage/belt/bluespace/sandbox/populate_contents()
new /obj/item/crowbar(src)
new /obj/item/screwdriver(src)
new /obj/item/weldingtool/hugetank(src)
@@ -792,7 +736,7 @@
storage_slots = 6
max_w_class = WEIGHT_CLASS_BULKY
max_combined_w_class = 20
- use_item_overlays = 0
+ use_item_overlays = FALSE
can_hold = list(
/obj/item/crowbar,
/obj/item/screwdriver,
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index 34be0a58fa9..384dc250901 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -51,8 +51,7 @@
desc = "To be applied to the head repeatedly."
icon_state ="bible"
-/obj/item/storage/bible/booze/New()
- ..()
+/obj/item/storage/bible/booze/populate_contents()
new /obj/item/reagent_containers/food/drinks/cans/beer(src)
new /obj/item/reagent_containers/food/drinks/cans/beer(src)
new /obj/item/stack/spacecash(src)
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 390e78f5d5e..4531490a9b3 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -42,21 +42,16 @@
/obj/item/storage/box/survival
icon_state = "box_civ"
-/obj/item/storage/box/survival/New()
- ..()
- contents = list()
- new /obj/item/clothing/mask/breath( src )
- new /obj/item/tank/internals/emergency_oxygen( src )
- new /obj/item/reagent_containers/hypospray/autoinjector( src )
- new /obj/item/flashlight/flare/glowstick/emergency( src )
- return
+/obj/item/storage/box/survival/populate_contents()
+ new /obj/item/clothing/mask/breath(src)
+ new /obj/item/tank/internals/emergency_oxygen(src)
+ new /obj/item/reagent_containers/hypospray/autoinjector(src)
+ new /obj/item/flashlight/flare/glowstick/emergency(src)
/obj/item/storage/box/survival_vox
icon_state = "box_vox"
-/obj/item/storage/box/survival_vox/New()
- ..()
- contents = list()
+/obj/item/storage/box/survival_vox/populate_contents()
new /obj/item/clothing/mask/breath/vox(src)
new /obj/item/tank/internals/emergency_oxygen/nitrogen(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
@@ -65,9 +60,7 @@
/obj/item/storage/box/survival_plasmaman
icon_state = "box_plasma"
-/obj/item/storage/box/survival_plasmaman/New()
- ..()
- contents = list()
+/obj/item/storage/box/survival_plasmaman/populate_contents()
new /obj/item/clothing/mask/breath(src)
new /obj/item/tank/internals/emergency_oxygen/plasma(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
@@ -76,21 +69,16 @@
/obj/item/storage/box/engineer
icon_state = "box_eng"
-/obj/item/storage/box/engineer/New()
- ..()
- contents = list()
- new /obj/item/clothing/mask/breath( src )
- new /obj/item/tank/internals/emergency_oxygen/engi( src )
- new /obj/item/reagent_containers/hypospray/autoinjector( src )
- new /obj/item/flashlight/flare/glowstick/emergency( src )
- return
+/obj/item/storage/box/engineer/populate_contents()
+ new /obj/item/clothing/mask/breath(src)
+ new /obj/item/tank/internals/emergency_oxygen/engi(src)
+ new /obj/item/reagent_containers/hypospray/autoinjector(src)
+ new /obj/item/flashlight/flare/glowstick/emergency(src)
/obj/item/storage/box/survival_mining
icon_state = "box_min"
-/obj/item/storage/box/survival_mining/New()
- ..()
- contents = list()
+/obj/item/storage/box/survival_mining/populate_contents()
new /obj/item/clothing/mask/gas/explorer(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/crowbar/red(src)
@@ -100,9 +88,7 @@
/obj/item/storage/box/survival_syndi
icon_state = "box_syndi"
-/obj/item/storage/box/survival_syndi/New()
- ..()
- contents = list()
+/obj/item/storage/box/survival_syndi/populate_contents()
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/tank/internals/emergency_oxygen/engi/syndi(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
@@ -114,31 +100,18 @@
desc = "Contains white gloves."
icon_state = "latex"
-/obj/item/storage/box/gloves/New()
- ..()
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
- new /obj/item/clothing/gloves/color/latex(src)
+/obj/item/storage/box/gloves/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/clothing/gloves/color/latex(src)
/obj/item/storage/box/masks
name = "sterile masks"
desc = "This box contains masks of sterility."
icon_state = "sterile"
-/obj/item/storage/box/masks/New()
- ..()
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
- new /obj/item/clothing/mask/surgical(src)
-
+/obj/item/storage/box/masks/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/clothing/mask/surgical(src)
/obj/item/storage/box/syringes
name = "syringes"
@@ -146,37 +119,24 @@
desc = "A biohazard alert warning is printed on the box"
icon_state = "syringe"
-/obj/item/storage/box/syringes/New()
- ..()
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
- new /obj/item/reagent_containers/syringe( src )
+/obj/item/storage/box/syringes/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/syringe(src)
/obj/item/storage/box/beakers
name = "beaker box"
icon_state = "beaker"
-/obj/item/storage/box/beakers/New()
- ..()
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
- new /obj/item/reagent_containers/glass/beaker( src )
+/obj/item/storage/box/beakers/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/glass/beaker(src)
/obj/item/storage/box/beakers/bluespace
name = "box of bluespace beakers"
icon_state = "beaker"
-/obj/item/storage/box/beakers/bluespace/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/beakers/bluespace/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/reagent_containers/glass/beaker/bluespace(src)
/obj/item/storage/box/iv_bags
@@ -184,48 +144,34 @@
desc = "A box full of empty IV bags."
icon_state = "beaker"
-/obj/item/storage/box/iv_bags/New()
- ..()
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
- new /obj/item/reagent_containers/iv_bag( src )
+/obj/item/storage/box/iv_bags/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/iv_bag(src)
/obj/item/storage/box/injectors
name = "\improper DNA injectors"
desc = "This box contains injectors it seems."
-/obj/item/storage/box/injectors/New()
- ..()
- new /obj/item/dnainjector/h2m(src)
- new /obj/item/dnainjector/h2m(src)
- new /obj/item/dnainjector/h2m(src)
- new /obj/item/dnainjector/m2h(src)
- new /obj/item/dnainjector/m2h(src)
- new /obj/item/dnainjector/m2h(src)
+/obj/item/storage/box/injectors/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/dnainjector/h2m(src)
/obj/item/storage/box/slug
name = "Ammunition Box (Slug)"
desc = "A small box capable of holding seven shotgun shells."
icon_state = "slugbox"
-/obj/item/storage/box/slug/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/slug/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun(src)
-
/obj/item/storage/box/buck
name = "Ammunition Box (Buckshot)"
desc = "A small box capable of holding seven shotgun shells."
icon_state = "buckshotbox"
-/obj/item/storage/box/buck/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/buck/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/buckshot(src)
/obj/item/storage/box/dragonsbreath
@@ -233,9 +179,8 @@
desc = "A small box capable of holding seven shotgun shells."
icon_state = "dragonsbreathbox"
-/obj/item/storage/box/dragonsbreath/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/dragonsbreath/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath(src)
/obj/item/storage/box/stun
@@ -243,9 +188,8 @@
desc = "A small box capable of holding seven shotgun shells."
icon_state = "stunbox"
-/obj/item/storage/box/stun/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/stun/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/stunslug(src)
/obj/item/storage/box/beanbag
@@ -253,9 +197,8 @@
desc = "A small box capable of holding seven shotgun shells."
icon_state = "beanbagbox"
-/obj/item/storage/box/beanbag/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/beanbag/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/beanbag(src)
/obj/item/storage/box/rubbershot
@@ -263,9 +206,8 @@
desc = "A small box capable of holding seven shotgun shells."
icon_state = "rubbershotbox"
-/obj/item/storage/box/rubbershot/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/rubbershot/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/rubbershot(src)
/obj/item/storage/box/tranquilizer
@@ -273,9 +215,8 @@
desc = "A small box capable of holding seven shotgun shells."
icon_state = "tranqbox"
-/obj/item/storage/box/tranquilizer/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/tranquilizer/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/ammo_casing/shotgun/tranquilizer(src)
/obj/item/storage/box/flashbangs
@@ -283,57 +224,36 @@
desc = "WARNING: These devices are extremely dangerous and can cause blindness or deafness in repeated use."
icon_state = "flashbang"
-/obj/item/storage/box/flashbangs/New()
- ..()
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
- new /obj/item/grenade/flashbang(src)
+/obj/item/storage/box/flashbangs/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/grenade/flashbang(src)
/obj/item/storage/box/flashes
name = "box of flashbulbs"
desc = "WARNING: Flashes can cause serious eye damage, protective eyewear is required."
icon_state = "flashbang"
-/obj/item/storage/box/flashes/New()
- ..()
- new /obj/item/flash(src)
- new /obj/item/flash(src)
- new /obj/item/flash(src)
- new /obj/item/flash(src)
- new /obj/item/flash(src)
- new /obj/item/flash(src)
+/obj/item/storage/box/flashes/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/flash(src)
/obj/item/storage/box/teargas
name = "box of tear gas grenades (WARNING)"
desc = "WARNING: These devices are extremely dangerous and can cause blindness and skin irritation."
icon_state = "flashbang"
-/obj/item/storage/box/teargas/New()
- ..()
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
- new /obj/item/grenade/chem_grenade/teargas(src)
+/obj/item/storage/box/teargas/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/grenade/chem_grenade/teargas(src)
/obj/item/storage/box/emps
name = "emp grenades"
desc = "A box with 5 emp grenades."
icon_state = "flashbang"
-/obj/item/storage/box/emps/New()
- ..()
- new /obj/item/grenade/empgrenade(src)
- new /obj/item/grenade/empgrenade(src)
- new /obj/item/grenade/empgrenade(src)
- new /obj/item/grenade/empgrenade(src)
- new /obj/item/grenade/empgrenade(src)
+/obj/item/storage/box/emps/populate_contents()
+ for(var/I in 1 to 5)
+ new /obj/item/grenade/empgrenade(src)
/obj/item/storage/box/trackimp
@@ -341,8 +261,7 @@
desc = "Box full of scum-bag tracking utensils."
icon_state = "implant"
-/obj/item/storage/box/trackimp/New()
- ..()
+/obj/item/storage/box/trackimp/populate_contents()
new /obj/item/implantcase/tracking(src)
new /obj/item/implantcase/tracking(src)
new /obj/item/implantcase/tracking(src)
@@ -356,8 +275,7 @@
desc = "For finding those who have died on the accursed lavaworld."
icon_state = "implant"
-/obj/item/storage/box/minertracker/New()
- ..()
+/obj/item/storage/box/minertracker/populate_contents()
new /obj/item/implantcase/tracking(src)
new /obj/item/implantcase/tracking(src)
new /obj/item/implantcase/tracking(src)
@@ -370,13 +288,9 @@
desc = "Box of stuff used to implant chemicals."
icon_state = "implant"
-/obj/item/storage/box/chemimp/New()
- ..()
- new /obj/item/implantcase/chem(src)
- new /obj/item/implantcase/chem(src)
- new /obj/item/implantcase/chem(src)
- new /obj/item/implantcase/chem(src)
- new /obj/item/implantcase/chem(src)
+/obj/item/storage/box/chemimp/populate_contents()
+ for(var/I in 1 to 5)
+ new /obj/item/implantcase/chem(src)
new /obj/item/implanter(src)
new /obj/item/implantpad(src)
@@ -385,13 +299,9 @@
desc = "Box of exile implants. It has a picture of a clown being booted through the Gateway."
icon_state = "implant"
-/obj/item/storage/box/exileimp/New()
- ..()
- new /obj/item/implantcase/exile(src)
- new /obj/item/implantcase/exile(src)
- new /obj/item/implantcase/exile(src)
- new /obj/item/implantcase/exile(src)
- new /obj/item/implantcase/exile(src)
+/obj/item/storage/box/exileimp/populate_contents()
+ for(var/I in 1 to 5)
+ new /obj/item/implantcase/exile(src)
new /obj/item/implanter(src)
/obj/item/storage/box/deathimp
@@ -399,14 +309,9 @@
desc = "Box of life sign monitoring implants."
icon_state = "implant"
-/obj/item/storage/box/deathimp/New()
- ..()
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
+/obj/item/storage/box/deathimp/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/implantcase/death_alarm(src)
new /obj/item/implanter(src)
/obj/item/storage/box/tapes
@@ -414,114 +319,60 @@
desc = "A box of spare recording tapes"
icon_state = "box"
-/obj/item/storage/box/tapes/New()
- ..()
- new /obj/item/tape(src)
- new /obj/item/tape(src)
- new /obj/item/tape(src)
- new /obj/item/tape(src)
- new /obj/item/tape(src)
- new /obj/item/tape(src)
+/obj/item/storage/box/tapes/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/tape(src)
/obj/item/storage/box/rxglasses
name = "prescription glasses"
desc = "This box contains nerd glasses."
icon_state = "glasses"
-/obj/item/storage/box/rxglasses/New()
- ..()
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
- new /obj/item/clothing/glasses/regular(src)
+/obj/item/storage/box/rxglasses/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/clothing/glasses/regular(src)
/obj/item/storage/box/drinkingglasses
name = "box of drinking glasses"
desc = "It has a picture of drinking glasses on it."
-/obj/item/storage/box/drinkingglasses/New()
- ..()
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
- new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
-
-/obj/item/storage/box/cdeathalarm_kit
- name = "Death Alarm Kit"
- desc = "Box of stuff used to implant death alarms."
- icon_state = "implant"
- item_state = "syringe_kit"
-
-/obj/item/storage/box/cdeathalarm_kit/New()
- ..()
- new /obj/item/implanter(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
- new /obj/item/implantcase/death_alarm(src)
+/obj/item/storage/box/drinkingglasses/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/reagent_containers/food/drinks/drinkingglass(src)
/obj/item/storage/box/condimentbottles
name = "box of condiment bottles"
desc = "It has a large ketchup smear on it."
-/obj/item/storage/box/condimentbottles/New()
- ..()
- new /obj/item/reagent_containers/food/condiment(src)
- new /obj/item/reagent_containers/food/condiment(src)
- new /obj/item/reagent_containers/food/condiment(src)
- new /obj/item/reagent_containers/food/condiment(src)
- new /obj/item/reagent_containers/food/condiment(src)
- new /obj/item/reagent_containers/food/condiment(src)
+/obj/item/storage/box/condimentbottles/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/reagent_containers/food/condiment(src)
/obj/item/storage/box/cups
name = "box of paper cups"
desc = "It has pictures of paper cups on the front."
-/obj/item/storage/box/cups/New()
- ..()
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
- new /obj/item/reagent_containers/food/drinks/sillycup( src )
-
+/obj/item/storage/box/cups/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/food/drinks/sillycup(src)
/obj/item/storage/box/donkpockets
name = "box of donk-pockets"
desc = "Instructions: Heat in microwave. Product will cool if not eaten within seven minutes."
icon_state = "donk_kit"
-/obj/item/storage/box/donkpockets/New()
- ..()
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
- new /obj/item/reagent_containers/food/snacks/donkpocket(src)
+/obj/item/storage/box/donkpockets/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/reagent_containers/food/snacks/donkpocket(src)
/obj/item/storage/box/syndidonkpockets
name = "box of donk-pockets"
desc = "This box feels slightly warm"
icon_state = "donk_kit"
-/obj/item/storage/box/syndidonkpockets/New()
- ..()
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
- new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
+/obj/item/storage/box/syndidonkpockets/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/reagent_containers/food/snacks/syndidonkpocket(src)
/obj/item/storage/box/monkeycubes
name = "monkey cube box"
@@ -532,9 +383,8 @@
can_hold = list(/obj/item/reagent_containers/food/snacks/monkeycube)
var/monkey_cube_type = /obj/item/reagent_containers/food/snacks/monkeycube
-/obj/item/storage/box/monkeycubes/New()
- ..()
- for(var/i in 1 to 5)
+/obj/item/storage/box/monkeycubes/populate_contents()
+ for(var/I in 1 to 5)
new monkey_cube_type(src)
/obj/item/storage/box/monkeycubes/syndicate
@@ -566,15 +416,9 @@
desc = "A box for containing construction permits, used to officially declare built rooms as additions to the station."
icon_state = "id"
-/obj/item/storage/box/permits/New()
- ..()
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
- new /obj/item/areaeditor/permit(src)
+/obj/item/storage/box/permits/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/areaeditor/permit(src)
/obj/item/storage/box/ids
@@ -582,23 +426,16 @@
desc = "Has so many empty IDs."
icon_state = "id"
-/obj/item/storage/box/ids/New()
- ..()
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
- new /obj/item/card/id(src)
+/obj/item/storage/box/ids/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/card/id(src)
/obj/item/storage/box/prisoner
name = "prisoner IDs"
desc = "Take away their last shred of dignity, their name."
icon_state = "id"
-/obj/item/storage/box/prisoner/New()
- ..()
+/obj/item/storage/box/prisoner/populate_contents()
new /obj/item/card/id/prisoner/one(src)
new /obj/item/card/id/prisoner/two(src)
new /obj/item/card/id/prisoner/three(src)
@@ -612,23 +449,16 @@
desc = "A box full of R.O.B.U.S.T. Cartridges, used by Security."
icon_state = "pda"
-/obj/item/storage/box/seccarts/New()
- ..()
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
- new /obj/item/cartridge/security(src)
+/obj/item/storage/box/seccarts/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/cartridge/security(src)
/obj/item/storage/box/holobadge
name = "holobadge box"
icon_state = "box_badge"
desc = "A box claiming to contain holobadges."
-/obj/item/storage/box/holobadge/New()
- ..()
+/obj/item/storage/box/holobadge/populate_contents()
new /obj/item/clothing/accessory/holobadge(src)
new /obj/item/clothing/accessory/holobadge(src)
new /obj/item/clothing/accessory/holobadge(src)
@@ -641,53 +471,35 @@
desc = "A box claiming to contain evidence bags."
icon_state = "box_evidence"
-/obj/item/storage/box/evidence/New()
- new /obj/item/evidencebag(src)
- new /obj/item/evidencebag(src)
- new /obj/item/evidencebag(src)
- new /obj/item/evidencebag(src)
- new /obj/item/evidencebag(src)
- new /obj/item/evidencebag(src)
- ..()
+/obj/item/storage/box/evidence/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/evidencebag(src)
/obj/item/storage/box/handcuffs
name = "spare handcuffs"
desc = "A box full of handcuffs."
icon_state = "handcuff"
-/obj/item/storage/box/handcuffs/New()
- ..()
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
- new /obj/item/restraints/handcuffs(src)
+/obj/item/storage/box/handcuffs/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/restraints/handcuffs(src)
/obj/item/storage/box/zipties
name = "box of spare zipties"
desc = "A box full of zipties."
icon_state = "handcuff"
-/obj/item/storage/box/zipties/New()
- ..()
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
- new /obj/item/restraints/handcuffs/cable/zipties(src)
+/obj/item/storage/box/zipties/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/restraints/handcuffs/cable/zipties(src)
/obj/item/storage/box/alienhandcuffs
name = "box of spare handcuffs"
desc = "A box full of handcuffs."
icon_state = "alienboxCuffs"
-/obj/item/storage/box/alienhandcuffs/New()
- ..()
- for(var/i in 1 to 7)
+/obj/item/storage/box/alienhandcuffs/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/restraints/handcuffs/alien(src)
/obj/item/storage/box/fakesyndiesuit
@@ -695,8 +507,7 @@
desc = "A sleek, sturdy box used to hold replica spacesuits."
icon_state = "box_of_doom"
-/obj/item/storage/box/fakesyndiesuit/New()
- ..()
+/obj/item/storage/box/fakesyndiesuit/populate_contents()
new /obj/item/clothing/head/syndicatefake(src)
new /obj/item/clothing/suit/syndicatefake(src)
@@ -705,8 +516,7 @@
desc = "A box marked with pictures of an enforcer pistol, two ammo clips, and the word 'NON-LETHAL'."
icon_state = "box_ert"
-/obj/item/storage/box/enforcer_rubber/New()
- ..()
+/obj/item/storage/box/enforcer_rubber/populate_contents()
new /obj/item/gun/projectile/automatic/pistol/enforcer(src) // loaded with rubber by default
new /obj/item/ammo_box/magazine/enforcer(src)
new /obj/item/ammo_box/magazine/enforcer(src)
@@ -716,8 +526,7 @@
desc = "A box marked with pictures of an enforcer pistol, two ammo clips, and the word 'LETHAL'."
icon_state = "box_ert"
-/obj/item/storage/box/enforcer_lethal/New()
- ..()
+/obj/item/storage/box/enforcer_lethal/populate_contents()
new /obj/item/gun/projectile/automatic/pistol/enforcer/lethal(src)
new /obj/item/ammo_box/magazine/enforcer/lethal(src)
new /obj/item/ammo_box/magazine/enforcer/lethal(src)
@@ -726,8 +535,7 @@
name = "bartender rare reagents kit"
desc = "A box intended for experienced bartenders."
-/obj/item/storage/box/bartender_rare_ingredients_kit/New()
- ..()
+/obj/item/storage/box/bartender_rare_ingredients_kit/populate_contents()
var/list/reagent_list = list("sacid", "radium", "ether", "methamphetamine", "plasma", "gold", "silver", "capsaicin", "psilocybin")
for(var/reag in reagent_list)
var/obj/item/reagent_containers/glass/bottle/B = new(src)
@@ -738,8 +546,7 @@
name = "chef rare reagents kit"
desc = "A box intended for experienced chefs."
-/obj/item/storage/box/chef_rare_ingredients_kit/New()
- ..()
+/obj/item/storage/box/chef_rare_ingredients_kit/populate_contents()
new /obj/item/reagent_containers/food/condiment/soysauce(src)
new /obj/item/reagent_containers/food/condiment/enzyme(src)
new /obj/item/reagent_containers/food/condiment/pack/hotsauce(src)
@@ -755,57 +562,34 @@
desc = "WARNING: Keep out of reach of children."
icon_state = "mousetraps"
-/obj/item/storage/box/mousetraps/New()
- ..()
- new /obj/item/assembly/mousetrap( src )
- new /obj/item/assembly/mousetrap( src )
- new /obj/item/assembly/mousetrap( src )
- new /obj/item/assembly/mousetrap( src )
- new /obj/item/assembly/mousetrap( src )
- new /obj/item/assembly/mousetrap( src )
+/obj/item/storage/box/mousetraps/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/assembly/mousetrap(src)
/obj/item/storage/box/pillbottles
name = "box of pill bottles"
desc = "It has pictures of pill bottles on its front."
-/obj/item/storage/box/pillbottles/New()
- ..()
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
- new /obj/item/storage/pill_bottle( src )
+/obj/item/storage/box/pillbottles/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/storage/pill_bottle(src)
/obj/item/storage/box/patch_packs
name = "box of patch packs"
desc = "It has pictures of patch packs on its front."
-/obj/item/storage/box/patch_packs/New()
- ..()
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
- new /obj/item/storage/pill_bottle/patch_pack(src)
+/obj/item/storage/box/patch_packs/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/storage/pill_bottle/patch_pack(src)
/obj/item/storage/box/bodybags
name = "body bags"
desc = "This box contains body bags."
icon_state = "bodybags"
-/obj/item/storage/box/bodybags/New()
- ..()
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
- new /obj/item/bodybag(src)
+/obj/item/storage/box/bodybags/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/bodybag(src)
/obj/item/storage/box/snappops
name = "snap pop box"
@@ -815,9 +599,8 @@
storage_slots = 8
can_hold = list(/obj/item/toy/snappop)
-/obj/item/storage/box/snappops/New()
- ..()
- for(var/i=1; i <= storage_slots; i++)
+/obj/item/storage/box/snappops/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/toy/snappop(src)
/obj/item/storage/box/matches
@@ -834,9 +617,8 @@
pickup_sound = 'sound/items/handling/matchbox_pickup.ogg'
can_hold = list(/obj/item/match)
-/obj/item/storage/box/matches/New()
- ..()
- for(var/i in 1 to storage_slots)
+/obj/item/storage/box/matches/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/match(src)
/obj/item/storage/box/matches/attackby(obj/item/match/W, mob/user, params)
@@ -850,9 +632,8 @@
desc = "Contains autoinjectors."
icon_state = "syringe"
-/obj/item/storage/box/autoinjectors/New()
- ..()
- for(var/i; i < storage_slots; i++)
+/obj/item/storage/box/autoinjectors/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
/obj/item/storage/box/autoinjector/utility
@@ -860,8 +641,7 @@
desc = "A box with several utility autoinjectors for the economical miner."
icon_state = "syringe"
-/obj/item/storage/box/autoinjector/utility/New()
- ..()
+/obj/item/storage/box/autoinjector/utility/populate_contents()
new /obj/item/reagent_containers/hypospray/autoinjector/teporone(src)
new /obj/item/reagent_containers/hypospray/autoinjector/teporone(src)
new /obj/item/reagent_containers/hypospray/autoinjector/stimpack(src)
@@ -874,34 +654,31 @@
icon_state = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
item_state = "syringe_kit"
- storage_slots=21
+ storage_slots = 21
can_hold = list(/obj/item/light/tube, /obj/item/light/bulb)
max_combined_w_class = 21
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try
-/obj/item/storage/box/lights/bulbs/New()
- ..()
- for(var/i = 0; i < 21; i++)
+/obj/item/storage/box/lights/bulbs/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/light/bulb(src)
/obj/item/storage/box/lights/tubes
name = "replacement tubes"
icon_state = "lighttube"
-/obj/item/storage/box/lights/tubes/New()
- ..()
- for(var/i = 0; i < 21; i++)
+/obj/item/storage/box/lights/tubes/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/light/tube(src)
/obj/item/storage/box/lights/mixed
name = "replacement lights"
icon_state = "lightmixed"
-/obj/item/storage/box/lights/mixed/New()
- ..()
- for(var/i = 0; i < 14; i++)
+/obj/item/storage/box/lights/mixed/populate_contents()
+ for(var/I in 1 to 14)
new /obj/item/light/tube(src)
- for(var/i = 0; i < 7; i++)
+ for(var/I in 1 to 7)
new /obj/item/light/bulb(src)
/obj/item/storage/box/barber
@@ -909,8 +686,7 @@
desc = "For all hairstyling needs."
icon_state = "implant"
-/obj/item/storage/box/barber/New()
- ..()
+/obj/item/storage/box/barber/populate_contents()
new /obj/item/scissors/barber(src)
new /obj/item/hair_dye_bottle(src)
new /obj/item/reagent_containers/glass/bottle/reagent/hairgrownium(src)
@@ -924,8 +700,7 @@
desc = "For all your lip coloring needs."
icon_state = "implant"
-/obj/item/storage/box/lip_stick/New()
- ..()
+/obj/item/storage/box/lip_stick/populate_contents()
new /obj/item/lipstick(src)
new /obj/item/lipstick/purple(src)
new /obj/item/lipstick/jade(src)
@@ -1006,9 +781,7 @@
storage_slots = 14
max_combined_w_class = 20
-/obj/item/storage/box/centcomofficer/New()
- ..()
- contents = list()
+/obj/item/storage/box/centcomofficer/populate_contents()
new /obj/item/clothing/mask/breath(src)
new /obj/item/tank/internals/emergency_oxygen/double(src)
new /obj/item/flashlight/seclite(src)
@@ -1026,8 +799,7 @@
name = "boxed survival kit"
icon_state = "box_ert"
-/obj/item/storage/box/responseteam/New()
- ..()
+/obj/item/storage/box/responseteam/populate_contents()
new /obj/item/clothing/mask/breath(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/flashlight/flare(src)
@@ -1046,31 +818,29 @@
/obj/item/storage/box/emptysandbags
name = "box of empty sandbags"
-/obj/item/storage/box/emptysandbags/New()
- ..()
- contents = list()
- for(var/i in 1 to 7)
+/obj/item/storage/box/emptysandbags/populate_contents()
+ for(var/I in 1 to 7)
new /obj/item/emptysandbag(src)
/obj/item/storage/box/rndboards
name = "the Liberator's legacy"
desc = "A box containing a gift for worthy golems."
-/obj/item/storage/box/rndboards/New()
- ..()
- contents = list()
+/obj/item/storage/box/rndboards/populate_contents()
new /obj/item/circuitboard/protolathe(src)
new /obj/item/circuitboard/destructive_analyzer(src)
new /obj/item/circuitboard/circuit_imprinter(src)
new /obj/item/circuitboard/rdconsole/public(src)
+/obj/item/storage/box/stockparts
+ display_contents_with_number = TRUE
+
/obj/item/storage/box/stockparts/basic //for ruins where it's a bad idea to give access to an autolathe/protolathe, but still want to make stock parts accessible
name = "box of stock parts"
desc = "Contains a variety of basic stock parts."
-/obj/item/storage/box/stockparts/basic/New()
- ..()
- for(var/i in 1 to 3)
+/obj/item/storage/box/stockparts/basic/populate_contents()
+ for(var/I in 1 to 3)
new /obj/item/stock_parts/capacitor(src)
new /obj/item/stock_parts/scanning_module(src)
new /obj/item/stock_parts/manipulator(src)
@@ -1081,9 +851,8 @@
name = "box of deluxe stock parts"
desc = "Contains a variety of deluxe stock parts."
-/obj/item/storage/box/stockparts/deluxe/New()
- ..()
- for(var/i in 1 to 3)
+/obj/item/storage/box/stockparts/deluxe/populate_contents()
+ for(var/I in 1 to 3)
new /obj/item/stock_parts/capacitor/quadratic(src)
new /obj/item/stock_parts/scanning_module/triphasic(src)
new /obj/item/stock_parts/manipulator/femto(src)
diff --git a/code/game/objects/items/weapons/storage/briefcase.dm b/code/game/objects/items/weapons/storage/briefcase.dm
index 55911d4ddc5..952da94ff73 100644
--- a/code/game/objects/items/weapons/storage/briefcase.dm
+++ b/code/game/objects/items/weapons/storage/briefcase.dm
@@ -19,8 +19,7 @@
desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding. Smells like L'Air du Temps."
force = 10
-/obj/item/storage/briefcase/sniperbundle/New()
- ..()
+/obj/item/storage/briefcase/sniperbundle/populate_contents()
new /obj/item/gun/projectile/automatic/sniper_rifle/syndicate(src)
new /obj/item/clothing/accessory/red(src)
new /obj/item/clothing/under/syndicate/sniper(src)
@@ -47,7 +46,7 @@
var/obj/item/gun/stored_gun = stored_item
stored_gun.afterattack(A, user, flag, params)
-/obj/item/storage/briefcase/false_bottomed/attackby(var/obj/item/I, mob/user)
+/obj/item/storage/briefcase/false_bottomed/attackby(obj/item/I, mob/user)
if(bottom_open)
if(stored_item)
to_chat(user, "There's already something in the false bottom!")
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index 98c6a439ac4..71852c60541 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -18,9 +18,9 @@
resistance_flags = FLAMMABLE
var/icon_type
-/obj/item/storage/fancy/update_icon(var/itemremoved = 0)
- var/total_contents = src.contents.len - itemremoved
- src.icon_state = "[src.icon_type]box[total_contents]"
+/obj/item/storage/fancy/update_icon(itemremoved = 0)
+ var/total_contents = length(contents) - itemremoved
+ icon_state = "[icon_type]box[total_contents]"
return
/obj/item/storage/fancy/examine(mob/user)
@@ -28,11 +28,11 @@
if(in_range(user, src))
var/len = LAZYLEN(contents)
if(len <= 0)
- . += "There are no [src.icon_type]s left in the box."
+ . += "There are no [icon_type]s left in the box."
else if(len == 1)
- . += "There is one [src.icon_type] left in the box."
+ . += "There is one [icon_type] left in the box."
else
- . += "There are [src.contents.len] [src.icon_type]s in the box."
+ . += "There are [length(contents)] [icon_type]s in the box."
/*
* Donut Box
@@ -51,23 +51,21 @@
/obj/item/storage/fancy/donut_box/update_icon()
overlays.Cut()
- for(var/i = 1 to length(contents))
- var/obj/item/reagent_containers/food/snacks/donut/donut = contents[i]
+ for(var/I = 1 to length(contents))
+ var/obj/item/reagent_containers/food/snacks/donut/donut = contents[I]
var/icon/new_donut_icon = icon('icons/obj/food/containers.dmi', "donut_[donut.donut_sprite_type]")
- new_donut_icon.Shift(EAST, 3 * (i-1))
+ new_donut_icon.Shift(EAST, 3 * (I-1))
overlays += new_donut_icon
overlays += icon('icons/obj/food/containers.dmi', "donutbox_front")
-/obj/item/storage/fancy/donut_box/New()
- ..()
- if(!empty)
- for(var/i = 1 to storage_slots)
- new /obj/item/reagent_containers/food/snacks/donut(src)
+/obj/item/storage/fancy/donut_box/populate_contents()
+ for(var/I in 1 to storage_slots)
+ new /obj/item/reagent_containers/food/snacks/donut(src)
update_icon()
-/obj/item/storage/fancy/donut_box/empty
- empty = TRUE
+/obj/item/storage/fancy/donut_box/empty/populate_contents()
+ return
/*
* Egg Box
@@ -81,11 +79,9 @@
storage_slots = 12
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
-/obj/item/storage/fancy/egg_box/New()
- ..()
- for(var/i=1; i <= storage_slots; i++)
+/obj/item/storage/fancy/egg_box/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/reagent_containers/food/snacks/egg(src)
- return
/*
* Candle Box
@@ -103,21 +99,17 @@
slot_flags = SLOT_BELT
-/obj/item/storage/fancy/candle_box/full/New()
- ..()
- for(var/i=1; i <= storage_slots; i++)
+/obj/item/storage/fancy/candle_box/full/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/candle(src)
- return
/obj/item/storage/fancy/candle_box/eternal
name = "Eternal Candle pack"
desc = "A pack of red candles made with a special wax."
-/obj/item/storage/fancy/candle_box/eternal/New()
- ..()
- for(var/i=1; i <= storage_slots; i++)
+/obj/item/storage/fancy/candle_box/eternal/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/candle/eternal(src)
- return
/*
* Crayon Box
@@ -135,8 +127,7 @@
/obj/item/toy/crayon
)
-/obj/item/storage/fancy/crayons/New()
- ..()
+/obj/item/storage/fancy/crayons/populate_contents()
new /obj/item/toy/crayon/red(src)
new /obj/item/toy/crayon/orange(src)
new /obj/item/toy/crayon/yellow(src)
@@ -151,9 +142,10 @@
for(var/obj/item/toy/crayon/crayon in contents)
overlays += image('icons/obj/crayons.dmi',crayon.colourName)
-/obj/item/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W,/obj/item/toy/crayon))
- switch(W:colourName)
+/obj/item/storage/fancy/crayons/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/toy/crayon))
+ var/obj/item/toy/crayon/C = I
+ switch(C.colourName)
if("mime")
to_chat(usr, "This crayon is too sad to be contained in this box.")
return
@@ -185,9 +177,8 @@
icon_type = "cigarette"
var/cigarette_type = /obj/item/clothing/mask/cigarette
-/obj/item/storage/fancy/cigarettes/New()
- ..()
- for(var/i = 1 to storage_slots)
+/obj/item/storage/fancy/cigarettes/populate_contents()
+ for(var/I in 1 to storage_slots)
new cigarette_type(src)
/obj/item/storage/fancy/cigarettes/update_icon()
@@ -227,7 +218,7 @@
to_chat(usr, "Putting [W] in [src] while lit probably isn't a good idea.")
return 0
//if we get this far, handle the insertion checks as normal
- .=..()
+ . = ..()
/obj/item/storage/fancy/cigarettes/decompile_act(obj/item/matter_decompiler/C, mob/user)
if(!length(contents))
@@ -249,8 +240,8 @@
icon_state = "robustpacket"
item_state = "robustpacket"
-/obj/item/storage/fancy/cigarettes/syndicate/New()
- ..()
+/obj/item/storage/fancy/cigarettes/syndicate/Initialize(mapload)
+ . = ..()
var/new_name = pick("evil", "suspicious", "ominous", "donk-flavored", "robust", "sneaky")
name = "[new_name] cigarette packet"
@@ -262,7 +253,7 @@
cigarette_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_med
- name = "Medical Marijuana Packet"
+ name = "\improper Medical Marijuana Packet"
desc = "A prescription packet containing six marijuana cigarettes."
icon_state = "medpacket"
item_state = "medpacket"
@@ -326,9 +317,8 @@
icon_type = "rolling paper"
can_hold = list(/obj/item/rollingpaper)
-/obj/item/storage/fancy/rollingpapers/New()
- ..()
- for(var/i in 1 to storage_slots)
+/obj/item/storage/fancy/rollingpapers/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/rollingpaper(src)
/obj/item/storage/fancy/rollingpapers/update_icon()
@@ -349,9 +339,8 @@
can_hold = list(/obj/item/reagent_containers/glass/beaker/vial)
-/obj/item/storage/fancy/vials/New()
- ..()
- for(var/i=1; i <= storage_slots; i++)
+/obj/item/storage/fancy/vials/populate_contents()
+ for(var/I in 1 to storage_slots)
new /obj/item/reagent_containers/glass/beaker/vial(src)
return
@@ -367,23 +356,21 @@
storage_slots = 6
req_access = list(ACCESS_VIROLOGY)
-/obj/item/storage/lockbox/vials/New()
- ..()
+/obj/item/storage/lockbox/vials/Initialize(mapload)
+ . = ..()
update_icon()
-/obj/item/storage/lockbox/vials/update_icon(var/itemremoved = 0)
- var/total_contents = src.contents.len - itemremoved
- src.icon_state = "vialbox[total_contents]"
- src.overlays.Cut()
+/obj/item/storage/lockbox/vials/update_icon()
+ icon_state = "vialbox[length(contents)]"
+ cut_overlays()
if(!broken)
overlays += image(icon, src, "led[locked]")
if(locked)
overlays += image(icon, src, "cover")
else
overlays += image(icon, src, "ledb")
- return
-/obj/item/storage/lockbox/vials/attackby(obj/item/W as obj, mob/user as mob, params)
+/obj/item/storage/lockbox/vials/attackby(obj/item/I, mob/user, params)
..()
update_icon()
@@ -402,8 +389,7 @@
/obj/item/storage/firstaid/aquatic_kit/full
desc = "It's a starter kit for an aquarium; includes 1 tank brush, 1 egg scoop, 1 fish net, 1 container of fish food and 1 fish bag."
-/obj/item/storage/firstaid/aquatic_kit/full/New()
- ..()
+/obj/item/storage/firstaid/aquatic_kit/full/populate_contents()
new /obj/item/egg_scoop(src)
new /obj/item/fish_net(src)
new /obj/item/tank_brush(src)
diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm
index d875e469464..ec00a0c4c08 100644
--- a/code/game/objects/items/weapons/storage/firstaid.dm
+++ b/code/game/objects/items/weapons/storage/firstaid.dm
@@ -32,28 +32,25 @@
item_state = "firstaid-ointment"
med_bot_skin = "ointment"
-/obj/item/storage/firstaid/fire/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/fire/Initialize(mapload)
+ . = ..()
icon_state = pick("ointment", "firefirstaid")
+
+/obj/item/storage/firstaid/fire/populate_contents()
new /obj/item/reagent_containers/applicator/burn(src)
new /obj/item/reagent_containers/food/pill/patch/silver_sulf/small(src)
new /obj/item/healthanalyzer(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
new /obj/item/reagent_containers/food/pill/salicylic(src)
-/obj/item/storage/firstaid/fire/empty
- empty = TRUE
+/obj/item/storage/firstaid/fire/empty/populate_contents()
+ return
/obj/item/storage/firstaid/regular
desc = "A general medical kit that contains medical patches for both brute damage and burn damage. Also contains an epinephrine syringe for emergency use and a health analyzer"
icon_state = "firstaid"
-/obj/item/storage/firstaid/regular/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/regular/populate_contents()
new /obj/item/reagent_containers/food/pill/patch/styptic(src)
new /obj/item/reagent_containers/food/pill/patch/styptic(src)
new /obj/item/reagent_containers/food/pill/salicylic(src)
@@ -62,14 +59,14 @@
new /obj/item/healthanalyzer(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
+/obj/item/storage/firstaid/regular/empty/populate_contents()
+ return
+
/obj/item/storage/firstaid/doctor
desc = "A general medical kit that contains medical patches for both brute damage and burn damage. Also contains an epinephrine syringe for emergency use and a health analyzer"
icon_state = "firstaid"
-/obj/item/storage/firstaid/doctor/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/doctor/populate_contents()
new /obj/item/reagent_containers/applicator/brute(src)
new /obj/item/reagent_containers/applicator/burn(src)
new /obj/item/reagent_containers/food/pill/patch/styptic(src)
@@ -85,21 +82,18 @@
item_state = "firstaid-toxin"
med_bot_skin = "tox"
-/obj/item/storage/firstaid/toxin/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/toxin/Initialize(mapload)
+ . = ..()
icon_state = pick("antitoxin", "antitoxfirstaid", "antitoxfirstaid2", "antitoxfirstaid3")
- new /obj/item/reagent_containers/syringe/charcoal(src)
- new /obj/item/reagent_containers/syringe/charcoal(src)
- new /obj/item/reagent_containers/syringe/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
+
+/obj/item/storage/firstaid/toxin/populate_contents()
+ for(var/I in 1 to 3)
+ new /obj/item/reagent_containers/syringe/charcoal(src)
+ new /obj/item/reagent_containers/food/pill/charcoal(src)
new /obj/item/healthanalyzer(src)
-/obj/item/storage/firstaid/toxin/empty
- empty = TRUE
+/obj/item/storage/firstaid/toxin/empty/populate_contents()
+ return
/obj/item/storage/firstaid/o2
name = "oxygen deprivation first aid kit"
@@ -108,18 +102,15 @@
item_state = "firstaid-o2"
med_bot_skin = "o2"
-/obj/item/storage/firstaid/o2/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/o2/populate_contents()
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/reagent_containers/food/pill/salbutamol(src)
new /obj/item/healthanalyzer(src)
-/obj/item/storage/firstaid/o2/empty
- empty = TRUE
+/obj/item/storage/firstaid/o2/empty/populate_contents()
+ return
/obj/item/storage/firstaid/brute
name = "brute trauma treatment kit"
@@ -128,19 +119,19 @@
item_state = "firstaid-brute"
med_bot_skin = "brute"
-/obj/item/storage/firstaid/brute/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/brute/Initialize(mapload)
+ . = ..()
icon_state = pick("brute", "brute2")
+
+/obj/item/storage/firstaid/brute/populate_contents()
new /obj/item/reagent_containers/applicator/brute(src)
new /obj/item/reagent_containers/food/pill/patch/styptic/small(src)
new /obj/item/healthanalyzer(src)
new /obj/item/reagent_containers/hypospray/autoinjector(src)
new /obj/item/stack/medical/bruise_pack(src)
-/obj/item/storage/firstaid/brute/empty
- empty = TRUE
+/obj/item/storage/firstaid/brute/empty/populate_contents()
+ return
/obj/item/storage/firstaid/adv
name = "advanced first-aid kit"
@@ -149,10 +140,7 @@
item_state = "firstaid-advanced"
med_bot_skin = "adv"
-/obj/item/storage/firstaid/adv/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/adv/populate_contents()
new /obj/item/stack/medical/bruise_pack(src)
new /obj/item/stack/medical/bruise_pack/advanced(src)
new /obj/item/stack/medical/bruise_pack/advanced(src)
@@ -161,8 +149,8 @@
new /obj/item/reagent_containers/hypospray/autoinjector(src)
new /obj/item/healthanalyzer(src)
-/obj/item/storage/firstaid/adv/empty
- empty = TRUE
+/obj/item/storage/firstaid/adv/empty/populate_contents()
+ return
/obj/item/storage/firstaid/machine
name = "machine repair kit"
@@ -171,19 +159,15 @@
item_state = "firstaid-machine"
med_bot_skin = "machine"
-/obj/item/storage/firstaid/machine/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/machine/populate_contents()
new /obj/item/weldingtool(src)
new /obj/item/stack/cable_coil(src)
new /obj/item/stack/cable_coil(src)
new /obj/item/stack/cable_coil(src)
new /obj/item/robotanalyzer(src)
-/obj/item/storage/firstaid/machine/empty
- empty = TRUE
-
+/obj/item/storage/firstaid/machine/empty/populate_contents()
+ return
/obj/item/storage/firstaid/tactical
name = "first-aid kit"
@@ -198,17 +182,14 @@
med_bot_skin = "bezerk"
syndicate_aligned = TRUE
-/obj/item/storage/firstaid/tactical/New()
- ..()
- if(empty)
- return
+/obj/item/storage/firstaid/tactical/populate_contents()
new /obj/item/reagent_containers/hypospray/combat(src)
new /obj/item/reagent_containers/applicator/dual/syndi(src) // Because you ain't got no time to look at what damage dey taking yo
new /obj/item/defibrillator/compact/combat/loaded(src)
new /obj/item/clothing/glasses/hud/health/night(src)
-/obj/item/storage/firstaid/tactical/empty
- empty = TRUE
+/obj/item/storage/firstaid/tactical/empty/populate_contents()
+ return
/obj/item/storage/firstaid/surgery
name = "field surgery kit"
@@ -220,8 +201,7 @@
can_hold = list(/obj/item/roller,/obj/item/bonesetter,/obj/item/bonegel, /obj/item/scalpel, /obj/item/hemostat,
/obj/item/cautery, /obj/item/retractor, /obj/item/FixOVein, /obj/item/surgicaldrill, /obj/item/circular_saw)
-/obj/item/storage/firstaid/surgery/New()
- ..()
+/obj/item/storage/firstaid/surgery/populate_contents()
new /obj/item/roller(src)
new /obj/item/bonesetter(src)
new /obj/item/bonegel(src)
@@ -263,8 +243,8 @@
/// The icon state of the wrapper overlay.
var/wrapper_state = "pillbottle_wrap"
-/obj/item/storage/pill_bottle/New()
- ..()
+/obj/item/storage/pill_bottle/Initialize(mapload)
+ . = ..()
base_name = name
if(allow_wrap)
apply_wrap()
@@ -294,16 +274,12 @@
/obj/item/storage/pill_bottle/ert
wrapper_color = COLOR_MAROON
-/obj/item/storage/pill_bottle/ert/New()
- ..()
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
+/obj/item/storage/pill_bottle/ert/populate_contents()
+ for(var/I in 1 to 3)
+ new /obj/item/reagent_containers/food/pill/salicylic(src)
+ new /obj/item/reagent_containers/food/pill/charcoal(src)
-/obj/item/storage/pill_bottle/MouseDrop(obj/over_object as obj) // Best utilized if you're a cantankerous doctor with a Vicodin habit.
+/obj/item/storage/pill_bottle/MouseDrop(obj/over_object) // Best utilized if you're a cantankerous doctor with a Vicodin habit.
if(iscarbon(over_object))
var/mob/living/carbon/C = over_object
if(loc == C && src == C.get_active_hand())
@@ -340,37 +316,23 @@
desc = "Contains pills used to counter toxins."
wrapper_color = COLOR_GREEN
-/obj/item/storage/pill_bottle/charcoal/New()
- ..()
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
- new /obj/item/reagent_containers/food/pill/charcoal(src)
+/obj/item/storage/pill_bottle/charcoal/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/food/pill/charcoal(src)
/obj/item/storage/pill_bottle/painkillers
name = "Pill Bottle (Salicylic Acid)"
desc = "Contains various pills for minor pain relief."
wrapper_color = COLOR_RED
-/obj/item/storage/pill_bottle/painkillers/New()
- ..()
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
- new /obj/item/reagent_containers/food/pill/salicylic(src)
+/obj/item/storage/pill_bottle/painkillers/populate_contents()
+ for(var/I in 1 to 8)
+ new /obj/item/reagent_containers/food/pill/salicylic(src)
/obj/item/storage/pill_bottle/fakedeath
allow_wrap = FALSE
-/obj/item/storage/pill_bottle/fakedeath/New()
- ..()
+/obj/item/storage/pill_bottle/fakedeath/populate_contents()
new /obj/item/reagent_containers/food/pill/fakedeath(src)
new /obj/item/reagent_containers/food/pill/fakedeath(src)
new /obj/item/reagent_containers/food/pill/fakedeath(src)
diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm
index 317655eeca1..278f1af1403 100644
--- a/code/game/objects/items/weapons/storage/internal.dm
+++ b/code/game/objects/items/weapons/storage/internal.dm
@@ -36,7 +36,7 @@
return 0
if(over_object == user && Adjacent(user)) // this must come before the screen objects only block
- src.open(user)
+ open(user)
return 0
if(!( istype(over_object, /obj/screen) ))
@@ -75,15 +75,15 @@
H.r_store = null
return 0
- src.add_fingerprint(user)
+ add_fingerprint(user)
if(master_item.loc == user)
- src.open(user)
+ open(user)
return 0
for(var/mob/M in range(1, master_item.loc))
if(M.s_active == src)
- src.close(M)
+ close(M)
return 1
-/obj/item/storage/internal/Adjacent(var/atom/neighbor)
+/obj/item/storage/internal/Adjacent(atom/neighbor)
return master_item.Adjacent(neighbor)
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index b67ba9154e3..851ca02a441 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -77,8 +77,7 @@
name = "Lockbox (Mindshield Implants)"
req_access = list(ACCESS_SECURITY)
-/obj/item/storage/lockbox/mindshield/New()
- ..()
+/obj/item/storage/lockbox/mindshield/populate_contents()
new /obj/item/implantcase/mindshield(src)
new /obj/item/implantcase/mindshield(src)
new /obj/item/implantcase/mindshield(src)
@@ -89,8 +88,7 @@
desc = "You have a bad feeling about opening this."
req_access = list(ACCESS_SECURITY)
-/obj/item/storage/lockbox/clusterbang/New()
- ..()
+/obj/item/storage/lockbox/clusterbang/populate_contents()
new /obj/item/grenade/clusterbuster(src)
/obj/item/storage/lockbox/medal
@@ -107,8 +105,7 @@
icon_closed = "medalbox"
icon_broken = "medalbox+b"
-/obj/item/storage/lockbox/medal/New()
- ..()
+/obj/item/storage/lockbox/medal/populate_contents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/leadership(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
@@ -119,8 +116,7 @@
desc = "Contains three T4 breaching charges."
req_access = list(ACCESS_CENT_SPECOPS)
-/obj/item/storage/lockbox/t4/New()
- ..()
+/obj/item/storage/lockbox/t4/populate_contents()
for(var/i in 0 to 2)
new /obj/item/grenade/plastic/x4/thermite(src)
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index e205ed76006..dd859ccd9ea 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -31,6 +31,10 @@
if(in_range(user, src))
. += "The service panel is [open ? "open" : "closed"]."
+/obj/item/storage/secure/populate_contents()
+ new /obj/item/paper(src)
+ new /obj/item/pen(src)
+
/obj/item/storage/secure/attackby(obj/item/W as obj, mob/user as mob, params)
if(locked)
if((istype(W, /obj/item/melee/energy/blade)) && (!emagged))
@@ -192,11 +196,6 @@
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
-/obj/item/storage/secure/briefcase/New()
- ..()
- handle_item_insertion(new /obj/item/paper, 1)
- handle_item_insertion(new /obj/item/pen, 1)
-
/obj/item/storage/secure/briefcase/attack_hand(mob/user as mob)
if((loc == user) && (locked == 1))
to_chat(usr, "[src] is locked and cannot be opened!")
@@ -218,10 +217,10 @@
/obj/item/storage/secure/briefcase/syndie
force = 15
-/obj/item/storage/secure/briefcase/syndie/New()
+/obj/item/storage/secure/briefcase/syndie/populate_contents()
..()
- for(var/i = 0, i < storage_slots - 2, i++)
- handle_item_insertion(new /obj/item/stack/spacecash/c1000, 1)
+ for(var/I in 1 to 5)
+ new /obj/item/stack/spacecash/c1000(src)
// -----------------------------
// Secure Safe
@@ -241,10 +240,5 @@
density = 0
cant_hold = list(/obj/item/storage/secure/briefcase)
-/obj/item/storage/secure/safe/New()
- ..()
- handle_item_insertion(new /obj/item/paper, 1)
- handle_item_insertion(new /obj/item/pen, 1)
-
/obj/item/storage/secure/safe/attack_hand(mob/user as mob)
return attack_self(user)
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 00dbe81a6ee..85aa8ca72cc 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -9,117 +9,167 @@
name = "storage"
icon = 'icons/obj/storage.dmi'
w_class = WEIGHT_CLASS_NORMAL
- var/silent = FALSE // No message on putting items in
- var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
- var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
- var/empty = FALSE // Will this spawn as an empty box
- var/max_w_class = WEIGHT_CLASS_SMALL //Max size of objects that this object can store (in effect only if can_hold isn't set)
- var/max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
- var/storage_slots = 7 //The number of storage slots in this container.
+ /// No message on putting items in.
+ var/silent = FALSE
+ /// List of objects which this item can store (if set, it can't store anything else)
+ var/list/can_hold = new/list()
+ /// List of objects which this item can't store (in effect only if can_hold isn't set)
+ var/list/cant_hold = new/list()
+ /// Max size of objects that this object can store (in effect only if can_hold isn't set)
+ var/max_w_class = WEIGHT_CLASS_SMALL
+ /// The sum of the w_classes of all the items in this storage item.
+ var/max_combined_w_class = 14
+ /// The number of storage slots in this container.
+ var/storage_slots = 7
var/obj/screen/storage/boxes = null
var/obj/screen/close/closer = null
- var/use_to_pickup //Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.
- var/display_contents_with_number //Set this to make the storage item group contents of the same type and display them as a number.
- var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
- var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
- var/pickup_all_on_tile = TRUE //FALSE = pick one at a time, TRUE = pick all on tile
- var/use_sound = "rustle" //sound played when used. null for no sound.
+
+ /// Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.
+ var/use_to_pickup = FALSE
+ /// Set this to make the storage item group contents of the same type and display them as a number.
+ var/display_contents_with_number
+ /// Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
+ var/allow_quick_empty
+ /// Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
+ var/allow_quick_gather
+ /// Pick up one item at a time or everything on the tile
+ var/pickup_all_on_tile = TRUE
+ /// Sound played when used. `null` for no sound.
+ var/use_sound = "rustle"
/// What kind of [/obj/item/stack] can this be folded into. (e.g. Boxes and cardboard)
var/foldable = null
/// How much of the stack item do you get.
var/foldable_amt = 0
+/obj/item/storage/Initialize(mapload)
+ . = ..()
+ can_hold = typecacheof(can_hold)
+ cant_hold = typecacheof(cant_hold)
+
+ if(allow_quick_empty)
+ verbs += /obj/item/storage/verb/quick_empty
+ else
+ verbs -= /obj/item/storage/verb/quick_empty
+
+ if(allow_quick_gather)
+ verbs += /obj/item/storage/verb/toggle_gathering_mode
+ else
+ verbs -= /obj/item/storage/verb/toggle_gathering_mode
+
+ populate_contents()
+
+ boxes = new /obj/screen/storage()
+ boxes.name = "storage"
+ boxes.master = src
+ boxes.icon_state = "block"
+ boxes.screen_loc = "7,7 to 10,8"
+ boxes.layer = HUD_LAYER
+ boxes.plane = HUD_PLANE
+ closer = new /obj/screen/close()
+ closer.master = src
+ closer.icon_state = "backpack_close"
+ closer.layer = ABOVE_HUD_LAYER
+ closer.plane = ABOVE_HUD_PLANE
+ orient2hud()
+
/obj/item/storage/MouseDrop(obj/over_object)
- if(ishuman(usr)) //so monkeys can take off their backpacks -- Urist
- var/mob/M = usr
+ if(!ismob(usr)) //so monkeys can take off their backpacks -- Urist
+ return
+ var/mob/M = usr
- if(istype(M.loc,/obj/mecha) || M.incapacitated(FALSE, TRUE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated
- return
+ if(istype(M.loc, /obj/mecha) || M.incapacitated(FALSE, TRUE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated
+ return
- if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
- if(M.s_active)
- M.s_active.close(M)
- show_to(M)
- return
+ if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
+ if(M.s_active)
+ M.s_active.close(M)
+ show_to(M)
+ return
- if((istype(over_object, /obj/structure/table) || istype(over_object, /turf/simulated/floor)) \
- && contents.len && loc == usr && !usr.stat && !usr.restrained() && usr.canmove && over_object.Adjacent(usr) \
- && !istype(src, /obj/item/storage/lockbox))
- var/turf/T = get_turf(over_object)
- if(istype(over_object, /turf/simulated/floor))
- if(get_turf(usr) != T)
- return // Can only empty containers onto the floor under you
- if("Yes" != alert(usr,"Empty \the [src] onto \the [T]?","Confirm","Yes","No"))
+ if((istype(over_object, /obj/structure/table) || isfloorturf(over_object)) && length(contents) \
+ && loc == M && !M.stat && !M.restrained() && M.canmove && over_object.Adjacent(M) && !istype(M, /obj/item/storage/lockbox)) // Worlds longest `if()`
+ var/turf/T = get_turf(over_object)
+ if(isfloorturf(over_object))
+ if(get_turf(M) != T)
+ return // Can only empty containers onto the floor under you
+ if(alert(M, "Empty [src] onto [T]?", "Confirm", "Yes", "No") != "Yes")
+ return
+ if(!(M && over_object && length(contents) && loc == M && !M.stat && !M.restrained() && M.canmove && get_turf(M) == T))
+ return // Something happened while the player was thinking
+ hide_from(M)
+ M.face_atom(over_object)
+ M.visible_message("[M] empties [src] onto [over_object].",
+ "You empty [src] onto [over_object].")
+ for(var/obj/item/I in contents)
+ remove_from_storage(I, T)
+ update_icon() // For content-sensitive icons
+ return
+
+ if(!(istype(over_object, /obj/screen)))
+ return ..()
+ if(!(loc == M) || (loc && loc.loc == M))
+ return
+ playsound(loc, "rustle", 50, 1, -5)
+ if(!M.restrained() && !M.stat)
+ switch(over_object.name)
+ if("r_hand")
+ if(!M.unEquip(src, silent = TRUE))
return
- if(!(usr && over_object && contents.len && loc == usr && !usr.stat && !usr.restrained() && usr.canmove && get_turf(usr) == T))
- return // Something happened while the player was thinking
- hide_from(usr)
- usr.face_atom(over_object)
- usr.visible_message("[usr] empties \the [src] onto \the [over_object].",
- "You empty \the [src] onto \the [over_object].")
- for(var/obj/item/I in contents)
- remove_from_storage(I, T)
- update_icon() // For content-sensitive icons
- return
-
- if(!(istype(over_object, /obj/screen)))
- return ..()
- if(!(loc == usr) || (loc && loc.loc == usr))
- return
- playsound(loc, "rustle", 50, TRUE, -5)
- if(!(M.restrained()) && !(M.stat))
- switch(over_object.name)
- if("r_hand")
- if(!M.unEquip(src, silent = TRUE))
- return
- M.put_in_r_hand(src)
- if("l_hand")
- if(!M.unEquip(src, silent = TRUE))
- return
- M.put_in_l_hand(src)
- add_fingerprint(usr)
- return
- if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
- if(usr.s_active)
- usr.s_active.close(usr)
- show_to(usr)
- return
+ M.put_in_r_hand(src)
+ if("l_hand")
+ if(!M.unEquip(src, silent = TRUE))
+ return
+ M.put_in_l_hand(src)
+ add_fingerprint(usr)
+ return
+ if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+ if(usr.s_active)
+ usr.s_active.close(usr)
+ show_to(usr)
/obj/item/storage/AltClick(mob/user)
+ . = ..()
if(ishuman(user) && Adjacent(user) && !user.incapacitated(FALSE, TRUE, TRUE))
show_to(user)
playsound(loc, "rustle", 50, TRUE, -5)
add_fingerprint(user)
else if(isobserver(user))
show_to(user)
- return ..()
+/**
+ * Loops through any nested containers inside `src`, and returns a list of everything inside them.
+ *
+ * Currently checks for storage containers, gifts containing storage containers, and folders.
+ */
/obj/item/storage/proc/return_inv()
var/list/L = list()
+ L += contents // Inventory of the main storage item
- L += contents
-
- for(var/obj/item/storage/S in src)
+ for(var/obj/item/storage/S in src) // Inventory of nested storage items
L += S.return_inv()
for(var/obj/item/gift/G in src)
L += G.gift
- if(istype(G.gift, /obj/item/storage))
- L += G.gift:return_inv()
+ if(istype(G.gift, /obj/item/storage)) // If the gift contains a storage item
+ var/obj/item/storage/S = G.gift
+ L += S.return_inv()
for(var/obj/item/folder/F in src)
L += F.contents
return L
+/**
+ * Shows `user` the contents of `src`, and activates any mouse trap style triggers.
+ */
/obj/item/storage/proc/show_to(mob/user)
if(!user.client)
return
- if(user.s_active != src)
+ if(user.s_active != src) // Switching from another container
for(var/obj/item/I in src)
- if(I.on_found(user))
- return
- orient2hud(user) // this only needs to happen to make .contents show properly as screen objects.
+ if(I.on_found(user)) // For mouse traps and such
+ return // If something triggered, don't open the UI
+ orient2hud(user) // this only needs to happen to make .contents show properly as screen objects.
if(user.s_active)
- user.s_active.hide_from(user)
+ user.s_active.hide_from(user) // If there's already an interface open, close it.
user.client.screen -= boxes
user.client.screen -= closer
user.client.screen -= contents
@@ -127,20 +177,20 @@
user.client.screen += closer
user.client.screen += contents
user.s_active = src
- return
+/**
+ * Hides the current container interface from `user`.
+ */
/obj/item/storage/proc/hide_from(mob/user)
if(!user.client)
return
-
user.client.screen -= boxes
user.client.screen -= closer
user.client.screen -= contents
if(user.s_active == src)
user.s_active = null
- return
-/obj/item/storage/proc/open(mob/user as mob)
+/obj/item/storage/proc/open(mob/user)
if(use_sound)
playsound(loc, use_sound, 50, TRUE, -5)
@@ -152,8 +202,14 @@
hide_from(user)
user.s_active = null
-//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
-//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
+/**
+ * Draws the inventory and places the items on it using custom positions.
+ *
+ * `tx` and `ty` are the upper left tile.
+ * `mx` and `my` are the bottom right tile.
+ *
+ * The numbers are calculated from the bottom left, with the bottom left being `1,1`.
+ */
/obj/item/storage/proc/orient_objs(tx, ty, mx, my)
var/cx = tx
var/cy = ty
@@ -211,125 +267,142 @@
//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
/obj/item/storage/proc/orient2hud(mob/user)
- var/adjusted_contents = contents.len
+ var/adjusted_contents = length(contents)
//Numbered contents display
- var/list/datum/numbered_display/display_contents
+ var/list/datum/numbered_display/numbered_contents
if(display_contents_with_number)
for(var/obj/O in contents)
O.layer = initial(O.layer)
O.plane = initial(O.plane)
- display_contents = list()
+ numbered_contents = list()
adjusted_contents = 0
for(var/obj/item/I in contents)
var/found = FALSE
- for(var/datum/numbered_display/ND in display_contents)
+ for(var/datum/numbered_display/ND in numbered_contents)
if(ND.sample_object.type == I.type && ND.sample_object.name == I.name)
ND.number++
found = TRUE
break
if(!found)
adjusted_contents++
- display_contents.Add(new/datum/numbered_display(I))
+ numbered_contents += new/datum/numbered_display(I)
- //var/mob/living/carbon/human/H = user
var/row_num = 0
var/col_count = min(7, storage_slots) - 1
if(adjusted_contents > 7)
row_num = round((adjusted_contents - 1) / 7) // 7 is the maximum allowed width.
- standard_orient_objs(row_num, col_count, display_contents)
+ standard_orient_objs(row_num, col_count, numbered_contents)
-//This proc returns TRUE if the item can be picked up and FALSE if it can't.
-//Set the stop_messages to stop it from printing messages
-/obj/item/storage/proc/can_be_inserted(obj/item/W, stop_messages = FALSE)
- if(!istype(W) || (W.flags & ABSTRACT)) //Not an item
+/**
+ * Checks whether `I` can be inserted into the container.
+ *
+ * Returns `TRUE` if it can, and `FALSE` if it can't.
+ * Arguments:
+ * * obj/item/I - The item to insert
+ * * stop_messages - Don't display a warning message if the item can't be inserted
+ */
+/obj/item/storage/proc/can_be_inserted(obj/item/I, stop_messages = FALSE)
+ if(!istype(I) || (I.flags & ABSTRACT)) // Not an item
return
- if(loc == W)
+ if(loc == I)
return FALSE //Means the item is already in the storage item
- if(contents.len >= storage_slots)
+
+ if(length(contents) >= storage_slots)
if(!stop_messages)
- to_chat(usr, "[W] won't fit in [src], make some space!")
+ to_chat(usr, "[I] won't fit in [src], make some space!")
return FALSE //Storage item is full
- if(can_hold.len)
- if(!is_type_in_typecache(W, can_hold))
+ if(length(can_hold))
+ if(!is_type_in_typecache(I, can_hold))
if(!stop_messages)
- to_chat(usr, "[src] cannot hold [W].")
+ to_chat(usr, "[src] cannot hold [I].")
return FALSE
- if(is_type_in_typecache(W, cant_hold)) //Check for specific items which this container can't hold.
+ if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
if(!stop_messages)
- to_chat(usr, "[src] cannot hold [W].")
+ to_chat(usr, "[src] cannot hold [I].")
return FALSE
- if(W.w_class > max_w_class)
+ if(I.w_class > max_w_class)
if(!stop_messages)
- to_chat(usr, "[W] is too big for [src].")
+ to_chat(usr, "[I] is too big for [src].")
return FALSE
- var/sum_w_class = W.w_class
- for(var/obj/item/I in contents)
- sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
+ var/sum_w_class = I.w_class
+ for(var/obj/item/item in contents)
+ sum_w_class += item.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
if(!stop_messages)
- to_chat(usr, "[src] is full, make some space.")
+ to_chat(usr, "[src] is full, make some space.")
return FALSE
- if(W.w_class >= w_class && (istype(W, /obj/item/storage)))
- if(!istype(src, /obj/item/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
+ if(I.w_class >= w_class && istype(I, /obj/item/storage))
+ if(!istype(src, /obj/item/storage/backpack/holding)) //BoHs should be able to hold backpacks again. The override for putting a BoH in a BoH is in backpack.dm.
if(!stop_messages)
- to_chat(usr, "[src] cannot hold [W] as it's a storage item of the same size.")
+ to_chat(usr, "[src] cannot hold [I] as it's a storage item of the same size.")
return FALSE //To prevent the stacking of same sized storage items.
- if(W.flags & NODROP) //SHOULD be handled in unEquip, but better safe than sorry.
- to_chat(usr, "\the [W] is stuck to your hand, you can't put it in \the [src]")
+ if(I.flags & NODROP) //SHOULD be handled in unEquip, but better safe than sorry.
+ to_chat(usr, "[I] is stuck to your hand, you can't put it in [src]")
return FALSE
return TRUE
-//This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted()
-//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once,
-//such as when picking up all the items on a tile with one click.
-/obj/item/storage/proc/handle_item_insertion(obj/item/W, prevent_warning = FALSE)
- if(!istype(W))
+/**
+ * Handles items being inserted into a storage container.
+ *
+ * This doesn't perform any checks of whether an item can be inserted. That's done by [/obj/item/storage/proc/can_be_inserted]
+ * Arguments:
+ * * obj/item/I - The item to be inserted
+ * * prevent_warning - Stop the insertion message being displayed. Intended for cases when you are inserting multiple items at once.
+ */
+/obj/item/storage/proc/handle_item_insertion(obj/item/I, prevent_warning = FALSE)
+ if(!istype(I))
return FALSE
if(usr)
- if(!usr.unEquip(W, silent = TRUE))
+ if(!usr.unEquip(I, silent = TRUE))
return FALSE
usr.update_icons() //update our overlays
if(silent)
prevent_warning = TRUE
- W.forceMove(src)
- W.on_enter_storage(src)
+ I.forceMove(src)
+ I.on_enter_storage(src)
if(usr)
if(usr.client && usr.s_active != src)
- usr.client.screen -= W
- W.dropped(usr, TRUE)
+ usr.client.screen -= I
+ I.dropped(usr, TRUE)
add_fingerprint(usr)
- if(!prevent_warning && !istype(W, /obj/item/gun/energy/kinetic_accelerator/crossbow))
+ if(!prevent_warning && !istype(I, /obj/item/gun/energy/kinetic_accelerator/crossbow))
for(var/mob/M in viewers(usr, null))
if(M == usr)
- to_chat(usr, "You put [W] into [src].")
+ to_chat(usr, "You put [I] into [src].")
else if(M in range(1)) //If someone is standing close enough, they can tell what it is...
- M.show_message("[usr] puts [W] into [src].")
- else if(W && W.w_class >= WEIGHT_CLASS_NORMAL) //Otherwise they can only see large or normal items from a distance...
- M.show_message("[usr] puts [W] into [src].")
+ M.show_message("[usr] puts [I] into [src].")
+ else if(I && I.w_class >= WEIGHT_CLASS_NORMAL) //Otherwise they can only see large or normal items from a distance...
+ M.show_message("[usr] puts [I] into [src].")
orient2hud(usr)
if(usr.s_active)
usr.s_active.show_to(usr)
- W.mouse_opacity = MOUSE_OPACITY_OPAQUE //So you can click on the area around the item to equip it, instead of having to pixel hunt
- W.in_inventory = TRUE
+ I.mouse_opacity = MOUSE_OPACITY_OPAQUE //So you can click on the area around the item to equip it, instead of having to pixel hunt
+ I.in_inventory = TRUE
update_icon()
return TRUE
-//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
-/obj/item/storage/proc/remove_from_storage(obj/item/W, atom/new_location)
- if(!istype(W))
+/**
+ * Handles the removal of an item from a storage container.
+ *
+ * Arguments:
+ * * obj/item/I - The item to be removed
+ * * atom/new_location - The location to send the item to.
+ */
+/obj/item/storage/proc/remove_from_storage(obj/item/I, atom/new_location)
+ if(!istype(I))
return FALSE
if(istype(src, /obj/item/storage/fancy))
@@ -337,32 +410,31 @@
F.update_icon(TRUE)
for(var/mob/M in range(1, loc))
- if(M.s_active == src)
- if(M.client)
- M.client.screen -= W
+ if((M.s_active == src) && M.client)
+ M.client.screen -= I
if(new_location)
if(ismob(loc))
- W.dropped(usr, TRUE)
+ I.dropped(usr, TRUE)
if(ismob(new_location))
- W.layer = ABOVE_HUD_LAYER
- W.plane = ABOVE_HUD_PLANE
+ I.layer = ABOVE_HUD_LAYER
+ I.plane = ABOVE_HUD_PLANE
else
- W.layer = initial(W.layer)
- W.plane = initial(W.plane)
- W.forceMove(new_location)
+ I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
+ I.forceMove(new_location)
else
- W.forceMove(get_turf(src))
+ I.forceMove(get_turf(src))
if(usr)
orient2hud(usr)
if(usr.s_active)
usr.s_active.show_to(usr)
- if(W.maptext)
- W.maptext = ""
- W.on_exit_storage(src)
+ if(I.maptext)
+ I.maptext = ""
+ I.on_exit_storage(src)
update_icon()
- W.mouse_opacity = initial(W.mouse_opacity)
+ I.mouse_opacity = initial(I.mouse_opacity)
return TRUE
/obj/item/storage/Exited(atom/A, loc)
@@ -389,25 +461,27 @@
return //Robots can't interact with storage items.
if(!can_be_inserted(I))
- if(contents.len >= storage_slots) //don't use items on the backpack if they don't fit
+ if(length(contents) >= storage_slots) //don't use items on the backpack if they don't fit
return TRUE
return FALSE
handle_item_insertion(I)
+
/obj/item/storage/attack_hand(mob/user)
playsound(loc, "rustle", 50, TRUE, -5)
if(ishuman(user))
var/mob/living/carbon/human/H = user
- if(H.l_store == src && !H.get_active_hand()) //Prevents opening if it's in a pocket.
- H.put_in_hands(src)
- H.l_store = null
- return
- if(H.r_store == src && !H.get_active_hand())
- H.put_in_hands(src)
- H.r_store = null
- return
+ if(!H.get_active_hand())
+ if(H.l_store == src) //Prevents opening if it's in a pocket.
+ H.put_in_hands(src)
+ H.l_store = null
+ return
+ if(H.r_store == src)
+ H.put_in_hands(src)
+ H.r_store = null
+ return
orient2hud(user)
if(loc == user)
@@ -454,34 +528,13 @@
remove_from_storage(I, T)
CHECK_TICK
-/obj/item/storage/New()
- ..()
- can_hold = typecacheof(can_hold)
- cant_hold = typecacheof(cant_hold)
-
- if(allow_quick_empty)
- verbs += /obj/item/storage/verb/quick_empty
- else
- verbs -= /obj/item/storage/verb/quick_empty
-
- if(allow_quick_gather)
- verbs += /obj/item/storage/verb/toggle_gathering_mode
- else
- verbs -= /obj/item/storage/verb/toggle_gathering_mode
-
- boxes = new /obj/screen/storage()
- boxes.name = "storage"
- boxes.master = src
- boxes.icon_state = "block"
- boxes.screen_loc = "7,7 to 10,8"
- boxes.layer = HUD_LAYER
- boxes.plane = HUD_PLANE
- closer = new /obj/screen/close()
- closer.master = src
- closer.icon_state = "backpack_close"
- closer.layer = ABOVE_HUD_LAYER
- closer.plane = ABOVE_HUD_PLANE
- orient2hud()
+/**
+ * Populates the container with items
+ *
+ * Override with whatever you want to put in the container
+ */
+/obj/item/storage/proc/populate_contents()
+ return // Override
/obj/item/storage/Destroy()
for(var/obj/O in contents)
@@ -493,8 +546,8 @@
/obj/item/storage/emp_act(severity)
..()
- for(var/i in contents)
- var/atom/A = i
+ for(var/I in contents)
+ var/atom/A = I
A.emp_act(severity)
/obj/item/storage/hear_talk(mob/living/M, list/message_pieces)
@@ -536,8 +589,12 @@
user.put_in_hands(I)
qdel(src)
-//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
-//Returns -1 if the atom was not found on container.
+/**
+ * Returns the storage depth of an atom up to the area level.
+ *
+ * The storage depth is the number of storage items the atom is contained in.
+ * Returns `-1` if the atom was not found in a container.
+ */
/atom/proc/storage_depth(atom/container)
var/depth = 0
var/atom/cur_atom = src
@@ -554,8 +611,11 @@
return depth
-//Like storage depth, but returns the depth to the nearest turf
-//Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow).
+/**
+ * Like [/atom/proc/storage_depth], but returns the depth to the nearest turf.
+ *
+ * Returns `-1` if there's no top level turf. (A loc was null somewhere, or a non-turf atom's loc was an area somehow.)
+ */
/atom/proc/storage_depth_turf()
var/depth = 0
var/atom/cur_atom = src
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index 2d96f7ef947..2f2eb9841cc 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -5,8 +5,8 @@
icon_state = "red"
item_state = "toolbox_red"
flags = CONDUCT
- force = 10.0
- throwforce = 10.0
+ force = 10
+ throwforce = 10
throw_speed = 2
throw_range = 7
w_class = WEIGHT_CLASS_BULKY
@@ -22,8 +22,7 @@
icon_state = "red"
item_state = "toolbox_red"
-/obj/item/storage/toolbox/emergency/New()
- ..()
+/obj/item/storage/toolbox/emergency/populate_contents()
new /obj/item/crowbar/red(src)
new /obj/item/weldingtool/mini(src)
new /obj/item/extinguisher/mini(src)
@@ -42,8 +41,7 @@
icon_state = "blue"
item_state = "toolbox_blue"
-/obj/item/storage/toolbox/mechanical/New()
- ..()
+/obj/item/storage/toolbox/mechanical/populate_contents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
@@ -63,8 +61,7 @@
icon_state = "yellow"
item_state = "toolbox_yellow"
-/obj/item/storage/toolbox/electrical/New()
- ..()
+/obj/item/storage/toolbox/electrical/populate_contents()
var/pickedcolor = pick(COLOR_RED, COLOR_YELLOW, COLOR_GREEN, COLOR_BLUE, COLOR_PINK, COLOR_ORANGE, COLOR_CYAN, COLOR_WHITE)
new /obj/item/screwdriver(src)
new /obj/item/wirecutters(src)
@@ -82,12 +79,11 @@
icon_state = "syndicate"
item_state = "toolbox_syndi"
origin_tech = "combat=2;syndicate=1;engineering=2"
- silent = 1
- force = 15.0
- throwforce = 18.0
+ silent = TRUE
+ force = 15
+ throwforce = 18
-/obj/item/storage/toolbox/syndicate/New()
- ..()
+/obj/item/storage/toolbox/syndicate/populate_contents()
new /obj/item/screwdriver(src, "red")
new /obj/item/wrench(src)
new /obj/item/weldingtool/largetank(src)
@@ -107,8 +103,7 @@
icon_state = "blue"
item_state = "toolbox_blue"
-/obj/item/storage/toolbox/drone/New()
- ..()
+/obj/item/storage/toolbox/drone/populate_contents()
var/pickedcolor = pick(pick(COLOR_RED, COLOR_YELLOW, COLOR_GREEN, COLOR_BLUE, COLOR_PINK, COLOR_ORANGE, COLOR_CYAN, COLOR_WHITE))
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
@@ -130,8 +125,7 @@
storage_slots = 28
attack_verb = list("robusted", "crushed", "smashed")
-/obj/item/storage/toolbox/brass/prefilled/New()
- ..()
+/obj/item/storage/toolbox/brass/prefilled/populate_contents()
new /obj/item/screwdriver/brass(src)
new /obj/item/wirecutters/brass(src)
new /obj/item/wrench/brass(src)
diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm
index ae8bd6ca3dc..2747be43612 100644
--- a/code/game/objects/items/weapons/storage/uplink_kits.dm
+++ b/code/game/objects/items/weapons/storage/uplink_kits.dm
@@ -1,127 +1,121 @@
-/obj/item/storage/box/syndicate/New()
- ..()
- switch(pickweight(list("bloodyspai" = 1, "thief" = 1, "bond" = 1, "sabotage" = 1, "payday" = 1, "implant" = 1, "hacker" = 1, "darklord" = 1, "professional" = 1)))
- if("bloodyspai") // 37TC + one 0TC
- new /obj/item/clothing/under/chameleon(src) // 2TC
- new /obj/item/clothing/mask/chameleon(src) // 0TC
- new /obj/item/card/id/syndicate(src) // 2TC
- new /obj/item/clothing/shoes/chameleon/noslip(src) // 2TC
- new /obj/item/camera_bug(src) // 1TC
- new /obj/item/multitool/ai_detect(src) // 1TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- new /obj/item/twohanded/garrote(src) // 10TC
- new /obj/item/pinpointer/advpinpointer(src) // 4TC
- new /obj/item/storage/fancy/cigarettes/cigpack_syndicate(src) // 2TC
- new /obj/item/flashlight/emp(src) // 2TC
- new /obj/item/clothing/glasses/hud/security/chameleon(src) // 2TC
- new /obj/item/chameleon(src) // 7TC
- return
+/obj/item/storage/box/syndicate // Traitor bundles
- if("thief") // 39TC
- new /obj/item/gun/energy/kinetic_accelerator/crossbow(src) // 12TC
- new /obj/item/chameleon(src) // 7TC
- new /obj/item/clothing/glasses/chameleon/thermal(src) // 6TC
- new /obj/item/clothing/gloves/color/black/thief(src) // 6TC
- new /obj/item/card/id/syndicate(src) // 2TC
- new /obj/item/clothing/shoes/chameleon/noslip(src) // 2TC
- new /obj/item/storage/backpack/satchel_flat(src) // 2TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/spy = list( // 37TC + one 0TC
+ /obj/item/clothing/under/chameleon, // 2TC
+ /obj/item/clothing/mask/chameleon, // 0TC
+ /obj/item/card/id/syndicate, // 2TC
+ /obj/item/clothing/shoes/chameleon/noslip, // 2TC
+ /obj/item/camera_bug, // 1TC
+ /obj/item/multitool/ai_detect, // 1TC
+ /obj/item/encryptionkey/syndicate, // 2TC
+ /obj/item/twohanded/garrote, // 10TC
+ /obj/item/pinpointer/advpinpointer, // 4TC
+ /obj/item/storage/fancy/cigarettes/cigpack_syndicate, // 2TC
+ /obj/item/flashlight/emp, // 2TC
+ /obj/item/clothing/glasses/hud/security/chameleon, // 2TC
+ /obj/item/chameleon) // 7TC
- if("bond") // 33TC + three 0TC
- new /obj/item/gun/projectile/automatic/pistol(src) // 4TC
- new /obj/item/suppressor(src) // 1TC
- new /obj/item/ammo_box/magazine/m10mm/hp(src) // 3TC
- new /obj/item/ammo_box/magazine/m10mm/ap(src) // 2TC
- new /obj/item/clothing/under/suit_jacket/really_black(src) // 0TC
- new /obj/item/card/id/syndicate(src) // 2TC
- new /obj/item/clothing/suit/storage/lawyer/blackjacket/armored(src) // 0TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- new /obj/item/reagent_containers/food/drinks/drinkingglass/alliescocktail(src) // 0TC
- new /obj/item/dnascrambler(src) // 4TC
- new /obj/item/storage/box/syndie_kit/emp(src) // 2TC
- new /obj/item/CQC_manual(src) // 13TC
- return
+ var/static/list/thief = list( // 39TC
+ /obj/item/gun/energy/kinetic_accelerator/crossbow, // 12TC
+ /obj/item/chameleon, // 7TC
+ /obj/item/clothing/glasses/chameleon/thermal, // 6TC
+ /obj/item/clothing/gloves/color/black/thief, // 6TC
+ /obj/item/card/id/syndicate, // 2TC
+ /obj/item/clothing/shoes/chameleon/noslip, // 2TC
+ /obj/item/storage/backpack/satchel_flat, // 2TC
+ /obj/item/encryptionkey/syndicate) // 2TC
- if("sabotage") // 41TC + two 0TC
- new /obj/item/grenade/plastic/c4(src) // 1TC
- new /obj/item/grenade/plastic/c4(src) // 1TC
- new /obj/item/camera_bug(src) // 1TC
- new /obj/item/powersink(src) // 10TC
- new /obj/item/cartridge/syndicate(src) // 6TC
- new /obj/item/rcd/preloaded(src) // 0TC
- new /obj/item/card/emag(src) // 6TC
- new /obj/item/clothing/gloves/color/yellow(src) // 0TC
- new /obj/item/grenade/syndieminibomb(src) // 6TC
- new /obj/item/grenade/clusterbuster/n2o(src) // 4TC
- new /obj/item/storage/box/syndie_kit/space(src) // 4TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/bond = list( // 33TC + three 0TC
+ /obj/item/gun/projectile/automatic/pistol, // 4TC
+ /obj/item/suppressor, // 1TC
+ /obj/item/ammo_box/magazine/m10mm/hp, // 3TC
+ /obj/item/ammo_box/magazine/m10mm/ap, // 2TC
+ /obj/item/clothing/under/suit_jacket/really_black, // 0TC
+ /obj/item/card/id/syndicate, // 2TC
+ /obj/item/clothing/suit/storage/lawyer/blackjacket/armored, // 0TC
+ /obj/item/encryptionkey/syndicate, // 2TC
+ /obj/item/reagent_containers/food/drinks/drinkingglass/alliescocktail, // 0TC
+ /obj/item/dnascrambler, // 4TC
+ /obj/item/storage/box/syndie_kit/emp, // 2TC
+ /obj/item/CQC_manual) // 13TC
- if("payday") // 35TC + four 0TC
- new /obj/item/gun/projectile/revolver(src) // 13TC
- new /obj/item/ammo_box/a357(src) // 3TC
- new /obj/item/ammo_box/a357(src) // 3TC
- new /obj/item/card/emag(src) // 6TC
- new /obj/item/jammer(src) // 5TC
- new /obj/item/card/id/syndicate(src) // 2TC
- new /obj/item/clothing/under/suit_jacket/really_black(src) //0TC
- new /obj/item/clothing/suit/storage/lawyer/blackjacket/armored(src) //0TC
- new /obj/item/clothing/gloves/color/latex/nitrile(src) //0 TC
- new /obj/item/clothing/mask/gas/clown_hat(src) // 0TC
- new /obj/item/thermal_drill/diamond_drill(src) // 1TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/sabotage = list( // 41TC + two 0TC
+ /obj/item/grenade/plastic/c4, // 1TC
+ /obj/item/grenade/plastic/c4, // 1TC
+ /obj/item/camera_bug, // 1TC
+ /obj/item/powersink, // 10TC
+ /obj/item/cartridge/syndicate, // 6TC
+ /obj/item/rcd/preloaded, // 0TC
+ /obj/item/card/emag, // 6TC
+ /obj/item/clothing/gloves/color/yellow, // 0TC
+ /obj/item/grenade/syndieminibomb, // 6TC
+ /obj/item/grenade/clusterbuster/n2o, // 4TC
+ /obj/item/storage/box/syndie_kit/space, // 4TC
+ /obj/item/encryptionkey/syndicate) // 2TC
- if("implant") // 39TC + ten free TC
- new /obj/item/implanter/freedom(src) // 5TC
- new /obj/item/implanter/uplink(src) // 14TC (ten free TC)
- new /obj/item/implanter/emp(src) // 0TC
- new /obj/item/implanter/adrenalin(src) // 8TC
- new /obj/item/implanter/explosive(src) // 2TC
- new /obj/item/implanter/storage(src) // 8TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/payday = list( // 35TC + four 0TC
+ /obj/item/gun/projectile/revolver, // 13TC
+ /obj/item/ammo_box/a357, // 3TC
+ /obj/item/ammo_box/a357, // 3TC
+ /obj/item/card/emag, // 6TC
+ /obj/item/jammer, // 5TC
+ /obj/item/card/id/syndicate, // 2TC
+ /obj/item/clothing/under/suit_jacket/really_black, //0TC
+ /obj/item/clothing/suit/storage/lawyer/blackjacket/armored, //0TC
+ /obj/item/clothing/gloves/color/latex/nitrile, //0 TC
+ /obj/item/clothing/mask/gas/clown_hat, // 0TC
+ /obj/item/thermal_drill/diamond_drill, // 1TC
+ /obj/item/encryptionkey/syndicate) // 2TC
- if("hacker") // 37TC + two 0TC
- new /obj/item/aiModule/syndicate(src) // 12TC
- new /obj/item/card/emag(src) // 6TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- new /obj/item/encryptionkey/binary(src) // 5TC
- new /obj/item/aiModule/toyAI(src) // 0TC
- new /obj/item/clothing/glasses/chameleon/thermal(src) // 6TC
- new /obj/item/storage/belt/military/traitor/hacker(src) // 3TC
- new /obj/item/clothing/gloves/combat(src) // 0TC
- new /obj/item/multitool/ai_detect(src) // 1TC
- new /obj/item/flashlight/emp(src) // 2TC
- return
+ var/static/list/implant = list( // 39TC + ten free TC
+ /obj/item/implanter/freedom, // 5TC
+ /obj/item/implanter/uplink, // 14TC (ten free TC)
+ /obj/item/implanter/emp, // 0TC
+ /obj/item/implanter/adrenalin, // 8TC
+ /obj/item/implanter/explosive, // 2TC
+ /obj/item/implanter/storage, // 8TC
+ /obj/item/encryptionkey/syndicate) // 2TC
- if("darklord") // 24TC + two 0TC
- new /obj/item/melee/energy/sword/saber/red(src) // 8TC
- new /obj/item/melee/energy/sword/saber/red(src) // 8TC
- new /obj/item/dnainjector/telemut/darkbundle(src) // 0TC
- new /obj/item/clothing/suit/hooded/chaplain_hoodie(src) // 0TC
- new /obj/item/card/id/syndicate(src) // 2TC
- new /obj/item/clothing/shoes/chameleon/noslip(src) // 2TC
- new /obj/item/clothing/mask/chameleon(src) // 2TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/hacker = list( // 37TC + two 0TC
+ /obj/item/aiModule/syndicate, // 12TC
+ /obj/item/card/emag, // 6TC
+ /obj/item/encryptionkey/syndicate, // 2TC
+ /obj/item/encryptionkey/binary, // 5TC
+ /obj/item/aiModule/toyAI, // 0TC
+ /obj/item/clothing/glasses/chameleon/thermal, // 6TC
+ /obj/item/storage/belt/military/traitor/hacker, // 3TC
+ /obj/item/clothing/gloves/combat, // 0TC
+ /obj/item/multitool/ai_detect, // 1TC
+ /obj/item/flashlight/emp) // 2TC
- if("professional") // 34TC + two 0TC
- new /obj/item/gun/projectile/automatic/sniper_rifle/syndicate/penetrator(src) // 16TC
- new /obj/item/ammo_box/magazine/sniper_rounds/penetrator(src) // 5TC
- new /obj/item/ammo_box/magazine/sniper_rounds/soporific(src) // 3TC
- new /obj/item/clothing/glasses/chameleon/thermal(src) // 6TC
- new /obj/item/clothing/gloves/combat(src) // 0 TC
- new /obj/item/clothing/under/suit_jacket/really_black(src) // 0 TC
- new /obj/item/clothing/suit/storage/lawyer/blackjacket/armored(src) // 0TC
- new /obj/item/pen/edagger(src) // 2TC
- new /obj/item/encryptionkey/syndicate(src) // 2TC
- return
+ var/static/list/darklord = list( // 24TC + two 0TC
+ /obj/item/melee/energy/sword/saber/red, // 8TC
+ /obj/item/melee/energy/sword/saber/red, // 8TC
+ /obj/item/dnainjector/telemut/darkbundle, // 0TC
+ /obj/item/clothing/suit/hooded/chaplain_hoodie, // 0TC
+ /obj/item/card/id/syndicate, // 2TC
+ /obj/item/clothing/shoes/chameleon/noslip, // 2TC
+ /obj/item/clothing/mask/chameleon, // 2TC
+ /obj/item/encryptionkey/syndicate) // 2TC
+
+ var/static/list/professional = list( // 34TC + two 0TC
+ /obj/item/gun/projectile/automatic/sniper_rifle/syndicate/penetrator, // 16TC
+ /obj/item/ammo_box/magazine/sniper_rounds/penetrator, // 5TC
+ /obj/item/ammo_box/magazine/sniper_rounds/soporific, // 3TC
+ /obj/item/clothing/glasses/chameleon/thermal, // 6TC
+ /obj/item/clothing/gloves/combat, // 0 TC
+ /obj/item/clothing/under/suit_jacket/really_black, // 0 TC
+ /obj/item/clothing/suit/storage/lawyer/blackjacket/armored, // 0TC
+ /obj/item/pen/edagger, // 2TC
+ /obj/item/encryptionkey/syndicate) // 2TC
+
+/obj/item/storage/box/syndicate/populate_contents()
+ var/list/bundle = pick(spy, thief, bond, sabotage, payday, implant, hacker, darklord, professional)
+ for(var/item in bundle)
+ new item(src)
/obj/item/storage/box/syndie_kit
- name = "Box"
- desc = "A sleek, sturdy box"
+ desc = "A sleek, sturdy box."
icon_state = "box_of_doom"
/obj/item/storage/box/syndie_kit/space
@@ -129,21 +123,18 @@
can_hold = list(/obj/item/clothing/suit/space/syndicate/black/red, /obj/item/clothing/head/helmet/space/syndicate/black/red, /obj/item/tank/internals/emergency_oxygen/engi/syndi, /obj/item/clothing/mask/gas/syndicate)
max_w_class = WEIGHT_CLASS_NORMAL
-/obj/item/storage/box/syndie_kit/space/New()
- ..()
+/obj/item/storage/box/syndie_kit/space/populate_contents()
new /obj/item/clothing/suit/space/syndicate/black/red(src)
new /obj/item/clothing/head/helmet/space/syndicate/black/red(src)
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/tank/internals/emergency_oxygen/engi/syndi(src)
- return
/obj/item/storage/box/syndie_kit/hardsuit
name = "Boxed Blood Red Suit and Helmet"
can_hold = list(/obj/item/clothing/suit/space/hardsuit/syndi, /obj/item/tank/internals/emergency_oxygen/engi/syndi, /obj/item/clothing/mask/gas/syndicate)
max_w_class = WEIGHT_CLASS_NORMAL
-/obj/item/storage/box/syndie_kit/hardsuit/New()
- ..()
+/obj/item/storage/box/syndie_kit/hardsuit/populate_contents()
new /obj/item/clothing/suit/space/hardsuit/syndi(src)
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/tank/internals/emergency_oxygen/engi/syndi(src)
@@ -151,29 +142,21 @@
/obj/item/storage/box/syndie_kit/conversion
name = "box (CK)"
-/obj/item/storage/box/syndie_kit/conversion/New()
- ..()
+/obj/item/storage/box/syndie_kit/conversion/populate_contents()
new /obj/item/conversion_kit(src)
new /obj/item/ammo_box/a357(src)
- return
/obj/item/storage/box/syndie_kit/boolets
name = "Shotgun shells"
-/obj/item/storage/box/syndie_kit/boolets/New()
- ..()
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
- new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
+/obj/item/storage/box/syndie_kit/boolets/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/ammo_casing/shotgun/fakebeanbag(src)
/obj/item/storage/box/syndie_kit/emp
name = "boxed EMP kit"
-/obj/item/storage/box/syndie_kit/emp/New()
- ..()
+/obj/item/storage/box/syndie_kit/emp/populate_contents()
new /obj/item/grenade/empgrenade(src)
new /obj/item/grenade/empgrenade(src)
new /obj/item/implanter/emp/(src)
@@ -181,13 +164,9 @@
/obj/item/storage/box/syndie_kit/c4
name = "Pack of C-4 Explosives"
-/obj/item/storage/box/syndie_kit/c4/New()
- ..()
- new /obj/item/grenade/plastic/c4(src)
- new /obj/item/grenade/plastic/c4(src)
- new /obj/item/grenade/plastic/c4(src)
- new /obj/item/grenade/plastic/c4(src)
- new /obj/item/grenade/plastic/c4(src)
+/obj/item/storage/box/syndie_kit/c4/populate_contents()
+ for(var/I in 1 to 5)
+ new /obj/item/grenade/plastic/c4(src)
/obj/item/storage/box/syndie_kit/throwing_weapons
name = "boxed throwing kit"
@@ -195,21 +174,16 @@
max_combined_w_class = 16
max_w_class = WEIGHT_CLASS_NORMAL
-/obj/item/storage/box/syndie_kit/throwing_weapons/New()
- ..()
- new /obj/item/throwing_star(src)
- new /obj/item/throwing_star(src)
- new /obj/item/throwing_star(src)
- new /obj/item/throwing_star(src)
- new /obj/item/throwing_star(src)
+/obj/item/storage/box/syndie_kit/throwing_weapons/populate_contents()
+ for(var/I in 1 to 5)
+ new /obj/item/throwing_star(src)
new /obj/item/restraints/legcuffs/bola/tactical(src)
new /obj/item/restraints/legcuffs/bola/tactical(src)
/obj/item/storage/box/syndie_kit/sarin
name = "Sarin Gas Grenades"
-/obj/item/storage/box/syndie_kit/sarin/New()
- ..()
+/obj/item/storage/box/syndie_kit/sarin/populate_contents()
new /obj/item/grenade/chem_grenade/saringas(src)
new /obj/item/grenade/chem_grenade/saringas(src)
new /obj/item/grenade/chem_grenade/saringas(src)
@@ -218,43 +192,29 @@
/obj/item/storage/box/syndie_kit/bioterror
name = "bioterror syringe box"
-/obj/item/storage/box/syndie_kit/bioterror/New()
- ..()
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- new /obj/item/reagent_containers/syringe/bioterror(src)
- return
+/obj/item/storage/box/syndie_kit/bioterror/populate_contents()
+ for(var/I in 1 to 7)
+ new /obj/item/reagent_containers/syringe/bioterror(src)
/obj/item/storage/box/syndie_kit/caneshotgun
name = "cane gun kit"
-/obj/item/storage/box/syndie_kit/caneshotgun/New()
- ..()
- new /obj/item/ammo_casing/shotgun/assassination(src)
- new /obj/item/ammo_casing/shotgun/assassination(src)
- new /obj/item/ammo_casing/shotgun/assassination(src)
- new /obj/item/ammo_casing/shotgun/assassination(src)
- new /obj/item/ammo_casing/shotgun/assassination(src)
- new /obj/item/ammo_casing/shotgun/assassination(src)
+/obj/item/storage/box/syndie_kit/caneshotgun/populate_contents()
+ for(var/I in 1 to 6)
+ new /obj/item/ammo_casing/shotgun/assassination(src)
new /obj/item/gun/projectile/revolver/doublebarrel/improvised/cane(src)
/obj/item/storage/box/syndie_kit/fake_revolver
name = "trick revolver kit"
-/obj/item/storage/box/syndie_kit/fake_revolver/New()
- ..()
+/obj/item/storage/box/syndie_kit/fake_revolver/populate_contents()
new /obj/item/toy/russian_revolver/trick_revolver(src)
/obj/item/storage/box/syndie_kit/mimery
name = "advanced mimery kit"
-/obj/item/storage/box/syndie_kit/mimery/New()
- ..()
+/obj/item/storage/box/syndie_kit/mimery/populate_contents()
new /obj/item/spellbook/oneuse/mime/greaterwall(src)
new /obj/item/spellbook/oneuse/mime/fingergun(src)
@@ -262,8 +222,7 @@
/obj/item/storage/box/syndie_kit/atmosn2ogrenades
name = "Atmos N2O Grenades"
-/obj/item/storage/box/syndie_kit/atmosn2ogrenades/New()
- ..()
+/obj/item/storage/box/syndie_kit/atmosn2ogrenades/populate_contents()
new /obj/item/grenade/clusterbuster/n2o(src)
new /obj/item/grenade/clusterbuster/n2o(src)
@@ -271,8 +230,7 @@
/obj/item/storage/box/syndie_kit/atmosfiregrenades
name = "Plasma Fire Grenades"
-/obj/item/storage/box/syndie_kit/atmosfiregrenades/New()
- ..()
+/obj/item/storage/box/syndie_kit/atmosfiregrenades/populate_contents()
new /obj/item/grenade/clusterbuster/plasma(src)
new /obj/item/grenade/clusterbuster/plasma(src)
@@ -280,8 +238,7 @@
/obj/item/storage/box/syndie_kit/missionary_set
name = "Missionary Starter Kit"
-/obj/item/storage/box/syndie_kit/missionary_set/New()
- ..()
+/obj/item/storage/box/syndie_kit/missionary_set/populate_contents()
new /obj/item/nullrod/missionary_staff(src)
new /obj/item/clothing/suit/hooded/chaplain_hoodie/missionary_robe(src)
var/obj/item/storage/bible/B = new /obj/item/storage/bible(src)
@@ -294,8 +251,7 @@
/obj/item/storage/box/syndie_kit/cutouts
name = "Fortified Artistic Box"
-/obj/item/storage/box/syndie_kit/cutouts/New()
- ..()
+/obj/item/storage/box/syndie_kit/cutouts/populate_contents()
for(var/i in 1 to 3)
new/obj/item/cardboard_cutout/adaptive(src)
new/obj/item/toy/crayon/spraycan(src)
@@ -304,8 +260,7 @@
name = "bone repair kit"
desc = "A box containing one prototype field bone repair kit."
-/obj/item/storage/box/syndie_kit/bonerepair/New()
- ..()
+/obj/item/storage/box/syndie_kit/bonerepair/populate_contents()
new /obj/item/reagent_containers/hypospray/autoinjector/nanocalcium(src)
var/obj/item/paper/P = new /obj/item/paper(src)
P.name = "Bone repair guide"
@@ -324,8 +279,7 @@ To apply, hold the injector a short distance away from the outer thigh before ap
name = "Safe-cracking Kit"
desc = "Everything you need to quietly open a mechanical combination safe."
-/obj/item/storage/box/syndie_kit/safecracking/New()
- ..()
+/obj/item/storage/box/syndie_kit/safecracking/populate_contents()
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/clothing/mask/balaclava(src)
new /obj/item/clothing/accessory/stethoscope(src)
@@ -334,8 +288,7 @@ To apply, hold the injector a short distance away from the outer thigh before ap
/obj/item/storage/box/syndie_kit/chameleon
name = "chameleon kit"
-/obj/item/storage/box/syndie_kit/chameleon/New()
- ..()
+/obj/item/storage/box/syndie_kit/chameleon/populate_contents()
new /obj/item/clothing/under/chameleon(src)
new /obj/item/clothing/suit/chameleon(src)
new /obj/item/clothing/gloves/chameleon(src)
@@ -351,10 +304,8 @@ To apply, hold the injector a short distance away from the outer thigh before ap
/obj/item/storage/box/syndie_kit/dart_gun
name = "dart gun kit"
-/obj/item/storage/box/syndie_kit/dart_gun/New()
- ..()
+/obj/item/storage/box/syndie_kit/dart_gun/populate_contents()
new /obj/item/gun/syringe/syndicate(src)
new /obj/item/reagent_containers/syringe/capulettium_plus(src)
new /obj/item/reagent_containers/syringe/sarin(src)
new /obj/item/reagent_containers/syringe/pancuronium(src)
-
diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm
index 197a3cad49f..a2f52ff243b 100644
--- a/code/game/objects/items/weapons/storage/wallets.dm
+++ b/code/game/objects/items/weapons/storage/wallets.dm
@@ -74,29 +74,20 @@
else
return ..()
-/obj/item/storage/wallet/random/New()
- ..()
- var/item1_type = pick(/obj/item/stack/spacecash,
+/obj/item/storage/wallet/random/populate_contents()
+ var/cash = pick(/obj/item/stack/spacecash,
/obj/item/stack/spacecash/c10,
/obj/item/stack/spacecash/c100,
/obj/item/stack/spacecash/c500,
/obj/item/stack/spacecash/c1000)
- var/item2_type
- if(prob(50))
- item2_type = pick(/obj/item/stack/spacecash,
- /obj/item/stack/spacecash/c10,
- /obj/item/stack/spacecash/c100,
- /obj/item/stack/spacecash/c500,
- /obj/item/stack/spacecash/c1000)
- var/item3_type = pick( /obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/gold, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/iron )
+ var/coin = pickweight(list(/obj/item/coin/iron = 3,
+ /obj/item/coin/silver = 2,
+ /obj/item/coin/gold = 1))
- spawn(2)
- if(item1_type)
- new item1_type(src)
- if(item2_type)
- new item2_type(src)
- if(item3_type)
- new item3_type(src)
+ new cash(src)
+ if(prob(50)) // 50% chance of a second
+ new cash(src)
+ new coin(src)
//////////////////////////////////////
// Color Wallets //
@@ -107,11 +98,11 @@
desc = "A cheap wallet from the arcade."
storage_slots = 5 //smaller storage than normal wallets
-/obj/item/storage/wallet/color/New()
- ..()
+/obj/item/storage/wallet/color/Initialize(mapload)
+ . = ..()
if(!item_color)
var/color_wallet = pick(subtypesof(/obj/item/storage/wallet/color))
- new color_wallet(src.loc)
+ new color_wallet(loc)
qdel(src)
return
UpdateDesc()
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index f15cbb793e2..e4431c03acb 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -82,6 +82,7 @@
var/obj/item/r_hand = null //Living
var/obj/item/back = null //Human
var/obj/item/tank/internal = null //Human
+ /// Active storage container
var/obj/item/storage/s_active = null //Carbon
var/obj/item/clothing/mask/wear_mask = null //Carbon