From 4f33dda9abfe67582b83fed07617a2b4e5635d6e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:52:00 +0200 Subject: [PATCH] [MIRROR] Replace girder to_chat messages with balloon alerts [MDB IGNORE] (#12579) * Replace girder to_chat messages with balloon alerts (#65873) * Replace girder to_chat messages with balloon alerts Co-authored-by: Tim --- code/game/objects/structures/girders.dm | 243 ++++++++++++------------ 1 file changed, 126 insertions(+), 117 deletions(-) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 13654810031..5672de5b5dc 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -4,12 +4,21 @@ desc = "A large structural assembly made out of metal; It requires a layer of iron before it can be considered a wall." anchored = TRUE density = TRUE + max_integrity = 200 + rad_insulation = RAD_VERY_LIGHT_INSULATION var/state = GIRDER_NORMAL var/girderpasschance = 20 // percentage chance that a projectile passes through the girder. var/can_displace = TRUE //If the girder can be moved around by wrenching it var/next_beep = 0 //Prevents spamming of the construction sound - max_integrity = 200 - rad_insulation = RAD_VERY_LIGHT_INSULATION + /// The material cost to construct something on the girder + var/static/list/construction_cost = list( + /obj/item/stack/sheet/iron = 2, + /obj/item/stack/rods = 5, + /obj/item/stack/sheet/plasteel = 2, + /obj/item/stack/sheet/bronze = 2, + /obj/item/stack/sheet/runed_metal = 1, + exotic_material = 2 // this needs to be refactored properly + ) /obj/structure/girder/examine(mob/user) . = ..() @@ -38,9 +47,9 @@ add_fingerprint(user) if(istype(W, /obj/item/gun/energy/plasmacutter)) - to_chat(user, span_notice("You start slicing apart the girder...")) + user.balloon_alert("slicing apart...") if(W.use_tool(src, user, 40, volume=100)) - to_chat(user, span_notice("You slice apart the girder.")) + user.balloon_alert("sliced apart") var/obj/item/stack/sheet/iron/M = new (loc, 2) if (!QDELETED(M)) M.add_fingerprint(user) @@ -48,46 +57,44 @@ return else if(istype(W, /obj/item/stack)) - if(iswallturf(loc)) - to_chat(user, span_warning("There is already a wall present!")) + if(iswallturf(loc) || (locate(/obj/structure/falsewall) in src.loc.contents)) + user.balloon_alert("wall already present!") return if(!isfloorturf(src.loc) && state != GIRDER_TRAM) - to_chat(user, span_warning("A floor must be present to build a wall!")) + user.balloon_alert("need floor!") return if(state == GIRDER_TRAM) if(!locate(/obj/structure/industrial_lift/tram) in src.loc.contents) - to_chat(user, span_warning("Tram walls can only be built on tram floors!")) + user.balloon_alert("need tram floors!") return - if (locate(/obj/structure/falsewall) in src.loc.contents) - to_chat(user, span_warning("There is already a false wall present!")) - return if(istype(W, /obj/item/stack/rods)) var/obj/item/stack/rods/rod = W + var/amount = construction_cost[rod.type] if(state == GIRDER_DISPLACED) - if(rod.get_amount() < 5) - to_chat(user, span_warning("You need at least five rods to create a false wall!")) + if(rod.get_amount() < amount) + user.balloon_alert("need [amount] rods!") return - to_chat(user, span_notice("You start building a false wall...")) + user.balloon_alert("concealing entrance...") if(do_after(user, 20, target = src)) - if(rod.get_amount() < 5) + if(rod.get_amount() < amount) return - rod.use(5) - to_chat(user, span_notice("You create a false wall. Push on it to open or close the passage.")) + rod.use(amount) + user.balloon_alert("entrance concealed") var/obj/structure/falsewall/iron/FW = new (loc) transfer_fingerprints_to(FW) qdel(src) return else - if(rod.get_amount() < 5) - to_chat(user, span_warning("You need at least five rods to add plating!")) + if(rod.get_amount() < amount) + user.balloon_alert("need [amount] rods!") return - to_chat(user, span_notice("You start adding plating...")) + user.balloon_alert("adding plating...") if(do_after(user, 40, target = src)) - if(rod.get_amount() < 5) + if(rod.get_amount() < amount) return - rod.use(5) - to_chat(user, span_notice("You add the plating.")) + rod.use(amount) + user.balloon_alert("plating added") var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall/mineral/iron) transfer_fingerprints_to(T) @@ -99,47 +106,48 @@ var/obj/item/stack/sheet/sheets = W if(istype(sheets, /obj/item/stack/sheet/iron)) + var/amount = construction_cost[/obj/item/stack/sheet/iron] if(state == GIRDER_DISPLACED) - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need two sheets of iron to create a false wall!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start building a false wall...")) + user.balloon_alert("concealing entrance...") if(do_after(user, 20*platingmodifier, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You create a false wall. Push on it to open or close the passage.")) + sheets.use(amount) + user.balloon_alert("entrance concealed") var/obj/structure/falsewall/F = new (loc) transfer_fingerprints_to(F) qdel(src) return else if(state == GIRDER_REINF) - to_chat(user, span_warning("You can't finish a reinforced girder with regular iron. You need a plasteel sheet for that.")) + user.balloon_alert("need plasteel sheet!") return else if(state == GIRDER_TRAM) - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need at least two sheets to add plating!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start adding plating...")) + user.balloon_alert("adding plating...") if (do_after(user, 4 SECONDS, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return sheets.use(2) - to_chat(user, span_notice("You add the plating.")) + user.balloon_alert("plating added") var/obj/structure/tramwall/tram_wall = new sheets.tram_wall_type(loc) transfer_fingerprints_to(tram_wall) qdel(src) return else - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need two sheets of iron to finish a wall!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start adding plating...")) + user.balloon_alert("adding plating...") if (do_after(user, 40*platingmodifier, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You add the plating.")) + sheets.use(amount) + user.balloon_alert("plating added") var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall) transfer_fingerprints_to(T) @@ -147,43 +155,46 @@ return if(istype(sheets, /obj/item/stack/sheet/plasteel)) + var/amount = construction_cost[/obj/item/stack/sheet/plasteel] if(state == GIRDER_DISPLACED) - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need at least two sheets to create a false wall!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start building a reinforced false wall...")) + user.balloon_alert("concealing entrance...") if(do_after(user, 20, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You create a reinforced false wall. Push on it to open or close the passage.")) + sheets.use(amount) + user.balloon_alert("entrance concealed") var/obj/structure/falsewall/reinforced/FW = new (loc) transfer_fingerprints_to(FW) qdel(src) return else if(state == GIRDER_REINF) - if(sheets.get_amount() < 1) + amount = 1 // hur dur let's make plasteel have different construction amounts 4norasin + if(sheets.get_amount() < amount) return - to_chat(user, span_notice("You start finalizing the reinforced wall...")) + user.balloon_alert("adding plating...") if(do_after(user, 50*platingmodifier, target = src)) - if(sheets.get_amount() < 1) + if(sheets.get_amount() < amount) return - sheets.use(1) - to_chat(user, span_notice("You fully reinforce the wall.")) + sheets.use(amount) + user.balloon_alert("plating added") var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall/r_wall) transfer_fingerprints_to(T) qdel(src) return else - if(sheets.get_amount() < 1) + amount = 1 // hur dur x2 + if(sheets.get_amount() < amount) return - to_chat(user, span_notice("You start reinforcing the girder...")) + user.balloon_alert("reinforcing frame...") if(do_after(user, 60*platingmodifier, target = src)) - if(sheets.get_amount() < 1) + if(sheets.get_amount() < amount) return - sheets.use(1) - to_chat(user, span_notice("You reinforce the girder.")) + sheets.use(amount) + user.balloon_alert("frame reinforced") var/obj/structure/girder/reinforced/R = new (loc) transfer_fingerprints_to(R) qdel(src) @@ -191,22 +202,23 @@ if(!sheets.has_unique_girder && sheets.material_type) if(istype(src, /obj/structure/girder/reinforced)) - to_chat(user, span_warning("You need plasteel to make a reinforced wall!")) + user.balloon_alert("need plasteel!") return var/M = sheets.sheettype + var/amount = construction_cost["exotic_material"] if(state == GIRDER_TRAM) if(!sheets.tram_wall_type) - to_chat(user, span_warning("This tram girder only works with Titanium, Plastitanium, or Iron!")) + user.balloon_alert("need titanium, plastitanium, or iron!") return - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need at least two sheets to add plating!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start adding plating...")) + user.balloon_alert("adding plating...") if (do_after(user, 4 SECONDS, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You add the plating.")) + sheets.use(amount) + user.balloon_alert("plating added") var/obj/structure/tramwall/tram_wall = new sheets.tram_wall_type(loc) transfer_fingerprints_to(tram_wall) qdel(src) @@ -214,30 +226,31 @@ if(state == GIRDER_DISPLACED) var/falsewall_type = text2path("/obj/structure/falsewall/[M]") if(!falsewall_type) - to_chat(user, span_warning("You can't seem to figure out how to make a false wall with [sheets]!")) + user.balloon_alert("need comptatiable sheets!") return - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need at least two sheets to create a false wall!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return + user.balloon_alert("concealing entrance...") if(do_after(user, 20, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You create a false wall. Push on it to open or close the passage.")) + sheets.use(amount) + user.balloon_alert("entrance concealed") var/obj/structure/falsewall/FW = new falsewall_type (loc) transfer_fingerprints_to(FW) qdel(src) return else - if(sheets.get_amount() < 2) - to_chat(user, span_warning("You need at least two sheets to add plating!")) + if(sheets.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - to_chat(user, span_notice("You start adding plating...")) + user.balloon_alert("adding plating...") if (do_after(user, 40, target = src)) - if(sheets.get_amount() < 2) + if(sheets.get_amount() < amount) return - sheets.use(2) - to_chat(user, span_notice("You add the plating.")) + sheets.use(amount) + user.balloon_alert("plating added") var/turf/T = get_turf(src) if(sheets.walltype) T.PlaceOnTop(sheets.walltype) @@ -259,7 +272,7 @@ if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds. if(!user.transferItemToLoc(P, drop_location())) return - to_chat(user, span_notice("You fit the pipe into \the [src].")) + user.balloon_alert("inserted pipe") else return ..() @@ -270,14 +283,12 @@ . = FALSE if(state == GIRDER_TRAM) - user.visible_message(span_warning("[user] disassembles the girder."), - span_notice("You start to disassemble the girder..."), - span_hear("You hear clanking and banging noises.")) + user.balloon_alert("disassembling frame...") if(tool.use_tool(src, user, 4 SECONDS, volume=100)) if(state != GIRDER_TRAM) return state = GIRDER_DISASSEMBLED - to_chat(user, span_notice("You disassemble the girder.")) + user.balloon_alert("frame disassembled") var/obj/item/stack/sheet/iron/M = new (loc, 2) if (!QDELETED(M)) M.add_fingerprint(user) @@ -285,14 +296,12 @@ return TRUE if(state == GIRDER_DISPLACED) - user.visible_message(span_warning("[user] disassembles the girder."), - span_notice("You start to disassemble the girder..."), - span_hear("You hear clanking and banging noises.")) + user.balloon_alert("disassembling frame...") if(tool.use_tool(src, user, 40, volume=100)) if(state != GIRDER_DISPLACED) return state = GIRDER_DISASSEMBLED - to_chat(user, span_notice("You disassemble the girder.")) + user.balloon_alert("frame disassembled") var/obj/item/stack/sheet/iron/M = new (loc, 2) if (!QDELETED(M)) M.add_fingerprint(user) @@ -300,20 +309,20 @@ return TRUE else if(state == GIRDER_REINF) - to_chat(user, span_notice("You start unsecuring support struts...")) + user.balloon_alert("unsecuring support struts...") if(tool.use_tool(src, user, 40, volume=100)) if(state != GIRDER_REINF) return - to_chat(user, span_notice("You unsecure the support struts.")) + user.balloon_alert("support struts unsecured") state = GIRDER_REINF_STRUTS return TRUE else if(state == GIRDER_REINF_STRUTS) - to_chat(user, span_notice("You start securing support struts...")) + user.balloon_alert("securing support struts...") if(tool.use_tool(src, user, 40, volume=100)) if(state != GIRDER_REINF_STRUTS) return - to_chat(user, span_notice("You secure the support struts.")) + user.balloon_alert("support struts secured") state = GIRDER_REINF return TRUE @@ -321,9 +330,9 @@ /obj/structure/girder/wirecutter_act(mob/user, obj/item/tool) . = ..() if(state == GIRDER_REINF_STRUTS) - to_chat(user, span_notice("You start removing the inner grille...")) + user.balloon_alert("removing inner grille...") if(tool.use_tool(src, user, 40, volume=100)) - to_chat(user, span_notice("You remove the inner grille.")) + user.balloon_alert("inner grille removed") new /obj/item/stack/sheet/plasteel(get_turf(src)) var/obj/structure/girder/G = new (loc) transfer_fingerprints_to(G) @@ -334,19 +343,19 @@ . = ..() if(state == GIRDER_DISPLACED) if(!isfloorturf(loc)) - to_chat(user, span_warning("A floor must be present to secure the girder!")) + user.balloon_alert("needs floor!") - to_chat(user, span_notice("You start securing the girder...")) + user.balloon_alert("securing frame...") if(tool.use_tool(src, user, 40, volume=100)) - to_chat(user, span_notice("You secure the girder.")) + user.balloon_alert("frame secured") var/obj/structure/girder/G = new (loc) transfer_fingerprints_to(G) qdel(src) return TRUE else if(state == GIRDER_NORMAL && can_displace) - to_chat(user, span_notice("You start unsecuring the girder...")) + user.balloon_alert("unsecuring frame...") if(tool.use_tool(src, user, 40, volume=100)) - to_chat(user, span_notice("You unsecure the girder.")) + user.balloon_alert("frame unsecured") var/obj/structure/girder/displaced/D = new (loc) transfer_fingerprints_to(D) qdel(src) @@ -391,8 +400,6 @@ name = "tram girder" state = GIRDER_TRAM - - //////////////////////////////////////////// cult girder ////////////////////////////////////////////// /obj/structure/girder/cult @@ -408,24 +415,25 @@ if(!W.tool_start_check(user, amount=0)) return - to_chat(user, span_notice("You start slicing apart the girder...")) + user.balloon_alert("slicing apart...") if(W.use_tool(src, user, 40, volume=50)) - to_chat(user, span_notice("You slice apart the girder.")) + user.balloon_alert("sliced apart") var/obj/item/stack/sheet/runed_metal/R = new(drop_location(), 1) transfer_fingerprints_to(R) qdel(src) else if(istype(W, /obj/item/stack/sheet/runed_metal)) var/obj/item/stack/sheet/runed_metal/R = W - if(R.get_amount() < 1) - to_chat(user, span_warning("You need at least one sheet of runed metal to construct a runed wall!")) + var/amount = construction_cost[R.type] + if(R.get_amount() < amount) + user.balloon_alert("need [amount] sheet!") return - user.visible_message(span_notice("[user] begins laying runed metal on [src]..."), span_notice("You begin constructing a runed wall...")) + user.balloon_alert("adding plating...") if(do_after(user, 50, target = src)) - if(R.get_amount() < 1) + if(R.get_amount() < amount) return - user.visible_message(span_notice("[user] plates [src] with runed metal."), span_notice("You construct a runed wall.")) - R.use(1) + user.balloon_alert("plating added") + R.use(amount) var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall/mineral/cult) qdel(src) @@ -456,12 +464,12 @@ var/turf/T = get_turf(src) switch(passed_mode) if(RCD_FLOORWALL) - to_chat(user, span_notice("You finish a wall.")) + user.balloon_alert("plating added") T.PlaceOnTop(/turf/closed/wall) qdel(src) return TRUE if(RCD_DECONSTRUCT) - to_chat(user, span_notice("You deconstruct the girder.")) + user.balloon_alert("frame disassembled") qdel(src) return TRUE return FALSE @@ -477,24 +485,25 @@ if(W.tool_behaviour == TOOL_WELDER) if(!W.tool_start_check(user, amount = 0)) return - to_chat(user, span_notice("You start slicing apart [src]...")) + user.balloon_alert("slicing apart...") if(W.use_tool(src, user, 40, volume=50)) - to_chat(user, span_notice("You slice apart [src].")) + user.balloon_alert("sliced apart") var/obj/item/stack/sheet/bronze/B = new(drop_location(), 2) transfer_fingerprints_to(B) qdel(src) else if(istype(W, /obj/item/stack/sheet/bronze)) var/obj/item/stack/sheet/bronze/B = W - if(B.get_amount() < 2) - to_chat(user, span_warning("You need at least two bronze sheets to build a bronze wall!")) + var/amount = construction_cost[B.type] + if(B.get_amount() < amount) + user.balloon_alert("need [amount] sheets!") return - user.visible_message(span_notice("[user] begins plating [src] with bronze..."), span_notice("You begin constructing a bronze wall...")) + user.balloon_alert("adding plating...") if(do_after(user, 50, target = src)) - if(B.get_amount() < 2) + if(B.get_amount() < amount) return - user.visible_message(span_notice("[user] plates [src] with bronze!"), span_notice("You construct a bronze wall.")) - B.use(2) + user.balloon_alert("plating added") + B.use(amount) var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall/mineral/bronze) qdel(src)