Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_wild_revolver_circle_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (can_execute == false)
4
    return;
5
var fight_number = global.fight_number
6
if (fight_number == 1)
7
{
8
    var enemy_sparing = global.enemy_sparing
9
    var enemy_vulnerable = global.enemy_vulnerable
10
    var current_hp_enemy = global.current_hp_enemy
11
    var attacking_damage_stat_critical = global.attacking_damage_stat_critical
12
    var enemy_target_x = global.enemy_target_x
13
    var enemy_target_y = global.enemy_target_y
14
}
15
else if (fight_number == 2)
16
{
17
    enemy_sparing = global.enemy_sparing_2
18
    enemy_vulnerable = global.enemy_vulnerable_2
19
    current_hp_enemy = global.current_hp_enemy_2
20
    attacking_damage_stat_critical = global.attacking_damage_stat_critical_2
21
    enemy_target_x = global.enemy_target_x_2
22
    enemy_target_y = global.enemy_target_y_2
23
}
24
else if (fight_number == 3)
25
{
26
    enemy_sparing = global.enemy_sparing_3
27
    enemy_vulnerable = global.enemy_vulnerable_3
28
    current_hp_enemy = global.current_hp_enemy_3
29
    attacking_damage_stat_critical = global.attacking_damage_stat_critical_3
30
    enemy_target_x = global.enemy_target_x_3
31
    enemy_target_y = global.enemy_target_y_3
32
}
33
script_execute(gml_Script_scr_controls_battle_reticle)
34
if (outline <= 0 && no_loop == false)
35
{
36
    outline = 0
37
    shrink = false
38
    image_alpha = 0
39
    alarm[0] = 1
alarm[0]

if (button_pressed_pre == true) button_pressed = true dd_type = "Revolver Single" event_user(0)
40
    no_loop = true
41
}
42
if key_select
43
{
44
    if ((outline < small_circle && ((enemy_sparing == true && enemy_vulnerable == true) || (enemy_vulnerable == true && current_hp_enemy <= attacking_damage_stat_critical))) || outline <= (small_circle * 0.5))
45
    {
46
        shot_type = "strong"
47
        hit_object = obj_shot_strong
48
        var shot_sound = audio_play_sound(snd_attackhitperfect, 1, 0)
49
    }
50
    else if (outline < small_circle && outline > (small_circle * 0.5))
51
    {
52
        shot_type = "medium"
53
        hit_object = 2912
54
        shot_sound = audio_play_sound(snd_attackhit, 1, 0)
55
    }
56
    else
57
    {
58
        shrink = false
59
        image_alpha = 0
60
        alarm[0] = 5
alarm[0]

if (button_pressed_pre == true) button_pressed = true dd_type = "Revolver Single" event_user(0)
61
        no_loop = true
62
        button_pressed = true
63
        button_pressed_main = true
64
        audio_play_sound(snd_fail, 1, 0)
65
        return;
66
    }
67
    audio_sound_pitch(shot_sound, (1 + obj_wild_revolver_battle_outline.target_current * 0.08))
68
    instance_create(enemy_target_x, enemy_target_y, hit_object)
69
    shrink = false
70
    button_pressed = true
71
    button_pressed_main = true
72
}
73
if (outline > 0 && shrink == true)
74
    outline -= shrink_speed
75
if (button_pressed_main == true && shrink == false)
76
{
77
    color_alt_total += color_alt_speed
78
    if (color_alt_total >= color_alt_max)
79
    {
80
        color_alt_total = 0
81
        color_number += 1
82
        if (color_number > 1)
83
            color_number = 0
84
    }
85
    cursor_color = color[color_number]
86
    color_number_2 = color_number + 1
87
    if (color_number_2 > 1)
88
        color_number_2 = 0
89
    outline_color = color[color_number_2]
90
}