Files
Bubberstation/code/modules/unit_tests/spraycan.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

23 lines
962 B
Plaintext

/// Tests spray painting the ground to create graffiti.
/datum/unit_test/spraypainting
/datum/unit_test/spraypainting/Run()
var/mob/living/carbon/human/consistent/artist = EASY_ALLOCATE()
var/obj/item/toy/crayon/spraycan/can = EASY_ALLOCATE()
var/turf/spray_turf = get_turf(artist)
artist.put_in_active_hand(can, forced = TRUE)
// Try to spray with a capped spraycan.
click_wrapper(artist, spray_turf)
TEST_ASSERT_EQUAL(can.charges, can.charges_left, "Spraypaint sprayed paint while capped.")
// Uncap it
click_wrapper(artist, can, list(ALT_CLICK = TRUE, BUTTON = ALT_CLICK))
TEST_ASSERT(!can.is_capped, "Spraypaint did not uncap when alt-clicked.")
// Try to spray with an uncapped spraycan.
click_wrapper(artist, spray_turf)
TEST_ASSERT_NOTEQUAL(can.charges, can.charges_left, "Spraypaint did not spray any paint when clicking on a turf with it.")
// Cleanup
for(var/obj/effect/decal/cleanable/crayon/made_art in spray_turf)
qdel(made_art)