Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit ebd2a7e

Browse files
stuff (#21500)
1 parent 245000f commit ebd2a7e

File tree

7 files changed

+89
-89
lines changed

7 files changed

+89
-89
lines changed

code/game/mecha/equipment/mecha_equipment.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
forceMove(M)
158158
log_message("[src] initialized.", LOG_MECHA)
159159
update_chassis_page()
160-
ADD_TRAIT(src, TRAIT_NODROP, "mecha")
160+
ADD_TRAIT(src, TRAIT_NODROP, REF(M))
161161
item_flags |= NO_MAT_REDEMPTION // terrible
162162
for(var/datum/action/innate/mecha/equipment/action as anything in equip_actions)
163163
action.chassis = M
@@ -171,7 +171,7 @@
171171
for(var/datum/action/innate/mecha/equipment/action as anything in equip_actions)
172172
action.chassis = null
173173
item_flags &= ~NO_MAT_REDEMPTION
174-
REMOVE_TRAIT(src, TRAIT_NODROP, "mecha")
174+
REMOVE_TRAIT(src, TRAIT_NODROP, REF(chassis))
175175
if(chassis.selected == src)
176176
src.on_deselect()
177177
moveto = moveto || get_turf(chassis)

code/game/objects/structures/crates_lockers/closets.dm

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(lockers)
2626
var/max_mob_size = MOB_SIZE_HUMAN //Biggest mob_size accepted by the container
2727
var/mob_storage_capacity = 3 // how many human sized mob/living can fit together inside a closet.
2828
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
29-
var/cutting_tool = /obj/item/weldingtool
29+
var/cutting_tool = TOOL_WELDER
3030
var/open_sound = 'sound/machines/click.ogg'
3131
var/close_sound = 'sound/machines/click.ogg'
3232
var/material_drop = /obj/item/stack/sheet/metal
@@ -320,71 +320,67 @@ GLOBAL_LIST_EMPTY(lockers)
320320
if(!broken && !(flags_1 & NODECONSTRUCT_1))
321321
bust_open()
322322

323-
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
323+
/obj/structure/closet/attackby(obj/item/attacking_item, mob/user, params)
324324
if(user in src)
325325
return
326-
if(src.tool_interact(W,user))
327-
return 1 // No afterattack
328-
else
329-
return ..()
330-
331-
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/user)//returns TRUE if attackBy call shouldnt be continued (because tool was used/closet was of wrong type), FALSE if otherwise
332-
. = TRUE
333-
if(opened)
334-
if(user.a_intent == INTENT_HARM)
335-
return FALSE
336-
if(istype(W, cutting_tool))
337-
if(W.tool_behaviour == TOOL_WELDER)
338-
if(!W.tool_start_check(user, amount=0))
339-
return
340-
341-
to_chat(user, span_notice("You begin cutting \the [src] apart..."))
342-
if(W.use_tool(src, user, 40, volume=50))
343-
if(!opened)
344-
return
345-
user.visible_message(span_notice("[user] slices apart \the [src]."),
346-
span_notice("You cut \the [src] apart with \the [W]."),
347-
span_italics("You hear welding."))
348-
deconstruct(TRUE)
349-
return
350-
else // for example cardboard box is cut with wirecutters
351-
user.visible_message(span_notice("[user] cut apart \the [src]."), \
352-
span_notice("You cut \the [src] apart with \the [W]."))
353-
deconstruct(TRUE)
354-
return
355-
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
356-
return
357-
else if(W.tool_behaviour == TOOL_WELDER && can_weld_shut)
358-
if(!W.tool_start_check(user, amount=0))
359-
return
326+
if(user.a_intent != INTENT_HARM && attacking_item.GetID())
327+
togglelock(user)
328+
return TRUE
329+
return ..()
360330

