chore(release): 0.4.0
[risinglegends.git] / src / shared / dungeon.ts
1 export type Dungeon = {
2   id: string;
3   name: string;
4   starting_room: string;
5 }
6
7 export type RoomExit = {
8   name: string;
9   target_room_id: string
10 }
11
12 export type RoomSettings = {
13   visit?: {
14     visit_number: number;
15     description?: string;
16   }[],
17   fight?: {
18     monster_id: number;
19     one_time: boolean;
20   },
21   end?: boolean;
22   rewards?: {
23     base: {
24       exp?: number,
25       gold?: number
26     },
27     per_kill_bonus?: {
28       exp?: number,
29       gold?: number
30     }
31   }
32 }
33
34 export type DungeonRoom = {
35   id: string;
36   dungeon_id: string;
37   description: string;
38   exits: RoomExit[];
39   settings: RoomSettings;
40 }
41
42 export type DungeonThing = {
43   room_id: string;
44   id: number;
45   name: string;
46   type: string;
47   properties: Record<string, any>;
48 }
49
50 export type DungeonState = {
51   player_id: string;
52   dungeon_id: string;
53   event_name: 'ROOM_VISIT' | 'FIGHT_COMPLETE';
54   event_props: any;
55   create_date: number;
56 }
57
58 export type DungeonPlayer = {
59   player_id: string;
60   dungeon_id: string;
61   current_room_id: string;
62   target_room_id: string;
63 }
64
65 // <room_id, total visit count>
66 export type DungeonStateSummaryVists = Record<string, number>;
67 // <room_id, <monster_id, count>>
68 export type DungeonStateSummaryFights = Record<string, Record<string, number>>;
69
70 export type DungeonRewards = {
71   exp: number;
72   gold: number;
73 }