#245 & #254: Started working on character hair sprite management & character customisation

This commit is contained in:
2024-11-21 02:58:25 +01:00
parent 40c7f6289a
commit 4a62bbb118
6 changed files with 65 additions and 40 deletions

View File

@ -23,6 +23,7 @@ model Sprite {
updatedAt DateTime @updatedAt
spriteActions SpriteAction[]
characterTypes CharacterType[]
characterHairs CharacterHair[]
}
model SpriteAction {
@ -39,3 +40,13 @@ model SpriteAction {
frameHeight Int @default(0)
frameSpeed Int @default(0)
}
model Item {
id String @id @default(uuid())
name String
description String?
stackable Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
characters CharacterItem[]
}

View File

@ -1,3 +1,16 @@
enum CharacterGender {
MALE
FEMALE
}
enum CharacterRace {
HUMAN
ELF
DWARF
ORC
GOBLIN
}
model User {
id Int @id @default(autoincrement())
username String @unique
@ -16,19 +29,6 @@ model PasswordResetToken {
createdAt DateTime @default(now())
}
enum CharacterGender {
MALE
FEMALE
}
enum CharacterRace {
HUMAN
ELF
DWARF
ORC
GOBLIN
}
model CharacterType {
id Int @id @default(autoincrement())
name String
@ -42,6 +42,15 @@ model CharacterType {
updatedAt DateTime @updatedAt
}
model CharacterHair {
id Int @id @default(autoincrement())
name String
sprite Sprite? @relation(fields: [spriteId], references: [id], onDelete: Cascade)
spriteId String?
characters Character[]
// @TODO: Do we need addedAt and updatedAt?
}
model Character {
id Int @id @default(autoincrement())
userId Int
@ -61,6 +70,8 @@ model Character {
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
characterTypeId Int?
characterType CharacterType? @relation(fields: [characterTypeId], references: [id], onDelete: Cascade)
hairId Int?
hair CharacterHair? @relation(fields: [hairId], references: [id], onDelete: Cascade)
chats Chat[]
items CharacterItem[]
}

View File

@ -21,16 +21,6 @@ model Object {
ZoneObject ZoneObject[]
}
model Item {
id String @id @default(uuid())
name String
description String?
stackable Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
characters CharacterItem[]
}
model Zone {
id Int @id @default(autoincrement())
name String