diff --git a/code/__DEFINES/materials.dm b/code/__DEFINES/materials.dm index 99a62948e57..0e5234792af 100644 --- a/code/__DEFINES/materials.dm +++ b/code/__DEFINES/materials.dm @@ -6,8 +6,9 @@ /// Gets the reference for the material type that was given -#define getmaterialref(A) (SSmaterials.materials[A]) +#define getmaterialref(A) (SSmaterials.materials[A] || A) /// Flag for atoms, this flag ensures it isn't re-colored by materials. Useful for snowflake icons such as default toolboxes. -#define MATERIAL_NO_COLOR (1<<0) -#define MATERIAL_ADD_PREFIX (1<<1) \ No newline at end of file +#define MATERIAL_COLOR (1<<0) +#define MATERIAL_ADD_PREFIX (1<<1) +#define MATERIAL_NO_EFFECTS (1<<2) diff --git a/code/controllers/subsystem/materials.dm b/code/controllers/subsystem/materials.dm index 5acfa4fed41..3f69e57a5cf 100644 --- a/code/controllers/subsystem/materials.dm +++ b/code/controllers/subsystem/materials.dm @@ -13,6 +13,8 @@ SUBSYSTEM_DEF(materials) var/list/materials = list() ///Dictionary of category || list of material refs var/list/materials_by_category = list() + ///List of stackcrafting recipes for materials using rigid materials + var/list/rigid_stack_recipes = list(new/datum/stack_recipe("chair", /obj/structure/chair/greyscale, one_per_turf = TRUE, on_floor = TRUE, applies_mats = TRUE)) /datum/controller/subsystem/materials/Initialize(timeofday) InitializeMaterials() diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index b95121c6e9f..8eeaba932a7 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -71,10 +71,10 @@ return var/material_amount = get_item_material_amount(I) if(!material_amount) - to_chat(user, "[I] does not contain sufficient amounts of metal or glass to be accepted by [parent].") + to_chat(user, "[I] does not contain sufficient materials to be accepted by [parent].") return if(!has_space(material_amount)) - to_chat(user, "[parent] is full. Please remove metal or glass from [parent] in order to insert more.") + to_chat(user, "[parent] is full. Please remove materials from [parent] in order to insert more.") return user_insert(I, user) @@ -96,17 +96,10 @@ return var/inserted = insert_item(I, stack_amt = requested_amount) if(inserted) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - to_chat(user, "You insert [inserted] [S.singular_name][inserted>1 ? "s" : ""] into [parent].") - if(!QDELETED(I) && I == active_held && !user.put_in_hands(I)) - stack_trace("Warning: User could not put object back in hand during material container insertion, line [__LINE__]! This can lead to issues.") - I.forceMove(user.drop_location()) - else - to_chat(user, "You insert a material total of [inserted] into [parent].") - qdel(I) + to_chat(user, "You insert a material total of [inserted] into [parent].") + qdel(I) if(after_insert) - after_insert.Invoke(I.type, last_inserted_id, inserted) + after_insert.Invoke(I, last_inserted_id, inserted) else if(I == active_held) user.put_in_active_hand(I) @@ -114,8 +107,6 @@ /datum/component/material_container/proc/insert_item(obj/item/I, var/multiplier = 1, stack_amt) if(!I) return FALSE - if(istype(I, /obj/item/stack)) - return insert_stack(I, stack_amt, multiplier) multiplier = CEILING(multiplier, 0.01) @@ -130,35 +121,12 @@ var/primary_mat var/max_mat_value = 0 for(var/MAT in materials) - materials[MAT] += I.materials[MAT] * multiplier - total_amount += I.materials[MAT] * multiplier - if(I.materials[MAT] > max_mat_value) + materials[MAT] += I.custom_materials[MAT] * multiplier + total_amount += I.custom_materials[MAT] * multiplier + if(I.custom_materials[MAT] > max_mat_value) primary_mat = MAT return primary_mat -/// Proc for putting a stack inside of the container -/datum/component/material_container/proc/insert_stack(obj/item/stack/S, amt, multiplier = 1) - if(isnull(amt)) - amt = S.amount - - if(amt <= 0) - return FALSE - - if(amt > S.amount) - amt = S.amount - - var/material_amt = get_item_material_amount(S) - if(!material_amt) - return FALSE - - amt = min(amt, round(((max_amount - total_amount) / material_amt))) - if(!amt) - return FALSE - - last_inserted_id = insert_item_materials(S,amt * multiplier) - S.use(amt) - return amt - /// For inserting an amount of material /datum/component/material_container/proc/insert_amount_mat(amt, var/datum/material/mat) if(!istype(mat)) @@ -342,7 +310,7 @@ return FALSE var/material_amount = 0 for(var/MAT in materials) - material_amount += I.materials[MAT] + material_amount += I.custom_materials[MAT] return material_amount /// Returns the amount of a specific material in this container. diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm index c7f40ebabd9..5a421c970d5 100644 --- a/code/datums/elements/_element.dm +++ b/code/datums/elements/_element.dm @@ -14,7 +14,7 @@ if(type == /datum/element) return ELEMENT_INCOMPATIBLE if(element_flags & ELEMENT_DETACH) - RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/Detach) + RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/Detach, override = TRUE) /// Deactivates the functionality defines by the element on the given datum /datum/element/proc/Detach(datum/source, force) diff --git a/code/datums/elements/firestacker.dm b/code/datums/elements/firestacker.dm index 6f5b4b99666..df491d32f30 100644 --- a/code/datums/elements/firestacker.dm +++ b/code/datums/elements/firestacker.dm @@ -11,10 +11,10 @@ . = ..() if(!ismovableatom(target)) return ELEMENT_INCOMPATIBLE - RegisterSignal(target, COMSIG_MOVABLE_IMPACT, .proc/impact) + RegisterSignal(target, COMSIG_MOVABLE_IMPACT, .proc/impact, override = TRUE) if(isitem(target)) - RegisterSignal(target, COMSIG_ITEM_ATTACK, .proc/item_attack) - RegisterSignal(target, COMSIG_ITEM_ATTACK_SELF, .proc/item_attack_self) + RegisterSignal(target, COMSIG_ITEM_ATTACK, .proc/item_attack, override = TRUE) + RegisterSignal(target, COMSIG_ITEM_ATTACK_SELF, .proc/item_attack_self, override = TRUE) if(amount) // If amount is not given we default to 1 and don't need to save it here amount_by_owner[target] = amount diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 549ed72a93d..fde9b4ad4aa 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -216,7 +216,7 @@ desc = "Stores recorder holocalls." icon_state = "holodisk" obj_flags = UNIQUE_RENAME - materials = list(/datum/material/iron = 100, /datum/material/glass = 100) + custom_materials = list(/datum/material/iron = 100, /datum/material/glass = 100) var/datum/holorecord/record //Preset variables var/preset_image_type diff --git a/code/datums/materials/_material.dm b/code/datums/materials/_material.dm index f355ab3cf6e..37fd67eff5f 100644 --- a/code/datums/materials/_material.dm +++ b/code/datums/materials/_material.dm @@ -14,9 +14,9 @@ Simple datum which is instanced once per type and is used for every object of sa var/color ///Base alpha of the material, is used for greyscale icons. var/alpha - ///Materials "Traits". its a map of key = category | Value = Bool. Used to define what it can be used for.gold + ///Materials "Traits". its a map of key = category | Value = Bool. Used to define what it can be used for var/list/categories = list() - ///The type of sheet this material creates. This should be replaced as soon as possible by greyscale sheets. + ///The type of sheet this material creates. This should be replaced as soon as possible by greyscale sheets var/sheet_type ///This is a modifier for force, and resembles the strength of the material var/strength_modifier = 1 @@ -26,12 +26,12 @@ Simple datum which is instanced once per type and is used for every object of sa var/value_per_unit = 0 ///Armor modifiers, multiplies an items normal armor vars by these amounts. var/armor_modifiers = list("melee" = 1, "bullet" = 1, "laser" = 1, "energy" = 1, "bomb" = 1, "bio" = 1, "rad" = 1, "fire" = 1, "acid" = 1) - ///How beautiful is this material per unit? + ///How beautiful is this material per unit var/beauty_modifier = 0 ///This proc is called when the material is added to an object. /datum/material/proc/on_applied(atom/source, amount, material_flags) - if(!(material_flags & MATERIAL_NO_COLOR)) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example + if(material_flags & MATERIAL_COLOR) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example if(color) //Do we have a custom color? source.add_atom_colour(color, FIXED_COLOUR_PRIORITY) if(alpha) @@ -49,13 +49,14 @@ Simple datum which is instanced once per type and is used for every object of sa ///This proc is called when the material is added to an object specifically. /datum/material/proc/on_applied_obj(var/obj/o, amount, material_flags) var/new_max_integrity = CEILING(o.max_integrity * integrity_modifier, 1) - // This is to keep the same damage relative to the max integrity of the object - o.obj_integrity = (o.obj_integrity / o.max_integrity) * new_max_integrity - o.max_integrity = new_max_integrity + o.modify_max_integrity(new_max_integrity) o.force *= strength_modifier o.throwforce *= strength_modifier var/list/temp_armor_list = list() //Time to add armor modifiers! + + if(!istype(o.armor)) + return var/list/current_armor = o.armor?.getList() for(var/i in current_armor) @@ -64,7 +65,7 @@ Simple datum which is instanced once per type and is used for every object of sa ///This proc is called when the material is removed from an object. /datum/material/proc/on_removed(atom/source, material_flags) - if(!(material_flags & MATERIAL_NO_COLOR)) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example + if(material_flags & MATERIAL_COLOR) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example if(color) source.remove_atom_colour(FIXED_COLOUR_PRIORITY, color) source.alpha = initial(source.alpha) @@ -78,9 +79,6 @@ Simple datum which is instanced once per type and is used for every object of sa ///This proc is called when the material is removed from an object specifically. /datum/material/proc/on_removed_obj(var/obj/o, amount, material_flags) var/new_max_integrity = initial(o.max_integrity) - // This is to keep the same damage relative to the max integrity of the object - o.obj_integrity = (o.obj_integrity / o.max_integrity) * new_max_integrity - - o.max_integrity = new_max_integrity + o.modify_max_integrity(new_max_integrity) o.force = initial(o.force) o.throwforce = initial(o.throwforce) diff --git a/code/datums/materials/basemats.dm b/code/datums/materials/basemats.dm index f907bcfa7a8..ce0427357ef 100644 --- a/code/datums/materials/basemats.dm +++ b/code/datums/materials/basemats.dm @@ -14,7 +14,7 @@ id = "glass" desc = "Glass forged by melting sand." color = "#dae6f0" - alpha = 210 + alpha = 150 categories = list(MAT_CATEGORY_RIGID = TRUE) integrity_modifier = 0.1 sheet_type = /obj/item/stack/sheet/glass @@ -38,7 +38,7 @@ name = "gold" id = "gold" desc = "Gold" - color = "#f0972b" + color = "#C7ED55" strength_modifier = 1.2 categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE) sheet_type = /obj/item/stack/sheet/mineral/gold @@ -54,6 +54,7 @@ color = "#22c2d4" categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE) sheet_type = /obj/item/stack/sheet/mineral/diamond + alpha = 150 value_per_unit = 0.25 beauty_modifier = 0.3 armor_modifiers = list("melee" = 1.3, "bullet" = 1.3, "laser" = 0.6, "energy" = 1, "bomb" = 1.2, "bio" = 1, "rad" = 1, "fire" = 1, "acid" = 1) @@ -78,13 +79,12 @@ . = ..() qdel(source.GetComponent(/datum/component/radioactive)) - ///Adds firestacks on hit (Still needs support to turn into gas on destruction) /datum/material/plasma name = "plasma" id = "plasma" desc = "Isn't plasma a state of matter? Oh whatever." - color = "#eb80f2" + color = "#D30EB0" categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE) sheet_type = /obj/item/stack/sheet/mineral/plasma value_per_unit = 0.1 @@ -107,7 +107,7 @@ name = "bluespace crystal" id = "bluespace_crystal" desc = "Crystals with bluespace properties" - color = "#506bc7" + color = "#3E65D1" categories = list(MAT_CATEGORY_ORE = TRUE) beauty_modifier = 0.5 sheet_type = /obj/item/stack/sheet/bluespace_crystal diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 2f994109c0b..7b6f55f2940 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -72,6 +72,8 @@ var/list/custom_materials ///Bitfield for how the atom handles materials. var/material_flags = NONE + ///Modifier that raises/lowers the effect of the amount of a material, prevents small and easy to get items from being death machines. + var/material_modifier = 1 /** @@ -152,14 +154,12 @@ if (canSmoothWith) canSmoothWith = typelist("canSmoothWith", canSmoothWith) - if(custom_materials && custom_materials.len) - var/temp_list = list() - for(var/i in custom_materials) - temp_list[getmaterialref(i)] = custom_materials[i] //Get the proper instanced version - - custom_materials = null //Null the list to prepare for applying the materials properly - set_custom_materials(temp_list) + var/temp_list = list() + for(var/i in custom_materials) + temp_list[getmaterialref(i)] = custom_materials[i] //Get the proper instanced version + custom_materials = null //Null the list to prepare for applying the materials properly + set_custom_materials(temp_list) ComponentInitialize() @@ -1162,15 +1162,20 @@ ///Sets the custom materials for an item. /atom/proc/set_custom_materials(var/list/materials, multiplier = 1) + + if(!materials) + materials = custom_materials + if(custom_materials) //Only runs if custom materials existed at first. Should usually be the case but check anyways for(var/i in custom_materials) - var/datum/material/custom_material = i + var/datum/material/custom_material = getmaterialref(i) custom_material.on_removed(src, material_flags) //Remove the current materials custom_materials = list() //Reset the list for(var/x in materials) - var/datum/material/custom_material = x + var/datum/material/custom_material = getmaterialref(x) - custom_material.on_applied(src, materials[custom_material] * multiplier, material_flags) + if(!(material_flags & MATERIAL_NO_EFFECTS)) + custom_material.on_applied(src, materials[custom_material] * multiplier * material_modifier, material_flags) custom_materials[custom_material] += materials[custom_material] * multiplier diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 04dd796eda4..c02a6180892 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -138,15 +138,15 @@ return ..() -/obj/machinery/autolathe/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted) - if(ispath(type_inserted, /obj/item/stack/ore/bluespace_crystal)) +/obj/machinery/autolathe/proc/AfterMaterialInsert(item_inserted, id_inserted, amount_inserted) + if(istype(item_inserted, /obj/item/stack/ore/bluespace_crystal)) use_power(MINERAL_MATERIAL_AMOUNT / 10) + else if(custom_materials && custom_materials.len && custom_materials[getmaterialref(/datum/material/glass)]) + flick("autolathe_r",src)//plays glass insertion animation by default otherwise else - switch(id_inserted) - if (/datum/material/iron) - flick("autolathe_o",src)//plays metal insertion animation - else - flick("autolathe_r",src)//plays glass insertion animation by default otherwise + flick("autolathe_o",src)//plays metal insertion animation + + use_power(min(1000, amount_inserted / 100)) updateUsrDialog() @@ -243,9 +243,6 @@ else for(var/i=1, i<=multiplier, i++) var/obj/item/new_item = new being_built.build_path(A) - new_item.materials = new_item.materials.Copy() - for(var/mat in materials_used) - new_item.materials[mat] = materials_used[mat] / multiplier new_item.autolathe_crafted(src) if(length(picked_materials)) diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 4e38c7f9642..6abbdebe4e8 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -285,4 +285,4 @@ desc = "Used for building buttons." icon_state = "button" result_path = /obj/machinery/button - materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 216a32c4b40..7a63833f65d 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -15,7 +15,7 @@ damage_deflection = 12 armor = list("melee" = 50, "bullet" = 20, "laser" = 20, "energy" = 20, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 90, "acid" = 50) max_integrity = 100 - integrity_failure = 50 + integrity_failure = 0.5 var/default_camera_icon = "camera" //the camera's base icon used by update_icon - icon_state is primarily used for mapping display purposes. var/list/network = list("ss13") var/c_tag = null diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 7731ead88e8..fbd97bd2f45 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -8,7 +8,7 @@ desc = "The basic construction for Nanotrasen-Always-Watching-You cameras." icon = 'icons/obj/machines/camera.dmi' icon_state = "cameracase" - materials = list(/datum/material/iron=400, /datum/material/glass=250) + custom_materials = list(/datum/material/iron=400, /datum/material/glass=250) result_path = /obj/structure/camera_assembly /obj/structure/camera_assembly diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 3bdc772b4f3..737fe9a1675 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -7,7 +7,7 @@ idle_power_usage = 300 active_power_usage = 300 max_integrity = 200 - integrity_failure = 100 + integrity_failure = 0.5 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 40, "acid" = 20) var/brightness_on = 1 var/icon_keyboard = "generic_key" diff --git a/code/game/machinery/defibrillator_mount.dm b/code/game/machinery/defibrillator_mount.dm index 5bd8d1e125c..8a5a25b2e0a 100644 --- a/code/game/machinery/defibrillator_mount.dm +++ b/code/game/machinery/defibrillator_mount.dm @@ -139,7 +139,7 @@ desc = "A frame for a defibrillator mount. It can't be removed once it's placed." icon = 'icons/obj/machines/defib_mount.dmi' icon_state = "defibrillator_mount" - materials = list(/datum/material/iron = 300, /datum/material/glass = 100) + custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 100) w_class = WEIGHT_CLASS_BULKY result_path = /obj/machinery/defibrillator_mount pixel_shift = -28 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 643a60ddebc..0d755106ffd 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -43,7 +43,7 @@ icon_state = "closed" max_integrity = 300 var/normal_integrity = AIRLOCK_INTEGRITY_N - integrity_failure = 70 + integrity_failure = 0.25 damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_N autoclose = TRUE secondsElectrified = MACHINE_NOT_ELECTRIFIED //How many seconds remain until the door is no longer electrified. -1/MACHINE_ELECTRIFIED_PERMANENT = permanently electrified until someone fixes it. @@ -466,7 +466,7 @@ panel_overlay = get_airlock_overlay("panel_closed", overlays_file) if(welded) weld_overlay = get_airlock_overlay("welded", overlays_file) - if(obj_integrity You dismantle [src].") @@ -119,5 +119,5 @@ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' flags_1 = CONDUCT_1 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=50, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=50) grind_results = list(/datum/reagent/iron = 10, /datum/reagent/silicon = 10) diff --git a/code/game/objects/items/circuitboards/circuitboard.dm b/code/game/objects/items/circuitboards/circuitboard.dm index 8c1b92172b8..6dc5db970d3 100644 --- a/code/game/objects/items/circuitboards/circuitboard.dm +++ b/code/game/objects/items/circuitboards/circuitboard.dm @@ -10,7 +10,7 @@ item_state = "electronic" lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(/datum/material/glass=1000) + custom_materials = list(/datum/material/glass=1000) w_class = WEIGHT_CLASS_SMALL grind_results = list(/datum/reagent/silicon = 20) var/build_path = null diff --git a/code/game/objects/items/devices/desynchronizer.dm b/code/game/objects/items/devices/desynchronizer.dm index 1b4c0878e42..2dd5609c79e 100644 --- a/code/game/objects/items/devices/desynchronizer.dm +++ b/code/game/objects/items/devices/desynchronizer.dm @@ -8,7 +8,7 @@ item_flags = NOBLUDGEON lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(/datum/material/iron=250, /datum/material/glass=500) + custom_materials = list(/datum/material/iron=250, /datum/material/glass=500) var/max_duration = 3000 var/duration = 300 var/last_use = 0 diff --git a/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm b/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm index 76d1a1f23d5..4f96317b4af 100644 --- a/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm +++ b/code/game/objects/items/devices/electroadaptive_pseudocircuit.dm @@ -5,7 +5,7 @@ icon = 'icons/obj/module.dmi' icon_state = "boris" w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron = 50, /datum/material/glass = 300) + custom_materials = list(/datum/material/iron = 50, /datum/material/glass = 300) var/recharging = FALSE var/circuits = 5 //How many circuits the pseudocircuit has left var/static/recycleable_circuits = typecacheof(list(/obj/item/electronics/firelock, /obj/item/electronics/airalarm, /obj/item/electronics/firealarm, \ diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index fb427e22aa8..e64fb344603 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -10,7 +10,7 @@ w_class = WEIGHT_CLASS_SMALL flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron=50, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) actions_types = list(/datum/action/item_action/toggle_light) var/on = FALSE var/brightness_on = 4 //range of light when on @@ -218,7 +218,7 @@ brightness_on = 5 w_class = WEIGHT_CLASS_BULKY flags_1 = CONDUCT_1 - materials = list() + custom_materials = null on = TRUE @@ -363,7 +363,7 @@ item_state = "slime" w_class = WEIGHT_CLASS_SMALL slot_flags = ITEM_SLOT_BELT - materials = list() + custom_materials = null brightness_on = 6 //luminosity when on /obj/item/flashlight/emp diff --git a/code/game/objects/items/devices/forcefieldprojector.dm b/code/game/objects/items/devices/forcefieldprojector.dm index bd06b2b5ead..25a98c3dd7f 100644 --- a/code/game/objects/items/devices/forcefieldprojector.dm +++ b/code/game/objects/items/devices/forcefieldprojector.dm @@ -9,7 +9,7 @@ item_state = "electronic" lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(/datum/material/iron=250, /datum/material/glass=500) + custom_materials = list(/datum/material/iron=250, /datum/material/glass=500) var/max_shield_integrity = 250 var/shield_integrity = 250 var/max_fields = 3 diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm index fb5db099a58..eb947c1d084 100644 --- a/code/game/objects/items/devices/geiger_counter.dm +++ b/code/game/objects/items/devices/geiger_counter.dm @@ -18,7 +18,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' w_class = WEIGHT_CLASS_SMALL slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron = 150, /datum/material/glass = 150) + custom_materials = list(/datum/material/iron = 150, /datum/material/glass = 150) var/grace = RAD_GRACE_PERIOD var/datum/looping_sound/geiger/soundloop diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index e091f924e6d..ac30f0924ea 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -8,7 +8,7 @@ flags_1 = CONDUCT_1 item_flags = NOBLUDGEON slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron=500, /datum/material/glass=500) + custom_materials = list(/datum/material/iron=500, /datum/material/glass=500) w_class = WEIGHT_CLASS_SMALL var/turf/pointer_loc var/energy = 10 diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index e13989ad333..93c4a11ab4f 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -24,9 +24,9 @@ throwforce = 0 throw_range = 7 throw_speed = 3 - materials = list(/datum/material/iron=50, /datum/material/glass=20) drop_sound = 'sound/items/handling/multitool_drop.ogg' pickup_sound = 'sound/items/handling/multitool_pickup.ogg' + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) var/obj/machinery/buffer // simple machine buffer for device linkage toolspeed = 1 usesound = 'sound/weapons/empty.ogg' diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm index cf978effdef..3bd41cae8e8 100644 --- a/code/game/objects/items/devices/pipe_painter.dm +++ b/code/game/objects/items/devices/pipe_painter.dm @@ -6,7 +6,7 @@ item_flags = NOBLUDGEON var/paint_color = "grey" - materials = list(/datum/material/iron=5000, /datum/material/glass=2000) + custom_materials = list(/datum/material/iron=5000, /datum/material/glass=2000) /obj/item/pipe_painter/afterattack(atom/A, mob/user, proximity_flag) . = ..() diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 71469d86e63..3c64e26211d 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -13,7 +13,7 @@ throwforce = 5 throw_speed = 1 throw_range = 2 - materials = list(/datum/material/iron=750) + custom_materials = list(/datum/material/iron=750) var/drain_rate = 2000000 // amount of power to drain per tick var/power_drained = 0 // has drained this much power var/max_power = 6e8 // maximum power that can be drained before exploding diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index a94134499d4..62dfab7d024 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -9,7 +9,7 @@ flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BACK w_class = WEIGHT_CLASS_HUGE - materials = list(/datum/material/iron=10000, /datum/material/glass=2500) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=2500) var/on = TRUE var/code = 2 var/frequency = FREQ_ELECTROPACK diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 05caf493d2a..309adeaa56c 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(channel_tokens, list( desc = "An updated, modular intercom that fits over the head. Takes encryption keys." icon_state = "headset" item_state = "headset" - materials = list(/datum/material/iron=75) + custom_materials = list(/datum/material/iron=75) subspace_transmission = TRUE canhear_range = 0 // can't hear headsets from very far away diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c0949f4c60a..3e33deb2c31 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -153,4 +153,4 @@ result_path = /obj/item/radio/intercom/unscrewed pixel_shift = 29 inverse = TRUE - materials = list(/datum/material/iron = 75, /datum/material/glass = 25) + custom_materials = list(/datum/material/iron = 75, /datum/material/glass = 25) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 92c260e746a..b7dd07f80a0 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -11,7 +11,7 @@ throw_speed = 3 throw_range = 7 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=75, /datum/material/glass=25) + custom_materials = list(/datum/material/iron=75, /datum/material/glass=25) obj_flags = USES_TGUI var/on = TRUE diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index e24c4bc6ea7..e9fa7fcdd3d 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -22,7 +22,7 @@ GENE SCANNER item_state = "electronic" lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(/datum/material/iron=150) + custom_materials = list(/datum/material/iron=150) /obj/item/t_scanner/suicide_act(mob/living/carbon/user) user.visible_message("[user] begins to emit terahertz-rays into [user.p_their()] brain with [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -86,7 +86,7 @@ GENE SCANNER w_class = WEIGHT_CLASS_TINY throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=200) + custom_materials = list(/datum/material/iron=200) var/mode = 1 var/scanmode = 0 var/advanced = FALSE @@ -444,7 +444,7 @@ GENE SCANNER throw_speed = 3 throw_range = 7 tool_behaviour = TOOL_ANALYZER - materials = list(/datum/material/iron=30, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=20) grind_results = list(/datum/reagent/mercury = 5, /datum/reagent/iron = 5, /datum/reagent/silicon = 5) var/cooldown = FALSE var/cooldown_time = 250 @@ -639,7 +639,7 @@ GENE SCANNER throwforce = 0 throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=30, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=20) /obj/item/slime_scanner/attack(mob/living/M, mob/living/user) if(user.stat || user.eye_blind) @@ -698,7 +698,7 @@ GENE SCANNER w_class = WEIGHT_CLASS_TINY throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=200) + custom_materials = list(/datum/material/iron=200) /obj/item/nanite_scanner/attack(mob/living/M, mob/living/carbon/human/user) user.visible_message("[user] analyzes [M]'s nanites.", \ @@ -725,7 +725,7 @@ GENE SCANNER w_class = WEIGHT_CLASS_TINY throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=200) + custom_materials = list(/datum/material/iron=200) var/list/discovered = list() //hit a dna console to update the scanners database var/list/buffer var/ready = TRUE diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 736f0671d36..2c746e77c0e 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -9,7 +9,7 @@ w_class = WEIGHT_CLASS_SMALL flags_1 = HEAR_1 slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron=60, /datum/material/glass=30) + custom_materials = list(/datum/material/iron=60, /datum/material/glass=30) force = 2 throwforce = 0 var/recording = 0 @@ -242,7 +242,7 @@ lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron=20, /datum/material/glass=5) + custom_materials = list(/datum/material/iron=20, /datum/material/glass=5) force = 1 throwforce = 0 var/max_capacity = 600 diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 7fded659ea7..3068e06166d 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -69,7 +69,7 @@ effective or pretty fucking useless. */ /obj/item/healthanalyzer/rad_laser - materials = list(/datum/material/iron=400) + custom_materials = list(/datum/material/iron=400) var/irradiate = 1 var/intensity = 10 // how much damage the radiation does var/wavelength = 10 // time it takes for the radiation to kick in, in seconds diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index f98d16e914e..7718c20dd15 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -11,7 +11,7 @@ throw_speed = 2 throw_range = 7 force = 10 - materials = list(/datum/material/iron = 90) + custom_materials = list(/datum/material/iron = 90) attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") dog_fashion = /datum/dog_fashion/back resistance_flags = FIRE_PROOF @@ -36,7 +36,7 @@ throwforce = 2 w_class = WEIGHT_CLASS_SMALL force = 3 - materials = list(/datum/material/iron = 50, /datum/material/glass = 40) + custom_materials = list(/datum/material/iron = 50, /datum/material/glass = 40) max_water = 30 sprite_name = "miniFE" dog_fashion = null diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index cb69657a05f..66ffc1d1d6c 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -12,7 +12,7 @@ throw_speed = 1 throw_range = 5 w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=500) + custom_materials = list(/datum/material/iron=500) resistance_flags = FIRE_PROOF var/status = FALSE var/lit = FALSE //on or off diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 628546211fc..ff1e402d9c4 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -34,7 +34,7 @@ w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=500) + custom_materials = list(/datum/material/iron=500) breakouttime = 1 MINUTES armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) var/cuffsound = 'sound/weapons/handcuffs.ogg' @@ -103,7 +103,7 @@ icon = 'icons/obj/mining.dmi' icon_state = "sinewcuff" item_state = "sinewcuff" - materials = null + custom_materials = null color = null /obj/item/restraints/handcuffs/cable @@ -114,7 +114,7 @@ color = "#ff0000" lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - materials = list(/datum/material/iron=150, /datum/material/glass=75) + custom_materials = list(/datum/material/iron=150, /datum/material/glass=75) breakouttime = 30 SECONDS cuffsound = 'sound/weapons/cablecuff.ogg' @@ -187,7 +187,7 @@ icon_state = "cuff" lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' - materials = list() + custom_materials = null breakouttime = 45 SECONDS trashtype = /obj/item/restraints/handcuffs/cable/zipties/used color = null diff --git a/code/game/objects/items/implants/implantcase.dm b/code/game/objects/items/implants/implantcase.dm index d58156b7548..5a06aff10fc 100644 --- a/code/game/objects/items/implants/implantcase.dm +++ b/code/game/objects/items/implants/implantcase.dm @@ -9,7 +9,7 @@ throw_speed = 2 throw_range = 5 w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/glass=500) + custom_materials = list(/datum/material/glass=500) var/obj/item/implant/imp = null var/imp_type diff --git a/code/game/objects/items/implants/implanter.dm b/code/game/objects/items/implants/implanter.dm index 26265450b5d..0b9890760ca 100644 --- a/code/game/objects/items/implants/implanter.dm +++ b/code/game/objects/items/implants/implanter.dm @@ -9,7 +9,7 @@ throw_speed = 3 throw_range = 5 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=600, /datum/material/glass=200) + custom_materials = list(/datum/material/iron=600, /datum/material/glass=200) var/obj/item/implant/imp = null var/imp_type = null diff --git a/code/game/objects/items/kitchen.dm b/code/game/objects/items/kitchen.dm index e8f0c06dea4..28f4ba8e130 100644 --- a/code/game/objects/items/kitchen.dm +++ b/code/game/objects/items/kitchen.dm @@ -22,7 +22,7 @@ throwforce = 0 throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) flags_1 = CONDUCT_1 attack_verb = list("attacked", "stabbed", "poked") hitsound = 'sound/weapons/bladeslice.ogg' @@ -68,7 +68,7 @@ hitsound = 'sound/weapons/bladeslice.ogg' throw_speed = 3 throw_range = 6 - materials = list(/datum/material/iron=12000) + custom_materials = list(/datum/material/iron=12000) attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") sharpness = IS_SHARP_ACCURATE armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) @@ -110,7 +110,7 @@ flags_1 = CONDUCT_1 force = 15 throwforce = 10 - materials = list(/datum/material/iron=18000) + custom_materials = list(/datum/material/iron=18000) attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") w_class = WEIGHT_CLASS_NORMAL custom_price = 60 @@ -144,7 +144,7 @@ embedding = list("embedded_pain_multiplier" = 4, "embed_chance" = 35, "embedded_fall_chance" = 10) force = 15 throwforce = 15 - materials = list() + custom_materials = null /obj/item/kitchen/knife/combat/cyborg name = "cyborg knife" @@ -161,7 +161,7 @@ desc = "Unlike other carrots, you should probably keep this far away from your eyes." force = 8 throwforce = 12//fuck git - materials = list() + custom_materials = null attack_verb = list("shanked", "shivved") armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index db61d342a34..8f8dfcf16f4 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -23,7 +23,7 @@ w_class = WEIGHT_CLASS_NORMAL attack_verb = list("flogged", "whipped", "lashed", "disciplined") hitsound = 'sound/weapons/chainhit.ogg' - materials = list(/datum/material/iron = 1000) + custom_materials = list(/datum/material/iron = 1000) /obj/item/melee/chainofcommand/suicide_act(mob/user) user.visible_message("[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -65,7 +65,7 @@ sharpness = IS_SHARP attack_verb = list("slashed", "cut") hitsound = 'sound/weapons/rapierhit.ogg' - materials = list(/datum/material/iron = 1000) + custom_materials = list(/datum/material/iron = 1000) /obj/item/melee/sabre/Initialize() . = ..() diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index 1f0f9ff7dac..1731ab15567 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -15,7 +15,7 @@ w_class = WEIGHT_CLASS_BULKY throw_speed = 2 throw_range = 3 - materials = list(/datum/material/iron = 7500, /datum/material/glass = 100) + custom_materials = list(/datum/material/iron = 7500, /datum/material/glass = 100) var/open = TRUE var/locked = FALSE var/list/occupants = list() diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index a74f07561be..ffc9e1a9c20 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -12,7 +12,7 @@ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron = 500, /datum/material/glass = 250) + custom_materials = list(/datum/material/iron = 500, /datum/material/glass = 250) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF var/active = FALSE var/atom/movable/target //The thing we're searching for diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 66177bb7409..21dd03458e8 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -20,7 +20,7 @@ throw_speed = 2 throw_range = 3 w_class = WEIGHT_CLASS_BULKY - materials = list(/datum/material/glass=7500, /datum/material/iron=1000) + custom_materials = list(/datum/material/glass=7500, /datum/material/iron=1000) attack_verb = list("shoved", "bashed") var/cooldown = 0 //shield bash cooldown. based on world.time transparent = TRUE @@ -87,7 +87,7 @@ lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' transparent = FALSE - materials = list(/datum/material/iron=8500) + custom_materials = list(/datum/material/iron=8500) max_integrity = 65 /obj/item/shield/riot/roman/fake @@ -107,7 +107,7 @@ item_state = "buckler" lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - materials = list() + custom_materials = null resistance_flags = FLAMMABLE block_chance = 30 transparent = FALSE diff --git a/code/game/objects/items/stacks/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm index c4580b634be..9a71ffe16fe 100644 --- a/code/game/objects/items/stacks/bscrystal.dm +++ b/code/game/objects/items/stacks/bscrystal.dm @@ -7,7 +7,7 @@ singular_name = "bluespace crystal" dye_color = DYE_COSMIC w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) points = 50 var/blink_range = 8 // The teleport range when crushed/thrown at someone. refined_type = /obj/item/stack/sheet/bluespace_crystal @@ -50,7 +50,7 @@ /obj/item/stack/ore/bluespace_crystal/artificial name = "artificial bluespace crystal" desc = "An artificially made bluespace crystal, it looks delicate." - materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT*0.5) + custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT*0.5) blink_range = 4 // Not as good as the organic stuff! points = 0 //nice try refined_type = null @@ -64,7 +64,7 @@ item_state = "sheet-polycrystal" singular_name = "bluespace polycrystal" desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." - materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") novariants = TRUE grind_results = list(/datum/reagent/bluespace = 20) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index caf70797469..c9b517e3f57 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -122,7 +122,7 @@ stop_bleeding = 900 /obj/item/stack/medical/gauze/cyborg - materials = list() + custom_materials = null is_cyborg = 1 cost = 250 diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 45a2bf51594..8e1ceaa4280 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -17,7 +17,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ throwforce = 10 throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=1000) + custom_materials = list(/datum/material/iron=1000) max_amount = 50 attack_verb = list("hit", "bludgeoned", "whacked") hitsound = 'sound/weapons/gun/general/grenade_launch.ogg' @@ -29,10 +29,12 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ /obj/item/stack/rods/Initialize(mapload, new_amount, merge = TRUE) . = ..() - - recipes = GLOB.rod_recipes update_icon() +/obj/item/stack/rods/get_main_recipes() + . = ..() + . += GLOB.rod_recipes + /obj/item/stack/rods/update_icon() var/amount = get_amount() if((amount <= 5) && (amount > 0)) @@ -71,7 +73,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ return ..() /obj/item/stack/rods/cyborg - materials = list() + custom_materials = null is_cyborg = 1 cost = 250 diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index ab7b3513c4b..117061e479e 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -19,11 +19,12 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \ singular_name = "glass sheet" icon_state = "sheet-glass" item_state = "sheet-glass" - materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/glass grind_results = list(/datum/reagent/silicon = 20) + material_type = /datum/material/glass point_value = 1 tableVariant = /obj/structure/table/glass @@ -32,16 +33,16 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \ return BRUTELOSS /obj/item/stack/sheet/glass/cyborg - materials = list() + custom_materials = null is_cyborg = 1 cost = 500 /obj/item/stack/sheet/glass/fifty amount = 50 -/obj/item/stack/sheet/glass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.glass_recipes - return ..() +/obj/item/stack/sheet/glass/get_main_recipes() + . = ..() + . += GLOB.glass_recipes /obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params) add_fingerprint(user) @@ -84,18 +85,19 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \ singular_name = "plasma glass sheet" icon_state = "sheet-pglass" item_state = "sheet-pglass" - materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/plasmaglass grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10) + material_flags = MATERIAL_NO_EFFECTS /obj/item/stack/sheet/plasmaglass/fifty amount = 50 -/obj/item/stack/sheet/plasmaglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.pglass_recipes - return ..() +/obj/item/stack/sheet/plasmaglass/get_main_recipes() + . = ..() + . += GLOB.pglass_recipes /obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user, params) add_fingerprint(user) @@ -135,7 +137,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ singular_name = "reinforced glass sheet" icon_state = "sheet-rglass" item_state = "sheet-rglass" - materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/rglass @@ -147,7 +149,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ ..() /obj/item/stack/sheet/rglass/cyborg - materials = list() + custom_materials = null var/datum/robot_energy_storage/glasource var/metcost = 250 var/glacost = 500 @@ -165,9 +167,9 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ source.add_charge(amount * metcost) glasource.add_charge(amount * glacost) -/obj/item/stack/sheet/rglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.reinforced_glass_recipes - return ..() +/obj/item/stack/sheet/rglass/get_main_recipes() + . = ..() + . += GLOB.reinforced_glass_recipes GLOBAL_LIST_INIT(prglass_recipes, list ( \ new/datum/stack_recipe("directional reinforced window", /obj/structure/window/plasma/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \ @@ -180,16 +182,17 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \ singular_name = "reinforced plasma glass sheet" icon_state = "sheet-prglass" item_state = "sheet-prglass" - materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5,) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5,) armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100) resistance_flags = ACID_PROOF + material_flags = MATERIAL_NO_EFFECTS merge_type = /obj/item/stack/sheet/plasmarglass grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10, /datum/reagent/iron = 10) point_value = 23 -/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.prglass_recipes - return ..() +/obj/item/stack/sheet/plasmarglass/get_main_recipes() + . = ..() + . += GLOB.prglass_recipes GLOBAL_LIST_INIT(titaniumglass_recipes, list( new/datum/stack_recipe("shuttle window", /obj/structure/window/shuttle/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) @@ -201,14 +204,14 @@ GLOBAL_LIST_INIT(titaniumglass_recipes, list( singular_name = "titanium glass sheet" icon_state = "sheet-titaniumglass" item_state = "sheet-titaniumglass" - materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/titaniumglass -/obj/item/stack/sheet/titaniumglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.titaniumglass_recipes - return ..() +/obj/item/stack/sheet/titaniumglass/get_main_recipes() + . = ..() + . += GLOB.titaniumglass_recipes GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( new/datum/stack_recipe("plastitanium window", /obj/structure/window/plasma/reinforced/plastitanium/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) @@ -220,14 +223,15 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( singular_name = "plastitanium glass sheet" icon_state = "sheet-plastitaniumglass" item_state = "sheet-plastitaniumglass" - materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100) + material_flags = MATERIAL_NO_EFFECTS resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/plastitaniumglass -/obj/item/stack/sheet/plastitaniumglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.plastitaniumglass_recipes - return ..() +/obj/item/stack/sheet/plastitaniumglass/get_main_recipes() + . = ..() + . += GLOB.plastitaniumglass_recipes /obj/item/shard name = "shard" @@ -240,7 +244,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( item_state = "shard-glass" lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi' - materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) attack_verb = list("stabbed", "slashed", "sliced", "cut") hitsound = 'sound/weapons/bladeslice.ogg' resistance_flags = ACID_PROOF @@ -340,6 +344,6 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( force = 6 throwforce = 11 icon_state = "plasmalarge" - materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) icon_prefix = "plasma" weld_material = /obj/item/stack/sheet/plasmaglass diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index a02adf83cfe..2df757b75f4 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -15,9 +15,9 @@ GLOBAL_LIST_INIT(human_recipes, list( \ new/datum/stack_recipe("bloated human costume", /obj/item/clothing/suit/hooded/bloated_human, 5), \ )) -/obj/item/stack/sheet/animalhide/human/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.human_recipes - return ..() +/obj/item/stack/sheet/animalhide/human/get_main_recipes() + . = ..() + . += GLOB.human_recipes /obj/item/stack/sheet/animalhide/generic name = "skin" @@ -45,17 +45,17 @@ GLOBAL_LIST_INIT(gondola_recipes, list ( \ icon_state = "sheet-gondola" item_state = "sheet-gondola" -/obj/item/stack/sheet/animalhide/gondola/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.gondola_recipes - return ..() +/obj/item/stack/sheet/animalhide/gondola/get_main_recipes() + . = ..() + . += GLOB.gondola_recipes GLOBAL_LIST_INIT(corgi_recipes, list ( \ new/datum/stack_recipe("corgi costume", /obj/item/clothing/suit/hooded/ian_costume, 3), \ )) -/obj/item/stack/sheet/animalhide/corgi/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.corgi_recipes - return ..() +/obj/item/stack/sheet/animalhide/corgi/get_main_recipes() + . = ..() + . += GLOB.corgi_recipes /obj/item/stack/sheet/animalhide/cat name = "cat hide" @@ -76,9 +76,9 @@ GLOBAL_LIST_INIT(monkey_recipes, list ( \ new/datum/stack_recipe("monkey suit", /obj/item/clothing/suit/monkeysuit, 2), \ )) -/obj/item/stack/sheet/animalhide/monkey/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.monkey_recipes - return ..() +/obj/item/stack/sheet/animalhide/monkey/get_main_recipes() + . = ..() + . += GLOB.monkey_recipes /obj/item/stack/sheet/animalhide/lizard name = "lizard skin" @@ -99,9 +99,9 @@ GLOBAL_LIST_INIT(xeno_recipes, list ( \ new/datum/stack_recipe("alien suit", /obj/item/clothing/suit/xenos, 2), \ )) -/obj/item/stack/sheet/animalhide/xeno/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.xeno_recipes - return ..() +/obj/item/stack/sheet/animalhide/xeno/get_main_recipes() + . = ..() + . += GLOB.xeno_recipes //don't see anywhere else to put these, maybe together they could be used to make the xenos suit? /obj/item/stack/sheet/xenochitin @@ -162,10 +162,9 @@ GLOBAL_LIST_INIT(leather_recipes, list ( \ new/datum/stack_recipe("leather overcoat", /obj/item/clothing/suit/jacket/leather/overcoat, 10), \ )) -/obj/item/stack/sheet/leather/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.leather_recipes - return ..() - +/obj/item/stack/sheet/leather/Initialize/get_main_recipes() + . = ..() + . += GLOB.leather_recipes /* * Sinew */ @@ -182,9 +181,9 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \ new/datum/stack_recipe("sinew restraints", /obj/item/restraints/handcuffs/cable/sinew, 1), \ )) -/obj/item/stack/sheet/sinew/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.sinew_recipes - return ..() +/obj/item/stack/sheet/sinew/get_main_recipes() + . = ..() + . += GLOB.sinew_recipes /* * Plates diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 7e999b451e8..c7626bb077f 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -19,11 +19,6 @@ Mineral Sheets - Coal */ -/obj/item/stack/sheet/mineral/Initialize(mapload) - pixel_x = rand(-4, 4) - pixel_y = rand(-4, 4) - . = ..() - /* * Sandstone */ @@ -43,13 +38,13 @@ GLOBAL_LIST_INIT(sandstone_recipes, list ( \ item_state = "sheet-sandstone" throw_speed = 3 throw_range = 5 - materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) sheettype = "sandstone" merge_type = /obj/item/stack/sheet/mineral/sandstone -/obj/item/stack/sheet/mineral/sandstone/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.sandstone_recipes +/obj/item/stack/sheet/mineral/sandstone/get_main_recipes() . = ..() + . += GLOB.sandstone_recipes /obj/item/stack/sheet/mineral/sandstone/thirty amount = 30 @@ -70,9 +65,9 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ new/datum/stack_recipe("sandbags", /obj/structure/barricade/sandbags, 1, time = 25, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/sandbags/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.sandbag_recipes +/obj/item/stack/sheet/mineral/sandbags/get_main_recipes() . = ..() + . += GLOB.sandbag_recipes /obj/item/emptysandbag name = "empty sandbag" @@ -102,11 +97,12 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ item_state = "sheet-diamond" singular_name = "diamond" sheettype = "diamond" - materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/carbon = 20) point_value = 25 merge_type = /obj/item/stack/sheet/mineral/diamond + material_type = /datum/material/diamond GLOBAL_LIST_INIT(diamond_recipes, list ( \ new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \ @@ -116,9 +112,9 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \ new/datum/stack_recipe("AI Core Statue", /obj/structure/statue/diamond/ai2, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/diamond/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.diamond_recipes +/obj/item/stack/sheet/mineral/diamond/get_main_recipes() . = ..() + . += GLOB.diamond_recipes /* * Uranium @@ -129,11 +125,12 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \ item_state = "sheet-uranium" singular_name = "uranium sheet" sheettype = "uranium" - materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/uranium = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/uranium + material_type = /datum/material/uranium GLOBAL_LIST_INIT(uranium_recipes, list ( \ new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \ @@ -142,9 +139,9 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \ new/datum/stack_recipe("Engineer Statue", /obj/structure/statue/uranium/eng, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/uranium/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.uranium_recipes +/obj/item/stack/sheet/mineral/uranium/get_main_recipes() . = ..() + . += GLOB.uranium_recipes /* * Plasma @@ -157,10 +154,11 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \ sheettype = "plasma" resistance_flags = FLAMMABLE max_integrity = 100 - materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/toxin/plasma = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/plasma + material_type = /datum/material/plasma /obj/item/stack/sheet/mineral/plasma/suicide_act(mob/living/carbon/user) user.visible_message("[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -172,9 +170,9 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \ new/datum/stack_recipe("Scientist Statue", /obj/structure/statue/plasma/scientist, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/plasma/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.plasma_recipes +/obj/item/stack/sheet/mineral/plasma/get_main_recipes() . = ..() + . += GLOB.plasma_recipes /obj/item/stack/sheet/mineral/plasma/attackby(obj/item/W as obj, mob/user as mob, params) if(W.get_temperature() > 300)//If the temperature of the object is over 300, then ignite @@ -198,10 +196,11 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \ item_state = "sheet-gold" singular_name = "gold bar" sheettype = "gold" - materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/gold = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/gold + material_type = /datum/material/gold GLOBAL_LIST_INIT(gold_recipes, list ( \ new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \ @@ -214,9 +213,9 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \ new/datum/stack_recipe("CMO Statue", /obj/structure/statue/gold/cmo, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/gold/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.gold_recipes +/obj/item/stack/sheet/mineral/gold/get_main_recipes() . = ..() + . += GLOB.gold_recipes /* * Silver @@ -227,10 +226,11 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \ item_state = "sheet-silver" singular_name = "silver bar" sheettype = "silver" - materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/silver = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/silver + material_type = /datum/material/silver tableVariant = /obj/structure/table/optable GLOBAL_LIST_INIT(silver_recipes, list ( \ @@ -243,11 +243,11 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \ new/datum/stack_recipe("Med Borg Statue", /obj/structure/statue/silver/medborg, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/silver/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.silver_recipes +/obj/item/stack/sheet/mineral/silver/get_main_recipes() . = ..() + . += GLOB.silver_recipes -/* +/* * Clown */ /obj/item/stack/sheet/mineral/bananium @@ -256,23 +256,24 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \ item_state = "sheet-bananium" singular_name = "bananium sheet" sheettype = "bananium" - materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/consumable/banana = 20) point_value = 50 merge_type = /obj/item/stack/sheet/mineral/bananium + material_type = /datum/material/bananium GLOBAL_LIST_INIT(bananium_recipes, list ( \ new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \ new/datum/stack_recipe("Clown Statue", /obj/structure/statue/bananium/clown, 5, one_per_turf = 1, on_floor = 1), \ )) -/obj/item/stack/sheet/mineral/bananium/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.bananium_recipes +/obj/item/stack/sheet/mineral/bananium/get_main_recipes() . = ..() + . += GLOB.bananium_recipes -/* - * Titanium +/* + * Titanium */ /obj/item/stack/sheet/mineral/titanium name = "titanium" @@ -285,22 +286,22 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \ throw_speed = 1 throw_range = 3 sheettype = "titanium" - materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/titanium + material_type = /datum/material/titanium GLOBAL_LIST_INIT(titanium_recipes, list ( \ new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20), \ )) -/obj/item/stack/sheet/mineral/titanium/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.titanium_recipes +/obj/item/stack/sheet/mineral/titanium/get_main_recipes() . = ..() + . += GLOB.titanium_recipes /obj/item/stack/sheet/mineral/titanium/fifty amount = 50 - /* * Plastitanium */ @@ -315,7 +316,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \ throw_speed = 1 throw_range = 3 sheettype = "plastitanium" - materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT) point_value = 45 merge_type = /obj/item/stack/sheet/mineral/plastitanium @@ -323,14 +324,15 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ new/datum/stack_recipe("plastitanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20), \ )) -/obj/item/stack/sheet/mineral/plastitanium/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.plastitanium_recipes +/obj/item/stack/sheet/mineral/plastitanium/get_main_recipes() . = ..() + . += GLOB.plastitanium_recipes /* * Snow */ + /obj/item/stack/sheet/mineral/snow name = "snow" icon_state = "sheet-snow" @@ -348,15 +350,17 @@ GLOBAL_LIST_INIT(snow_recipes, list ( \ new/datum/stack_recipe("Snow tile", /obj/item/stack/tile/mineral/snow, 1, 4, 20), \ )) -/obj/item/stack/sheet/mineral/snow/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.snow_recipes +/obj/item/stack/sheet/mineral/snow/get_main_recipes() . = ..() + . += GLOB.snow_recipes /****************************** Others ****************************/ /* * Adamantine - */ +*/ + + GLOBAL_LIST_INIT(adamantine_recipes, list( new /datum/stack_recipe("incomplete servant golem shell", /obj/item/golem_shell/servant, req_amount=1, res_amount=1), )) @@ -366,12 +370,12 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( icon_state = "sheet-adamantine" item_state = "sheet-adamantine" singular_name = "adamantine sheet" - materials = list(/datum/material/adamantine=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/adamantine=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/adamantine -/obj/item/stack/sheet/mineral/adamantine/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.adamantine_recipes +/obj/item/stack/sheet/mineral/adamantine/get_main_recipes() . = ..() + . += GLOB.adamantine_recipes /* * Runite @@ -383,8 +387,9 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( singular_name = "runite bar" icon_state = "sheet-runite" item_state = "sheet-runite" - materials = list(/datum/material/runite=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/runite=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/runite + material_type = /datum/material/runite /* @@ -396,7 +401,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( item_state = "sheet-mythril" singular_name = "mythril sheet" novariants = TRUE - materials = list(/datum/material/mythril=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/mythril=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/mythril /* @@ -420,9 +425,9 @@ GLOBAL_LIST_INIT(abductor_recipes, list ( \ new/datum/stack_recipe("alien floor tile", /obj/item/stack/tile/mineral/abductor, 1, 4, 20), \ )) -/obj/item/stack/sheet/mineral/abductor/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.abductor_recipes +/obj/item/stack/sheet/mineral/abductor/get_main_recipes() . = ..() + . += GLOB.abductor_recipes /* * Coal diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 7f72b147f0a..1434e2ee97f 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -18,7 +18,6 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ new/datum/stack_recipe("stool", /obj/structure/chair/stool, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("bar stool", /obj/structure/chair/stool/bar, one_per_turf = TRUE, on_floor = TRUE), \ - new/datum/stack_recipe("chair", /obj/structure/chair, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("bed", /obj/structure/bed, 2, one_per_turf = TRUE, on_floor = TRUE), \ null, \ new/datum/stack_recipe_list("office chairs", list( \ @@ -99,14 +98,14 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ singular_name = "metal sheet" icon_state = "sheet-metal" item_state = "sheet-metal" - materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) throwforce = 10 flags_1 = CONDUCT_1 resistance_flags = FIRE_PROOF merge_type = /obj/item/stack/sheet/metal grind_results = list(/datum/reagent/iron = 20) point_value = 2 - tableVariant = /obj/structure/table + material_type = /datum/material/iron /obj/item/stack/sheet/metal/ratvar_act() new /obj/item/stack/tile/brass(loc, amount) @@ -129,13 +128,13 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ amount = 5 /obj/item/stack/sheet/metal/cyborg - materials = list() + custom_materials = null is_cyborg = 1 cost = 500 -/obj/item/stack/sheet/metal/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.metal_recipes - return ..() +/obj/item/stack/sheet/metal/get_main_recipes() + . = ..() + . += GLOB.metal_recipes /obj/item/stack/sheet/metal/suicide_act(mob/living/carbon/user) user.visible_message("[user] begins whacking [user.p_them()]self over the head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -161,7 +160,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ desc = "This sheet is an alloy of iron and plasma." icon_state = "sheet-plasteel" item_state = "sheet-metal" - materials = list(/datum/material/iron=2000, /datum/material/plasma=2000) + custom_materials = list(/datum/material/iron=2000, /datum/material/plasma=2000) throwforce = 10 flags_1 = CONDUCT_1 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 80) @@ -171,9 +170,9 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ point_value = 23 tableVariant = /obj/structure/table/reinforced -/obj/item/stack/sheet/plasteel/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.plasteel_recipes - return ..() +/obj/item/stack/sheet/plasteel/get_main_recipes() + . = ..() + . += GLOB.plasteel_recipes /obj/item/stack/sheet/plasteel/twenty amount = 20 @@ -236,9 +235,9 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ novariants = TRUE grind_results = list(/datum/reagent/carbon = 20) -/obj/item/stack/sheet/mineral/wood/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.wood_recipes - return ..() +/obj/item/stack/sheet/mineral/wood/get_main_recipes() + . = ..() + . += GLOB.wood_recipes /obj/item/stack/sheet/mineral/wood/fifty amount = 50 @@ -265,9 +264,9 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \ merge_type = /obj/item/stack/sheet/mineral/bamboo grind_results = list("carbon" = 5) -/obj/item/stack/sheet/mineral/bamboo/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.bamboo_recipes - return ..() +/obj/item/stack/sheet/mineral/bamboo/get_main_recipes() + . = ..() + . += GLOB.bamboo_recipes /* * Cloth @@ -313,9 +312,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \ drop_sound = 'sound/items/handling/cloth_drop.ogg' pickup_sound = 'sound/items/handling/cloth_pickup.ogg' -/obj/item/stack/sheet/cloth/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.cloth_recipes - return ..() +/obj/item/stack/sheet/cloth/get_main_recipes() + . = ..() + . += GLOB.cloth_recipes /obj/item/stack/sheet/cloth/ten amount = 10 @@ -343,9 +342,9 @@ GLOBAL_LIST_INIT(durathread_recipes, list ( \ drop_sound = 'sound/items/handling/cloth_drop.ogg' pickup_sound = 'sound/items/handling/cloth_pickup.ogg' -/obj/item/stack/sheet/durathread/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.durathread_recipes - return ..() +/obj/item/stack/sheet/durathread/get_main_recipes() + . = ..() + . += GLOB.durathread_recipes /obj/item/stack/sheet/cotton name = "raw cotton bundle" @@ -433,9 +432,9 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \ merge_type = /obj/item/stack/sheet/cardboard novariants = TRUE -/obj/item/stack/sheet/cardboard/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.cardboard_recipes - return ..() +/obj/item/stack/sheet/cardboard/get_main_recipes() + . = ..() + . += GLOB.cardboard_recipes /obj/item/stack/sheet/cardboard/fifty amount = 50 @@ -492,9 +491,9 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list ( \ return FALSE return ..() -/obj/item/stack/sheet/runed_metal/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.runed_metal_recipes - return ..() +/obj/item/stack/sheet/runed_metal/get_main_recipes() + . = ..() + . += GLOB.runed_metal_recipes /obj/item/stack/sheet/runed_metal/fifty amount = 50 @@ -555,8 +554,11 @@ GLOBAL_LIST_INIT(brass_recipes, list ( \ return ..() -/obj/item/stack/tile/brass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.brass_recipes +/obj/item/stack/tile/brass/get_main_recipes() + . = ..() + . += GLOB.brass_recipes + +/obj/item/stack/sheet/paperframes/Initialize() . = ..() pixel_x = 0 pixel_y = 0 @@ -602,8 +604,11 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ to_chat(user, "Wha... what is this cheap imitation crap? This isn't brass at all!") ..() -/obj/item/stack/tile/bronze/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.bronze_recipes +/obj/item/stack/tile/bronze/get_main_recipes() + . = ..() + . += GLOB.bronze_recipes + +/obj/item/stack/sheet/paperframes/Initialize() . = ..() pixel_x = 0 pixel_y = 0 @@ -662,7 +667,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list( singular_name = "plastic sheet" icon_state = "sheet-plastic" item_state = "sheet-plastic" - materials = list(/datum/material/plastic=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/plastic=MINERAL_MATERIAL_AMOUNT) throwforce = 7 merge_type = /obj/item/stack/sheet/plastic @@ -672,9 +677,9 @@ GLOBAL_LIST_INIT(plastic_recipes, list( /obj/item/stack/sheet/plastic/five amount = 5 -/obj/item/stack/sheet/plastic/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.plastic_recipes +/obj/item/stack/sheet/plastic/get_main_recipes() . = ..() + . += GLOB.plastic_recipes GLOBAL_LIST_INIT(paperframe_recipes, list( new /datum/stack_recipe("paper frame separator", /obj/structure/window/paperframe, 2, one_per_turf = TRUE, on_floor = TRUE, time = 10), \ @@ -690,9 +695,9 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra resistance_flags = FLAMMABLE merge_type = /obj/item/stack/sheet/paperframes -/obj/item/stack/sheet/paperframes/Initialize() - recipes = GLOB.paperframe_recipes +/obj/item/stack/sheet/paperframes/get_main_recipes() . = ..() + . += GLOB.paperframe_recipes /obj/item/stack/sheet/paperframes/five amount = 5 /obj/item/stack/sheet/paperframes/twenty diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm index fcbe0e54935..6e7c29c210d 100644 --- a/code/game/objects/items/stacks/sheets/sheets.dm +++ b/code/game/objects/items/stacks/sheets/sheets.dm @@ -13,3 +13,8 @@ var/perunit = MINERAL_MATERIAL_AMOUNT var/sheettype = null //this is used for girders in the creation of walls/false walls var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity. + +/obj/item/stack/sheet/Initialize(mapload, new_amount, merge) + . = ..() + pixel_x = rand(-4, 4) + pixel_y = rand(-4, 4) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index a489d2f101f..4f20bd151f6 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -8,9 +8,12 @@ /* * Stacks */ + + /obj/item/stack icon = 'icons/obj/stack_objects.dmi' gender = PLURAL + material_modifier = 0.1 var/list/datum/stack_recipe/recipes var/singular_name var/amount = 1 @@ -21,6 +24,8 @@ var/merge_type = null // This path and its children should merge with this stack, defaults to src.type var/full_w_class = WEIGHT_CLASS_NORMAL //The weight class the stack should have at amount > 2/3rds max_amount var/novariants = TRUE //Determines whether the item should update it's sprites based on amount. + ///Datum material type that this stack is made of + var/material_type //NOTE: When adding grind_results, the amounts should be for an INDIVIDUAL ITEM - these amounts will be multiplied by the stack size in on_grind() var/obj/structure/table/tableVariant // we tables now (stores table variant to be built from this stack) @@ -35,7 +40,6 @@ return TRUE /obj/item/stack/Initialize(mapload, new_amount, merge = TRUE) - . = ..() if(new_amount != null) amount = new_amount while(amount > max_amount) @@ -43,13 +47,30 @@ new type(loc, max_amount, FALSE) if(!merge_type) merge_type = type + if(custom_materials && custom_materials.len) + for(var/i in custom_materials) + custom_materials[getmaterialref(i)] = MINERAL_MATERIAL_AMOUNT * amount + . = ..() if(merge) for(var/obj/item/stack/S in loc) if(S.merge_type == merge_type) merge(S) + var/list/temp_recipes = get_main_recipes() + recipes = temp_recipes.Copy() + if(material_type) + var/datum/material/M = getmaterialref(material_type) //First/main material + for(var/i in M.categories) + switch(i) + if(MAT_CATEGORY_RIGID) + var/list/temp = SSmaterials.rigid_stack_recipes.Copy() + recipes += temp update_weight() update_icon() +/obj/item/stack/proc/get_main_recipes() + SHOULD_CALL_PARENT(1) + return list()//empty list + /obj/item/stack/proc/update_weight() if(amount <= (max_amount * (1/3))) w_class = CLAMP(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class) @@ -58,6 +79,7 @@ else w_class = full_w_class + /obj/item/stack/update_icon() if(novariants) return ..() @@ -202,6 +224,12 @@ if(O) O.setDir(usr.dir) use(R.req_amount * multiplier) + + if(R.applies_mats && custom_materials && custom_materials.len) + var/list/used_materials = list() + for(var/i in custom_materials) + used_materials[getmaterialref(i)] = R.req_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len) + O.set_custom_materials(used_materials) //START: oh fuck i'm so sorry if(istype(O, /obj/structure/windoor_assembly)) @@ -317,6 +345,10 @@ source.add_charge(amount * cost) else src.amount += amount + if(custom_materials && custom_materials.len) + for(var/i in custom_materials) + custom_materials[getmaterialref(i)] = MINERAL_MATERIAL_AMOUNT * src.amount + set_custom_materials() //Refresh update_icon() update_weight() @@ -422,8 +454,9 @@ var/on_floor = FALSE var/window_checks = FALSE var/placement_checks = FALSE + var/applies_mats = FALSE -/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1,time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE ) +/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1,time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE, applies_mats = FALSE) src.title = title @@ -436,6 +469,7 @@ src.on_floor = on_floor src.window_checks = window_checks src.placement_checks = placement_checks + src.applies_mats = applies_mats /* * Recipe list datum */ diff --git a/code/game/objects/items/stacks/tiles/tile_mineral.dm b/code/game/objects/items/stacks/tiles/tile_mineral.dm index 03380c2c000..9af095385b3 100644 --- a/code/game/objects/items/stacks/tiles/tile_mineral.dm +++ b/code/game/objects/items/stacks/tiles/tile_mineral.dm @@ -6,7 +6,7 @@ item_state = "tile-plasma" turf_type = /turf/open/floor/mineral/plasma mineralType = "plasma" - materials = list(/datum/material/plasma=500) + custom_materials = list(/datum/material/plasma=500) /obj/item/stack/tile/mineral/uranium name = "uranium tile" @@ -16,7 +16,7 @@ item_state = "tile-uranium" turf_type = /turf/open/floor/mineral/uranium mineralType = "uranium" - materials = list(/datum/material/uranium=500) + custom_materials = list(/datum/material/uranium=500) /obj/item/stack/tile/mineral/gold name = "gold tile" @@ -26,7 +26,7 @@ item_state = "tile-gold" turf_type = /turf/open/floor/mineral/gold mineralType = "gold" - materials = list(/datum/material/gold=500) + custom_materials = list(/datum/material/gold=500) /obj/item/stack/tile/mineral/silver name = "silver tile" @@ -36,7 +36,7 @@ item_state = "tile-silver" turf_type = /turf/open/floor/mineral/silver mineralType = "silver" - materials = list(/datum/material/silver=500) + custom_materials = list(/datum/material/silver=500) /obj/item/stack/tile/mineral/diamond name = "diamond tile" @@ -46,7 +46,7 @@ item_state = "tile-diamond" turf_type = /turf/open/floor/mineral/diamond mineralType = "diamond" - materials = list(/datum/material/diamond=500) + custom_materials = list(/datum/material/diamond=500) /obj/item/stack/tile/mineral/bananium name = "bananium tile" @@ -56,7 +56,7 @@ item_state = "tile-bananium" turf_type = /turf/open/floor/mineral/bananium mineralType = "bananium" - materials = list(/datum/material/bananium=500) + custom_materials = list(/datum/material/bananium=500) /obj/item/stack/tile/mineral/abductor name = "alien floor tile" @@ -76,7 +76,7 @@ item_state = "tile-shuttle" turf_type = /turf/open/floor/mineral/titanium mineralType = "titanium" - materials = list(/datum/material/titanium=500) + custom_materials = list(/datum/material/titanium=500) /obj/item/stack/tile/mineral/plastitanium name = "plastitanium tile" @@ -86,7 +86,7 @@ item_state = "tile-darkshuttle" turf_type = /turf/open/floor/mineral/plastitanium mineralType = "plastitanium" - materials = list(/datum/material/titanium=250, /datum/material/plasma=250) + custom_materials = list(/datum/material/titanium=250, /datum/material/plasma=250) /obj/item/stack/tile/mineral/snow name = "snow tile" diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 171f4b8a6e9..d9ebe6d3d7b 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -303,7 +303,7 @@ icon_state = "tile" item_state = "tile" force = 6 - materials = list(/datum/material/iron=500) + custom_materials = list(/datum/material/iron=500) throwforce = 10 flags_1 = CONDUCT_1 turf_type = /turf/open/floor/plasteel @@ -313,6 +313,6 @@ /obj/item/stack/tile/plasteel/cyborg desc = "The ground you walk on." //Not the usual floor tile desc as that refers to throwing, Cyborgs can't do that - RR - materials = list() // All other Borg versions of items have no Metal or Glass - RR + custom_materials = null // All other Borg versions of items have no Metal or Glass - RR is_cyborg = 1 cost = 125 diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm index a0a9cc6b7d2..9613d52ed54 100644 --- a/code/game/objects/items/storage/bags.dm +++ b/code/game/objects/items/storage/bags.dm @@ -108,6 +108,7 @@ /obj/item/storage/bag/ore/ComponentInitialize() . = ..() + AddComponent(/datum/component/rad_insulation, 0.01) //please datum mats no more cancer var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack) STR.allow_quick_empty = TRUE STR.set_holdable(list(/obj/item/stack/ore)) @@ -283,7 +284,7 @@ throw_range = 5 w_class = WEIGHT_CLASS_BULKY flags_1 = CONDUCT_1 - materials = list(/datum/material/iron=3000) + custom_materials = list(/datum/material/iron=3000) /obj/item/storage/bag/tray/ComponentInitialize() . = ..() diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 15ac6778d2e..73d7f3fc6e6 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -327,7 +327,7 @@ desc = "Proves to the world that you are the strongest!" icon_state = "championbelt" item_state = "champion" - materials = list(/datum/material/gold=400) + custom_materials = list(/datum/material/gold=400) /obj/item/storage/belt/champion/ComponentInitialize() . = ..() diff --git a/code/game/objects/items/storage/toolbox.dm b/code/game/objects/items/storage/toolbox.dm index 17978ef5e67..57f1dc06939 100644 --- a/code/game/objects/items/storage/toolbox.dm +++ b/code/game/objects/items/storage/toolbox.dm @@ -11,12 +11,13 @@ throw_speed = 2 throw_range = 7 w_class = WEIGHT_CLASS_BULKY - materials = list(/datum/material/iron = 500) + custom_materials = list(/datum/material/iron = 500) attack_verb = list("robusted") hitsound = 'sound/weapons/smash.ogg' drop_sound = 'sound/items/handling/toolbox_drop.ogg' pickup_sound = 'sound/items/handling/toolbox_pickup.ogg' custom_materials = list(/datum/material/iron = 500) //Toolboxes by default use iron as their core, custom material. + material_flags = MATERIAL_COLOR var/latches = "single_latch" var/has_latches = TRUE @@ -44,7 +45,7 @@ name = "emergency toolbox" icon_state = "red" item_state = "toolbox_red" - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/emergency/PopulateContents() new /obj/item/crowbar/red(src) @@ -63,13 +64,13 @@ name = "rusty red toolbox" icon_state = "toolbox_red_old" has_latches = FALSE - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/mechanical name = "mechanical toolbox" icon_state = "blue" item_state = "toolbox_blue" - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/mechanical/PopulateContents() new /obj/item/screwdriver(src) @@ -83,7 +84,7 @@ name = "rusty blue toolbox" icon_state = "toolbox_blue_old" has_latches = FALSE - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/mechanical/old/heirloom name = "toolbox" //this will be named "X family toolbox" @@ -131,7 +132,7 @@ name = "electrical toolbox" icon_state = "yellow" item_state = "toolbox_yellow" - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/electrical/PopulateContents() var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white") @@ -152,7 +153,7 @@ item_state = "toolbox_syndi" force = 15 throwforce = 18 - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/syndicate/ComponentInitialize() . = ..() @@ -172,7 +173,7 @@ name = "mechanical toolbox" icon_state = "blue" item_state = "toolbox_blue" - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/drone/PopulateContents() var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white") @@ -193,7 +194,7 @@ resistance_flags = FIRE_PROOF | ACID_PROOF w_class = WEIGHT_CLASS_HUGE attack_verb = list("robusted", "crushed", "smashed") - material_flags = MATERIAL_NO_COLOR + material_flags = NONE var/fabricator_type = /obj/item/clockwork/replica_fabricator/scarab /obj/item/storage/toolbox/brass/ComponentInitialize() @@ -233,7 +234,7 @@ icon_state = "green" item_state = "artistic_toolbox" w_class = WEIGHT_CLASS_GIGANTIC //Holds more than a regular toolbox! - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/storage/toolbox/artistic/ComponentInitialize() . = ..() diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index d96d6f7ebcb..7ebc2d245e1 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -11,7 +11,7 @@ throwforce = 10 throw_speed = 1 throw_range = 4 - materials = list(/datum/material/iron = 500) + custom_materials = list(/datum/material/iron = 500) actions_types = list(/datum/action/item_action/set_internals) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 30) var/datum/gas_mixture/air_contents = null diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index 171e82293a1..7025bc03fec 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -24,7 +24,7 @@ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=400) + custom_materials = list(/datum/material/iron=400) /obj/item/locator/attack_self(mob/user) user.set_machine(src) @@ -126,7 +126,7 @@ w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=10000) + custom_materials = list(/datum/material/iron=10000) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF var/list/active_portal_pairs diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm index 9eb8ad53972..10bdf34cf18 100644 --- a/code/game/objects/items/tools/crowbar.dm +++ b/code/game/objects/items/tools/crowbar.dm @@ -11,7 +11,7 @@ force = 5 throwforce = 7 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=50) + custom_materials = list(/datum/material/iron=50) drop_sound = 'sound/items/handling/crowbar_drop.ogg' pickup_sound = 'sound/items/handling/crowbar_pickup.ogg' @@ -53,7 +53,7 @@ w_class = WEIGHT_CLASS_NORMAL throw_speed = 3 throw_range = 3 - materials = list(/datum/material/iron=70) + custom_materials = list(/datum/material/iron=70) icon_state = "crowbar_large" item_state = "crowbar" toolspeed = 0.7 @@ -65,7 +65,7 @@ item_state = "jawsoflife" lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) + custom_materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) usesound = 'sound/items/jaws_pry.ogg' force = 15 toolspeed = 0.7 diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 95831aade49..b18bfffef1c 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -13,7 +13,7 @@ throwforce = 5 throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=75) + custom_materials = list(/datum/material/iron=75) attack_verb = list("stabbed") hitsound = 'sound/weapons/bladeslice.ogg' usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg') @@ -113,7 +113,7 @@ item_state = "drill" lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) //done for balance reasons, making them high value for research, but harder to get + custom_materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) //done for balance reasons, making them high value for research, but harder to get force = 8 //might or might not be too high, subject to change w_class = WEIGHT_CLASS_SMALL throwforce = 8 diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index c76a1c3fe8a..3fc45c867fb 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -23,7 +23,7 @@ armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30) resistance_flags = FIRE_PROOF - materials = list(/datum/material/iron=70, /datum/material/glass=30) + custom_materials = list(/datum/material/iron=70, /datum/material/glass=30) var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2) var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower) var/max_fuel = 20 //The max amount of fuel the welder can hold @@ -299,7 +299,7 @@ desc = "A slightly larger welder with a larger tank." icon_state = "indwelder" max_fuel = 40 - materials = list(/datum/material/glass=60) + custom_materials = list(/datum/material/glass=60) /obj/item/weldingtool/largetank/flamethrower_screwdriver() return @@ -323,7 +323,7 @@ icon_state = "miniwelder" max_fuel = 10 w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) change_icons = 0 /obj/item/weldingtool/mini/flamethrower_screwdriver() @@ -349,7 +349,7 @@ icon_state = "upindwelder" item_state = "upindwelder" max_fuel = 80 - materials = list(/datum/material/iron=70, /datum/material/glass=120) + custom_materials = list(/datum/material/iron=70, /datum/material/glass=120) /obj/item/weldingtool/experimental name = "experimental welding tool" @@ -357,7 +357,7 @@ icon_state = "exwelder" item_state = "exwelder" max_fuel = 40 - materials = list(/datum/material/iron=70, /datum/material/glass=120) + custom_materials = list(/datum/material/iron=70, /datum/material/glass=120) var/last_gen = 0 change_icons = 0 can_off_process = 1 diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index a34fae46e16..40f09240cdb 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -12,7 +12,7 @@ throw_speed = 3 throw_range = 7 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) attack_verb = list("pinched", "nipped") hitsound = 'sound/items/wirecutter.ogg' usesound = 'sound/items/wirecutter.ogg' @@ -91,7 +91,7 @@ icon_state = "jaws_cutter" item_state = "jawsoflife" - materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) + custom_materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) usesound = 'sound/items/jaws_cut.ogg' toolspeed = 0.7 random_color = FALSE diff --git a/code/game/objects/items/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm index 2ec67d4d8ad..ce3d9a1584e 100644 --- a/code/game/objects/items/tools/wrench.dm +++ b/code/game/objects/items/tools/wrench.dm @@ -11,7 +11,7 @@ throwforce = 7 w_class = WEIGHT_CLASS_SMALL usesound = 'sound/items/ratchet.ogg' - materials = list(/datum/material/iron=150) + custom_materials = list(/datum/material/iron=150) drop_sound = 'sound/items/handling/wrench_drop.ogg' pickup_sound = 'sound/items/handling/wrench_pickup.ogg' @@ -49,7 +49,7 @@ lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' usesound = 'sound/items/drill_use.ogg' - materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) + custom_materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25) //done for balance reasons, making them high value for research, but harder to get force = 8 //might or might not be too high, subject to change w_class = WEIGHT_CLASS_SMALL diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 7f4d3eeb401..3b4e92627ca 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -188,7 +188,7 @@ flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=10, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=10) attack_verb = list("struck", "pistol whipped", "hit", "bashed") var/bullets = 7 @@ -242,7 +242,7 @@ icon = 'icons/obj/ammo.dmi' icon_state = "357OLD-7" w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron=10, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=10) var/amount_left = 7 /obj/item/toy/ammo/gun/update_icon() diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 20a407eea39..917b42417e0 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -460,7 +460,7 @@ throw_speed = 4 embedding = list("embedded_impact_pain_multiplier" = 3) armour_penetration = 10 - materials = list(/datum/material/iron=1150, /datum/material/glass=2075) + custom_materials = list(/datum/material/iron=1150, /datum/material/glass=2075) hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "poked", "jabbed", "torn", "gored") sharpness = IS_SHARP @@ -572,7 +572,7 @@ throwforce = 13 throw_speed = 2 throw_range = 4 - materials = list(/datum/material/iron=13000) + custom_materials = list(/datum/material/iron=13000) attack_verb = list("sawed", "torn", "cut", "chopped", "diced") hitsound = "swing_hit" sharpness = IS_SHARP diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 733e518ee09..a08043dd906 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -239,7 +239,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 force = 9 throwforce = 10 w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=1150, /datum/material/glass=75) + custom_materials = list(/datum/material/iron=1150, /datum/material/glass=75) attack_verb = list("hit", "bludgeoned", "whacked", "bonked") /obj/item/wirerod/attackby(obj/item/I, mob/user, params) @@ -283,7 +283,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 embedding = list("embedded_pain_multiplier" = 4, "embed_chance" = 100, "embedded_fall_chance" = 0) w_class = WEIGHT_CLASS_SMALL sharpness = IS_SHARP - materials = list(/datum/material/iron=500, /datum/material/glass=500) + custom_materials = list(/datum/material/iron=500, /datum/material/glass=500) resistance_flags = FIRE_PROOF /obj/item/throwing_star/magspear @@ -309,7 +309,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 throwforce = 5 throw_speed = 3 throw_range = 6 - materials = list(/datum/material/iron=12000) + custom_materials = list(/datum/material/iron=12000) hitsound = 'sound/weapons/genhit.ogg' attack_verb = list("stubbed", "poked") resistance_flags = FIRE_PROOF @@ -370,7 +370,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 force = 5 throwforce = 5 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=50) + custom_materials = list(/datum/material/iron=50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") /obj/item/staff diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 966f23265a3..5ed0a9afaec 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -14,7 +14,7 @@ . = damage_amount obj_integrity = max(obj_integrity - damage_amount, 0) //BREAKING FIRST - if(integrity_failure && obj_integrity <= integrity_failure) + if(integrity_failure && obj_integrity <= integrity_failure * max_integrity) obj_break(damage_flag) //DESTROYING SECOND if(obj_integrity <= 0) @@ -263,7 +263,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e deconstruct(FALSE) ///changes max_integrity while retaining current health percentage, returns TRUE if the obj got broken. -/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE, new_failure_integrity = null) +/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE) var/current_integrity = obj_integrity var/current_max = max_integrity @@ -274,10 +274,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e max_integrity = new_max - if(new_failure_integrity != null) - integrity_failure = new_failure_integrity - - if(can_break && integrity_failure && current_integrity <= integrity_failure) + if(can_break && integrity_failure && current_integrity <= integrity_failure * max_integrity) obj_break(damage_type) return TRUE return FALSE diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 31d33ad2986..9d703136fca 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -11,7 +11,7 @@ var/datum/armor/armor var/obj_integrity //defaults to max_integrity var/max_integrity = 500 - var/integrity_failure = 0 //0 if we have no special broken behavior + var/integrity_failure = 0 //0 if we have no special broken behavior, otherwise is a percentage of at what point the obj breaks. 0.5 being 50% ///Damage under this value will be completely ignored var/damage_deflection = 0 @@ -48,16 +48,17 @@ return ..() /obj/Initialize() - . = ..() if (islist(armor)) armor = getArmor(arglist(armor)) else if (!armor) armor = getArmor() else if (!istype(armor, /datum/armor)) stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()") - if(obj_integrity == null) obj_integrity = max_integrity + + . = ..() //Do this after, else mat datums is mad. + if (set_obj_flags) var/flagslist = splittext(set_obj_flags,";") var/list/string_to_objflag = GLOB.bitfields["obj_flags"] @@ -331,4 +332,4 @@ // Should move all contained objects to it's location. /obj/proc/dump_contents() CRASH("Unimplemented.") - return \ No newline at end of file + return diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index 24a68286159..c413575128f 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -218,7 +218,7 @@ density = FALSE anchored = TRUE max_integrity = 100 - integrity_failure = 5 + integrity_failure = 0.05 var/status = GROWING //can be GROWING, GROWN or BURST; all mutually exclusive layer = MOB_LAYER var/obj/item/clothing/mask/facehugger/child @@ -232,7 +232,7 @@ addtimer(CALLBACK(src, .proc/Grow), rand(MIN_GROWTH_TIME, MAX_GROWTH_TIME)) proximity_monitor = new(src, status == GROWN ? 1 : 0) if(status == BURST) - obj_integrity = integrity_failure + obj_integrity = integrity_failure * max_integrity /obj/structure/alien/egg/update_icon() ..() diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index 544c276a117..57a8f95730e 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -5,7 +5,7 @@ icon_state = "empty" req_access = list(ACCESS_BAR) max_integrity = 500 - integrity_failure = 250 + integrity_failure = 0.5 armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) buildable_sign = 0 @@ -312,4 +312,4 @@ name = null icon = "empty" desc = "This sign doesn't seem to be on." - rename_area = FALSE \ No newline at end of file + rename_area = FALSE diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm index 034f46aebe9..c0a6c8f8244 100644 --- a/code/game/objects/structures/beds_chairs/bed.dm +++ b/code/game/objects/structures/beds_chairs/bed.dm @@ -17,7 +17,7 @@ buckle_lying = 90 resistance_flags = FLAMMABLE max_integrity = 100 - integrity_failure = 30 + integrity_failure = 0.35 var/buildstacktype = /obj/item/stack/sheet/metal var/buildstackamount = 2 var/bolts = TRUE diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 4e4d0a233f6..9a53035e0a4 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -8,7 +8,8 @@ buckle_lying = 0 //you sit in a chair, not lay resistance_flags = NONE max_integrity = 250 - integrity_failure = 25 + integrity_failure = 0.1 + custom_materials = list(/datum/material/iron = 2000) var/buildstacktype = /obj/item/stack/sheet/metal var/buildstackamount = 1 var/item_chair = /obj/item/chair // if null it can't be picked up @@ -120,6 +121,13 @@ handle_rotation(newdir) // Chair types + +///Material chair +/obj/structure/chair/greyscale + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR + item_chair = /obj/item/chair/greyscale + + /obj/structure/chair/wood icon_state = "wooden_chair" name = "wooden chair" @@ -233,7 +241,8 @@ if(!usr.canUseTopic(src, BE_CLOSE, ismonkey(usr))) return usr.visible_message("[usr] grabs \the [src.name].", "You grab \the [src.name].") - var/C = new item_chair(loc) + var/obj/item/C = new item_chair(loc) + C.set_custom_materials(custom_materials) TransferComponents(C) usr.put_in_hands(C) qdel(src) @@ -258,7 +267,7 @@ throw_range = 3 hitsound = 'sound/items/trayhit1.ogg' hit_reaction_chance = 50 - materials = list(/datum/material/iron = 2000) + custom_materials = list(/datum/material/iron = 2000) var/break_chance = 5 //Likely hood of smashing the chair. var/obj/structure/chair/origin_type = /obj/structure/chair @@ -290,6 +299,7 @@ user.visible_message("[user] rights \the [src.name].", "You right \the [name].") var/obj/structure/chair/C = new origin_type(get_turf(loc)) + C.set_custom_materials(custom_materials) TransferComponents(C) C.setDir(dir) qdel(src) @@ -303,7 +313,7 @@ if(remaining_mats) for(var/M=1 to remaining_mats) new stack_type(get_turf(loc)) - else if(materials[/datum/material/iron]) + else if(custom_materials[getmaterialref(/datum/material/iron)]) new /obj/item/stack/rods(get_turf(loc), 2) qdel(src) @@ -328,6 +338,9 @@ C.Paralyze(20) smash(user) +/obj/item/chair/greyscale + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR + origin_type = /obj/structure/chair/greyscale /obj/item/chair/stool name = "stool" @@ -353,7 +366,7 @@ max_integrity = 70 hitsound = 'sound/weapons/genhit1.ogg' origin_type = /obj/structure/chair/wood - materials = null + custom_materials = null break_chance = 50 /obj/item/chair/wood/narsie_act() diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index bb143fbf266..75d8a677f58 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -6,7 +6,7 @@ density = TRUE drag_slowdown = 1.5 // Same as a prone mob max_integrity = 200 - integrity_failure = 50 + integrity_failure = 0.25 armor = list("melee" = 20, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 60) var/icon_door = null diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 7358db38af0..a3d3848732d 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -8,7 +8,7 @@ resistance_flags = ACID_PROOF armor = list("melee" = 30, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100) max_integrity = 200 - integrity_failure = 50 + integrity_failure = 0.25 var/obj/item/showpiece = null var/alert = TRUE var/open = FALSE diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index adec4b2ae45..106d05a77bb 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -6,7 +6,7 @@ anchored = TRUE density = FALSE max_integrity = 200 - integrity_failure = 50 + integrity_failure = 0.25 var/obj/item/extinguisher/stored_extinguisher var/opened = FALSE diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index cbc194a50d4..3194f98f79a 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -7,7 +7,7 @@ density = FALSE armor = list("melee" = 50, "bullet" = 20, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50) max_integrity = 150 - integrity_failure = 50 + integrity_failure = 0.33 var/locked = TRUE var/open = FALSE var/obj/item/twohanded/fireaxe/fireaxe diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 4e132690f1e..ef8c92259ac 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -9,7 +9,7 @@ pressure_resistance = 5*ONE_ATMOSPHERE armor = list("melee" = 50, "bullet" = 70, "laser" = 70, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0) max_integrity = 50 - integrity_failure = 20 + integrity_failure = 0.4 var/rods_type = /obj/item/stack/rods var/rods_amount = 2 var/rods_broken = TRUE diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 785cbbad57b..632366e2abc 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -7,7 +7,7 @@ density = FALSE anchored = TRUE max_integrity = 200 - integrity_failure = 100 + integrity_failure = 0.5 /obj/structure/mirror/Initialize(mapload) . = ..() diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index ef579358cff..6a20246b54c 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -31,21 +31,34 @@ return var/obj/item/stack/material = I - if (istype(I, /obj/item/stack) && material?.tableVariant) - if(material.get_amount() < 1) - to_chat(user, "You need one [material.name] sheet to do this!") - return - to_chat(user, "You start adding [material] to [src]...") - if(do_after(user, 20, target = src) && material.use(1)) - make_new_table(material.tableVariant) + if (istype(I, /obj/item/stack)) + if(material?.tableVariant) + if(material.get_amount() < 1) + to_chat(user, "You need one [material.name] sheet to do this!") + return + to_chat(user, "You start adding [material] to [src]...") + if(do_after(user, 20, target = src) && material.use(1)) + make_new_table(material.tableVariant) + else + if(material.get_amount() < 1) + to_chat(user, "You need one metal sheet to do this!") + return + to_chat(user, "You start adding [material] to [src]...") + if(do_after(user, 20, target = src) && material.use(1)) + var/list/material_list + if(material.material_type) + material_list = list(material.material_type = MINERAL_MATERIAL_AMOUNT) + make_new_table(/obj/structure/table/greyscale, material_list) else return ..() -/obj/structure/table_frame/proc/make_new_table(table_type) //makes sure the new table made retains what we had as a frame +/obj/structure/table_frame/proc/make_new_table(table_type, list/custom_materials) //makes sure the new table made retains what we had as a frame var/obj/structure/table/T = new table_type(loc) T.frame = type T.framestack = framestack T.framestackamount = framestackamount + if(custom_materials) + T.set_custom_materials(custom_materials) qdel(src) /obj/structure/table_frame/deconstruct(disassembled = TRUE) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 0de5a57caca..5927efc50eb 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -29,10 +29,11 @@ var/buildstackamount = 1 var/framestackamount = 2 var/deconstruction_ready = 1 + custom_materials = list(/datum/material/iron = 2000) max_integrity = 100 - integrity_failure = 30 + integrity_failure = 0.33 smooth = SMOOTH_TRUE - canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced) + canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced, /obj/structure/table/greyscale) /obj/structure/table/examine(mob/user) . = ..() @@ -201,6 +202,10 @@ qdel(src) +/obj/structure/table/greyscale + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR + + /* * Glass tables */ @@ -395,7 +400,7 @@ buildstack = /obj/item/stack/sheet/plasteel canSmoothWith = list(/obj/structure/table/reinforced, /obj/structure/table) max_integrity = 200 - integrity_failure = 50 + integrity_failure = 0.25 armor = list("melee" = 10, "bullet" = 30, "laser" = 30, "energy" = 100, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70) /obj/structure/table/reinforced/deconstruction_hints(mob/user) @@ -609,7 +614,7 @@ icon = 'icons/obj/items_and_weapons.dmi' icon_state = "rack_parts" flags_1 = CONDUCT_1 - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) var/building = FALSE /obj/item/rack_parts/attackby(obj/item/W, mob/user, params) diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm index 93a9bb996d5..b19c558da12 100644 --- a/code/modules/antagonists/swarmer/swarmer.dm +++ b/code/modules/antagonists/swarmer/swarmer.dm @@ -4,7 +4,7 @@ desc = "A shell of swarmer that was completely powered down. It can no longer activate itself." icon = 'icons/mob/swarmer.dmi' icon_state = "swarmer_unactivated" - materials = list(/datum/material/iron=10000, /datum/material/glass=4000) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=4000) /obj/effect/mob_spawn/swarmer name = "unactivated swarmer" @@ -191,7 +191,7 @@ return 0 /obj/item/IntegrateAmount() //returns the amount of resources gained when eating this item - if(materials[getmaterialref(/datum/material/iron)] || materials[getmaterialref(/datum/material/glass)]) + if(custom_materials[getmaterialref(/datum/material/iron)] || custom_materials[getmaterialref(/datum/material/glass)]) return 1 return ..() diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 4a92d1804f7..6d8cb6ac390 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -12,7 +12,7 @@ icon_state = "" flags_1 = CONDUCT_1 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=100) + custom_materials = list(/datum/material/iron=100) throwforce = 2 throw_speed = 3 throw_range = 7 diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 0830c6d434f..dd74e86fd71 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -8,7 +8,7 @@ righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' throwforce = 0 w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron = 300, /datum/material/glass = 300) + custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 300) light_color = LIGHT_COLOR_WHITE light_power = FLASH_LIGHT_POWER var/flashing_overlay = "flash-f" diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm index 19ec84f4433..0af6c85fb6b 100644 --- a/code/modules/assembly/health.dm +++ b/code/modules/assembly/health.dm @@ -2,7 +2,7 @@ name = "health sensor" desc = "Used for scanning and monitoring health." icon_state = "health" - materials = list(/datum/material/iron=800, /datum/material/glass=200) + custom_materials = list(/datum/material/iron=800, /datum/material/glass=200) attachable = TRUE var/scanning = FALSE diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm index 4bbd009c229..bb380e34db6 100644 --- a/code/modules/assembly/igniter.dm +++ b/code/modules/assembly/igniter.dm @@ -2,7 +2,7 @@ name = "igniter" desc = "A small electronic device able to ignite combustible substances." icon_state = "igniter" - materials = list(/datum/material/iron=500, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=500, /datum/material/glass=50) var/datum/effect_system/spark_spread/sparks heat = 1000 diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index f598dafc003..77d90ddb758 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -2,7 +2,7 @@ name = "infrared emitter" desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted." icon_state = "infrared" - materials = list(/datum/material/iron=1000, /datum/material/glass=500) + custom_materials = list(/datum/material/iron=1000, /datum/material/glass=500) is_position_sensitive = TRUE var/on = FALSE diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 55444ac2b61..504639b459b 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -3,7 +3,7 @@ desc = "A handy little spring-loaded trap for catching pesty rodents." icon_state = "mousetrap" item_state = "mousetrap" - materials = list(/datum/material/iron=100) + custom_materials = list(/datum/material/iron=100) attachable = TRUE var/armed = FALSE diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 45da42b5320..3b7f15aa15d 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -2,7 +2,7 @@ name = "proximity sensor" desc = "Used for scanning and alerting when someone enters a certain proximity." icon_state = "prox" - materials = list(/datum/material/iron=800, /datum/material/glass=200) + custom_materials = list(/datum/material/iron=800, /datum/material/glass=200) attachable = TRUE var/scanning = FALSE diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index fd12b931a12..472fc872c56 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -5,7 +5,7 @@ item_state = "signaler" lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(/datum/material/iron=400, /datum/material/glass=120) + custom_materials = list(/datum/material/iron=400, /datum/material/glass=120) wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE attachable = TRUE diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index ac7c630714b..e87a0dea75b 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -2,7 +2,7 @@ name = "timer" desc = "Used to time things. Works well with contraptions which has to count down. Tick tock." icon_state = "timer" - materials = list(/datum/material/iron=500, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=500, /datum/material/glass=50) attachable = TRUE var/timing = FALSE diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm index 0dd79f8c772..1ef781bafff 100644 --- a/code/modules/assembly/voice.dm +++ b/code/modules/assembly/voice.dm @@ -7,7 +7,7 @@ name = "voice analyzer" desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated." icon_state = "voice" - materials = list(/datum/material/iron=500, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=500, /datum/material/glass=50) flags_1 = HEAR_1 attachable = TRUE verb_say = "beeps" diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 246b252dc3f..5569e1d74cc 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -68,7 +68,7 @@ power_channel = ENVIRON req_access = list(ACCESS_ATMOSPHERICS) max_integrity = 250 - integrity_failure = 80 + integrity_failure = 0.33 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30) resistance_flags = FIRE_PROOF ui_x = 440 diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index d09eb8f8bea..7e960da6357 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -21,7 +21,7 @@ armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 50) max_integrity = 250 - integrity_failure = 100 + integrity_failure = 0.4 pressure_resistance = 7 * ONE_ATMOSPHERE var/temperature_resistance = 1000 + T0C var/starter_temp diff --git a/code/modules/awaymissions/super_secret_room.dm b/code/modules/awaymissions/super_secret_room.dm index fca227cf8bc..628df002fce 100644 --- a/code/modules/awaymissions/super_secret_room.dm +++ b/code/modules/awaymissions/super_secret_room.dm @@ -122,7 +122,7 @@ icon = 'icons/obj/economy.dmi' icon_state = "rupee" w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/glass = 500) + custom_materials = list(/datum/material/glass = 500) /obj/item/rupee/Initialize() . = ..() diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm index 57c79426342..9c91a60c374 100644 --- a/code/modules/cargo/exports/materials.dm +++ b/code/modules/cargo/exports/materials.dm @@ -14,10 +14,10 @@ if(!isitem(O)) return 0 var/obj/item/I = O - if(!(getmaterialref(material_id) in I.materials)) + if(!(getmaterialref(material_id) in I.custom_materials)) return 0 - var/amount = I.materials[getmaterialref(material_id)] + var/amount = I.custom_materials[getmaterialref(material_id)] if(istype(I, /obj/item/stack)) var/obj/item/stack/S = I diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 5d14889318b..78319840f7b 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -2,7 +2,7 @@ name = "clothing" resistance_flags = FLAMMABLE max_integrity = 200 - integrity_failure = 80 + integrity_failure = 0.4 var/damaged_clothes = 0 //similar to machine's BROKEN stat and structure's broken var ///What level of bright light protection item has. var/flash_protect = FLASH_PROTECTION_NONE diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 2d51576abfd..44c52943377 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -8,7 +8,7 @@ strip_delay = 20 equip_delay_other = 25 resistance_flags = NONE - materials = list(/datum/material/glass = 250) + custom_materials = list(/datum/material/glass = 250) var/vision_flags = 0 var/darkness_view = 2//Base human is 2 var/invis_view = SEE_INVISIBLE_LIVING //admin only for now @@ -259,8 +259,8 @@ icon_state = "welding-g" item_state = "welding-g" actions_types = list(/datum/action/item_action/toggle) - materials = list(/datum/material/iron = 250) flash_protect = FLASH_PROTECTION_WELDER + custom_materials = list(/datum/material/iron = 250) tint = 2 visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT flags_cover = GLASSESCOVERSEYES diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index d740a1759cc..b142b2ff633 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -274,7 +274,7 @@ icon_state = "knight_greyscale" item_state = "knight_greyscale" armor = list("melee" = 35, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 10, "bio" = 10, "rad" = 10, "fire" = 40, "acid" = 40) - material_flags = MATERIAL_ADD_PREFIX //Can change color and add prefix + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR//Can change color and add prefix /obj/item/clothing/head/helmet/skull name = "skull helmet" diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index e92dbbbad3a..718a49a59f9 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -19,7 +19,7 @@ icon_state = "welding" flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH item_state = "welding" - materials = list(/datum/material/iron=1750, /datum/material/glass=400) + custom_materials = list(/datum/material/iron=1750, /datum/material/glass=400) flash_protect = FLASH_PROTECTION_WELDER tint = 2 armor = list("melee" = 10, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 60) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 0064430cd92..52ce7dc34bd 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -35,8 +35,8 @@ name = "welding mask" desc = "A gas mask with built-in welding goggles and a face shield. Looks like a skull - clearly designed by a nerd." icon_state = "weldingmask" - materials = list(/datum/material/iron=4000, /datum/material/glass=2000) flash_protect = FLASH_PROTECTION_WELDER + custom_materials = list(/datum/material/iron=4000, /datum/material/glass=2000) tint = 2 armor = list("melee" = 10, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 55) actions_types = list(/datum/action/item_action/toggle) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index f607daa06bd..e8f0a70a136 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -244,8 +244,8 @@ desc = "A classic suit of armour, able to be made from many different materials." icon_state = "knight_greyscale" item_state = "knight_greyscale" + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR//Can change color and add prefix armor = list("melee" = 35, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 10, "bio" = 10, "rad" = 10, "fire" = 40, "acid" = 40) - material_flags = MATERIAL_ADD_PREFIX //Can change color and add prefix /obj/item/clothing/suit/armor/vest/durathread name = "durathread vest" diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm index 736701c91e1..4f8e65f444b 100755 --- a/code/modules/clothing/under/accessories.dm +++ b/code/modules/clothing/under/accessories.dm @@ -108,7 +108,7 @@ name = "bronze medal" desc = "A bronze medal." icon_state = "bronze" - materials = list(/datum/material/iron=1000) + custom_materials = list(/datum/material/iron=1000) resistance_flags = FIRE_PROOF var/medaltype = "medal" //Sprite used for medalbox var/commended = FALSE @@ -176,7 +176,7 @@ desc = "A silver medal." icon_state = "silver" medaltype = "medal-silver" - materials = list(/datum/material/silver=1000) + custom_materials = list(/datum/material/silver=1000) /obj/item/clothing/accessory/medal/silver/valor name = "medal of valor" @@ -195,7 +195,7 @@ desc = "A prestigious golden medal." icon_state = "gold" medaltype = "medal-gold" - materials = list(/datum/material/gold=1000) + custom_materials = list(/datum/material/gold=1000) /obj/item/clothing/accessory/medal/gold/captain name = "medal of captaincy" @@ -212,7 +212,7 @@ icon_state = "plasma" medaltype = "medal-plasma" armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = -10, "acid" = 0) //It's made of plasma. Of course it's flammable. - materials = list(/datum/material/plasma=1000) + custom_materials = list(/datum/material/plasma=1000) /obj/item/clothing/accessory/medal/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300) diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 3d11667e995..8c6f9562429 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -153,7 +153,7 @@ force = 1 throwforce = 1 amount_per_transfer_from_this = 5 - materials = list(/datum/material/iron=100) + custom_materials = list(/datum/material/iron=100) possible_transfer_amounts = list() volume = 5 flags_1 = CONDUCT_1 @@ -169,7 +169,7 @@ force = 14 throwforce = 10 amount_per_transfer_from_this = 20 - materials = list(/datum/material/gold=1000) + custom_materials = list(/datum/material/gold=1000) volume = 150 /obj/item/reagent_containers/food/drinks/trophy/silver_cup @@ -180,7 +180,7 @@ force = 10 throwforce = 8 amount_per_transfer_from_this = 15 - materials = list(/datum/material/silver=800) + custom_materials = list(/datum/material/silver=800) volume = 100 @@ -192,7 +192,7 @@ force = 5 throwforce = 4 amount_per_transfer_from_this = 10 - materials = list(/datum/material/iron=400) + custom_materials = list(/datum/material/iron=400) volume = 25 ///////////////////////////////////////////////Drinks @@ -367,7 +367,7 @@ name = "shaker" desc = "A metal shaker to mix drinks in." icon_state = "shaker" - materials = list(/datum/material/iron=1500) + custom_materials = list(/datum/material/iron=1500) amount_per_transfer_from_this = 10 volume = 100 isGlass = FALSE @@ -377,7 +377,7 @@ desc = "Every good spaceman knows it's a good idea to bring along a couple of pints of whiskey wherever they go." custom_price = 30 icon_state = "flask" - materials = list(/datum/material/iron=250) + custom_materials = list(/datum/material/iron=250) volume = 60 isGlass = FALSE @@ -385,7 +385,7 @@ name = "captain's flask" desc = "A gold flask belonging to the captain." icon_state = "flask_gold" - materials = list(/datum/material/gold=500) + custom_materials = list(/datum/material/gold=500) /obj/item/reagent_containers/food/drinks/flask/det name = "detective's flask" diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index c6038a7e723..719a454b7a8 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -7,7 +7,7 @@ icon_state = "glass_empty" amount_per_transfer_from_this = 10 volume = 50 - materials = list(/datum/material/glass=500) + custom_materials = list(/datum/material/glass=500) max_integrity = 20 spillable = TRUE resistance_flags = ACID_PROOF @@ -49,7 +49,7 @@ amount_per_transfer_from_this = 15 possible_transfer_amounts = list() volume = 15 - materials = list(/datum/material/glass=100) + custom_materials = list(/datum/material/glass=100) /obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change(changetype) cut_overlays() diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index 80f5b60cd4d..73ec0ec9cc9 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -291,7 +291,7 @@ icon = 'icons/obj/food/soupsalad.dmi' icon_state = "bowl" reagent_flags = OPENCONTAINER - materials = list(/datum/material/glass = 500) + custom_materials = list(/datum/material/glass = 500) w_class = WEIGHT_CLASS_NORMAL /obj/item/reagent_containers/glass/bowl/attackby(obj/item/I,mob/user, params) diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 498d4ca08e8..883cd6a0d89 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -309,8 +309,9 @@ var/metal = 0 for(var/obj/item/O in ingredients) O.microwave_act(src) - if(O.materials[/datum/material/iron]) - metal += O.materials[/datum/material/iron] + if(O.custom_materials || O.custom_materials.len) + if(O.custom_materials[getmaterialref(/datum/material/iron)]) + metal += O.custom_materials[getmaterialref(/datum/material/iron)] if(metal) spark() diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index e3ae896782c..b22b24c64a4 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -424,7 +424,7 @@ name = "plant data disk" desc = "A disk for storing plant genetic data." icon_state = "datadisk_hydro" - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) var/datum/plant_gene/gene var/read_only = 0 //Well, it's still a floppy disk obj_flags = UNIQUE_RENAME diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm index 71aa16f6d6f..a5cf84dcf45 100644 --- a/code/modules/hydroponics/hydroitemdefines.dm +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -9,7 +9,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' w_class = WEIGHT_CLASS_TINY slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron=30, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=20) // ************************************* // Hydroponics Tools @@ -57,7 +57,7 @@ force = 5 throwforce = 7 w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=50) + custom_materials = list(/datum/material/iron=50) attack_verb = list("slashed", "sliced", "cut", "clawed") hitsound = 'sound/weapons/bladeslice.ogg' @@ -71,7 +71,7 @@ w_class = WEIGHT_CLASS_NORMAL attack_verb = list("slashed", "sliced", "bashed", "clawed") hitsound = null - materials = null + custom_materials = null flags_1 = NONE resistance_flags = FLAMMABLE @@ -97,7 +97,7 @@ throwforce = 15 throw_speed = 3 throw_range = 4 - materials = list(/datum/material/iron = 15000) + custom_materials = list(/datum/material/iron = 15000) attack_verb = list("chopped", "torn", "cut") hitsound = 'sound/weapons/bladeslice.ogg' sharpness = IS_SHARP @@ -114,7 +114,7 @@ /obj/item/hatchet/wooden desc = "A crude axe blade upon a short wooden handle." icon_state = "woodhatchet" - materials = null + custom_materials = null flags_1 = NONE /obj/item/scythe diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index af78d3d8d66..4e813397480 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -52,7 +52,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also Unit | Condition | Status | Direction | Distance
" for(var/PDT in turrets) var/obj/machinery/porta_turret/aux_base/T = PDT - var/integrity = max((T.obj_integrity-T.integrity_failure)/(T.max_integrity-T.integrity_failure)*100, 0) + var/integrity = max((T.obj_integrity-T.integrity_failure * T.max_integrity)/(T.max_integrity-T.integrity_failure * max_integrity)*100, 0) var/status if(T.stat & BROKEN) status = "ERROR" diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index ccdf690c082..9a3d87d1490 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -16,7 +16,7 @@ throwforce = 5 throw_speed = 4 armour_penetration = 10 - materials = list(/datum/material/iron=1150, /datum/material/glass=2075) + custom_materials = list(/datum/material/iron=1150, /datum/material/glass=2075) hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("smashed", "crushed", "cleaved", "chopped", "pulped") sharpness = IS_SHARP diff --git a/code/modules/mining/equipment/mining_tools.dm b/code/modules/mining/equipment/mining_tools.dm index 57646564e80..341221f26e4 100644 --- a/code/modules/mining/equipment/mining_tools.dm +++ b/code/modules/mining/equipment/mining_tools.dm @@ -11,7 +11,7 @@ lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi' w_class = WEIGHT_CLASS_BULKY - materials = list(/datum/material/iron=2000) //one sheet, but where can you make them? + custom_materials = list(/datum/material/iron=2000) //one sheet, but where can you make them? tool_behaviour = TOOL_MINING toolspeed = 1 usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg') @@ -32,7 +32,7 @@ throwforce = 7 slot_flags = ITEM_SLOT_BELT w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=1000) + custom_materials = list(/datum/material/iron=1000) /obj/item/pickaxe/silver name = "silver-plated pickaxe" @@ -106,7 +106,7 @@ throwforce = 4 item_state = "shovel" w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=50) + custom_materials = list(/datum/material/iron=50) attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked") sharpness = IS_SHARP diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index f4c78585f6b..c424fdd5d95 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -18,7 +18,7 @@ var/points = 0 var/ore_pickup_rate = 15 - var/sheet_per_ore = 1 + var/ore_multiplier = 1 var/point_upgrade = 1 var/list/ore_values = list(/datum/material/iron = 1, /datum/material/glass = 1, /datum/material/plasma = 15, /datum/material/silver = 16, /datum/material/gold = 18, /datum/material/titanium = 30, /datum/material/uranium = 30, /datum/material/diamond = 50, /datum/material/bluespace = 50, /datum/material/bananium = 60) var/message_sent = FALSE @@ -39,21 +39,21 @@ /obj/machinery/mineral/ore_redemption/RefreshParts() var/ore_pickup_rate_temp = 15 var/point_upgrade_temp = 1 - var/sheet_per_ore_temp = 1 + var/ore_multiplier_temp = 1 for(var/obj/item/stock_parts/matter_bin/B in component_parts) - sheet_per_ore_temp = 0.65 + (0.35 * B.rating) + ore_multiplier_temp = 0.65 + (0.35 * B.rating) for(var/obj/item/stock_parts/manipulator/M in component_parts) ore_pickup_rate_temp = 15 * M.rating for(var/obj/item/stock_parts/micro_laser/L in component_parts) point_upgrade_temp = 0.65 + (0.35 * L.rating) ore_pickup_rate = ore_pickup_rate_temp point_upgrade = point_upgrade_temp - sheet_per_ore = round(sheet_per_ore_temp, 0.01) + ore_multiplier = round(ore_multiplier_temp, 0.01) /obj/machinery/mineral/ore_redemption/examine(mob/user) . = ..() if(in_range(user, src) || isobserver(user)) - . += "The status display reads: Smelting [sheet_per_ore] sheet(s) per piece of ore.
Reward point generation at [point_upgrade*100]%.
Ore pickup speed at [ore_pickup_rate].
" + . += "The status display reads: Smelting [ore_multiplier] sheet(s) per piece of ore.
Reward point generation at [point_upgrade*100]%.
Ore pickup speed at [ore_pickup_rate].
" if(panel_open) . += "Alt-click to rotate the input and output direction." @@ -75,13 +75,13 @@ if(!material_amount) qdel(O) //no materials, incinerate it - else if(!mat_container.has_space(material_amount * sheet_per_ore * O.amount)) //if there is no space, eject it + else if(!mat_container.has_space(material_amount * O.amount)) //if there is no space, eject it unload_mineral(O) else - var/mats = O.materials & mat_container.materials + var/mats = O.custom_materials & mat_container.materials var/amount = O.amount - mat_container.insert_item(O, sheet_per_ore) //insert it + mat_container.insert_item(O, ore_multiplier) //insert it materials.silo_log(src, "smelted", amount, "someone", mats) qdel(O) diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index 58bbda1b4ea..1d4cbf18623 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -49,7 +49,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs) if(!istype(I) || (I.flags_1 & HOLOGRAM_1) || (I.item_flags & NO_MAT_REDEMPTION)) to_chat(user, "[M] won't accept [I]!") return - var/item_mats = I.materials & materials.materials + var/item_mats = I.custom_materials & materials.materials if(!length(item_mats)) to_chat(user, "[I] does not contain sufficient materials to be accepted by [M].") return diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index 51864ae64db..12e5716cde2 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -108,9 +108,9 @@ qdel(inp) if(materials.silo && !materials.on_hold()) //Dump the sheets to the silo - var/matlist = storage.materials & materials.mat_container.materials + var/matlist = storage.custom_materials & materials.mat_container.materials if (length(matlist)) - var/inserted = materials.mat_container.insert_stack(storage) + var/inserted = materials.mat_container.insert_item(storage) materials.silo_log(src, "collected", inserted, "sheets", matlist) if (QDELETED(storage)) stack_list -= key diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 330571146fb..f8a96f2970b 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -39,7 +39,7 @@ var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) for(var/obj/item/stack/sheet/O in T) - materials.insert_stack(O, O.amount) + materials.insert_item(O) /obj/machinery/mineral/mint/attack_hand(mob/user) . = ..() diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 34100bd96be..f418f6268d0 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -70,7 +70,8 @@ item_state = "Uranium ore" singular_name = "uranium ore chunk" points = 30 - materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) + material_flags = MATERIAL_NO_EFFECTS + custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/uranium /obj/item/stack/ore/iron @@ -79,7 +80,7 @@ item_state = "Iron ore" singular_name = "iron ore chunk" points = 1 - materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/metal /obj/item/stack/ore/glass @@ -88,7 +89,7 @@ item_state = "Glass ore" singular_name = "sand pile" points = 1 - materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/glass w_class = WEIGHT_CLASS_TINY @@ -131,7 +132,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ item_state = "Plasma ore" singular_name = "plasma ore chunk" points = 15 - materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/plasma /obj/item/stack/ore/plasma/welder_act(mob/living/user, obj/item/I) @@ -145,7 +146,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ item_state = "Silver ore" singular_name = "silver ore chunk" points = 16 - materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/silver /obj/item/stack/ore/gold @@ -154,7 +155,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ icon_state = "Gold ore" singular_name = "gold ore chunk" points = 18 - materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/gold /obj/item/stack/ore/diamond @@ -163,7 +164,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ item_state = "Diamond ore" singular_name = "diamond ore chunk" points = 50 - materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/diamond /obj/item/stack/ore/bananium @@ -172,7 +173,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ item_state = "Bananium ore" singular_name = "bananium ore chunk" points = 60 - materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/bananium /obj/item/stack/ore/titanium @@ -181,7 +182,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ item_state = "Titanium ore" singular_name = "titanium ore chunk" points = 50 - materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/titanium /obj/item/stack/ore/slag @@ -310,7 +311,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ throwforce = 2 w_class = WEIGHT_CLASS_TINY custom_materials = list(/datum/material/iron = 400) - material_flags = MATERIAL_ADD_PREFIX + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR var/string_attached var/list/sideslist = list("heads","tails") var/cooldown = 0 @@ -447,7 +448,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ icon_state = "coin_valid" custom_materials = list(/datum/material/plastic = 400) sideslist = list("valid", "salad") - material_flags = MATERIAL_NO_COLOR + material_flags = NONE /obj/item/coin/iron diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index d0a25cda3c6..7ef1d3aa0fe 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -18,6 +18,10 @@ else return ..() +/obj/structure/ore_box/ComponentInitialize() + . = ..() + AddComponent(/datum/component/rad_insulation, 0.01) //please datum mats no more cancer + /obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I) if(I.use_tool(src, user, 50, volume=50)) user.visible_message("[user] pries \the [src] apart.", diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 1ea9b4a701e..e473a229337 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -88,8 +88,9 @@ var/obj/item/stack/S = I if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel))) - if(S.materials[/datum/material/iron]) - S.cost = S.materials[/datum/material/iron] * 0.25 + if(S.custom_materials && custom_materials.len) + if(S.custom_materials[getmaterialref(/datum/material/iron)]) + S.cost = S.custom_materials[getmaterialref(/datum/material/iron)] * 0.25 S.source = get_or_create_estorage(/datum/robot_energy_storage/metal) else if(istype(S, /obj/item/stack/sheet/glass)) @@ -118,7 +119,7 @@ S.source = get_or_create_estorage(/datum/robot_energy_storage/pipe_cleaner) if(S && S.source) - S.materials = list() + S.custom_materials = null S.is_cyborg = 1 if(I.loc != src) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 3540a45871c..0811e3945f6 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -29,7 +29,7 @@ var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4. var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer. - integrity_failure = 50 + integrity_failure = 0.5 max_integrity = 100 armor = list("melee" = 0, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0) @@ -188,7 +188,7 @@ /obj/item/modular_computer/examine(mob/user) . = ..() - if(obj_integrity <= integrity_failure) + if(obj_integrity <= integrity_failure * max_integrity) . += "It is heavily damaged!" else if(obj_integrity < max_integrity) . += "It is damaged." @@ -206,7 +206,7 @@ else add_overlay(icon_state_menu) - if(obj_integrity <= integrity_failure) + if(obj_integrity <= integrity_failure * max_integrity) add_overlay("bsod") add_overlay("broken") @@ -220,7 +220,7 @@ /obj/item/modular_computer/proc/turn_on(mob/user) var/issynth = issilicon(user) // Robots and AIs get different activation messages. - if(obj_integrity <= integrity_failure) + if(obj_integrity <= integrity_failure * max_integrity) if(issynth) to_chat(user, "You send an activation signal to \the [src], but it responds with an error code. It must be damaged.") else @@ -252,7 +252,7 @@ last_power_usage = 0 return 0 - if(obj_integrity <= integrity_failure) + if(obj_integrity <= integrity_failure * max_integrity) shutdown_computer() return 0 diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index b3378679d7d..2a252fe1375 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -67,7 +67,7 @@ else add_overlay(screen_icon_state_menu) - if(cpu && cpu.obj_integrity <= cpu.integrity_failure) + if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity) add_overlay("bsod") add_overlay("broken") diff --git a/code/modules/modular_computers/computers/machinery/modular_console.dm b/code/modules/modular_computers/computers/machinery/modular_console.dm index 026091f88b1..5d596f98e4f 100644 --- a/code/modules/modular_computers/computers/machinery/modular_console.dm +++ b/code/modules/modular_computers/computers/machinery/modular_console.dm @@ -15,7 +15,7 @@ steel_sheet_cost = 10 light_strength = 2 max_integrity = 300 - integrity_failure = 150 + integrity_failure = 0.5 var/console_department = "" // Used in New() to set network tag according to our area. /obj/machinery/modular_computer/console/buildable/Initialize() @@ -52,4 +52,4 @@ network_card.identification_string = "Unknown Console" if(cpu) cpu.screen_on = 1 - update_icon() \ No newline at end of file + update_icon() diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 330bea16010..4112f730d9c 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -21,7 +21,7 @@ w_class = WEIGHT_CLASS_TINY throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=10) + custom_materials = list(/datum/material/iron=10) pressure_resistance = 2 grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1) var/colour = "black" //what colour the ink is! @@ -79,7 +79,7 @@ throwforce = 5 throw_speed = 4 colour = "crimson" - materials = list(/datum/material/gold = 750) + custom_materials = list(/datum/material/gold = 750) sharpness = IS_SHARP resistance_flags = FIRE_PROOF unique_reskin = list("Oak" = "pen-fountain-o", diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index c619edcbc2b..419cbc793c8 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -18,7 +18,7 @@ active_power_usage = 200 power_channel = EQUIP max_integrity = 300 - integrity_failure = 100 + integrity_failure = 0.33 var/obj/item/paper/copy = null //what's in the copier! var/obj/item/photo/photocopy = null var/obj/item/documents/doccopy = null diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm index 48defba55dc..6780a0c6f19 100644 --- a/code/modules/paperwork/stamps.dm +++ b/code/modules/paperwork/stamps.dm @@ -8,7 +8,7 @@ w_class = WEIGHT_CLASS_TINY throw_speed = 3 throw_range = 7 - materials = list(/datum/material/iron=60) + custom_materials = list(/datum/material/iron=60) pressure_resistance = 2 attack_verb = list("stamped") diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 0525c2283af..6e99cba2f68 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -14,7 +14,7 @@ w_class = WEIGHT_CLASS_SMALL flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_NECK - materials = list(/datum/material/iron = 50, /datum/material/glass = 150) + custom_materials = list(/datum/material/iron = 50, /datum/material/glass = 150) custom_price = 80 var/flash_enabled = TRUE var/state_on = "camera" diff --git a/code/modules/photography/camera/film.dm b/code/modules/photography/camera/film.dm index 5d7606d8551..4d05bb2ac32 100644 --- a/code/modules/photography/camera/film.dm +++ b/code/modules/photography/camera/film.dm @@ -11,4 +11,4 @@ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE - materials = list(/datum/material/iron = 10, /datum/material/glass = 10) + custom_materials = list(/datum/material/iron = 10, /datum/material/glass = 10) diff --git a/code/modules/photography/photos/frame.dm b/code/modules/photography/photos/frame.dm index f9618da81e2..df5d998b4ef 100644 --- a/code/modules/photography/photos/frame.dm +++ b/code/modules/photography/photos/frame.dm @@ -4,7 +4,7 @@ name = "picture frame" desc = "The perfect showcase for your favorite deathtrap memories." icon = 'icons/obj/decals.dmi' - materials = list() + custom_materials = null flags_1 = 0 icon_state = "frame-empty" result_path = /obj/structure/sign/picture_frame diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index cdafe47d9fb..740e3cbf8ac 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -53,7 +53,7 @@ use_power = NO_POWER_USE req_access = null max_integrity = 200 - integrity_failure = 50 + integrity_failure = 0.25 damage_deflection = 10 resistance_flags = FIRE_PROOF interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index ef9231ceac6..f595b9bbd37 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -398,7 +398,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list(new/datum/stack_recipe("cable restrain w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=10, /datum/material/glass=5) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=5) flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined", "flogged") @@ -552,7 +552,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list(new/datum/stack_recipe("cable restrain /obj/item/stack/cable_coil/cyborg is_cyborg = 1 - materials = list() + custom_materials = list() cost = 1 /obj/item/stack/cable_coil/cyborg/attack_self(mob/user) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 1975db5d243..0d5c9c291f0 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -13,7 +13,7 @@ w_class = WEIGHT_CLASS_SMALL var/charge = 0 // note %age conveted to actual charge in New var/maxcharge = 1000 - materials = list(/datum/material/iron=700, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=700, /datum/material/glass=50) grind_results = list(/datum/reagent/lithium = 15, /datum/reagent/iron = 5, /datum/reagent/silicon = 5) var/rigged = FALSE // true if rigged to explode var/chargerate = 100 //how much power is given every tick in a recharger @@ -170,7 +170,7 @@ name = "\improper Nanotrasen brand rechargeable AA battery" desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT maxcharge = 500 - materials = list(/datum/material/glass=40) + custom_materials = list(/datum/material/glass=40) /obj/item/stock_parts/cell/crap/empty/Initialize() . = ..() @@ -181,7 +181,7 @@ name = "upgraded power cell" desc = "A power cell with a slightly higher capacity than normal!" maxcharge = 2500 - materials = list(/datum/material/glass=50) + custom_materials = list(/datum/material/glass=50) chargerate = 1000 /obj/item/stock_parts/cell/upgraded/plus @@ -192,7 +192,7 @@ /obj/item/stock_parts/cell/secborg name = "security borg rechargeable D battery" maxcharge = 600 //600 max charge / 100 charge per shot = six shots - materials = list(/datum/material/glass=40) + custom_materials = list(/datum/material/glass=40) /obj/item/stock_parts/cell/secborg/empty/Initialize() . = ..() @@ -216,7 +216,7 @@ name = "high-capacity power cell" icon_state = "hcell" maxcharge = 10000 - materials = list(/datum/material/glass=60) + custom_materials = list(/datum/material/glass=60) chargerate = 1500 /obj/item/stock_parts/cell/high/plus @@ -235,7 +235,7 @@ name = "super-capacity power cell" icon_state = "scell" maxcharge = 20000 - materials = list(/datum/material/glass=300) + custom_materials = list(/datum/material/glass=300) chargerate = 2000 /obj/item/stock_parts/cell/super/empty/Initialize() @@ -247,7 +247,7 @@ name = "hyper-capacity power cell" icon_state = "hpcell" maxcharge = 30000 - materials = list(/datum/material/glass=400) + custom_materials = list(/datum/material/glass=400) chargerate = 3000 /obj/item/stock_parts/cell/hyper/empty/Initialize() @@ -260,7 +260,7 @@ desc = "A rechargeable transdimensional power cell." icon_state = "bscell" maxcharge = 40000 - materials = list(/datum/material/glass=600) + custom_materials = list(/datum/material/glass=600) chargerate = 4000 /obj/item/stock_parts/cell/bluespace/empty/Initialize() @@ -272,7 +272,7 @@ name = "infinite-capacity power cell!" icon_state = "icell" maxcharge = 30000 - materials = list(/datum/material/glass=1000) + custom_materials = list(/datum/material/glass=1000) rating = 100 chargerate = 30000 @@ -298,7 +298,7 @@ icon_state = "potato" charge = 100 maxcharge = 300 - materials = list() + custom_materials = null grown_battery = TRUE //it has the overlays for wires /obj/item/stock_parts/cell/high/slime @@ -306,7 +306,7 @@ desc = "A yellow slime core infused with plasma, it crackles with power." icon = 'icons/mob/slimes.dmi' icon_state = "yellow slime extract" - materials = list() + custom_materials = null rating = 5 //self-recharge makes these desirable self_recharge = 1 // Infused slime cores self-recharge, over time @@ -350,7 +350,7 @@ name = "miniature power cell" desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage." maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell - materials = list(/datum/material/glass = 20) + custom_materials = list(/datum/material/glass = 20) w_class = WEIGHT_CLASS_TINY /obj/item/stock_parts/cell/emergency_light/Initialize() diff --git a/code/modules/power/floodlight.dm b/code/modules/power/floodlight.dm index 06a37add831..8f160d3da66 100644 --- a/code/modules/power/floodlight.dm +++ b/code/modules/power/floodlight.dm @@ -43,7 +43,7 @@ icon_state = "floodlight" density = TRUE max_integrity = 100 - integrity_failure = 80 + integrity_failure = 0.8 idle_power_usage = 100 active_power_usage = 1000 var/list/light_setting_list = list(0, 5, 10, 15) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 1d6a4878347..2a1528dd63e 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -24,7 +24,7 @@ name = "small light fixture frame" icon_state = "bulb-construct-item" result_path = /obj/structure/light_construct/small - materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) /obj/item/wallframe/light_fixture/try_build(turf/on_wall, user) if(!..()) @@ -764,7 +764,7 @@ var/status = LIGHT_OK // LIGHT_OK, LIGHT_BURNED or LIGHT_BROKEN var/base_state var/switchcount = 0 // number of times switched - materials = list(/datum/material/glass=100) + custom_materials = list(/datum/material/glass=100) grind_results = list(/datum/reagent/silicon = 5, /datum/reagent/nitrogen = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs var/rigged = FALSE // true if rigged to explode var/brightness = 2 //how much light it gives off diff --git a/code/modules/power/pipecleaners.dm b/code/modules/power/pipecleaners.dm index ba9ec4479fa..f0492b01f94 100644 --- a/code/modules/power/pipecleaners.dm +++ b/code/modules/power/pipecleaners.dm @@ -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 - materials = list(/datum/material/iron=10, /datum/material/glass=5) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=5) flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined", "flogged") @@ -205,7 +205,7 @@ By design, d1 is the smallest direction and d2 is the highest /obj/item/stack/pipe_cleaner_coil/cyborg is_cyborg = 1 - materials = list() + custom_materials = null cost = 1 /obj/item/stack/pipe_cleaner_coil/cyborg/attack_self(mob/user) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 05803e7ad9e..d97cc10d51b 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -15,7 +15,7 @@ req_access = list(ACCESS_ENGINE_EQUIP) // use_power = NO_POWER_USE max_integrity = 350 - integrity_failure = 80 + integrity_failure = 0.2 circuit = /obj/item/circuitboard/machine/rad_collector rad_insulation = RAD_EXTREME_INSULATION var/obj/item/tank/internals/plasma/loaded_tank = null diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 3c109d9efd4..4e78c662a37 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -11,7 +11,7 @@ idle_power_usage = 0 active_power_usage = 0 max_integrity = 150 - integrity_failure = 50 + integrity_failure = 0.33 ui_x = 500 ui_y = 400 @@ -265,7 +265,7 @@ use_power = IDLE_POWER_USE idle_power_usage = 250 max_integrity = 200 - integrity_failure = 100 + integrity_failure = 0.5 var/icon_screen = "solar" var/icon_keyboard = "power_key" var/id = 0 diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index 206740360bf..063fc5265ff 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -11,7 +11,7 @@ density = TRUE use_power = NO_POWER_USE max_integrity = 250 - integrity_failure = 50 + integrity_failure = 0.2 var/id = 0 var/sun_angle = 0 // sun angle as set by sun datum diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm index 8cc82ddf9cf..886834109c9 100644 --- a/code/modules/projectiles/ammunition/_ammunition.dm +++ b/code/modules/projectiles/ammunition/_ammunition.dm @@ -7,7 +7,7 @@ slot_flags = ITEM_SLOT_BELT throwforce = 0 w_class = WEIGHT_CLASS_TINY - materials = list(/datum/material/iron = 500) + custom_materials = list(/datum/material/iron = 500) var/fire_sound = null //What sound should play when this ammo is fired var/caliber = null //Which kind of guns it can be loaded into var/projectile_type = null //The bullet type to create when New() is called diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm index a00348061dc..f8601015ec6 100644 --- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm +++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm @@ -5,15 +5,15 @@ desc = "A 12 gauge lead slug." icon_state = "blshell" caliber = "shotgun" + custom_materials = list(/datum/material/iron=4000) projectile_type = /obj/projectile/bullet/shotgun_slug - materials = list(/datum/material/iron=4000) /obj/item/ammo_casing/shotgun/beanbag name = "beanbag slug" desc = "A weak beanbag slug for riot control." icon_state = "bshell" + custom_materials = list(/datum/material/iron=250) projectile_type = /obj/projectile/bullet/shotgun_beanbag - materials = list(/datum/material/iron=250) /obj/item/ammo_casing/shotgun/incendiary name = "incendiary slug" @@ -34,7 +34,7 @@ desc = "A stunning taser slug." icon_state = "stunshell" projectile_type = /obj/projectile/bullet/shotgun_stunslug - materials = list(/datum/material/iron=250) + custom_materials = list(/datum/material/iron=250) /obj/item/ammo_casing/shotgun/meteorslug name = "meteorslug shell" @@ -71,7 +71,7 @@ projectile_type = /obj/projectile/bullet/pellet/shotgun_rubbershot pellets = 6 variance = 25 - materials = list(/datum/material/iron=4000) + custom_materials = list(/datum/material/iron=4000) /obj/item/ammo_casing/shotgun/incapacitate name = "custom incapacitating shot" @@ -80,14 +80,14 @@ projectile_type = /obj/projectile/bullet/pellet/shotgun_incapacitate pellets = 12//double the pellets, but half the stun power of each, which makes this best for just dumping right in someone's face. variance = 25 - materials = list(/datum/material/iron=4000) + custom_materials = list(/datum/material/iron=4000) /obj/item/ammo_casing/shotgun/improvised name = "improvised shell" desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards." icon_state = "improvshell" projectile_type = /obj/projectile/bullet/pellet/shotgun_improvised - materials = list(/datum/material/iron=250) + custom_materials = list(/datum/material/iron=250) pellets = 10 variance = 25 diff --git a/code/modules/projectiles/ammunition/caseless/foam.dm b/code/modules/projectiles/ammunition/caseless/foam.dm index 3145358ec8a..f2cf0f23246 100644 --- a/code/modules/projectiles/ammunition/caseless/foam.dm +++ b/code/modules/projectiles/ammunition/caseless/foam.dm @@ -5,7 +5,7 @@ caliber = "foam_force" icon = 'icons/obj/guns/toy.dmi' icon_state = "foamdart" - materials = list(/datum/material/iron = 11.25) + custom_materials = list(/datum/material/iron = 11.25) harmful = FALSE var/modified = FALSE @@ -62,4 +62,4 @@ desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up." projectile_type = /obj/projectile/bullet/reusable/foam_dart/riot icon_state = "foamdart_riot" - materials = list(/datum/material/iron = 1125) + custom_materials = list(/datum/material/iron = 1125) diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm index 355ef66fa16..3311212cd9b 100644 --- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm +++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm @@ -8,7 +8,7 @@ item_state = "syringe_kit" lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - materials = list(/datum/material/iron = 30000) + custom_materials = list(/datum/material/iron = 30000) throwforce = 2 w_class = WEIGHT_CLASS_TINY throw_speed = 3 @@ -35,8 +35,8 @@ /obj/item/ammo_box/Initialize() . = ..() if (!bullet_cost) - for (var/material in materials) - var/material_amount = materials[material] + for (var/material in custom_materials) + var/material_amount = custom_materials[material] LAZYSET(base_cost, material, (material_amount * 0.10)) material_amount *= 0.90 // 10% for the container @@ -133,7 +133,8 @@ for (var/material in bullet_cost) var/material_amount = bullet_cost[material] material_amount = (material_amount*stored_ammo.len) + base_cost[material] - materials[material] = material_amount + custom_materials[material] = material_amount + set_custom_materials(custom_materials)//make sure we setup the correct properties again ///Count of number of bullets in the magazine /obj/item/ammo_box/magazine/proc/ammo_count(countempties = TRUE) diff --git a/code/modules/projectiles/boxes_magazines/ammo_boxes.dm b/code/modules/projectiles/boxes_magazines/ammo_boxes.dm index fae1135218a..b0218577271 100644 --- a/code/modules/projectiles/boxes_magazines/ammo_boxes.dm +++ b/code/modules/projectiles/boxes_magazines/ammo_boxes.dm @@ -14,7 +14,7 @@ ammo_type = /obj/item/ammo_casing/c38 max_ammo = 6 multiple_sprites = AMMO_BOX_PER_BULLET - materials = list(/datum/material/iron = 20000) + custom_materials = list(/datum/material/iron = 20000) /obj/item/ammo_box/c38/trac name = "speed loader (.38 TRAC)" @@ -76,9 +76,9 @@ icon_state = "foambox" ammo_type = /obj/item/ammo_casing/caseless/foam_dart max_ammo = 40 - materials = list(/datum/material/iron = 500) + custom_materials = list(/datum/material/iron = 500) /obj/item/ammo_box/foambox/riot icon_state = "foambox_riot" ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot - materials = list(/datum/material/iron = 50000) + custom_materials = list(/datum/material/iron = 50000) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index c72af051d4e..7b9715bc3d5 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -9,7 +9,7 @@ item_state = "gun" flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) w_class = WEIGHT_CLASS_NORMAL throwforce = 5 throw_speed = 3 diff --git a/code/modules/projectiles/guns/ballistic/laser_gatling.dm b/code/modules/projectiles/guns/ballistic/laser_gatling.dm index 16ad34421f8..1d21e00ca37 100644 --- a/code/modules/projectiles/guns/ballistic/laser_gatling.dm +++ b/code/modules/projectiles/guns/ballistic/laser_gatling.dm @@ -103,7 +103,7 @@ slowdown = 1 slot_flags = null w_class = WEIGHT_CLASS_HUGE - materials = list() + custom_materials = null burst_size = 3 automatic = 0 fire_delay = 1 diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 6d6ec8deda7..5ff5b96dec1 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -4,7 +4,7 @@ icon_state = "laser" item_state = "laser" w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) ammo_type = list(/obj/item/ammo_casing/energy/lasergun) ammo_x_offset = 1 shaded_charge = 1 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index cbadddb4825..05737d3759b 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -89,7 +89,7 @@ icon_state = "crossbow" item_state = "crossbow" w_class = WEIGHT_CLASS_SMALL - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) suppressed = TRUE ammo_type = list(/obj/item/ammo_casing/energy/bolt) weapon_weight = WEAPON_LIGHT @@ -112,7 +112,7 @@ desc = "A reverse engineered weapon using syndicate technology." icon_state = "crossbowlarge" w_class = WEIGHT_CLASS_NORMAL - materials = list(/datum/material/iron=4000) + custom_materials = list(/datum/material/iron=4000) suppressed = null ammo_type = list(/obj/item/ammo_casing/energy/bolt/large) pin = null diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index e0d007a5edc..07cdbe256ac 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -19,7 +19,7 @@ fire_sound = 'sound/weapons/beam_sniper.ogg' slot_flags = ITEM_SLOT_BACK force = 15 - materials = list() + custom_materials = null recoil = 4 ammo_x_offset = 3 ammo_y_offset = 3 diff --git a/code/modules/projectiles/guns/misc/chem_gun.dm b/code/modules/projectiles/guns/misc/chem_gun.dm index 317969e806c..835dcf862d8 100644 --- a/code/modules/projectiles/guns/misc/chem_gun.dm +++ b/code/modules/projectiles/guns/misc/chem_gun.dm @@ -9,7 +9,7 @@ throw_speed = 3 throw_range = 7 force = 4 - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) clumsy_check = FALSE fire_sound = 'sound/items/syringeproj.ogg' var/time_per_syringe = 250 diff --git a/code/modules/projectiles/guns/misc/grenade_launcher.dm b/code/modules/projectiles/guns/misc/grenade_launcher.dm index bf057fdd3cd..f269d70bdbb 100644 --- a/code/modules/projectiles/guns/misc/grenade_launcher.dm +++ b/code/modules/projectiles/guns/misc/grenade_launcher.dm @@ -10,7 +10,7 @@ force = 5 var/list/grenades = new/list() var/max_grenades = 3 - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) /obj/item/gun/grenadelauncher/examine(mob/user) . = ..() diff --git a/code/modules/projectiles/guns/misc/syringe_gun.dm b/code/modules/projectiles/guns/misc/syringe_gun.dm index 9753e2f59af..090e96ed17a 100644 --- a/code/modules/projectiles/guns/misc/syringe_gun.dm +++ b/code/modules/projectiles/guns/misc/syringe_gun.dm @@ -7,7 +7,7 @@ throw_speed = 3 throw_range = 7 force = 4 - materials = list(/datum/material/iron=2000) + custom_materials = list(/datum/material/iron=2000) clumsy_check = 0 fire_sound = 'sound/items/syringeproj.ogg' var/list/syringes = list() diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 85114111dbc..52d69f05736 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -115,7 +115,7 @@ icon = 'icons/obj/chemical.dmi' icon_state = "beaker" item_state = "beaker" - materials = list(/datum/material/glass=500) + custom_materials = list(/datum/material/glass=500) /obj/item/reagent_containers/glass/beaker/Initialize() . = ..() @@ -164,7 +164,7 @@ name = "large beaker" desc = "A large beaker. Can hold up to 100 units." icon_state = "beakerlarge" - materials = list(/datum/material/glass=2500) + custom_materials = list(/datum/material/glass=2500) volume = 100 amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,20,25,30,50,100) @@ -173,7 +173,7 @@ name = "x-large beaker" desc = "An extra-large beaker. Can hold up to 120 units." icon_state = "beakerwhite" - materials = list(/datum/material/glass=2500, /datum/material/plastic=3000) + custom_materials = list(/datum/material/glass=2500, /datum/material/plastic=3000) volume = 120 amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,20,25,30,60,120) @@ -187,7 +187,7 @@ name = "metamaterial beaker" desc = "A large beaker. Can hold up to 180 units." icon_state = "beakergold" - materials = list(/datum/material/glass=2500, /datum/material/plastic=3000, /datum/material/gold=1000, /datum/material/titanium=1000) + custom_materials = list(/datum/material/glass=2500, /datum/material/plastic=3000, /datum/material/gold=1000, /datum/material/titanium=1000) volume = 180 amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,20,25,30,60,120,180) @@ -197,7 +197,7 @@ desc = "A cryostasis beaker that allows for chemical storage without \ reactions. Can hold up to 50 units." icon_state = "beakernoreact" - materials = list(/datum/material/iron=3000) + custom_materials = list(/datum/material/iron=3000) reagent_flags = OPENCONTAINER | NO_REACT volume = 50 amount_per_transfer_from_this = 10 @@ -208,8 +208,9 @@ and Element Cuban combined with the Compound Pete. Can hold up to \ 300 units." icon_state = "beakerbluespace" - materials = list(/datum/material/glass = 5000, /datum/material/plasma = 3000, /datum/material/diamond = 1000, /datum/material/bluespace = 1000) + custom_materials = list(/datum/material/glass = 5000, /datum/material/plasma = 3000, /datum/material/diamond = 1000, /datum/material/bluespace = 1000) volume = 300 + material_flags = MATERIAL_NO_EFFECTS amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300) @@ -249,7 +250,7 @@ item_state = "bucket" lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' - materials = list(/datum/material/iron=200) + custom_materials = list(/datum/material/iron=200) w_class = WEIGHT_CLASS_NORMAL amount_per_transfer_from_this = 20 possible_transfer_amounts = list(5,10,15,20,25,30,50,70) @@ -273,7 +274,7 @@ name = "wooden bucket" icon_state = "woodbucket" item_state = "woodbucket" - materials = null + custom_materials = null armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 50) resistance_flags = FLAMMABLE @@ -322,7 +323,7 @@ icon_state = "smallbottle" item_state = "bottle" list_reagents = list(/datum/reagent/water = 49.5, /datum/reagent/fluorine = 0.5)//see desc, don't think about it too hard - materials = list(/datum/material/glass=0) + custom_materials = list(/datum/material/glass=0) volume = 50 amount_per_transfer_from_this = 10 @@ -332,7 +333,7 @@ /obj/item/reagent_containers/glass/beaker/waterbottle/large desc = "A fresh commercial-sized bottle of water." icon_state = "largebottle" - materials = list(/datum/material/glass=0) + custom_materials = list(/datum/material/glass=0) list_reagents = list(/datum/reagent/water = 100) volume = 100 amount_per_transfer_from_this = 20 diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 5f4716b52a6..fff0ecf04b3 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -12,7 +12,7 @@ var/mode = SYRINGE_DRAW var/busy = FALSE // needed for delayed drawing of blood var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun - materials = list(/datum/material/iron=10, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=20) reagent_flags = TRANSPARENT /obj/item/reagent_containers/syringe/Initialize() diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index e72cd57e199..4020c04e653 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -58,8 +58,6 @@ other types of metals and chemistry for reagents). else temp_list[i] = amount materials = temp_list - for(var/i in materials) - to_chat("[i] [materials[i]]") /datum/design/proc/icon_html(client/user) var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) @@ -74,7 +72,7 @@ other types of metals and chemistry for reagents). name = "Component Design Disk" desc = "A disk for storing device design data for construction in lathes." icon_state = "datadisk1" - materials = list(/datum/material/iron =300, /datum/material/glass =100) + custom_materials = list(/datum/material/iron =300, /datum/material/glass =100) var/list/blueprints = list() var/max_blueprints = 1 @@ -88,5 +86,5 @@ other types of metals and chemistry for reagents). /obj/item/disk/design_disk/adv name = "Advanced Component Design Disk" desc = "A disk for storing device design data for construction in lathes. This one has extra storage space." - materials = list(/datum/material/iron =300, /datum/material/glass = 100, /datum/material/silver = 50) + custom_materials = list(/datum/material/iron =300, /datum/material/glass = 100, /datum/material/silver = 50) max_blueprints = 5 diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 3f6eb278e28..1c97022348d 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -61,12 +61,12 @@ Note: Must be placed within 3 tiles of the R&D Console . = 0 var/datum/component/material_container/storage = linked_console?.linked_lathe?.materials.mat_container if(storage) //Also sends salvaged materials to a linked protolathe, if any. - for(var/material in thing.materials) - var/can_insert = min((storage.max_amount - storage.total_amount), (max(thing.materials[material]*(decon_mod/10), thing.materials[material]))) + for(var/material in thing.custom_materials) + var/can_insert = min((storage.max_amount - storage.total_amount), (max(thing.custom_materials[material]*(decon_mod/10), thing.custom_materials[material]))) storage.insert_amount_mat(can_insert, material) . += can_insert if (.) - linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.materials) + linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.custom_materials) /obj/machinery/rnd/destructive_analyzer/proc/destroy_item(obj/item/thing, innermode = FALSE) if(QDELETED(thing) || QDELETED(src) || QDELETED(linked_console)) @@ -132,7 +132,7 @@ Note: Must be placed within 3 tiles of the R&D Console var/user_mode_string = "" if(length(point_value)) user_mode_string = " for [json_encode(point_value)] points" - else if(loaded_item.materials.len) + else if(loaded_item.custom_materials.len) user_mode_string = " for material reclamation" var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel") if(choice == "Cancel") diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index fa7eca37141..d2796563e13 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -440,8 +440,8 @@ visible_message("[exp_on] activates the crushing mechanism, [exp_on] is destroyed!") if(linked_console.linked_lathe) var/datum/component/material_container/linked_materials = linked_console.linked_lathe.GetComponent(/datum/component/material_container) - for(var/material in exp_on.materials) - linked_materials.insert_amount_mat( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material) + for(var/material in exp_on.custom_materials) + linked_materials.insert_amount_mat( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.custom_materials[material])), material) if(prob(EFFECT_PROB_LOW) && criticalReaction) visible_message("[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!") new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src)))) diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index b201ec76397..9e6827e8789 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -88,7 +88,8 @@ for(var/i in 1 to amount) var/obj/item/I = new path(get_turf(src)) if(efficient_with(I.type)) - I.materials = matlist.Copy() + I.set_custom_materials(matlist.Copy()) + I.material_flags |= MATERIAL_NO_EFFECTS //Find a better way to do this. SSblackbox.record_feedback("nested tally", "item_printed", amount, list("[type]", "[path]")) /obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, var/mat) // now returns how many times the item can be built with the material diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index b60a93aebd2..fb4b4fd8d2d 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -625,7 +625,7 @@ Nothing else in the console has ID requirements. l += "[RDSCREEN_NOBREAK]" if(!(linked_destroy.loaded_item.resistance_flags & INDESTRUCTIBLE)) - var/list/materials = linked_destroy.loaded_item.materials + var/list/materials = linked_destroy.loaded_item.custom_materials l += "
[materials.len? "Material Reclamation" : "Destroy Item"]" for (var/M in materials) l += "* [CallMaterialName(M)] x [materials[M]]" diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 23d515cf880..73302014758 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -93,14 +93,14 @@ loaded_item.forceMove(loc) ..() -/obj/machinery/rnd/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted) +/obj/machinery/rnd/proc/AfterMaterialInsert(item_inserted, id_inserted, amount_inserted) var/stack_name - if(ispath(type_inserted, /obj/item/stack/ore/bluespace_crystal)) + if(istype(item_inserted, /obj/item/stack/ore/bluespace_crystal)) stack_name = "bluespace" use_power(MINERAL_MATERIAL_AMOUNT / 10) else - var/obj/item/stack/S = type_inserted - stack_name = initial(S.name) + var/obj/item/stack/S = item_inserted + stack_name = S.name use_power(min(1000, (amount_inserted / 100))) add_overlay("protolathe_[stack_name]") addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10) diff --git a/code/modules/research/research_disk.dm b/code/modules/research/research_disk.dm index 7c7d0af8b79..5de053fae6f 100644 --- a/code/modules/research/research_disk.dm +++ b/code/modules/research/research_disk.dm @@ -3,7 +3,7 @@ name = "technology disk" desc = "A disk for storing technology data for further research." icon_state = "datadisk0" - materials = list(/datum/material/iron=300, /datum/material/glass=100) + custom_materials = list(/datum/material/iron=300, /datum/material/glass=100) var/datum/techweb/stored_research /obj/item/disk/tech_disk/Initialize() @@ -15,7 +15,7 @@ /obj/item/disk/tech_disk/debug name = "\improper CentCom technology disk" desc = "A debug item for research" - materials = list() + custom_materials = null /obj/item/disk/tech_disk/debug/Initialize() . = ..() diff --git a/code/modules/research/stock_parts.dm b/code/modules/research/stock_parts.dm index 15d740cf26d..9b41c4aec4d 100644 --- a/code/modules/research/stock_parts.dm +++ b/code/modules/research/stock_parts.dm @@ -132,31 +132,31 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi name = "capacitor" desc = "A basic capacitor used in the construction of a variety of devices." icon_state = "capacitor" - materials = list(/datum/material/iron=50, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=50) /obj/item/stock_parts/scanning_module name = "scanning module" desc = "A compact, high resolution scanning module used in the construction of certain devices." icon_state = "scan_module" - materials = list(/datum/material/iron=50, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) /obj/item/stock_parts/manipulator name = "micro-manipulator" desc = "A tiny little manipulator used in the construction of certain devices." icon_state = "micro_mani" - materials = list(/datum/material/iron=30) + custom_materials = list(/datum/material/iron=30) /obj/item/stock_parts/micro_laser name = "micro-laser" desc = "A tiny laser used in certain devices." icon_state = "micro_laser" - materials = list(/datum/material/iron=10, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=20) /obj/item/stock_parts/matter_bin name = "matter bin" desc = "A container designed to hold compressed matter awaiting reconstruction." icon_state = "matter_bin" - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) //Rating 2 @@ -165,35 +165,35 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi desc = "An advanced capacitor used in the construction of a variety of devices." icon_state = "adv_capacitor" rating = 2 - materials = list(/datum/material/iron=50, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=50) /obj/item/stock_parts/scanning_module/adv name = "advanced scanning module" desc = "A compact, high resolution scanning module used in the construction of certain devices." icon_state = "adv_scan_module" rating = 2 - materials = list(/datum/material/iron=50, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) /obj/item/stock_parts/manipulator/nano name = "nano-manipulator" desc = "A tiny little manipulator used in the construction of certain devices." icon_state = "nano_mani" rating = 2 - materials = list(/datum/material/iron=30) + custom_materials = list(/datum/material/iron=30) /obj/item/stock_parts/micro_laser/high name = "high-power micro-laser" desc = "A tiny laser used in certain devices." icon_state = "high_micro_laser" rating = 2 - materials = list(/datum/material/iron=10, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=20) /obj/item/stock_parts/matter_bin/adv name = "advanced matter bin" desc = "A container designed to hold compressed matter awaiting reconstruction." icon_state = "advanced_matter_bin" rating = 2 - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) //Rating 3 @@ -202,35 +202,35 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi desc = "A super-high capacity capacitor used in the construction of a variety of devices." icon_state = "super_capacitor" rating = 3 - materials = list(/datum/material/iron=50, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=50) /obj/item/stock_parts/scanning_module/phasic name = "phasic scanning module" desc = "A compact, high resolution phasic scanning module used in the construction of certain devices." icon_state = "super_scan_module" rating = 3 - materials = list(/datum/material/iron=50, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) /obj/item/stock_parts/manipulator/pico name = "pico-manipulator" desc = "A tiny little manipulator used in the construction of certain devices." icon_state = "pico_mani" rating = 3 - materials = list(/datum/material/iron=30) + custom_materials = list(/datum/material/iron=30) /obj/item/stock_parts/micro_laser/ultra name = "ultra-high-power micro-laser" icon_state = "ultra_high_micro_laser" desc = "A tiny laser used in certain devices." rating = 3 - materials = list(/datum/material/iron=10, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=20) /obj/item/stock_parts/matter_bin/super name = "super matter bin" desc = "A container designed to hold compressed matter awaiting reconstruction." icon_state = "super_matter_bin" rating = 3 - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) //Rating 4 @@ -239,35 +239,35 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi desc = "An capacity capacitor used in the construction of a variety of devices." icon_state = "quadratic_capacitor" rating = 4 - materials = list(/datum/material/iron=50, /datum/material/glass=50) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=50) /obj/item/stock_parts/scanning_module/triphasic name = "triphasic scanning module" desc = "A compact, ultra resolution triphasic scanning module used in the construction of certain devices." icon_state = "triphasic_scan_module" rating = 4 - materials = list(/datum/material/iron=50, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) /obj/item/stock_parts/manipulator/femto name = "femto-manipulator" desc = "A tiny little manipulator used in the construction of certain devices." icon_state = "femto_mani" rating = 4 - materials = list(/datum/material/iron=30) + custom_materials = list(/datum/material/iron=30) /obj/item/stock_parts/micro_laser/quadultra name = "quad-ultra micro-laser" icon_state = "quadultra_micro_laser" desc = "A tiny laser used in certain devices." rating = 4 - materials = list(/datum/material/iron=10, /datum/material/glass=20) + custom_materials = list(/datum/material/iron=10, /datum/material/glass=20) /obj/item/stock_parts/matter_bin/bluespace name = "bluespace matter bin" desc = "A container designed to hold compressed matter awaiting reconstruction." icon_state = "bluespace_matter_bin" rating = 4 - materials = list(/datum/material/iron=80) + custom_materials = list(/datum/material/iron=80) // Subspace stock parts @@ -275,43 +275,43 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi name = "subspace ansible" icon_state = "subspace_ansible" desc = "A compact module capable of sensing extradimensional activity." - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) /obj/item/stock_parts/subspace/filter name = "hyperwave filter" icon_state = "hyperwave_filter" desc = "A tiny device capable of filtering and converting super-intense radiowaves." - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) /obj/item/stock_parts/subspace/amplifier name = "subspace amplifier" icon_state = "subspace_amplifier" desc = "A compact micro-machine capable of amplifying weak subspace transmissions." - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) /obj/item/stock_parts/subspace/treatment name = "subspace treatment disk" icon_state = "treatment_disk" desc = "A compact micro-machine capable of stretching out hyper-compressed radio waves." - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) /obj/item/stock_parts/subspace/analyzer name = "subspace wavelength analyzer" icon_state = "wavelength_analyzer" desc = "A sophisticated analyzer capable of analyzing cryptic subspace wavelengths." - materials = list(/datum/material/iron=30, /datum/material/glass=10) + custom_materials = list(/datum/material/iron=30, /datum/material/glass=10) /obj/item/stock_parts/subspace/crystal name = "ansible crystal" icon_state = "ansible_crystal" desc = "A crystal made from pure glass used to transmit laser databursts to subspace." - materials = list(/datum/material/glass=50) + custom_materials = list(/datum/material/glass=50) /obj/item/stock_parts/subspace/transmitter name = "subspace transmitter" icon_state = "subspace_transmitter" desc = "A large piece of equipment used to open a window into the subspace dimension." - materials = list(/datum/material/iron=50) + custom_materials = list(/datum/material/iron=50) /obj/item/research//Makes testing much less of a pain -Sieve name = "research" diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 9d44b014994..18d36f28e04 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -985,7 +985,7 @@ item_state = "tile-bluespace" w_class = WEIGHT_CLASS_NORMAL force = 6 - materials = list(/datum/material/iron=500) + custom_materials = list(/datum/material/iron=500) throwforce = 10 throw_speed = 3 throw_range = 7 @@ -1002,7 +1002,7 @@ item_state = "tile-sepia" w_class = WEIGHT_CLASS_NORMAL force = 6 - materials = list(/datum/material/iron=500) + custom_materials = list(/datum/material/iron=500) throwforce = 10 throw_speed = 0.1 throw_range = 28 diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index a9a8e7bf9fb..02a07b51787 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -92,7 +92,7 @@ ADD_TRAIT(holder, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT) holder.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF holder.slot_flags = null - holder.materials = null + holder.set_custom_materials(null) if(istype(holder, /obj/item/assembly/flash/armimplant)) var/obj/item/assembly/flash/F = holder diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index ed1bc7aeb98..57ea52e3959 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -142,14 +142,14 @@ name = "Surgery Procedure Disk" desc = "A disk that contains advanced surgery procedures, must be loaded into an Operating Console." icon_state = "datadisk1" - materials = list(/datum/material/iron=300, /datum/material/glass=100) + custom_materials = list(/datum/material/iron=300, /datum/material/glass=100) var/list/surgeries /obj/item/disk/surgery/debug name = "Debug Surgery Disk" desc = "A disk that contains all existing surgery procedures." icon_state = "datadisk1" - materials = list(/datum/material/iron=300, /datum/material/glass=100) + custom_materials = list(/datum/material/iron=300, /datum/material/glass=100) /obj/item/disk/surgery/debug/Initialize() . = ..() diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 6ae500d1c1f..b91b38bf73c 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -6,7 +6,7 @@ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' item_state = "clamps" - materials = list(/datum/material/iron=6000, /datum/material/glass=3000) + custom_materials = list(/datum/material/iron=6000, /datum/material/glass=3000) flags_1 = CONDUCT_1 item_flags = SURGICAL_TOOL w_class = WEIGHT_CLASS_TINY @@ -17,7 +17,7 @@ desc = "Micro-mechanical manipulator for retracting stuff." icon = 'icons/obj/surgery.dmi' icon_state = "retractor" - materials = list(/datum/material/iron=6000, /datum/material/glass=3000) + custom_materials = list(/datum/material/iron=6000, /datum/material/glass=3000) w_class = WEIGHT_CLASS_TINY toolspeed = 0.5 @@ -30,7 +30,7 @@ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' item_state = "clamps" - materials = list(/datum/material/iron=5000, /datum/material/glass=2500) + custom_materials = list(/datum/material/iron=5000, /datum/material/glass=2500) flags_1 = CONDUCT_1 item_flags = SURGICAL_TOOL w_class = WEIGHT_CLASS_TINY @@ -42,7 +42,7 @@ desc = "Tiny servos power a pair of pincers to stop bleeding." icon = 'icons/obj/surgery.dmi' icon_state = "hemostat" - materials = list(/datum/material/iron=5000, /datum/material/glass=2500) + custom_materials = list(/datum/material/iron=5000, /datum/material/glass=2500) w_class = WEIGHT_CLASS_TINY toolspeed = 0.5 attack_verb = list("attacked", "pinched") @@ -56,7 +56,7 @@ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' item_state = "cautery" - materials = list(/datum/material/iron=2500, /datum/material/glass=750) + custom_materials = list(/datum/material/iron=2500, /datum/material/glass=750) flags_1 = CONDUCT_1 item_flags = SURGICAL_TOOL w_class = WEIGHT_CLASS_TINY @@ -68,7 +68,7 @@ desc = "A heated element that cauterizes wounds." icon = 'icons/obj/surgery.dmi' icon_state = "cautery" - materials = list(/datum/material/iron=2500, /datum/material/glass=750) + custom_materials = list(/datum/material/iron=2500, /datum/material/glass=750) w_class = WEIGHT_CLASS_TINY toolspeed = 0.5 attack_verb = list("burnt") @@ -82,7 +82,7 @@ lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' hitsound = 'sound/weapons/circsawhit.ogg' - materials = list(/datum/material/iron=10000, /datum/material/glass=6000) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=6000) flags_1 = CONDUCT_1 item_flags = SURGICAL_TOOL force = 15 @@ -96,7 +96,7 @@ icon = 'icons/obj/surgery.dmi' icon_state = "drill" hitsound = 'sound/weapons/circsawhit.ogg' - materials = list(/datum/material/iron=10000, /datum/material/glass=6000) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=6000) force = 10 w_class = WEIGHT_CLASS_SMALL toolspeed = 0.5 @@ -119,7 +119,7 @@ throwforce = 5 throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=4000, /datum/material/glass=1000) + custom_materials = list(/datum/material/iron=4000, /datum/material/glass=1000) attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") hitsound = 'sound/weapons/bladeslice.ogg' sharpness = IS_SHARP_ACCURATE @@ -138,7 +138,7 @@ throwforce = 5 throw_speed = 3 throw_range = 5 - materials = list(/datum/material/iron=4000, /datum/material/glass=1000) + custom_materials = list(/datum/material/iron=4000, /datum/material/glass=1000) attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") toolspeed = 0.5 hitsound = 'sound/weapons/bladeslice.ogg' @@ -165,7 +165,7 @@ throwforce = 9 throw_speed = 2 throw_range = 5 - materials = list(/datum/material/iron=10000, /datum/material/glass=6000) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=6000) attack_verb = list("attacked", "slashed", "sawed", "cut") sharpness = IS_SHARP @@ -183,7 +183,7 @@ throwforce = 9 throw_speed = 2 throw_range = 5 - materials = list(/datum/material/iron=10000, /datum/material/glass=6000) + custom_materials = list(/datum/material/iron=10000, /datum/material/glass=6000) toolspeed = 0.5 attack_verb = list("attacked", "slashed", "sawed", "cut") sharpness = IS_SHARP diff --git a/code/modules/vehicles/atv.dm b/code/modules/vehicles/atv.dm index 0d7781be03e..ada1a7ba3a9 100644 --- a/code/modules/vehicles/atv.dm +++ b/code/modules/vehicles/atv.dm @@ -6,7 +6,7 @@ max_integrity = 150 armor = list("melee" = 50, "bullet" = 25, "laser" = 20, "energy" = 0, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 60, "acid" = 60) key_type = /obj/item/key - integrity_failure = 70 + integrity_failure = 0.5 var/static/mutable_appearance/atvcover /obj/vehicle/ridden/atv/Initialize() @@ -80,7 +80,7 @@ return ..() /obj/vehicle/ridden/atv/process() - if(obj_integrity >= integrity_failure) + if(obj_integrity >= integrity_failure * max_integrity) return PROCESS_KILL if(prob(20)) return diff --git a/code/modules/vehicles/secway.dm b/code/modules/vehicles/secway.dm index 46305334d86..97ed066420d 100644 --- a/code/modules/vehicles/secway.dm +++ b/code/modules/vehicles/secway.dm @@ -6,7 +6,7 @@ max_integrity = 60 armor = list("melee" = 10, "bullet" = 0, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 60, "acid" = 60) key_type = /obj/item/key/security - integrity_failure = 30 + integrity_failure = 0.5 /obj/vehicle/ridden/secway/Initialize() . = ..() @@ -19,7 +19,7 @@ return ..() /obj/vehicle/ridden/secway/process() - if(obj_integrity >= integrity_failure) + if(obj_integrity >= integrity_failure * max_integrity) return PROCESS_KILL if(prob(20)) return @@ -51,4 +51,4 @@ for(var/mob/M in buckled_mobs) M.bullet_act(P) return TRUE - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index bb395416e59..28edb2f7ea4 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -51,7 +51,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C verb_ask = "beeps" verb_exclaim = "beeps" max_integrity = 300 - integrity_failure = 100 + integrity_failure = 0.33 armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70) circuit = /obj/item/circuitboard/machine/vendor payment_department = ACCOUNT_SRV diff --git a/icons/mob/inhands/equipment/toolbox_lefthand.dmi b/icons/mob/inhands/equipment/toolbox_lefthand.dmi index 4cee2d7d43a..f22572d36cd 100644 Binary files a/icons/mob/inhands/equipment/toolbox_lefthand.dmi and b/icons/mob/inhands/equipment/toolbox_lefthand.dmi differ diff --git a/icons/mob/inhands/equipment/toolbox_righthand.dmi b/icons/mob/inhands/equipment/toolbox_righthand.dmi index 8f1755669fc..9842e84283c 100644 Binary files a/icons/mob/inhands/equipment/toolbox_righthand.dmi and b/icons/mob/inhands/equipment/toolbox_righthand.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 224d56324db..9b1ec794ea3 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