109 lines
3.9 KiB
Markdown
109 lines
3.9 KiB
Markdown
# Plan: Improve Low Confidence Ability Parsing
|
|
|
|
## Current State
|
|
- 1,008 abilities have LOW confidence (14.9% of total)
|
|
- All have "No effects parsed" - the parser didn't match any pattern
|
|
|
|
## Pattern Categories to Fix
|
|
|
|
### Priority 1: High Count Patterns (700+ abilities)
|
|
|
|
#### 1.1 "Cannot be X" (148 abilities)
|
|
Examples:
|
|
- "Lann cannot be blocked by a Forward with a power greater than his"
|
|
- "Terra cannot be chosen by opponent's Summons"
|
|
- "Zidane cannot be blocked by a Forward of cost 4 or more"
|
|
|
|
**Effect Type:** `BLOCK_IMMUNITY` or `SELECTION_IMMUNITY`
|
|
**Fields needed:** condition (power comparison, cost comparison), from (opponent summons, etc.)
|
|
|
|
#### 1.2 "IF conditional" (186 abilities)
|
|
Examples:
|
|
- "If this Forward blocks or is blocked by a Forward without First Strike, this Forward deals damage first"
|
|
- "If Shantotto is on the field, it gains Elements of Fire, Ice, Wind..."
|
|
- "If a Forward forming a party with Knight is dealt damage, the damage becomes 0 instead"
|
|
|
|
**Effect Type:** `CONDITIONAL_FIELD_EFFECT`
|
|
**Fields needed:** condition, effect (nested)
|
|
|
|
#### 1.3 "Cost modification" (102 abilities)
|
|
Examples:
|
|
- "The cost required for your opponent to cast Summons increases by 1"
|
|
- "The cost required to play Lightning is reduced by 1 for each [Category (XIII)] Forward"
|
|
- "This Character can attack or use abilities the turn it enters the field" (Haste-like)
|
|
|
|
**Effect Type:** `COST_MODIFIER`
|
|
**Fields needed:** target_cards (filter), amount (static or dynamic), applies_to (self/opponent)
|
|
|
|
#### 1.4 "Your opponent X" (86 abilities)
|
|
Examples:
|
|
- "Your opponent may play 1 Character Card from his/her hand"
|
|
- "Summons or abilities of your opponent must choose Cecil if possible"
|
|
- "Kimahri gains Elements of all the Characters your opponent controls"
|
|
|
|
**Effect Type:** Various - `OPPONENT_ACTION`, `TAUNT`, `GAIN_ELEMENTS`
|
|
|
|
#### 1.5 "Cannot X" (45 abilities)
|
|
Examples:
|
|
- "Lann cannot block a Forward with a power greater than his"
|
|
- "Naji cannot attack"
|
|
- "You cannot play Hooded Man while already in control of either Character"
|
|
|
|
**Effect Type:** `RESTRICTION`
|
|
**Fields needed:** restriction_type (ATTACK, BLOCK, PLAY), condition
|
|
|
|
### Priority 2: Medium Count Patterns (70+ abilities)
|
|
|
|
#### 2.1 "Replacement effect" (32 abilities)
|
|
Examples:
|
|
- "the next damage dealt to you becomes 0 instead"
|
|
- "reduce the damage by 2000 instead"
|
|
|
|
**Effect Type:** `DAMAGE_REPLACEMENT` or `DAMAGE_PREVENTION`
|
|
|
|
#### 2.2 "When trigger (embedded)" (28 abilities)
|
|
These have triggers embedded in FIELD abilities
|
|
|
|
#### 2.3 "Each X" (23 abilities)
|
|
Examples:
|
|
- "each Forward you control gains +1000 power"
|
|
- "each time a card is put into your Break Zone"
|
|
|
|
### Priority 3: Low Count Patterns
|
|
|
|
#### 3.1 "Return X" (17 abilities) - May already be partially handled
|
|
#### 3.2 "You may X" (15 abilities)
|
|
#### 3.3 "Gains ability text" (7 abilities)
|
|
#### 3.4 "All X you control" (4 abilities)
|
|
#### 3.5 "Other" (311 abilities) - Need further categorization
|
|
|
|
## Implementation Plan
|
|
|
|
### Phase 1: Add FIELD ability patterns for common types
|
|
1. Add patterns for "cannot be blocked by X"
|
|
2. Add patterns for "cannot be chosen by X"
|
|
3. Add patterns for "cannot attack/block" (self restriction)
|
|
4. Add patterns for cost modification (increase/reduce for specific cards)
|
|
|
|
### Phase 2: Add conditional wrapper support
|
|
1. Parse "If X, then Y" structure
|
|
2. Support nested effects inside conditionals
|
|
3. Handle "gains X until end of turn" with ability text
|
|
|
|
### Phase 3: Add opponent interaction patterns
|
|
1. "opponent must choose X if possible" (taunt)
|
|
2. "opponent may X" (optional opponent actions)
|
|
3. "gains elements of opponent's cards"
|
|
|
|
### Phase 4: Add replacement effects
|
|
1. "damage becomes 0 instead"
|
|
2. "reduce damage by X instead"
|
|
|
|
### Phase 5: Review remaining "other" category
|
|
- Further categorize the 311 remaining
|
|
- Add patterns for common sub-groups
|
|
|
|
## Expected Outcome
|
|
- Target: Reduce LOW confidence from 1,008 to <300
|
|
- This would bring HIGH confidence from 79.4% to ~90%
|