Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_keyboardpuzzle_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    idealLength = string_length(idealString);
4
    for (i = 0; i < idealLength; i++)
5
        idealLetter[i] = string_char_at(idealString, 1 + i);
6
    init = 1;
7
}
8
if (con == 10 && global.interact == 0)
9
{
10
    global.interact = 1;
11
    global.facing = 2;
12
    timer = 0;
13
    con = 11;
14
    lost = 1;
15
}
16
if (con == 11)
17
{
18
    timer++;
19
    if (timer == 30)
20
        snd_play(snd_cantselect);
21
    if (timer == 60)
22
    {
23
        with (lastPressedTile)
24
            bouncecon = 1;
25
        snd_play(snd_jump);
26
        ball = 
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; }
(obj_mainchara.x - 10, obj_mainchara.y - 40, spr_kris_fall_ball);
27
        ball.image_speed = 0.5;
28
        ball.depth = 100;
29
        if (puzzle_id == 2)
30
        {
31
            krisStartX = 80;
32
            krisStartY = 220;
33
            if (firstTileX > 420)
34
            {
35
                krisStartX = 522;
36
                if (use_ja)
37
                    krisStartX += 16;
38
            }
39
            else if (firstTileX > 180)
40
            {
41
                krisStartX = 302;
42
                krisStartY = 312;
43
            }
44
            else if (use_ja)
45
            {
46
                krisStartX -= 16;
47
            }
48
        }
49
        var ballX = krisStartX - 10;
50
        var ballY = krisStartY - 40;
51
        with (ball)
52
            
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3)
{ return
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
}
(ballX, ballY, 30, 20);
53
        with (obj_mainchara)
54
        {
55
            x = other.ball.x;
56
            y = other.ball.y;
57
            visible = 0;
58
        }
59
        letterCount = 0;
60
        addString = "";
61
        currentString = "";
62
        lost = 0;
63
    }
64
    if (timer == 80)
65
    {
66
        obj_mainchara.x = krisStartX;
67
        obj_mainchara.y = krisStartY;
68
        global.facing = 0;
69
        with (ball)
70
            instance_destroy();
71
        with (obj_mainchara)
72
            visible = 1;
73
        global.interact = 0;
74
        failcount++;
75
    }
76
}
77
if (con == 20 && global.interact == 0)
78
{
79
    global.interact = 1;
80
    global.facing = 2;
81
    timer = 0;
82
    con = 21;
83
}
84
if (con == 21)
85
{
86
    timer++;
87
    if (timer == 30)
88
    {
89
        won = 1;
90
        if (puzzle_id != 2)
91
            snd_play(snd_won);
92
        else
93
            snd_play(snd_won_skipping);
94
    }
95
    if (puzzle_id == 2)
96
    {
97
        if (timer == 30)
98
            victorySprite = spr_keyboard_puzzle_icee;
99
        if (timer == 60)
100
        {
101
            victorySprite = spr_keyboard_puzzle_icee_hacked;
102
            hacked = true;
103
            image_timer = 1;
104
        }
105
        else if (timer == 80)
106
        {
107
            hacked = false;
108
            image_timer = -0.25;
109
            victorySprite = spr_keyboard_puzzle_icee_hacked_2;
110
        }
111
    }
112
    if (timer == 90)
113
    {
114
        if (puzzle_id == 0 && room != room_dw_cyber_keyboard_puzzle_2)
115
        {
116
            global.interact = 0;
117
            con = 0;
118
            event_user(1);
119
        }
120
        else
121
        {
122
            con = 22;
123
            if (room == room_dw_cyber_keyboard_puzzle_2)
124
            {
125
                snd_play(snd_queen_bitcrushed_hoot);
126
                victorySprite = spr_keyboard_puzzle_queenface;
127
            }
128
            else
129
            {
130
                victorySprite = 0;
131
            }
132
        }
133
        timer = 0;
134
    }
135
}
136
if (con == 22)
137
{
138
    timer++;
139
    if (timer == 10)
140
        global.facing = 2;
141
    else if (timer == 30)
142
        con = 23;
143
}
144
if (con == 23)
145
{
146
    if (room == room_dw_cyber_keyboard_puzzle_2)
147
    {
148
        
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 == "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; } if (global.fighting == 1) ...
("queen");
149
        msgsetloc(0, 
Face 1* You Typed: Agree 2 AllWait for input
"\\E1* You Typed: Agree 2 All/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_160_0"
);
150
        msgnextloc(
* Thank You For Agreeing 2 This Peon Release FormWait for input
"* Thank You For Agreeing 2 This Peon Release Form/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_161_0"
);
151
        msgnextloc(
Face C* Now You Are All Legally My MinionsWait for input
"\\EC* Now You Are All Legally My Minions/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_162_0"
);
152
        msgnextloc(
Face D* And I Can Use Your Likeness For Funny StatuesWait for input
"\\ED* And I Can Use Your Likeness For Funny Statues/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_163_0"
);
153
        
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("susie", 0);
154
        msgnextloc(
Face 0* What if we just...Delay 11 don't do what you say?Wait for input
"\\E0* What if we just..^1. don't do what you say?/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_165_0"
);
155
        
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("queen", 6);
156
        msgnextloc(
Face 6* In That Case I Would Be Forced ToWait for input
"\\E6* In That Case I Would Be Forced To/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_167_0"
);
157
        msgnextloc(
Face F* Use Another Guy ProbablyWait for input
"\\EF* Use Another Guy Probably/", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_168_0"
);
158
        
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("susie", 0);
159
        msgnextloc(
Face 0* Uh.Delay 11 Better get started on that then.Wait for input
"\\E0* Uh^1. Better get started on that then./", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_170_0"
);
160
        
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("queen", 6);
161
        msgnextloc(
Face 6* Okay But I'm Still Going To Use Your LikenessWait for inputClose Message
"\\E6* Okay But I'm Still Going To Use Your Likeness/%", "obj_ch2_keyboardpuzzle_controller_slash_Step_0_gml_172_0"
);
162
        d_make();
163
        con = 24;
164
    }
165
    else
166
    {
167
        timer++;
168
        if (timer == 60)
169
        {
170
            victorySprite = spr_keyboard_puzzle_bluecheck;
171
            global.interact = 0;
172
            checkscreen = instance_create(monitorx + 40, 80, obj_queenscreen);
173
            checkscreen.extflag = 4;
174
            checkscreen.image_index = 10;
175
            checkscreen.depth = 0;
176
            event_user(1);
177
            con = 0;
178
        }
179
    }
180
}
181
else if (con == 24)
182
{
183
    if (!instance_exists(obj_dialoguer))
184
    {
185
        victorySprite = spr_keyboard_puzzle_agree2all;
186
        global.interact = 0;
187
        global.facing = 0;
188
        event_user(1);
189
        con = 0;
190
    }
191
}