Skip to content

Commit

Permalink
removes /turf/simulated
Browse files Browse the repository at this point in the history
  • Loading branch information
duncathan committed Feb 29, 2016
1 parent 9716d1f commit 1db8235
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 141 deletions.
80 changes: 0 additions & 80 deletions code/game/turfs/simulated.dm
Original file line number Diff line number Diff line change
@@ -1,80 +0,0 @@
/turf/simulated
name = "station"
var/wet = 0
var/image/wet_overlay = null

var/thermite = 0
oxygen = MOLES_O2STANDARD
nitrogen = MOLES_N2STANDARD
var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed
var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to



/turf/simulated/proc/burn_tile()

/turf/simulated/proc/MakeSlippery(wet_setting = TURF_WET_WATER) // 1 = Water, 2 = Lube, 3 = Ice
if(wet >= wet_setting)
return
wet = wet_setting
if(wet_setting != TURF_DRY)
if(wet_overlay)
overlays -= wet_overlay
wet_overlay = null
var/turf/simulated/floor/F = src
if(istype(F))
wet_overlay = image('icons/effects/water.dmi', src, "wet_floor_static")
else
wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
overlays += wet_overlay

spawn(rand(790, 820)) // Purely so for visual effect
if(!istype(src, /turf/simulated)) //Because turfs don't get deleted, they change, adapt, transform, evolve and deform. they are one and they are all.
return
MakeDry(wet_setting)

/turf/simulated/proc/MakeDry(wet_setting = TURF_WET_WATER)
if(wet > wet_setting)
return
wet = TURF_DRY
if(wet_overlay)
overlays -= wet_overlay

/turf/simulated/Entered(atom/A, atom/OL)
..()
if (istype(A,/mob/living/carbon))
var/mob/living/carbon/M = A
switch(wet)
if(TURF_WET_WATER)
if(!M.slip(3, 1, null, NO_SLIP_WHEN_WALKING))
M.inertia_dir = 0
return
if(TURF_WET_LUBE)
M.slip(0, 7, null, (SLIDE|GALOSHES_DONT_HELP))
return
if(TURF_WET_ICE)
M.slip(0, 4, null, (SLIDE|NO_SLIP_WHEN_WALKING))
return


/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 if(is_shielded())
affecting_level = 3
else if(intact)
affecting_level = 2
else
affecting_level = 1

for(var/V in contents)
var/atom/A = V
if(A.level >= affecting_level)
A.ex_act(severity, target)
3 changes: 3 additions & 0 deletions code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
var/list/broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
var/list/burnt_states = list()

oxygen = MOLES_O2STANDARD
nitrogen = MOLES_N2STANDARD

/turf/simulated/floor/New()
..()
if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
Expand Down
7 changes: 4 additions & 3 deletions code/game/turfs/space/space.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/turf/space
icon = 'icons/turf/space.dmi'
name = "\proper space"
icon_state = "0"
icon_state = SPACE_ICON_STATE
intact = 0

temperature = TCMB
Expand All @@ -12,9 +12,10 @@
var/destination_x
var/destination_y

var/global/datum/gas_mixture/space/space_gas = new

/turf/space/New()
if(!istype(src, /turf/space/transit))
icon_state = SPACE_ICON_STATE
air = space_gas

/turf/space/Destroy()
return QDEL_HINT_LETMELIVE
Expand Down
4 changes: 4 additions & 0 deletions code/game/turfs/space/transit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
/turf/space/transit/horizontal
dir = WEST

/turf/space/transit/New()
..()
update_icon()

/turf/space/transit/Entered(atom/movable/AM, atom/OldLoc)
if(!AM)
return
Expand Down
70 changes: 69 additions & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

//Properties for both
var/temperature = T20C
var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed
var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to

var/blocks_air = 0

Expand All @@ -28,7 +30,12 @@

var/list/proximity_checkers = list()

var/wet = 0
var/image/wet_overlay = null
var/image/obscured //camerachunks

var/thermite = 0

/turf/New()
..()
for(var/atom/movable/AM in src)
Expand Down Expand Up @@ -93,6 +100,17 @@
for(var/A in proximity_checkers)
var/atom/B = A
B.HasProximity(M)
//slipping
if (istype(A,/mob/living/carbon))
var/mob/living/carbon/M = A
switch(wet)
if(TURF_WET_WATER)
if(!M.slip(3, 1, null, NO_SLIP_WHEN_WALKING))
M.inertia_dir = 0
if(TURF_WET_LUBE)
M.slip(0, 7, null, (SLIDE|GALOSHES_DONT_HELP))
if(TURF_WET_ICE)
M.slip(0, 4, null, (SLIDE|NO_SLIP_WHEN_WALKING))

/turf/proc/is_plasteel_floor()
return 0
Expand Down Expand Up @@ -140,10 +158,12 @@
if(!can_have_cabling())
for(var/obj/structure/cable/C in contents)
C.Deconstruct()

smooth_icon_neighbors(src)
return W

//////Assimilate Air//////
/turf/simulated/proc/Assimilate_Air()
/turf/proc/Assimilate_Air()
if(air)
var/datum/gas_mixture/total = new//Holders to assimilate air from nearby turfs
var/list/total_gases = total.gases
Expand Down Expand Up @@ -308,6 +328,54 @@
underlays += O
return 1

/turf/proc/burn_tile()

/turf/proc/MakeSlippery(wet_setting = TURF_WET_WATER) // 1 = Water, 2 = Lube, 3 = Ice
if(wet >= wet_setting)
return
wet = wet_setting
if(wet_setting != TURF_DRY)
if(wet_overlay)
overlays -= wet_overlay
wet_overlay = null
var/turf/simulated/floor/F = src
if(istype(F))
wet_overlay = image('icons/effects/water.dmi', src, "wet_floor_static")
else
wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
overlays += wet_overlay

spawn(rand(790, 820)) // Purely so for visual effect
if(!istype(src, /turf/simulated)) //Because turfs don't get deleted, they change, adapt, transform, evolve and deform. they are one and they are all.
return
MakeDry(wet_setting)

/turf/proc/MakeDry(wet_setting = TURF_WET_WATER)
if(wet > wet_setting)
return
wet = TURF_DRY
if(wet_overlay)
overlays -= wet_overlay

/turf/proc/is_shielded()

/turf/contents_explosion(severity, target)
var/affecting_level
if(severity == 1)
affecting_level = 1
else if(is_shielded())
affecting_level = 3
else if(intact)
affecting_level = 2
else
affecting_level = 1

for(var/V in contents)
var/atom/A = V
if(A.level >= affecting_level)
A.ex_act(severity, target)


/turf/indestructible
name = "wall"
icon = 'icons/turf/walls.dmi'
Expand Down
Loading

0 comments on commit 1db8235

Please sign in to comment.