Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plasmacutter buff #9

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
GLOBAL_LIST_INIT(closet_cutting_types, typecacheof(list(
/obj/item/gun/energy/plasmacutter)))

/obj/structure/closet/secure_closet/tool_interact(obj/item/W, mob/user, proximity)//returns TRUE if attackBy call shouldnt be continued (because tool was used/closet was of wrong type), FALSE if otherwise
. = TRUE
if(opened)
if(user.a_intent == INTENT_HARM)
return FALSE
if(istype(W, cutting_tool))
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return

to_chat(user, span_notice("You begin cutting \the [src] apart..."))
if(W.use_tool(src, user, 40, volume=50))
if(!opened)
return
user.visible_message(span_notice("[user] slices apart \the [src]."),
span_notice("You cut \the [src] apart with \the [W]."),
span_italics("You hear welding."))
deconstruct(TRUE)
return
else // for example cardboard box is cut with wirecutters
user.visible_message(span_notice("[user] cut apart \the [src]."), \
span_notice("You cut \the [src] apart with \the [W]."))
deconstruct(TRUE)
return
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return
else if(is_type_in_typecache(W, GLOB.closet_cutting_types) && user.a_intent == INTENT_HARM)
to_chat(user, span_notice("You begin cutting off electronic lock \the [src]..."))
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin cutting \the [src] lock..."))
while(obj_integrity > integrity_failure)
if(W.use_tool(src, user, 40, volume=50))
if(opened)
return
user.visible_message(span_notice("[user] melts the lock of \the [src]."),
span_notice("You melting the lock of \the [src] with \the [W]."),
span_italics("You hear welding."))
obj_integrity -= 40
if(obj_integrity <= integrity_failure)
bust_open()
else if(W.tool_behaviour == TOOL_WELDER && can_weld_shut)
if(!W.tool_start_check(user, amount=0))
return

to_chat(user, span_notice("You begin [welded ? "unwelding":"welding"] \the [src]..."))
if(W.use_tool(src, user, 40, volume=50))
if(opened)
return
welded = !welded
after_weld(welded)
update_airtightness()
user.visible_message(span_notice("[user] [welded ? "welds shut" : "unwelded"] \the [src]."),
span_notice("You [welded ? "weld" : "unwelded"] \the [src] with \the [W]."),
span_italics("You hear welding."))
update_appearance(UPDATE_ICON)
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
if(isinspace() && !anchored)
return
setAnchored(!anchored)
W.play_tool_sound(src, 75)
user.visible_message(span_notice("[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
span_notice("You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
span_italics("You hear a ratchet."))
else if(user.a_intent != INTENT_HARM)
var/item_is_id = W.GetID()
if(!item_is_id && !(W.item_flags & NOBLUDGEON))
return FALSE
if(item_is_id || !toggle(user))
togglelock(user)
else
return FALSE
1 change: 1 addition & 0 deletions modular_dripstation/includes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "code\modules\atmospherics\machinery\other\meter.dm"
#include "code\modules\awaymissions\mission_code\Academy.dm"
#include "code\modules\clothing\_neck.dm"
#include "code\game\objects\structures\crates_lockers\closets.dm"
#include "code\modules\economy\pay_stand.dm"
#include "code\modules\events\wizard\greentext.dm"
#include "code\modules\research\stock_parts.dm"
Expand Down
Loading