Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_room_castle_town_Step_0

(view raw script w/o annotations or w/e)
1
if (global.chapter == 2)
2
{
3
    if (con == 0)
4
    {
5
        if (obj_mainchara.y < 1220)
6
        {
7
            con = 1;
8
            global.interact = 1;
9
        }
10
    }
11
    if (con == 1)
12
    {
13
        con = 2;
14
        
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("ralsei");
15
        msgsetloc(0, 
Face 2* (Kris... I bet you have a lot of people to talk to.)Wait for input
"\\E2* (Kris... I bet you have a lot of people to talk to.)/", "obj_ch2_room_castle_transformed_slash_Step_0_gml_17_0"
);
16
        msgnextloc(
Face 2* (But, you don't have to do everything at once.)Wait for input
"\\E2* (But, you don't have to do \\cYeverything at once\\c0.)/", "obj_ch2_room_castle_transformed_slash_Step_0_gml_18_0"
);
17
        msgnextloc(
Face 2* (SAVE and take a break anytime you want, OK?)Wait for inputClose Message
"\\E2* (\\cYSAVE\\c0 and take a break anytime you want, OK?)/%", "obj_ch2_room_castle_transformed_slash_Step_0_gml_19_0"
);
18
        var d = d_make();
19
        d.side = 1;
20
    }
21
    if (con == 2 && !d_ex())
22
    {
23
        con = 99;
24
        global.interact = 0;
25
        global.flag[443 told_save_town] = 1;
26
    }
27
}
28
if (global.chapter == 4)
29
{
30
    if (con == 10 && !d_ex() && global.interact == 0 && obj_mainchara.x >= 960 && obj_mainchara.y >= 1220 && 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(706) == 1)
31
    {
32
        con = 11;
33
        
scr_flag_set
scr_flag_set

function
scr_flag_set(arg0, arg1)
{ global.flag[arg0] = arg1; if (
scr_debug())
show_debug_message("*** flag [" + string(arg0) + "] updated: " + string(arg1) + " | " + scr_flag_name_get(arg0)); } function scr_setflag(arg0, arg1) {
scr_flag_set(arg0, arg1);
}
(793, 1);
34
        var sus_x = 0;
35
        var sus_y = 0;
36
        var sus_sprite = -4;
37
        var sus_depth = 0;
38
        with (obj_caterpillarchara)
39
        {
40
            if (name == "susie")
41
            {
42
                sus_x = x;
43
                sus_y = y;
44
                sus_sprite = sprite_index;
45
                sus_depth = depth;
46
                visible = 0;
47
            }
48
        }
49
        susie_marker = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(sus_x, sus_y, sus_sprite);
50
        susie_marker.depth = sus_depth;
51
    }
52
    if (con == 11)
53
    {
54
        if (susie_marker.x != 1020 || susie_marker.y != 1209)
55
        {
56
            with (susie_marker)
57
                
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
58
            susie_marker.sprite_index = spr_susie_walk_right_dw;
59
            susie_marker.image_speed = 0.2;
60
            susie_marker.x = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(susie_marker.x, 1020, 6);
61
            susie_marker.y = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(susie_marker.y, 1209, 6);
62
        }
63
        else
64
        {
65
            with (lancer_marker)
66
                sprite_index = spr_lancer_dt;
67
            susie_marker.image_speed = 0;
68
            susie_marker.image_index = 0;
69
            con = 12;
70
            alarm[0]
 = 30;
gml_Object_obj_room_castle_town_Alarm_0.gml

con++;
71
        }
72
    }
73
    if (con == 13)
74
    {
75
        lancer_jump_timer++;
76
        var offset = 1;
77
        if (lancer_jump_timer == 1)
78
        {
79
            susie_marker.sprite_index = spr_susie_catch;
80
            susie_marker.x -= 4;
81
            susie_marker.y += 2;
82
            with (lancer_marker)
83
            {
84
                sprite_index = spr_lancer_jump_ready;
85
                image_speed = 0.5;
86
            }
87
        }
88
        if (lancer_jump_timer == (1 + offset))
89
        {
90
            snd_play(snd_jump);
91
            with (lancer_marker)
92
            {
93
                sprite_index = spr_lancer_ball;
94
                image_speed = 0.5;
95
                x += 10;
96
                vspeed = -20;
97
                gravity = 2;
98
                hspeed = -4.7;
99
                friction = 0.25;
100
            }
101
        }
102
        if (lancer_jump_timer == (15 + offset))
103
            lancer_marker.depth = susie_marker.depth + 10;
104
        if (lancer_jump_timer == (24 + offset))
105
        {
106
            con = 14;
107
            alarm[0]
 = 1;
gml_Object_obj_room_castle_town_Alarm_0.gml

con++;
108
            susie_marker.sprite_index = spr_susie_carry_down;
109
            susie_marker.x += 4;
110
            susie_marker.y -= 2;
111
            lancer_marker.y = susie_marker.y - 32;
112
            with (lancer_marker)
113
            {
114
                sprite_index = spr_lancer_dt;
115
                image_speed = 0;
116
                image_index = 0;
117
                x -= 10;
118
                vspeed = 0;
119
                gravity = 0;
120
                hspeed = 0;
121
            }
122
        }
123
    }
124
    if (con == 15)
125
    {
126
        con = 16;
127
        alarm[0]
 = 16;
gml_Object_obj_room_castle_town_Alarm_0.gml

con++;
128
        snd_play(snd_bell);
129
        susie_marker.sprite_index = spr_susie_carry_pose;
130
        lancer_marker.sprite_index = spr_lancer_wave;
131
        lancer_marker.image_speed = 0.5;
132
    }
133
    if (con == 17)
134
    {
135
        con = 18;
136
        alarm[0]
 = 30;
gml_Object_obj_room_castle_town_Alarm_0.gml

con++;
137
        lancer_marker.image_speed = 0;
138
    }
139
    if (con == 19)
140
    {
141
        con = 20;
142
        susie_marker.sprite_index = spr_susie_lancer_carry_walk_down;
143
        with (lancer_marker)
144
            instance_destroy();
145
    }
146
    if (con == 20)
147
    {
148
        var rejoin = false;
149
        var sus_x = susie_marker.x + 10;
150
        with (obj_mainchara)
151
        {
152
            if (y >= 1210 && abs(x - sus_x) < 90)
153
                rejoin = true;
154
        }
155
        if (rejoin)
156
            con = 21;
157
    }
158
    if (con == 21)
159
    {
160
        con = 99;
161
        with (obj_caterpillarchara)
162
        {
163
            if (name == "susie")
164
            {
165
                x = 1020;
166
                y = 1209;
167
                visible = 1;
168
            }
169
            
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate(arg0 = "none")
{ if (arg0 == "all") { with (obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else if (arg0 == "none") { if (object_index == obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else { with (obj_caterpillarchara) { if (name == arg0) scr_caterpillar_interpolate_old(); } } } function scr_caterinterp(arg0 = "none") {
scr_caterpillar_interpolate(arg0);
} function scr_caterpillar_interpolate_old() { _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y)));
remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
170
        }
171
        with (susie_marker)
172
            instance_destroy();
173
    }
174
}