@dchighs/dc-config-mapper 0.2.1 → 0.3.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.
@@ -0,0 +1,109 @@
1
+ import { Localization } from "@dchighs/dc-localization";
2
+ import { GameConfigDto } from "@dchighs/dc-config";
3
+ type GridIslandsDto = GameConfigDto["game_data"]["config"]["grid_island"];
4
+ export declare class GridIslandsMapper {
5
+ readonly localization: Localization;
6
+ constructor(localization: Localization);
7
+ map(gridIslands: GridIslandsDto): {
8
+ islands: import("@dchighs/dc-localization/dist/types").Translated<{
9
+ id: number;
10
+ min_level: number;
11
+ availability: {
12
+ from: string;
13
+ to: string;
14
+ };
15
+ name_key: string;
16
+ sound_tag: string;
17
+ zip_file_name: string;
18
+ currency_id: number;
19
+ pool: {
20
+ points: number;
21
+ time: number;
22
+ };
23
+ initial_points: number;
24
+ board_size: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ initial_square_id: number;
29
+ episode_ids: number[];
30
+ }>[];
31
+ episodes: import("@dchighs/dc-localization/dist/types").Translated<{
32
+ id: number;
33
+ board_size: {
34
+ width: number;
35
+ height: number;
36
+ };
37
+ initial_square_id: number;
38
+ final_square_id: number;
39
+ name_key: string;
40
+ square_ids: number[];
41
+ }>[];
42
+ squares: {
43
+ id: number;
44
+ type: string;
45
+ reward: {
46
+ chest_id: number | undefined;
47
+ type: string;
48
+ } | {
49
+ dragon_id: number | undefined;
50
+ type: string;
51
+ } | null;
52
+ highlight: number;
53
+ x: number;
54
+ y: number;
55
+ claim_cost: number;
56
+ wall: string | undefined;
57
+ wall_suffix: string | undefined;
58
+ }[];
59
+ decorations: {
60
+ id: number;
61
+ filename: string;
62
+ x: number;
63
+ y: number;
64
+ island_id: number;
65
+ episode_id: number;
66
+ }[];
67
+ encounters: {
68
+ id: number;
69
+ enemy_ids: number[];
70
+ speed_up_price_per_hour: number;
71
+ fight_background: string;
72
+ fight_background_id: string;
73
+ }[];
74
+ enemies: {
75
+ id: number;
76
+ dragon_ids: Array<number>;
77
+ handicaps: Array<number>;
78
+ view_type: string;
79
+ elements_view_type: Array<any>;
80
+ cooldown: number;
81
+ }[];
82
+ currencies: {
83
+ id: number;
84
+ tid_name: string;
85
+ actions: Array<number>;
86
+ }[];
87
+ actions: {
88
+ id: number;
89
+ type: string;
90
+ tid_name: string;
91
+ image: string;
92
+ pool_percent: number;
93
+ max_points: number;
94
+ extra_parameters?: {
95
+ max_time?: number;
96
+ cooldown?: number;
97
+ max_control_level?: number;
98
+ max_production?: number;
99
+ max_level?: number;
100
+ };
101
+ }[];
102
+ parameters: {
103
+ id: number;
104
+ name: string;
105
+ value: any;
106
+ }[];
107
+ };
108
+ }
109
+ export {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridIslandsMapper = void 0;
4
+ const island_schema_1 = require("../schemas/islands/grid-islands/island.schema");
5
+ const episode_schema_1 = require("../schemas/islands/grid-islands/episode.schema");
6
+ const square_schema_1 = require("../schemas/islands/grid-islands/square.schema");
7
+ const decoration_schema_1 = require("../schemas/islands/grid-islands/decoration.schema");
8
+ const encounter_schema_1 = require("../schemas/islands/grid-islands/encounter.schema");
9
+ class GridIslandsMapper {
10
+ constructor(localization) {
11
+ this.localization = localization;
12
+ }
13
+ map(gridIslands) {
14
+ return {
15
+ islands: gridIslands.islands.map(island => this.localization.translate(island_schema_1.gridIslandSchema.parse(island))),
16
+ episodes: gridIslands.episodes.map(episode => this.localization.translate(episode_schema_1.gridIslandsEpisodeSchema.parse(episode))),
17
+ squares: gridIslands.squares.map(square => square_schema_1.gridIslandsSquareSchema.parse(square)),
18
+ decorations: gridIslands.decorations.map(decoration => decoration_schema_1.gridIslandsDecorationSchema.parse(decoration)),
19
+ encounters: gridIslands.encounters.map(encounter => encounter_schema_1.gridIslandsEncounterSchema.parse(encounter)),
20
+ enemies: gridIslands.enemies,
21
+ currencies: gridIslands.currencies,
22
+ actions: gridIslands.actions,
23
+ parameters: gridIslands.parameters,
24
+ };
25
+ }
26
+ }
27
+ exports.GridIslandsMapper = GridIslandsMapper;
@@ -4,3 +4,4 @@ export * from "./skills.mapper";
4
4
  export * from "./heroic-races.mapper";
5
5
  export * from "./maze-islands.mapper";
6
6
  export * from "./tower-islands.mapper";
7
+ export * from "./grid-islands.mapper";
@@ -20,3 +20,4 @@ __exportStar(require("./skills.mapper"), exports);
20
20
  __exportStar(require("./heroic-races.mapper"), exports);
21
21
  __exportStar(require("./maze-islands.mapper"), exports);
22
22
  __exportStar(require("./tower-islands.mapper"), exports);
23
+ __exportStar(require("./grid-islands.mapper"), exports);
@@ -99,7 +99,6 @@ export declare class MazeIslandsMapper {
99
99
  };
100
100
  initial_points: number;
101
101
  min_level: number;
102
- mobile_tutorial_id: number;
103
102
  zip_file_name: string;
104
103
  sound_tag: string;
105
104
  }>[];
