Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3danger2_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 (mytrig == 0)
4
{
5
    with (obj_board_trigger)
6
    {
7
        if (extflag == "b3danger2")
8
            other.mytrig = id;
9
    }
10
}
11
if (active == 1)
12
{
13
    var triggered = 0;
14
    with (mytrig)
15
    {
16
        if (place_meeting(x, y, obj_mainchara_board))
17
            triggered = 1;
18
    }
19
    var reset = false;
20
    if (obj_board_camera.con == 0 && triggered)
21
    {
22
        var rate = 10;
23
        guntimer++;
24
        switch (guntimer)
25
        {
26
            case 10:
27
                mygunner1 = instance_create_board(1, 1, obj_board_shadowgunner);
28
                break;
29
            case 20:
30
                mygunner2 = instance_create_board(8, 1, obj_board_shadowgunner);
31
                break;
32
            case 30:
33
                safe_delete(mygunner1);
34
                break;
35
            case 40:
36
                safe_delete(mygunner2);
37
                break;
38
            case 50:
39
                mygunner1 = instance_create_board(3, 1, obj_board_shadowgunner);
40
                break;
41
            case 60:
42
                mygunner2 = instance_create_board(10, 1, obj_board_shadowgunner);
43
                break;
44
            case 70:
45
                safe_delete(mygunner1);
46
                break;
47
            case 80:
48
                safe_delete(mygunner2);
49
                guntimer = -1;
50
                break;
51
        }
52
    }
53
    else
54
    {
55
        reset = true;
56
    }
57
    if (i_ex(obj_board_deathevent))
58
        reset = true;
59
    if (reset)
60
    {
61
        guntimer = 0;
62
        safe_delete(mygunner1);
63
        safe_delete(mygunner2);
64
    }
65
    with (obj_board_shadowgunner)
66
        type = 2;
67
    if (con == 0 && obj_board_camera.con == 0)
68
    {
69
        if (kris.boat == false)
70
        {
71
            with (obj_board_grabobject)
72
                sourcey = susie.y;
73
        }
74
        if (suwalk == 0)
75
        {
76
            ralsei.follow = 0;
77
            if (i_ex(mygunner1))
78
            {
79
                if (mygunner1.timer == (mygunner1.startWait + 1))
80
                {
81
                    with (susie)
82
                    {
83
                        grabbed = other.ralsei;
84
                        grab = 1;
85
                        grabmarker = instance_create(x, y, obj_board_grabobject);
86
                        with (grabmarker)
87
                        {
88
                            drawreticle = false;
89
                            snd_play(snd_board_lift);
90
                            grabdaddy = other.id;
91
                            grabbedid = other.grabbed;
92
                            sprite_index = grabbedid.sprite_index;
93
                            image_xscale = grabbedid.image_xscale;
94
                            image_yscale = grabbedid.image_yscale;
95
                            image_speed = grabbedid.image_speed;
96
                            sourcex = grabbedid.x;
97
                            sourcey = grabbedid.y;
98
                        }
99
                        with (grabbed)
100
                        {
101
                            visible = false;
102
                            frozen = true;
103
                            setxy(board_tilex(-1), board_tiley(-1));
104
                            if (object_index == obj_mainchara_board)
105
                                canfreemove = 0;
106
                        }
107
                        if (x == 480)
108
                            
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", board_tilex(0), y);
109
                        if (x == 128)
110
                            
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", board_tilex(11), y);
111
                        if (y == 288)
112
                            
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(0, 10), 5);
113
                    }
114
                    suwalk = 1;
115
                }
116
            }
117
        }
118
    }
119
}
120
else
121
{
122
    guntimer = 0;
123
    made = false;
124
}
125
if (active && obj_board_camera.con != 0)
126
{
127
    susie.iframes = 0;
128
    guntimer = 0;
129
    safe_delete(mygunner1);
130
    safe_delete(mygunner2);
131
}