mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-28 18:23:10 +00:00
166 lines
5.5 KiB
Plaintext
166 lines
5.5 KiB
Plaintext
/turf/simulated/floor
|
|
name = "plating"
|
|
desc = "Unfinished flooring."
|
|
icon = 'icons/turf/flooring/plating_vr.dmi'
|
|
icon_state = "plating"
|
|
|
|
// Damage to flooring.
|
|
var/broken
|
|
var/burnt
|
|
|
|
// Plating data.
|
|
var/base_name = "plating"
|
|
var/base_desc = "The naked hull."
|
|
var/base_icon = 'icons/turf/flooring/plating_vr.dmi'
|
|
var/base_icon_state = "plating"
|
|
var/static/list/base_footstep_sounds = list("human" = list(
|
|
'sound/effects/footstep/plating1.ogg',
|
|
'sound/effects/footstep/plating2.ogg',
|
|
'sound/effects/footstep/plating3.ogg',
|
|
'sound/effects/footstep/plating4.ogg',
|
|
'sound/effects/footstep/plating5.ogg'))
|
|
|
|
var/list/old_decals = null // VOREStation Edit - Remember what decals we had between being pried up and replaced.
|
|
|
|
// Flooring data.
|
|
var/flooring_override
|
|
var/initial_flooring
|
|
var/decl/flooring/flooring
|
|
var/mineral = DEFAULT_WALL_MATERIAL
|
|
|
|
thermal_conductivity = 0.040
|
|
heat_capacity = 10000
|
|
var/lava = 0
|
|
|
|
/turf/simulated/floor/is_plating()
|
|
return !flooring
|
|
|
|
/turf/simulated/floor/New(var/newloc, var/floortype)
|
|
..(newloc)
|
|
if(!floortype && initial_flooring)
|
|
floortype = initial_flooring
|
|
if(floortype)
|
|
set_flooring(get_flooring_data(floortype))
|
|
else
|
|
footstep_sounds = base_footstep_sounds
|
|
if(can_dirty && can_start_dirty)
|
|
if(prob(dirty_prob))
|
|
dirt += rand(50,100)
|
|
update_dirt() //5% chance to start with dirt on a floor tile- give the janitor something to do
|
|
|
|
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring)
|
|
make_plating(defer_icon_update = 1)
|
|
flooring = newflooring
|
|
footstep_sounds = newflooring.footstep_sounds
|
|
// VOREStation Edit - We are plating switching to flooring, swap out old_decals for decals
|
|
var/tmp/list/overfloor_decals = old_decals
|
|
old_decals = decals
|
|
decals = overfloor_decals
|
|
// VOREStation Edit End
|
|
update_icon(1)
|
|
levelupdate()
|
|
|
|
//This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf
|
|
//This proc auto corrects the grass tiles' siding.
|
|
/turf/simulated/floor/proc/make_plating(var/place_product, var/defer_icon_update)
|
|
|
|
cut_overlays()
|
|
// VOREStation Edit - We are flooring switching to plating, swap out old_decals for decals.
|
|
if(flooring)
|
|
var/tmp/list/underfloor_decals = old_decals
|
|
old_decals = decals
|
|
decals = underfloor_decals
|
|
// VOREStation Edit End
|
|
|
|
name = base_name
|
|
desc = base_desc
|
|
icon = base_icon
|
|
icon_state = base_icon_state
|
|
footstep_sounds = base_footstep_sounds
|
|
|
|
if(flooring)
|
|
if(flooring.build_type && place_product)
|
|
new flooring.build_type(src)
|
|
flooring = null
|
|
|
|
set_light(0)
|
|
broken = null
|
|
burnt = null
|
|
flooring_override = null
|
|
levelupdate()
|
|
|
|
if(!defer_icon_update)
|
|
update_icon(1)
|
|
|
|
/turf/simulated/floor/levelupdate()
|
|
for(var/obj/O in src)
|
|
O.hide(O.hides_under_flooring() && src.flooring)
|
|
|
|
/turf/simulated/floor/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
|
switch(passed_mode)
|
|
if(RCD_FLOORWALL)
|
|
// A wall costs four sheets to build (two for the grider and two for finishing it).
|
|
var/cost = RCD_SHEETS_PER_MATTER_UNIT * 4
|
|
// R-walls cost five sheets, however.
|
|
if(the_rcd.make_rwalls)
|
|
cost += RCD_SHEETS_PER_MATTER_UNIT * 1
|
|
return list(
|
|
RCD_VALUE_MODE = RCD_FLOORWALL,
|
|
RCD_VALUE_DELAY = 2 SECONDS,
|
|
RCD_VALUE_COST = cost
|
|
)
|
|
if(RCD_AIRLOCK)
|
|
// Airlock assemblies cost four sheets. Let's just add another for the electronics/wires/etc.
|
|
return list(
|
|
RCD_VALUE_MODE = RCD_AIRLOCK,
|
|
RCD_VALUE_DELAY = 5 SECONDS,
|
|
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 5
|
|
)
|
|
if(RCD_WINDOWGRILLE)
|
|
// One steel sheet for the girder (two rods, which is one sheet).
|
|
return list(
|
|
RCD_VALUE_MODE = RCD_WINDOWGRILLE,
|
|
RCD_VALUE_DELAY = 1 SECOND,
|
|
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 1
|
|
)
|
|
if(RCD_DECONSTRUCT)
|
|
// Old RCDs made deconning the floor cost 10 units (IE, three times on full RCD).
|
|
// Now it's ten sheets worth of units (which is the same capacity-wise, three times on full RCD).
|
|
return list(
|
|
RCD_VALUE_MODE = RCD_DECONSTRUCT,
|
|
RCD_VALUE_DELAY = 5 SECONDS,
|
|
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 10
|
|
)
|
|
return FALSE
|
|
|
|
|
|
/turf/simulated/floor/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
|
switch(passed_mode)
|
|
if(RCD_FLOORWALL)
|
|
to_chat(user, span("notice", "You build a wall."))
|
|
ChangeTurf(/turf/simulated/wall)
|
|
var/turf/simulated/wall/T = get_turf(src) // Ref to the wall we just built.
|
|
// Apparently set_material(...) for walls requires refs to the material singletons and not strings.
|
|
// This is different from how other material objects with their own set_material(...) do it, but whatever.
|
|
var/material/M = name_to_material[the_rcd.material_to_use]
|
|
T.set_material(M, the_rcd.make_rwalls ? M : null, M)
|
|
T.add_hiddenprint(user)
|
|
return TRUE
|
|
if(RCD_AIRLOCK)
|
|
if(locate(/obj/machinery/door/airlock) in src)
|
|
return FALSE // No more airlock stacking.
|
|
to_chat(user, span("notice", "You build an airlock."))
|
|
new the_rcd.airlock_type(src)
|
|
return TRUE
|
|
if(RCD_WINDOWGRILLE)
|
|
if(locate(/obj/structure/grille) in src)
|
|
return FALSE
|
|
to_chat(user, span("notice", "You construct the grille."))
|
|
var/obj/structure/grille/G = new(src)
|
|
G.anchored = TRUE
|
|
return TRUE
|
|
if(RCD_DECONSTRUCT)
|
|
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
|
ChangeTurf(get_base_turf_by_area(src), preserve_outdoors = TRUE)
|
|
return TRUE
|