Undertale script viewer

← back to main script listing

gml_Object_obj_showercurtain_Draw_0

(view raw script w/o annotations or w/e)
1
anim += animspeed;
2
if (mode == 0)
3
{
4
    draw_sprite(spr_showercurtain_man, floor(anim), x, y);
5
    if (obj_mainchara.y < (remy - 2))
6
    {
7
        if (onoff == 1)
8
            obj_mainchara.y = remy - 1;
9
        else
10
            obj_mainchara.y = remy;
11
    }
12
    remy = obj_mainchara.y;
13
    if (onoff == 0)
14
        onoff = 1;
15
    else
16
        onoff = 0;
17
    if (obj_mainchara.y < 180)
18
    {
19
        animspeed = 0.08 + (0.8 * ((180 - obj_mainchara.y) / 180));
20
        pit = 0.6 + (1 * ((180 - obj_mainchara.y) / 180));
21
        caster_set_pitch(dist, pit);
22
    }
23
}
24
if (drawkey == 1)
25
    draw_sprite_ext(spr_leverkey, anim, x + 34, y + 30, 1, 1, 0, c_lime, 1);
26
if (myinteract == 1 && mode == 0)
27
{
28
    animspeed = 0.1;
29
    mode = 1;
30
    myinteract = 0;
31
    global.interact = 1;
32
    con = 1;
33
    alarm[4] = 10;
34
    caster_free(dist);
35
    snd_play(snd_splash);
36
    global.flag[483 truelab_green_key_status] = 1;
37
    drawkey = 1;
38
}
39
if (con == 2)
40
{
41
    myinteract = 0;
42
    global.interact = 0;
43
    con = 3;
44
}
45
if (myinteract == 1 && global.flag[483 truelab_green_key_status] == 1)
46
{
47
    con = 4;
48
    myinteract = 0;
49
    global.interact = 1;
50
    global.msc = 0;
51
    global.typer = 5;
52
    drawkey = 0;
53
    global.msg[0] = 
* (There's a green key lying
in the bathtub.)Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_showercurtain_227")
;
54
    global.msg[1] = 
* (You took it and put it
on your keychain.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_showercurtain_228")
;
55
    instance_create(0, 0, obj_dialoguer);
56
    global.flag[483 truelab_green_key_status] = 2;
57
}
58
if (con == 4 && instance_exists(OBJ_WRITER) == 0)
59
{
60
    con = 10;
61
    global.interact = 0;
62
}
63
if (myinteract == 1 && global.flag[483 truelab_green_key_status] >= 2)
64
{
65
    con = 12;
66
    myinteract = 0;
67
    global.interact = 1;
68
    global.msc = 0;
69
    global.typer = 5;
70
    global.msg[0] = 
* (It's an empty bathtub.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_showercurtain_248")
;
71
    instance_create(0, 0, obj_dialoguer);
72
}
73
if (con == 12 && instance_exists(OBJ_WRITER) == 0)
74
{
75
    con = 10;
76
    global.interact = 0;
77
}
78
if (mode == 1)
79
{
80
    if (size > 0.3)
81
        size -= 0.1;
82
    draw_sprite_ext(spr_showercurtain_empty, 0, x, y, size, 1, 0, c_white, 1);
83
}
84
if (mode == 2)
85
{
86
    size = 0.3;
87
    draw_sprite_ext(spr_showercurtain_empty, 0, x, y, size, 1, 0, c_white, 1);
88
}
89
draw_sprite(spr_showerbar, 0, x, y);