Skip to content

Commit 8c6aad7

Browse files
strideraclaude
andcommitted
Fix prettier formatting across codebase
Also clean up pre-existing lint issues: - Suppress eslint errors in Jest config files (CJS require, global jest) - Remove stale packages/db/src/index.js build artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d9bee7 commit 8c6aad7

64 files changed

Lines changed: 1889 additions & 1695 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ABILITY_RESTORATION.md

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ model RaceAbilities {
2121
```
2222

2323
**Purpose**: Defines racial bonuses to abilities
24+
2425
- Elves: +15 bonus to Archery, +10 to Stealth
2526
- Dwarves: +20 bonus to Mining, +15 to Smithing
2627
- Halflings: +15 bonus to Hiding, +10 to Pickpocketing
2728

2829
**Fields**:
30+
2931
- `race`: Which race gets the bonus
3032
- `abilityId`: Which ability gets the bonus
3133
- `category`: PRIMARY (core racial skill), SECONDARY (common), RESTRICTED (limited), FORBIDDEN (cannot learn)
@@ -53,12 +55,14 @@ model ObjectAbilities {
5355
**Purpose**: Allows objects to cast abilities (scrolls, wands, potions, magical weapons)
5456

5557
**Examples**:
58+
5659
- Scroll of Fireball: `{ abilityId: "fireball", level: 10, charges: 1 }`
5760
- Wand of Magic Missile: `{ abilityId: "magic_missile", level: 5, charges: 20 }`
5861
- Potion of Healing: `{ abilityId: "cure_light", level: 7, charges: 1 }`
5962
- Flaming Sword: `{ abilityId: "flame_weapon", level: 12, charges: -1 }` (infinite)
6063

6164
**Fields**:
65+
6266
- `abilityId`: Which ability the object can cast
6367
- `level`: Caster level (affects damage, duration, DC calculations)
6468
- `charges`: Overrides object.charges if needed, -1 = infinite
@@ -140,37 +144,67 @@ await prisma.raceAbilities.createMany({
140144

141145
// Halflings
142146
{ race: 'HALFLING', abilityId: hidingId, category: 'PRIMARY', bonus: 15 },
143-
{ race: 'HALFLING', abilityId: pickpocketId, category: 'SECONDARY', bonus: 10 },
144-
]
147+
{
148+
race: 'HALFLING',
149+
abilityId: pickpocketId,
150+
category: 'SECONDARY',
151+
bonus: 10,
152+
},
153+
],
145154
});
146155

147156
// Magical items
148157
await prisma.objectAbilities.createMany({
149158
data: [
150159
// Scroll of Fireball (zone 30, object 101)
151-
{ objectZoneId: 30, objectId: 101, abilityId: fireballId, level: 10, charges: 1 },
160+
{
161+
objectZoneId: 30,
162+
objectId: 101,
163+
abilityId: fireballId,
164+
level: 10,
165+
charges: 1,
166+
},
152167

153168
// Wand of Magic Missile (zone 30, object 102)
154-
{ objectZoneId: 30, objectId: 102, abilityId: magicMissileId, level: 5, charges: 20 },
169+
{
170+
objectZoneId: 30,
171+
objectId: 102,
172+
abilityId: magicMissileId,
173+
level: 5,
174+
charges: 20,
175+
},
155176

156177
// Potion of Healing (zone 30, object 103)
157-
{ objectZoneId: 30, objectId: 103, abilityId: cureLightId, level: 7, charges: 1 },
178+
{
179+
objectZoneId: 30,
180+
objectId: 103,
181+
abilityId: cureLightId,
182+
level: 7,
183+
charges: 1,
184+
},
158185

159186
// Flaming Longsword (zone 30, object 104)
160-
{ objectZoneId: 30, objectId: 104, abilityId: flameWeaponId, level: 12, charges: -1 },
161-
]
187+
{
188+
objectZoneId: 30,
189+
objectId: 104,
190+
abilityId: flameWeaponId,
191+
level: 12,
192+
charges: -1,
193+
},
194+
],
162195
});
163196
```
164197

165198
## Game Logic Integration
166199

167200
### Racial Ability System
201+
168202
```typescript
169203
// When character is created, apply racial bonuses
170204
async function applyRacialBonuses(characterId: string, race: Race) {
171205
const racialBonuses = await prisma.raceAbilities.findMany({
172206
where: { race },
173-
include: { ability: true }
207+
include: { ability: true },
174208
});
175209

176210
for (const bonus of racialBonuses) {
@@ -180,23 +214,28 @@ async function applyRacialBonuses(characterId: string, race: Race) {
180214
abilityId: bonus.abilityId,
181215
known: bonus.category !== 'FORBIDDEN',
182216
proficiency: bonus.bonus, // Start with racial bonus
183-
}
217+
},
184218
});
185219
}
186220
}
187221
```
188222

189223
### Object Ability System
224+
190225
```typescript
191226
// When object is used (read scroll, zap wand, quaff potion)
192-
async function useObjectAbility(characterId: string, objectZoneId: number, objectId: number) {
227+
async function useObjectAbility(
228+
characterId: string,
229+
objectZoneId: number,
230+
objectId: number
231+
) {
193232
const objectAbilities = await prisma.objectAbilities.findMany({
194233
where: { objectZoneId, objectId },
195-
include: { ability: true }
234+
include: { ability: true },
196235
});
197236

198237
if (objectAbilities.length === 0) {
199-
return { success: false, message: "Nothing happens." };
238+
return { success: false, message: 'Nothing happens.' };
200239
}
201240

202241
// Cast the ability at the specified level

RESTORATION_COMPLETE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ model RaceAbilities {
1919
```
2020

2121
**Purpose**: Racial ability bonuses
22+
2223
- Elves get +15 to Archery, +10 to Stealth
2324
- Dwarves get +20 to Mining, +15 to Smithing
2425
- Category system: PRIMARY, SECONDARY, RESTRICTED, FORBIDDEN
@@ -41,6 +42,7 @@ model ObjectAbilities {
4142
```
4243

4344
**Purpose**: Magical items that cast abilities
45+
4446
- Scrolls: Cast spell once
4547
- Wands: Multiple charges
4648
- Potions: Single use consumables
@@ -49,6 +51,7 @@ model ObjectAbilities {
4951
### 3. ✅ Updated Ability Relationships (lines 49-50)
5052

5153
Added two new relationships to the Ability model:
54+
5255
```prisma
5356
raceAbilities RaceAbilities[]
5457
objectAbilities ObjectAbilities[]
@@ -57,13 +60,15 @@ objectAbilities ObjectAbilities[]
5760
### 4. ✅ Updated Races Relationship (line 662)
5861

5962
Added relationship to Races model:
63+
6064
```prisma
6165
raceAbilities RaceAbilities[]
6266
```
6367

6468
### 5. ✅ Updated Objects Relationship (line 614)
6569

6670
Added relationship to Objects model:
71+
6772
```prisma
6873
objectAbilities ObjectAbilities[]
6974
```
@@ -78,12 +83,14 @@ objectAbilities ObjectAbilities[]
7883
## Next Steps
7984

8085
1. **Create migration**:
86+
8187
```bash
8288
cd /home/strider/Code/mud/muditor/packages/db
8389
pnpm db:migrate
8490
```
8591

8692
2. **Generate Prisma clients**:
93+
8794
```bash
8895
pnpm db:generate
8996
```
@@ -93,12 +100,14 @@ objectAbilities ObjectAbilities[]
93100
## Design Rationale Confirmed
94101

95102
### Auras as Effects ✅
103+
96104
- No separate Auras table needed
97105
- Effect model with JSON params handles persistent buffs/debuffs
98106
- Fireball = damage effect + burning DOT effect
99107
- Cleaner and more flexible for seed data
100108

101109
### Proficiency-Only Progression ✅
110+
102111
- Single `proficiency` field (0-100)
103112
- Direct increments on ability use
104113
- Capped by character level

apps/api/src/auth/dto/auth.payload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export class AuthPayload {
88

99
@Field()
1010
accessToken: string;
11-
}
11+
}

apps/api/src/auth/dto/login.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export class LoginInput {
1212
@IsString()
1313
@MinLength(1, { message: 'Password is required' })
1414
password: string;
15-
}
15+
}

