-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathchasm.dm
138 lines (120 loc) · 4.94 KB
/
chasm.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
// Base chasm, defaults to oblivion but can be overridden
/turf/open/chasm
name = "chasm"
desc = "Watch your step."
baseturfs = /turf/open/chasm
icon = 'icons/turf/floors/chasms.dmi'
icon_state = "chasms-255"
base_icon_state = "chasms"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER
smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_TURF_CHASM
canSmoothWith = SMOOTH_GROUP_TURF_CHASM
density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf
bullet_bounce_sound = null //abandon all hope ye who enter
/turf/open/chasm/Initialize(mapload)
. = ..()
apply_components(mapload)
/// Handles adding the chasm component to the turf (So stuff falls into it!)
/turf/open/chasm/proc/apply_components(mapload)
AddComponent(/datum/component/chasm, GET_TURF_BELOW(src), mapload)
/// Lets people walk into chasms.
/turf/open/chasm/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
return TRUE
/turf/open/chasm/proc/set_target(turf/target)
var/datum/component/chasm/chasm_component = GetComponent(/datum/component/chasm)
chasm_component.target_turf = target
/turf/open/chasm/proc/drop(atom/movable/AM)
var/datum/component/chasm/chasm_component = GetComponent(/datum/component/chasm)
chasm_component.drop(AM)
/turf/open/chasm/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
return
/turf/open/chasm/MakeDry()
return
/turf/open/chasm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
switch(the_rcd.construction_mode)
if(RCD_FLOORWALL)
return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 3)
return FALSE
/turf/open/chasm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
if(RCD_FLOORWALL)
to_chat(user, span_notice("You build a floor."))
place_on_top(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
return TRUE
return FALSE
/turf/open/chasm/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = 'icons/turf/floors.dmi'
underlay_appearance.icon_state = "basalt"
return TRUE
/turf/open/chasm/attackby(obj/item/C, mob/user, params, area/area_restriction)
..()
if(istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(!L)
if(R.use(1))
to_chat(user, span_notice("You construct a lattice."))
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
// Create a lattice, without reverting to our baseturf
new /obj/structure/lattice(src)
else
to_chat(user, span_warning("You need one rod to build a lattice."))
return
if(istype(C, /obj/item/stack/tile/plasteel))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
var/obj/item/stack/tile/plasteel/S = C
if(S.use(1))
qdel(L)
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
to_chat(user, span_notice("You build a floor."))
// Create a floor, which has this chasm underneath it
place_on_top(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
else
to_chat(user, span_warning("You need one floor tile to build a floor!"))
else
to_chat(user, span_warning("The plating is going to need some support! Place metal rods first."))
/turf/open/chasm/CanAllowThrough(atom/movable/AM, turf/target)
. = ..()
return TRUE
// Chasms for Lavaland, with planetary atmos and lava glow
/turf/open/chasm/lavaland
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/lavaland
light_range = 1.9 //slightly less range than lava
light_power = 0.65 //less bright, too
light_color = LIGHT_COLOR_LAVA //let's just say you're falling into lava, that makes sense right
// Chasms for Ice moon, with planetary atmos and glow
/turf/open/chasm/icemoon
icon = 'icons/turf/floors/icechasms.dmi'
icon_state = "icechasms-255"
base_icon_state = "icechasms"
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/icemoon
light_range = 1.9
light_power = 0.65
light_color = LIGHT_COLOR_PURPLE
// Chasms for the jungle, with planetary atmos and a different icon
/turf/open/chasm/jungle
icon = 'icons/turf/floors/junglechasm.dmi'
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/jungle
/turf/open/chasm/jungle/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = 'icons/turf/floors.dmi'
underlay_appearance.icon_state = "dirt"
return TRUE
//For Bag of Holding Bombs
/turf/open/chasm/magic
name = "tear in the fabric of reality"
desc = "Where does it lead?"
icon = 'icons/turf/floors/magic_chasm.dmi'
baseturfs = /turf/open/chasm/magic
light_range = 1.9
light_power = 0.65
can_atmos_pass = ATMOS_PASS_NO
/turf/open/chasm/magic/apply_components(mapload)
AddComponent(/datum/component/chasm, pick(get_area_turfs(/area/centcom/fabric_of_reality)), mapload)