Eigene Schläge pro Kachel zählen

Als Gast kann die Meldung eines Schlags erst nach dem nächsten Schlag
auf dieselbe Kachel ankommen. Ein Merker pro Kachel ging dabei verloren,
und der brechende Schlag zeigte seine Splitter doch zweimal. Die
Hauptszene zählt ihre noch nicht gemeldeten Schläge deshalb pro Kachel
und vergisst sie, wenn die Welt neu abgeglichen wird.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Steven Wroblewski
2026-10-02 12:19:01 +02:00
parent 55c09b0f1f
commit 69b642cc60
2 changed files with 37 additions and 6 deletions
+19
View File
@@ -406,3 +406,22 @@ func test_an_own_hit_that_breaks_the_rock_shows_its_burst_only_once() -> void:
check_eq(main.session.terrain_at(rock.x, rock.y), GwSession.TERRAIN_GROUND, "three own hits break the rock")
check_eq(main.map_view.burst_count(), 3, "one burst per own hit, none more when the rock breaks")
_clean_up([directory])
func test_own_hits_reported_late_show_no_second_burst() -> void:
var directory := TestFiles.temporary_dir("late")
var main := _start_main(directory)
main.play(false)
var rock: Vector2i = main.session.spawn_point() + Vector2i(7, -2)
main.dig_at(rock)
main._next_dig_tick = 0
main.dig_at(rock)
# As for a guest: the report of the first hit comes after the second hit,
# and the second hit breaks the rock.
var reports: Array[Dictionary] = [
{"type": "tile_hit", "player": main.session.local_player(), "x": rock.x, "y": rock.y},
{"type": "tile_changed", "x": rock.x, "y": rock.y},
]
main._apply(reports)
check_eq(main.map_view.burst_count(), 2, "two own hits, two bursts")
_clean_up([directory])