Skip to content

Commit 9f33e64

Browse files
committed
gaia battle anim complete
1 parent da0dce0 commit 9f33e64

File tree

5 files changed

+223
-3
lines changed

5 files changed

+223
-3
lines changed

assets/dbs/abilities_animations/gaia_db.json

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,101 @@
5555
"to": [5, 5, 13, 13],
5656
"start_delay": 0,
5757
"sprite_index": [2, 3, 4, 5]
58+
},{
59+
"is_absolute": false,
60+
"to": -10,
61+
"start_delay": 1200,
62+
"duration": 300,
63+
"sprite_index": "targets",
64+
"dont_affect_shadow": true
65+
},{
66+
"is_absolute": false,
67+
"to": -5,
68+
"start_delay": 1500,
69+
"duration": 300,
70+
"sprite_index": "targets",
71+
"dont_affect_shadow": true
72+
},{
73+
"is_absolute": false,
74+
"to": 7,
75+
"start_delay": 1800,
76+
"duration": 300,
77+
"sprite_index": "targets",
78+
"dont_affect_shadow": true
79+
},{
80+
"is_absolute": false,
81+
"to": -5,
82+
"start_delay": 2100,
83+
"duration": 300,
84+
"sprite_index": "targets",
85+
"dont_affect_shadow": true
86+
},{
87+
"is_absolute": false,
88+
"to": 13,
89+
"start_delay": 2700,
90+
"duration": 50,
91+
"sprite_index": "targets",
92+
"dont_affect_shadow": true,
93+
"tween": "Bounce.Out"
94+
}],
95+
"shake_sequence": [{
96+
"sprite_index": "background",
97+
"start_delay": 300,
98+
"interval": 45,
99+
"shake_count": 8,
100+
"intensity": 1,
101+
"direction": "y"
102+
},{
103+
"sprite_index": "background",
104+
"start_delay": 1200,
105+
"interval": 50,
106+
"shake_count": 12,
107+
"intensity": 2,
108+
"direction": "x"
109+
},{
110+
"sprite_index": "background",
111+
"start_delay": 1200,
112+
"interval": 45,
113+
"shake_count": 12,
114+
"intensity": 1,
115+
"direction": "y"
116+
},{
117+
"sprite_index": "targets",
118+
"start_delay": 1200,
119+
"interval": 40,
120+
"shake_count": 10,
121+
"intensity": 2,
122+
"direction": "y"
58123
}],
59124
"alpha_sequence": [{
125+
"start_delay": 0,
126+
"to": 0.75,
127+
"is_absolute": true,
128+
"tween": "Linear.None",
129+
"sprite_index": "background",
130+
"duration": 200
131+
},{
132+
"start_delay": 2500,
133+
"to": 1.0,
134+
"is_absolute": true,
135+
"tween": "Linear.None",
136+
"sprite_index": "background",
137+
"duration": 200
138+
},{
139+
"start_delay": 0,
140+
"to": 0.0,
141+
"is_absolute": true,
142+
"tween": "Linear.None",
143+
"sprite_index": "allies",
144+
"duration": 500
145+
},{
146+
"start_delay": 2500,
147+
"to": 1.0,
148+
"is_absolute": true,
149+
"tween": "Linear.None",
150+
"sprite_index": "allies",
151+
"duration": 300
152+
},{
60153
"is_absolute": true,
61154
"to": 1,
62155
"start_delay": 1600,
@@ -72,6 +165,18 @@
72165
"start_delay": 1400,
73166
"duration": 200,
74167
"sprite_index": [2,3]
168+
},{
169+
"is_absolute": true,
170+
"to": 1,
171+
"start_delay": 2500,
172+
"duration": 200,
173+
"sprite_index": [0,1]
174+
},{
175+
"is_absolute": true,
176+
"to": 0,
177+
"start_delay": 2500,
178+
"duration": 200,
179+
"sprite_index": [4, 5]
75180
}],
76181
"x_scale_sequence": [{
77182
"is_absolute": true,
@@ -96,7 +201,7 @@
96201
"start_delay": 0,
97202
"sprite_index": [2,3],
98203
"wait": false,
99-
"frame_rate": 22,
204+
"frame_rate": 25,
100205
"repeat": true
101206
},{
102207
"animation_key": "beam",
@@ -106,9 +211,109 @@
106211
"frame_rate": 23,
107212
"repeat": false,
108213
"hide_on_complete": true
214+
},{
215+
"animation_key": "beam",
216+
"start_delay": 2500,
217+
"sprite_index": [0,1],
218+
"wait": true,
219+
"frame_rate": 23,
220+
"repeat": false,
221+
"reverse": true,
222+
"hide_on_complete": true
223+
},{
224+
"animation_key": "damage",
225+
"start_delay": 1200,
226+
"sprite_index": "targets",
227+
"wait": false
109228
}],
110229
"alpha_gray_filter_sequence": [{
111230
"start_delay": 0,
112231
"sprite_index": [0, 1, 2, 3, 4, 5]
232+
}],
233+
"blink_sequence": [{
234+
"sprite_index": "targets",
235+
"start_delay": 1200,
236+
"count": 4,
237+
"duration": 80,
238+
"interval": 150
239+
}],
240+
"center_shift_sequence": [{
241+
"start_delay": 1200,
242+
"to": 12,
243+
"is_absolute": false,
244+
"tween": "Quadratic.Out",
245+
"sprite_index": "targets",
246+
"duration": 150
247+
}],
248+
"particles_sequence": [{
249+
"data": {
250+
"rocks_1" : {
251+
"image": "gaia_battle_animation",
252+
"scale": { "min": 0.4, "max": 0.7 },
253+
"rotation" : { "min": 0, "max": 360},
254+
"animations": {
255+
"leaf": {
256+
"frames": { "start": 0, "stop": 2, "prefix": "rocks/", "suffix": "", "zeroPad": 3 },
257+
"frameRate": 0
258+
}
259+
},
260+
"vy": { "min": -17, "max": -10 }
261+
},
262+
"rocks_2" : {
263+
"image": "gaia_battle_animation",
264+
"scale": { "min": 0.7, "max": 1.2 },
265+
"rotation" : { "min": 0, "max": 360},
266+
"animations": {
267+
"leaf": {
268+
"frames": { "start": 0, "stop": 2, "prefix": "rocks/", "suffix": "", "zeroPad": 3 },
269+
"frameRate": 0
270+
}
271+
},
272+
"vy": { "min": -11, "max": -8 }
273+
}
274+
},
275+
"zones": {
276+
"rect_zone_1": {
277+
"type": "rectangle",
278+
"width": 30,
279+
"height": 5
280+
},
281+
"rect_zone_2": {
282+
"type": "rectangle",
283+
"width": 90,
284+
"height": 5
285+
}
286+
},
287+
"emitters": [{
288+
"x": "targets",
289+
"y": "targets",
290+
"shift_x": -15,
291+
"zone_key": "rect_zone_1",
292+
"position": "between",
293+
"render_type": "sprite",
294+
"repeat": 10,
295+
"frequency": 80,
296+
"emitter_data_key": "rocks_1",
297+
"delay": {
298+
"start": 300,
299+
"visible": false
300+
}
301+
},{
302+
"x": "targets",
303+
"y": "targets",
304+
"shift_x": -45,
305+
"zone_key": "rect_zone_2",
306+
"position": "between",
307+
"render_type": "sprite",
308+
"total": 3,
309+
"repeat": 16,
310+
"frequency": 80,
311+
"emitter_data_key": "rocks_2",
312+
"delay": {
313+
"start": 1200,
314+
"visible": false
315+
}
316+
}],
317+
"emission_finish": 2500
113318
}]
114319
}

