Skip to content

Commit ee67c1e

Browse files
committed
Test and debug new ladders
1 parent cf0e9d9 commit ee67c1e

File tree

3 files changed

+57
-22
lines changed

3 files changed

+57
-22
lines changed

code/game/objects/structures/ladders.dm

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/// Optional travel time for ladder in deciseconds
1313
var/travel_time = 0
1414
var/obstructed = FALSE // MOJAVE SUN BASE EDIT
15+
var/locked = FALSE // MOJAVE SUN BASE EDIT
1516

1617
/obj/structure/ladder/Initialize(mapload, obj/structure/ladder/up, obj/structure/ladder/down)
1718
..()

mojave/icons/structure/ladders.dmi

2.26 KB
Binary file not shown.

mojave/structures/ladders.dm

+56-22
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
desc = "A manhole ladder, you could probably push the cover off from here, or try dragging it back on."
7070
travel_time = 2 SECONDS
7171
pixel_y = 7
72-
icon_state = "manhole_closed"
72+
icon_state = "ladder10"
7373

7474
/obj/structure/ladder/ms13/manhole/examine(mob/user)
7575
. = ..()
@@ -106,6 +106,7 @@
106106
to_chat(user, span_warning("It's so heavy! Surely there's a better way of doing this."))
107107
if(do_after(user, 10 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
108108
obstructed = FALSE
109+
down.obstructed = FALSE
109110
icon_state = "manhole_open"
110111
desc = "An open manhole, it still stinks even after all these years. You could use a crowbar or your hands to slide the cover back on."
111112
to_chat(user, span_notice("With a lot of effort, you manage to finally get the cover off."))
@@ -116,6 +117,7 @@
116117
else
117118
if(do_after(user, 10 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
118119
obstructed = TRUE
120+
down.obstructed = TRUE
119121
icon_state = "manhole_closed"
120122
desc = "A heavy stamped manhole. You could probably pry it up with a crowbar to access the lower town systems. Or, try using your hands..."
121123
to_chat(user, span_notice("You carefully slide the cover back on the manhole."))
@@ -125,6 +127,7 @@
125127
if(down && obstructed)
126128
if(do_after(user, 4 SECONDS * tool.toolspeed, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
127129
obstructed = FALSE
130+
down.obstructed = FALSE
128131
icon_state = "manhole_open"
129132
desc = "An open manhole, it still stinks even after all these years. You could use a crowbar or your hands to slide the cover back on."
130133
to_chat(user, span_notice("You wedge the crowbar in and pull the cover off the manhole."))
@@ -133,6 +136,7 @@
133136
if(down && !obstructed)
134137
if(do_after(user, 4 SECONDS * tool.toolspeed, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
135138
obstructed = TRUE
139+
down.obstructed = TRUE
136140
icon_state = "manhole_closed"
137141
desc = "A heavy stamped manhole. You could probably pry it up with a crowbar to access the lower town systems. Or, try using your hands..."
138142
to_chat(user, span_notice("You hook the edge of the manhole cover with your crowbar and slide it back on."))
@@ -144,6 +148,7 @@
144148
name = "manhole entry"
145149
desc = "A heavy stamped manhole. You could probably pry it up with a crowbar to access the lower town systems."
146150
icon_state = "manhole_closed"
151+
pixel_y = 7
147152
obstructed = TRUE
148153
else
149154
icon_state = "ladder10"
@@ -161,6 +166,7 @@
161166
return TRUE
162167
if(I.use_tool(src, user, 15 SECONDS, volume=80))
163168
obstructed = FALSE
169+
down.obstructed = FALSE
164170
icon_state = "bunker_open"
165171
desc = "Looks like the entrance to some bunker. The bars on the grate have been cut off, allowing entry."
166172
to_chat(user, span_notice("You cut-weld the bars off the grate, letting you slip past."))
@@ -173,6 +179,7 @@
173179
desc = "It looks like a grate, leading to some sort of bunker. You could probably weld the bars off."
174180
icon_state = "bunker_closed"
175181
obstructed = TRUE
182+
down.obstructed = TRUE
176183
else
177184
icon_state = "ladder10"
178185

@@ -201,14 +208,13 @@
201208
name = "bunker hatch"
202209
desc = "A bunker ladder, you could probably push the hatch open from here, or try closing it."
203210
travel_time = 2 SECONDS
204-
pixel_y = 7
205-
var/locked = TRUE
211+
locked = TRUE
206212

207213
/obj/structure/ladder/ms13/hatch/examine(mob/user)
208214
. = ..()
209215
. += "<span class='notice'>Use <b>RIGHT-CLICK</b> on [src] to open or close it.</span>"
210216
if(down)
211-
. += "<span class='notice'>Use <b>ALT-CLICK</b> on [src] to lock or unlock it.</span>"
217+
. += "<span class='notice'>Use <b>CTRL-CLICK</b> on [src] to lock or unlock it.</span>"
212218

213219
/// Open or close the hatch.
214220
/// Hatch can be opened/closed from both side.
@@ -222,41 +228,43 @@
222228

223229
if(!down)
224230
if(up.locked)
225-
to_chat(user, span_notice("The [src] is locked from above!"))
231+
to_chat(user, span_notice("The bunker hatch is locked from above!"))
226232
else
227-
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the [src] from below."))
233+
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the bunker hatch from below."))
228234
if(do_after(user, 12 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
229235
obstructed = !obstructed
230-
up.obstructed = !up.obstructed
236+
up.obstructed = obstructed
231237
up.icon_state = up.obstructed ? "hatch_closed" : "hatch_open"
232-
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the [src] from below."))
238+
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the bunker hatch from below."))
233239
else
234240
if(locked)
235-
to_chat(user, span_notice("The [src] must be unlocked first."))
241+
to_chat(user, span_notice("[src] must be unlocked first."))
236242
else
237-
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the [src]."))
243+
to_chat(user, span_warning("You start to slowly [obstructed ? "open" : "close"] [src]."))
238244
if(do_after(user, 10 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
239245
obstructed = !obstructed
246+
down.obstructed = obstructed
240247
icon_state = obstructed ? "hatch_closed" : "hatch_open"
241-
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the [src]."))
248+
to_chat(user, span_notice("You [obstructed ? "closed" : "opened"] [src]."))
242249

243250
/// Lock or unlock the hatch.
244251
/// Hatch can only be locked/unlocked from above.
245252
/// Hatch must be closed before begin locked.
246-
/obj/structure/ladder/ms13/hatch/AltClick(mob/user)
253+
/obj/structure/ladder/ms13/hatch/CtrlClick(mob/user)
247254
. = ..()
248255
if(!down)
249-
to_chat(user, span_notice("You cannot [locked ? "unlock" : "lock"] the [src] from this side!"))
256+
to_chat(user, span_notice("You cannot [locked ? "unlock" : "lock"] the bunker hatch from this side!"))
250257
return
251258
else
252259
if(obstructed)
253-
to_chat(user, span_warning("You start spinning the metal hand-wheel to [locked ? "unlock" : "lock"] the [src]."))
260+
to_chat(user, span_warning("You start spinning the metal hand-wheel to [locked ? "unlock" : "lock"] [src]."))
254261
if(do_after(user, 10 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
255262
locked = !locked
256-
to_chat(user, span_notice("You [locked ? "locked" : "unlocked"] the [src]."))
263+
down.locked = locked
264+
to_chat(user, span_notice("You [locked ? "locked" : "unlocked"] [src]."))
257265
return
258266
else
259-
to_chat(user, span_notice("The [src] must be brought down before you can lock it."))
267+
to_chat(user, span_notice("[src] must be brought down before you can lock it."))
260268

261269

262270
/obj/structure/ladder/ms13/hatch/update_icon_state()
@@ -266,19 +274,32 @@
266274
icon_state = "hatch_closed"
267275
desc = "A bunker hatch that can be firmly closed or opened from above using a metal hand-wheel."
268276
obstructed = TRUE
277+
down.obstructed = TRUE
269278
locked = TRUE
279+
down.locked = TRUE
270280
else
271281
name = "bunker ladder"
272282
icon_state = "ladder10"
273283

284+
/obj/structure/ladder/ms13/hatch/Initialize(mapload)
285+
. = ..()
286+
register_context()
287+
288+
/obj/structure/ladder/ms13/hatch/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
289+
. = ..()
290+
291+
if (isnull(held_item))
292+
context[SCREENTIP_CONTEXT_RMB] = "Open/Close"
293+
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Lock/Unlock"
294+
return CONTEXTUAL_SCREENTIP_SET
295+
274296
///////////////////// ENCLAVE BUNKER ////////////////////////
275297

276298
/// An Enclave hatch than cannot be locked.
277299
/obj/structure/ladder/ms13/enclave
278300
name = "Enclave bunker ladder"
279301
desc = "A bunker ladder adorned with Enclave heraldic, you could probably push the hatch open from here, or try closing it."
280302
travel_time = 2 SECONDS
281-
pixel_y = 7
282303

283304
/obj/structure/ladder/ms13/enclave/examine(mob/user)
284305
. = ..()
@@ -294,18 +315,19 @@
294315
. = SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
295316

296317
if(!down)
297-
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the [src] from below."))
318+
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the Enclave bunker hatch from below."))
298319
if(do_after(user, 12 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
299320
obstructed = !obstructed
300-
up.obstructed = !up.obstructed
321+
up.obstructed = obstructed
301322
up.icon_state = up.obstructed ? "enclave_closed" : "enclave_open"
302-
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the [src] from below."))
323+
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the Enclave bunker hatch from below."))
303324
else
304-
to_chat(user, span_warning("You start to slowly [up.obstructed ? "open" : "close"] the [src]."))
325+
to_chat(user, span_warning("You start to slowly [obstructed ? "open" : "close"] [src]."))
305326
if(do_after(user, 10 SECONDS, target = src, interaction_key = DOAFTER_SOURCE_LADDERBLOCKERS))
306327
obstructed = !obstructed
328+
down.obstructed = obstructed
307329
icon_state = obstructed ? "enclave_closed" : "enclave_open"
308-
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] the [src]."))
330+
to_chat(user, span_notice("You [up.obstructed ? "closed" : "opened"] [src]."))
309331

310332
/obj/structure/ladder/ms13/enclave/update_icon_state()
311333
. = ..()
@@ -314,6 +336,18 @@
314336
desc = "A thick bunker hatch adorned with a half-faded Enclave roundel."
315337
icon_state = "enclave_closed"
316338
obstructed = TRUE
339+
down.obstructed = TRUE
317340
else
318341
name = "Enclave bunker ladder"
319342
icon_state = "ladder10"
343+
344+
/obj/structure/ladder/ms13/enclave/Initialize(mapload)
345+
. = ..()
346+
register_context()
347+
348+
/obj/structure/ladder/ms13/enclave/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
349+
. = ..()
350+
351+
if (isnull(held_item))
352+
context[SCREENTIP_CONTEXT_RMB] = "Open/Close"
353+
return CONTEXTUAL_SCREENTIP_SET

0 commit comments

Comments
 (0)