Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_rouxls_simtown_Draw_0

(view raw script w/o annotations or w/e)
1
siner += 1;
2
if (instance_exists(obj_rouxls_enemy))
3
{
4
    if (MyTurn == 1)
5
        depth = -50;
6
    else
7
        depth = (room != room_dw_mansion_acid_tunnel_loop_rouxls) ? (obj_rouxls_enemy.depth + 9997) : 840000;
8
}
9
else if (room != room_dw_mansion_acid_tunnel_loop_rouxls)
10
{
11
    depth = 900000;
12
}
13
for (i = 0; i < 16; i += 1)
14
{
15
    for (j = 0; j < 6; j += 1)
16
    {
17
        if (TileHasHouse[i][j] == 0 && TileLand[i][j] == 1)
18
            draw_sprite_ext(spr_acid_house, 2, base_xpos + (i * 40), base_ypos + (j * 40) + 80 + tileHouseY[i][j], 1, 1, 0, c_white, 1);
19
        if (TileHasHouse[i][j] == 1)
20
            draw_sprite_ext(spr_acid_house, 0, base_xpos + (i * 40), base_ypos + (j * 40) + 80 + tileHouseY[i][j], 1, 1, 0, c_white, 1);
21
        if (TileHasHouse[i][j] == 2)
22
            draw_sprite_ext(spr_acid_house, 1, base_xpos + (i * 40), base_ypos + (j * 40) + 80 + tileHouseY[i][j], 1, 1, 0, c_white, 1);
23
        if (MyTurn == 1)
24
        {
25
            if (TileYouCanBuild[i][j] == 1)
26
            {
27
                if (CursorX == i && CursorY == j)
28
                {
29
                    draw_sprite_ext(spr_simtown_tile, 0, base_xpos + (i * 40), base_ypos + (j * 40) + 80, 1, 1, 0, c_yellow, 0.6 + (sin(siner / 8) * 0.2));
30
                    draw_sprite_ext(spr_acid_house, 0, base_xpos + (i * 40), base_ypos + (j * 40) + 80, 1, 1, 0, c_white, 0.2 + (sin(siner / 8) * 0.1));
31
                }
32
                else
33
                {
34
                    draw_sprite_ext(spr_acid_house, 0, base_xpos + (i * 40), base_ypos + (j * 40) + 80, 1, 1, 0, c_yellow, 0.6 + (sin(siner / 8) * 0.2));
35
                }
36
            }
37
        }
38
    }
39
}
40
StatusMessage = stringsetloc(
* You can take this tile!
"* You can take this tile!", "obj_rouxls_simtown_slash_Draw_0_gml_47_0"
);
41
if (TileHasHouse[CursorX][CursorY] != 0)
42
    StatusMessage = stringsetloc(
* Press arrows to move!
"* Press arrows to move!", "obj_rouxls_simtown_slash_Draw_0_gml_48_0"
);
43
if (TileYouCanBuild[CursorX][CursorY] == 0 && TileHasHouse[CursorX][CursorY] != 1)
44
    StatusMessage = stringsetloc(
* Too far from own territory!
"* Too far from own territory!", "obj_rouxls_simtown_slash_Draw_0_gml_49_0"
);
45
if (TileLand[CursorX][CursorY] != 1)
46
    StatusMessage = stringsetloc(
* Can't build on acid!
"* Can't build on acid!", "obj_rouxls_simtown_slash_Draw_0_gml_50_0"
);
47
if (TileHasHouse[CursorX][CursorY] == 2)
48
    StatusMessage = stringsetloc(
* Can't build on enemy territory!
"* Can't build on enemy territory!", "obj_rouxls_simtown_slash_Draw_0_gml_51_0"
);
49
if (CursorX == 2 && CursorY == 2)
50
    StatusMessage = stringsetloc(
* Swan is lacking#structural support
"* Swan is lacking#structural support", "obj_rouxls_simtown_slash_Draw_0_gml_53_0"
);
51
if (CursorX == 2 && CursorY == 3)
52
    StatusMessage = stringsetloc(
* Swan is lacking#structural support
"* Swan is lacking#structural support", "obj_rouxls_simtown_slash_Draw_0_gml_54_0"
);
53
if (CursorX == 3 && CursorY == 2)
54
    StatusMessage = stringsetloc(
* Swan is lacking#structural support
"* Swan is lacking#structural support", "obj_rouxls_simtown_slash_Draw_0_gml_55_0"
);
55
if (CursorX == 3 && CursorY == 3)
56
    StatusMessage = stringsetloc(
* Swan is lacking#structural support
"* Swan is lacking#structural support", "obj_rouxls_simtown_slash_Draw_0_gml_56_0"
);
57
var txt = stringsetloc(
* A familiar-looking machine.
"* A familiar-looking machine.", "obj_rouxls_simtown_slash_Draw_0_gml_58_0"
);
58
if (instance_exists(obj_thrashmachine) && obj_thrashmachine.part[1] == 3)
59
    txt = stringsetloc(
* It seems to be in love with your swan.
"* It seems to be in love with your swan.", "obj_rouxls_simtown_slash_Draw_0_gml_59_0"
);
60
if (CursorX == 12 && CursorY == 1)
61
    StatusMessage = txt;
