Open
Conversation
…ices
Combat style indices are weapon-dependent (e.g. index 3 means Defence for
swords but doesn't exist for unarmed), causing silent training bugs.
Changes:
- sendSetCombatStyle() now accepts TrainableSkill names ('Attack',
'Strength', 'Defence', 'Ranged', 'Shared') in addition to raw indices
- Add getCombatStyle() convenience method to BotSDK
- Add setCombatStyle() porcelain method to BotActions that waits for
the style change to take effect
- Add TrainableSkill type and SetCombatStyleResult to types.ts
- Add integration test (sdk/test/combat-style.ts)
- Update learnings/combat.md with name-based API examples
Closes #20
https://claude.ai/code/session_01JQF7su76pQyGyixghdNRuL
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.
Summary
Implements a name-based combat style API that allows setting combat styles by trained skill name (e.g., 'Attack', 'Strength', 'Defence') instead of opaque weapon-specific indices. The SDK automatically resolves skill names to the correct style index for the currently equipped weapon.
Key Changes
New
sendSetCombatStyle()overload: Now accepts both numeric indices (for backwards compatibility) and skill names as strings. Automatically resolves skill names to the correct index based on the equipped weapon's available styles.New porcelain
bot.setCombatStyle()method: High-level API that sets combat style by skill name and waits for the effect to take place. Returns a typedSetCombatStyleResultwith success status, the matched style object, and a reason code for failures (no_matching_style,already_set, etc.).New
getCombatStyle()convenience method: Returns the currentCombatStyleStatecontaining the equipped weapon name, current style index, and available styles with their trained skills.New types:
TrainableSkilltype for skill name validationSetCombatStyleResultinterface with detailed result information and reason codesUpdated documentation:
learnings/combat.mdnow shows the new skill-name-based API with examples, replacing the old index-based approach. Includes examples of error handling and balanced training patterns.Comprehensive test coverage: New
combat-style.tstest file verifies:Implementation Details
already_setreasonhttps://claude.ai/code/session_01JQF7su76pQyGyixghdNRuL