/
asteroid.dm
254 lines (208 loc) · 7 KB
/
asteroid.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
/**********************Asteroid**************************/
/turf/open/misc/asteroid //floor piece
gender = PLURAL
name = "asteroid sand"
desc = "It's coarse and rough and gets everywhere."
baseturfs = /turf/open/misc/asteroid
icon = 'icons/turf/floors.dmi'
icon_state = "asteroid"
base_icon_state = "asteroid"
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
/// Base turf type to be created by the tunnel
var/turf_type = /turf/open/misc/asteroid
/// Whether this turf has different icon states
var/has_floor_variance = TRUE
/// Probability floor has a different icon state
var/floor_variance = 20
/// Itemstack to drop when dug by a shovel
var/obj/item/stack/dig_result = /obj/item/stack/ore/glass
/// Whether the turf has been dug or not
var/dug = FALSE
/// Icon state to use when broken
var/broken_state = "asteroid_dug"
/// Percentage chance of receiving a bonus worm
var/worm_chance = 30
/turf/open/misc/asteroid/break_tile()
icon_state = broken_state
/turf/open/misc/asteroid/Initialize(mapload)
var/proper_name = name
. = ..()
name = proper_name
if(has_floor_variance && prob(floor_variance))
icon_state = "[base_icon_state][rand(0,12)]"
/// Drops itemstack when dug and changes icon
/turf/open/misc/asteroid/proc/getDug()
dug = TRUE
new dig_result(src, 5)
if (prob(worm_chance))
new /obj/item/food/bait/worm(src)
icon_state = "[base_icon_state]_dug"
/// If the user can dig the turf
/turf/open/misc/asteroid/proc/can_dig(mob/user)
if(!dug)
return TRUE
if(user)
to_chat(user, span_warning("Looks like someone has dug here already!"))
/turf/open/misc/asteroid/burn_tile()
return
/turf/open/misc/asteroid/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
return
/turf/open/misc/asteroid/MakeDry()
return
/turf/open/misc/asteroid/ex_act(severity, target)
return
/turf/open/misc/asteroid/attackby(obj/item/W, mob/user, params)
. = ..()
if(.)
return TRUE
if(W.tool_behaviour == TOOL_SHOVEL || W.tool_behaviour == TOOL_MINING)
if(!can_dig(user))
return TRUE
if(!isturf(user.loc))
return
balloon_alert(user, "digging...")
if(W.use_tool(src, user, 40, volume=50))
if(!can_dig(user))
return TRUE
getDug()
SSblackbox.record_feedback("tally", "pick_used_mining", 1, W.type)
return TRUE
else if(istype(W, /obj/item/storage/bag/ore))
for(var/obj/item/stack/ore/O in src)
SEND_SIGNAL(W, COMSIG_PARENT_ATTACKBY, O)
/turf/open/floor/plating/lavaland_baseturf
baseturfs = /turf/open/misc/asteroid/basalt/lava_land_surface
/turf/open/misc/asteroid/dug //When you want one of these to be already dug.
has_floor_variance = FALSE
dug = TRUE
base_icon_state = "asteroid_dug"
icon_state = "asteroid_dug"
/turf/open/misc/asteroid/lavaland_atmos
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/misc/asteroid/lavaland_atmos
/// Used by ashstorms to replenish basalt tiles that have been dug up without going through all of them.
GLOBAL_LIST_EMPTY(dug_up_basalt)
/turf/open/misc/asteroid/basalt
name = "volcanic floor"
baseturfs = /turf/open/misc/asteroid/basalt
icon = 'icons/turf/floors.dmi'
icon_state = "basalt"
base_icon_state = "basalt"
floor_variance = 15
dig_result = /obj/item/stack/ore/glass/basalt
broken_state = "basalt_dug"
/turf/open/misc/asteroid/basalt/getDug()
set_light(0)
GLOB.dug_up_basalt |= src
return ..()
/turf/open/misc/asteroid/basalt/Destroy()
GLOB.dug_up_basalt -= src
return ..()
/turf/open/misc/asteroid/basalt/lava //lava underneath
baseturfs = /turf/open/lava/smooth
/turf/open/misc/asteroid/basalt/airless
initial_gas_mix = AIRLESS_ATMOS
worm_chance = 0
/turf/open/misc/asteroid/basalt/Initialize(mapload)
. = ..()
set_basalt_light(src)
/proc/set_basalt_light(turf/open/floor/B)
switch(B.icon_state)
if("basalt1", "basalt2", "basalt3")
B.set_light(2, 0.6, LIGHT_COLOR_LAVA) //more light
if("basalt5", "basalt9")
B.set_light(1.4, 0.6, LIGHT_COLOR_LAVA) //barely anything!
///////Surface. The surface is warm, but survivable without a suit. Internals are required. The floors break to chasms, which drop you into the underground.
/turf/open/misc/asteroid/basalt/lava_land_surface
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/lava/smooth/lava_land_surface
/turf/open/misc/asteroid/lowpressure
initial_gas_mix = OPENTURF_LOW_PRESSURE
baseturfs = /turf/open/misc/asteroid/lowpressure
turf_type = /turf/open/misc/asteroid/lowpressure
/turf/open/misc/asteroid/airless
initial_gas_mix = AIRLESS_ATMOS
baseturfs = /turf/open/misc/asteroid/airless
turf_type = /turf/open/misc/asteroid/airless
worm_chance = 0
/turf/open/misc/asteroid/snow
gender = PLURAL
name = "snow"
desc = "Looks cold."
icon = 'icons/turf/snow.dmi'
baseturfs = /turf/open/misc/asteroid/snow
icon_state = "snow"
base_icon_state = "snow"
broken_state = "snow_dug"
initial_gas_mix = FROZEN_ATMOS
slowdown = 2
flags_1 = NONE
planetary_atmos = TRUE
bullet_sizzle = TRUE
bullet_bounce_sound = null
dig_result = /obj/item/stack/sheet/mineral/snow
var/burnt = FALSE
/turf/open/misc/asteroid/snow/burn_tile()
if(!burnt)
visible_message(span_danger("[src] melts away!."))
slowdown = 0
burnt = TRUE
icon_state = "snow_dug"
return TRUE
return FALSE
/turf/open/misc/asteroid/snow/icemoon
baseturfs = /turf/open/openspace/icemoon
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
slowdown = 0
/turf/open/lava/plasma/ice_moon
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
baseturfs = /turf/open/lava/plasma/ice_moon
planetary_atmos = TRUE
/turf/open/misc/asteroid/snow/ice
name = "icy snow"
desc = "Looks colder."
baseturfs = /turf/open/misc/asteroid/snow/ice
initial_gas_mix = "n2=82;plasma=24;TEMP=120"
floor_variance = 0
icon_state = "snow-ice"
base_icon_state = "snow-ice"
footstep = FOOTSTEP_FLOOR
barefootstep = FOOTSTEP_HARD_BAREFOOT
clawfootstep = FOOTSTEP_HARD_CLAW
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
/turf/open/misc/asteroid/snow/ice/break_tile()
return
/turf/open/misc/asteroid/snow/ice/icemoon
baseturfs = /turf/open/misc/asteroid/snow/ice/icemoon
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
planetary_atmos = TRUE
slowdown = 0
/turf/open/misc/asteroid/snow/ice/burn_tile()
return FALSE
/turf/open/misc/asteroid/snow/airless
initial_gas_mix = AIRLESS_ATMOS
worm_chance = 0
/turf/open/misc/asteroid/snow/temperatre
initial_gas_mix = "o2=22;n2=82;TEMP=255.37"
//Used for when you want to have real, genuine snow in your kitchen's cold room
/turf/open/misc/asteroid/snow/coldroom
baseturfs = /turf/open/misc/asteroid/snow/coldroom
planetary_atmos = FALSE
temperature = COLD_ROOM_TEMP
/turf/open/misc/asteroid/snow/coldroom/Initialize(mapload)
initial_gas_mix = KITCHEN_COLDROOM_ATMOS
return ..()
//Used in SnowCabin.dm
/turf/open/misc/asteroid/snow/snow_cabin
temperature = 180
/turf/open/misc/asteroid/snow/atmosphere
initial_gas_mix = FROZEN_ATMOS
planetary_atmos = FALSE
/turf/open/misc/asteroid/snow/standard_air
initial_gas_mix = OPENTURF_DEFAULT_ATMOS
planetary_atmos = FALSE