Deltarune script viewer

← back to main script listing

gml_Object_obj_controller_keyboard_puzzle_2_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    with (obj_mainchara)
4
    {
5
        if (place_meeting(x, y, obj_traffic_road_trigger))
6
            other.con = 1;
7
    }
8
}
9
if (con == 1)
10
{
11
    global.interact = 1;
12
    cutscene_master = scr_cutscene_make
scr_cutscene_make

function scr_cutscene_make() { _cutscene_master = instance_create(0, 0, obj_cutscene_master); _cutscene_master.master_object = id; return _cutscene_master; }
();
13
    scr_maincharacters_actors
scr_maincharacters_actors

function scr_maincharacters_actors() { actor_count = 0; kr = 0; kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor); scr_actor_setup(kr, kr_actor, "kris"); kr_actor.sprite_index = obj_mainchara.sprite_index; kr_actor.depth = obj_mainchara.depth; with (obj_mainchara) visible = 0; for (__jj = 0; __jj < array_length_1d(global.cinstance); __jj++) { if (i_ex(global.cinstance[__jj])) { if (global.cinstance[__jj].name == "susie") { actor_count++; su = __jj + 1; su_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor); scr_actor_setup(su, su_actor, "susie"); su_actor.sprite_index = global.cinstance[__jj].sprite_index; su_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "ralsei") { actor_count++; ra = __jj + 1; ra_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor); scr_actor_setup(ra, ra_actor, "ralsei"); ra_actor.sprite_index = global.cinstance[__jj].sprite_index; ra_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "noelle") { actor_count++; no = __jj + 1; no_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor); scr_actor_setup(no, no_actor, "noelle"); no_actor.sprite_index = global.cinstance[__jj].sprite_index; no_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } } } }
();
14
    con++;
15
}
16
if (con == 2)
17
{
18
    con = -999;
19
    c_speaker
c_speaker

function c_speaker(arg0) { c_cmd("speaker", arg0, 0, 0, 0); }
("susie");
20
    c_msgsetloc
c_msgsetloc

function c_msgsetloc(arg0, arg1, arg2) { var msg_index = arg0; var english = arg1; var localized_string_id = arg2; var str = english; if (!is_english()) str = scr_84_get_lang_string(localized_string_id); c_msgset(msg_index, str); }
(0,
Face 0* Wait, is this another puzzle? You do it.Wait for inputClose Message
"\\E0* Wait, is this another puzzle? You do it./%", "obj_controller_keyboard_puzzle_2_slash_Step_0_gml_18_0"
);
21
    c_talk_wait();
22
    c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(ra);
23
    c_walkdirect
c_walkdirect

function c_walkdirect(arg0, arg1, arg2) { c_cmd("walkdirect", arg0, arg1, arg2, 0); }
(150, ra_actor.y, 8);
24
    c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(su);
25
    c_walkdirect
c_walkdirect

function c_walkdirect(arg0, arg1, arg2) { c_cmd("walkdirect", arg0, arg1, arg2, 0); }
(86, su_actor.y, 6);
26
    c_wait
c_wait

function c_wait(arg0) { c_cmd("wait", arg0, 0, 0, 0); }
(8);
27
    c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(ra);
28
    c_walkdirect
c_walkdirect

function c_walkdirect(arg0, arg1, arg2) { c_cmd("walkdirect", arg0, arg1, arg2, 0); }
(150, 348, 12);
29
    c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(su);
30
    c_walkdirect
c_walkdirect

function c_walkdirect(arg0, arg1, arg2) { c_cmd("walkdirect", arg0, arg1, arg2, 0); }
(86, 344, 12);
31
    c_wait
c_wait

function c_wait(arg0) { c_cmd("wait", arg0, 0, 0, 0); }
(13);
32
    c_facing
c_facing

function c_facing(arg0) { c_cmd("facing", arg0, 0, 0, 0); }
("u");
33
    c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(ra);
34
    c_facing
c_facing

function c_facing(arg0) { c_cmd("facing", arg0, 0, 0, 0); }
("u");
35
    c_wait
c_wait

function c_wait(arg0) { c_cmd("wait", arg0, 0, 0, 0); }
(4);
36
    c_actortokris
c_actortokris

function c_actortokris() { c_cmd("actortokris", 0, 0, 0, 0); }
();
37
    c_actortocaterpillar
c_actortocaterpillar

function c_actortocaterpillar() { c_cmd("actortocaterpillar", 0, 0, 0, 0); }
();
38
    c_var_instance
c_var_instance

function c_var_instance(arg0, arg1, arg2) { c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0); }
(id, "con", 3);
39
    c_terminatekillactors
