Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_toy_gun_circle_Step_0

(view raw script w/o annotations or w/e)
1
function shotFail_gml_Object_obj_toy_gun_circle_Step_0() //gml_Script_shotFail_gml_Object_obj_toy_gun_circle_Step_0
2
{
3
    outline = 0
4
    shrink = false
5
    image_alpha = 0
6
    alarm[0] = 1
alarm[0]

dd_type = "Gun Single" event_user(0)
7
    no_loop = true
8
}
9
10
var fight_number = global.fight_number
11
if (fight_number == 1)
12
{
13
    var enemy_sparing = global.enemy_sparing
14
    var enemy_vulnerable = global.enemy_vulnerable
15
    var current_hp_enemy = global.current_hp_enemy
16
    var attacking_damage_stat_critical = global.attacking_damage_stat_critical
17
    var enemy_target_x = global.enemy_target_x
18
    var enemy_target_y = global.enemy_target_y
19
}
20
else if (fight_number == 2)
21
{
22
    enemy_sparing = global.enemy_sparing_2
23
    enemy_vulnerable = global.enemy_vulnerable_2
24
    current_hp_enemy = global.current_hp_enemy_2
25
    attacking_damage_stat_critical = global.attacking_damage_stat_critical_2
26
    enemy_target_x = global.enemy_target_x_2
27
    enemy_target_y = global.enemy_target_y_2
28
}
29
else if (fight_number == 3)
30
{
31
    enemy_sparing = global.enemy_sparing_3
32
    enemy_vulnerable = global.enemy_vulnerable_3
33
    current_hp_enemy = global.current_hp_enemy_3
34
    attacking_damage_stat_critical = global.attacking_damage_stat_critical_3
35
    enemy_target_x = global.enemy_target_x_3
36
    enemy_target_y = global.enemy_target_y_3
37
}
38
script_execute(gml_Script_scr_controls_battle_reticle)
39
if (outline <= 0 && no_loop == false)
40
    shotFail()
41
if key_select
42
{
43
    if (outline > small_circle)
44
    {
45
        audio_play_sound(snd_fail, 1, 0)
46
        shotFail()
47
    }
48
    else if ((enemy_sparing == true && enemy_vulnerable == true) || (enemy_vulnerable == true && current_hp_enemy <= attacking_damage_stat_critical) || outline <= (small_circle * 0.25))
49
    {
50
        shot_type = "strong"
51
        hit_object = obj_shot_strong
52
        if (global.battle_enemy_name == "micro froggit" && outline > (small_circle * 0.25))
53
        {
54
            shot_type = "weak"
55
            hit_object = obj_shot_weak
56
        }
57
    }
58
    else if (outline <= (small_circle * 0.6) && outline > (small_circle * 0.25))
59
    {
60
        shot_type = "medium"
61
        hit_object = obj_shot_medium
62
    }
63
    else if (outline < small_circle && outline > (small_circle * 0.6))
64
    {
65
        shot_type = "weak"
66
        hit_object = obj_shot_weak
67
    }
68
    if (shrink == true)
69
    {
70
        instance_create(enemy_target_x, enemy_target_y, hit_object)
71
        shrink = false
72
        button_pressed = true
73
    }
74
}
75
if (outline > 0 && shrink == true)
76
    outline -= shrink_speed
77
if (button_pressed == true && shrink == false)
78
{
79
    color_alt_total += color_alt_speed
80
    if (color_alt_total >= color_alt_max)
81
    {
82
        color_alt_total = 0
83
        color_number += 1
84
        if (color_number > 1)
85
            color_number = 0
86
    }
87
    cursor_color = color[color_number]
88
    color_number_2 = color_number + 1
89
    if (color_number_2 > 1)
90
        color_number_2 = 0
91
    outline_color = color[color_number_2]
92
}