Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3cactusfield_Step_0

(view raw script w/o annotations or w/e)
1
scr_board_populatevars
scr_board_populatevars

function
scr_board_populatevars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (kris == 0) { with (obj_mainchara_board) { if (name == "kris") other.kris = id; } } if (ralsei == 0) { with (obj_mainchara_board) { if (name == "ralsei") other.ralsei = id; } } if (susie == 0) { with (obj_mainchara_board) { if (name == "susie") other.susie = id; } } }
();
2
scr_gameshow_populatevars
scr_gameshow_populatevars

function
scr_gameshow_populatevars()
{ if (!variable_instance_exists(id, "kr_real")) kr_real = 0; if (!variable_instance_exists(id, "su_real")) su_real = 0; if (!variable_instance_exists(id, "ra_real")) ra_real = 0; if (!variable_instance_exists(id, "tenna")) tenna = 0; if (kr_real == 0) { with (obj_mainchara) other.kr_real = id; } if (su_real == 0) { with (obj_caterpillarchara) { if (name == "susie") other.su_real = id; } } if (ra_real == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ra_real = id; } } if (tenna == 0) { with (obj_actor_tenna) other.tenna = id; } }
();
3
if (desertboy == 0)
4
{
5
    with (obj_board_npc)
6
    {
7
        if (extflag == "b3desert2")
8
            other.desertboy = id;
9
    }
10
}
11
if (active == 1)
12
{
13
    if (con == 0 && obj_board_camera.con == 0)
14
        con = 1;
15
    if (con == 1)
16
    {
17
        timer++;
18
        if (timer == 1)
19
            tenna.bounce = 1;
20
        if (timer == 61)
21
        {
22
            con = 2;
23
            timer = 0;
24
        }
25
    }
26
    if (con == 50)
27
    {
28
        if (i_ex(obj_writer))
29
        {
30
            if (obj_writer.reachedend == true)
31
            {
32
                con = 51;
33
                timer = 0;
34
            }
35
        }
36
    }
37
    if (con == 51)
38
    {
39
        timer++;
40
        if (timer == 15)
41
        {
42
            tenna.bounce = 1;
43
            
scr_shakeobj_ext
scr_shakeobj_ext

function
scr_shakeobj_ext()
{ var _shakeobj = instance_create(x, y, obj_shakeobj_ext); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakexamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakeyamt = argument2; } if (argument_count >= 4) { if (argument3 != -1) _shakeobj.shakereduct = argument3; } if (argument_count >= 5) { if (argument4 != -1) _shakeobj.shakespeed = argument4; } with (_shakeobj) event_user(0); }
(tenna, 4, 10);
44
        }
45
        if (timer == 75)
46
            tenna.bounce = 1;
47
        if (timer == 115)
48
        {
49
            with (desertboy)
50
            {
51
                instance_create(x, y, obj_board_smokepuff);
52
                snd_play(snd_board_splash);
53
                instance_destroy();
54
            }
55
            desertboy = -1;
56
            with (obj_board_writer)
57
                instance_destroy();
58
            with (obj_writer)
59
                instance_destroy();
60
            con = 72;
61
            global.interact = 0;
62
        }
63
    }
64
    if (suwalk == 0 && obj_board_camera.con == 0)
65
    {
66
        suwalktimer++;
67
        if (suwalktimer == 1)
68
            ralsei.follow = false;
69
        if (suwalktimer == 10)
70
        {
71
            if (susie.x < 250)
72
                
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", choose(5, 6), 1, 0);
73
            else
74
                
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", 1, choose(3, 4), 0);
75
        }
76
        if (suwalktimer == 25)
77
        {
78
            var rand = irandom(3);
79
            var targx = 1;
80
            var targy = 1;
81
            switch (rand)
82
            {
83
                case 0:
84
                    targx = 2;
85
                    targy = 4;
86
                    break;
87
                case 1:
88
                    targx = 5;
89
                    targy = choose(2, 3);
90
                    break;
91
                case 2:
92
                    targx = 10;
93
                    targy = 6;
94
                    break;
95
                case 3:
96
                    targx = 6;
97
                    targy = choose(4, 5);
98
                    break;
99
            }
100
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("ralsei", targx, targy, 0);
101
            suwalk = 1;
102
        }
103
    }
104
}
105
else
106
{
107
    if (con == 72)
108
    {
109
        desertboy = instance_create(room_width, room_height, obj_board_npc);
110
        desertboy.extflag = "b3goodboy";
111
        with (desertboy)
112
            setxy_board(1696, 1280);
113
    }
114
    if (con > 0)
115
        con = 999;
116
    suwalktimer = 0;
117
    suwalk = 0;
118
}