pre_attack change (#30305)

This commit is contained in:
Contrabang
2025-09-01 21:10:58 +00:00
committed by GitHub
parent f322e8adad
commit e1f42f4673
9 changed files with 30 additions and 29 deletions
+3 -4
View File
@@ -124,7 +124,6 @@ LIGHTERS ARE IN LIGHTERS.DM
var/mob/living/target = A
if(target.on_fire)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(target)
if(target != user)
user.visible_message(
@@ -138,7 +137,7 @@ LIGHTERS ARE IN LIGHTERS.DM
"<span class='notice'>You quickly whip out [src] and nonchalantly light it with your own burning body. Clearly, you have your priorities straight.</span>"
)
light(user, user)
return FINISH_ATTACK
return FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
// The above section doesn't check for carbons to allow ALL burning bodies to be used.
if(!iscarbon(A))
@@ -361,10 +360,10 @@ LIGHTERS ARE IN LIGHTERS.DM
)
if(!do_after(user, 5 SECONDS, target = target))
return ITEM_INTERACT_COMPLETE
else
to_chat(user, "<span_class='notice'>You eat [src].</span>")
playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0)
// A SPICY candy!
@@ -169,16 +169,14 @@
return TRUE
/obj/item/gripper/pre_attack(atom/A, mob/living/user, params)
// This is required to avoid hypersonic interaction speed.
user.changeNext_move(CLICK_CD_MELEE)
. = FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
if(gripped_item)
gripped_item.attack(A, user)
return TRUE
return
if(!ismob(A))
return ..()
. = TRUE
var/mob/living/target = A
// If a human target is horizonal, try to help them up. Unless you're trying to kill them.
if(ishuman(target) && user.a_intent == INTENT_HELP && can_help_up)
+3 -4
View File
@@ -212,7 +212,6 @@
if(!ismob(A))
return
user.changeNext_move(CLICK_CD_MELEE)
var/mob/living/target = A
if(user.a_intent == INTENT_HARM)
@@ -225,7 +224,7 @@
"<span class='danger'>[target == user ? "You prod yourself" : "[user] has prodded you"] with [src]. Luckily it was off.</span>"
)
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
return FINISH_ATTACK
return FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
// Only human mobs can be stunned.
if(!ishuman(target))
@@ -235,11 +234,11 @@
"<span class='danger'>[target == user ? "You prod yourself" : "[user] has prodded you"] with [src]. It doesn't seem to have an effect.</span>"
)
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
return FINISH_ATTACK
return FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
if(baton_stun(target, user))
user.do_attack_animation(target)
return FINISH_ATTACK
return FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
/obj/item/melee/baton/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
+5 -4
View File
@@ -6,15 +6,16 @@
origin_tech = "combat=2;bluespace=4;materials=3"
/obj/item/melee/baton/cattleprod/teleprod/pre_attack(atom/A, mob/living/user, params)
if(..())
return FINISH_ATTACK
. = ..()
if(.)
return
if(!turned_on)
return FINISH_ATTACK
return FINISH_ATTACK | MELEE_COOLDOWN_PREATTACK
if(!ismob(A))
return
var/mob/living/carbon/M
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message(