mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 15:01:04 +01:00
Autakh Deployable Baton (#22926)
* The Autakh integrated stun baton can now be deployed and used like a normal baton. The ten second cooldown between hits, reduced stats, and nutrition loss for use remains as before. AI usage disclosure: The code for this was created in-part using GPT 5.6 Sol. (Sprites done manually by myself.)
This commit is contained in:
@@ -411,7 +411,8 @@
|
||||
|
||||
/obj/item/organ/external/hand/right/autakh/security
|
||||
name = "security grasper"
|
||||
action_button_name = "Activate Integrated Electroshock Weapon"
|
||||
action_button_name = "Deploy Integrated Stun Baton"
|
||||
var/augment_type = /obj/item/melee/baton/autakh
|
||||
|
||||
/obj/item/organ/external/hand/right/autakh/security/refresh_action_button()
|
||||
. = ..()
|
||||
@@ -433,6 +434,10 @@
|
||||
to_chat(owner, SPAN_DANGER("You can not use \the [src] in your current state!"))
|
||||
return
|
||||
|
||||
if(owner.get_active_hand())
|
||||
to_chat(owner, SPAN_DANGER("You must empty your active hand before enabling your [src]!"))
|
||||
return
|
||||
|
||||
if(is_broken())
|
||||
to_chat(owner, SPAN_DANGER("\The [src] is too damaged to be used!"))
|
||||
return
|
||||
@@ -440,30 +445,76 @@
|
||||
if(is_bruised())
|
||||
spark(get_turf(owner), 3)
|
||||
|
||||
var/obj/item/grab/G = owner.get_active_hand()
|
||||
if(!istype(G))
|
||||
to_chat(owner, SPAN_DANGER("You must grab someone before trying to use your [src]!"))
|
||||
return
|
||||
var/obj/item/M = new augment_type(owner)
|
||||
owner.put_in_active_hand(M)
|
||||
owner.visible_message(SPAN_NOTICE("\The [M] slides out of \the [owner]'s [src]."),
|
||||
SPAN_NOTICE("You deploy \the [M]!"))
|
||||
|
||||
if(owner.nutrition <= 200)
|
||||
to_chat(owner, SPAN_DANGER("Your energy reserves are too low to use your [src]!"))
|
||||
return
|
||||
/obj/item/melee/baton/autakh
|
||||
name = "integrated stun baton"
|
||||
desc = "An electroshock baton integrated into an Aut'akh security grasper. It retracts when released."
|
||||
icon = 'icons/obj/item/autakh_baton.dmi'
|
||||
icon_state = "autakh_baton"
|
||||
item_state = "autakh_baton"
|
||||
contained_sprite = TRUE
|
||||
force = 5
|
||||
agonyforce = 50
|
||||
status = TRUE
|
||||
sheathed = TRUE
|
||||
|
||||
if(ishuman(G.affecting))
|
||||
/obj/item/melee/baton/autakh/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. = list()
|
||||
. += "Left-click the baton in-hand to toggle its electroshock function."
|
||||
. += "On Harm intent, it inflicts damage whether or not the electroshock function is on."
|
||||
. += "The baton draws power from its user's energy reserves and retracts when dropped."
|
||||
|
||||
var/mob/living/carbon/human/H = G.affecting
|
||||
var/target_zone = check_zone(owner.zone_sel.selecting)
|
||||
/obj/item/melee/baton/autakh/feedback_hints(mob/user, distance, is_adjacent)
|
||||
. = list()
|
||||
if(distance > 1)
|
||||
return
|
||||
. += "The baton is powered by its user's energy reserves."
|
||||
|
||||
owner.last_special = world.time + 100
|
||||
owner.adjustNutritionLoss(50)
|
||||
/obj/item/melee/baton/autakh/update_icon()
|
||||
icon_state = status ? "[initial(icon_state)]_active" : initial(icon_state)
|
||||
if(status)
|
||||
set_light(1.3, 1, baton_color)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
if(owner.a_intent == I_HURT)
|
||||
H.electrocute_act(10, owner, def_zone = target_zone)
|
||||
else
|
||||
H.stun_effect_act(0, 50, target_zone, owner)
|
||||
/obj/item/melee/baton/autakh/attack_self(mob/user)
|
||||
status = !status
|
||||
to_chat(user, SPAN_NOTICE("[src] is now [status ? "on" : "off"]."))
|
||||
playsound(loc, SFX_SPARKS, 75, 1, -1)
|
||||
update_icon()
|
||||
add_fingerprint(user)
|
||||
|
||||
owner.visible_message(SPAN_DANGER("[H] has been prodded with [src] by [owner]!"))
|
||||
playsound(get_turf(owner), 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
/obj/item/melee/baton/autakh/attack(mob/living/target_mob, mob/living/user, target_zone)
|
||||
if(status)
|
||||
if(user.last_special > world.time)
|
||||
to_chat(user, SPAN_DANGER("\The [src] is still recharging!"))
|
||||
return FALSE
|
||||
if(user.nutrition <= 200)
|
||||
to_chat(user, SPAN_DANGER("Your energy reserves are too low to use \the [src]!"))
|
||||
return FALSE
|
||||
|
||||
. = ..()
|
||||
if(. && status)
|
||||
user.last_special = world.time + 10 SECONDS
|
||||
user.adjustNutritionLoss(50)
|
||||
|
||||
/obj/item/melee/baton/autakh/deductcharge(chrgdeductamt)
|
||||
return TRUE
|
||||
|
||||
/obj/item/melee/baton/autakh/attackby(obj/item/attacking_item, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/melee/baton/autakh/throw_at()
|
||||
usr.drop_from_inventory(src)
|
||||
|
||||
/obj/item/melee/baton/autakh/dropped()
|
||||
. = ..()
|
||||
loc = null
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/external/hand/right/autakh/tool/nullrod
|
||||
name = "blessed prosthesis"
|
||||
|
||||
Reference in New Issue
Block a user