fixes a bunch of broken clickdelays (#13218)

* fixes

* fix
This commit is contained in:
silicons
2020-08-25 11:58:20 -07:00
committed by GitHub
parent d4196650fd
commit 8699ce2174
6 changed files with 32 additions and 16 deletions

View File

@@ -32,4 +32,4 @@
/mob/camera/blob/AltClickOn(atom/A) //Remove a blob
var/turf/T = get_turf(A)
if(T)
remove_blob(T)
remove_blob(T)

View File

@@ -86,6 +86,10 @@
/obj/structure/grille/attack_animal(mob/user)
. = ..()
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return
user.DelayNextAction(flush = TRUE)
user.do_attack_animation(src)
if(!shock(user, 70) && !QDELETED(src)) //Last hit still shocks but shouldn't deal damage to the grille)
take_damage(rand(5,10), BRUTE, "melee", 1)
@@ -114,12 +118,12 @@
/obj/structure/grille/attack_alien(mob/living/user)
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return
user.DelayNextAction(flush = TRUE)
user.do_attack_animation(src)
user.visible_message("<span class='warning'>[user] mangles [src].</span>", null, null, COMBAT_MESSAGE_RANGE)
if(!shock(user, 70))
take_damage(20, BRUTE, "melee", 1)
/obj/structure/grille/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
return TRUE

View File

@@ -97,9 +97,12 @@ All foods are distributed among various categories. Use common sense.
return
/obj/item/reagent_containers/food/snacks/attack(mob/living/M, mob/living/user, def_zone)
/obj/item/reagent_containers/food/snacks/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
if(user.a_intent == INTENT_HARM)
return ..()
INVOKE_ASYNC(src, .proc/attempt_forcefeed, M, user)
/obj/item/reagent_containers/food/snacks/proc/attempt_forcefeed(mob/living/M, mob/living/user)
if(!eatverb)
eatverb = pick("bite","chew","nibble","gnaw","gobble","chomp")
if(!reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it.

View File

@@ -103,6 +103,7 @@
throwforce = 5
throw_speed = 2
throw_range = 3
attack_speed = CLICK_CD_MELEE
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
armour_penetration = 20
@@ -125,9 +126,12 @@
playsound(src,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1)
return (BRUTELOSS)
/obj/item/scythe/pre_attack(atom/A, mob/living/user, params)
/obj/item/scythe/pre_attack(atom/A, mob/living/user, params, attackchain_flags, damage_multiplier)
. = ..()
if(. & STOP_ATTACK_PROC_CHAIN)
return
if(swiping || !istype(A, /obj/structure/spacevine) || get_turf(A) == get_turf(user))
return ..()
return
else
var/turf/user_turf = get_turf(user)
var/dir_to_target = get_dir(user_turf, get_turf(A))
@@ -138,11 +142,12 @@
var/turf/T = get_step(user_turf, turn(dir_to_target, i))
for(var/obj/structure/spacevine/V in T)
if(user.Adjacent(V))
melee_attack_chain(user, V)
melee_attack_chain(user, V, attackchain_flags = ATTACK_IGNORE_CLICKDELAY)
stam_gain += 5 //should be hitcost
swiping = FALSE
stam_gain += 2 //Initial hitcost
user.adjustStaminaLoss(-stam_gain)
user.DelayNextAction()
// *************************************
// Nutrient defines for hydroponics
@@ -192,4 +197,4 @@
/obj/item/reagent_containers/glass/bottle/killer/pestkiller
name = "bottle of pest spray"
desc = "Contains a pesticide."
list_reagents = list(/datum/reagent/toxin/pestkiller = 50)
list_reagents = list(/datum/reagent/toxin/pestkiller = 50)

View File

@@ -87,7 +87,7 @@
if(user != src && (user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM))
for(var/datum/surgery/S in surgeries)
if(S.next_step(user,user.a_intent))
return 1
return STOP_ATTACK_PROC_CHAIN
if(!all_wounds || !(user.a_intent == INTENT_HELP || user == src))
return ..()
@@ -95,7 +95,7 @@
for(var/i in shuffle(all_wounds))
var/datum/wound/W = i
if(W.try_treating(I, user))
return 1
return STOP_ATTACK_PROC_CHAIN
return ..()

View File

@@ -19,6 +19,10 @@
var/stream_range = 1 //the range of tiles the sprayer will reach when in stream mode.
var/stream_amount = 10 //the amount of reagents transfered when in stream mode.
var/spray_delay = 3 //The amount of sleep() delay between each chempuff step.
/// Last world.time of spray
var/last_spray = 0
/// Spray cooldown
var/spray_cooldown = CLICK_CD_MELEE
var/can_fill_from_container = TRUE
amount_per_transfer_from_this = 5
volume = 250
@@ -27,8 +31,6 @@
/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user)
. = ..()
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return
if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics))
return
@@ -49,7 +51,8 @@
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
spray(A)
if(!spray(A))
return
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
user.last_action = world.time
@@ -64,10 +67,10 @@
if(reagents.has_reagent(/datum/reagent/lube))
message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [ADMIN_VERBOSEJMP(T)].")
log_game("[key_name(user)] fired Space lube from \a [src] at [AREACOORD(T)].")
return
/obj/item/reagent_containers/spray/proc/spray(atom/A)
if((last_spray + spray_cooldown) > world.time)
return
var/range = clamp(get_dist(src, A), 1, current_range)
var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src))
D.create_reagents(amount_per_transfer_from_this, NONE, NO_REAGENTS_VALUE)
@@ -79,10 +82,11 @@
reagents.trans_to(D, amount_per_transfer_from_this, 1/range)
D.color = mix_color_from_reagents(D.reagents.reagent_list)
var/wait_step = max(round(2+ spray_delay * INVERSE(range)), 2)
do_spray(A, wait_step, D, range, puff_reagent_left)
last_spray = world.time
INVOKE_ASYNC(src, .proc/do_spray, A, wait_step, D, range, puff_reagent_left)
return TRUE
/obj/item/reagent_containers/spray/proc/do_spray(atom/A, wait_step, obj/effect/decal/chempuff/D, range, puff_reagent_left)
set waitfor = FALSE
var/range_left = range
for(var/i=0, i<range, i++)
range_left--