-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathreinf_walls.dm
262 lines (236 loc) · 9.56 KB
/
reinf_walls.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
/turf/closed/wall/r_wall
name = "reinforced wall"
desc = "A huge chunk of reinforced metal used to separate rooms."
icon = 'icons/turf/walls/reinforced_wall.dmi'
icon_state = "reinforced_wall-0"
base_icon_state = "reinforced_wall"
opacity = TRUE
density = TRUE
turf_flags = IS_SOLID
smoothing_flags = SMOOTH_BITMASK
hardness = 10
sheet_type = /obj/item/stack/sheet/plasteel
sheet_amount = 1
girder_type = /obj/structure/girder/reinforced
explosion_block = 2
max_integrity = 400
damage_deflection = 75 // can't be damaged with most conventional weapons or tools
armor = list(MELEE = 80, BULLET = 80, LASER = 60, ENERGY = 25, BOMB = 50, BIO = 100, RAD = 100, FIRE = 100, ACID = 100)
smash_flags = ENVIRONMENT_SMASH_RWALLS // rwalls only
rad_insulation = RAD_FULL_INSULATION
///Dismantled state, related to deconstruction.
var/d_state = INTACT
///Base icon state to use for deconstruction
var/base_decon_state = "r_wall"
/turf/closed/wall/r_wall/deconstruction_hints(mob/user)
switch(d_state)
if(INTACT)
return span_notice("The outer <b>grille</b> is fully intact.")
if(SUPPORT_LINES)
return span_notice("The outer <i>grille</i> has been cut, and the support lines are <b>screwed</b> securely to the outer cover.")
if(COVER)
return span_notice("The support lines have been <i>unscrewed</i>, and the metal cover is <b>welded</b> firmly in place.")
if(CUT_COVER)
return span_notice("The metal cover has been <i>sliced through</i>, and is <b>connected loosely</b> to the girder.")
if(ANCHOR_BOLTS)
return span_notice("The outer cover has been <i>pried away</i>, and the bolts anchoring the support rods are <b>wrenched</b> in place.")
if(SUPPORT_RODS)
return span_notice("The bolts anchoring the support rods have been <i>loosened</i>, but are still <b>welded</b> firmly to the girder.")
if(SHEATH)
return span_notice("The support rods have been <i>sliced through</i>, and the outer sheath is <b>connected loosely</b> to the girder.")
/turf/closed/wall/r_wall/devastate_wall()
new sheet_type(src, sheet_amount)
new /obj/item/stack/sheet/metal(src, 2)
/turf/closed/wall/r_wall/try_decon(obj/item/W, mob/user, turf/T)
//DECONSTRUCTION
switch(d_state)
if(INTACT)
if(W.tool_behaviour == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = SUPPORT_LINES
update_appearance()
to_chat(user, span_notice("You cut the outer grille."))
return TRUE
if(SUPPORT_LINES)
if(W.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, span_notice("You begin unsecuring the support lines..."))
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_LINES)
return TRUE
d_state = COVER
update_appearance()
to_chat(user, span_notice("You unsecure the support lines."))
return TRUE
else if(W.tool_behaviour == TOOL_WIRECUTTER)
W.play_tool_sound(src, 100)
d_state = INTACT
update_appearance()
to_chat(user, span_notice("You repair the outer grille."))
return TRUE
if(COVER)
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin slicing through the metal cover..."))
if(W.use_tool(src, user, 60, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER)
return TRUE
d_state = CUT_COVER
update_appearance()
to_chat(user, span_notice("You press firmly on the cover, dislodging it."))
return TRUE
if(W.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, span_notice("You begin securing the support lines..."))
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER)
return TRUE
d_state = SUPPORT_LINES
update_appearance()
to_chat(user, span_notice("The support lines have been secured."))
return TRUE
if(CUT_COVER)
if(W.tool_behaviour == TOOL_CROWBAR)
to_chat(user, span_notice("You struggle to pry off the cover..."))
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER)
return TRUE
d_state = ANCHOR_BOLTS
update_appearance()
to_chat(user, span_notice("You pry off the cover."))
return TRUE
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin welding the metal cover back to the frame..."))
if(W.use_tool(src, user, 60, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER)
return TRUE
d_state = COVER
update_appearance()
to_chat(user, span_notice("The metal cover has been welded securely to the frame."))
return TRUE
if(ANCHOR_BOLTS)
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(user, span_notice("You start loosening the anchoring bolts which secure the support rods to their frame..."))
if(W.use_tool(src, user, 40, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
return TRUE
d_state = SUPPORT_RODS
update_appearance()
to_chat(user, span_notice("You remove the bolts anchoring the support rods."))
return TRUE
if(W.tool_behaviour == TOOL_CROWBAR)
to_chat(user, span_notice("You start to pry the cover back into place..."))
if(W.use_tool(src, user, 20, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS)
return TRUE
d_state = CUT_COVER
update_appearance()
to_chat(user, span_notice("The metal cover has been pried back into place."))
return TRUE
if(SUPPORT_RODS)
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin slicing through the support rods..."))
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS)
return TRUE
d_state = SHEATH
update_appearance()
to_chat(user, span_notice("You slice through the support rods."))
return TRUE
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(user, span_notice("You start tightening the bolts which secure the support rods to their frame..."))
W.play_tool_sound(src, 100)
if(W.use_tool(src, user, 40))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS)
return TRUE
d_state = ANCHOR_BOLTS
update_appearance()
to_chat(user, span_notice("You tighten the bolts anchoring the support rods."))
return TRUE
if(SHEATH)
if(W.tool_behaviour == TOOL_CROWBAR)
to_chat(user, span_notice("You struggle to pry off the outer sheath..."))
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SHEATH)
return TRUE
to_chat(user, span_notice("You pry off the outer sheath."))
dismantle_wall()
return TRUE
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin welding the support rods back together..."))
if(W.use_tool(src, user, 100, volume=100))
if(!istype(src, /turf/closed/wall/r_wall) || d_state != SHEATH)
return TRUE
d_state = SUPPORT_RODS
update_appearance()
to_chat(user, span_notice("You weld the support rods back together."))
return TRUE
return FALSE
/turf/closed/wall/r_wall/update_icon(updates=ALL)
. = ..()
if(d_state != INTACT)
smoothing_flags = NONE
return
if (!(updates & UPDATE_SMOOTHING))
return
smoothing_flags = SMOOTH_BITMASK
QUEUE_SMOOTH_NEIGHBORS(src)
QUEUE_SMOOTH(src)
// We don't react to smoothing changing here because this else exists only to "revert" intact changes
/turf/closed/wall/r_wall/update_icon_state()
if(d_state != INTACT)
icon = 'icons/turf/walls/reinforced_states.dmi'
icon_state = "[base_decon_state]-[d_state]"
else
icon = 'icons/turf/walls/reinforced_wall.dmi'
icon_state = "[base_icon_state]-[smoothing_junction]"
return ..()
/turf/closed/wall/r_wall/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
if(prob(30))
dismantle_wall()
/turf/closed/wall/r_wall/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.canRturf)
return ..()
/turf/closed/wall/r_wall/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
if(the_rcd.canRturf)
return ..()
/turf/closed/wall/r_wall/rust_heretic_act()
if(prob(50))
return
if(HAS_TRAIT(src, TRAIT_RUSTY))
ScrapeAway()
return
return ..()
/turf/closed/wall/r_wall/syndicate
name = "hull"
desc = "The armored hull of an ominous looking ship."
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "plastitanium_wall-0"
base_icon_state = "plastitanium_wall"
explosion_block = 20
sheet_type = /obj/item/stack/sheet/mineral/plastitanium
turf_flags = IS_SOLID
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
smoothing_groups = SMOOTH_GROUP_WALLS + SMOOTH_GROUP_CLOSED_TURFS + SMOOTH_GROUP_SYNDICATE_WALLS
canSmoothWith = SMOOTH_GROUP_SHUTTLE_PARTS + SMOOTH_GROUP_AIRLOCK + SMOOTH_GROUP_PLASTITANIUM_WALLS + SMOOTH_GROUP_SYNDICATE_WALLS
/turf/closed/wall/r_wall/syndicate/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
return FALSE
/turf/closed/wall/r_wall/syndicate/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "plastitanium_wall"
smoothing_flags = SMOOTH_BITMASK
/turf/closed/wall/r_wall/syndicate/nosmooth
icon = 'icons/turf/shuttle.dmi'
icon_state = "wall"
smoothing_flags = NONE
/turf/closed/wall/r_wall/syndicate/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
fixed_underlay = list("space" = TRUE)