/
Lachklen
/
MYtgstation
Обзор
Документация
Войти
/
Lachklen
/
MYtgstation
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
code/modules/unit_tests/embedding.dm
13 строк
755 B
SmArtKar
Implements datumized embedding handlers in place of element-component-datum triad (#88511)
03 янв 2025, 02:18
Не верифицирован
03 янв 2025, 02:18
3499727
Код
Авторство
О чём код?
/datum/unit_test/embedding /datum/unit_test/embedding/Run() var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent) var/mob/living/carbon/human/firer = allocate(/mob/living/carbon/human/consistent) var/obj/projectile/bullet/c38/bullet = new(get_turf(firer)) bullet.get_embed().embed_chance = 100 TEST_ASSERT_EQUAL(bullet.get_embed().embed_chance, 100, "embed_chance failed to modify") bullet.aim_projectile(victim, firer) bullet.fire(get_angle(firer, victim), victim) var/obj/item/shrapnel/shrapnel = locate() in victim TEST_ASSERT(!isnull(shrapnel), "Projectile with 100% embed chance didn't embed") TEST_ASSERT_EQUAL(shrapnel.get_embed().embed_chance, 100, "embed_chance modification did not transfer to shrapnel")