1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
switch (attack_beam_stage) |
4 |
{ |
5 |
case 0: |
6 |
attack_beam_width_current += attack_beam_width_inc; |
7 |
if (attack_beam_width_current >= attack_beam_width) |
8 |
{ |
9 |
attack_beam_width_current = attack_beam_width; |
10 |
attack_beam_stage = 1; |
11 |
attack_beam_draw_color = make_colour_rgb(230, 50, 50); |
12 |
} |
13 |
attack_beam_draw_alpha = (attack_beam_width_current / attack_beam_width) * 0.5; |
14 |
break; |
15 |
case 1: |
16 |
if (attack_beam_grow == true) |
17 |
{ |
18 |
if (attack_beam_width_current < (attack_beam_width + attack_beam_width_fluctuation)) |
19 |
attack_beam_width_current += 2; |
20 |
} |
21 |
if (attack_beam_grow == false) |
22 |
{ |
23 |
if (attack_beam_width_current > (attack_beam_width - attack_beam_width_fluctuation)) |
24 |
attack_beam_width_current -= 2; |
25 |
else |
26 |
attack_beam_grow = true; |
27 |
} |
28 |
if (attack_beam_timer > 0) |
29 |
attack_beam_timer -= 1; |
30 |
else |
31 |
attack_beam_stage = 2; |
32 |
break; |
33 |
case 2: |
34 |
if (attack_beam_width_current > 0) |
35 |
attack_beam_width_current -= 7; |
36 |
else |
37 |
instance_destroy(); |
38 |
break; |
39 |
} |
40 |
if (attack_beam_stage == 0) |
41 |
exit; |
42 |
var y_original = 0; |
43 |
var y_max = room_height; |
44 |
var x_original = 0; |
45 |
var x_max = room_width; |
46 |
if (obj_heart_battle_fighting_parent.vulnerable == true && (point_in_rectangle(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, x - (attack_beam_width_current / 2), y_original, x + (attack_beam_width_current / 2), y_max) || point_in_rectangle(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, x_original, y - (attack_beam_width_current / 2), x_max, y + (attack_beam_width_current / 2)))) |
47 |
{ |
48 |
var damage = (global.enemy_attack_stat - global.player_armor_defense - global.player_armor_modifier_defense - global.player_defense) + 10; |
49 |
if (damage < 1) |
50 |
damage = 1; |
51 |
global.current_hp_self -= damage; |
52 |
audio_play_sound(snd_hurt, 1, 0); |
53 |
with (obj_heart_battle_fighting_parent) |
54 |
{ |
55 |
vulnerable = false; |
56 |
global.hit_self = true; |
57 |
alarm[0] |
58 |
} |
59 |
} |