This commit is contained in:
Forrest 2026-10-01 23:01:56 -04:00
parent 0cba7f5ee0
commit 32ed347b58
172 changed files with 5464 additions and 582 deletions

View file

@ -50,7 +50,7 @@ func _init(card_pool: Dictionary, match_setup: Dictionary, the_bot: Object, opts
options = DEFAULT_OPTIONS.duplicate()
options.merge(opts, true)
bot = the_bot
s = RulesEngine.create_game({"pool": pool, "decks": setup.decks, "seed": setup.seed, "rules": rules, "log": true})
s = RulesEngine.create_game({"pool": pool, "decks": setup.decks, "seed": setup.seed, "rules": rules, "log": true, "events": true})
_settle()
@ -125,6 +125,16 @@ func log_lines() -> Array:
return out
## How many events the game has recorded (see State.emit): pass it to events_since() later.
func event_count() -> int:
return s.events.size() if s.events != null else 0
## Events from index `from` on, as you may see them (State.events_for). Copies.
func events_since(from: int) -> Array:
return State.events_for(s, human, from)
## The current or latest combat, or null.
func combat() -> Variant:
return combats.back() if not combats.is_empty() else null