feat: Add parsing for new fight rounds - #257
Merged
Merged
Conversation
- 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
…ad of raw indexing and as-casts
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is largely AI written, but under supervision and it works.
Will need to review, but should close #47