fix(m98): count the in-flight basic with its tick batch
This commit is contained in:
@@ -256,7 +256,7 @@ func _verify_triggerless() -> void:
|
||||
var entry: Dictionary = Dictionary(record)
|
||||
if str(entry.get("signature", "")) == "EQ-273" and str(entry.get("phase", "")) == "exposed":
|
||||
if exposed == 0:
|
||||
basics_before = _count_basic_events(result, "ally-knife")
|
||||
basics_before = _count_basic_events(result, "ally-knife", int(entry.get("tick", 0)))
|
||||
exposed += 1
|
||||
_expect(exposed >= 1, "the third triggerless basic applies Exposed (exposed=%d)" % exposed)
|
||||
_expect(basics_before >= 3, "Exposed lands after three basics (basics=%d)" % basics_before)
|
||||
@@ -270,13 +270,15 @@ func _verify_triggerless() -> void:
|
||||
_expect(bare_exposed == 0, "without the knife nothing is applied (%d)" % bare_exposed)
|
||||
|
||||
|
||||
func _count_basic_events(battle_result: Dictionary, actor_id: String) -> int:
|
||||
func _count_basic_events(battle_result: Dictionary, actor_id: String, up_to_tick: int) -> int:
|
||||
# The third basic's damage is journaled in the same tick's apply batch, so the
|
||||
# count includes every damage event up to and including that tick.
|
||||
var count := 0
|
||||
for record in Array(battle_result.get("journal", [])):
|
||||
var entry: Dictionary = Dictionary(record)
|
||||
if str(entry.get("signature", "")) == "EQ-273":
|
||||
break
|
||||
if str(entry.get("kind", "")) == "damage" and str(entry.get("actor", "")) == actor_id:
|
||||
if str(entry.get("kind", "")) != "damage" or str(entry.get("actor", "")) != actor_id:
|
||||
continue
|
||||
if int(entry.get("tick", -1)) <= up_to_tick:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
Reference in New Issue
Block a user