feat(combat): implement CombatAction data model with 19 properties #328

Merged
freemo merged 5 commits from feature/m4-combat-action into master 2026-04-01 20:36:33 +00:00
Owner

Summary

Implements Issue #269: CombatAction data model as a frozen value object with all 19 properties defined in the Deterministic Combat System specification.

Changes

  • Created lib/aethyr/core/combat/combat_action.rb with CombatAction class
  • All 19 properties implemented with proper types and validation:
    • id (String, required)
    • action_type (Symbol, required)
    • actor_id (String, required)
    • target_id (String, optional)
    • body_zone (Symbol, optional)
    • damage_type (Symbol, optional)
    • base_damage (Integer, default 0)
    • ap_cost (Integer, default 1)
    • reach (Integer, default 1)
    • telegraph_rounds (Integer, default 0)
    • cooldown_rounds (Integer, default 0)
    • stamina_cost (Integer, default 0)
    • requires_weapon (Boolean, default false)
    • requires_shield (Boolean, default false)
    • combo_chain (Array, default [])
    • status_effects (Array, default [])
    • animation_id (String, optional)
    • sound_id (String, optional)
    • metadata (Hash, default {})
  • Immutable design with freeze after initialization
  • Type validation with descriptive error messages
  • Factory method CombatAction.build for convenient construction
  • Full BDD test coverage with Cucumber/Gherkin

Testing

  • 67 unit test scenarios (198 steps) - ALL PASSING
  • 3 integration test scenarios (10 steps) - ALL PASSING
  • RuboCop passes with no new violations

Closes

Closes #269