331+
/obj/structure/closet/welder_act(mob/living/user, obj/item/tool)
332+
if(user.a_intent == INTENT_HARM)
333+
return FALSE
334+
if(!tool.tool_start_check(user, amount=0))
335+
return FALSE
336+
if(opened && !(flags_1 & NODECONSTRUCT_1))
337+
if(tool.tool_behaviour != cutting_tool)
338+
return FALSE // the wrong tool
339+
to_chat(user, span_notice("You begin cutting \the [src] apart..."))
340+
if(tool.use_tool(src, user, 4 SECONDS, volume=50))
341+
if(!opened)
342+
return TRUE
343+
user.visible_message(span_notice("[user] slices apart \the [src]."),
344+
span_notice("You cut \the [src] apart with \the [tool]."),
345+
span_italics("You hear welding."))
346+
deconstruct(TRUE)
347+
return TRUE
348+
if(can_weld_shut)
361349
to_chat(user, span_notice("You begin [welded ? "unwelding":"welding"] \the [src]..."))
362-
if(W.use_tool(src, user, 40, volume=50))
350+
if(tool.use_tool(src, user, 4 SECONDS, volume=50))
363351
if(opened)
364352
return
365353
welded = !welded
366354
after_weld(welded)
367355
update_airtightness()
368356
user.visible_message(span_notice("[user] [welded ? "welds shut" : "unwelded"] \the [src]."),
369-
span_notice("You [welded ? "weld" : "unwelded"] \the [src] with \the [W]."),
370-
span_italics("You hear welding."))
357+
span_notice("You [welded ? "weld" : "unwelded"] \the [src] with \the [tool]."),
358+
span_italics("You hear welding."))
371359
update_appearance()
372-
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
373-
if(isinspace() && !anchored)
374-
return
375-
setAnchored(!anchored)
376-
W.play_tool_sound(src, 75)
377-
user.visible_message(span_notice("[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
378-
span_notice("You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
379-
span_italics("You hear a ratchet."))
380-
else if(user.a_intent != INTENT_HARM)
381-
var/item_is_id = W.GetID()
382-
if(!item_is_id && !(W.item_flags & NOBLUDGEON))
383-
return FALSE
384-
if(item_is_id || !toggle(user))
385-
togglelock(user)
386-
else
360+
return TRUE
361+
return FALSE
362+
363+
/obj/structure/closet/wirecutter_act(mob/living/user, obj/item/tool)
364+
if(user.a_intent == INTENT_HARM || (flags_1 & NODECONSTRUCT_1))
387365
return FALSE
366+
if(tool.tool_behaviour != cutting_tool)
367+
return FALSE
368+
user.visible_message(span_notice("[user] cut apart \the [src]."), \
369+
span_notice("You cut \the [src] apart with \the [tool]."))
370+
deconstruct(TRUE)
371+
return TRUE
372+
373+
/obj/structure/closet/wrench_act(mob/living/user, obj/item/tool)
374+
if(!anchorable)
375+
return FALSE
376+
if(isinspace() && !anchored)
377+
return FALSE
378+
setAnchored(!anchored)
379+
tool.play_tool_sound(src, 75)
380+
user.visible_message(span_notice("[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
381+
span_notice("You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
382+
span_italics("You hear a ratchet."))
383+
return TRUE
388384

389385
/obj/structure/closet/proc/after_weld(weld_state)
390386
return

code/game/objects/structures/crates_lockers/closets/bluespace_locker.dm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
desc = ""
2929
cutting_tool = null
3030
can_weld_shut = FALSE
31+
anchorable = FALSE
3132
anchored = TRUE
33+
flags_1 = NODECONSTRUCT_1
3234
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
3335
var/list/mirage_whitelist = list()
3436

@@ -54,9 +56,6 @@
5456
return TRUE
5557
return other.can_open(user)
5658

57-
/obj/structure/closet/bluespace/internal/tool_interact(obj/item/W, mob/user)
58-
return
59-
6059
/obj/structure/closet/bluespace/internal/attack_hand(mob/living/user)
6160
var/obj/structure/closet/other = get_other_locker()
6261
if(!other)

code/game/objects/structures/crates_lockers/closets/cardboardbox.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
max_integrity = 70
99
integrity_failure = 0
1010
can_weld_shut = 0
11-
cutting_tool = /obj/item/wirecutters
11+
cutting_tool = TOOL_WIRECUTTER
1212
open_sound = "rustle"
1313
material_drop = /obj/item/stack/sheet/cardboard
1414
delivery_icon = "deliverybox"
@@ -77,7 +77,7 @@
7777
mob_storage_capacity = 5
7878
resistance_flags = NONE
7979
move_speed_multiplier = 2
80-
cutting_tool = /obj/item/weldingtool
80+
cutting_tool = TOOL_WELDER
8181
open_sound = 'sound/machines/click.ogg'
8282
material_drop = /obj/item/stack/sheet/plasteel
8383
#undef SNAKE_SPAM_TICKS

code/game/objects/structures/tables_racks.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@
189189
/obj/structure/table/attackby(obj/item/I, mob/user, params)
190190
if(istype(I, /obj/item/rsf)) // Stops RSF from placing itself instead of glasses
191191
return
192-
if(!(flags_1 & NODECONSTRUCT_1))
193-
if(I.tool_behaviour == TOOL_SCREWDRIVER && deconstruction_ready && (user.a_intent != INTENT_HELP && user.a_intent != INTENT_HARM || !(INTENT_DISARM in user.possible_a_intents)))
192+
if(!(flags_1 & NODECONSTRUCT_1) && deconstruction_ready && ((user.a_intent != INTENT_HELP || HAS_TRAIT(I, TRAIT_NODROP)) && (user.a_intent != INTENT_HARM || (I.item_flags & NOBLUDGEON)) || !(INTENT_DISARM in user.possible_a_intents)))
193+
if(I.tool_behaviour == TOOL_SCREWDRIVER)
194194
to_chat(user, span_notice("You start disassembling [src]..."))
195195
if(I.use_tool(src, user, 20, volume=50))
196196
deconstruct(TRUE)
197197
return
198198

199-
if(I.tool_behaviour == TOOL_WRENCH && deconstruction_ready && (user.a_intent != INTENT_HELP && user.a_intent != INTENT_HARM || !(INTENT_DISARM in user.possible_a_intents)))
199+
if(I.tool_behaviour == TOOL_WRENCH)
200200
to_chat(user, span_notice("You start deconstructing [src]..."))
201201
if(I.use_tool(src, user, 40, volume=50))
202202
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
@@ -211,7 +211,7 @@
211211
return
212212
// If the tray IS empty, continue on (tray will be placed on the table like other items)
213213

214-
if(user.a_intent != INTENT_HARM && !(I.item_flags & ABSTRACT))
214+
if((user.a_intent != INTENT_HARM && !HAS_TRAIT(I, TRAIT_NODROP)) && !(I.item_flags & ABSTRACT)) // if you can't drop it, you can't place it on the table
215215
if(user.transferItemToLoc(I, drop_location()))
216216
var/list/click_params = params2list(params)
217217
//Center the icon where the user clicked.

code/modules/antagonists/bloodsuckers/structures/bloodsucker_coffin.dm

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,30 +196,37 @@
196196
return TRUE
197197

198198
/// You cannot weld or deconstruct an owned coffin. Only the owner can destroy their own coffin.
199-
/obj/structure/closet/crate/coffin/attackby(obj/item/item, mob/user, params)
200-
if(!resident)
201-
return ..()
202-
if(user != resident)
203-
if(istype(item, cutting_tool))
204-
to_chat(user, span_notice("This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src]."))
205-
return
206-
if(anchored && (item.tool_behaviour == TOOL_WRENCH))
207-
to_chat(user, span_danger("The coffin won't come unanchored from the floor.[user == resident ? " You can Alt-Click to unclaim and unwrench your Coffin." : ""]"))
208-
return
199+
/obj/structure/closet/crate/coffin/welder_act(mob/living/user, obj/item/tool)
200+
if(user.a_intent != INTENT_HARM && resident && resident != user)
201+
to_chat(user, span_notice("This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src]."))
202+
return TRUE
203+
return ..()
204+
205+
/obj/structure/closet/crate/coffin/wirecutter_act(mob/living/user, obj/item/tool)
206+
if(user.a_intent != INTENT_HARM && resident && resident != user && tool.tool_behaviour == cutting_tool)
207+
to_chat(user, span_notice("This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src]."))
208+
return TRUE
209+
return ..()
209210

210-
if(locked && (item.tool_behaviour == TOOL_CROWBAR))
211-
var/pry_time = pry_lid_timer * item.toolspeed // Pry speed must be affected by the speed of the tool.
211+
/obj/structure/closet/crate/coffin/crowbar_act(mob/living/user, obj/item/tool)
212+
if(locked && resident)
212213
user.visible_message(
213-
span_notice("[user] tries to pry the lid off of [src] with [item]."),
214-
span_notice("You begin prying the lid off of [src] with [item]. This should take about [DisplayTimeText(pry_time)]."))
215-
if(!do_after(user, pry_time, src))
216-
return
214+
span_notice("[user] tries to pry the lid off of [src] with [tool]."),
215+
span_notice("You begin prying the lid off of [src] with [tool]. This should take about [DisplayTimeText(pry_lid_timer)]."))
216+
if(!tool.use_tool(src, user, pry_lid_timer)) // Pry speed must be affected by the speed of the tool.
217+
return TRUE
217218
bust_open()
218219
user.visible_message(
219220
span_notice("[user] snaps the door of [src] wide open."),
220221
span_notice("The door of [src] snaps open."))
221-
return
222-
. = ..()
222+
return TRUE
223+
return FALSE
224+
225+
/obj/structure/closet/crate/coffin/wrench_act(mob/living/user, obj/item/tool)
226+
if(anchored && resident)
227+
to_chat(user, span_danger("The coffin won't come unanchored from the floor.[user == resident ? " You can Alt-Click to unclaim and unwrench your Coffin." : ""]"))
228+
return TRUE
229+
return ..()
223230

224231
/// Distance Check (Inside Of)
225232
/obj/structure/closet/crate/coffin/AltClick(mob/user)

code/modules/cargo/supplypod.dm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
/obj/structure/closet/supplypod/bluespacepod
6262
style = STYLE_BLUESPACE
6363
bluespace = TRUE
64+
flags_1 = NODECONSTRUCT_1|PREVENT_CONTENTS_EXPLOSION_1
6465
explosionSize = list(0,0,1,2)
6566
delays = list(POD_TRANSIT = 15, POD_FALLING = 4, POD_OPENING = 30, POD_LEAVING = 30)
6667

@@ -70,12 +71,14 @@
7071
specialised = TRUE
7172
style = STYLE_SYNDICATE
7273
bluespace = TRUE
74+
flags_1 = NODECONSTRUCT_1|PREVENT_CONTENTS_EXPLOSION_1
7375
explosionSize = list(0,0,1,2)
7476
delays = list(POD_TRANSIT = 25, POD_FALLING = 4, POD_OPENING = 30, POD_LEAVING = 30)
7577

7678
/obj/structure/closet/supplypod/centcompod
7779
style = STYLE_CENTCOM
7880
bluespace = TRUE
81+
flags_1 = NODECONSTRUCT_1|PREVENT_CONTENTS_EXPLOSION_1
7982
explosionSize = list(0,0,0,0)
8083
delays = list(POD_TRANSIT = 20, POD_FALLING = 4, POD_OPENING = 30, POD_LEAVING = 30)
8184
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
@@ -178,12 +181,6 @@
178181
if(decal)
179182
. += decal
180183

181-
/obj/structure/closet/supplypod/tool_interact(obj/item/W, mob/user)
182-
if(bluespace) //We dont want to worry about interacting with bluespace pods, as they are due to delete themselves soon anyways.
183-
return FALSE
184-
else
185-
..()
186-
187184
/obj/structure/closet/supplypod/ex_act() //Explosions dont do SHIT TO US! This is because supplypods create explosions when they land.
188185
return
189186

@@ -199,6 +196,7 @@
199196
/obj/structure/closet/supplypod/proc/handleReturnAfterDeparting(atom/movable/holder = src)
200197
reversing = FALSE //Now that we're done reversing, we set this to false (otherwise we would get stuck in an infinite loop of calling the close proc at the bottom of open_pod() )
201198
bluespace = TRUE //Make it so that the pod doesn't stay in centcom forever
199+
flags_1 = NODECONSTRUCT_1|PREVENT_CONTENTS_EXPLOSION_1
202200
pod_flags &= ~FIRST_SOUNDS //Make it so we play sounds now
203201
if (!effectQuiet && style != STYLE_SEETHROUGH)
204202
audible_message(span_notice("The pod hisses, closing and launching itself away from the station."), span_notice("The ground vibrates, and you hear the sound of engines firing."))

0 commit comments

Comments
 (0)