apps/api/src/auth/dto/register.input.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { InputType, Field } from '@nestjs/graphql';
2-
import { IsEmail, IsString, MinLength, MaxLength, Matches } from 'class-validator';
2+
import {
3+
IsEmail,
4+
IsString,
5+
MinLength,
6+
MaxLength,
7+
Matches,
8+
} from 'class-validator';
39

410
@InputType()
511
export class RegisterInput {
@@ -11,8 +17,8 @@ export class RegisterInput {
1117
@IsString()
1218
@MinLength(3, { message: 'Username must be at least 3 characters long' })
1319
@MaxLength(20, { message: 'Username must be at most 20 characters long' })
14-
@Matches(/^[a-zA-Z0-9_]+$/, {
15-
message: 'Username can only contain letters, numbers, and underscores'
20+
@Matches(/^[a-zA-Z0-9_]+$/, {
21+
message: 'Username can only contain letters, numbers, and underscores',
1622
})
1723
username: string;
1824

@@ -21,4 +27,4 @@ export class RegisterInput {
2127
@MinLength(8, { message: 'Password must be at least 8 characters long' })
2228
@MaxLength(128, { message: 'Password must be at most 128 characters long' })
2329
password: string;
24-
}
30+
}

apps/api/src/database/database.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import { DatabaseService } from './database.service';
66
providers: [DatabaseService],
77
exports: [DatabaseService],
88
})
9-
export class DatabaseModule {}
9+
export class DatabaseModule {}

apps/api/src/equipment-sets/__tests__/equipment-sets.resolver.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { EquipmentSetsResolver } from '../equipment-sets.resolver';
33
import { EquipmentSetsService } from '../equipment-sets.service';
4-
import { CreateEquipmentSetInput, CreateEquipmentSetItemStandaloneInput } from '../equipment-set.dto';
4+
import {
5+
CreateEquipmentSetInput,
6+
CreateEquipmentSetItemStandaloneInput,
7+
} from '../equipment-set.dto';
58

69
describe('EquipmentSetsResolver', () => {
710
let resolver: EquipmentSetsResolver;
@@ -110,11 +113,13 @@ describe('EquipmentSetsResolver', () => {
110113
probability: 0.8,
111114
};
112115

113-
mockEquipmentSetsService.createEquipmentSetItem.mockResolvedValue(expectedResult);
116+
mockEquipmentSetsService.createEquipmentSetItem.mockResolvedValue(
117+
expectedResult
118+
);
114119

115120
const result = await resolver.createEquipmentSetItem(input);
116121
expect(result).toBe(expectedResult);
117122
expect(service.createEquipmentSetItem).toHaveBeenCalledWith(input);
118123
});
119124
});
120-
});
125+
});

