43 lines
828 B
TypeScript
43 lines
828 B
TypeScript
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
|
|
|
export type AttackType = 'melee' | 'ranged' | 'magic';
|
|
|
|
@Entity('monsters')
|
|
export class Monster {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ length: 100 })
|
|
name: string;
|
|
|
|
@Column({ name: 'min_level' })
|
|
minLevel: number;
|
|
|
|
@Column({ name: 'max_level' })
|
|
maxLevel: number;
|
|
|
|
@Column()
|
|
hp: number;
|
|
|
|
@Column()
|
|
attack: number;
|
|
|
|
@Column({ default: 0 })
|
|
defense: number;
|
|
|
|
@Column({ name: 'attack_type', type: 'varchar', length: 20 })
|
|
attackType: AttackType;
|
|
|
|
@Column({ name: 'xp_reward' })
|
|
xpReward: number;
|
|
|
|
@Column({ name: 'gold_min' })
|
|
goldMin: number;
|
|
|
|
@Column({ name: 'gold_max' })
|
|
goldMax: number;
|
|
|
|
@Column({ name: 'drop_material_id', type: 'varchar', nullable: true })
|
|
dropMaterialId: string | null;
|
|
}
|