Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_noelle_scared_Step_0

(view raw script w/o annotations or w/e)
1
graceperiod--;
2
if (con == 1 && graceperiod < 0)
3
{
4
    if (jumppuzzle == 1)
5
        hastarget = 0;
6
    if (autocomplete == 0)
7
    {
8
        sprite_index = spr_noelleb_battleintro_l;
9
        image_index = 3;
10
    }
11
    else
12
    {
13
        sprite_index = spr_noelle_walk_right_smile_dw;
14
        image_index = 1;
15
        image_speed = 0;
16
    }
17
    jumping = 1;
18
    if (jumpstyle == 1)
19
        jumpyspeed = -30;
20
    else
21
        jumpyspeed = -20;
22
    maxjumpy = -200;
23
    xadjust = 0;
24
    yadjust = 0;
25
    step = 0;
26
    while (xadjust == 0)
27
    {
28
        step++;
29
        yadjust = 0;
30
        met = 0;
31
        while (yadjust == 0)
32
        {
33
            mety = 0;
34
            if (mety == 0)
35
                yadjust = 1;
36
        }
37
        if (met == 0)
38
            xadjust = 1;
39
        if (step >= 10)
40
        {
41
            targetx = x;
42
            targety = y;
43
            xadjust = 1;
44
            yadjust = 1;
45
        }
46
    }
47
    timer = 0;
48
    con = 2;
49
}
50
if (jumpstyle == 0 && con == 2)
51
{
52
    timer++;
53
    image_index += 0.5;
54
    if (image_index >= 5)
55
        image_index = 3;
56
    x = lerp(x, targetx, 0.2);
57
    y = lerp(y, targety, 0.2);
58
    jumpyspeed += 2;
59
    jumpy += jumpyspeed;
60
    if (jumpy >= jumpyspeed && timer >= 4)
61
    {
62
        image_index = 2;
63
        x = targetx;
64
        y = targety;
65
        jumping = 0;
66
        jumpy = 0;
67
        jumpyspeed = 0;
68
        timer = 0;
69
        con = 4;
70
    }
71
}
72
if (con == 2 && jumpstyle == 1)
73
{
74
    image_index += 0.5;
75
    if (image_index >= 5)
76
        image_index = 3;
77
    if ((y + jumpy) > (__view_get(e__VW.YView, 0) - 80))
78
    {
79
        jumpy += jumpyspeed;
80
    }
81
    else
82
    {
83
        x += 10;
84
        if (x >= targetx)
85
        {
86
            con = 3;
87
            jumpyspeed = 10;
88
        }
89
    }
90
}
91
if (con == 3 && jumpstyle == 1)
92
{
93
    image_index += 0.5;
94
    if (image_index >= 5)
95
        image_index = 3;
96
    jumpyspeed += 2;
97
    jumpy += jumpyspeed;
98
    if (jumpy >= jumpyspeed)
99
    {
100
        image_index = 2;
101
        jumping = 0;
102
        jumpy = 0;
103
        jumpyspeed = 0;
104
        con = 4;
105
    }
106
}
107
if (con == 4)
108
{
109
    if (jumppuzzle == 1)
110
    {
111
        hastarget = 1;
112
        if (fallen == 0)
113
            target = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform];
114
        else
115
            target = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform - 1];
116
    }
117
    image_index -= 0.5;
118
    if (image_index <= 0.5)
119
    {
120
        image_index = 0;
121
        con = 0;
122
        graceperiod = 30;
123
        if (jumppuzzle == 1)
124
        {
125
            if (instance_exists(obj_masterPlatformController) && fallen == 0)
126
                obj_masterPlatformController.makenewplatform = 1;
127
            else
128
                fallen = 0;
129
        }
130
    }
131
}
132
if (jostlecon == 1)
133
{
134
    sprite_index = spr_noelleb_battleintro;
135
    image_index = 4;
136
    jostlesiner = 0;
137
    crowdx = crowdid.x - 10;
138
    crowdy = crowdid.y - 60;
139
    jumpy = lerp(jumpy, -60, 0.2);
140
    jumpyfactor = jumpy;
141
    x = lerp(x, crowdx, 0.2);
142
    y = lerp(y, crowdy, 0.2);
143
    if (crowdx < x)
144
        x -= 2;
145
    if (crowdx > x)
146
        x += 2;
147
    if (crowdy > y)
148
        y += 2;
149
    if (crowdy < y)
150
        y -= 2;
151
    if (point_distance(x, y, crowdx, crowdy) < 6)
152
        jostlecon = 2;
153
}
154
if (jostlecon == 2)
155
{
156
    jostlesiner++;
157
    x = (crowdid.x - 10) + (sin(jostlesiner) * 3);
158
    y = crowdid.y - 60;
159
    jumpy = (-abs(sin(jostlesiner / 2)) * 16) + random(2) + jumpyfactor;
160
    if (jumpyfactor > -60)
161
        jumpyfactor -= 5;
162
    if (jostlesiner >= 180)
163
    {
164
        jostlecon = 0;
165
        con = 1;
166
        targetx = x + 240;
167
        jumpstyle = 0;
168
    }
169
}
170
if (fallen == 0 && y > room_height)
171
{
172
    failureCount++;
173
    fallen = 1;
174
}
175
if (fallen == 1)
176
{
177
    x = 114;
178
    y = room_height + 20;
179
    tower = instance_create(x, y, obj_tower_o_mice);
180
    
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(115, 285, 60);
181
    fallen = 2;
182
    timer = 0;
183
}
184
if (fallen == 2)
185
{
186
    timer++;
187
    if (timer == 60)
188
    {
189
        alarm[0]
 = true;
gml_Object_obj_noelle_scared_Alarm_0.gml

if (autocomplete == 0) { if (jumppuzzle == 0) { if (con == 0) { snd_play(snd_noelle_scared); jumpy = 20; if (i_ex(obj_controller_city_mice2)) { targetx = 370; targety = 166; } if (instance_exists(obj_controller_city_mice2) && obj_controller_city_mice2.victory == 1 && obj_controller_city_mice2.con != -2) { targetx = 860; targety = 238; } if (extflag == "mice1Scare") { targetx = x; targety = y; } con = 1; } } else { if (instance_exists(obj_controller_city_mice3)) { if (fallen == 0) obj_controller_city_mice3.exttrig = "success"; else obj_controller_city_mice3.exttrig = "fell"; } snd_play(snd_noelle_scared); if (instance_exists(obj_masterPlatformController)) { if (con == 0) { jumpy = 20; if (fallen == 0) { targetx = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform].x + 120; targety = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform].patidealy; } else { targetx = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform - 1].x + 120; targety = obj_masterPlatformController.plat[obj_masterPlatformController.currentPlatform - 1].patidealy; } con = 1; } } } }
190
        tower.con++;