c_terminatekillactors

function c_terminatekillactors() { c_cmd("terminatekillactors", 0, 0, 0, 0); }
();
40
}
41
if (con == 3 && !i_ex(cutscene_master))
42
{
43
    npcral = instance_create(realral.x, realral.y, obj_npc_sign);
44
    npcral.sprite_index = spr_ralsei_walk_up;
45
    realral.visible = false;
46
    npcsus = instance_create(realsus.x, realsus.y, obj_npc_sign);
47
    npcsus.sprite_index = spr_susie_walk_up_dw;
48
    realsus.visible = false;
49
    global.interact = 0;
50
    con++;
51
}
52
if (con == 4)
53
{
54
    if (global.flag[333 solved_agree2all] == 1)
55
    {
56
        with (obj_mainchara)
57
        {
58
            if (place_meeting(x, y, obj_traffic_road_trigger))
59
                other.con = 5;
60
        }
61
    }
62
}
63
if (con == 5)
64
{
65
    scr_tempsave
scr_tempsave

function scr_tempsave() { filechoicebk2 = global.filechoice; global.filechoice = 9; var is_valid = scr_saveprocess(global.filechoice); global.filechoice = filechoicebk2; if (!is_valid) { var error_message = instance_create(0, 0, obj_savedata_error); error_message.error_type = "temp_save_failed"; if (room != PLACE_MENU) error_message.type = "auto"; } return is_valid; }
();
66
    realral.x = npcral.x;
67
    realral.y = npcral.y;
68
    with (realral)
69
        scr_caterpillar_interpolate
scr_caterpillar_interpolate

function scr_caterpillar_interpolate() { _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; } }
();
70
    realral.visible = true;
71
    realsus.x = npcsus.x;
72
    realsus.y = npcsus.y;
73
    with (realsus)
74
        scr_caterpillar_interpolate
scr_caterpillar_interpolate

function scr_caterpillar_interpolate() { _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; } }
();
75
    realsus.visible = true;
76
    with (npcral)
77
        instance_destroy();
78
    with (npcsus)
79
        instance_destroy();
80
    con++;
81
}
82
if (con == 4)
83
{
84
    failcount = obj_ch2_keyboardpuzzle_controller.failcount;
85
    if (hintcon == 0 && global.interact == 0)
86
    {
87
        if (failcount == 8)
88
        {
89
            global.interact = 1;
90
            hintcon++;
91
            timer = 0;
92
        }
93
    }
94
    if (hintcon == 1)
95
    {
96
        timer++;
97
        if (timer == 15)
98
        {
99
            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) ...
("ralsei");
100
            msgsetloc(0, 
Face Q* Um...Delay 11 Kris?Wait for input
"\\EQ* Um..^1. Kris?/", "obj_controller_keyboard_puzzle_2_slash_Step_0_gml_109_0"
);
101
            msgnextloc(
Face J* Maybe you can press the same key more than once?Wait for inputClose Message
"\\EJ* Maybe you can press the same key more than once?/%", "obj_controller_keyboard_puzzle_2_slash_Step_0_gml_110_0"
);
102
            d = d_make();
103
            d.side = 0;
104
            hintcon++;
105
        }
106
    }
107
    if (hintcon == 2 && !d_ex())
108
    {
109
        global.interact = 0;
110
        global.facing = 0;
111
        hintcon++;
112
    }
113
}