-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
71 lines (64 loc) · 1.36 KB
/
types.ts
File metadata and controls
71 lines (64 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
export enum Role {
QUIZ = 'QUIZ',
SUPPORT = 'SUPPORT',
COMBAT = 'COMBAT'
}
export enum ClassType {
WARRIOR = 'WARRIOR',
MAGE = 'MAGE',
ARCHER = 'ARCHER',
ROGUE = 'ROGUE'
}
export interface CharacterStats {
atk: number;
def: number;
range: number;
speed: number;
atkSpeed: number;
}
export interface Team {
id: string;
name: string;
points: number;
hp: number;
maxHp: number;
mp: number;
maxMp: number;
x: number;
y: number;
angle: number;
isDead: boolean;
classType: ClassType;
stats: CharacterStats;
items: { weapon: boolean; armor: boolean; boots: boolean };
unlockedSkills: string[];
activeEffects: { type: string; until: number }[];
skillCooldowns: Record<string, number>;
lastAtkTime: number;
totalDamageDealt?: number; // 추가: 점수 합산용
}
export interface Quiz {
question: string;
options: string[];
answer: number;
}
export interface GameState {
isStarted: boolean;
teams: Record<string, Team>;
players: Record<string, Player>;
quizzes: Quiz[];
roomCode?: string;
currentQuizIndex: number;
phase: 'QUIZ' | 'BATTLE' | 'GAME_OVER'; // GAME_OVER 단계 추가
timer: number;
winnerTeamId?: string; // 추가: 최종 우승팀
}
export interface Player {
id: string;
name: string;
teamId: string;
role: Role;
classType: ClassType;
points: number;
hasSubmittedQuiz?: boolean;
}