191
        fallen = 3;
192
    }
193
}
194
if (room != room_dw_city_mice3)
195
    
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
196
if (con == 0 && jostlecon == 0 && extflag == "mice1Scare")
197
{
198
    noelleFacing = instance_create(x, y, obj_npc_facing);
199
    noelleFacing.sprite_index = sprite_index;
200
    noelleFacing.image_xscale = 2;
201
    noelleFacing.image_yscale = 2;
202
    noelleFacing.y = noelleFacing.ystart;
203
    with (noelleFacing)
204
        
scr_set_facing_sprites
scr_set_facing_sprites

function
scr_set_facing_sprites(arg0)
{ _actorname = arg0; name = arg0; if (is_string(_actorname)) { if (_actorname == "kris") { name = "kris"; if (global.darkzone == 0) _actorname = "krislight"; if (global.darkzone == 1) _actorname = "krisdark"; } if (_actorname == "susie") { name = "susie"; if (global.darkzone == 0) { _actorname = "susielight"; if (global.chapter >= 2) _actorname = "susielighteyes"; } if (global.darkzone == 1) { if (global.chapter == 1) _actorname = "susiedark"; if (global.chapter >= 2) _actorname = "susiedarkeyes"; } } if (_actorname == "ralsei") { name = "ralsei"; if (global.chapter <= 1) _actorname = "ralseihat"; if (global.chapter > 1) _actorname = "ralseinohat"; } if (_actorname == "noelle") { name = "noelle"; if (global.darkzone == 0) _actorname = "noellelight"; if (global.darkzone == 1) _actorname = "noelledark"; } if (_actorname == "berdly") { name = "berdly"; if (global.darkzone == 0) _actorname = "berdlylight"; if (global.darkzone == 1) _actorname = "berdlydark"; } if (_actorname == "krislight") { usprite = spr_krisu; rsprite = spr_krisr; dsprite = spr_krisd; lsprite = spr_krisl; } if (_actorname == "krisdark") { usprite = spr_krisu_dark; rsprite = spr_krisr_dark; dsprite = spr_krisd_dark; lsprite = spr_krisl_dark; } if (_actorname == "susielight") { usprite = spr_susieu; rsprite = spr_susier; dsprite = spr_susied; lsprite = spr_susiel; } if (_actorname == "susielighteyes") { usprite = spr_susie_walk_up_lw; rsprite = spr_susie_walk_right_lw; dsprite = spr_susie_walk_down_lw; lsprite = spr_susie_walk_left_lw; } if (_actorname == "susiedark") { usprite = spr_susieu_dark; rsprite = spr_susier_dark; dsprite = spr_susied_dark; lsprite = spr_susiel_dark; specialsprite[4] = spr_susie_shock_r; specialsprite[5] = spr_susie_shock; } if (_actorname == "susiedarkeyes") { usprite = spr_susie_walk_up_dw; rsprite = spr_susie_walk_right_dw; dsprite = spr_susie_walk_down_dw; lsprite = spr_susie_walk_left_dw; specialsprite[4] = spr_susie_shock_r; specialsprite[5] = spr_susie_shock; } ...
("noelledark");
205
    instance_destroy();
206
}
207
if (con == 0 && jostlecon == 0)
208
    jostletimer++;
209
else
210
    jostletimer = 0;
211
if (instance_exists(obj_controller_city_mice3))
212
{
213
    if (obj_controller_city_mice3.micescore >= obj_controller_city_mice3.micetarget)
214
        image_speed = 0;
215
}
216
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
217
218
enum e__VW
219
{
220
    XView,
221
    YView,
222
    WView,
223
    HView,
224
    Angle,
225
    HBorder,
226
    VBorder,
227
    HSpeed,
228
    VSpeed,
229
    Object,
230
    Visible,
231
    XPort,
232
    YPort,
233
    WPort,
234
    HPort,
235
    Camera,
236
    SurfaceID
237
}