diff --git a/code/game/objects/items/stacks/fifty_spawner.dm b/code/game/objects/items/stacks/fifty_spawner.dm index adac95eaf4d..1977427ebba 100644 --- a/code/game/objects/items/stacks/fifty_spawner.dm +++ b/code/game/objects/items/stacks/fifty_spawner.dm @@ -4,16 +4,18 @@ desc = "This item spawns stack of 50 of a given material." icon = 'icons/misc/mark.dmi' icon_state = "x4" - var/material = "" +// var/material = "" + var/obj/item/stack/type_to_spawn = null /obj/fiftyspawner/New() //spawns the 50-stack and qdels self ..() - var/obj_path = text2path("/obj/item/stack/[material]") - var/obj/item/stack/M = new obj_path(src.loc) +// var/obj_path = text2path("/obj/item/stack/[material]") + var/obj/item/stack/M = new type_to_spawn(src.loc) M.amount = M.max_amount //some stuff spawns with 60, we're still calling it fifty + M.update_icon() // Some stacks have different sprites depending on how full they are. qdel(src) /obj/fiftyspawner/rods name = "stack of rods" //this needs to be defined for cargo - material = "rods" \ No newline at end of file + type_to_spawn = /obj/item/stack/rods \ No newline at end of file diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 54142ea35c1..dde2f168b0e 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -1,7 +1,7 @@ /obj/item/stack/medical name = "medical pack" singular_name = "medical pack" - icon = 'icons/obj/items.dmi' + icon = 'icons/obj/stacks.dmi' amount = 10 max_amount = 10 w_class = ITEMSIZE_SMALL @@ -64,6 +64,7 @@ desc = "Some sterile gauze to wrap around bloody stumps." icon_state = "brutepack" origin_tech = list(TECH_BIO = 1) + no_variants = FALSE /obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob) if(..()) @@ -123,6 +124,7 @@ icon_state = "ointment" heal_burn = 1 origin_tech = list(TECH_BIO = 1) + no_variants = FALSE /obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob) if(..()) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 7680231428f..95803696d49 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -2,11 +2,12 @@ name = "nanopaste" singular_name = "nanite swarm" desc = "A tube of paste containing swarms of repair nanites. Very effective in repairing robotic machinery." - icon = 'icons/obj/nanopaste.dmi' - icon_state = "tube" + icon = 'icons/obj/stacks.dmi' + icon_state = "nanopaste" origin_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3) amount = 10 w_class = ITEMSIZE_SMALL + no_variants = FALSE /obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob) if (!istype(M) || !istype(user)) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index ee21fc86a77..784eadd3b97 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -21,10 +21,19 @@ uses_charge = 1 charge_costs = list(500) stacktype = /obj/item/stack/rods + no_variants = TRUE /obj/item/stack/rods/New() ..() recipes = rods_recipes + update_icon() + +/obj/item/stack/rods/update_icon() + var/amount = get_amount() + if((amount <= 5) && (amount > 0)) + icon_state = "rods-[amount]" + else + icon_state = "rods" var/global/list/datum/stack_recipe/rods_recipes = list( \ new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 96b35e13e71..8ece302f139 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -3,6 +3,7 @@ desc = "The by-product of human farming." singular_name = "human skin piece" icon_state = "sheet-hide" + no_variants = FALSE /obj/item/stack/material/animalhide/human amount = 50 @@ -80,6 +81,7 @@ desc = "This hide was stripped of it's hair, but still needs tanning." singular_name = "hairless hide piece" icon_state = "sheet-hairlesshide" + no_variants = FALSE /obj/item/stack/material/hairlesshide amount = 50 @@ -91,6 +93,7 @@ icon_state = "sheet-wetleather" var/wetness = 30 //Reduced when exposed to high temperautres var/drying_threshold_temperature = 500 //Kelvin to start drying + no_variants = FALSE /obj/item/stack/material/wetleather amount = 50 diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index ee1cc1b0786..c5be2552044 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -12,6 +12,7 @@ /obj/item/stack gender = PLURAL origin_tech = list(TECH_MATERIAL = 1) + icon = 'icons/obj/stacks.dmi' var/list/datum/stack_recipe/recipes var/singular_name var/amount = 1 @@ -21,6 +22,7 @@ var/uses_charge = 0 var/list/charge_costs = null var/list/datum/matter_synth/synths = null + var/no_variants = TRUE // Determines whether the item should update it's sprites based on amount. /obj/item/stack/New(var/loc, var/amount=null) ..() @@ -28,6 +30,7 @@ stacktype = type if (amount) src.amount = amount + update_icon() return /obj/item/stack/Destroy() @@ -37,6 +40,18 @@ usr << browse(null, "window=stack") return ..() +/obj/item/stack/update_icon() + if(no_variants) + icon_state = initial(icon_state) + else + if(amount <= (max_amount * (1/3))) + icon_state = initial(icon_state) + else if (amount <= (max_amount * (2/3))) + icon_state = "[initial(icon_state)]_2" + else + icon_state = "[initial(icon_state)]_3" + item_state = initial(icon_state) + /obj/item/stack/examine(mob/user) if(..(user, 1)) if(!uses_charge) @@ -189,6 +204,7 @@ if(usr) usr.remove_from_mob(src) qdel(src) //should be safe to qdel immediately since if someone is still using this stack it will persist for a little while longer + update_icon() return 1 else if(get_amount() < used) @@ -205,6 +221,7 @@ return 0 else amount += extra + update_icon() return 1 else if(!synths || synths.len < uses_charge) return 0 @@ -298,7 +315,7 @@ /obj/item/stack/attack_hand(mob/user as mob) if (user.get_inactive_hand() == src) - var/N = input("How many stacks of [src] would you like to split off?", "Split stacks", 1) as num|null + var/N = input("How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1) as num|null if(N) var/obj/item/stack/F = src.split(N) if (F) diff --git a/code/game/objects/items/stacks/tiles/fifty_spawner_tiles.dm b/code/game/objects/items/stacks/tiles/fifty_spawner_tiles.dm index 09df497d8d4..3d89b5e7865 100644 --- a/code/game/objects/items/stacks/tiles/fifty_spawner_tiles.dm +++ b/code/game/objects/items/stacks/tiles/fifty_spawner_tiles.dm @@ -2,48 +2,48 @@ /obj/fiftyspawner/grass name = "stack of grass" - material = "tile/grass" + type_to_spawn = /obj/item/stack/tile/grass /obj/fiftyspawner/wood name = "stack of wood" - material = "tile/wood" + type_to_spawn = /obj/item/stack/tile/wood /obj/fiftyspawner/carpet name = "stack of carpet" - material = "tile/carpet" + type_to_spawn = /obj/item/stack/tile/carpet /obj/fiftyspawner/bluecarpet name = "stack of blue carpet" - material = "tile/carpet/blue" + type_to_spawn = /obj/item/stack/tile/carpet/blue /obj/fiftyspawner/floor name = "stack of floor tiles" - material = "tile/floor" + type_to_spawn = /obj/item/stack/tile/floor /obj/fiftyspawner/floor_red name = "stack of red floor tiles" - material = "tile/floor_red" + type_to_spawn = /obj/item/stack/tile/floor/red /obj/fiftyspawner/floor_steel name = "stack of steel floor tiles" - material = "tile/floor_steel" + type_to_spawn = /obj/item/stack/tile/floor/steel /obj/fiftyspawner/floor_white name = "stack of white floor tiles" - material = "tile/floor_white" + type_to_spawn = /obj/item/stack/tile/floor/white /obj/fiftyspawner/floor_yellow name = "stack of yellow floor tiles" - material = "tile/floor_yellow" + type_to_spawn = /obj/item/stack/tile/floor/yellow /obj/fiftyspawner/floor_dark name = "stack of dark floor tiles" - material = "tile/floor_dark" + type_to_spawn = /obj/item/stack/tile/floor/dark /obj/fiftyspawner/floor_freezer name = "stack of freezer tiles" - material = "tile/floor_freezer" + type_to_spawn = /obj/item/stack/tile/floor/freezer /obj/fiftyspawner/linoleum name = "stack of linoleum tiles" - material = "tile/linoleum" \ No newline at end of file + type_to_spawn = /obj/item/stack/tile/linoleum \ No newline at end of file diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index a670d7dd279..888af9124b6 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -36,6 +36,7 @@ throw_range = 20 flags = 0 origin_tech = list(TECH_BIO = 1) + no_variants = FALSE /obj/item/stack/tile/grass/fifty amount = 50 @@ -52,6 +53,7 @@ throw_speed = 5 throw_range = 20 flags = 0 + no_variants = FALSE /obj/item/stack/tile/wood/fifty amount = 50 @@ -77,12 +79,14 @@ throw_speed = 5 throw_range = 20 flags = 0 + no_variants = FALSE /obj/item/stack/tile/carpet/blue name = "blue carpet" singular_name = "blue carpet" desc = "A piece of blue carpet. It is the same size as a normal floor tile!" icon_state = "tile-bluecarpet" + no_variants = FALSE // TODO - Add descriptions to these /obj/item/stack/tile/carpet/bcarpet @@ -111,29 +115,34 @@ throw_speed = 5 throw_range = 20 flags = CONDUCT + no_variants = FALSE /obj/item/stack/tile/floor/red name = "red floor tile" singular_name = "red floor tile" color = COLOR_RED_GRAY icon_state = "tile_white" + no_variants = FALSE // VOREStation Edit /obj/item/stack/tile/floor/techgrey name = "grey techfloor tile" singular_name = "grey techfloor tile" icon_state = "techtile_grey" + no_variants = FALSE /obj/item/stack/tile/floor/techgrid name = "grid techfloor tile" singular_name = "grid techfloor tile" icon_state = "techtile_grid" + no_variants = FALSE /obj/item/stack/tile/floor/steel_dirty name = "steel floor tile" singular_name = "steel floor tile" icon_state = "tile_steel" matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4) + no_variants = FALSE // VOREStation Edit End /obj/item/stack/tile/floor/steel @@ -141,30 +150,35 @@ singular_name = "steel floor tile" icon_state = "tile_steel" matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4) + no_variants = FALSE /obj/item/stack/tile/floor/white name = "white floor tile" singular_name = "white floor tile" icon_state = "tile_white" matter = list("plastic" = SHEET_MATERIAL_AMOUNT / 4) + no_variants = FALSE /obj/item/stack/tile/floor/yellow name = "yellow floor tile" singular_name = "yellow floor tile" color = COLOR_BROWN icon_state = "tile_white" + no_variants = FALSE /obj/item/stack/tile/floor/dark name = "dark floor tile" singular_name = "dark floor tile" - icon_state = "fr_tile" + icon_state = "tile_steel" matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4) + no_variants = FALSE /obj/item/stack/tile/floor/freezer name = "freezer floor tile" singular_name = "freezer floor tile" icon_state = "tile_freezer" matter = list("plastic" = SHEET_MATERIAL_AMOUNT / 4) + no_variants = FALSE /obj/item/stack/tile/floor/cyborg name = "floor tile synthesizer" @@ -186,3 +200,4 @@ throw_speed = 5 throw_range = 20 flags = 0 + no_variants = FALSE diff --git a/code/modules/materials/fifty_spawner_mats.dm b/code/modules/materials/fifty_spawner_mats.dm index 95f10e20120..8054bf9c9d8 100644 --- a/code/modules/materials/fifty_spawner_mats.dm +++ b/code/modules/materials/fifty_spawner_mats.dm @@ -2,101 +2,101 @@ /obj/fiftyspawner/iron name = "stack of iron" - material = "material/iron" + type_to_spawn = /obj/item/stack/material/iron /obj/fiftyspawner/sandstone name = "stack of sandstone" - material = "material/sandstone" + type_to_spawn = /obj/item/stack/material/sandstone /obj/fiftyspawner/marble name = "stack of marble" - material = "material/marble" + type_to_spawn = /obj/item/stack/material/marble /obj/fiftyspawner/diamond name = "stack of diamond" - material = "material/diamond" + type_to_spawn = /obj/item/stack/material/diamond /obj/fiftyspawner/uranium name = "stack of uranium" - material = "material/uranium" + type_to_spawn = /obj/item/stack/material/uranium /obj/fiftyspawner/phoron name = "stack of phoron" - material = "material/phoron" + type_to_spawn = /obj/item/stack/material/phoron /obj/fiftyspawner/plastic name = "stack of plastic" - material = "material/plastic" + type_to_spawn = /obj/item/stack/material/plastic /obj/fiftyspawner/gold name = "stack of gold" - material = "material/gold" + type_to_spawn = /obj/item/stack/material/gold /obj/fiftyspawner/silver name = "stack of silver" - material = "material/silver" + type_to_spawn = /obj/item/stack/material/silver /obj/fiftyspawner/platinum name = "stack of platinum" - material = "material/platinum" + type_to_spawn = /obj/item/stack/material/platinum /obj/fiftyspawner/mhydrogen name = "stack of mhydrogen" - material = "material/mhydrogen" + type_to_spawn = /obj/item/stack/material/mhydrogen /obj/fiftyspawner/tritium name = "stack of tritium" - material = "material/tritium" + type_to_spawn = /obj/item/stack/material/tritium /obj/fiftyspawner/osmium name = "stack of osmium" - material = "material/osmium" + type_to_spawn = /obj/item/stack/material/osmium /obj/fiftyspawner/steel name = "stack of steel" - material = "material/steel" + type_to_spawn = /obj/item/stack/material/steel /obj/fiftyspawner/plasteel name = "stack of plasteel" - material = "material/plasteel" + type_to_spawn = /obj/item/stack/material/plasteel /obj/fiftyspawner/durasteel name = "stack of durasteel" - material = "material/durasteel" + type_to_spawn = /obj/item/stack/material/durasteel /obj/fiftyspawner/wood name = "stack of wood" - material = "material/wood" + type_to_spawn = /obj/item/stack/material/wood /obj/fiftyspawner/cloth name = "stack of cloth" - material = "material/cloth" + type_to_spawn = /obj/item/stack/material/cloth /obj/fiftyspawner/cardboard name = "stack of cardboard" - material = "material/cardboard" + type_to_spawn = /obj/item/stack/material/cardboard /obj/fiftyspawner/leather name = "stack of leather" - material = "material/leather" + type_to_spawn = /obj/item/stack/material/leather /obj/fiftyspawner/glass name = "stack of glass" - material = "material/glass" + type_to_spawn = /obj/item/stack/material/glass /obj/fiftyspawner/rglass name = "stack of reinforced glass" - material = "material/glass/reinforced" + type_to_spawn = /obj/item/stack/material/glass/reinforced /obj/fiftyspawner/phoronglass name = "stack of borosilicate glass" - material = "material/glass/phoronglass" + type_to_spawn = /obj/item/stack/material/glass/phoronglass /obj/fiftyspawner/phoronrglass name = "stack of reinforced borosilicate glass" - material = "material/glass/phoronrglass" + type_to_spawn = /obj/item/stack/material/glass/phoronrglass //R-UST port /obj/fiftyspawner/deuterium name = "stack of deuterium" - material = "material/deuterium" \ No newline at end of file + type_to_spawn = /obj/item/stack/material/deuterium \ No newline at end of file diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 2f9949098be..7ba518f6ef3 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -92,16 +92,19 @@ icon_state = "sheet-silver" default_type = "iron" apply_colour = 1 + no_variants = FALSE /obj/item/stack/material/sandstone name = "sandstone brick" icon_state = "sheet-sandstone" default_type = "sandstone" + no_variants = FALSE /obj/item/stack/material/marble name = "marble brick" icon_state = "sheet-marble" default_type = "marble" + no_variants = FALSE /obj/item/stack/material/diamond name = "diamond" @@ -112,38 +115,45 @@ name = "uranium" icon_state = "sheet-uranium" default_type = "uranium" + no_variants = FALSE /obj/item/stack/material/phoron name = "solid phoron" icon_state = "sheet-phoron" default_type = "phoron" + no_variants = FALSE /obj/item/stack/material/plastic name = "plastic" icon_state = "sheet-plastic" default_type = "plastic" + no_variants = FALSE /obj/item/stack/material/gold name = "gold" icon_state = "sheet-gold" default_type = "gold" + no_variants = FALSE /obj/item/stack/material/silver name = "silver" icon_state = "sheet-silver" default_type = "silver" + no_variants = FALSE //Valuable resource, cargo can sell it. /obj/item/stack/material/platinum name = "platinum" icon_state = "sheet-adamantine" default_type = "platinum" + no_variants = FALSE //Extremely valuable to Research. /obj/item/stack/material/mhydrogen name = "metallic hydrogen" icon_state = "sheet-mythril" default_type = "mhydrogen" + no_variants = FALSE //Fuel for MRSPACMAN generator. /obj/item/stack/material/tritium @@ -151,12 +161,14 @@ icon_state = "sheet-silver" default_type = "tritium" apply_colour = 1 + no_variants = FALSE /obj/item/stack/material/osmium name = "osmium" icon_state = "sheet-silver" default_type = "osmium" apply_colour = 1 + no_variants = FALSE //R-UST port // Fusion fuel. @@ -165,22 +177,26 @@ icon_state = "sheet-silver" default_type = "deuterium" apply_colour = 1 + no_variants = FALSE /obj/item/stack/material/steel name = DEFAULT_WALL_MATERIAL icon_state = "sheet-metal" default_type = DEFAULT_WALL_MATERIAL + no_variants = FALSE /obj/item/stack/material/plasteel name = "plasteel" icon_state = "sheet-plasteel" default_type = "plasteel" + no_variants = FALSE /obj/item/stack/material/durasteel name = "durasteel" icon_state = "sheet-durasteel" item_state = "sheet-metal" default_type = "durasteel" + no_variants = FALSE /obj/item/stack/material/wood name = "wooden plank" @@ -191,11 +207,13 @@ name = "cloth" icon_state = "sheet-cloth" default_type = "cloth" + no_variants = FALSE /obj/item/stack/material/cardboard name = "cardboard" icon_state = "sheet-card" default_type = "cardboard" + no_variants = FALSE /obj/item/stack/material/snow name = "snow" @@ -208,16 +226,19 @@ desc = "The by-product of mob grinding." icon_state = "sheet-leather" default_type = "leather" + no_variants = FALSE /obj/item/stack/material/glass name = "glass" icon_state = "sheet-glass" default_type = "glass" + no_variants = FALSE /obj/item/stack/material/glass/reinforced name = "reinforced glass" icon_state = "sheet-rglass" default_type = "rglass" + no_variants = FALSE /obj/item/stack/material/glass/phoronglass name = "borosilicate glass" @@ -225,6 +246,7 @@ singular_name = "borosilicate glass sheet" icon_state = "sheet-phoronglass" default_type = "borosilicate glass" + no_variants = FALSE /obj/item/stack/material/glass/phoronrglass name = "reinforced borosilicate glass" @@ -232,3 +254,4 @@ singular_name = "reinforced borosilicate glass sheet" icon_state = "sheet-phoronrglass" default_type = "reinforced borosilicate glass" + no_variants = FALSE diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index e35880d3d4c..6465ec33190 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/icons/obj/nanopaste.dmi b/icons/obj/nanopaste.dmi deleted file mode 100644 index b3c096325f9..00000000000 Binary files a/icons/obj/nanopaste.dmi and /dev/null differ diff --git a/icons/obj/stacks.dmi b/icons/obj/stacks.dmi new file mode 100644 index 00000000000..1713cacb671 Binary files /dev/null and b/icons/obj/stacks.dmi differ