forked from vgstation-coders/vgstation13
-
Notifications
You must be signed in to change notification settings - Fork 0
/
floor.dm
707 lines (640 loc) · 21.6 KB
/
floor.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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
//This is so damaged or burnt tiles or platings don't get remembered as the default tile
var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
"damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
"platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
"light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
"light_on_broken","light_off","wall_thermite","grass1","grass2","grass3","grass4",
"asteroid","asteroid_dug",
"asteroid0","asteroid1","asteroid2","asteroid3","asteroid4",
"asteroid5","asteroid6","asteroid7","asteroid8","asteroid9","asteroid10","asteroid11","asteroid12",
"oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", "wood-broken2", "wood-broken3", "wood-broken4", "wood-broken5", "wood-broken6", "wood-broken7", "carpet",
"carpetcorner", "carpetside", "carpet", "arcade", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5",
"ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11",
"ironsand12", "ironsand13", "ironsand14", "ironsand15")
var/list/plating_icons = list("plating","platingdmg1","platingdmg2","platingdmg3","asteroid","asteroid_dug",
"ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5", "ironsand6", "ironsand7",
"ironsand8", "ironsand9", "ironsand10", "ironsand11",
"ironsand12", "ironsand13", "ironsand14", "ironsand15")
var/list/wood_icons = list("wood","wood-broken")
var/image/list/w_overlays = list("wet" = image('icons/effects/water.dmi',icon_state = "wet_floor"))
/turf/simulated/floor
//Note to coders, the 'intact' var can no longer be used to determine if the floor is a plating or not.
//Use the is_plating(), is_plasteel_floor() and is_light_floor() procs instead. --Errorage
name = "floor"
icon = 'icons/turf/floors.dmi'
icon_state = "floor"
var/icon_regular_floor = "floor" //used to remember what icon the tile should have by default
var/icon_plating = "plating"
thermal_conductivity = 0.040
heat_capacity = 10000
var/lava = 0
var/broken = 0
var/burnt = 0
var/material = "metal"
var/spam_flag = 0 //For certain interactions, like bananium floors honking when stepped on
var/obj/item/stack/tile/floor_tile
var/image/floor_overlay
melt_temperature = 1643.15 // Melting point of steel
plane = TURF_PLANE
/turf/simulated/floor/New()
..()
if(!floor_tile)
floor_tile = getFromPool(/obj/item/stack/tile/plasteel, null)
floor_tile.amount = 1
if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
icon_regular_floor = "floor"
else
icon_regular_floor = icon_state
/turf/simulated/floor/ashify()
burn_tile()
/turf/simulated/floor/melt() // Melting is different.
burn_tile()
//turf/simulated/floor/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
// if ((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
// if (!( locate(/obj/machinery/mass_driver, src) ))
// return 0
// return ..()
/turf/simulated/floor/ex_act(severity)
//set src in oview(1)
switch(severity)
if(1.0)
src.ChangeTurf(get_underlying_turf())
if(2.0)
switch(pick(1,2;75,3))
if (1)
src.ReplaceWithLattice()
if(prob(33))
var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, get_turf(src))
M.amount = 1
if(2)
src.ChangeTurf(get_underlying_turf())
if(3)
if(prob(80))
src.break_tile_to_plating()
else
src.break_tile()
src.hotspot_expose(1000,CELL_VOLUME,surfaces=1)
if(prob(33))
var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, get_turf(src))
M.amount = 1
if(3.0)
if (prob(50))
src.break_tile()
src.hotspot_expose(1000,CELL_VOLUME,surfaces=1)
return
/turf/simulated/floor/blob_act()
return
/turf/simulated/floor/add_dust()
if(!(locate(/obj/effect/decal/cleanable/dirt) in contents))
getFromPool(/obj/effect/decal/cleanable/dirt,src)
turf/simulated/floor/update_icon()
overlays -= floor_overlay
if(lava)
return
else if(is_plasteel_floor())
if(!broken && !burnt)
icon_state = icon_regular_floor
else if(is_plating())
if(!broken && !burnt)
icon_state = icon_plating //Because asteroids are 'platings' too.
else if(is_slime_floor())
icon_state = "tile-slime"
else if(is_light_floor())
var/obj/item/stack/tile/light/T = floor_tile
if(T.on)
set_light(5)
floor_overlay = T.get_turf_image()
icon_state = "light_base"
overlays += floor_overlay
light_color = floor_overlay.color
else
set_light(0)
icon_state = "light_off"
else if(is_grass_floor())
if(!broken && !burnt)
if(!(icon_state in list("grass1","grass2","grass3","grass4")))
icon_state = "grass[pick("1","2","3","4")]"
else if(is_carpet_floor())
if(!broken && !burnt)
var/connectdir = 0
for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
if(FF.is_carpet_floor())
connectdir |= direction
//Check the diagonal connections for corners, where you have, for example, connections both north and east. In this case it checks for a north-east connection to determine whether to add a corner marker or not.
var/diagonalconnect = 0 //1 = NE; 2 = SE; 4 = NW; 8 = SW
//Northeast
if(connectdir & NORTH && connectdir & EAST)
if(istype(get_step(src,NORTHEAST),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,NORTHEAST)
if(FF.is_carpet_floor())
diagonalconnect |= 1
//Southeast
if(connectdir & SOUTH && connectdir & EAST)
if(istype(get_step(src,SOUTHEAST),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,SOUTHEAST)
if(FF.is_carpet_floor())
diagonalconnect |= 2
//Northwest
if(connectdir & NORTH && connectdir & WEST)
if(istype(get_step(src,NORTHWEST),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,NORTHWEST)
if(FF.is_carpet_floor())
diagonalconnect |= 4
//Southwest
if(connectdir & SOUTH && connectdir & WEST)
if(istype(get_step(src,SOUTHWEST),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,SOUTHWEST)
if(FF.is_carpet_floor())
diagonalconnect |= 8
icon_state = "carpet[connectdir]-[diagonalconnect]"
else if(is_arcade_floor())
if(!broken && !burnt)
icon_state = "arcade"
else if(is_wood_floor())
if(!broken && !burnt)
if( !(icon_state in wood_icons) )
icon_state = "wood"
// to_chat(world, "[icon_state]y's got [icon_state]")
else if(is_mineral_floor())
if(!broken && !burnt)
icon_state = floor_tile.material
/*spawn(1)
if(istype(src,/turf/simulated/floor)) //Was throwing runtime errors due to a chance of it changing to space halfway through.
if(air)
update_visuals(air)*/
/turf/simulated/floor/return_siding_icon_state()
..()
if(is_grass_floor())
var/dir_sum = 0
for(var/direction in cardinal)
var/turf/T = get_step(src,direction)
if(!(T.is_grass_floor()))
dir_sum += direction
if(dir_sum)
return "wood_siding[dir_sum]"
else
return 0
/turf/simulated/floor/attack_paw(mob/user as mob)
return src.attack_hand(user)
/turf/simulated/floor/attack_hand(mob/user as mob)
if (is_light_floor())
var/obj/item/stack/tile/light/T = floor_tile
T.on = !T.on
update_icon()
switch(material)
if("bananium")
if(!spam_flag)
spam_flag = 1
playsound(get_turf(src), 'sound/items/bikehorn.ogg', 50, 1)
spawn(20)
spam_flag = 0
..()
/turf/simulated/floor/proc/gets_drilled()
return
/turf/simulated/floor/proc/break_tile_to_plating()
if(!is_plating())
make_plating()
break_tile()
/turf/simulated/floor/is_plasteel_floor()
if(istype(floor_tile,/obj/item/stack/tile/plasteel))
return 1
else
return 0
/turf/simulated/floor/is_light_floor()
if(istype(floor_tile,/obj/item/stack/tile/light))
return 1
else
return 0
/turf/simulated/floor/is_grass_floor()
if(istype(floor_tile,/obj/item/stack/tile/grass))
return 1
else
return 0
/turf/simulated/floor/is_wood_floor()
if(istype(floor_tile,/obj/item/stack/tile/wood))
return 1
else
return 0
/turf/simulated/floor/is_carpet_floor()
if(istype(floor_tile,/obj/item/stack/tile/carpet))
return 1
else
return 0
/turf/simulated/floor/is_arcade_floor()
if(istype(floor_tile,/obj/item/stack/tile/arcade))
return 1
return 0
/turf/simulated/floor/is_slime_floor()
if(istype(floor_tile,/obj/item/stack/tile/slime))
return 1
else
return 0
/turf/simulated/floor/is_plating()
if(!floor_tile)
return 1
return 0
/turf/simulated/floor/is_mineral_floor()
if(istype(floor_tile,/obj/item/stack/tile/mineral))
return 1
return 0
/turf/simulated/floor/proc/break_tile()
if(istype(src,/turf/simulated/floor/engine))
return
if(broken)
return
if(is_plasteel_floor())
src.icon_state = "damaged[pick(1,2,3,4,5)]"
broken = 1
else if(is_light_floor())
src.icon_state = "light_broken"
broken = 1
else if(is_plating())
src.icon_state = "platingdmg[pick(1,2,3)]"
broken = 1
else if(is_wood_floor())
src.icon_state = "wood-broken"
broken = 1
else if((is_carpet_floor()) || (is_arcade_floor()))
src.icon_state = "carpet-broken"
broken = 1
else if(is_grass_floor())
src.icon_state = "sand[pick("1","2","3")]"
broken = 1
else if(is_slime_floor())
spawn(rand(2,10))
make_plating()
return //slime burns up or completely loses form
else if(is_mineral_floor())
if(material=="diamond")
return //diamond doesn't break
if(material=="plastic")
return //you can't break legos
if(material=="phazon") //Phazon shatters
spawn(rand(2,10))
playsound(get_turf(src), "shatter", 70, 1)
make_plating()
return
src.icon_state = "[material]_broken"
/turf/simulated/floor/proc/burn_tile()
if(istype(src,/turf/simulated/floor/engine))
return
if(istype(src,/turf/unsimulated/floor/asteroid))
return//Asteroid tiles don't burn
if(is_plasteel_floor())
src.icon_state = "damaged[pick(1,2,3,4,5)]"
burnt = 1
else if(is_plasteel_floor())
src.icon_state = "floorscorched[pick(1,2)]"
burnt = 1
else if(is_plating())
src.icon_state = "panelscorched"
burnt = 1
else if(is_wood_floor())
src.icon_state = "wood-broken"
burnt = 1
else if((is_carpet_floor()) || (is_arcade_floor()))
src.icon_state = "carpet-broken"
burnt = 1
else if(is_grass_floor())
src.icon_state = "sand[pick("1","2","3")]"
burnt = 1
else if(is_mineral_floor())
burnt = 1
//This proc will delete the floor_tile and the update_iocn() proc will then change the icon_state of the turf
//This proc auto corrects the grass tiles' siding.
/turf/simulated/floor/proc/make_plating()
if(istype(src,/turf/simulated/floor/engine))
return
if(is_grass_floor())
for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly
else if(is_carpet_floor())
spawn(5)
if(src)
for(var/direction in alldirs)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly
if(floor_tile)
//qdel(floor_tile)
returnToPool(floor_tile)
icon_plating = "plating"
set_light(0)
floor_tile = null
intact = 0
broken = 0
burnt = 0
material = "metal"
plane = PLATING_PLANE
update_icon()
levelupdate()
//This proc will make the turf a plasteel floor tile. The expected argument is the tile to make the turf with
//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
//this proc.
/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/plasteel/T = null)
broken = 0
burnt = 0
intact = 1
plane = TURF_PLANE
set_light(0)
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
if(T)
if(istype(T,/obj/item/stack/tile/plasteel))
floor_tile = T
if (icon_regular_floor)
icon_state = icon_regular_floor
else
icon_state = "floor"
icon_regular_floor = icon_state
update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
floor_tile = getFromPool(/obj/item/stack/tile/plasteel, null)
icon_state = "floor"
icon_regular_floor = icon_state
update_icon()
levelupdate()
//This proc will make the turf a light floor tile. The expected argument is the tile to make the turf with
//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
//this proc.
/turf/simulated/floor/proc/make_light_floor(var/obj/item/stack/tile/light/T = null)
broken = 0
burnt = 0
intact = 1
plane = TURF_PLANE
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
if(T)
if(istype(T,/obj/item/stack/tile/light))
floor_tile = T
update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
floor_tile = getFromPool(/obj/item/stack/tile/light, null)
update_icon()
levelupdate()
//This proc will make a turf into a grass patch. Fun eh? Insert the grass tile to be used as the argument
//If no argument is given a new one will be made.
/turf/simulated/floor/proc/make_grass_floor(var/obj/item/stack/tile/grass/T = null)
broken = 0
burnt = 0
intact = 1
plane = TURF_PLANE
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
if(T)
if(istype(T,/obj/item/stack/tile/grass))
floor_tile = T
update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
floor_tile = getFromPool(/obj/item/stack/tile/wood, null)
update_icon()
levelupdate()
//This proc will make a turf into a wood floor. Fun eh? Insert the wood tile to be used as the argument
//If no argument is given a new one will be made.
/turf/simulated/floor/proc/make_wood_floor(var/obj/item/stack/tile/wood/T = null)
broken = 0
burnt = 0
intact = 1
plane = TURF_PLANE
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
if(T)
if(istype(T,/obj/item/stack/tile/wood))
floor_tile = T
update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
floor_tile = getFromPool(/obj/item/stack/tile/wood, null)
update_icon()
levelupdate()
//This proc will make a turf into a carpet floor. Fun eh? Insert the carpet tile to be used as the argument
//If no argument is given a new one will be made.
/turf/simulated/floor/proc/make_carpet_floor(var/obj/item/stack/tile/carpet/T = null)
broken = 0
burnt = 0
intact = 1
plane = TURF_PLANE
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
if(T)
if(istype(T,/obj/item/stack/tile/carpet))
floor_tile = T
update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
floor_tile = getFromPool(/obj/item/stack/tile/carpet, null)
update_icon()
levelupdate()
/turf/simulated/floor/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
if(prob(75))
if(floor_tile && !broken && !burnt)
floor_tile.forceMove(src)
floor_tile = null
make_plating()
return
if(current_size == STAGE_FOUR)
if(prob(30))
if(floor_tile && !broken && !burnt)
floor_tile.forceMove(src)
floor_tile = null
make_plating()
/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob)
if(!C || !user)
return 0
if(iscrowbar(C) && (!(is_plating())))
if (user.a_intent != I_HELP) //We assume the user is fighting
to_chat(user, "<span class='notice'>You swing the crowbar in front of you.</span>")
return
if(broken || burnt)
to_chat(user, "<span class='warning'>You remove the broken plating.</span>")
else
if(is_wood_floor())
to_chat(user, "<span class='warning'>You forcefully pry off the planks, destroying them in the process.</span>")
else
to_chat(user, "<span class='notice'>You remove the [floor_tile.name].</span>")
floor_tile.forceMove(src)
floor_tile = null
make_plating()
// Can't play sounds from areas. - N3X
playsound(src, 'sound/items/Crowbar.ogg', 80, 1)
return
else if(isscrewdriver(C))
if(is_wood_floor())
if(broken || burnt)
return
else
if(is_wood_floor())
to_chat(user, "<span class='notice'>You unscrew the planks.</span>")
new floor_tile.type(src)
make_plating()
playsound(src, 'sound/items/Screwdriver.ogg', 80, 1)
return
else if(istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
if (is_plating())
if (R.amount >= 2)
to_chat(user, "<span class='notice'>Reinforcing the floor...</span>")
if(do_after(user, src, 30) && R && R.amount >= 2 && is_plating())
ChangeTurf(/turf/simulated/floor/engine)
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
R.use(2)
return
else
to_chat(user, "<span class='warning'>You need more rods.</span>")
else
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
return
else if(istype(C, /obj/item/stack/tile))
if(is_plating())
if(!broken && !burnt)
var/obj/item/stack/tile/T = C
if(T.use(1))
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(T.type, null)
material = floor_tile.material
intact = 1
plane = TURF_PLANE
if(istype(T,/obj/item/stack/tile/light))
var/obj/item/stack/tile/light/L = T
var/obj/item/stack/tile/light/F = floor_tile
F.color_r = L.color_r
F.color_g = L.color_g
F.color_b = L.color_b
F.on = L.on
if(istype(T,/obj/item/stack/tile/grass))
for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding gets updated properly
else if(istype(T,/obj/item/stack/tile/carpet))
for(var/direction in alldirs)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding gets updated properly
update_icon()
levelupdate()
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
else
to_chat(user, "<span class='warning'>This section is too damaged to support a tile. Use a welder to fix the damage.</span>")
else if(istype(C, /obj/item/stack/cable_coil))
if(is_plating())
var/obj/item/stack/cable_coil/coil = C
coil.turf_place(src, user)
else
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
else if(istype(C, /obj/item/weapon/pickaxe/shovel))
if(is_grass_floor())
playsound(src, 'sound/items/shovel.ogg', 50, 1)
new /obj/item/weapon/ore/glass(src)
new /obj/item/weapon/ore/glass(src) //Make some sand if you shovel grass
to_chat(user, "<span class='notice'>You shovel the grass.</span>")
if(prob(10))
var/to_spawn = pick(
/obj/item/seeds/carrotseed,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/seeds/potatoseed,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
/obj/item/seeds/whitebeetseed,
/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet,)
new to_spawn(src)
to_chat(user, "<span class='notice'>Something falls out of the grass!</span>")
make_plating()
else
to_chat(user, "<span class='warning'>You cannot shovel this.</span>")
else if(iswelder(C))
var/obj/item/weapon/weldingtool/welder = C
if(welder.isOn() && (is_plating()))
if(broken || burnt)
if(welder.remove_fuel(0,user))
to_chat(user, "<span class='warning'>You fix some dents on the broken plating.</span>")
playsound(src, 'sound/items/Welder.ogg', 80, 1)
icon_state = "plating"
burnt = 0
broken = 0
else
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
/turf/simulated/floor/Enter(mob/AM)
.=..()
if(AM && istype(AM,/mob/living))
switch(material)
if("bananium")
if(!spam_flag)
spam_flag = 1
playsound(get_turf(src), "clownstep", 50, 1)
spawn(20)
spam_flag = 0
if("uranium")
if(!spam_flag)
spam_flag = 1
set_light(3)
icon_state = "uranium_inactive"
for(var/mob/living/L in range(2,src)) //Weak radiation
L.apply_effect(3,IRRADIATE,0)
flick("uranium_active",src)
spawn(20)
set_light(0)
spawn(200)
spam_flag = 0
update_icon()
/turf/simulated/proc/wet(delay = 800, slipperiness = TURF_WET_WATER)
if(wet >= slipperiness)
return
wet = slipperiness
if(wet_overlay)
overlays -= wet_overlay
wet_overlay = null
wet_overlay = w_overlays["wet"]
overlays += wet_overlay
spawn(delay)
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
dry(slipperiness)
/turf/simulated/proc/dry(slipperiness = TURF_WET_WATER)
if(wet > slipperiness)
return
wet = TURF_DRY
if(wet_overlay)
overlays -= wet_overlay
wet_overlay = null
/turf/simulated/floor/attack_construct(mob/user as mob)
if(istype(src,/turf/simulated/floor/carpet))
return//carpets are cool
if(istype(user,/mob/living/simple_animal/construct/builder))
if((icon_state != "cult")&&(icon_state != "cult-narsie"))
var/spell/aoe_turf/conjure/floor/S = locate() in user.spell_list
S.perform(user, 0, list(src))
//var/obj/abstract/screen/spell/SS = S.connected_button
//SS.update_charge(1)
return 1
return 0
/turf/simulated/floor/cultify()
if((icon_state != "cult")&&(icon_state != "cult-narsie"))
name = "engraved floor"
icon_state = "cult"
turf_animation('icons/effects/effects.dmi',"cultfloor",0,0,MOB_LAYER-1,anim_plane = OBJ_PLANE)
return
/turf/simulated/floor/adjust_slowdown(mob/living/L, current_slowdown)
//Phazon floors make movement instant
if(floor_tile)
return floor_tile.adjust_slowdown(L, current_slowdown)
return ..()