This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
_open.dm
263 lines (218 loc) · 7.95 KB
/
_open.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
/turf/open
plane = FLOOR_PLANE
FASTDMM_PROP(\
pipe_astar_cost = 1\
)
var/slowdown = 0 //negative for faster, positive for slower
var/postdig_icon_change = FALSE
var/postdig_icon
var/wet
var/footstep = null
var/barefootstep = null
var/clawfootstep = null
var/heavyfootstep = null
/turf/open/ComponentInitialize()
. = ..()
if(wet)
AddComponent(/datum/component/wet_floor, wet, INFINITY, 0, INFINITY, TRUE)
//direction is direction of travel of A
/turf/open/zPassIn(atom/movable/A, direction, turf/source)
if(direction == DOWN)
for(var/obj/O in contents)
if(O.obj_flags & BLOCK_Z_IN_DOWN)
return FALSE
return TRUE
return FALSE
//direction is direction of travel of A
/turf/open/zPassOut(atom/movable/A, direction, turf/destination)
if(direction == UP)
for(var/obj/O in contents)
if(O.obj_flags & BLOCK_Z_OUT_UP)
return FALSE
return TRUE
return FALSE
//direction is direction of travel of air
/turf/open/zAirIn(direction, turf/source)
return (direction == DOWN)
//direction is direction of travel of air
/turf/open/zAirOut(direction, turf/source)
return (direction == UP)
/turf/open/indestructible
name = "floor"
icon = 'icons/turf/floors.dmi'
icon_state = "floor"
footstep = FOOTSTEP_FLOOR
barefootstep = FOOTSTEP_HARD_BAREFOOT
clawfootstep = FOOTSTEP_HARD_CLAW
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
tiled_dirt = TRUE
/turf/open/indestructible/Melt()
to_be_destroyed = FALSE
return src
/turf/open/indestructible/singularity_act()
return
/turf/open/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE)
return
/turf/open/indestructible/sound
name = "squeaky floor"
footstep = null
barefootstep = null
clawfootstep = null
heavyfootstep = null
var/sound
/turf/open/indestructible/sound/Entered(atom/movable/AM)
..()
if(ismob(AM))
playsound(src,sound,50,TRUE)
/turf/open/indestructible/necropolis
name = "necropolis floor"
desc = "It's regarding you suspiciously."
icon = 'icons/turf/floors.dmi'
icon_state = "necro1"
baseturfs = /turf/open/indestructible/necropolis
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
footstep = FOOTSTEP_LAVA
barefootstep = FOOTSTEP_LAVA
clawfootstep = FOOTSTEP_LAVA
heavyfootstep = FOOTSTEP_LAVA
tiled_dirt = FALSE
/turf/open/indestructible/necropolis/Initialize()
. = ..()
if(prob(12))
icon_state = "necro[rand(2,3)]"
/turf/open/indestructible/necropolis/air
initial_gas_mix = OPENTURF_DEFAULT_ATMOS
/turf/open/indestructible/boss //you put stone tiles on this and use it as a base
name = "necropolis floor"
icon = 'icons/turf/boss_floors.dmi'
icon_state = "boss"
baseturfs = /turf/open/indestructible/boss
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
/turf/open/indestructible/boss/air
initial_gas_mix = OPENTURF_DEFAULT_ATMOS
/turf/open/indestructible/hierophant
icon = 'icons/turf/floors/hierophant_floor.dmi'
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
baseturfs = /turf/open/indestructible/hierophant
smoothing_flags = SMOOTH_CORNERS
tiled_dirt = FALSE
/turf/open/indestructible/hierophant/two
/turf/open/indestructible/hierophant/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
return FALSE
/turf/open/indestructible/paper
name = "notebook floor"
desc = "A floor made of invulnerable notebook paper."
icon_state = "paperfloor"
footstep = null
barefootstep = null
clawfootstep = null
heavyfootstep = null
tiled_dirt = FALSE
/turf/open/indestructible/binary
name = "tear in the fabric of reality"
CanAtmosPass = ATMOS_PASS_NO
baseturfs = /turf/open/indestructible/binary
icon_state = "binary"
footstep = null
barefootstep = null
clawfootstep = null
heavyfootstep = null
/turf/open/indestructible/airblock
icon_state = "bluespace"
blocks_air = TRUE
baseturfs = /turf/open/indestructible/airblock
/turf/open/Initalize_Atmos(times_fired)
set_excited(FALSE)
update_visuals()
current_cycle = times_fired
ImmediateCalculateAdjacentTurfs()
for(var/i in atmos_adjacent_turfs)
var/turf/open/enemy_tile = i
var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
if(!get_excited() && air.compare(enemy_air))
//testing("Active turf found. Return value of compare(): [is_active]")
set_excited(TRUE)
SSair.active_turfs |= src
/turf/open/proc/GetHeatCapacity()
. = air.heat_capacity()
/turf/open/proc/GetTemperature()
. = air.return_temperature()
/turf/open/proc/TakeTemperature(temp)
air.set_temperature(air.return_temperature() + temp)
air_update_turf()
/turf/open/proc/freon_gas_act()
for(var/obj/I in contents)
if(I.resistance_flags & FREEZE_PROOF)
continue
if(!(I.obj_flags & FROZEN))
I.make_frozen_visual()
for(var/mob/living/L in contents)
if(L.bodytemperature <= 50)
L.apply_status_effect(/datum/status_effect/freon)
MakeSlippery(TURF_WET_PERMAFROST, 50)
return TRUE
/turf/open/proc/water_vapor_gas_act()
MakeSlippery(TURF_WET_WATER, min_wet_time = 100, wet_time_to_add = 50)
for(var/mob/living/simple_animal/slime/M in src)
M.apply_water()
wash(CLEAN_WASH)
for(var/am in src)
var/atom/movable/movable_content = am
if(ismopable(movable_content)) // Will have already been washed by the wash call above at this point.
continue
movable_content.wash(CLEAN_WASH)
return TRUE
/turf/open/handle_slip(mob/living/carbon/C, knockdown_amount, obj/O, lube, paralyze_amount, force_drop)
if(C.movement_type & FLYING)
return 0
if(has_gravity(src))
var/obj/buckled_obj
if(C.buckled)
buckled_obj = C.buckled
if(!(lube&GALOSHES_DONT_HELP)) //can't slip while buckled unless it's lube.
return 0
else
if(!(lube & SLIP_WHEN_CRAWLING) && (C.body_position == LYING_DOWN || !(C.status_flags & CANKNOCKDOWN))) // can't slip unbuckled mob if they're lying or can't fall.
return FALSE
if(C.m_intent == MOVE_INTENT_WALK && (lube&NO_SLIP_WHEN_WALKING))
return 0
if(!(lube&SLIDE_ICE))
to_chat(C, "<span class='notice'>You slipped[ O ? " on the [O.name]" : ""]!</span>")
playsound(C.loc, 'sound/misc/slip.ogg', 50, TRUE, -3)
SEND_SIGNAL(C, COMSIG_ADD_MOOD_EVENT, "slipped", /datum/mood_event/slipped)
if(force_drop)
for(var/obj/item/I in C.held_items)
C.accident(I)
var/olddir = C.dir
C.moving_diagonally = 0 //If this was part of diagonal move slipping will stop it.
if(!(lube & SLIDE_ICE))
C.Knockdown(knockdown_amount)
C.Paralyze(paralyze_amount)
C.stop_pulling()
else
C.Knockdown(20)
if(buckled_obj)
buckled_obj.unbuckle_mob(C)
lube |= SLIDE_ICE
if(lube&SLIDE)
new /datum/forced_movement(C, get_ranged_target_turf(C, olddir, 4), 1, FALSE, CALLBACK(C, /mob/living/carbon/.proc/spin, 1, 1))
else if(lube&SLIDE_ICE)
if(C.force_moving) //If we're already slipping extend it
qdel(C.force_moving)
new /datum/forced_movement(C, get_ranged_target_turf(C, olddir, 1), 1, FALSE) //spinning would be bad for ice, fucks up the next dir
return 1
/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER, min_wet_time = 0, wet_time_to_add = 0, max_wet_time = MAXIMUM_WET_TIME, permanent)
AddComponent(/datum/component/wet_floor, wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
/turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER, immediate = FALSE, amount = INFINITY)
SEND_SIGNAL(src, COMSIG_TURF_MAKE_DRY, wet_setting, immediate, amount)
/turf/open/get_dumping_location()
return src
/turf/open/proc/ClearWet()//Nuclear option of immediately removing slipperyness from the tile instead of the natural drying over time
qdel(GetComponent(/datum/component/wet_floor))
/turf/open/rad_act(pulse_strength)
. = ..()
if (air.get_moles(/datum/gas/carbon_dioxide) && air.get_moles(/datum/gas/oxygen))
pulse_strength = min(pulse_strength,air.get_moles(/datum/gas/carbon_dioxide)*1000,air.get_moles(/datum/gas/oxygen)*2000) //Ensures matter is conserved properly
air.set_moles(/datum/gas/carbon_dioxide, max(air.get_moles(/datum/gas/carbon_dioxide)-(pulse_strength/1000),0))
air.set_moles(/datum/gas/oxygen, max(air.get_moles(/datum/gas/oxygen)-(pulse_strength/2000),0))
air.adjust_moles(/datum/gas/pluoxium, pulse_strength/4000)