From 97adee16dba4a2a6b631e8d2ce396495f6c417b6 Mon Sep 17 00:00:00 2001 From: RavingManiac Date: Sun, 3 May 2015 21:53:02 +1000 Subject: [PATCH] Recursive explosion resistance values for walls, space tiles, grilles and airlocks tweaked Lattices now spawn properly when a floor tile is destroyed by an explosion. Probabilities involved tweaked --- code/game/machinery/doors/airlock.dm | 14 +++++++++++++- code/game/objects/explosion_recursive.dm | 18 +++++------------- code/game/objects/structures/grille.dm | 2 +- code/game/turfs/simulated/floor.dm | 6 +++--- code/game/turfs/turf.dm | 3 ++- 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 35e8ea30445..76b08dba2c5 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -4,7 +4,7 @@ icon_state = "door_closed" power_channel = ENVIRON - explosion_resistance = 15 + explosion_resistance = 10 var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. var/hackProof = 0 // if 1, this door can't be hacked by the AI var/electrified_until = 0 //World time when the door is no longer electrified. -1 if it is permanently electrified until someone fixes it. @@ -80,6 +80,7 @@ icon = 'icons/obj/doors/Doorglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 glass = 1 @@ -91,6 +92,7 @@ /obj/machinery/door/airlock/vault name = "Vault" icon = 'icons/obj/doors/vault.dmi' + explosion_resistance = 20 opacity = 1 secured_wires = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites. @@ -108,12 +110,14 @@ /obj/machinery/door/airlock/hatch name = "Airtight Hatch" icon = 'icons/obj/doors/Doorhatchele.dmi' + explosion_resistance = 20 opacity = 1 assembly_type = /obj/structure/door_assembly/door_assembly_hatch /obj/machinery/door/airlock/maintenance_hatch name = "Maintenance Hatch" icon = 'icons/obj/doors/Doorhatchmaint2.dmi' + explosion_resistance = 20 opacity = 1 assembly_type = /obj/structure/door_assembly/door_assembly_mhatch @@ -122,6 +126,7 @@ icon = 'icons/obj/doors/Doorcomglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_com glass = 1 @@ -131,6 +136,7 @@ icon = 'icons/obj/doors/Doorengglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_eng glass = 1 @@ -140,6 +146,7 @@ icon = 'icons/obj/doors/Doorsecglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_sec glass = 1 @@ -149,6 +156,7 @@ icon = 'icons/obj/doors/Doormedglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_med glass = 1 @@ -173,6 +181,7 @@ icon = 'icons/obj/doors/Doorresearchglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_research glass = 1 @@ -183,6 +192,7 @@ icon = 'icons/obj/doors/Doorminingglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_min glass = 1 @@ -192,6 +202,7 @@ icon = 'icons/obj/doors/Dooratmoglass.dmi' hitsound = 'sound/effects/Glasshit.ogg' maxhealth = 300 + explosion_resistance = 5 opacity = 0 assembly_type = /obj/structure/door_assembly/door_assembly_atmo glass = 1 @@ -292,6 +303,7 @@ /obj/machinery/door/airlock/highsecurity name = "Secure Airlock" icon = 'icons/obj/doors/hightechsecurity.dmi' + explosion_resistance = 20 secured_wires = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 9dc04ff6301..9b03866b988 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -65,7 +65,7 @@ proc/explosion_rec(turf/epicenter, power) var/explosion_resistance /turf/space - explosion_resistance = 10 + explosion_resistance = 3 /turf/simulated/floor explosion_resistance = 1 @@ -83,10 +83,10 @@ proc/explosion_rec(turf/epicenter, power) explosion_resistance = 1 /turf/simulated/shuttle/wall - explosion_resistance = 5 + explosion_resistance = 10 /turf/simulated/wall - explosion_resistance = 5 + explosion_resistance = 10 /turf/simulated/wall/r_wall explosion_resistance = 25 @@ -107,24 +107,16 @@ proc/explosion_rec(turf/epicenter, power) explosion_turfs[src] = power var/spread_power = power - src.explosion_resistance //This is the amount of power that will be spread to the tile in the direction of the blast - var/side_spread_power = power - 2 * src.explosion_resistance //This is the amount of power that will be spread to the side tiles for(var/obj/O in src) if(O.explosion_resistance) spread_power -= O.explosion_resistance - side_spread_power -= O.explosion_resistance var/turf/T = get_step(src, direction) T.explosion_spread(spread_power, direction) T = get_step(src, turn(direction,90)) - T.explosion_spread(side_spread_power, turn(direction,90)) + T.explosion_spread(spread_power, turn(direction,90)) T = get_step(src, turn(direction,-90)) - T.explosion_spread(side_spread_power, turn(direction,90)) - - /* - for(var/direction in cardinal) - var/turf/T = get_step(src, direction) - T.explosion_spread(spread_power) - */ + T.explosion_spread(spread_power, turn(direction,90)) /turf/unsimulated/explosion_spread(power) return //So it doesn't get to the parent proc, which simulates explosions \ No newline at end of file diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 54536dd4001..7f3bdc98834 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -8,7 +8,7 @@ flags = CONDUCT pressure_resistance = 5*ONE_ATMOSPHERE layer = 2.9 - explosion_resistance = 5 + explosion_resistance = 1 var/health = 10 var/destroyed = 0 diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 46007735c33..9541e671164 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -82,19 +82,19 @@ var/list/wood_icons = list("wood","wood-broken") if(1.0) src.ChangeTurf(/turf/space) if(2.0) - switch(pick(1,2;75,3)) + switch(pick(40;1,40;2,3)) if (1) - src.ReplaceWithLattice() if(prob(33)) new /obj/item/stack/sheet/metal(src) + src.ReplaceWithLattice() if(2) src.ChangeTurf(/turf/space) if(3) + if(prob(33)) new /obj/item/stack/sheet/metal(src) if(prob(80)) src.break_tile_to_plating() else src.break_tile() src.hotspot_expose(1000,CELL_VOLUME) - if(prob(33)) new /obj/item/stack/sheet/metal(src) if(3.0) if (prob(50)) src.break_tile() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 882fa059c0a..98f56361feb 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -338,7 +338,8 @@ /turf/proc/ReplaceWithLattice() src.ChangeTurf(/turf/space) - new /obj/structure/lattice( locate(src.x, src.y, src.z) ) + spawn() + new /obj/structure/lattice( locate(src.x, src.y, src.z) ) /turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N //Useful to batch-add creatures to the list.