Undertale script viewer

← back to main script listing

gml_Object_obj_barrierevent_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    con = 1;
4
    alarm[4] = 180;
5
}
6
if (con == 1)
7
{
8
    global.interact = 1;
9
    global.facing = 2;
10
}
11
if (con == 2)
12
{
13
    global.msc = 762;
14
    global.typer = 60;
15
    global.facechoice = 0;
16
    global.faceemotion = 0;
17
    if (global.flag[457 told_asgore_ready] == 0)
18
        global.msc = 762;
19
    else
20
        global.msc = 764;
21
    instance_create(0, 0, obj_dialoguer);
22
    con = 3;
23
}
24
if (con == 10 && instance_exists(OBJ_WRITER) == 0)
25
{
26
    con = 11;
27
    alarm[4] = 50;
28
}
29
if (con == 11)
30
    global.facing = 2;
31
if (con == 12)
32
{
33
    asg.sprite_index = asg.rsprite;
34
    con = 13;
35
    alarm[4] = 30;
36
}
37
if (con == 14)
38
{
39
    asg.sprite_index = asg.dtsprite;
40
    con = 15;
41
    alarm[4] = 30;
42
}
43
if (con == 16)
44
{
45
    global.typer = 60;
46
    global.facechoice = 7;
47
    global.faceemotion = 1;
48
    global.msc = 0;
49
    global.msg[0] = 
* Ready?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_barrierevent_145")
;
50
    instance_create(0, 0, obj_dialoguer);
51
    con = 17;
52
}
53
if (con == 17 && instance_exists(OBJ_WRITER) == 0)
54
{
55
    caster_free(all);
56
    snd_play(snd_spearappear);
57
    h[0] = instance_create(60, 220, obj_heartcontainer);
58
    h[0].image_blend = c_green;
59
    h[1] = instance_create(80, 220, obj_heartcontainer);
60
    h[1].image_blend = c_yellow;
61
    h[2] = instance_create(100, 220, obj_heartcontainer);
62
    h[2].image_blend = c_orange;
63
    h[3] = instance_create(120, 220, obj_heartcontainer);
64
    h[4] = instance_create(200, 220, obj_heartcontainer);
65
    h[4].image_blend = c_purple;
66
    h[5] = instance_create(220, 220, obj_heartcontainer);
67
    h[5].image_blend = c_blue;
68
    h[6] = instance_create(240, 220, obj_heartcontainer);
69
    h[6].image_blend = c_aqua;
70
    con = 18;
71
    alarm[4] = 150;
72
}
73
if (con == 19)
74
{
75
    global.flag[15 in_battle] = 0;
76
    global.flag[16 type_heart_transition] = 1;
77
    caster_free(all);
78
    global.battlegroup = 100;
79
    instance_create(0, 0, obj_battler);
80
    con = 20;
81
}
82
if (con == 40 && instance_exists(OBJ_WRITER) == 0)
83
{
84
    instance_create(obj_mainchara.x, obj_mainchara.y + 15, obj_doorBmusicfade);
85
    con = 41;
86
}