Undertale script viewer

← back to main script listing

gml_Object_obj_tobdog_pendant_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 1)
2
{
3
    image_speed = 0.25;
4
    x += (random(2) - 1);
5
    y += (random(2) - 1);
6
    move_towards_point(obj_rarependant.x - 4, obj_rarependant.y - 5, 2);
7
}
8
if (con == 1)
9
{
10
    if (hspeed > 0)
11
        sprite_index = spr_tobdogr;
12
    else
13
        sprite_index = spr_tobdogl;
14
    if (abs(distance_to_point(obj_rarependant.x - 4, obj_rarependant.y - 5)) < 2)
15
    {
16
        con = 2;
17
        alarm[4] = 30;
18
    }
19
}
20
if (con == 2 || con == 3 || con == 4)
21
{
22
    image_speed = 0.25;
23
    x = obj_rarependant.x - 4;
24
    y = obj_rarependant.y - 5;
25
    x += (random(1) - 0.5);
26
    y += (random(1.2) - 0.5);
27
}
28
if (con == 4 && instance_exists(OBJ_WRITER) == 0)
29
{
30
    con = 5;
31
    alarm[4] = 90;
32
}
33
if (con == 5)
34
{
35
    move_towards_point(x + 400, y + 100, 2);
36
    x += (1 - random(2));
37
    y += (1 - random(2));
38
    if (hspeed > 0)
39
        sprite_index = spr_tobdogr;
40
    else
41
        sprite_index = spr_tobdogl;
42
}
43
if (con == 6)
44
{
45
    obj_rarependant.con = 5;
46
    con = 7;
47
}
48
if (con == 3)
49
{
50
    with (obj_rarependant)
51
        image_index = 1;
52
    global.typer = 5;
53
    global.facechoice = 0;
54
    global.msc = 0;
55
    global.msg[0] = 
* (The dog absorbs the
artifact.)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_tobdog_pendant_137")
;
56
    instance_create(0, 0, obj_dialoguer);
57
    con = 4;
58
}