From 928fbe5ac8223a2f74732493a63f1b051cc0b7d7 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Fri, 20 Jul 2018 18:07:48 -0500 Subject: [PATCH 1/6] Fixes indoor weather, hopefully for real this time. --- code/controllers/subsystems/planets.dm | 2 +- code/game/objects/items/weapons/RCD.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 47 +++++++++++++++++++++ code/game/turfs/simulated/wall_attacks.dm | 31 ++++++++++++++ code/game/turfs/turf_changing.dm | 8 +++- 5 files changed, 87 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 3b3675d5c3a..1ff84e18104 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -62,7 +62,7 @@ SUBSYSTEM_DEF(planets) while(currentlist.len) var/turf/simulated/OT = currentlist[currentlist.len] currentlist.len-- - if(istype(OT) && z_to_planet.len >= OT.z && z_to_planet[OT.z]) + if(istype(OT) && OT.outdoors && z_to_planet.len >= OT.z && z_to_planet[OT.z]) var/datum/planet/P = z_to_planet[OT.z] P.planet_floors |= OT OT.vis_contents |= P.weather_holder.visuals diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 58aa30547dc..d9543fed201 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -153,7 +153,7 @@ return 0 if(build_turf) - T.ChangeTurf(build_turf) + T.ChangeTurf(build_turf, preserve_outdoors = TRUE) else if(build_other) new build_other(T) else diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 91371e7beb5..dce206d313b 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -9,6 +9,53 @@ attack_tile(C, L) // Be on help intent if you want to decon something. return +<<<<<<< HEAD +======= + if(istype(C, /obj/item/stack/tile/roofing)) + var/expended_tile = FALSE // To track the case. If a ceiling is built in a multiz zlevel, it also necessarily roofs it against weather + var/turf/T = GetAbove(src) + var/obj/item/stack/tile/roofing/R = C + + // Patch holes in the ceiling + if(T) + if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) + // Must be build adjacent to an existing floor/wall, no floating floors + var/list/cardinalTurfs = list() // Up a Z level + for(var/dir in cardinal) + var/turf/B = get_step(T, dir) + if(B) + cardinalTurfs += B + + var/turf/simulated/A = locate(/turf/simulated/floor) in cardinalTurfs + if(!A) + A = locate(/turf/simulated/wall) in cardinalTurfs + if(!A) + to_chat(user, "There's nothing to attach the ceiling to!") + return + + if(R.use(1)) // Cost of roofing tiles is 1:1 with cost to place lattice and plating + T.ReplaceWithLattice() + T.ChangeTurf(/turf/simulated/floor, preserve_outdoors = TRUE) + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + user.visible_message("[user] patches a hole in the ceiling.", "You patch a hole in the ceiling.") + expended_tile = TRUE + else + to_chat(user, "There aren't any holes in the ceiling to patch here.") + return + + // Create a ceiling to shield from the weather + if(src.outdoors) + for(var/dir in cardinal) + var/turf/A = get_step(src, dir) + if(A && !A.outdoors) + if(expended_tile || R.use(1)) + make_indoors() + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + user.visible_message("[user] roofs a tile, shielding it from the elements.", "You roof this tile, shielding it from the elements.") + break + return + +>>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix if(flooring) if(istype(C, /obj/item/weapon)) try_deconstruct_tile(C, user) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 1eaca16e761..8923fbe46aa 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -149,6 +149,37 @@ if(is_hot(W)) burn(is_hot(W)) +<<<<<<< HEAD +======= + if(istype(W, /obj/item/stack/tile/roofing)) + var/expended_tile = FALSE // To track the case. If a ceiling is built in a multiz zlevel, it also necessarily roofs it against weather + var/turf/T = GetAbove(src) + var/obj/item/stack/tile/roofing/R = W + + // Place plating over a wall + if(T) + if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) + if(R.use(1)) // Cost of roofing tiles is 1:1 with cost to place lattice and plating + T.ReplaceWithLattice() + T.ChangeTurf(/turf/simulated/floor, preserve_outdoors = TRUE) + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + user.visible_message("[user] patches a hole in the ceiling.", "You patch a hole in the ceiling.") + expended_tile = TRUE + else + to_chat(user, "There aren't any holes in the ceiling to patch here.") + return + + // Create a ceiling to shield from the weather + if(outdoors) + if(expended_tile || R.use(1)) // Don't need to check adjacent turfs for a wall, we're building on one + make_indoors() + if(!expended_tile) // Would've already played a sound + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + user.visible_message("[user] roofs \the [src], shielding it from the elements.", "You roof \the [src] tile, shielding it from the elements.") + return + + +>>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix if(locate(/obj/effect/overlay/wallrot) in src) if(istype(W, /obj/item/weapon/weldingtool) ) var/obj/item/weapon/weldingtool/WT = W diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index b355ec6328b..a613f3bc5df 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -22,7 +22,7 @@ below.update_icon() // To add or remove the 'ceiling-less' overlay. //Creates a new turf -/turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0) +/turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0, var/preserve_outdoors = FALSE) if (!N) return @@ -108,3 +108,9 @@ lighting_build_overlay() else lighting_clear_overlay() +<<<<<<< HEAD +======= + + if(preserve_outdoors) + outdoors = old_outdoors +>>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix From 815ccfe30896eb89f3cd218ade8ae252ba861451 Mon Sep 17 00:00:00 2001 From: Spades Date: Sat, 1 Sep 2018 18:36:33 -0400 Subject: [PATCH 2/6] Update turf_changing.dm How the fuck did this get merged here --- code/game/turfs/turf_changing.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index a613f3bc5df..43a80bb1f95 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -108,9 +108,5 @@ lighting_build_overlay() else lighting_clear_overlay() -<<<<<<< HEAD -======= - if(preserve_outdoors) outdoors = old_outdoors ->>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix From 07a8c29bcd3e5a359ba338cd960424cc30f08daa Mon Sep 17 00:00:00 2001 From: Spades Date: Sat, 1 Sep 2018 18:37:30 -0400 Subject: [PATCH 3/6] Just update the whole file --- code/game/turfs/turf_changing.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 43a80bb1f95..fa026a0c601 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -26,13 +26,11 @@ if (!N) return - /* VOREStation Edit Start - Say Nope To This. Tether's Z info is setup fine, trust it. // This makes sure that turfs are not changed to space when one side is part of a zone if(N == /turf/space) var/turf/below = GetBelow(src) if(istype(below) && (air_master.has_valid_zone(below) || air_master.has_valid_zone(src))) N = /turf/simulated/open - */ // VOREStation Edit End var/obj/fire/old_fire = fire var/old_opacity = opacity @@ -40,6 +38,7 @@ var/old_affecting_lights = affecting_lights var/old_lighting_overlay = lighting_overlay var/old_corners = corners + var/old_outdoors = outdoors //world << "Replacing [src.type] with [N]" @@ -108,5 +107,6 @@ lighting_build_overlay() else lighting_clear_overlay() + if(preserve_outdoors) outdoors = old_outdoors From 301ef7cc553c83a73eba14a63ecf050d1ff14c51 Mon Sep 17 00:00:00 2001 From: Spades Date: Sat, 1 Sep 2018 18:37:55 -0400 Subject: [PATCH 4/6] Update wall_attacks.dm --- code/game/turfs/simulated/wall_attacks.dm | 70 +++++++++++------------ 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 8923fbe46aa..6c7e65b122b 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -84,16 +84,16 @@ if(rotting) if(reinf_material) - user << "\The [reinf_material.display_name] feels porous and crumbly." + to_chat(user, "\The [reinf_material.display_name] feels porous and crumbly.") else - user << "\The [material.display_name] crumbles under your touch!" + to_chat(user, "\The [material.display_name] crumbles under your touch!") dismantle_wall() return 1 if(..()) return 1 if(!can_open) - user << "You push the wall, but nothing happens." + to_chat(user, "You push the wall, but nothing happens.") playsound(src, 'sound/weapons/Genhit.ogg', 25, 1) else toggle_open(user) @@ -138,19 +138,18 @@ user.setClickCooldown(user.get_attack_speed(W)) if (!user.) - user << "You don't have the dexterity to do this!" + to_chat(user, "You don't have the dexterity to do this!") return //get the user's location - if(!istype(user.loc, /turf)) return //can't do this stuff whilst inside objects and such + if(!istype(user.loc, /turf)) + return //can't do this stuff whilst inside objects and such if(W) radiate() if(is_hot(W)) burn(is_hot(W)) -<<<<<<< HEAD -======= if(istype(W, /obj/item/stack/tile/roofing)) var/expended_tile = FALSE // To track the case. If a ceiling is built in a multiz zlevel, it also necessarily roofs it against weather var/turf/T = GetAbove(src) @@ -179,18 +178,17 @@ return ->>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix if(locate(/obj/effect/overlay/wallrot) in src) if(istype(W, /obj/item/weapon/weldingtool) ) var/obj/item/weapon/weldingtool/WT = W if( WT.remove_fuel(0,user) ) - user << "You burn away the fungi with \the [WT]." + to_chat(user, "You burn away the fungi with \the [WT].") playsound(src, WT.usesound, 10, 1) for(var/obj/effect/overlay/wallrot/WR in src) qdel(WR) return else if(!is_sharp(W) && W.force >= 10 || W.force >= 20) - user << "\The [src] crumbles away under the force of your [W.name]." + to_chat(user, "\The [src] crumbles away under the force of your [W.name].") src.dismantle_wall(1) return @@ -210,7 +208,7 @@ var/obj/item/weapon/melee/energy/blade/EB = W EB.spark_system.start() - user << "You slash \the [src] with \the [EB]; the thermite ignites!" + to_chat(user, "You slash \the [src] with \the [EB]; the thermite ignites!") playsound(src, "sparks", 50, 1) playsound(src, 'sound/weapons/blade1.ogg', 50, 1) @@ -227,13 +225,13 @@ return if(WT.remove_fuel(0,user)) - user << "You start repairing the damage to [src]." + to_chat(user, "You start repairing the damage to [src].") playsound(src.loc, WT.usesound, 100, 1) if(do_after(user, max(5, damage / 5) * WT.toolspeed) && WT && WT.isOn()) - user << "You finish repairing the damage to [src]." + to_chat(user, "You finish repairing the damage to [src].") take_damage(-damage) else - user << "You need more welding fuel to complete this task." + to_chat(user, "You need more welding fuel to complete this task.") return user.update_examine_panel(src) return @@ -250,7 +248,7 @@ if(!WT.isOn()) return if(!WT.remove_fuel(0,user)) - user << "You need more welding fuel to complete this task." + to_chat(user, "You need more welding fuel to complete this task.") return dismantle_verb = "cutting" dismantle_sound = W.usesound @@ -267,7 +265,7 @@ if(dismantle_verb) - user << "You begin [dismantle_verb] through the outer plating." + to_chat(user, "You begin [dismantle_verb] through the outer plating.") if(dismantle_sound) playsound(src, dismantle_sound, 100, 1) @@ -277,7 +275,7 @@ if(!do_after(user,cut_delay * W.toolspeed)) return - user << "You remove the outer plating." + to_chat(user, "You remove the outer plating.") dismantle_wall() user.visible_message("The wall was torn open by [user]!") return @@ -290,24 +288,24 @@ playsound(src, W.usesound, 100, 1) construction_stage = 5 user.update_examine_panel(src) - user << "You cut through the outer grille." + to_chat(user, "You cut through the outer grille.") update_icon() return if(5) if (istype(W, /obj/item/weapon/screwdriver)) - user << "You begin removing the support lines." + to_chat(user, "You begin removing the support lines.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 5) return construction_stage = 4 user.update_examine_panel(src) update_icon() - user << "You unscrew the support lines." + to_chat(user, "You unscrew the support lines.") return else if (istype(W, /obj/item/weapon/wirecutters)) construction_stage = 6 user.update_examine_panel(src) - user << "You mend the outer grille." + to_chat(user, "You mend the outer grille.") playsound(src, W.usesound, 100, 1) update_icon() return @@ -320,51 +318,51 @@ if(WT.remove_fuel(0,user)) cut_cover=1 else - user << "You need more welding fuel to complete this task." + to_chat(user, "You need more welding fuel to complete this task.") return else if (istype(W, /obj/item/weapon/pickaxe/plasmacutter)) cut_cover = 1 if(cut_cover) - user << "You begin slicing through the metal cover." + to_chat(user, "You begin slicing through the metal cover.") playsound(src, W.usesound, 100, 1) if(!do_after(user, 60 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) return construction_stage = 3 user.update_examine_panel(src) update_icon() - user << "You press firmly on the cover, dislodging it." + to_chat(user, "You press firmly on the cover, dislodging it.") return else if (istype(W, /obj/item/weapon/screwdriver)) - user << "You begin screwing down the support lines." + to_chat(user, "You begin screwing down the support lines.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) return construction_stage = 5 user.update_examine_panel(src) update_icon() - user << "You screw down the support lines." + to_chat(user, "You screw down the support lines.") return if(3) if (istype(W, /obj/item/weapon/crowbar)) - user << "You struggle to pry off the cover." + to_chat(user, "You struggle to pry off the cover.") playsound(src, W.usesound, 100, 1) if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 3) return construction_stage = 2 user.update_examine_panel(src) update_icon() - user << "You pry off the cover." + to_chat(user, "You pry off the cover.") return if(2) if (istype(W, /obj/item/weapon/wrench)) - user << "You start loosening the anchoring bolts which secure the support rods to their frame." + to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame.") playsound(src, W.usesound, 100, 1) if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 2) return construction_stage = 1 user.update_examine_panel(src) update_icon() - user << "You remove the bolts anchoring the support rods." + to_chat(user, "You remove the bolts anchoring the support rods.") return if(1) var/cut_cover @@ -373,28 +371,28 @@ if( WT.remove_fuel(0,user) ) cut_cover=1 else - user << "You need more welding fuel to complete this task." + to_chat(user, "You need more welding fuel to complete this task.") return else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter)) cut_cover = 1 if(cut_cover) - user << "You begin slicing through the support rods." + to_chat(user, "You begin slicing through the support rods.") playsound(src, W.usesound, 100, 1) if(!do_after(user,70 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 1) return construction_stage = 0 user.update_examine_panel(src) update_icon() - user << "The slice through the support rods." + to_chat(user, "The slice through the support rods.") return if(0) if(istype(W, /obj/item/weapon/crowbar)) - user << "You struggle to pry off the outer sheath." + to_chat(user, "You struggle to pry off the outer sheath.") playsound(src, W.usesound, 100, 1) if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || !user || !W || !T ) return if(user.loc == T && user.get_active_hand() == W ) - user << "You pry off the outer sheath." + to_chat(user, "You pry off the outer sheath.") dismantle_wall() return @@ -405,5 +403,3 @@ else if(!istype(W,/obj/item/weapon/rcd) && !istype(W, /obj/item/weapon/reagent_containers)) return attack_hand(user) - - From 9e77d6a16f56f257a4eae71187e35c10963ec56c Mon Sep 17 00:00:00 2001 From: Spades Date: Sat, 1 Sep 2018 18:38:23 -0400 Subject: [PATCH 5/6] Update floor_attackby.dm --- code/game/turfs/simulated/floor_attackby.dm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index dce206d313b..11c45f2c2a7 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -9,8 +9,6 @@ attack_tile(C, L) // Be on help intent if you want to decon something. return -<<<<<<< HEAD -======= if(istype(C, /obj/item/stack/tile/roofing)) var/expended_tile = FALSE // To track the case. If a ceiling is built in a multiz zlevel, it also necessarily roofs it against weather var/turf/T = GetAbove(src) @@ -55,7 +53,6 @@ break return ->>>>>>> 14d8df2... Merge pull request #5424 from Neerti/outdoor_shuttle_fix if(flooring) if(istype(C, /obj/item/weapon)) try_deconstruct_tile(C, user) @@ -159,4 +156,4 @@ return if(flooring) return - attackby(T, user) \ No newline at end of file + attackby(T, user) From a60d61f594973d7f1e48b98f8225363cac3b3b4a Mon Sep 17 00:00:00 2001 From: Spades Date: Sat, 1 Sep 2018 18:39:06 -0400 Subject: [PATCH 6/6] Update planets.dm --- code/controllers/subsystems/planets.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 1ff84e18104..a163a3b1e79 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -56,6 +56,7 @@ SUBSYSTEM_DEF(planets) P.planet_floors -= T else P.planet_walls -= T + T.vis_contents -= P.weather_holder.visuals /datum/controller/subsystem/planets/proc/allocateTurfs(var/initial = FALSE) var/list/currentlist = new_outdoor_turfs @@ -113,9 +114,9 @@ SUBSYSTEM_DEF(planets) while(currentrun.len) var/datum/planet/P = currentrun[currentrun.len] currentrun.len-- - + P.process(last_fire) - + //Sun light needs changing if(P.needs_work & PLANET_PROCESS_SUN) P.needs_work &= ~PLANET_PROCESS_SUN