|
| 1 | +# Super Smash Mobs Brawl Feature Development Guide |
| 2 | + |
| 3 | +## Development Workflow |
| 4 | + |
| 5 | +### Phase 1: Analysis & Planning |
| 6 | + |
| 7 | +1. **Understand the Request** |
| 8 | + - Clarify feature scope, goals, and acceptance criteria |
| 9 | + - Identify which components are needed (Kit, Abilities, Passives, Disguises, Projectiles) |
| 10 | + - Review similar existing features to understand patterns |
| 11 | + |
| 12 | +2. **Working with Legacy Code Snippets** |
| 13 | + - If you are given code snippets, study them carefully and understand how they work |
| 14 | + - If the snippets are from a different version of the codebase, ensure the feature you are creating has the **exact same functionality**, but adapted to fit the new modern codebase |
| 15 | + - Identify core mechanics and behaviors that must be preserved |
| 16 | + - Recognize outdated patterns that need modernization (old APIs, deprecated methods, etc.) |
| 17 | + - Map old code structures to their modern equivalents in the current codebase |
| 18 | + |
| 19 | +3. **Define Technical Approach** |
| 20 | + - Determine required data models and class structures |
| 21 | + - Identify necessary YAML configurations |
| 22 | + - Plan metadata fields for runtime customization |
| 23 | + - Consider edge cases |
| 24 | + |
| 25 | +4. **Verify Requirements** |
| 26 | + - List all directories and files that will be created/modified |
| 27 | + - Confirm understanding with the user before implementation |
| 28 | + |
| 29 | +### Phase 2: Implementation |
| 30 | + |
| 31 | +Follow these steps in order: |
| 32 | + |
| 33 | +1. **Create Disguise** (if needed) |
| 34 | + - Location: `plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/disguises` |
| 35 | + - Add custom properties for mob-specific behaviors (e.g., Enderman holding blocks, Creeper primed state) |
| 36 | + |
| 37 | +2. **Create Projectiles** (if needed) |
| 38 | + - Location: `plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles` |
| 39 | + - First check if `BrawlProjectile` helper constructors can be used |
| 40 | + - Only extend `BrawlProjectile` if custom behavior is needed |
| 41 | + |
| 42 | +3. **Create Abilities** |
| 43 | + - Location: `plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities` |
| 44 | + - Extend `BrawlAbility` class |
| 45 | + - Handle cooldowns, usage, and metadata |
| 46 | + - Add to factory in `BrawlKit` class |
| 47 | + |
| 48 | +4. **Create Passives** |
| 49 | + - Location: `plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/passives` |
| 50 | + - Extend `BrawlPassive` class |
| 51 | + - Configure triggers (events, cooldowns, or timers) |
| 52 | + - Add to factory in `BrawlKit` class |
| 53 | + |
| 54 | +5. **Create/Configure Kit** |
| 55 | + - Location: `plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits` |
| 56 | + - Use `BrawlKit` class for standard kits |
| 57 | + - Only create custom kit class if truly necessary (extend `BrawlKit` and add to `KitService.assignKit` factory) |
| 58 | + |
| 59 | +6. **Create YAML Definitions** |
| 60 | + - Location: `plugin/src/main/resources/data/*.yml` |
| 61 | + - Define all configurable properties |
| 62 | + - Include metadata values |
| 63 | + |
| 64 | +## Technical Components Reference |
| 65 | + |
| 66 | +### Disguises |
| 67 | + |
| 68 | +- Transform players into mobs with custom properties |
| 69 | +- Methods for manipulation (e.g., `setHeldBlock()`, `setPrimed()`) |
| 70 | + |
| 71 | +### Abilities |
| 72 | + |
| 73 | +- Triggered by right/left click on hotbar tools |
| 74 | +- Managed by `BrawlAbility` base class |
| 75 | +- Handle cooldowns, usage conditions, and effects |
| 76 | + |
| 77 | +### Passives |
| 78 | + |
| 79 | +- Auto-applied enhancements/debuffs when kit is assigned |
| 80 | +- Managed by `BrawlPassive` base class |
| 81 | +- Can be event-based, cooldown-based, or timer-based |
| 82 | + |
| 83 | +### Projectiles |
| 84 | + |
| 85 | +- Common for ranged abilities |
| 86 | +- Use `BrawlProjectile` helper constructors when possible |
| 87 | +- Custom projectiles extend `BrawlProjectile` |
| 88 | + |
| 89 | +### Metadata System |
| 90 | + |
| 91 | +**Critical for flexibility**: Any value that could be useful for custom gamemodes should be metadata-driven. |
| 92 | + |
| 93 | +**When adding metadata:** |
| 94 | + |
| 95 | +- Add field to corresponding `*Def` data class |
| 96 | +- Include in YAML definition |
| 97 | +- Allow runtime customization without code changes |
| 98 | + |
| 99 | +## Key Directories |
| 100 | + |
| 101 | +``` |
| 102 | +plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/ |
| 103 | +├── kits/ |
| 104 | +├── abilities/ |
| 105 | +├── passives/ |
| 106 | +├── projectiles/ |
| 107 | +├── disguises/ |
| 108 | +└── models/brawlData/ |
| 109 | + |
| 110 | +plugin/src/main/resources/data/*.yml |
| 111 | +``` |
| 112 | + |
| 113 | +## Implementation Standards |
| 114 | + |
| 115 | +### Code Consistency |
| 116 | + |
| 117 | +- **Always** study existing similar features first |
| 118 | +- Match naming conventions, code structure, and patterns |
| 119 | +- Follow Kotlin idioms and best practices |
| 120 | +- Use Prettier formatting (80 character line width) |
| 121 | + |
| 122 | +### Legacy Code Migration |
| 123 | + |
| 124 | +When adapting features from older code: |
| 125 | + |
| 126 | +- **Preserve functionality**: The new implementation must behave identically to the original |
| 127 | +- **Modernize implementation**: Use current APIs, patterns, and best practices |
| 128 | +- **Maintain intent**: Understand _why_ the original code worked a certain way |
| 129 | +- **Document changes**: Note any significant adaptations made from the legacy version |
| 130 | + |
| 131 | +### Quality Checklist |
| 132 | + |
| 133 | +- [ ] Studied similar existing implementations |
| 134 | +- [ ] Follows existing code patterns and structure |
| 135 | +- [ ] Extends appropriate base classes |
| 136 | +- [ ] Added to necessary factories |
| 137 | +- [ ] Metadata fields identified and implemented |
| 138 | +- [ ] YAML definitions created |
| 139 | +- [ ] Custom properties for disguises (if applicable) |
| 140 | +- [ ] Cooldown and usage handling implemented |
| 141 | +- [ ] Edge cases considered |
| 142 | + |
| 143 | +## Remember |
| 144 | + |
| 145 | +- Consistency with existing code is paramount |
| 146 | +- When given legacy code, preserve functionality while modernizing implementation |
| 147 | +- Metadata enables customization without code changes |
| 148 | +- Always extend base classes rather than reimplementing functionality |
| 149 | +- Ask clarifying questions before implementation if requirements are unclear |
0 commit comments