-
Notifications
You must be signed in to change notification settings - Fork 3
/
turfs.dm
439 lines (364 loc) · 13.2 KB
/
turfs.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
//Dirt!
/turf/simulated/floor/dirty
name = "dirt" //"snowy dirt"
icon = 'icons/turf/dirt.dmi'
icon_state = "dirt1"
movement_delay = 0.1
atom_flags = ATOM_FLAG_CLIMBABLE
has_coldbreath = FALSE // No more freezing to death indoors.
var/has_light = FALSE
var/can_generate_water = FALSE // NO MORE RNG WATER> PLACE THE TILES YOURSELF YOU LAZY MAPPERS
var/can_be_dug = TRUE
/turf/simulated/floor/dirty/fake
desc = "This dirt isn't climbable"
atom_flags = null
can_generate_water = FALSE
can_be_dug = TRUE
/turf/simulated/floor/dirty/tough //this is meant to be the default undiggiable. You can dig it for now though
name = "tough dirt"
desc = "This dirt may or may not be diggable"
can_be_dug = TRUE
/turf/simulated/floor/dirty/tough/lightless
can_be_dug = TRUE
has_light = FALSE
/turf/simulated/floor/dirty/tough/fake //Can't be click dragged on.
desc = "This dirt isn't climbable"
atom_flags = null
/turf/simulated/floor/dirty/tough/lightless/fake
atom_flags = null
/turf/simulated/floor/dirty/tough/ex_act(severity)//Can't be blown up.
return
/turf/simulated/floor/dirty/CanPass(atom/movable/mover, turf/target)
if(ishuman(mover))
if(istype(get_turf(mover), /turf/simulated/floor/trench))
if(!mover.pulledby)
return FALSE
return TRUE
/turf/simulated/floor/dirty/can_climb(var/mob/living/user, post_climb_check=0)
if (!(atom_flags & ATOM_FLAG_CLIMBABLE) || !can_touch(user))
return FALSE
if (!user.Adjacent(src))
to_chat(user, "<span class='danger'>You can't climb there, the way is blocked.</span>")
return FALSE
return TRUE
/turf/simulated/floor/dirty/do_climb(var/mob/living/user)
if(!can_climb(user))
return
/*
if(istype(get_area(src), /area/warfare/battlefield/no_mans_land))//We're trying to go into no man's land?
if(locate(/obj/item/device/boombox) in user)//Locate the boombox.
to_chat(user, "I can't bring this with me onto the battlefield. Wouldn't want to lose it.")//No you fucking don't.
return //Keep that boombox at base asshole.
if(locate(/obj/item/storage) in user)//Gotta check storage as well.
var/obj/item/storage/S = locate() in user
if(locate(/obj/item/device/boombox) in S)
to_chat(user, "I can't bring this with me onto the battlefield. Wouldn't want to lose it.")
return
*/
user.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user
if(!can_climb(user))
climbers -= user
return
if(!do_after(user,15))
climbers -= user
return
user.forceMove(get_turf(src))
user.visible_message("<span class='warning'>[user] climbed onto \the [src]!</span>")
climbers -= user
/turf/simulated/floor/dirty/MouseDrop_T(mob/target, mob/user)
var/mob/living/H = user
if(istype(H) && can_climb(H) && target == user)
do_climb(target)
else
return ..()
/turf/simulated/floor/dirty/indestructable/snow
name = "snow"
icon = 'icons/turf/snow.dmi'
icon_state = "snow"
/turf/simulated/floor/dirty/indestructable/snow/New()
icon_state = pick("snow[rand(1,12)]","snow0")
..()
/turf/simulated/floor/dirty/New()
..()
temperature = T0C - 60
//icon_state = pick("snow[rand(1,12)]","snow0")
dir = pick(GLOB.alldirs)
if(!(locate(/obj/effect/lighting_dummy/daylight) in src) && has_light)
new /obj/effect/lighting_dummy/daylight(src)
spawn(1)
overlays.Cut()
if(loc.type != /area/warfare/battlefield/no_mans_land) // no base puddles
return
if(!can_generate_water)//This type can't generate water so don't bother.
return
/turf/simulated/floor/dirty/attackby(obj/O as obj, mob/living/user as mob)
if(istype(O, /obj/item/shovel))
if(!user.doing_something)
user.doing_something = TRUE
if(src.density)
user.doing_something = FALSE
return
for(var/obj/structure/object in contents)
if(object)
to_chat(user, "There are things in the way.")
user.doing_something = FALSE
return
playsound(src, 'sound/effects/dig_shovel.ogg', 50, 0)
visible_message("[user] begins to dig some dirt cover!")
if(do_after(user, (backwards_skill_scale(user.SKILL_LEVEL(engineering)) * 10)))
new /obj/structure/dirt_wall(src)
visible_message("[user] finishes digging the dirt cover.")
playsound(src, 'sound/effects/empty_shovel.ogg', 50, 0)
user.doing_something = FALSE
else
to_chat(user, "You're already digging.")
/turf/simulated/floor/dirty/RightClick(mob/living/user)
if(!CanPhysicallyInteract(user))
return
var/obj/item/shovel/S = user.get_active_hand()
if(!istype(S))
return
if(!can_be_dug)//No escaping to mid early.
return
if(!user.doing_something)
user.doing_something = TRUE
if(src.density)
user.doing_something = FALSE
return
for(var/obj/structure/object in contents)
if(object)
to_chat(user, "There are things in the way.")
user.doing_something = FALSE
return
playsound(src, 'sound/effects/dig_shovel.ogg', 50, 0)
visible_message("[user] begins to dig a trench!")
if(do_after(user, backwards_skill_scale(user.SKILL_LEVEL(engineering)) * 10))
ChangeTurf(/turf/simulated/floor/trench)
visible_message("[user] finishes digging the trench.")
playsound(src, 'sound/effects/empty_shovel.ogg', 50, 0)
user.doing_something = FALSE
user.doing_something = FALSE
else
to_chat(user, "You're already digging.")
/turf/simulated/floor/snow/RightClick(mob/living/user)
if(!CanPhysicallyInteract(user))
return
var/obj/item/shovel/S = user.get_active_hand()
if(!istype(S))
return
if(!can_be_dug)//No escaping to mid early.
return
if(!user.doing_something)
user.doing_something = TRUE
if(src.density)
user.doing_something = FALSE
return
for(var/obj/structure/object in contents)
if(object)
to_chat(user, "There are things in the way.")
user.doing_something = FALSE
return
playsound(src, 'sound/effects/dig_shovel.ogg', 50, 0)
visible_message("[user] begins to dig a trench!")
if(do_after(user, backwards_skill_scale(user.SKILL_LEVEL(engineering)) * 10))
ChangeTurf(/turf/simulated/floor/trench)
visible_message("[user] finishes digging the trench.")
playsound(src, 'sound/effects/empty_shovel.ogg', 50, 0)
user.doing_something = FALSE
user.doing_something = FALSE
else
to_chat(user, "You're already digging.")
/turf/simulated/floor/snow/attackby(obj/O as obj, mob/living/user as mob)
if(istype(O, /obj/item/shovel))
if(!user.doing_something)
user.doing_something = TRUE
if(src.density)
user.doing_something = FALSE
return
for(var/obj/structure/object in contents)
if(object)
to_chat(user, "There are things in the way.")
user.doing_something = FALSE
return
playsound(src, 'sound/effects/dig_shovel.ogg', 50, 0)
visible_message("[user] begins to dig a grave!")
if(do_after(user, (backwards_skill_scale(user.SKILL_LEVEL(engineering)) * 10)))
new /obj/structure/closet/pit(src)
visible_message("[user] finishes digging the grave!")
playsound(src, 'sound/effects/empty_shovel.ogg', 50, 0)
user.doing_something = FALSE
else
to_chat(user, "You're already digging.")
/turf/simulated/floor/dirty/update_dirt()
return // Dirt doesn't doesn't become dirty
/turf/simulated/floor/dirty/indestructable
desc = "This dirt seems tougher than most other dirts."
/turf/simulated/floor/dirty/indestructable/mud
name = "mud"
desc = "This mud looks tougher than most other muds."
icon_state = "mud"
movement_delay = 0.1
/turf/simulated/floor/dirty/indestructable/mud/New()
dir = pick(GLOB.alldirs)
..()
/turf/simulated/floor/dirty/indestructable/ex_act(severity)//Can't be blown up.
return
/turf/simulated/floor/dirty/indestructable/lightless
has_light = FALSE
/turf/simulated/floor/dirty/indestructable/lightless/has_trees
/////////
//WATER//
/////////
/turf/simulated/floor/exoplanet/water/shallow
name = "water"
icon = 'icons/turf/dirt.dmi'//This appears under the water.
icon_state = "mud"
movement_delay = 2
mudpit = 1
has_coldbreath = TRUE
var/has_light = TRUE
atom_flags = ATOM_FLAG_CLIMBABLE
/turf/simulated/floor/exoplanet/water/shallow/update_dirt()
return
/turf/simulated/floor/exoplanet/water/shallow/ex_act(severity)
return
/turf/simulated/floor/exoplanet/water/shallow/CanPass(atom/movable/mover, turf/target)
if(ishuman(mover))
if(istype(get_turf(mover), /turf/simulated/floor/trench))
if(!mover.pulledby)
return FALSE
return TRUE
/turf/simulated/floor/exoplanet/water/shallow/can_climb(var/mob/living/user, post_climb_check=0)
if (!(atom_flags & ATOM_FLAG_CLIMBABLE) || !can_touch(user))
return FALSE
if (!user.Adjacent(src))
to_chat(user, "<span class='danger'>You can't climb there, the way is blocked.</span>")
return FALSE
return TRUE
/turf/simulated/floor/exoplanet/water/shallow/do_climb(var/mob/living/user)
if(!can_climb(user))
return
user.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user
if(!can_climb(user))
climbers -= user
return
if(!do_after(user,15))
climbers -= user
return
user.forceMove(get_turf(src))
user.visible_message("<span class='warning'>[user] climbed onto \the [src]!</span>")
climbers -= user
/turf/simulated/floor/exoplanet/water/shallow/MouseDrop_T(mob/target, mob/user)
var/mob/living/H = user
if(istype(H) && can_climb(H) && target == user)
if(istype(get_area(src), /area/warfare/battlefield/no_mans_land))//We're trying to go into no man's land?
if(locate(/obj/item/device/boombox) in user)//Locate the boombox.
to_chat(user, "I can't bring this with me onto the battlefield. Wouldn't want to lose it.")//No you fucking don't.
return //Keep that boombox at base asshole.
if(locate(/obj/item/storage) in user)//Gotta check storage as well.
var/obj/item/storage/S = locate() in user
if(locate(/obj/item/device/boombox) in S)
to_chat(user, "I can't bring this with me onto the battlefield. Wouldn't want to lose it.")
return
do_climb(target)
else
return ..()
/turf/simulated/floor/exoplanet/water/shallow/Cross(var/atom/A)//People who are on fire go out.
if(isliving(A))
var/mob/living/L = A
L.ExtinguishMob()
/turf/simulated/floor/exoplanet/water/shallow/lightless
has_light = FALSE
/turf/simulated/floor/exoplanet/water/shallow/New()
..()
if((!locate(/obj/effect/lighting_dummy/daylight) in src) && has_light)
new /obj/effect/lighting_dummy/daylight(src)
temperature = T0C - 80
for(var/obj/effect/water/bottom/B in src)
if(B)
qdel(B)
for(var/obj/effect/water/top/T in src)
if(T)
qdel(T)
new /obj/effect/water/bottom(src)//Put it right on top of the water so that they look like they're the same.
new /obj/effect/water/top(src)
spawn(5)
update_icon()
for(var/turf/simulated/floor/exoplanet/water/shallow/T in range(1))
T.update_icon()
/turf/simulated/floor/exoplanet/water/shallow/update_icon()
overlays.Cut()
for(var/direction in GLOB.cardinal)
var/turf/turf_to_check = get_step(src,direction)
if(istype(turf_to_check, /turf/simulated/floor/exoplanet/water/shallow))
continue
else if(istype(turf_to_check, /turf/simulated))
var/image/water_side = image('icons/obj/warfare.dmi', "over_water1", dir = direction)//turn(direction, 180))
water_side.plane = EFFECTS_BELOW_LIGHTING_PLANE
overlays += water_side
var/image/wave_overlay = image('icons/obj/warfare.dmi', "waves")
overlays += wave_overlay
/turf/simulated/floor/exoplanet/water/shallow/Destroy()
. = ..()
for(var/obj/effect/water/bottom/B in src)
qdel(B)
for(var/obj/effect/water/top/T in src)
qdel(T)
/turf/simulated/floor/exoplanet/water/shallow/attackby(obj/item/O, mob/user)
if(istype(O, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RG = O
if (istype(RG) && RG.is_open_container())
RG.reagents.add_reagent(/datum/reagent/water, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
user.visible_message("<span class='notice'>[user] fills \the [RG] using \the [src].</span>","<span class='notice'>You fill \the [RG] using \the [src].</span>")
return 1
if (istype(O, /obj/item/stack/duckboard))
var/obj/item/stack/duckboard/S = O
if (S.get_amount() < 1)
return
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
S.use(1)
ChangeTurf(/turf/simulated/floor/trenches)
return
/turf/simulated/floor/exoplanet/water/shallow/ChangeTurf(turf/N, tell_universe, force_lighting_update)
var/obj/effect/water/top/T = locate() in loc
if(T)
qdel(T)
var/obj/effect/water/bottom/B = locate() in loc
if(B)
qdel(B)
. = ..()
for(var/turf/simulated/floor/exoplanet/water/shallow/S in range(1))
S.update_icon()
/obj/effect/water/top//This one appears over objects but under mobs.
name = "water"
icon = 'icons/obj/warfare.dmi'
icon_state = "trench_water_top"
plane = ABOVE_OBJ_PLANE
layer = ABOVE_OBJ_LAYER
density = FALSE
anchored = TRUE
mouse_opacity = FALSE
/obj/effect/water/bottom//This one appears over mobs.
name = "water"
icon = 'icons/obj/warfare.dmi'
icon_state = "trench_water_bottom"
plane = ABOVE_HUMAN_PLANE
layer = ABOVE_HUMAN_LAYER
density = FALSE
anchored = TRUE
mouse_opacity = FALSE//Don't want this being clicked.
/turf/simulated/floor/exoplanet/water/update_dirt()
return // Water doesn't become dirty
/obj/item/stack/duckboard
name = "duckboards"
singular_name = "duckboard"
w_class = 1
force = 0
throwforce = 0
max_amount = 20
gender = PLURAL
desc = "For building over water."
icon = 'icons/turf/trenches_turfs.dmi'
icon_state = "wood0"