@@ -20,13 +20,17 @@ export declare class TowerIslandsMapper {
20
20
  initial_points: number;
21
21
  currency_id: number;
22
22
  min_level: number;
23
- tower_size: number[];
24
23
  zip_file_name: string;
25
24
  sound_tag: string;
26
25
  max_die_roll: number;
27
26
  help_view_id: number;
28
27
  square_ids: number[];
29
28
  floor_ids: number[];
29
+ reward_ids: number[];
30
+ board_size: {
31
+ width: number;
32
+ height: number;
33
+ };
30
34
  }>[];
31
35
  floors: import("@dchighs/dc-localization/dist/types").Translated<{
32
36
  id: number;
@@ -14,10 +14,12 @@ class TowerIslandsMapper {
14
14
  islands: data.islands.map(island => {
15
15
  const squareIds = data.squares.filter(square => square.island_id === island.id).map(square => square.id);
16
16
  const floorIds = data.floors.filter(floor => floor.island_id === island.id).map(floor => floor.id);
17
+ const rewardIds = data.rewards.filter(reward => reward.island_id === island.id).map(reward => reward.id);
17
18
  return this.localization.translate(island_schema_1.towerIslandSchema.parse({
18
19
  ...island,
19
20
  square_ids: squareIds,
20
- floor_ids: floorIds
21
+ floor_ids: floorIds,
22
+ reward_ids: rewardIds,
21
23
  }));
22
24
  }),
23
25
  floors: data.floors.map(floor => this.localization.translate(floor_schema_1.towerIslandsFloorSchema.parse(floor))),
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ export declare const gridIslandsDecorationSchema: z.ZodPipe<z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ file: z.ZodString;
5
+ x: z.ZodNumber;
6
+ y: z.ZodNumber;
7
+ island_id: z.ZodNumber;
8
+ episode_id: z.ZodNumber;
9
+ }, z.core.$strict>, z.ZodTransform<{
10
+ id: number;
11
+ filename: string;
12
+ x: number;
13
+ y: number;
14
+ island_id: number;
15
+ episode_id: number;
16
+ }, {
17
+ id: number;
18
+ file: string;
19
+ x: number;
20
+ y: number;
21
+ island_id: number;
22
+ episode_id: number;
23
+ }>>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gridIslandsDecorationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.gridIslandsDecorationSchema = zod_1.z.object({
6
+ id: zod_1.z.number(),
7
+ file: zod_1.z.string(),
8
+ x: zod_1.z.number(),
9
+ y: zod_1.z.number(),
10
+ island_id: zod_1.z.number(),
11
+ episode_id: zod_1.z.number(),
12
+ }).strict().transform(data => {
13
+ return {
14
+ id: data.id,
15
+ filename: data.file,
16
+ x: data.x,
17
+ y: data.y,
18
+ island_id: data.island_id,
19
+ episode_id: data.episode_id,
20
+ };
21
+ });
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const gridIslandsEncounterSchema: z.ZodPipe<z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ enemies: z.ZodArray<z.ZodNumber>;
5
+ speed_up_price_per_hour: z.ZodNumber;
6
+ fight_background: z.ZodString;
7
+ fight_background_id: z.ZodString;
8
+ }, z.core.$strict>, z.ZodTransform<{
9
+ id: number;
10
+ enemy_ids: number[];
11
+ speed_up_price_per_hour: number;
12
+ fight_background: string;
13
+ fight_background_id: string;
14
+ }, {
15
+ id: number;
16
+ enemies: number[];
17
+ speed_up_price_per_hour: number;
18
+ fight_background: string;
19
+ fight_background_id: string;
20
+ }>>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gridIslandsEncounterSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.gridIslandsEncounterSchema = zod_1.z.object({
6
+ id: zod_1.z.number(),
7
+ enemies: zod_1.z.array(zod_1.z.number()),
8
+ speed_up_price_per_hour: zod_1.z.number(),
9
+ fight_background: zod_1.z.string(),
10
+ fight_background_id: zod_1.z.string(),
11
+ }).strict().transform(data => {
12
+ return {
13
+ id: data.id,
14
+ enemy_ids: data.enemies,
15
+ speed_up_price_per_hour: data.speed_up_price_per_hour,
16
+ fight_background: data.fight_background,
17
+ fight_background_id: data.fight_background_id,
18
+ };
19
+ });
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export declare const gridIslandsEpisodeSchema: z.ZodPipe<z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ island_id: z.ZodNumber;
5
+ board_size: z.ZodArray<z.ZodNumber>;
6
+ initial_square_id: z.ZodNumber;
7
+ final_square_id: z.ZodNumber;
8
+ tid_title: z.ZodString;
9
+ mobile_begin_tutorial_id: z.ZodNumber;
10
+ mobile_end_tutorial_id: z.ZodNumber;
11
+ canvas_background: z.ZodString;
12
+ backgrounds: z.ZodArray<z.ZodString>;
13
+ background_plist: z.ZodString;
14
+ foregrounds: z.ZodArray<z.ZodAny>;
15
+ foregrounds_plists: z.ZodArray<z.ZodAny>;
16
+ squares: z.ZodArray<z.ZodNumber>;
17
+ }, z.core.$strict>, z.ZodTransform<{
18
+ id: number;
19
+ board_size: {
20
+ width: number;
21
+ height: number;
22
+ };
23
+ initial_square_id: number;
24
+ final_square_id: number;
25
+ name_key: string;
26
+ square_ids: number[];
27
+ }, {
28
+ id: number;
29
+ island_id: number;
30
+ board_size: number[];
31
+ initial_square_id: number;
32
+ final_square_id: number;
33
+ tid_title: string;
34
+ mobile_begin_tutorial_id: number;
35
+ mobile_end_tutorial_id: number;
36
+ canvas_background: string;
37
+ backgrounds: string[];
38
+ background_plist: string;
39
+ foregrounds: any[];
40
+ foregrounds_plists: any[];
41
+ squares: number[];
42
+ }>>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gridIslandsEpisodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.gridIslandsEpisodeSchema = zod_1.z.object({
6
+ id: zod_1.z.number(),
7
+ island_id: zod_1.z.number(),
8
+ board_size: zod_1.z.array(zod_1.z.number()),
9
+ initial_square_id: zod_1.z.number(),
10
+ final_square_id: zod_1.z.number(),
11
+ tid_title: zod_1.z.string(),
12
+ mobile_begin_tutorial_id: zod_1.z.number(),
13
+ mobile_end_tutorial_id: zod_1.z.number(),
14
+ canvas_background: zod_1.z.string(),
15
+ backgrounds: zod_1.z.array(zod_1.z.string()),
16
+ background_plist: zod_1.z.string(),
17
+ foregrounds: zod_1.z.array(zod_1.z.any()),
18
+ foregrounds_plists: zod_1.z.array(zod_1.z.any()),
19
+ squares: zod_1.z.array(zod_1.z.number()),
20
+ }).strict().transform((data) => {
21
+ return {
22
+ id: data.id,
23
+ board_size: {
24
+ width: data.board_size[0],
25
+ height: data.board_size[1],
26
+ },
27
+ initial_square_id: data.initial_square_id,
28
+ final_square_id: data.final_square_id,
29
+ name_key: data.tid_title,
30
+ square_ids: data.squares,
31
+ };
32
+ });
@@ -0,0 +1,188 @@
1
+ import { z } from "zod";
2
+ export declare const gridIslandSchema: z.ZodPipe<z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ analytics_id: z.ZodString;
5
+ tid_name: z.ZodString;
6
+ tutorial_id: z.ZodNumber;
7
+ tutorial_claimable_cell_id: z.ZodNumber;
8
+ pool_points: z.ZodNumber;
9
+ pool_time: z.ZodNumber;
10
+ initial_points: z.ZodNumber;
11
+ start_ts: z.ZodNumber;
12
+ end_ts: z.ZodNumber;
13
+ currency_id: z.ZodNumber;
14
+ min_level: z.ZodNumber;
15
+ building_id: z.ZodNumber;
16
+ building_position: z.ZodArray<z.ZodNumber>;
17
+ zip_file: z.ZodString;
18
+ sound_tag: z.ZodString;
19
+ canvas_assets_url: z.ZodString;
20
+ ui_configuration: z.ZodObject<{
21
+ cell_contents_config: z.ZodObject<{
22
+ blocked_dragon_position_offset: z.ZodArray<z.ZodNumber>;
23
+ blocked_opacity: z.ZodNumber;
24
+ claimable_dragon_position_offset: z.ZodArray<z.ZodNumber>;
25
+ default_dragon_scale: z.ZodArray<z.ZodNumber>;
26
+ dragon_scale: z.ZodArray<z.ZodNumber>;
27
+ dragon_scale_by_id: z.ZodRecord<z.ZodNumber, z.ZodArray<z.ZodNumber>>;
28
+ icon_position_offset: z.ZodArray<z.ZodNumber>;
29
+ label_position_offset: z.ZodArray<z.ZodNumber>;
30
+ }, z.core.$strip>;
31
+ cell_highlight_asset: z.ZodString;
32
+ cell_highlight_index: z.ZodNumber;
33
+ cell_size: z.ZodArray<z.ZodNumber>;
34
+ cells_label_config: z.ZodObject<{
35
+ claimable: z.ZodObject<{
36
+ color: z.ZodArray<z.ZodNumber>;
37
+ size: z.ZodNumber;
38
+ stroke_color: z.ZodArray<z.ZodNumber>;
39
+ stroke_width: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ unclaimable: z.ZodObject<{
42
+ color: z.ZodArray<z.ZodNumber>;
43
+ size: z.ZodNumber;
44
+ stroke_color: z.ZodArray<z.ZodNumber>;
45
+ stroke_width: z.ZodNumber;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strip>;
48
+ dragon_evolution: z.ZodNumber;
49
+ grey_scale_blocked_cells: z.ZodBoolean;
50
+ island_title_config: z.ZodObject<{
51
+ down_color: z.ZodArray<z.ZodNumber>;
52
+ size: z.ZodNumber;
53
+ small_stroke_color: z.ZodArray<z.ZodNumber>;
54
+ small_stroke_width: z.ZodNumber;
55
+ upper_color: z.ZodArray<z.ZodNumber>;
56
+ }, z.core.$strip>;
57
+ layers_z_indexes: z.ZodObject<{
58
+ additional_layer: z.ZodNumber;
59
+ cell_backgrounds: z.ZodNumber;
60
+ cell_contents: z.ZodNumber;
61
+ decorations: z.ZodNumber;
62
+ player_token: z.ZodNumber;
63
+ walls: z.ZodNumber;
64
+ }, z.core.$strip>;
65
+ origin_offset: z.ZodArray<z.ZodNumber>;
66
+ tutorial_scroll_duration: z.ZodNumber;
67
+ tutorial_scroll_duration_base: z.ZodNumber;
68
+ tutorial_scroll_duration_factor: z.ZodNumber;
69
+ }, z.core.$strip>;
70
+ active_platforms: z.ZodObject<{
71
+ ios: z.ZodNumber;
72
+ canvas: z.ZodString;
73
+ android: z.ZodNumber;
74
+ amazon: z.ZodNumber;
75
+ windows: z.ZodNumber;
76
+ }, z.core.$strip>;
77
+ episodes: z.ZodArray<z.ZodNumber>;
78
+ board_size: z.ZodArray<z.ZodNumber>;
79
+ initial_square_id: z.ZodNumber;
80
+ backgrounds: z.ZodArray<z.ZodNumber>;
81
+ background_plist: z.ZodString;
82
+ foregrounds: z.ZodArray<z.ZodAny>;
83
+ foregrounds_plists: z.ZodArray<z.ZodAny>;
84
+ }, z.core.$strict>, z.ZodTransform<{
85
+ id: number;
86
+ min_level: number;
87
+ availability: {
88
+ from: string;
89
+ to: string;
90
+ };
91
+ name_key: string;
92
+ sound_tag: string;
93
+ zip_file_name: string;
94
+ currency_id: number;
95
+ pool: {
96
+ points: number;
97
+ time: number;
98
+ };
99
+ initial_points: number;
100
+ board_size: {
101
+ width: number;
102
+ height: number;
103
+ };
104
+ initial_square_id: number;
105
+ episode_ids: number[];
106
+ }, {
107
+ id: number;
108
+ analytics_id: string;
109
+ tid_name: string;
110
+ tutorial_id: number;
111
+ tutorial_claimable_cell_id: number;
112
+ pool_points: number;
113
+ pool_time: number;
114
+ initial_points: number;
115
+ start_ts: number;
116
+ end_ts: number;
117
+ currency_id: number;
118
+ min_level: number;
119
+ building_id: number;
120
+ building_position: number[];
121
+ zip_file: string;
122
+ sound_tag: string;
123
+ canvas_assets_url: string;
124
+ ui_configuration: {
125
+ cell_contents_config: {
126
+ blocked_dragon_position_offset: number[];
127
+ blocked_opacity: number;
128
+ claimable_dragon_position_offset: number[];
129
+ default_dragon_scale: number[];
130
+ dragon_scale: number[];
131
+ dragon_scale_by_id: Record<number, number[]>;
132
+ icon_position_offset: number[];
133
+ label_position_offset: number[];
134
+ };
135
+ cell_highlight_asset: string;
136
+ cell_highlight_index: number;
137
+ cell_size: number[];
138
+ cells_label_config: {
139
+ claimable: {
140
+ color: number[];
141
+ size: number;
142
+ stroke_color: number[];
143
+ stroke_width: number;
144
+ };
145
+ unclaimable: {
146
+ color: number[];
147
+ size: number;
148
+ stroke_color: number[];
149
+ stroke_width: number;
150
+ };
151
+ };
152
+ dragon_evolution: number;
153
+ grey_scale_blocked_cells: boolean;
154
+ island_title_config: {
155
+ down_color: number[];
156
+ size: number;
157
+ small_stroke_color: number[];
158
+ small_stroke_width: number;
159
+ upper_color: number[];
160
+ };
161
+ layers_z_indexes: {
162
+ additional_layer: number;
163
+ cell_backgrounds: number;
164
+ cell_contents: number;
165
+ decorations: number;
166
+ player_token: number;
167
+ walls: number;
168
+ };
169
+ origin_offset: number[];
170
+ tutorial_scroll_duration: number;
171
+ tutorial_scroll_duration_base: number;
172
+ tutorial_scroll_duration_factor: number;
173
+ };
174
+ active_platforms: {
175
+ ios: number;
176
+ canvas: string;
177
+ android: number;
178
+ amazon: number;
179
+ windows: number;
180
+ };
181
+ episodes: number[];
182
+ board_size: number[];
183
+ initial_square_id: number;
184
+ backgrounds: number[];
185
+ background_plist: string;
186
+ foregrounds: any[];
187
+ foregrounds_plists: any[];
188
+ }>>;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.gridIslandSchema = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const zod_1 = require("zod");
9
+ exports.gridIslandSchema = zod_1.z.object({
10
+ id: zod_1.z.number(),
11
+ analytics_id: zod_1.z.string(),
12
+ tid_name: zod_1.z.string(),
13
+ tutorial_id: zod_1.z.number(),
14
+ tutorial_claimable_cell_id: zod_1.z.number(),
15
+ pool_points: zod_1.z.number(),
16
+ pool_time: zod_1.z.number(),
17
+ initial_points: zod_1.z.number(),
18
+ start_ts: zod_1.z.number(),
19
+ end_ts: zod_1.z.number(),
20
+ currency_id: zod_1.z.number(),
21
+ min_level: zod_1.z.number(),
22
+ building_id: zod_1.z.number(),
23
+ building_position: zod_1.z.array(zod_1.z.number()),
24
+ zip_file: zod_1.z.string(),
25
+ sound_tag: zod_1.z.string(),
26
+ canvas_assets_url: zod_1.z.string(),
27
+ ui_configuration: zod_1.z.object({
28
+ cell_contents_config: zod_1.z.object({
29
+ blocked_dragon_position_offset: zod_1.z.array(zod_1.z.number()),
30
+ blocked_opacity: zod_1.z.number(),
31
+ claimable_dragon_position_offset: zod_1.z.array(zod_1.z.number()),
32
+ default_dragon_scale: zod_1.z.array(zod_1.z.number()),
33
+ dragon_scale: zod_1.z.array(zod_1.z.number()),
34
+ dragon_scale_by_id: zod_1.z.record(zod_1.z.number(), zod_1.z.array(zod_1.z.number())),
35
+ icon_position_offset: zod_1.z.array(zod_1.z.number()),
36
+ label_position_offset: zod_1.z.array(zod_1.z.number()),
37
+ }),
38
+ cell_highlight_asset: zod_1.z.string(),
39
+ cell_highlight_index: zod_1.z.number(),
40
+ cell_size: zod_1.z.array(zod_1.z.number()),
41
+ cells_label_config: zod_1.z.object({
42
+ claimable: zod_1.z.object({
43
+ color: zod_1.z.array(zod_1.z.number()),
44
+ size: zod_1.z.number(),
45
+ stroke_color: zod_1.z.array(zod_1.z.number()),
46
+ stroke_width: zod_1.z.number(),
47
+ }),
48
+ unclaimable: zod_1.z.object({
49
+ color: zod_1.z.array(zod_1.z.number()),
50
+ size: zod_1.z.number(),
51
+ stroke_color: zod_1.z.array(zod_1.z.number()),
52
+ stroke_width: zod_1.z.number(),
53
+ }),
54
+ }),
55
+ dragon_evolution: zod_1.z.number(),
56
+ grey_scale_blocked_cells: zod_1.z.boolean(),
57
+ island_title_config: zod_1.z.object({
58
+ down_color: zod_1.z.array(zod_1.z.number()),
59
+ size: zod_1.z.number(),
60
+ small_stroke_color: zod_1.z.array(zod_1.z.number()),
61
+ small_stroke_width: zod_1.z.number(),
62
+ upper_color: zod_1.z.array(zod_1.z.number()),
63
+ }),
64
+ layers_z_indexes: zod_1.z.object({
65
+ additional_layer: zod_1.z.number(),
66
+ cell_backgrounds: zod_1.z.number(),
67
+ cell_contents: zod_1.z.number(),
68
+ decorations: zod_1.z.number(),
69
+ player_token: zod_1.z.number(),
70
+ walls: zod_1.z.number(),
71
+ }),
72
+ origin_offset: zod_1.z.array(zod_1.z.number()),
73
+ tutorial_scroll_duration: zod_1.z.number(),
74
+ tutorial_scroll_duration_base: zod_1.z.number(),
75
+ tutorial_scroll_duration_factor: zod_1.z.number(),
76
+ }),
77
+ active_platforms: zod_1.z.object({
78
+ ios: zod_1.z.number(),
79
+ canvas: zod_1.z.string(),
80
+ android: zod_1.z.number(),
81
+ amazon: zod_1.z.number(),
82
+ windows: zod_1.z.number(),
83
+ }),
84
+ episodes: zod_1.z.array(zod_1.z.number()),
85
+ board_size: zod_1.z.array(zod_1.z.number()),
86
+ initial_square_id: zod_1.z.number(),
87
+ backgrounds: zod_1.z.array(zod_1.z.number()),
88
+ background_plist: zod_1.z.string(),
89
+ foregrounds: zod_1.z.array(zod_1.z.any()),
90
+ foregrounds_plists: zod_1.z.array(zod_1.z.any()),
91
+ }).strict().transform(data => {
92
+ return {
93
+ id: data.id,
94
+ min_level: data.min_level,
95
+ availability: {
96
+ from: new Date(data.start_ts * 1000).toISOString(),
97
+ to: new Date(data.end_ts * 1000).toISOString(),
98
+ },
99
+ name_key: data.tid_name,
100
+ sound_tag: data.sound_tag,
101
+ zip_file_name: node_path_1.default.basename(data.zip_file),
102
+ currency_id: data.currency_id,
103
+ pool: {
104
+ points: data.pool_points,
105
+ time: data.pool_time,
106
+ },
107
+ initial_points: data.initial_points,
108
+ board_size: {
109
+ width: data.board_size[0],
110
+ height: data.board_size[1],
111
+ },
112
+ initial_square_id: data.initial_square_id,
113
+ episode_ids: data.episodes,
114
+ };
115
+ });
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export declare const gridIslandsSquareSchema: z.ZodPipe<z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ type: z.ZodString;
5
+ type_id: z.ZodOptional<z.ZodNumber>;
6
+ highlight: z.ZodNumber;
7
+ x: z.ZodNumber;
8
+ y: z.ZodNumber;
9
+ island_id: z.ZodNumber;
10
+ episode_id: z.ZodNumber;
11
+ claim_cost: z.ZodNumber;
12
+ wall: z.ZodOptional<z.ZodString>;
13
+ wall_suffix: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strict>, z.ZodTransform<{
15
+ id: number;
16
+ type: string;
17
+ reward: {
18
+ chest_id: number | undefined;
19
+ type: string;
20
+ } | {
21
+ dragon_id: number | undefined;
22
+ type: string;
23
+ } | null;
24
+ highlight: number;
25
+ x: number;
26
+ y: number;
27
+ claim_cost: number;
28
+ wall: string | undefined;
29
+ wall_suffix: string | undefined;
30
+ }, {
31
+ id: number;
32
+ type: string;
33
+ highlight: number;
34
+ x: number;
35
+ y: number;
36
+ island_id: number;
37
+ episode_id: number;
38
+ claim_cost: number;
39
+ type_id?: number | undefined;
40
+ wall?: string | undefined;
41
+ wall_suffix?: string | undefined;
42
+ }>>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gridIslandsSquareSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /*
6
+ squares: Array<{
7
+ id: number;
8
+ type: string;
9
+ type_id?: number;
10
+ highlight: number;
11
+ x: number;
12
+ y: number;
13
+ island_id: number;
14
+ episode_id: number;
15
+ claim_cost: number;
16
+ wall?: string;
17
+ wall_suffix?: string;
18
+ }
19
+ */
20
+ exports.gridIslandsSquareSchema = zod_1.z.object({
21
+ id: zod_1.z.number(),
22
+ type: zod_1.z.string(),
23
+ type_id: zod_1.z.number().optional(),
24
+ highlight: zod_1.z.number(),
25
+ x: zod_1.z.number(),
26
+ y: zod_1.z.number(),
27
+ island_id: zod_1.z.number(),
28
+ episode_id: zod_1.z.number(),
29
+ claim_cost: zod_1.z.number(),
30
+ wall: zod_1.z.string().optional(),
31
+ wall_suffix: zod_1.z.string().optional()
32
+ }).strict().transform(data => {
33
+ return {
34
+ id: data.id,
35
+ type: data.type,
36
+ reward: data.type === "NONE" ? null : {
37
+ type: data.type.toLowerCase(),
38
+ ...(data.type === "CHEST" ? {
39
+ chest_id: data.type_id,
40
+ } : {
41
+ dragon_id: data.type_id,
42
+ })
43
+ },
44
+ highlight: data.highlight,
45
+ x: data.x,
46
+ y: data.y,
47
+ claim_cost: data.claim_cost,
48
+ wall: data.wall,
49
+ wall_suffix: data.wall_suffix,
50
+ };
51
+ });
@@ -50,7 +50,6 @@ export declare const mazeIslandSchema: z.ZodPipe<z.ZodObject<{
50
50
  };
51
51
  initial_points: number;
52
52
  min_level: number;
53
- mobile_tutorial_id: number;
54
53
  zip_file_name: string;
55
54
  sound_tag: string;
56
55
  }, {
@@ -58,7 +58,6 @@ exports.mazeIslandSchema = zod_1.z.object({
58
58
  },
59
59
  initial_points: data.initial_points,
60
60
  min_level: data.min_level,
61
- mobile_tutorial_id: data.mobile_tutorial_id,
62
61
  zip_file_name: node_path_1.default.basename(data.zip_file),
63
62
  sound_tag: data.sound_tag,
64
63
  };
@@ -36,6 +36,7 @@ export declare const towerIslandSchema: z.ZodPipe<z.ZodObject<{
36
36
  }, z.core.$strip>;
37
37
  square_ids: z.ZodArray<z.ZodNumber>;
38
38
  floor_ids: z.ZodArray<z.ZodNumber>;
39
+ reward_ids: z.ZodArray<z.ZodNumber>;
39
40
  }, z.core.$strict>, z.ZodTransform<{
40
41
  id: number;
41
42
  name_key: string;
@@ -51,13 +52,17 @@ export declare const towerIslandSchema: z.ZodPipe<z.ZodObject<{
51
52
  initial_points: number;
52
53
  currency_id: number;
53
54
  min_level: number;
54
- tower_size: number[];
55
55
  zip_file_name: string;
56
56
  sound_tag: string;
57
57
  max_die_roll: number;
58
58
  help_view_id: number;
59
59
  square_ids: number[];
60
60
  floor_ids: number[];
61
+ reward_ids: number[];
62
+ board_size: {
63
+ width: number;
64
+ height: number;
65
+ };
61
66
  }, {
62
67
  id: number;
63
68
  analytics_id: string;
@@ -95,4 +100,5 @@ export declare const towerIslandSchema: z.ZodPipe<z.ZodObject<{
95
100
  };
96
101
  square_ids: number[];
97
102
  floor_ids: number[];
103
+ reward_ids: number[];
98
104
  }>>;
@@ -44,6 +44,7 @@ exports.towerIslandSchema = zod_1.z.object({
44
44
  // injected properties
45
45
  square_ids: zod_1.z.array(zod_1.z.number()),
46
46
  floor_ids: zod_1.z.array(zod_1.z.number()),
47
+ reward_ids: zod_1.z.array(zod_1.z.number()),
47
48
  }).strict().transform(data => {
48
49
  return {
49
50
  id: data.id,
@@ -60,12 +61,16 @@ exports.towerIslandSchema = zod_1.z.object({
60
61
  initial_points: data.initial_points,
61
62
  currency_id: data.currency_id,
62
63
  min_level: data.min_level,
63
- tower_size: data.tower_size,
64
64
  zip_file_name: node_path_1.default.basename(data.zip_file),
65
65
  sound_tag: data.sound_tag,
66
66
  max_die_roll: data.max_die_roll,
67
67
  help_view_id: data.help_view_id,
68
68
  square_ids: data.square_ids,
69
69
  floor_ids: data.floor_ids,
70
+ reward_ids: data.reward_ids,
71
+ board_size: {
72
+ width: data.tower_size[0],
73
+ height: data.tower_size[1],
74
+ },
70
75
  };
71
76
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dchighs/dc-config-mapper",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "A opined library to restructure and populate configuration for Dragon City.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -17,7 +17,8 @@
17
17
  "dc highs"
18
18
  ],
19
19
  "scripts": {
20
- "build": "tsc"
20
+ "build": "tsc",
21
+ "playground": "ts-node ./playground/index.ts"
21
22
  },
22
23
  "author": "Marcuth",
23
24
  "license": "MIT",