mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 15:15:34 +01:00
9546ad2608
* Fix advanced proximity monitors being 1 tile too small (again...) (#84307) ## About The Pull Request Fixes #84301 Right here, https://github.com/tgstation/tgstation/blob/d1051ec8a80b34ca3f3cab2a14e75421e3bae3d6/code/datums/proximity_monitor/field.dm#L129-L132 We get the inner turfs and then use them to find the outer turfs But We subtract the inner turfs from the outer turfs instead of subtracting the outer turfs from the inner turfs... (also adds a unit test and updates the field debugger for better field debugging) ## Changelog 🆑 Melbert fix: Fix timestop being 1 tile too small again, and fixes a lot of other field effects from being 1-small as well /🆑 * Fix advanced proximity monitors being 1 tile too small (again...) --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
31 lines
1.3 KiB
Plaintext
31 lines
1.3 KiB
Plaintext
/// Regression test for timestop being a 3x3 instead of a 5x5
|
|
/datum/unit_test/timestop
|
|
|
|
/datum/unit_test/timestop/Run()
|
|
var/mob/living/carbon/human/dio = allocate(/mob/living/carbon/human/consistent)
|
|
var/mob/living/carbon/human/kakyoin = allocate(/mob/living/carbon/human/consistent)
|
|
var/mob/living/carbon/human/jotaro = allocate(/mob/living/carbon/human/consistent)
|
|
|
|
var/turf/center = run_loc_floor_bottom_left
|
|
var/turf/in_range = locate(center.x + 2, center.y + 2, center.z)
|
|
var/turf/out_of_range = locate(in_range.x + 1, in_range.y + 1, in_range.z)
|
|
|
|
dio.forceMove(center)
|
|
kakyoin.forceMove(in_range)
|
|
jotaro.forceMove(out_of_range)
|
|
|
|
var/datum/action/cooldown/spell/timestop/timestop = new(dio)
|
|
timestop.spell_requirements = NONE
|
|
timestop.Grant(dio)
|
|
timestop.Trigger()
|
|
var/obj/effect/timestop/time_effect = locate() in center
|
|
TEST_ASSERT(time_effect, "Failed to create timestop effect")
|
|
sleep(0.1 SECONDS) // timestop is invoked async so let's just wait
|
|
|
|
TEST_ASSERT(!dio.IsStun(), "Timestopper should not have frozen themselves when using timestop")
|
|
TEST_ASSERT(kakyoin.IsStun(), "Timestopper should have frozen the target within 2 tiles of range when using timestop")
|
|
TEST_ASSERT(!jotaro.IsStun(), "Timestopper should not have frozen the target outside of 2 tiles of range when using timestop")
|
|
|
|
// cleanup
|
|
qdel(time_effect)
|