test suite: mob attack chain (#28440)

* test suite: mob attack chain

* 100% random zone probability in tests
This commit is contained in:
warriorstar-orion
2025-02-20 10:03:21 -05:00
committed by GitHub
parent 0c48363fd1
commit 6359d3f41b
10 changed files with 189 additions and 4 deletions
@@ -22,6 +22,7 @@
var/last_eaten = 0
footstep_type = FOOTSTEP_MOB_CLAW
var/next_spin_message = 0
var/razor_shave_delay = 5 SECONDS
/mob/living/simple_animal/pet/dog/npc_safe(mob/user)
return TRUE
@@ -193,7 +194,7 @@
to_chat(user, "<span class='warning'>You can't shave this corgi, it doesn't have a fur coat!</span>")
return
user.visible_message("<span class='notice'>[user] starts to shave [src] using \the [O].", "<span class='notice'>You start to shave [src] using \the [O]...</span>")
if(do_after(user, 50, target = src))
if(do_after(user, razor_shave_delay, target = src))
user.visible_message("<span class='notice'>[user] shaves [src]'s hair using \the [O].</span>")
playsound(loc, O.usesound, 20, TRUE)
shaved = TRUE
+3 -1
View File
@@ -211,7 +211,9 @@
// Do not use this if someone is intentionally trying to hit a specific body part.
// Use get_zone_with_miss_chance() for that.
/proc/ran_zone(zone, probability = 80)
#ifdef GAME_TESTS
probability = 100
#endif
zone = check_zone(zone)
if(prob(probability))