From e3609bac9418d303b3d3b93e24816e94b57d44ef Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 1 Aug 2015 21:03:33 -0400 Subject: [PATCH 1/7] Adds common proc to obtain the material of an object Adds a common get_material() proc to objects, and implements overrides where applicable --- code/game/machinery/deployable.dm | 3 +++ code/game/objects/items/weapons/material/material_weapons.dm | 3 +++ code/game/objects/structures/simple_doors.dm | 3 +++ code/game/objects/structures/stool_bed_chair_nest/bed.dm | 3 +++ code/game/turfs/simulated/walls.dm | 5 ++--- code/modules/materials/material_sheets.dm | 3 +++ code/modules/materials/materials.dm | 5 +++++ 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 4f19ab0118..d2ea405d3f 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -79,6 +79,9 @@ for reference: maxhealth = material.integrity health = maxhealth +/obj/structure/barricade/get_material() + return material + /obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob) if (istype(W, /obj/item/stack/material)) var/obj/item/stack/material/D = W diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm index c396f8d4b9..18181df6b0 100644 --- a/code/game/objects/items/weapons/material/material_weapons.dm +++ b/code/game/objects/items/weapons/material/material_weapons.dm @@ -34,6 +34,9 @@ if(!isnull(matter[material_type])) matter[material_type] *= force_divisor // May require a new var instead. +/obj/item/weapon/material/get_material() + return material + /obj/item/weapon/material/proc/update_force() if(edge || sharp) force = material.get_edge_damage() diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm index b3230095c1..10fa149e8b 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -44,6 +44,9 @@ update_nearby_tiles() ..() +/obj/structure/simple_door/get_material() + return material + /obj/structure/simple_door/Bumped(atom/user) ..() if(!state) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 1030afd019..3067b70d36 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -33,6 +33,9 @@ padding_material = get_material_by_name(new_padding_material) update_icon() +/obj/structure/bed/get_material() + return material + // Reuse the cache/code from stools, todo maybe unify. /obj/structure/bed/update_icon() // Prep icon. diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 662c245da6..cdcab2eb39 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -28,7 +28,7 @@ var/list/global/wall_cache = list() materialtype = DEFAULT_WALL_MATERIAL material = get_material_by_name(materialtype) if(!isnull(rmaterialtype)) - reinf_material = name_to_material[rmaterialtype] + reinf_material = get_material_by_name(rmaterialtype) update_material() processing_turfs |= src @@ -38,7 +38,6 @@ var/list/global/wall_cache = list() dismantle_wall(null,null,1) ..() - /turf/simulated/wall/process() // Calling parent will kill processing if(!radiate()) @@ -170,7 +169,7 @@ var/list/global/wall_cache = list() O.loc = src clear_plants() - material = name_to_material["placeholder"] + material = get_material_by_name("placeholder") reinf_material = null check_relatives() diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index fb4a0723f9..af818be50b 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -39,6 +39,9 @@ update_strings() return 1 +/obj/item/stack/material/get_material() + return material + /obj/item/stack/material/proc/update_strings() // Update from material datum. if(amount>1) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index f47a2a1394..b382564e34 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -27,6 +27,11 @@ // Assoc list containing all material datums indexed by name. var/list/name_to_material +//Returns the material the object is made of, if applicable. +//Will we ever need to return more than one value here? +/obj/proc/get_material() + return null + // Builds the datum list above. /proc/populate_material_list(force_remake=0) if(name_to_material && !force_remake) return // Already set up! From 0ceb0e291d1086464063fbdf7e1f329a20d32564 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 1 Aug 2015 23:13:29 -0400 Subject: [PATCH 2/7] Fixes #10314 Replaces every check for a hardcoded material stack type with a check for material of the stack. --- code/game/gamemodes/cult/cultify/obj.dm | 4 +- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/bioprinter.dm | 12 +++--- code/game/machinery/computer/ai_core.dm | 4 +- .../game/machinery/computer/buildandrepair.dm | 4 +- .../machinery/computer3/buildandrepair.dm | 11 ++--- code/game/machinery/deployable.dm | 9 ++-- code/game/machinery/doors/airlock.dm | 5 +++ code/game/machinery/doors/blast_door.dm | 18 ++------ code/game/machinery/doors/door.dm | 10 ++--- code/game/machinery/doors/firedoor.dm | 2 + code/game/machinery/pipe/pipelayer.dm | 4 +- code/game/machinery/portable_turret.dm | 8 ++-- code/game/machinery/robot_fabricator.dm | 4 +- .../objects/items/devices/lightreplacer.dm | 4 +- code/game/objects/items/robot/robot_parts.dm | 2 +- .../game/objects/items/stacks/sheets/light.dm | 4 +- .../objects/items/weapons/storage/bags.dm | 4 +- code/game/objects/structures/door_assembly.dm | 14 +++---- code/game/objects/structures/girders.dm | 6 +-- code/game/supplyshuttle.dm | 16 +++----- code/game/turfs/simulated/wall_icon.dm | 2 +- code/modules/clothing/spacesuits/breaches.dm | 26 +++++++----- .../clothing/spacesuits/rig/rig_attackby.dm | 2 +- code/modules/materials/material_sheets.dm | 2 + code/modules/materials/materials.dm | 14 ++++++- code/modules/mining/machine_processing.dm | 4 +- code/modules/mining/mint.dm | 38 ++++++++--------- code/modules/mob/living/bot/floorbot.dm | 19 +++++---- .../mob/living/silicon/robot/robot_items.dm | 2 +- code/modules/power/solar.dm | 2 +- .../projectiles/guns/launcher/crossbow.dm | 4 +- .../projectiles/guns/launcher/pneumatic.dm | 4 +- code/modules/research/circuitprinter.dm | 5 +-- code/modules/research/protolathe.dm | 41 ++++++++++--------- code/modules/research/rdconsole.dm | 33 ++++++++------- code/modules/tables/tables.dm | 2 +- 37 files changed, 179 insertions(+), 168 deletions(-) diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm index 405ea6b29c..517c6079fd 100644 --- a/code/game/gamemodes/cult/cultify/obj.dm +++ b/code/game/gamemodes/cult/cultify/obj.dm @@ -136,8 +136,8 @@ // Make it a wood-reinforced wooden table. // There are cult materials available, but it'd make the table non-deconstructable with how holotables work. // Could possibly use a new material var for holographic-ness? - material = name_to_material["wood"] - reinforced = name_to_material["wood"] + material = get_material_by_name("wood") + reinforced = get_material_by_name("wood") update_desc() update_connections(1) update_icon() diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 83112ea778..c613124ced 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -290,7 +290,7 @@ /obj/machinery/autolathe/dismantle() for(var/mat in stored_material) - var/material/M = name_to_material[mat] + var/material/M = get_material_by_name(mat) if(!istype(M)) continue var/obj/item/stack/material/S = new M.stack_type(get_turf(src)) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 9f144c23b1..23d00318ea 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -66,19 +66,19 @@ user << "You inject the blood sample into the bioprinter." return // Meat for biomass. - else if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat)) + if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat)) stored_matter += 50 user.drop_item() user << "\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]" qdel(W) return // Steel for matter. - else if(prints_prosthetics && istype(W, /obj/item/stack/material/steel)) - var/obj/item/stack/material/steel/M = W - stored_matter += M.amount * 10 + if(prints_prosthetics && istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL) + var/obj/item/stack/S = W + stored_matter += S.amount * 10 user.drop_item() user << "\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]" qdel(W) return - else - return..() \ No newline at end of file + + return..() \ No newline at end of file diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 43cb71acc6..91466c7988 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -88,8 +88,8 @@ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc ) A.amount = 5 - if(istype(P, /obj/item/stack/material/glass/reinforced)) - var/obj/item/stack/material/glass/reinforced/RG = P + if(istype(P, /obj/item/stack/material) && P.get_material_name() == "reinforced glass") + var/obj/item/stack/RG = P if (RG.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 7cae6c6d93..3a6deafa3d 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -87,8 +87,8 @@ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc ) A.amount = 5 - if(istype(P, /obj/item/stack/material/glass)) - var/obj/item/stack/material/glass/G = P + if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass") + var/obj/item/stack/G = P if (G.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return diff --git a/code/game/machinery/computer3/buildandrepair.dm b/code/game/machinery/computer3/buildandrepair.dm index 5e5c8af856..5ecd89e30e 100644 --- a/code/game/machinery/computer3/buildandrepair.dm +++ b/code/game/machinery/computer3/buildandrepair.dm @@ -178,13 +178,14 @@ if(istype(P, /obj/item/weapon/crowbar)) // complicated check remove_peripheral() - if(istype(P, /obj/item/stack/material/glass)) - if(P:amount >= 2) + if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass") + var/obj/item/stack/S = P + if(S.amount >= 2) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) - if(P) - P:use(2) - user << "\blue You put in the glass panel." + if(S) + S.use(2) + user << "You put in the glass panel." src.state = 4 src.icon_state = "4" if(4) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index d2ea405d3f..fcb66fef09 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -83,11 +83,10 @@ for reference: return material /obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/stack/material)) - var/obj/item/stack/material/D = W - if(D.material.name != material.name) - user << "That is the wrong material needed to repair \the [src]." - return + if (istype(W, /obj/item/stack)) + var/obj/item/stack/D = W + if(D.get_material_name() != material.name) + return //hitting things with the wrong type of stack usually doesn't produce messages, and probably doesn't need to. if (health < maxhealth) if (D.get_amount() < 1) user << "You need one sheet of [material.display_name] to repair \the [src]." diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 1313838cf5..d604cefff5 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -48,6 +48,11 @@ return ..() +/obj/machinery/door/airlock/get_material() + if(mineral) + return get_material_by_name(mineral) + return get_material_by_name(DEFAULT_WALL_MATERIAL) + /obj/machinery/door/airlock/command name = "Airlock" icon = 'icons/obj/doors/Doorcom.dmi' diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 2c5c00caaa..00101893e9 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -96,12 +96,12 @@ else usr << "[src]'s motors resist your effort." return - if(istype(C, /obj/item/stack/material/plasteel)) - var/amt = repair_price() + if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel") + var/amt = Ceiling((maxhealth - health)/150) if(!amt) usr << "\The [src] is already fully repaired." return - var/obj/item/stack/material/plasteel/P = C + var/obj/item/stack/P = C if(P.amount < amt) usr << "You don't have enough sheets to repair this! You need at least [amt] sheets." return @@ -135,16 +135,6 @@ return force_close() -// Proc: repair_price() -// Parameters: None -// Description: Determines amount of sheets needed for full repair. (max)150HP per sheet, (max)10 emitter hits per sheet. -/obj/machinery/door/blast/proc/repair_price() - var/sheets_needed = 0 - var/dam = maxhealth - health - while(dam > 0) - dam -= 150 - sheets_needed++ - return sheets_needed // Proc: repair() // Parameters: None @@ -154,7 +144,7 @@ if(stat & BROKEN) stat &= ~BROKEN - + /obj/machinery/door/blast/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) return 1 return ..() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 03971f4fbb..47147bfac0 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -206,7 +206,7 @@ if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. src.add_fingerprint(user) - if(istype(I, /obj/item/stack/material/steel)) + if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name()) if(stat & BROKEN) user << "It looks like \the [src] is pretty busted. It's going to need more than just patching up now." return @@ -221,20 +221,20 @@ var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc? - var/obj/item/stack/material/steel/metalstack = I + var/obj/item/stack/stack = I var/transfer if (repairing) - transfer = metalstack.transfer_to(repairing, amount_needed - repairing.amount) + transfer = stack.transfer_to(repairing, amount_needed - repairing.amount) if (!transfer) user << "You must weld or remove \the [repairing] from \the [src] before you can add anything else." else - repairing = metalstack.split(amount_needed) + repairing = stack.split(amount_needed) if (repairing) repairing.loc = src transfer = repairing.amount if (transfer) - user << "You fit [transfer] [metalstack.singular_name]\s to damaged and broken parts on \the [src]." + user << "You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src]." return diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 0c0d23b52a..a3131c649b 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -75,6 +75,8 @@ A.all_doors.Remove(src) . = ..() +/obj/machinery/door/firedoor/get_material() + return get_material_by_name(DEFAULT_WALL_MATERIAL) /obj/machinery/door/firedoor/examine(mob/user) . = ..(user, 1) diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm index 0f2dc3c855..ca164d7d0c 100644 --- a/code/game/machinery/pipe/pipelayer.dm +++ b/code/game/machinery/pipe/pipelayer.dm @@ -50,7 +50,7 @@ user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.") return - if(istype(W, /obj/item/stack/material/steel)) + if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL) var/result = load_metal(W) if(isnull(result)) @@ -86,7 +86,7 @@ on=0 return -/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/material/steel/MM) +/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/MM) if(istype(MM) && MM.get_amount()) var/cur_amount = metal var/to_load = max(max_metal - round(cur_amount),0) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 7f7a02b5f0..ad678f93d5 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -704,8 +704,8 @@ var/list/turret_icons return if(1) - if(istype(I, /obj/item/stack/material/steel)) - var/obj/item/stack/material/steel/M = I + if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL) + var/obj/item/stack/M = I if(M.use(2)) user << "You add some metal armor to the interior frame." build_step = 2 @@ -796,8 +796,8 @@ var/list/turret_icons //attack_hand() removes the prox sensor if(6) - if(istype(I, /obj/item/stack/material/steel)) - var/obj/item/stack/material/steel/M = I + if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL) + var/obj/item/stack/M = I if(M.use(2)) user << "You add some metal armor to the exterior frame." build_step = 7 diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index b2461f1d7f..4c44bcd4ee 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -12,8 +12,8 @@ active_power_usage = 10000 /obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob) - if (istype(O, /obj/item/stack/material/steel)) - var/obj/item/stack/material/steel/M = O + if (istype(O, /obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL) + var/obj/item/stack/M = O if (src.metal_amount < 150000.0) var/count = 0 src.overlays += "fab-load-metal" diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index cd930cc577..d59b7ceaa0 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -71,8 +71,8 @@ Emag() return - if(istype(W, /obj/item/stack/material/glass)) - var/obj/item/stack/material/glass/G = W + if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass") + var/obj/item/stack/G = W if(uses >= max_uses) user << "[src.name] is full." return diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 563df642ef..da1d0b701d 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -125,7 +125,7 @@ /obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob) ..() - if(istype(W, /obj/item/stack/material/steel) && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head) + if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head) var/obj/item/stack/material/steel/M = W if (M.use(1)) var/obj/item/weapon/secbot_assembly/ed209_assembly/B = new /obj/item/weapon/secbot_assembly/ed209_assembly diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index b32cb54def..424eab6a03 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -22,8 +22,8 @@ user.drop_from_inventory(src) qdel(src) - if(istype(O,/obj/item/stack/material/steel)) - var/obj/item/stack/material/steel/M = O + if(istype(O,/obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL) + var/obj/item/stack/M = O if (M.use(1)) use(1) new/obj/item/stack/tile/light(get_turf(user)) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index d91ecb463c..0d3d92aa6f 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -119,10 +119,10 @@ //verbs += /obj/item/weapon/storage/bag/sheetsnatcher/quick_empty can_be_inserted(obj/item/W as obj, stop_messages = 0) - if(!istype(W,/obj/item/stack/material) || istype(W,/obj/item/stack/material/sandstone) || istype(W,/obj/item/stack/material/wood)) + if(!istype(W,/obj/item/stack/material)) if(!stop_messages) usr << "The snatcher does not accept [W]." - return 0 //I don't care, but the existing code rejects them for not being "sheets" *shrug* -Sayu + return 0 var/current = 0 for(var/obj/item/stack/material/S in contents) current += S.amount diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 3de1075f38..51eee4793d 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -236,20 +236,20 @@ electronics = null else if(istype(W, /obj/item/stack/material) && !glass) - var/obj/item/stack/material/S = W + var/obj/item/stack/S = W + var/material_name = S.get_material_name() if (S) if (S.get_amount() >= 1) - if(istype(S, /obj/item/stack/material/glass/reinforced)) + if(material_name == "reinforced glass") playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.") if(do_after(user, 40) && !glass) if (S.use(1)) user << "You installed reinforced glass windows into the airlock assembly." glass = 1 - else if(istype(S, /obj/item/stack/material) && S.default_type) - var/M = S.default_type + else if(material_name) // Ugly hack, will suffice for now. Need to fix it upstream as well, may rewrite mineral walls. ~Z - if(M in list("mhydrogen","osmium","tritium","platinum","iron")) + if(!(material_name in list("gold", "silver", "diamond", "uranium", "phoron", "sandstone"))) user << "You cannot make an airlock out of that material." return if(S.get_amount() >= 2) @@ -257,8 +257,8 @@ user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.") if(do_after(user, 40) && !glass) if (S.use(2)) - user << "You installed [M] plating into the airlock assembly." - glass = "[M]" + user << "You installed [material_display_name(material_name)] plating into the airlock assembly." + glass = material_name else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 ) playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 67bf484f39..98947a2dae 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -108,11 +108,11 @@ else if(istype(W, /obj/item/stack/material)) - var/obj/item/stack/material/S = W + var/obj/item/stack/S = W if(S.get_amount() < 2) return ..() - var/material/M = name_to_material[S.default_type] + var/material/M = S.get_material() if(!istype(M)) return ..() @@ -183,7 +183,7 @@ user << "There is not enough material here to reinforce the girder." return - var/material/M = name_to_material[S.default_type] + var/material/M = S.get_material() if(!istype(M) || M.integrity < 50) user << "You cannot reinforce \the [src] with that; it is too soft." return diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 253d96174d..044143269e 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -195,16 +195,12 @@ var/list/mechtoys = list( find_slip = 0 continue - // Sell phoron - if(istype(A, /obj/item/stack/material/phoron)) - var/obj/item/stack/material/phoron/P = A - phoron_count += P.get_amount() - - // Sell platinum - if(istype(A, /obj/item/stack/material/platinum)) - var/obj/item/stack/material/platinum/P = A - plat_count += P.get_amount() - + // Sell phoron and platinum + if(istype(A, /obj/item/stack)) + var/obj/item/stack/P + switch(P.get_material_name()) + if("phoron") phoron_count += P.get_amount() + if("platinum") plat_count += P.get_amount() qdel(MA) if(phoron_count) diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm index 364f58c29e..aa7db8a0cc 100644 --- a/code/game/turfs/simulated/wall_icon.dm +++ b/code/game/turfs/simulated/wall_icon.dm @@ -8,7 +8,7 @@ else construction_stage = null if(!material) - material = name_to_material[DEFAULT_WALL_MATERIAL] + material = get_material_by_name(DEFAULT_WALL_MATERIAL) if(material) explosion_resistance = material.explosion_resistance if(reinf_material && reinf_material.explosion_resistance > explosion_resistance) diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 6789a50dfc..7caa4e0bdf 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -178,23 +178,29 @@ var/global/list/breach_burn_descriptors = list( //Handles repairs (and also upgrades). /obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob) - if(istype(W,/obj/item/stack/material/plastic) || istype(W,/obj/item/stack/material/steel)) - + if(istype(W,/obj/item/stack/material)) + var/repair_power = 0 + switch(W.get_material_name()) + if(DEFAULT_WALL_MATERIAL) + repair_power = 2 + if("plastic") + repair_power = 1 + + if(!repair_power) + return + if(istype(src.loc,/mob/living)) - user << "\red How do you intend to patch a hardsuit while someone is wearing it?" + user << "How do you intend to patch a hardsuit while someone is wearing it?" return if(!damage || !burn_damage) user << "There is no surface damage on \the [src] to repair." return - var/obj/item/stack/material/P = W - if(P.get_amount() < 3) - P.use(P.get_amount()) - repair_breaches(BURN, ( istype(P,/obj/item/stack/material/plastic) ? P.get_amount() : (P.get_amount()*2) ), user) - else - P.use(3) - repair_breaches(BURN, ( istype(P,/obj/item/stack/material/plastic) ? 3 : 5), user) + var/obj/item/stack/P = W + var/use_amt = min(P.get_amount(), 3) + if(use_amt && P.use(use_amt)) + repair_breaches(BURN, use_amt * repair_power, user) return else if(istype(W, /obj/item/weapon/weldingtool)) diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 2bf00e66c0..14e5ecc1b9 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -7,7 +7,7 @@ return // Pass repair items on to the chestpiece. - if(chest && (istype(W,/obj/item/stack/material/plastic) || istype(W,/obj/item/stack/material/steel) || istype(W, /obj/item/weapon/weldingtool))) + if(chest && (istype(W,/obj/item/stack/material) || istype(W, /obj/item/weapon/weldingtool))) return chest.attackby(W,user) // Lock or unlock the access panel. diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index af818be50b..b931a73b97 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -44,6 +44,8 @@ /obj/item/stack/material/proc/update_strings() // Update from material datum. + singular_name = material.sheet_singular_name + if(amount>1) name = "[material.use_name] [material.sheet_plural_name]" desc = "A stack of [material.use_name] [material.sheet_plural_name]." diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index b382564e34..71b10c6443 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -28,10 +28,16 @@ var/list/name_to_material //Returns the material the object is made of, if applicable. -//Will we ever need to return more than one value here? +//Will we ever need to return more than one value here? Or should we just return the "dominant" material. /obj/proc/get_material() return null +//mostly for convenience +/obj/proc/get_material_name() + var/material/material = get_material() + if(material) + return material.name + // Builds the datum list above. /proc/populate_material_list(force_remake=0) if(name_to_material && !force_remake) return // Already set up! @@ -49,6 +55,12 @@ var/list/name_to_material populate_material_list() return name_to_material[name] +/proc/material_display_name(name) + var/material/material = get_material_by_name(name) + if(material) + return material.display_name + return null + // Material definition and procs follow. /material var/name // Unique name for use in indexing the list. diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 0eb8bdaa1f..b2d4f0f6a5 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -210,7 +210,7 @@ var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets) if(can_make%2>0) can_make-- - var/material/M = name_to_material[O.compresses_to] + var/material/M = get_material_by_name(O.compresses_to) if(!istype(M) || !can_make || ores_stored[metal] < 1) continue @@ -224,7 +224,7 @@ var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets) - var/material/M = name_to_material[O.smelts_to] + var/material/M = get_material_by_name(O.smelts_to) if(!istype(M) || !can_make || ores_stored[metal] < 1) continue diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 96f6fb480c..99dc1956b1 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -37,26 +37,26 @@ /obj/machinery/mineral/mint/process() if ( src.input) - var/obj/item/stack/material/O - O = locate(/obj/item/stack/material, input.loc) + var/obj/item/stack/O + O = locate(/obj/item/stack, input.loc) if(O) - if (istype(O,/obj/item/stack/material/gold)) - amt_gold += 100 * O.get_amount() - qdel(O) - if (istype(O,/obj/item/stack/material/silver)) - amt_silver += 100 * O.get_amount() - qdel(O) - if (istype(O,/obj/item/stack/material/diamond)) - amt_diamond += 100 * O.get_amount() - qdel(O) - if (istype(O,/obj/item/stack/material/phoron)) - amt_phoron += 100 * O.get_amount() - qdel(O) - if (istype(O,/obj/item/stack/material/uranium)) - amt_uranium += 100 * O.get_amount() - qdel(O) - if (istype(O,/obj/item/stack/material/steel)) - amt_iron += 100 * O.get_amount() + var/processed = 1 + switch(O.get_material_name()) + if("gold") + amt_gold += 100 * O.get_amount() + if("silver") + amt_silver += 100 * O.get_amount() + if("diamond") + amt_diamond += 100 * O.get_amount() + if("phoron") + amt_phoron += 100 * O.get_amount() + if("uranium") + amt_uranium += 100 * O.get_amount() + if(DEFAULT_WALL_MATERIAL) + amt_iron += 100 * O.get_amount() + else + processed = 0 + if(processed) qdel(O) /obj/machinery/mineral/mint/attack_hand(user as mob) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 80d6d69df8..5b64540f70 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -249,15 +249,16 @@ target = null repairing = 0 update_icons() - else if(istype(A, /obj/item/stack/material/steel) && amount + 3 < maxAmount) - var/obj/item/stack/material/steel/M = A - visible_message("[src] begins to make tiles.") - repairing = 1 - update_icons() - if(do_after(50)) - if(M) - M.use(1) - addTiles(4) + else if(istype(A, /obj/item/stack/material) && amount + 4 <= maxAmount) + var/obj/item/stack/material/M = A + if(M.get_material_name() == DEFAULT_WALL_MATERIAL) + visible_message("[src] begins to make tiles.") + repairing = 1 + update_icons() + if(do_after(50)) + if(M) + M.use(1) + addTiles(4) /mob/living/bot/floorbot/explode() turn_off() diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 59e251e01b..3e072d3d74 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -37,7 +37,7 @@ for(var/obj/I in contents) for(var/mob/M in I.contents) M.death() - if(istype(I,/obj/item/stack/material))//Only deconsturcts one sheet at a time instead of the entire stack + if(istype(I,/obj/item/stack/material))//Only deconstructs one sheet at a time instead of the entire stack var/obj/item/stack/material/S = I if(S.get_amount() > 1) S.use(1) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index eb8bb66b72..6f8b6fcbe5 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -251,7 +251,7 @@ var/list/solars_list = list() playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) return 1 - if(istype(W, /obj/item/stack/material/glass)) + if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass" || W.get_material_name() == "reinforced glass") var/obj/item/stack/material/S = W if(S.use(2)) glass_type = W.type diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index b199d4ad8b..e11844293e 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -254,9 +254,9 @@ else user << "You need at least five segments of cable coil to complete this task." return - else if(istype(W,/obj/item/stack/material/plastic)) + else if(istype(W,/obj/item/stack/material) && W.get_material_name() == "plastic") if(buildstate == 3) - var/obj/item/stack/material/plastic/P = W + var/obj/item/stack/material/P = W if(P.use(3)) user << "You assemble and install a heavy plastic lath onto the crossbow." buildstate++ diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index e7c3870ed0..b20e9521e6 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -167,9 +167,9 @@ buildstate++ update_icon() return - else if(istype(W,/obj/item/stack/material/steel)) + else if(istype(W,/obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL) if(buildstate == 2) - var/obj/item/stack/material/steel/M = W + var/obj/item/stack/material/M = W if(M.use(5)) user << "You assemble a chassis around the cannon frame." buildstate++ diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index f5191fb37f..1eaf9ba97e 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -104,16 +104,13 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). return 1 if(O.is_open_container()) return 0 -// if(!istype(O, /obj/item/stack/material/glass) && !istype(O, /obj/item/stack/material/gold) && !istype(O, /obj/item/stack/material/diamond) && !istype(O, /obj/item/stack/material/uranium)) -// user << "You cannot insert this item into \the [src]!" -// return 1 if(stat) return 1 if(busy) user << "\The [src] is busy. Please wait for completion of previous operation." return 1 - if(istype(O, /obj/item/stack/material/glass) || istype(O, /obj/item/stack/material/gold) || istype(O, /obj/item/stack/material/diamond) || istype(O, /obj/item/stack/material/uranium)) + if(istype(O, /obj/item/stack/material) && O.get_material_name() in list("glass", "gold", "diamond", "uranium")) var/obj/item/stack/material/stack = O if((TotalMaterials() + stack.perunit) > max_material_amount) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index c35d820372..aab30f32c7 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -144,28 +144,29 @@ Note: Must be placed west/left of and R&D console to function. icon_state = "protolathe" busy = 1 use_power(max(1000, (3750 * amount / 10))) - var/stacktype = stack.type - stack.use(amount) - if(do_after(user, 16)) + var/material/material = stack.get_material() + if(istype(material) && stack.use(amount) && do_after(user, 16)) user << "You add [amount] sheets to \the [src]." icon_state = "protolathe" - switch(stacktype) - if(/obj/item/stack/material/steel) - m_amount += amount * 3750 - if(/obj/item/stack/material/glass) - g_amount += amount * 3750 - if(/obj/item/stack/material/gold) - gold_amount += amount * 2000 - if(/obj/item/stack/material/silver) - silver_amount += amount * 2000 - if(/obj/item/stack/material/phoron) - phoron_amount += amount * 2000 - if(/obj/item/stack/material/uranium) - uranium_amount += amount * 2000 - if(/obj/item/stack/material/diamond) - diamond_amount += amount * 2000 - else - new stacktype(loc, amount) + + var/amount_to_add = amount * material.stack_per_sheet + switch(material.name) + if(DEFAULT_WALL_MATERIAL) + m_amount += amount_to_add + if("glass") + g_amount += amount_to_add + if("gold") + gold_amount += amount_to_add + if("silver") + silver_amount += amount_to_add + if("phoron") + phoron_amount += amount_to_add + if("uranium") + uranium_amount += amount_to_add + if("diamond") + diamond_amount += amount_to_add + else if(ispath(material.stack_type)) + new material.stack_type(loc, amount) //failed, so spit the material back out busy = 0 updateUsrDialog() return diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 4f0178ed3d..37814e5855 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -439,25 +439,24 @@ won't update every console in existence) but it's more of a hassle to do. Also, else if(href_list["lathe_ejectsheet"] && linked_lathe) //Causes the protolathe to eject a sheet of material var/desired_num_sheets = text2num(href_list["amount"]) var/res_amount, type - var/material/M = name_to_material[href_list["lathe_ejectsheet"]] + var/material/M = get_material_by_name(href_list["lathe_ejectsheet"]) if(istype(M)) type = M.stack_type - - switch(name_to_material[href_list["lathe_ejectsheet"]]) - if(DEFAULT_WALL_MATERIAL) - res_amount = "m_amount" - if("glass") - res_amount = "g_amount" - if("gold") - res_amount = "gold_amount" - if("silver") - res_amount = "silver_amount" - if("phoron") - res_amount = "phoron_amount" - if("uranium") - res_amount = "uranium_amount" - if("diamond") - res_amount = "diamond_amount" + switch(M.name) + if(DEFAULT_WALL_MATERIAL) + res_amount = "m_amount" + if("glass") + res_amount = "g_amount" + if("gold") + res_amount = "gold_amount" + if("silver") + res_amount = "silver_amount" + if("phoron") + res_amount = "phoron_amount" + if("uranium") + res_amount = "uranium_amount" + if("diamond") + res_amount = "diamond_amount" if(ispath(type) && hasvar(linked_lathe, res_amount)) var/obj/item/stack/material/sheet = new type(linked_lathe.loc) diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 11fc798d33..a496e32c81 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -200,7 +200,7 @@ // Returns the material to set the table to. /obj/structure/table/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'. - var/material/M = name_to_material[S.default_type] + var/material/M = S.get_material() if(!istype(M)) user << "You cannot [verb]e \the [src] with \the [S]." return null From 2f20f0c537d842d9cfb8020585058935ab30cb6a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 2 Aug 2015 00:02:33 -0400 Subject: [PATCH 3/7] Fixes #10249 Moves the isrobot() check so that it only applies to robots interacting with doors to open them. --- code/game/machinery/doors/door.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 47147bfac0..2f60caad31 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -203,7 +203,6 @@ /obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/device/detective_scanner)) return - if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. src.add_fingerprint(user) if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name()) @@ -274,6 +273,8 @@ take_damage(W.force) return + if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. + if(src.operating) return if(src.density && (operable() && istype(I, /obj/item/weapon/card/emag))) From 8f4394266b72978898ece0a1a3723431de5caf03 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 2 Aug 2015 00:25:20 -0400 Subject: [PATCH 4/7] Fixes not being able to insert a complete stack into the protolathe The call order meant that if you tried to insert a complete stack, use() would qdel the stack causing do_after() to fail. --- code/modules/research/protolathe.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index aab30f32c7..409a0f7424 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -145,7 +145,7 @@ Note: Must be placed west/left of and R&D console to function. busy = 1 use_power(max(1000, (3750 * amount / 10))) var/material/material = stack.get_material() - if(istype(material) && stack.use(amount) && do_after(user, 16)) + if(istype(material) && do_after(user, 16) && stack.use(amount)) user << "You add [amount] sheets to \the [src]." icon_state = "protolathe" @@ -165,8 +165,6 @@ Note: Must be placed west/left of and R&D console to function. uranium_amount += amount_to_add if("diamond") diamond_amount += amount_to_add - else if(ispath(material.stack_type)) - new material.stack_type(loc, amount) //failed, so spit the material back out busy = 0 updateUsrDialog() return From d1bd146b1a71d6b9f4fad1bcb2f228e269df396b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 3 Aug 2015 23:01:34 -0400 Subject: [PATCH 5/7] Changes reinforced glass material name Gives the reinforced glass material a name that is easier to verify for correctness. --- code/game/machinery/computer/ai_core.dm | 2 +- code/game/objects/structures/door_assembly.dm | 2 +- code/modules/materials/material_sheets.dm | 2 +- code/modules/materials/material_synth.dm | 2 +- code/modules/materials/materials.dm | 3 ++- code/modules/power/solar.dm | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 91466c7988..4dbdabd7fc 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -88,7 +88,7 @@ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc ) A.amount = 5 - if(istype(P, /obj/item/stack/material) && P.get_material_name() == "reinforced glass") + if(istype(P, /obj/item/stack/material) && P.get_material_name() == "rglass") var/obj/item/stack/RG = P if (RG.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 51eee4793d..4e3a6298f7 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -240,7 +240,7 @@ var/material_name = S.get_material_name() if (S) if (S.get_amount() >= 1) - if(material_name == "reinforced glass") + if(material_name == "rglass") playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.") if(do_after(user, 40) && !glass) diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index b931a73b97..75ab6ff891 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -192,7 +192,7 @@ /obj/item/stack/material/glass/reinforced name = "reinforced glass" icon_state = "sheet-rglass" - default_type = "reinforced glass" + default_type = "rglass" /obj/item/stack/material/glass/phoronglass name = "phoron glass" diff --git a/code/modules/materials/material_synth.dm b/code/modules/materials/material_synth.dm index 23b0e7e546..86e3e16a2d 100644 --- a/code/modules/materials/material_synth.dm +++ b/code/modules/materials/material_synth.dm @@ -34,5 +34,5 @@ /obj/item/stack/material/cyborg/glass/reinforced icon_state = "sheet-rglass" - default_type = "reinforced glass" + default_type = "rglass" charge_costs = list(500, 1000) \ No newline at end of file diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 71b10c6443..bbf875cf4d 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -439,7 +439,8 @@ var/list/name_to_material return (hardness > 35) //todo /material/glass/reinforced - name = "reinforced glass" + name = "rglass" + display_name = "reinforced glass" stack_type = /obj/item/stack/material/glass/reinforced flags = MATERIAL_BRITTLE icon_colour = "#00E1FF" diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 6f8b6fcbe5..a355e16957 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -251,7 +251,7 @@ var/list/solars_list = list() playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) return 1 - if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass" || W.get_material_name() == "reinforced glass") + if(istype(W, /obj/item/stack/material) && (W.get_material_name() == "glass" || W.get_material_name() == "rglass")) var/obj/item/stack/material/S = W if(S.use(2)) glass_type = W.type From c146f1e324cc0ff090bdb5ff64d82ee8a585f098 Mon Sep 17 00:00:00 2001 From: Kearel Date: Fri, 7 Aug 2015 14:41:54 -0500 Subject: [PATCH 6/7] zenghu icon fixes --- icons/mob/human_races/cyberlimbs/zenghu.dmi | Bin 853 -> 849 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/icons/mob/human_races/cyberlimbs/zenghu.dmi b/icons/mob/human_races/cyberlimbs/zenghu.dmi index ca0cff0efa80a6c992b8b91f40f3c3c9aa8f40d0..a94eacc48a512f131f9f999ad93d7b764135fb2f 100644 GIT binary patch delta 601 zcmV-f0;c`d2GItv1Ob0INklH6I!azrGiU) zs47tr(zAYJv3z1|MSUF~VD+ruk;w$c_CnP}RD|@jpS~5hJD-1A#Y4gkIr-J=8Byyg z6O(0K8&M+bSwDRt7ASkyRF!ZAjh^*WPh!E|qdk6kjt^+`tlz<_T=5=nD(XZ100000 z0D#0O#Vz(>XJIxwfO+ttQCDWO1N5f1$c+Sn{9uz~ZOb8r^M{ zUVTW*t50XZ!aIMp+i}3Rk(STCoB>O}qT7J1kmnlt7ytkO004l#Sidjl0iy065*xoC z$OHc3cqwUGY5aa558Qj7>h1#?zaPj0{$kmEfc5xt9tf#3FRnGD+{k3~j4h4iS6k~2 zSg^0u@xTKNT`C71Ap9uuLGOX^++o-&`1@M~00000@SlHhjg*uJ+Q}>5o2jZI&dl@s zEDuEMbxo|~n7U2R@3TA*t&a~V{Q=}`v|iC2$*G<7%q%mz(R%h@!<>f5((SH(lreEVp0{{R30001BD~LY-7cx_)h*d~$Fx(|gU;LFk zBsvSUpPo?*1Lj_4s^^}9SGan1Ru=^uP!vUrf>*eDsUH9U00000+X8(h!d|iTh5CKw n|9cPc;((YK`r*fc0UiDi?}SK|zN%-500000NkvXXu0mjfan>I& delta 605 zcmV-j0;2uV2Gs_z1Ob0MNkly&spTrJHBoObbvXeJ6inA-tTRTYr03ed>=wMtCo@x)Zgkyhc zN>$OO7xi*AeeQflbsBEq^`hR6OB8bdpk}Tr+Vs4hy-=4sU3h=RZNv-N`_|iYrnUmZZ-qw?z@e(eo>f7o800000 z0F7D9v^a#dm7BJKn8C-!oVaNl*r}JOX$e~VgLh(4CXuoE?9(rurr1C8*9A2-wqGy% z{;GxF-x>{8ESkL<{ zet-t^8%@(mJ@2>pfh+Q<>ffNA_gnk`4Ho?y_!(dK18wSr*tMFN7a5H`7onNHwe`~m zEAf@u9l3$yp<>hq%8w!)^&KexJB<4Te}9Pp00000{u6(*=4_Sr%}z@?o0+oYlNmW` z$B*g-^KHdO$(&D{hMa`Uuj$=jez*ZWYR5fhFyHVMN%=TS=UYD72J^*P!<3syst_)@ z;2oJ`5N8cVh3+L1c7QtuG2n~wzI%z3HJf-d7XSbN0000m5yAieg`nF|h`X7#gV79G zzVTP^45C%%_3Tnu>-1O7zVWiBTo2VQ2$8{jBy5600000NkvXXu0mjft#%%k From fc7e89380e04d6fbc4df5e2882b2546414a4a8da Mon Sep 17 00:00:00 2001 From: HarpyEagle Date: Wed, 5 Aug 2015 16:06:48 -0400 Subject: [PATCH 7/7] More material renames Gives several materials shorter and easier to type names, updating the display_name where applicable. Also fixed a slightly mismatched variable type. --- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/weapons/material/shards.dm | 2 +- code/modules/materials/material_sheets.dm | 4 ++-- code/modules/materials/materials.dm | 12 +++++++----- code/modules/tables/presets.dm | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index da1d0b701d..2ee5e723ea 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -126,7 +126,7 @@ /obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob) ..() if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head) - var/obj/item/stack/material/steel/M = W + var/obj/item/stack/material/M = W if (M.use(1)) var/obj/item/weapon/secbot_assembly/ed209_assembly/B = new /obj/item/weapon/secbot_assembly/ed209_assembly B.loc = get_turf(src) diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index fa39ce719e..2f395f2ed0 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -87,4 +87,4 @@ ..(loc, "steel") /obj/item/weapon/material/shard/phoron/New(loc) - ..(loc, "phoron glass") + ..(loc, "phglass") diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 75ab6ff891..c2a2b56ab7 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -198,9 +198,9 @@ name = "phoron glass" singular_name = "phoron glass sheet" icon_state = "sheet-phoronglass" - default_type = "phoron glass" + default_type = "phglass" /obj/item/stack/material/glass/phoronrglass name = "reinforced phoron glass" icon_state = "sheet-phoronrglass" - default_type = "reinforced phoron glass" + default_type = "rphglass" diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index bbf875cf4d..dd839dbbb2 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -329,7 +329,7 @@ var/list/name_to_material icon_colour = "#666666" /material/steel/holographic - name = "holographic " + DEFAULT_WALL_MATERIAL + name = "holo" + DEFAULT_WALL_MATERIAL display_name = DEFAULT_WALL_MATERIAL stack_type = null shard_type = SHARD_NONE @@ -458,7 +458,8 @@ var/list/name_to_material rod_product = null /material/glass/phoron - name = "phoron glass" + name = "phglass" + display_name = "phoron glass" stack_type = /obj/item/stack/material/glass/phoronglass flags = MATERIAL_BRITTLE ignition_point = PHORON_MINIMUM_BURN_TEMPERATURE+300 @@ -470,7 +471,8 @@ var/list/name_to_material rod_product = /obj/item/stack/material/glass/phoronrglass /material/glass/phoron/reinforced - name = "reinforced phoron glass" + name = "rphglass" + display_name = "reinforced phoron glass" stack_type = /obj/item/stack/material/glass/phoronrglass stack_origin_tech = "materials=4;phorontech=2" composite_material = list() //todo @@ -491,7 +493,7 @@ var/list/name_to_material stack_origin_tech = "materials=3" /material/plastic/holographic - name = "holographic plastic" + name = "holoplastic" display_name = "plastic" stack_type = null shard_type = SHARD_NONE @@ -569,7 +571,7 @@ var/list/name_to_material sheet_plural_name = "planks" /material/wood/holographic - name = "holographic wood" + name = "holowood" display_name = "wood" stack_type = null shard_type = SHARD_NONE diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm index 60d45f1ede..933f54ea8b 100644 --- a/code/modules/tables/presets.dm +++ b/code/modules/tables/presets.dm @@ -63,11 +63,11 @@ icon_state = "holo_preview" color = "#EEEEEE" New() - material = get_material_by_name("holographic [DEFAULT_TABLE_MATERIAL]") + material = get_material_by_name("holo[DEFAULT_TABLE_MATERIAL]") ..() woodentable/holotable icon_state = "holo_preview" New() - material = get_material_by_name("holographic wood") + material = get_material_by_name("holowood") ..()