Smith Polish: Adds access requirements to smith machines (#29295)

* Adds access requirements to smith machines

* No smashy without access

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
This commit is contained in:
PollardTheDragon
2025-05-27 20:53:28 +00:00
committed by GitHub
parent ccde8980d4
commit 5a298513fc
5 changed files with 27 additions and 0 deletions
@@ -148,6 +148,8 @@
update_icon(UPDATE_OVERLAYS)
/obj/machinery/smithing/casting_basin/attack_hand(mob/user)
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
if(!we_are_open)
to_chat(user, "<span class='notice'>You open [src].</span>")
we_are_open = TRUE
@@ -174,6 +174,9 @@
return ITEM_INTERACT_COMPLETE
/obj/machinery/smithing/kinetic_assembler/attack_hand(mob/user)
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
return FINISH_ATTACK
if(!primary)
to_chat(user, "<span class='warning'>[src] lacks a primary component!</span>")
return FINISH_ATTACK
@@ -246,6 +249,7 @@
bound_width = 32
bound_y = 0
operation_sound = 'sound/items/welder.ogg'
req_one_access = list(ACCESS_TOX, ACCESS_XENOBIOLOGY, ACCESS_SMITH)
/// Slime extract for the egun
var/obj/item/slime_extract/slime_core
/// The gun frame
@@ -351,6 +355,9 @@
return ITEM_INTERACT_COMPLETE
/obj/machinery/smithing/scientific_assembler/attack_hand(mob/user)
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
return FINISH_ATTACK
if(!slime_core)
to_chat(user, "<span class='warning'>[src] lacks a slime core!</span>")
return FINISH_ATTACK
@@ -58,6 +58,9 @@
/obj/machinery/smithing/lava_furnace/attack_hand(mob/user)
. = ..()
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
return FINISH_ATTACK
if(operating)
to_chat(user, "<span class='warning'>[src] is currently operating!</span>")
return
@@ -79,6 +79,9 @@
/obj/machinery/smithing/power_hammer/attack_hand(mob/user)
. = ..()
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
return FINISH_ATTACK
if(operating)
to_chat(user, "<span class='warning'>[src] is currently operating!</span>")
return
+12
View File
@@ -12,6 +12,7 @@
anchored = TRUE
density = TRUE
resistance_flags = FIRE_PROOF
req_one_access = list(ACCESS_SMITH)
/// How many loops per operation
var/operation_time = 10
/// Is this active
@@ -66,6 +67,14 @@
return ITEM_INTERACT_COMPLETE
return ..()
/obj/machinery/smithing/emag_act(user as mob)
if(!emagged)
playsound(get_turf(src), 'sound/effects/sparks4.ogg', 75, 1)
req_one_access = list()
emagged = TRUE
to_chat(user, "<span class='notice'>You disable the security protocols</span>")
return TRUE
/obj/machinery/smithing/proc/operate(loops, mob/living/user)
operating = TRUE
update_icon(ALL)
@@ -91,6 +100,9 @@
if(G.state < GRAB_NECK)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return FALSE
if(!allowed(user) && !isobserver(user))
to_chat(user, "<span class='warning'>You try to shove someone into the machine, but your access is denied!</span>")
return FALSE
var/result = special_attack(user, G.affecting)
user.changeNext_move(CLICK_CD_MELEE)
special_attack_on_cooldown = TRUE