1
0
forked from noxious/server

npm run format

This commit is contained in:
2024-12-25 02:06:58 +01:00
parent c35e27799e
commit b4989aac26
28 changed files with 252 additions and 243 deletions

View File

@ -1,84 +1,84 @@
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
import { User } from './user';
import { Zone } from './zone';
import { CharacterType } from './characterType';
import { CharacterHair } from './characterHair';
import { CharacterItem } from './characterItem';
import { CharacterEquipment } from './characterEquipment';
import { Chat } from './chat';
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
import { User } from './user'
import { Zone } from './zone'
import { CharacterType } from './characterType'
import { CharacterHair } from './characterHair'
import { CharacterItem } from './characterItem'
import { CharacterEquipment } from './characterEquipment'
import { Chat } from './chat'
@Entity()
export class Character {
@PrimaryKey()
id!: number;
id!: number
@ManyToOne(() => User)
user!: User;
user!: User
@Property({ unique: true })
name!: string;
name!: string
@Property()
online = false;
online = false
@Property()
role = 'player';
role = 'player'
@OneToMany(() => Chat, chat => chat.character)
chats = new Collection<Chat>(this);
@OneToMany(() => Chat, (chat) => chat.character)
chats = new Collection<Chat>(this)
// Position
@ManyToOne(() => Zone)
zone!: Zone;
zone!: Zone
@Property()
positionX = 0;
positionX = 0
@Property()
positionY = 0;
positionY = 0
@Property()
rotation = 0;
rotation = 0
// Customization
@ManyToOne(() => CharacterType, { nullable: true })
characterType?: CharacterType;
characterType?: CharacterType
@ManyToOne(() => CharacterHair, { nullable: true })
characterHair?: CharacterHair;
characterHair?: CharacterHair
// Inventory
@OneToMany(() => CharacterItem, item => item.character)
items = new Collection<CharacterItem>(this);
@OneToMany(() => CharacterItem, (item) => item.character)
items = new Collection<CharacterItem>(this)
@OneToMany(() => CharacterEquipment, equipment => equipment.character)
equipment = new Collection<CharacterEquipment>(this);
@OneToMany(() => CharacterEquipment, (equipment) => equipment.character)
equipment = new Collection<CharacterEquipment>(this)
// Stats
@Property()
alignment = 50;
alignment = 50
@Property()
hitpoints = 100;
hitpoints = 100
@Property()
mana = 100;
mana = 100
@Property()
level = 1;
level = 1
@Property()
experience = 0;
experience = 0
@Property()
strength = 10;
strength = 10
@Property()
dexterity = 10;
dexterity = 10
@Property()
intelligence = 10;
intelligence = 10
@Property()
wisdom = 10;
}
wisdom = 10
}