1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
charge_percentage = charge_time / charge_time_max; |
4 |
if (is_charging) |
5 |
{ |
6 |
if (!audio_is_playing(snd_chargeshot_charge) && !is_charged) |
7 |
{ |
8 |
charge_sound = audio_play_sound(snd_chargeshot_charge, 1, 1); |
9 |
audio_sound_gain(charge_sound, 0.8, 0); |
10 |
audio_sound_pitch(charge_sound, 0.5); |
11 |
} |
12 |
if (charge_time > 0) |
13 |
{ |
14 |
charge_time -= 1; |
15 |
} |
16 |
else if (!is_charged) |
17 |
{ |
18 |
var ready_sound = audio_play_sound(snd_undertale_flash, 1, 0); |
19 |
audio_sound_gain(ready_sound, 0.5, 0); |
20 |
is_charged = true; |
21 |
sprite_index = spr_heart_yellow_ready; |
22 |
image_index = 0; |
23 |
image_speed = 1; |
24 |
} |
25 |
} |
26 |
else |
27 |
{ |
28 |
audio_stop_sound(charge_sound); |
29 |
} |
30 |
if ((can_shoot && keyboard_multicheck_pressed(0)) || auto_shoot) |
31 |
{ |
32 |
alarm[0] = -1; |
33 |
draw_hint = false; |
34 |
can_shoot = false; |
35 |
auto_shoot = false; |
36 |
if (is_charging == true) |
37 |
{ |
38 |
is_charging = false; |
39 |
charge_time = charge_time_max; |
40 |
sprite_index = spr_heart_yellow_up; |
41 |
image_index = 0; |
42 |
image_speed = 0; |
43 |
if (is_charged == true) |
44 |
{ |
45 |
instance_create_depth(x + 0.5, y - 6, -10000, obj_heart_yellow_shot_big); |
46 |
is_charged = false; |
47 |
sprite_index = spr_heart_yellow_shoot; |
48 |
image_index = 0; |
49 |
image_speed = 1; |
50 |
} |
51 |
} |
52 |
} |
53 |
if (audio_is_playing(charge_sound)) |
54 |
{ |
55 |
var pitch_original = audio_sound_get_pitch(charge_sound); |
56 |
if (pitch_original < 0.99) |
57 |
audio_sound_pitch(charge_sound, 1 - (0.5 * charge_percentage)); |
58 |
else |
59 |
audio_sound_pitch(charge_sound, 1); |
60 |
} |
61 |
if (!draw_hint) |
62 |
{ |
63 |
if (can_shoot && !alarm[0]) |
64 |
alarm[0] = 60; |
65 |
} |
66 |
else if (hint_alpha < 1) |
67 |
{ |
68 |
hint_alpha += 0.1; |
69 |
} |