## Summary Implements Issue #269: CombatAction data model as a frozen value object with all 19 properties defined in the Deterministic Combat System specification. ## Changes - Created `lib/aethyr/core/combat/combat_action.rb` with CombatAction class - All 19 properties implemented with proper types and validation: - id (String, required) - action_type (Symbol, required) - actor_id (String, required) - target_id (String, optional) - body_zone (Symbol, optional) - damage_type (Symbol, optional) - base_damage (Integer, default 0) - ap_cost (Integer, default 1) - reach (Integer, default 1) - telegraph_rounds (Integer, default 0) - cooldown_rounds (Integer, default 0) - stamina_cost (Integer, default 0) - requires_weapon (Boolean, default false) - requires_shield (Boolean, default false) - combo_chain (Array, default []) - status_effects (Array, default []) - animation_id (String, optional) - sound_id (String, optional) - metadata (Hash, default {}) - Immutable design with `freeze` after initialization - Type validation with descriptive error messages - Factory method `CombatAction.build` for convenient construction - Full BDD test coverage with Cucumber/Gherkin ## Testing - 67 unit test scenarios (198 steps) - ALL PASSING - 3 integration test scenarios (10 steps) - ALL PASSING - RuboCop passes with no new violations ## Closes Closes #269
freemo added this to the v1.3.0 milestone 2026-03-23 05:29:25 +00:00
freemo force-pushed feature/m4-combat-action from 9911e6aa5d
Some checks failed
CI / type_check (pull_request) Failing after 16m5s
CI / integration_tests (pull_request) Failing after 16m7s
CI / unit_tests (pull_request) Failing after 16m19s
CI / lint (pull_request) Failing after 25m52s
CI / build (pull_request) Has been skipped
to c6b1d7a4e2
Some checks failed
CI / integration_tests (pull_request) Failing after 16m8s
CI / unit_tests (pull_request) Failing after 16m8s
CI / lint (pull_request) Failing after 20m15s
CI / build (pull_request) Has been skipped
CI / type_check (pull_request) Failing after 21m4s
2026-03-24 17:25:08 +00:00
Compare
freemo force-pushed feature/m4-combat-action from c6b1d7a4e2
Some checks failed
CI / integration_tests (pull_request) Failing after 16m8s
CI / unit_tests (pull_request) Failing after 16m8s
CI / lint (pull_request) Failing after 20m15s
CI / build (pull_request) Has been skipped
CI / type_check (pull_request) Failing after 21m4s
to bf634a417d
Some checks failed
CI / unit_tests (pull_request) Failing after 40m53s
CI / build (pull_request) Has been skipped
CI / type_check (pull_request) Failing after 39s
CI / integration_tests (pull_request) Failing after 13m44s
CI / lint (pull_request) Failing after 19m35s
2026-03-31 03:25:20 +00:00
Compare
freemo force-pushed feature/m4-combat-action from bf634a417d
Some checks failed
CI / unit_tests (pull_request) Failing after 40m53s
CI / build (pull_request) Has been skipped
CI / type_check (pull_request) Failing after 39s
CI / integration_tests (pull_request) Failing after 13m44s
CI / lint (pull_request) Failing after 19m35s
to deea54cc22
Some checks failed
CI / lint (pull_request) Successful in 1m15s
CI / type_check (pull_request) Successful in 12m37s
CI / integration_tests (pull_request) Failing after 17m19s
CI / unit_tests (pull_request) Failing after 21m19s
CI / build (pull_request) Has been skipped
2026-03-31 19:36:34 +00:00
Compare
freemo force-pushed feature/m4-combat-action from deea54cc22
Some checks failed
CI / lint (pull_request) Successful in 1m15s
CI / type_check (pull_request) Successful in 12m37s
CI / integration_tests (pull_request) Failing after 17m19s
CI / unit_tests (pull_request) Failing after 21m19s
CI / build (pull_request) Has been skipped
to 599df2cc97
Some checks failed
CI / type_check (pull_request) Successful in 48s
CI / lint (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Failing after 4m30s
CI / unit_tests (pull_request) Failing after 24m12s
CI / build (pull_request) Has been skipped
2026-03-31 21:13:40 +00:00
Compare
freemo force-pushed feature/m4-combat-action from 599df2cc97
Some checks failed
CI / type_check (pull_request) Successful in 48s
CI / lint (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Failing after 4m30s
CI / unit_tests (pull_request) Failing after 24m12s
CI / build (pull_request) Has been skipped
to 6b4284319e
Some checks failed
CI / lint (pull_request) Failing after 2s
CI / type_check (pull_request) Successful in 42s
CI / integration_tests (pull_request) Failing after 1m57s
CI / unit_tests (pull_request) Failing after 21m33s
CI / build (pull_request) Has been skipped
2026-04-01 00:21:20 +00:00
Compare
freemo force-pushed feature/m4-combat-action from 6b4284319e
Some checks failed
CI / lint (pull_request) Failing after 2s
CI / type_check (pull_request) Successful in 42s
CI / integration_tests (pull_request) Failing after 1m57s
CI / unit_tests (pull_request) Failing after 21m33s
CI / build (pull_request) Has been skipped
to 1f3419f051
Some checks failed
CI / type_check (pull_request) Successful in 48s
CI / lint (pull_request) Successful in 1m23s
CI / integration_tests (pull_request) Failing after 1m31s
CI / unit_tests (pull_request) Failing after 21m28s
CI / build (pull_request) Has been skipped
2026-04-01 01:18:04 +00:00
Compare
freemo force-pushed feature/m4-combat-action from 1f3419f051
Some checks failed
CI / type_check (pull_request) Successful in 48s
CI / lint (pull_request) Successful in 1m23s
CI / integration_tests (pull_request) Failing after 1m31s
CI / unit_tests (pull_request) Failing after 21m28s
CI / build (pull_request) Has been skipped
to f65e9f9943
Some checks failed
CI / type_check (pull_request) Successful in 39s
CI / unit_tests (pull_request) Failing after 46s
CI / lint (pull_request) Successful in 1m10s
CI / integration_tests (pull_request) Failing after 1m24s
CI / build (pull_request) Has been skipped
2026-04-01 01:53:27 +00:00
Compare
fix: restore config.yaml and preserve Combat namespace in test stubs
Some checks failed
CI / type_check (pull_request) Successful in 38s
CI / lint (pull_request) Successful in 1m23s
CI / unit_tests (pull_request) Failing after 53s
CI / integration_tests (pull_request) Successful in 4m1s
CI / build (pull_request) Has been skipped
e5fc1befe8
- Revert config.yaml address from '7' to 127.0.0.1 (fixes server startup)
- Revert config.yaml log_level and start_room to master values
- Fix Combat namespace stubbing in test step definitions to preserve
  existing module contents (CombatAction, ShieldResolver, etc.)
  instead of replacing Aethyr::Core::Combat with an empty stub
- Affected files: slash_steps, kick_command_steps, punch_command_steps,
  simple_block_steps, simple_dodge_steps
fix: guard against duplicate ParameterType registration in shield_moves_steps
Some checks failed
CI / type_check (pull_request) Successful in 47s
CI / lint (pull_request) Successful in 1m13s
CI / integration_tests (pull_request) Successful in 3m58s
CI / unit_tests (pull_request) Successful in 21m19s
CI / build (pull_request) Successful in 41s
CI / unit_tests (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / type_check (push) Has been cancelled
CI / build (push) Has been cancelled
CI / lint (push) Has been cancelled
a47d298725
The shield_moves_steps.rb and lifecycle_hooks_steps.rb both define
a 'symbol' ParameterType. Wrap the definitions in begin/rescue to
handle the case where another step file has already registered them.
freemo merged commit a47d298725 into master 2026-04-01 20:36:33 +00:00
freemo deleted branch feature/m4-combat-action 2026-04-01 20:36:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aethyr/Aethyr!328
No description provided.