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

27 lines
1.1 KiB
Plaintext

/datum/unit_test/welder_combat
/datum/unit_test/welder_combat/Run()
var/mob/living/carbon/human/consistent/tider = EASY_ALLOCATE()
var/mob/living/carbon/human/consistent/victim = EASY_ALLOCATE()
var/obj/item/weldingtool/weapon = EASY_ALLOCATE()
tider.put_in_active_hand(weapon, forced = TRUE)
tider.set_combat_mode(TRUE)
weapon.attack_self(tider)
weapon.melee_attack_chain(tider, victim)
TEST_ASSERT_NOTEQUAL(victim.getFireLoss(), 0, "Victim did not get burned by welder.")
TEST_ASSERT_EQUAL(weapon.get_fuel(), weapon.max_fuel - 1, "Welder did not consume fuel on attacking a mob")
var/obj/structure/blob/blobby = EASY_ALLOCATE()
weapon.melee_attack_chain(tider, blobby)
TEST_ASSERT_NOTEQUAL(blobby.get_integrity(), blobby.max_integrity, "Blob did not get burned by welder.")
TEST_ASSERT_EQUAL(weapon.get_fuel(), weapon.max_fuel - 2, "Welder did not consume fuel on attacking a blob")
weapon.force = 999
weapon.melee_attack_chain(tider, blobby)
TEST_ASSERT(QDELETED(blobby), "Blob was not destroyed by welder.")
TEST_ASSERT_EQUAL(weapon.get_fuel(), weapon.max_fuel - 3, "Welder did not consume fuel on deleting a blob")