apps/api/src/equipment-sets/equipment-set.dto.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
ObjectType,
3-
Field,
4-
Int,
5-
InputType,
6-
Float,
7-
} from '@nestjs/graphql';
1+
import { ObjectType, Field, Int, InputType, Float } from '@nestjs/graphql';
82
import {
93
IsOptional,
104
IsString,
@@ -175,4 +169,4 @@ export class CreateMobEquipmentSetInput {
175169
@Min(0.0, { message: 'Probability must be between 0.0 and 1.0' })
176170
@Max(1.0, { message: 'Probability must be between 0.0 and 1.0' })
177171
probability?: number;
178-
}
172+
}

apps/api/src/equipment-sets/equipment-sets.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import { EquipmentSetsResolver } from './equipment-sets.resolver';
88
providers: [EquipmentSetsService, EquipmentSetsResolver],
99
exports: [EquipmentSetsService],
1010
})
11-
export class EquipmentSetsModule {}
11+
export class EquipmentSetsModule {}

apps/api/src/equipment-sets/equipment-sets.resolver.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ export class EquipmentSetsResolver {
2525
}
2626

2727
@Mutation(() => EquipmentSetDto)
28-
createEquipmentSet(@Args('data') createEquipmentSetInput: CreateEquipmentSetInput) {
28+
createEquipmentSet(
29+
@Args('data') createEquipmentSetInput: CreateEquipmentSetInput
30+
) {
2931
return this.equipmentSetsService.create(createEquipmentSetInput);
3032
}
3133

3234
@Mutation(() => EquipmentSetDto)
3335
updateEquipmentSet(
3436
@Args('id', { type: () => ID }) id: string,
35-
@Args('data') updateEquipmentSetInput: UpdateEquipmentSetInput,
37+
@Args('data') updateEquipmentSetInput: UpdateEquipmentSetInput
3638
) {
3739
return this.equipmentSetsService.update(id, updateEquipmentSetInput);
3840
}
@@ -44,7 +46,9 @@ export class EquipmentSetsResolver {
4446
}
4547

4648
@Mutation(() => EquipmentSetItemDto)
47-
createEquipmentSetItem(@Args('data') data: CreateEquipmentSetItemStandaloneInput) {
49+
createEquipmentSetItem(
50+
@Args('data') data: CreateEquipmentSetItemStandaloneInput
51+
) {
4852
return this.equipmentSetsService.createEquipmentSetItem(data);
4953
}
5054

@@ -64,4 +68,4 @@ export class EquipmentSetsResolver {
6468
await this.equipmentSetsService.deleteMobEquipmentSet(id);
6569
return true;
6670
}
67-
}
71+
}

0 commit comments

Comments
 (0)