Skip to content

Trigger player events: join, leave, damage, death, final blow #47

Description

@e54-bot

Problem

Reference workload: /Users/teakowa/Repos/wrightkit/.task-scratch/bastion/bastion.ow (Bastion mode, 291 rules) with scenario /Users/teakowa/Repos/wrightkit/.task-scratch/bastion/scen.json. Run it with cargo run --release -- <ow> <scenario> in /Users/teakowa/Repos/wrightkit/.task-scratch/bastion-run (calls athena_sim::run_scenario and prints the trace). Today it ends not_modeled at rule Update targetPlayer when player left: event team or player filter, tick null.

Bastion has rules on Player Joined Match (5), Player Left Match (3), Player Died (10), Player Took Damage (7), Player Dealt Final Blow (2) and Player Dealt Damage (1). sched.rs stops on any event other than ongoing.

Scope

  • Trigger these player events from (a) scenario events entries (already in the scenario format) and (b) the simulator's own state changes where the cause is modeled: Damage/Heal actions lead to Player Took Damage, Player Dealt Damage, Player Died and Player Dealt Final Blow when health reaches zero. Bind Event Player, Attacker, Victim, Event Damage etc. the way workshop-rs defines them.
  • Honor the team/player filter of the rule (depends on the event-filter issue).
  • A construct or event value with no passing capture fixture stays NotModeled with a precise construct text (AGENTS.md invariant).

Acceptance criteria

  • Tests: a scenario event playerLeftMatch runs a matching rule once with the right Event Player; a Damage action that kills runs Player Died and Player Dealt Final Blow rules in the documented order; a non-matching filter does not run.
  • Bastion run moves past the player-left rule; record the next stop in the PR body.
  • Docs (simulator-interface.md, scenario-format.md) updated in the same PR; the standard gates and wasm32 build pass.

Dependencies

Blocked by the event-filter issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp1Critical path of the current roadmap line, or a bug that hits real workflowsready-for-implementationContract settled; an Engineer can implement without inventing a decision

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions