Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_card_game_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (cardg_fade_out == true)
2
{
3
    if (cardg_draw_alpha > 0)
4
        cardg_draw_alpha -= 0.05
5
    else
6
        instance_destroy()
7
}
8
else if (cardg_draw_alpha < 1)
9
{
10
    cardg_draw_alpha += 0.05
11
    return;
12
}
13
if (instance_number(obj_card_game_card) <= 0 && (!cardg_failure) && (!cardg_fade_out))
14
{
15
    if instance_exists(obj_card_game_cursor)
16
        instance_destroy(obj_card_game_cursor)
17
    if (cardg_flashing_timer == 0)
18
    {
19
        cardg_flashing_timer = 20
20
        cardg_flash *= -1
21
    }
22
    else
23
        cardg_flashing_timer--
24
    if ((!alarm[0]) && cardg_victory == false)
25
        alarm[0] = 90
alarm[0]

cardg_victory = true audio_play_sound(snd_card_game_win, 1, 0)
26
    audio_sound_gain(mus_card_game, 0, 1000)
27
    if (cardg_victory == true)
28
    {
29
        var max_g_gained = 25
30
        var time_in_seconds = floor(cardg_timer / 30)
31
        if (time_in_seconds <= cardg_time_gold)
32
            max_g_gained = 25
33
        else if (time_in_seconds <= cardg_time_silver)
34
            max_g_gained = 15
35
        else
36
            max_g_gained = 3
37
        if (cardg_g_gained <= max_g_gained)
38
        {
39
            cardg_g_gained += 0.25
40
            if (cardg_g_gained == floor(cardg_g_gained))
41
                audio_play_sound(snd_card_game_gold, 1, 0)
42
        }
43
        else if (!alarm[1])
44
            alarm[1] = 120
alarm[1]

cardg_fade_out = true
45
    }
46
    return;
47
}
48
if cardg_failure
49
{
50
    if (!alarm[1])
51
        alarm[1] = 120
alarm[1]

cardg_fade_out = true
52
    return;
53
}
54
if (cardg_intro_countdown > 0)
55
{
56
    switch cardg_intro_countdown
57
    {
58
        case 120:
59
        case 90:
60
        case 60:
61
            audio_play_sound(snd_ring, 1, 0)
62
            cardg_intro_countdown_alpha = 1
63
            break
64
        case 30:
65
            audio_play_sound(snd_card_game_match, 1, 0)
66
            cardg_intro_countdown_alpha = 1
67
            break
68
    }
69
70
    cardg_intro_countdown_alpha = clamp((cardg_intro_countdown_alpha - 0.1), 0, cardg_intro_countdown_alpha)
71
    cardg_intro_countdown -= 1
72
}
73
else
74
    cardg_timer += 1