base/battle/Battle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ export class Battle {
863863
//resets stage and chars position to default
864864
this.battle_stage.pause_players_update = false;
865865
this.battle_stage.set_update_factor(1);
866+
this.battle_stage.set_bg_default_position();
866867
await Promise.all([this.battle_stage.reset_chars_position(), this.battle_stage.set_stage_default_position()]);
867868

868869
//summon's power buff after cast
@@ -1818,6 +1819,7 @@ So, if a character will die after 5 turns and you land another Curse on them, it
18181819
async battle_phase_end() {
18191820
this.battle_stage.pause_players_update = false;
18201821
this.battle_stage.set_update_factor(1);
1822+
this.battle_stage.set_bg_default_position();
18211823
await Promise.all([this.battle_stage.reset_chars_position(), this.battle_stage.set_stage_default_position()]);
18221824

18231825
for (let i = 0; i < this.on_going_effects.length; ++i) {

base/battle/BattleAnimation.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ export class BattleAnimation {
511511
y: this.caster_sprite.y,
512512
};
513513
this.targets_sprites = targets_sprites;
514-
this.allies_sprites = allies_sprites;
514+
this.allies_sprites = allies_sprites.filter(s => s !== caster_sprite);
515515
this.background_sprites = background_sprites;
516516
this.group_caster = group_caster;
517517
this.group_enemy = group_enemy;
@@ -1937,7 +1937,8 @@ export class BattleAnimation {
19371937
const r = filter_seq?.color?.r ?? 1.0;
19381938
const g = filter_seq?.color?.g ?? 1.0;
19391939
const b = filter_seq?.color?.b ?? 1.0;
1940-
blink_timer.loop(filter_seq.interval, () => {
1940+
const blink_duration = filter_seq?.duration ?? null;
1941+
blink_timer.loop(filter_seq.interval, async () => {
19411942
if (counter % 2 === 0) {
19421943
filter.r = r;
19431944
filter.g = g;
@@ -1947,6 +1948,12 @@ export class BattleAnimation {
19471948
filter.g = -1;
19481949
filter.b = -1;
19491950
}
1951+
if (blink_duration && blink_duration > 30 && filter.r !== -1) {
1952+
await promised_wait(this.game, blink_duration);
1953+
filter.r = -1;
1954+
filter.g = -1;
1955+
filter.b = -1;
1956+
}
19501957
--counter;
19511958
if (counter === 0) {
19521959
blink_timer.stop();

base/battle/BattleAnimationTester.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ export class BattleAnimationTester {
301301
//resets stage and chars position to default
302302
this.battle_stage.pause_players_update = false;
303303
this.battle_stage.set_update_factor(1);
304+
this.battle_stage.set_bg_default_position();
304305
await Promise.all([this.battle_stage.reset_chars_position(), this.battle_stage.set_stage_default_position()]);
305306
}
306307

base/battle/BattleStage.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,11 @@ export class BattleStage {
448448
await promise;
449449
}
450450

451+
set_bg_default_position() {
452+
this.battle_bg.y = BG_Y;
453+
this.battle_bg2.y = BG_Y;
454+
}
455+
451456
get_player_position_in_stage(sprite_index: number, target_angle?: number) {
452457
const player_sprite = this.sprites[sprite_index];
453458
target_angle = target_angle ?? this.camera_angle.rad;

0 commit comments

Comments
 (0)