Skip to content

Commit 64b4345

Browse files
committed
format
1 parent e9c9ec1 commit 64b4345

25 files changed

+633
-740
lines changed

.cursorrules

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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

apps/backend/src/db/migrations/meta/0000_snapshot.json

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,8 @@
9494
"name": "accounts_user_id_users_id_fk",
9595
"tableFrom": "accounts",
9696
"tableTo": "users",
97-
"columnsFrom": [
98-
"user_id"
99-
],
100-
"columnsTo": [
101-
"id"
102-
],
97+
"columnsFrom": ["user_id"],
98+
"columnsTo": ["id"],
10399
"onDelete": "cascade",
104100
"onUpdate": "no action"
105101
}
@@ -170,12 +166,8 @@
170166
"name": "sessions_user_id_users_id_fk",
171167
"tableFrom": "sessions",
172168
"tableTo": "users",
173-
"columnsFrom": [
174-
"user_id"
175-
],
176-
"columnsTo": [
177-
"id"
178-
],
169+
"columnsFrom": ["user_id"],
170+
"columnsTo": ["id"],
179171
"onDelete": "cascade",
180172
"onUpdate": "no action"
181173
}
@@ -185,9 +177,7 @@
185177
"sessions_token_unique": {
186178
"name": "sessions_token_unique",
187179
"nullsNotDistinct": false,
188-
"columns": [
189-
"token"
190-
]
180+
"columns": ["token"]
191181
}
192182
},
193183
"policies": {},
@@ -263,16 +253,12 @@
263253
"users_email_unique": {
264254
"name": "users_email_unique",
265255
"nullsNotDistinct": false,
266-
"columns": [
267-
"email"
268-
]
256+
"columns": ["email"]
269257
},
270258
"users_username_unique": {
271259
"name": "users_username_unique",
272260
"nullsNotDistinct": false,
273-
"columns": [
274-
"username"
275-
]
261+
"columns": ["username"]
276262
}
277263
},
278264
"policies": {},
@@ -394,12 +380,8 @@
394380
"name": "player_bans_player_uuid_players_uuid_fk",
395381
"tableFrom": "player_bans",
396382
"tableTo": "players",
397-
"columnsFrom": [
398-
"player_uuid"
399-
],
400-
"columnsTo": [
401-
"uuid"
402-
],
383+
"columnsFrom": ["player_uuid"],
384+
"columnsTo": ["uuid"],
403385
"onDelete": "cascade",
404386
"onUpdate": "no action"
405387
}
@@ -446,12 +428,8 @@
446428
"name": "player_join_events_player_uuid_players_uuid_fk",
447429
"tableFrom": "player_join_events",
448430
"tableTo": "players",
449-
"columnsFrom": [
450-
"player_uuid"
451-
],
452-
"columnsTo": [
453-
"uuid"
454-
],
431+
"columnsFrom": ["player_uuid"],
432+
"columnsTo": ["uuid"],
455433
"onDelete": "cascade",
456434
"onUpdate": "no action"
457435
}
@@ -556,4 +534,4 @@
556534
"schemas": {},
557535
"tables": {}
558536
}
559-
}
537+
}

0 commit comments

Comments
 (0)