[MIRROR] Fixes a few bugs with greyscale stacks. (#1670)

* Fixes a few bugs with greyscale stacks. (#54858)

    Fixes greyscale floor tiles merging regardless of their materials.
    Fixes greyscale floor tiles voiding materials when splitting the stack.
    Fixes greyscale floor tile stacks being created with no mats_per_unit and only enough custom materials for a single unit.
    Fixes greyscale tile flooring being created with the wrong amount of materials.
    Fixes greyscale tile flooring not producing floor tiles/producing floor tiles with 0 units.

* Fixes a few bugs with greyscale stacks.

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
This commit is contained in:
SkyratBot
2020-11-11 02:51:23 +00:00
committed by GitHub
co-authored by TemporalOroboros
parent d972fc4003
commit 186f4bd4c2
19 changed files with 169 additions and 130 deletions
+9 -9
View File
@@ -73,7 +73,7 @@
singular_name = "uranium ore chunk"
points = 30
material_flags = MATERIAL_NO_EFFECTS
custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/uranium
mine_experience = 6
scan_state = "rock_Uranium"
@@ -85,7 +85,7 @@
inhand_icon_state = "Iron ore"
singular_name = "iron ore chunk"
points = 1
custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/metal
mine_experience = 1
scan_state = "rock_Iron"
@@ -97,7 +97,7 @@
inhand_icon_state = "Glass ore"
singular_name = "sand pile"
points = 1
custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/glass
w_class = WEIGHT_CLASS_TINY
mine_experience = 0 //its sand
@@ -142,7 +142,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
inhand_icon_state = "Plasma ore"
singular_name = "plasma ore chunk"
points = 15
custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/plasma
mine_experience = 5
scan_state = "rock_Plasma"
@@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
singular_name = "silver ore chunk"
points = 16
mine_experience = 3
custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/silver
scan_state = "rock_Silver"
spreadChance = 5
@@ -172,7 +172,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
singular_name = "gold ore chunk"
points = 18
mine_experience = 5
custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/gold
scan_state = "rock_Gold"
spreadChance = 5
@@ -183,7 +183,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
inhand_icon_state = "Diamond ore"
singular_name = "diamond ore chunk"
points = 50
custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/diamond
mine_experience = 10
scan_state = "rock_Diamond"
@@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
inhand_icon_state = "Bananium ore"
singular_name = "bananium ore chunk"
points = 60
custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/bananium
mine_experience = 15
scan_state = "rock_Bananium"
@@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
inhand_icon_state = "Titanium ore"
singular_name = "titanium ore chunk"
points = 50
custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT)
refined_type = /obj/item/stack/sheet/mineral/titanium
mine_experience = 3
scan_state = "rock_Titanium"
+2 -2
View File
@@ -219,13 +219,13 @@
return FALSE
if (merge_stacks)
if (istype(active_stack) && istype(I_stack, active_stack.merge_type))
if (istype(active_stack) && active_stack.can_merge(I_stack))
if (I_stack.merge(active_stack))
to_chat(usr, "<span class='notice'>Your [active_stack.name] stack now contains [active_stack.get_amount()] [active_stack.singular_name]\s.</span>")
return TRUE
else
var/obj/item/stack/inactive_stack = get_inactive_held_item()
if (istype(inactive_stack) && istype(I_stack, inactive_stack.merge_type))
if (istype(inactive_stack) && inactive_stack.can_merge(I_stack))
if (I_stack.merge(inactive_stack))
to_chat(usr, "<span class='notice'>Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.</span>")
return TRUE
+1 -1
View File
@@ -390,7 +390,7 @@ All the important duct code:
singular_name = "duct"
icon = 'icons/obj/plumbing/fluid_ducts.dmi'
icon_state = "ducts"
custom_materials = list(/datum/material/iron=500)
mats_per_unit = list(/datum/material/iron=500)
w_class = WEIGHT_CLASS_TINY
novariants = FALSE
max_amount = 50
+2 -2
View File
@@ -399,7 +399,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
custom_materials = list(/datum/material/iron=10, /datum/material/glass=5)
mats_per_unit = list(/datum/material/iron=10, /datum/material/glass=5)
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
attack_verb_continuous = list("whips", "lashes", "disciplines", "flogs")
@@ -599,7 +599,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
custom_materials = list()
mats_per_unit = null
cost = 1
#undef CABLE_RESTRAINTS_COST
+2 -2
View File
@@ -194,7 +194,7 @@ By design, d1 is the smallest direction and d2 is the highest
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
custom_materials = list(/datum/material/iron=10, /datum/material/glass=5)
mats_per_unit = list(/datum/material/iron=10, /datum/material/glass=5)
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
attack_verb_continuous = list("whips", "lashes", "disciplines", "flogs")
@@ -208,7 +208,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/item/stack/pipe_cleaner_coil/cyborg
is_cyborg = 1
custom_materials = null
mats_per_unit = null
cost = 1
/obj/item/stack/pipe_cleaner_coil/cyborg/attack_self(mob/user)
@@ -1037,7 +1037,7 @@
inhand_icon_state = "tile-bluespace"
w_class = WEIGHT_CLASS_NORMAL
force = 6
custom_materials = list(/datum/material/iron=500)
mats_per_unit = list(/datum/material/iron=500)
throwforce = 10
throw_speed = 3
throw_range = 7
@@ -1054,7 +1054,7 @@
inhand_icon_state = "tile-sepia"
w_class = WEIGHT_CLASS_NORMAL
force = 6
custom_materials = list(/datum/material/iron=500)
mats_per_unit = list(/datum/material/iron=500)
throwforce = 10
throw_speed = 0.1
throw_range = 28