Refactor audio effect handling: remove cooldown logic and enhance sound playback functionality

This commit is contained in:
Kirill
2026-10-03 13:36:33 +03:00
parent 9e13c8bbe3
commit 6f6a1be3bd
8 changed files with 58 additions and 22 deletions
+13 -2
View File
@@ -176,8 +176,19 @@ func run() -> void:
world.state.amount.Met = 100
world.state.auto_resources.H = 100
world.evolute(E.of("0.1"))
check((E.eq(world.state.amount.RD, 101) and E.eq(world.state.amount.H, 0)), "Automatic formation uses its resource budget")
check(E.ge(world.state.binds.RD.HP, 1), "Automatic formation also creates planets")
check((E.eq(world.state.amount.RD, 1) and E.eq(world.state.amount.H, 100)), "Automatic formation cannot spend hydrogen retained from an earlier cycle")
check(E.eq(world.state.auto_resources.get("H", 0), 0), "Unused automatic hydrogen becomes an ordinary free resource")
dispose(world)
world = fixture()
world.catalog.entities.N.auto = 1
world.state.amount.RD = 1
world.state.amount.H = 100
world.state.amount.Met = 100
world.evolute(100)
check(E.gt(world.state.amount.RD, 1), "Automatic formation can spend newly produced hydrogen")
check(E.ge(world.state.amount.H, 100), "Automatic formation preserves hydrogen available before the cycle")
check(E.ge(world.state.binds.get("RD", {}).get("HP", 0), 1), "Automatic formation also creates planets")
dispose(world)
world = fixture()