Files
Bubberstation/code/modules/unit_tests/emp_flashlight.dm
MrMelbert 34d35c6048 Adds a bunch of interaction related unit tests (#88210)
## About The Pull Request

I made these a year ago and meant to PR them but never got around to it

Basically just adds a bunch of unit tests for a bunch of specific attack
chain interactions that are prone to breaking due to snowflake

Increasing coverage of attack chain is good so people who are working on
it don't have to worry about the 1000 edge cases breaking

- Blocking (both unarmed and armed)
- Cuffs
- Eyestab
- Flashes (combat mode, non combat mode, with flash protection)
- Help intent
- Pistol whip
- Butchering with a bayonet 
- Damp rag smothering
- Droppers
- EMP flashlights
- Holofans
- Door attack hand redirector
- Tool usage on Cyborgs
- Punching Cyborgs
- Ability to bash tables
- Ability to bash any structure
- Ability to use tools on machinery
- Kinetic Crusher projectile
- Spraycans (capping, making graffiti) 
- Loading a syringe gun
2024-11-27 11:38:43 -07:00

19 lines
678 B
Plaintext

/// Test EMP flashlight EMPs people you point it at
/datum/unit_test/emp_flashlight
var/sig_caught = 0
/datum/unit_test/emp_flashlight/Run()
var/mob/living/carbon/human/consistent/flashlighter = EASY_ALLOCATE()
var/mob/living/carbon/human/consistent/victim = EASY_ALLOCATE()
var/obj/item/flashlight/emp/debug/flashlight = EASY_ALLOCATE()
flashlighter.put_in_active_hand(flashlight, forced = TRUE)
RegisterSignal(victim, COMSIG_ATOM_EMP_ACT, PROC_REF(sig_caught))
click_wrapper(flashlighter, victim)
TEST_ASSERT_NOTEQUAL(sig_caught, 0, "EMP flashlight did not EMP the target on click.")
/datum/unit_test/emp_flashlight/proc/sig_caught()
SIGNAL_HANDLER
sig_caught++