Skip to content

Commit

Permalink
Merge pull request tgstation#14487 from xxalpha/shingles
Browse files Browse the repository at this point in the history
Floor level objects will now be protected from explosions until they are exposed.
  • Loading branch information
tkdrg committed Jan 9, 2016
2 parents 24b7eaa + 4dd308c commit 7bf3834
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/game/objects/structures/grille.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
var/health = 10
var/destroyed = 0
var/obj/item/stack/rods/stored
level = 3

/obj/structure/grille/New()
stored = new/obj/item/stack/rods(src)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@
fulltile = 1
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
level = 3

/obj/structure/window/reinforced/tinted/fulltile
icon = 'icons/obj/smooth_structures/tinted_window.dmi'
Expand All @@ -483,12 +484,14 @@
fulltile = 1
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile/)
level = 3

/obj/structure/window/reinforced/fulltile/ice
icon = 'icons/obj/smooth_structures/rice_window.dmi'
icon_state = "ice_window"
maxhealth = 150
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/reinforced/fulltile/ice)
level = 3

/obj/structure/window/shuttle
name = "shuttle window"
Expand All @@ -503,3 +506,4 @@
smooth = SMOOTH_TRUE
canSmoothWith = null
explosion_block = 1
level = 3
13 changes: 13 additions & 0 deletions code/game/turfs/simulated.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,16 @@
/turf/simulated/ChangeTurf(var/path)
. = ..()
smooth_icon_neighbors(src)

/turf/simulated/proc/is_shielded()

/turf/simulated/contents_explosion(severity, target)
var/affecting_level
if(severity == 1)
affecting_level = 1
else
affecting_level = is_shielded() ? 2 : (intact ? 2 : 1)
for(var/V in contents)
var/atom/A = V
if(A.level >= affecting_level)
A.ex_act(severity, target)
11 changes: 9 additions & 2 deletions code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","

/turf/simulated/floor/ex_act(severity, target)
..()
if(is_shielded())
return
if(target == src)
src.ChangeTurf(src.baseturf)
if(target != null)
ex_act(3)
return

switch(severity)
if(1)
src.ChangeTurf(src.baseturf)
Expand All @@ -75,7 +78,11 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
if (prob(50))
src.break_tile()
src.hotspot_expose(1000,CELL_VOLUME)
return

/turf/simulated/floor/is_shielded()
for(var/obj/structure/A in contents)
if(A.level == 3)
return 1

/turf/simulated/floor/blob_act()
return
Expand Down Expand Up @@ -169,4 +176,4 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
ChangeTurf(/turf/simulated/floor/engine/cult)

/turf/simulated/floor/can_have_cabling()
return !burnt & !broken
return !burnt && !broken

0 comments on commit 7bf3834

Please sign in to comment.