From 092773132dea4090bf087ca4e4e6fe604cae4ca9 Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Sat, 20 Apr 2019 03:09:13 +0200 Subject: [PATCH] no_lava fix, make sure simple explosions don't nuke the Syndicate base --- code/__DEFINES/misc.dm | 3 +++ code/_globalvars/lists/objects.dm | 2 ++ code/game/machinery/syndicatebomb.dm | 9 +++++++ code/game/objects/effects/mapping_helpers.dm | 9 +++---- code/game/turfs/simulated/walls_mineral.dm | 27 +++++++++---------- .../ruins/lavalandruin_code/syndicate_base.dm | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 15d2bbc3237..da1a481d305 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -423,3 +423,6 @@ #define GHOST_ORBIT_HEXAGON "hexagon" #define GHOST_ORBIT_SQUARE "square" #define GHOST_ORBIT_PENTAGON "pentagon" + +//Explosive wall groups +#define EXPLOSIVE_WALL_GROUP_SYNDICATE_BASE "syndicate_base" \ No newline at end of file diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index c7217221585..72ab95518b1 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -48,3 +48,5 @@ GLOBAL_LIST_INIT(active_jammers, list()) // List of active radio jam GLOBAL_LIST_INIT(active_diseases, list()) //List of Active disease in all mobs; purely for quick referencing. GLOBAL_LIST_EMPTY(mob_spawners) // All mob_spawn objects + +GLOBAL_LIST_EMPTY(explosive_walls) \ No newline at end of file diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index f02b8411e38..d9e66f39b60 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -275,6 +275,15 @@ desc = "Do not taunt. Warranty invalid if exposed to high temperature. Not suitable for agents under 3 years of age." payload = /obj/item/bombcore/large can_unanchor = FALSE + var/explosive_wall_group = EXPLOSIVE_WALL_GROUP_SYNDICATE_BASE // If set, this bomb will also cause explosive walls in the same group to explode + +/obj/machinery/syndicatebomb/self_destruct/try_detonate(ignore_active = FALSE) + . = ..() + if(. && explosive_wall_group) + for(var/wall in GLOB.explosive_walls) + var/turf/simulated/wall/mineral/plastitanium/explosive/E = wall + if(E.explosive_wall_group == explosive_wall_group) + E.self_destruct() ///Bomb Cores/// diff --git a/code/game/objects/effects/mapping_helpers.dm b/code/game/objects/effects/mapping_helpers.dm index d30905a58f6..909e63a98ba 100644 --- a/code/game/objects/effects/mapping_helpers.dm +++ b/code/game/objects/effects/mapping_helpers.dm @@ -64,13 +64,10 @@ return late ? INITIALIZE_HINT_LATELOAD : qdel(src) // INITIALIZE_HINT_QDEL <-- Doesn't work -//needs to do its thing before spawn_rivers() is called -INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) - /obj/effect/mapping_helpers/no_lava icon_state = "no_lava" -/obj/effect/mapping_helpers/no_lava/Initialize(mapload) - . = ..() +/obj/effect/mapping_helpers/no_lava/New() var/turf/T = get_turf(src) - T.flags |= NO_LAVA_GEN \ No newline at end of file + T.flags |= NO_LAVA_GEN + . = ..() \ No newline at end of file diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm index aa1c0470b1b..02c183353d8 100644 --- a/code/game/turfs/simulated/walls_mineral.dm +++ b/code/game/turfs/simulated/walls_mineral.dm @@ -275,21 +275,20 @@ icon_state = "map-overspace" fixed_underlay = list("space"=1) -/turf/simulated/wall/mineral/plastitanium/explosive/dismantle_wall(devastated, explode) - var/obj/item/bombcore/large/bombcore = new(get_turf(src)) - if(devastated || explode) - bombcore.detonate() - ..() +/turf/simulated/wall/mineral/plastitanium/explosive + var/explosive_wall_group = EXPLOSIVE_WALL_GROUP_SYNDICATE_BASE -/turf/simulated/wall/mineral/plastitanium/explosive/ex_act(severity, target) - switch(severity) - if(1) - dismantle_wall(1,1) - if(2) - dismantle_wall(1,1) - if(3) - if (prob(hardness)) - dismantle_wall(0,1) +/turf/simulated/wall/mineral/plastitanium/explosive/Initialize(mapload) + . = ..() + GLOB.explosive_walls += src + +/turf/simulated/wall/mineral/plastitanium/explosive/Destroy() + GLOB.explosive_walls -= src + return ..() + +/turf/simulated/wall/mineral/plastitanium/explosive/proc/self_destruct() + var/obj/item/bombcore/large/bombcore = new(get_turf(src)) + bombcore.detonate() //have to copypaste this code /turf/simulated/wall/mineral/plastitanium/interior/copyTurf(turf/T) diff --git a/code/modules/ruins/lavalandruin_code/syndicate_base.dm b/code/modules/ruins/lavalandruin_code/syndicate_base.dm index 31069c360eb..0f092ab4509 100644 --- a/code/modules/ruins/lavalandruin_code/syndicate_base.dm +++ b/code/modules/ruins/lavalandruin_code/syndicate_base.dm @@ -61,7 +61,7 @@ /obj/effect/mob_spawn/human/lavaland_syndicate/comms/space flavour_text = "You are a syndicate agent, assigned to a small listening post station situated near your hated enemy's top secret research facility: Space Station 13. Monitor enemy activity as best you can, and try to keep a low profile. DO NOT abandon the base. Use the communication equipment to provide support to any field agents, and sow disinformation to throw Nanotrasen off your trail. Do not let the base fall into enemy hands!" -/obj/effect/mob_spawn/human/lavaland_syndicate/comms/space/Initialize() +/obj/effect/mob_spawn/human/lavaland_syndicate/comms/space/Initialize(mapload) . = ..() if(prob(90)) //only has a 10% chance of existing, otherwise it'll just be a NPC syndie. new /mob/living/simple_animal/hostile/syndicate/ranged(get_turf(src))