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
idealLetter = [];
19
letterCount = 0;
20
lastPressedTile = -100;
21
firstTileX = 0;
22
victorySprite = spr_keyboard_puzzle_apple;
23
imageTimer = 0;
24
krisStartX = 80;
25
krisStartY = 220;
26
failcount = 0;
27
monitorx = 0;
28
monitory = 0;
29
victoryextra = 0;
30
hacked = false;
31
if (room == room_dw_cyber_keyboard_puzzle_2)
32
{
33
    krisStartX = 134;
34
    krisStartY = 210;
35
    victorySprite = spr_keyboard_puzzle_agree2all;
36
}
37
if (room == room_dw_cyber_keyboard_puzzle_3)
38
    victorySprite = spr_keyboard_puzzle_icee;
39
autoGenerate = (puzzle_id == 2) ? 1 : 0;
40
autoWidth = 8;
41
autoString = stringsetloc(
GIAEEFSBISSFLBALAELRHEIGSFFEBRSI
"GIAEEFSBISSFLBALAELRHEIGSFFEBRSI", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_38_0"
);
42
autoX = x;
43
autoY = y;
44
if (autoGenerate == 1)
45
{
46
    idealString = stringsetloc(
GIASFELFEBREHBER
"GIASFELFEBREHBER", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_46_0"
);
47
    var currentW = 0;
48
    var currentH = 0;
49
    if (use_ja)
50
    {
51
        autoWidth = 10;
52
        autoString = stringsetloc(
UPIOMAOIOTSUGNINMGUSIFIOPEKIFUSIORATEGUI
"UPIOMAOIOTSUGNINMGUSIFIOPEKIFUSIORATEGUI", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_56_0"
);
53
        autoX = x - 40;
54
        autoY = y;
55
        idealString = stringsetloc(
SUFUGIOROTENIPEKENAMO
"SUFUGIOROTENIPEKENAMO", "obj_ch2_keyboardpuzzle_controller_slash_Create_0_gml_59_0"
);
56
        layer_set_visible("JA_TILES", true);
57
        with (obj_solidblocksized_alt)
58
            instance_destroy();
59
    }
60
    else
61
    {
62
        layer_set_visible("JA_TILES", false);
63
    }
64
    var len = string_length(autoString);
65
    for (i = 0; i < len; i++)
66
    {
67
        keytile[i] = instance_create(autoX + (currentW * 40), autoY + (currentH * 40), obj_ch2_keyboardpuzzle_tile);
68
        keytile[i].myString = string_char_at(autoString, i + 1);
69
        currentW++;
70
        if (currentW >= autoWidth)
71
        {
72
            currentW = 0;
73
            currentH++;
74
        }
75
    }
76
}
77
if (puzzle_id == 2)
78
{
79
    monitorx = 40;
80
    monitory = -20;
81
    victorySprite = 0;
82
    if (use_ja)
83
    {
84
        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);
85
        monitorx += 412;
86
    }
87
    else
88
    {
89
        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);
90
        monitorx += 390;
91
    }
92
    monitor.image_speed = 0.0625;
93
}
94
else
95
{
96
    if (room == room_dw_cyber_keyboard_puzzle_2)
97
    {
98
        monitorx = 80;
99
        monitory = 0;
100
    }
101
    else
102
    {
103
        monitorx = 40;
104
        monitory = 0;
105
    }
106
    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);
107
    monitor.image_speed = 0.0625;
108
    monitorx += 330;
109
}
110
monitory += 70;
111
if (room == room_dw_cyber_keyboard_puzzle_1 && global.flag[390 solved_apple_puzzle] == 1)
112
    won = true;
113
if (room == room_dw_cyber_keyboard_puzzle_2 && global.flag[333 solved_agree2all] == 1)
114
    won = true;
115
if (room == room_dw_cyber_keyboard_puzzle_3 && global.flag[420 giasfelfebrehber] == 1)
116
{
117
    victorySprite = spr_keyboard_puzzle_bluecheck;
118
    won = true;
119
}
120
if (won)
121
{
122
    currentString = idealString;
123
    imageTimer = sprite_get_number(victorySprite) - 0.5;
124
}