Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_keyboardpuzzle_controller_Create_0

(view raw script w/o annotations or w/e)
1
depth = 800000;
2
lost = 0;
3
won = 0;
4
con = 0;
5
timer = 0;
6
init = 0;
7
use_ja = global.lang == "ja";
8
currentString = "";
9
idealString = stringsetloc(
APPLE
"APPLE", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_11_0"
);
10
if (room == room_dw_cyber_keyboard_puzzle_2)
11
{
12
    if (use_ja)
13
        idealString = "YEEES2O!!";
14
    else
15
        idealString = stringsetloc(
AGREE2ALL
"AGREE2ALL", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_12_0"
);
16
}
17
addString = "";
18
letterCount = 0;
19
lastPressedTile = -100;
20
firstTileX = 0;
21
victorySprite = spr_keyboard_puzzle_apple;
22
imageTimer = 0;
23
krisStartX = 80;
24
krisStartY = 220;
25
failcount = 0;
26
monitorx = 0;
27
monitory = 0;
28
victoryextra = 0;
29
hacked = false;
30
if (room == room_dw_cyber_keyboard_puzzle_2)
31
{
32
    krisStartX = 134;
33
    krisStartY = 210;
34
    victorySprite = spr_keyboard_puzzle_agree2all;
35
}
36
if (room == room_dw_cyber_keyboard_puzzle_3)
37
    victorySprite = spr_keyboard_puzzle_icee;
38
autoGenerate = (puzzle_id == 2) ? 1 : 0;
39
autoWidth = 8;
40
autoString = stringsetloc(
GIAEEFSBISSFLBALAELRHEIGSFFEBRSI
"GIAEEFSBISSFLBALAELRHEIGSFFEBRSI", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_38_0"
);
41
autoX = x;
42
autoY = y;
43
if (autoGenerate == 1)
44
{
45
    idealString = stringsetloc(
GIASFELFEBREHBER
"GIASFELFEBREHBER", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_46_0"
);
46
    var currentW = 0;
47
    var currentH = 0;
48
    if (use_ja)
49
    {
50
        autoWidth = 10;
51
        autoString = stringsetloc(
UPIOMAOIOTSUGNINMGUSIFIOPEKIFUSIORATEGUI
"UPIOMAOIOTSUGNINMGUSIFIOPEKIFUSIORATEGUI", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_56_0"
);
52
        autoX = x - 40;
53
        autoY = y;
54
        idealString = stringsetloc(
SUFUGIOROTENIPEKENAMO
"SUFUGIOROTENIPEKENAMO", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_59_0"
);
55
        layer_set_visible("JA_TILES", true);
56
        with (obj_solidblocksized_alt)
57
            instance_destroy();
58
    }
59
    else
60
    {
61
        layer_set_visible("JA_TILES", false);
62
    }
63
    var len = string_length(autoString);
64
    for (i = 0; i < len; i++)
65
    {
66
        keytile[i] = instance_create(autoX + (currentW * 40), autoY + (currentH * 40), obj_ch2_keyboardpuzzle_tile);
67
        keytile[i].myString = string_char_at(autoString, i + 1);
68
        currentW++;
69
        if (currentW >= autoWidth)
70
        {
71
            currentW = 0;
72
            currentH++;
73
        }
74
    }
75
}
76
if (puzzle_id == 2)
77
{
78
    monitorx = 40;
79
    monitory = -20;
80
    victorySprite = 0;
81
    if (use_ja)
82
    {
83
        monitor = scr_dark_marker_depth
scr_dark_marker_depth

function scr_dark_marker_depth(arg0, arg1, arg2, arg3) { thismarker = instance_create_depth(arg0, arg1, arg2, obj_marker); with (thismarker) { sprite_index = arg3; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(monitorx, monitory, 1100000, bg_dw_cyber_keyboard_bigger);
84
        monitorx += 412;
85
    }
86
    else
87
    {
88
        monitor = scr_dark_marker_depth
scr_dark_marker_depth

function scr_dark_marker_depth(arg0, arg1, arg2, arg3) { thismarker = instance_create_depth(arg0, arg1, arg2, obj_marker); with (thismarker) { sprite_index = arg3; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(monitorx, monitory, 1100000, bg_dw_cyber_keyboard_big);
89
        monitorx += 390;
90
    }
91
    monitor.image_speed = 0.0625;
92
}
93
else
94
{
95
    if (room == room_dw_cyber_keyboard_puzzle_2)
96
    {
97
        monitorx = 80;
98
        monitory = 0;
99
    }
100
    else
101
    {
102
        monitorx = 40;
103
        monitory = 0;
104
    }
105
    monitor = scr_dark_marker_depth
scr_dark_marker_depth

function scr_dark_marker_depth(arg0, arg1, arg2, arg3) { thismarker = instance_create_depth(arg0, arg1, arg2, obj_marker); with (thismarker) { sprite_index = arg3; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(monitorx, monitory, 950000, bg_dw_cyber_keyboard);
106
    monitor.image_speed = 0.0625;
107
    monitorx += 330;
108
}
109
monitory += 70;
110
if (room == room_dw_cyber_keyboard_puzzle_1 && global.flag[390 solved_apple_puzzle] == 1)
111
    won = true;
112
if (room == room_dw_cyber_keyboard_puzzle_2 && global.flag[333 solved_agree2all] == 1)
113
    won = true;
114
if (room == room_dw_cyber_keyboard_puzzle_3 && global.flag[420 giasfelfebrehber] == 1)
115
{
116
    victorySprite = spr_keyboard_puzzle_bluecheck;
117
    won = true;
118
}
119
if (won)
120
{
121
    currentString = idealString;
122
    imageTimer = sprite_get_number(victorySprite) - 0.5;
123
}