Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Add Flock plating under Flock floortiles #257

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
15 changes: 11 additions & 4 deletions code/turf/floors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,9 @@ DEFINE_FLOORS(grasslush/thin,
if(!force_break)
if(src.reinforced) return
if(!intact) return
if (src.flock_plating_under)
src.ReplaceWith("FeatherPlating", FALSE)
return
if (!icon_old)
icon_old = icon_state
if (!name_old)
Expand Down Expand Up @@ -1800,10 +1803,14 @@ DEFINE_FLOORS(grasslush/thin,

// Don't replace with an [else]! If a prying tool is found above [intact] might become 0 and this runs too, which is how floor swapping works now! - BatElite
if (!intact)
restore_tile()
src.plate_mat = src.material
if(C.material)
src.setMaterial(C.material)
if (istype(src, /turf/simulated/floor/plating/feather_plating))
var/turf/simulated/floor/plating/feather_plating/plating = src
plating.restore_tile(C.material)
else
restore_tile()
src.plate_mat = src.material
if(C.material)
src.setMaterial(C.material)
playsound(src, "sound/impact_sounds/Generic_Stab_1.ogg", 50, 1)

if(!istype(src.material, /datum/material/metal/steel))
Expand Down
15 changes: 15 additions & 0 deletions code/turf/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
var/tmp/allow_unrestricted_hotbox = 0
var/wet = 0
var/sticky = FALSE
/// this turf will be replaced by a flock plating tile if it becomes plating in the future
var/flock_plating_under = FALSE
throw_unlimited = 0 //throws cannot stop on this tile if true (also makes space drift)

var/step_material = 0
Expand Down Expand Up @@ -488,6 +490,7 @@ proc/generate_space_color()
/turf/proc/ReplaceWith(var/what, var/keep_old_material = 1, var/handle_air = 1, handle_dir = 1, force = 0)
var/turf/simulated/new_turf
var/old_dir = dir
var/flock_plating_is_under = src.flock_plating_under || istype(src, /turf/simulated/floor/plating/feather_plating)

var/oldmat = src.material

Expand Down Expand Up @@ -567,24 +570,36 @@ proc/generate_space_color()
new_turf = new /turf/space/fluid(src)
if ("Floor")
new_turf = new /turf/simulated/floor(src)
if (flock_plating_is_under)
new_turf.flock_plating_under = TRUE
if ("MetalFoam")
new_turf = new /turf/simulated/floor/metalfoam(src)
if ("EngineFloor")
new_turf = new /turf/simulated/floor/engine(src)
if (flock_plating_is_under)
new_turf.flock_plating_under = TRUE
if ("Circuit")
new_turf = new /turf/simulated/floor/circuit(src)
if (flock_plating_is_under)
new_turf.flock_plating_under = TRUE
if ("RWall")
if (map_settings)
new_turf = new map_settings.rwalls (src)
else
new_turf = new /turf/simulated/wall/r_wall(src)
if (flock_plating_is_under)
new_turf.flock_plating_under = TRUE
if("Concrete")
new_turf = new /turf/simulated/floor/concrete(src)
if ("Wall")
if (map_settings)
new_turf = new map_settings.walls (src)
else
new_turf = new /turf/simulated/wall(src)
if (flock_plating_is_under)
new_turf.flock_plating_under = TRUE
if ("FeatherPlating")
new_turf = new /turf/simulated/floor/plating/feather_plating(src)
if ("Unsimulated Floor")
new_turf = new /turf/unsimulated/floor(src)
else
Expand Down
75 changes: 73 additions & 2 deletions code/turf/turf_flock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,77 @@
// -----
// FLOOR
// -----
/turf/simulated/floor/plating/feather_plating
name = "weird plating"
desc = "A strange Flock under-plating. It looks rough enough that it could support tile placement."
icon = 'icons/misc/featherzone.dmi'
icon_state = "floor-plating"
mat_appearances_to_ignore = list("gnesis")
mat_changename = FALSE
mat_changedesc = FALSE

/turf/simulated/floor/plating/feather_plating/New()
..()
setMaterial(getMaterial("gnesis"))
setIntact(FALSE)

/turf/simulated/floor/plating/feather_plating/special_desc(dist, mob/user)
if (isflock(user) && !intact)
return {"<span class='flocksay'><span class='bold'>###=-</span> Ident unknown. No data packet received.
<br><span class='bold'>###=-</span></span>"}
else
return null

/turf/simulated/floor/plating/feather_plating/to_plating()
if (!intact)
return
setIntact(FALSE)

icon = initial(icon)
icon_state = initial(icon_state)
src.UpdateIcon()

mat_appearances_to_ignore = list("gnesis")
mat_changename = FALSE
mat_changedesc = FALSE
setMaterial(getMaterial("gnesis"))

name = initial(name)
desc = initial(desc)

levelupdate()

/turf/simulated/floor/plating/feather_plating/restore_tile(datum/material/mat)
if (intact)
return
setIntact(TRUE)

icon = 'icons/turf/floors.dmi'
icon_state = "floor"
src.UpdateIcon()

mat_appearances_to_ignore = list("steel")
mat_changename = TRUE
mat_changedesc = TRUE
if (mat)
setMaterial(mat)
else
setMaterial(getMaterial("steel"))

src.name = replacetext(src.name, initial(src.name), "floor")
src.desc = replacetext(src.desc, initial(src.desc), "")

levelupdate()

/turf/simulated/floor/plating/feather_plating/break_tile_to_plating()
return

/turf/simulated/floor/plating/feather_plating/break_tile()
return

/turf/simulated/floor/plating/feather_plating/burn_tile()
return

/turf/simulated/floor/feather
name = "weird floor"
desc = "I don't like the looks of that whatever-it-is."
Expand All @@ -13,6 +84,7 @@
mat_changename = 0
mat_changedesc = 0
broken = 0
flock_plating_under = TRUE
step_material = "step_plating"
step_priority = STEP_PRIORITY_MED
var/health = 50
Expand Down Expand Up @@ -73,8 +145,7 @@
/turf/simulated/floor/feather/break_tile_to_plating()
// if the turf's on, turn it off
off()
var/turf/simulated/floor/F = src.ReplaceWithFloor()
F.to_plating()
src.ReplaceWith("FeatherPlating", FALSE)

/turf/simulated/floor/feather/break_tile()
off()
Expand Down
Binary file modified icons/misc/featherzone.dmi
Binary file not shown.