Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_berdlycoaster_event_Create_0

(view raw script w/o annotations or w/e)
1
con = 0;
2
timer = 0;
3
y = cameray() + 480;
4
x = camerax() - 140;
5
for (i = 0; i < 20; i++)
6
{
7
    coasterSiner[i] = i * 2;
8
    coasterImageSpeed[i] = 0.25;
9
    coasterX[i] = 0;
10
    coasterY[i] = 0;
11
    coasterXscale[i] = 2;
12
    coasterSprite[i] = spr_whitepixel;
13
    coasterVisible[i] = 1;
14
    coasterImageIndex[i] = 0;
15
    coasterRecruitID[i] = 0;
16
    coasterCarVisible[i] = true;
17
}
18
coasterSprite[0] = spr_cutscene_26_berdly_left;
19
coasterX[0] = 0;
20
coasterY[0] = 0;
21
coasterX[1] = 0;
22
coasterY[1] = 0;
23
coasterImageSpeed[1] = 0;
24
coasterX[2] = 0;
25
coasterY[2] = 0;
26
coasterImageSpeed[2] = 0;
27
coasterX[3] = 0;
28
coasterY[3] = 0;
29
coasterImageSpeed[3] = 0;
30
coasterSprite[4] = spr_sweet_dance;
31
coasterXscale[4] = -2;
32
coasterX[4] = 0;
33
coasterY[4] = 0;
34
coasterSprite[5] = spr_hatguy_dance;
35
coasterX[5] = 0;
36
coasterY[5] = 0;
37
coasterSprite[6] = spr_kk_static;
38
coasterXscale[6] = -2;
39
coasterX[6] = 20;
40
coasterY[6] = 0;
41
coasterSprite[7] = spr_rouxls_stone_origin;
42
coasterX[7] = 36;
43
coasterY[7] = 120;
44
coasterImageSpeed[7] = 0;
45
coasterImageIndex[7] = 6;
46
coasterSprite[8] = spr_omawaroid_idle;
47
coasterXscale[8] = -2;
48
coasterX[8] = 0;
49
coasterY[8] = 0;
50
coasterRecruitID[8] = 30;
51
coasterSprite[9] = spr_poppup_idle;
52
coasterXscale[9] = -2;
53
coasterX[9] = 0;
54
coasterY[9] = 5;
55
coasterRecruitID[9] = 31;
56
coasterSprite[10] = spr_tasque_idle;
57
coasterXscale[10] = -2;
58
coasterX[10] = -10;
59
coasterY[10] = 0;
60
coasterRecruitID[10] = 32;
61
coasterSprite[11] = spr_werewire_idle;
62
coasterXscale[11] = -2;
63
coasterX[11] = 0;
64
coasterY[11] = 40;
65
coasterRecruitID[11] = 33;
66
coasterSprite[12] = spr_maus_idle;
67
coasterXscale[12] = -2;
68
coasterX[12] = -15;
69
coasterY[12] = -15;
70
coasterRecruitID[12] = 34;
71
coasterSprite[13] = spr_cutscene_26_virovirokun;
72
coasterXscale[13] = -2;
73
coasterX[13] = -20;
74
coasterY[13] = 30;
75
coasterRecruitID[13] = 35;
76
coasterSprite[14] = spr_npc_swatchling_down;
77
coasterXscale[14] = -2;
78
coasterX[14] = 10;
79
coasterY[14] = -10;
80
coasterRecruitID[14] = 36;
81
coasterSprite[15] = spr_werewerewire_idle;
82
coasterXscale[15] = -2;
83
coasterX[15] = 10;
84
coasterY[15] = 25;
85
coasterRecruitID[15] = 40;
86
coasterSprite[16] = spr_npc_tasquemanager;
87
coasterXscale[16] = -2;
88
coasterX[16] = 10;
89
coasterY[16] = 0;
90
coasterRecruitID[16] = 42;
91
coasterSprite[17] = spr_mauswheel_idle;
92
coasterXscale[17] = -2;
93
coasterX[17] = 5;
94
coasterY[17] = 0;
95
coasterRecruitID[17] = 44;
96
coasterRecruitID[18] = 500;
97
coasterRecruitID[19] = 900;
98
if (global.flag[357 recruit_hacker] == 1)
99
{
100
    coasterSprite[18] = spr_cutscene_26_hacker;
101
    coasterXscale[18] = 2;
102
    coasterX[18] = 35;
103
    coasterY[18] = 50;
104
}
105
if (global.flag[254 starwalker] == 1)
106
{
107
    coasterSprite[19] = spr_cutscene_26_originalstarwalker;
108
    coasterXscale[19] = -2;
109
    coasterX[19] = -30;
110
    coasterY[19] = 30;
111
}
112
for (i = 0; i < 20; i++)
113
{
114
    dx[i] = 65 - sprite_get_width(coasterSprite[i]);
115
    if (coasterXscale[i] != 2)
116
        dx[i] = 65 + sprite_get_width(coasterSprite[i]);
117
    dy[i] = (-sprite_get_height(coasterSprite[i]) * 2) + 44;
118
    if (coasterSprite[i] == spr_whitepixel)
119
        coasterVisible[i] = 0;
120
    if (coasterRecruitID[i] > 0)
121
    {
122
        coasterVisible[i] = (global.flag[600 + coasterRecruitID[i]] == 1) ? 1 : 0;
123
        if (coasterRecruitID[i] == 500 && global.flag[357 recruit_hacker] == 1)
124
            coasterVisible[i] = 1;
125
        if (coasterRecruitID[i] == 900)
126
        {
127
            coasterVisible[i] = global.flag[254 starwalker] == 1;
128
            coasterCarVisible[i] = global.flag[254 starwalker] == 1;
129
        }
130
    }
131
}