Skip to content

feat: Add parsing for new fight rounds - #257

Merged
the-marenga merged 24 commits into
mainfrom
fight-parsing-v2
Aug 2, 2026
Merged

feat: Add parsing for new fight rounds#257
the-marenga merged 24 commits into
mainfrom
fight-parsing-v2

Conversation

@the-marenga

Copy link
Copy Markdown
Owner

This is largely AI written, but under supervision and it works.
Will need to review, but should close #47

- Add FightAction.actor_life to track acting fighter's HP per round
- Parse 9-value round format: actor_id/0/action/outcome/0/actor_hp/target_hp/0/0
- Handle outcome=3 (Blocked), outcome=4 (Evaded) split from action type
- Fix fighter split to maintain backward compatibility at split_at(47)
- Early return guard for fight_version != 2
- Remove old comma-separated 3-value fight format parsing
- Store raw equipment data as Vec<Vec<i64>> on SingleFight
- Handle fightequipmentN keys with count-prefixed format
- Handle fightdecorationN and externaltoolequipmentN keys silently
- Fix race condition with HashMap key ordering by storing equipment
  at the SingleFight level instead of on Fighter
- Add name-based detection for archers (name=-732) and mages (name=-722)
- Parse fightadditionalplayers key data for additional fighter mapping
- Add PlayerCombatLogView command to view combat log fight replays
- McCoove fight: 85 sub-fights (6 Wall → 53 Archers → 26 Mages)
- Dynamic 9/12/15-value stride detection for fight round data
- Separate FightOutcome enum (Normal/Blocked/Evaded) from FightActionType
- Add SummonedMinion enum (Skeleton/Hound/Golem) with MinionState
- Parse minion state from extra metadata in 12-value and 15-value chunks
- Store actor_minion/opponent_minion on FightAction
- Remove unused Blocked/Evaded/MinionAttack variants from FightActionType
- Store raw int in Unknown variant for debugging
- Use range patterns for fortress fighter type detection (-71x Soldier,
  -72x Mage, -73x Archer, -74x to -79x Wall) to handle level variants
- Rename FortressPillager to FortressSoldier
- Add BattleMageFireball (10), Revive (14), AssassinMainHand (100),
  AssassinOffHand (101) action types
- Add FighterState enum to decode pos1/pos4 values into Normal,
  BearForm, DefensiveStance, Frenzy, Unknown
- Replace raw pos1/pos4 fields with decoded actor_state/defender_state
- All known arena action types now recognized, zero warnings
- Add ThrowPoison (17, 18) and PoisonTick (19, 20) action types
- Add flag=3 Poison variant to ActiveEffect for PlagueDoctor DoT
- All known action types across all tested fight types now recognized
…tive_effect offsets, cfsuget for acting_id, deduplicated stride p7, single raw_name read in Fighter::parse
- Use i64 values instead of string comparisons for stride detection
- Bound extra_vals to the current action instead of reading to EOF
- Fix 15-value effect ownership using who1/who2 flags
- Replace fragile string-based stride checks with integer matching
- Use crate's CGet and ArrSkip traits for safe bounds-checked access
Change the update_rounds call site to log errors with warn!()
instead of returning them via ?, matching the existing error-handling
pattern used throughout the response parser.
@the-marenga
the-marenga merged commit 987e518 into main Aug 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix fight parsing

1 participant