omniarena-types 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # omniarena-types
2
+
3
+ Omniarena types for sharing between Omniarena solutions.
@@ -0,0 +1,71 @@
1
+ export type GameDto = {
2
+ id: string;
3
+ globalEffects: string[];
4
+ player1: PlayerDto;
5
+ player2: PlayerDto;
6
+ characters: CharacterDto[];
7
+ skills: SkillDto[];
8
+ effects: EffectDto[];
9
+ currentTurn: number;
10
+ winner: string | null;
11
+ };
12
+ export type PlayerDto = {
13
+ id: string;
14
+ number: number;
15
+ username: string;
16
+ title: string;
17
+ avatar: string;
18
+ level: number;
19
+ ladderRank: number;
20
+ wins: number;
21
+ losses: number;
22
+ streak: number;
23
+ inventory: InventoryDto;
24
+ characters: string[];
25
+ playing: boolean;
26
+ };
27
+ export type InventoryDto = {
28
+ id: string;
29
+ resources: Record<Energy, number>;
30
+ };
31
+ export type CharacterDto = {
32
+ id: string;
33
+ characterId: number;
34
+ description: string;
35
+ maxHealth: number;
36
+ currentHealth: number;
37
+ skills: string[];
38
+ effects: string[];
39
+ };
40
+ export type SkillDto = {
41
+ id: string;
42
+ skillId: number;
43
+ description: string;
44
+ userId: string;
45
+ playerId: string;
46
+ cooldown: number;
47
+ cost: Resource[];
48
+ targetingOptions: TargetingOptions;
49
+ validTargets: string[];
50
+ };
51
+ export type EffectDto = {
52
+ id: string;
53
+ skillId: string;
54
+ description: string;
55
+ duration: number;
56
+ isPermanent: boolean;
57
+ endsThisTurn: boolean;
58
+ };
59
+ export type Energy = 'white' | 'purple' | 'lime' | 'orange';
60
+ export type Resource = Energy | 'random';
61
+ export type TargetingOptions = {
62
+ self: boolean;
63
+ teamMembers: number;
64
+ allTeamMembers: boolean;
65
+ allies: number;
66
+ allAllies: boolean;
67
+ enemies: number;
68
+ allEnemies: boolean;
69
+ partial: boolean;
70
+ random: boolean;
71
+ };
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "omniarena-types",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "types": "./dist/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "scripts": {
10
+ "build": "tsc"
11
+ },
12
+ "devDependencies": {
13
+ "typescript": "^4.9.3"
14
+ }
15
+ }