Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_wild_revolver_circle_multi_pre_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
function shoot_fail_gml_Object_obj_wild_revolver_circle_multi_pre_Step_0() //gml_Script_shoot_fail_gml_Object_obj_wild_revolver_circle_multi_pre_Step_0
4
{
5
    if (!shoot_miss)
6
    {
7
        gun_spin = false
8
        hit[circle_current] = 0
9
        color_hit_number[circle_current] = 0
10
        button_pressed = true
11
        if (shot_add == 0)
12
            button_pressed = false
13
        var shot_sound = audio_play_sound(snd_fail, 1, 0)
14
        shrink[circle_current] = false
15
        shrink_speed = 0
16
        alarm[0] = 20
alarm[0]

with (obj_target_bar_battle) { shot_total_pre += obj_wild_revolver_circle_multi_pre.shot_add if (button_pressed_pre == false) button_pressed_pre = obj_wild_revolver_circle_multi_pre.button_pressed if (other.shoot_miss == true) alarm[0] = 1 } with (obj_wild_revolver_battle_outline) continue_shot = obj_wild_revolver_circle_multi_pre.button_pressed instance_destroy()
17
        shoot_miss = true
18
        key_select = 0
19
        no_loop = true
20
    }
21
}
22
23
if (execute_create == true)
24
{
25
    if (can_execute == false)
26
        return;
27
    var fight_number = global.fight_number
28
    if (fight_number == 1)
29
    {
30
        var enemy_sparing = global.enemy_sparing
31
        var enemy_vulnerable = global.enemy_vulnerable
32
        var current_hp_enemy = global.current_hp_enemy
33
        var attacking_damage_stat_critical = global.attacking_damage_stat_critical
34
        var enemy_target_x = global.enemy_target_x
35
        var enemy_target_y = global.enemy_target_y
36
    }
37
    else if (fight_number == 2)
38
    {
39
        enemy_sparing = global.enemy_sparing_2
40
        enemy_vulnerable = global.enemy_vulnerable_2
41
        current_hp_enemy = global.current_hp_enemy_2
42
        attacking_damage_stat_critical = global.attacking_damage_stat_critical_2
43
        enemy_target_x = global.enemy_target_x_2
44
        enemy_target_y = global.enemy_target_y_2
45
    }
46
    else if (fight_number == 3)
47
    {
48
        enemy_sparing = global.enemy_sparing_3
49
        enemy_vulnerable = global.enemy_vulnerable_3
50
        current_hp_enemy = global.current_hp_enemy_3
51
        attacking_damage_stat_critical = global.attacking_damage_stat_critical_3
52
        enemy_target_x = global.enemy_target_x_3
53
        enemy_target_y = global.enemy_target_y_3
54
    }
55
    script_execute(gml_Script_scr_controls_battle_reticle_multi)
56
    for (i = 0; i <= final_circle; i++)
57
    {
58
        if (outline[i] <= 0 && shrink[i] == true)
59
        {
60
            outline[i] = 0
61
            shrink[i] = false
62
            imagea[i] = 0
63
            circle_current += 1
64
        }
65
    }
66
    if key_select
67
    {
68
        if (outline[circle_current] > small_circle)
69
        {
70
            shoot_fail()
71
            return;
72
        }
73
        else if ((enemy_sparing == true && enemy_vulnerable == true) || (enemy_vulnerable == true && current_hp_enemy <= attacking_damage_stat_critical) || outline[circle_current] <= (small_circle * 0.5))
74
        {
75
            gun_spin = true
76
            hit[circle_current] = 2
77
            color_hit_number[circle_current] = 1
78
            shot_add += 3
79
            if (circle_current == final_circle)
80
                hit_object = 2916
81
            else
82
                hit_object = 2916
83
            shot_sound = audio_play_sound(snd_attackhitperfect, 1, 0)
84
        }
85
        else if (outline[circle_current] <= small_circle && outline[circle_current] > (small_circle * 0.5))
86
        {
87
            gun_spin = true
88
            hit[circle_current] = 1
89
            color_hit_number[circle_current] = 0
90
            shot_add += 2
91
            if (circle_current == final_circle)
92
                hit_object = 2915
93
            else
94
                hit_object = 2915
95
            shot_sound = audio_play_sound(snd_attackhit, 1, 0)
96
        }
97
        audio_sound_pitch(shot_sound, (1 + obj_wild_revolver_battle_outline.target_current * 0.08))
98
        instance_create((enemy_target_x + (irandom_range(-50, 50))), (enemy_target_y + (irandom_range(-50, 50))), hit_object)
99
        shrink[circle_current] = false
100
        button_pressed = true
101
        button_pressed_main = true
102
        circle_current += 1
103
        if (circle_current > final_circle)
104
            alarm[0] = 5
alarm[0]

with (obj_target_bar_battle) { shot_total_pre += obj_wild_revolver_circle_multi_pre.shot_add if (button_pressed_pre == false) button_pressed_pre = obj_wild_revolver_circle_multi_pre.button_pressed if (other.shoot_miss == true) alarm[0] = 1 } with (obj_wild_revolver_battle_outline) continue_shot = obj_wild_revolver_circle_multi_pre.button_pressed instance_destroy()
105
        key_select = 0
106
    }
107
    for (i = 0; i <= final_circle; i++)
108
    {
109
        if (outline[i] > 0 && shrink[i] == true)
110
        {
111
            outline[i] -= shrink_speed
112
            if (outline[i] <= 0)
113
            {
114
                outline[i] = 0
115
                shoot_fail()
116
            }
117
        }
118
        if (shrink[i] == false && imagea[i] > 0)
119
        {
120
            if (hit[i] == 2)
121
            {
122
                color_alt_total[i] += color_alt_speed
123
                if (color_alt_total[i] >= color_alt_max)
124
                {
125
                    color_alt_total[i] = 0
126
                    color_hit_number[i] += 1
127
                    if (color_hit_number[i] > 2)
128
                        color_hit_number[i] = 0
129
                }
130
            }
131
            if (hit[i] != 0)
132
            {
133
                cursor_color[i] = color_hit[color_hit_number[i]]
134
                outline_color[i] = color_hit[color_hit_number[i]]
135
            }
136
            thickness[i] += thick_increase
137
            imagea[i] -= imagea_dec
138
            if (imagea[i] < 0)
139
                imagea[i] = 0
140
        }
141
    }
142
    if (no_loop == false)
143
    {
144
        if (outline[final_circle] == 0 && hit[final_circle] == false)
145
        {
146
            if (!instance_exists(obj_strike_fake))
147
            {
148
                alarm[0] = 5
alarm[0]

with (obj_target_bar_battle) { shot_total_pre += obj_wild_revolver_circle_multi_pre.shot_add if (button_pressed_pre == false) button_pressed_pre = obj_wild_revolver_circle_multi_pre.button_pressed if (other.shoot_miss == true) alarm[0] = 1 } with (obj_wild_revolver_battle_outline) continue_shot = obj_wild_revolver_circle_multi_pre.button_pressed instance_destroy()
149
                no_loop = true
150
            }
151
        }
152
    }
153
}