Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_pointsAdd_OLD_Step_0

(view raw script w/o annotations or w/e)
1
init = 0;
2
if (reward < 0)
3
    sprite_index = spr_board_tile_losepoints;
4
init = 1;
5
if (tilecon == 0)
6
    timer = 0;
7
if (tilecon == 1 && obj_mainchara_board.movingnow == 0)
8
{
9
    if (i_ex(obj_board_controller))
10
        obj_board_controller.phase = 99;
11
    timer++;
12
    if (timer == 5)
13
    {
14
        rewardadded = 0;
15
        tilecon = 2;
16
    }
17
}
18
if (tilecon == 2)
19
{
20
    if (reward > 0)
21
    {
22
        if (rewardadded < reward)
23
        {
24
            global.flag[1044 points] += 2;
25
            global.flag[1117 points_spent] = 2;
26
            rewardadded += 2;
27
            if ((rewardadded % 4) == 0)
28
                snd_play(snd_txtsans);
29
        }
30
        else
31
        {
32
            tilecon = 99;
33
        }
34
    }
35
    else if (rewardadded < abs(reward))
36
    {
37
        global.flag[1044 points] -= 2;
38
        if (global.flag[1044 points] < 0)
39
        {
40
            global.flag[1044 points] = 0;
41
            rewardadded = 99999;
42
        }
43
        rewardadded += 2;
44
        if ((rewardadded % 4) == 0)
45
            snd_play(snd_txtpap);
46
    }
47
    else
48
    {
49
        tilecon = 99;
50
    }
51
}
52
if (tilecon == 99)
53
{
54
    tilecon = 0;
55
    tiledone = 1;
56
    if (i_ex(obj_board_controller))
57
        obj_board_controller.phase = 0;
58
    instance_destroy();
59
}