62
if (CursorX == 13 && CursorY == 1)
63
    StatusMessage = txt;
64
if (CursorX == 14 && CursorY == 1)
65
    StatusMessage = txt;
66
if (CursorX == 15 && CursorY == 1)
67
    StatusMessage = txt;
68
if (CursorX == 12 && CursorY == 2)
69
    StatusMessage = txt;
70
if (CursorX == 13 && CursorY == 2)
71
    StatusMessage = txt;
72
if (CursorX == 14 && CursorY == 2)
73
    StatusMessage = txt;
74
if (CursorX == 15 && CursorY == 2)
75
    StatusMessage = txt;
76
if (CursorX == 12 && CursorY == 3)
77
    StatusMessage = txt;
78
if (CursorX == 13 && CursorY == 3)
79
    StatusMessage = txt;
80
if (CursorX == 14 && CursorY == 3)
81
    StatusMessage = txt;
82
if (CursorX == 15 && CursorY == 3)
83
    StatusMessage = txt;
84
if (CursorX == 13 && CursorY == 1)
85
    StatusMessage = stringsetloc(
* Thoust admireth moi...?
"* Thoust admireth moi...?", "obj_rouxls_simtown_slash_Draw_0_gml_72_0"
);
86
if (MyTurn == 0)
87
    StatusMessage = "* Rouxls Turn. TurnCon:" + string(TurnCon);
88
if (MyTurn == 1)
89
{
90
    scr_84_set_draw_font
scr_84_set_draw_font

function scr_84_set_draw_font(arg0) { global.chemg_font = arg0; draw_set_font(scr_84_get_font(arg0)); }
("mainbig");
91
    draw_set_color(c_white);
92
    StatusMessage = string_replace_all(StatusMessage, "&", "#");
93
    draw_text(base_xpos + 66, base_ypos + 415, string_hash_to_newline(StatusMessage));
94
    if (global.is_console || obj_gamecontroller.gamepad_active)
95
    {
96
        var button_offset = (global.lang == "en") ? 0 : -122;
97
        draw_sprite_ext(scr_getbuttonsprite
scr_getbuttonsprite

function scr_getbuttonsprite(arg0, arg1) { var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[4], false), 0, base_xpos + 233 + button_offset, base_ypos + 391, 2, 2, 0, c_white, 1);
98
        if (global.lang == "en")
99
        {
100
            draw_text(base_xpos + 66, base_ypos + 387, stringsetloc(
* Claim with
"* Claim with", "obj_rouxls_simtown_slash_Draw_0_gml_103_0"
));
101
        }
102
        else
103
        {
104
            draw_text(base_xpos + 66, base_ypos + 387, stringset("* "));
105
            draw_text(base_xpos + 140, base_ypos + 387, stringsetloc(
* Claim with
"* Claim with", "obj_rouxls_simtown_slash_Draw_0_gml_103_0"
));
106
        }
107
    }
108
    else
109
    {
110
        draw_text(base_xpos + 66, base_ypos + 387, stringsetsubloc("* Claim with ~1!", scr_get_input_name
scr_get_input_name

function scr_get_input_name(arg0) { var _control = "[?]"; if (global.is_console || obj_gamecontroller.gamepad_active) { _control = global.input_g[arg0]; if (_control == gp_padr) return "\\*D "; if (_control == gp_padl) return "\\*A "; if (_control == gp_padu) return "\\*W "; if (_control == gp_padd) return "\\*S "; if (_control == global.button0) return "\\*Z "; if (_control == global.button1) return "\\*X "; if (_control == global.button2) return "\\*C "; } var left_bracket = (global.lang == "en") ? "[" : "["; var right_bracket = (global.lang == "en") ? "]" : "]"; _control = left_bracket + global.asc_def[global.input_k[arg0]] + right_bracket; if (!is_string(_control)) _control = "[?]"; else return _control; }
(4), "obj_rouxls_simtown_slash_Draw_0_gml_80_0"));
111
    }
112
    specialCursor.x = (room != room_dw_mansion_acid_tunnel_loop_rouxls) ? CursorVisualX : (camerax() + CursorVisualX + 8);
113
    specialCursor.y = CursorVisualY;
114
}
115
else
116
{
117
    specialCursor.y = -999;
118
}
119
if (flyaway == 1)
120
{
121
    tileHouseY[6][2] -= 16;
122
    tileHouseY[7][2] -= 17;
123
    tileHouseY[8][2] -= 16;
124
    tileHouseY[7][3] -= 18;
125
    tileHouseY[8][3] -= 15;
126
    tileHouseY[9][3] -= 19;
127
}