Undertale script viewer

← back to main script listing

gml_Object_obj_mettatonb_quiz_Step_0

(view raw script w/o annotations or w/e)
1
if (global.mnfight == 3)
2
{
3
    attacked = 0;
4
    talked = 0;
5
}
6
if (alarm[5] > 0)
7
{
8
    if (global.monster[0] == 1)
9
    {
10
        if (global.monsterinstance[0].alarm[5] > alarm[5])
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
11
            alarm[5] = global.monsterinstance[0].alarm[5];
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
12
    }
13
    if (global.monster[1] == 1)
14
    {
15
        if (global.monsterinstance[1].alarm[5] > alarm[5])
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
16
            alarm[5] = global.monsterinstance[1].alarm[5];
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
17
    }
18
    if (global.monster[2] == 1)
19
    {
20
        if (global.monsterinstance[2].alarm[5] > alarm[5])
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
21
            alarm[5] = global.monsterinstance[2].alarm[5];
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
22
    }
23
}
24
if (global.mnfight == 1)
25
{
26
    if (talked == 1 && instance_exists(OBJ_WRITER) == 0)
27
    {
28
        alarm[5] = 1;
gml_Object_obj_mettatonb_quiz_Alarm_5.gml

talked = 0; whatiheard = -1; global.mnfight = 2; global.border = 0;
29
        talked = 2;
30
    }
31
    if (talked == 0)
32
    {
33
        attacked = 0;
34
        alarm[6] = 1;
gml_Object_obj_mettatonb_quiz_Alarm_6.gml

gg = floor(random(3)); mycommand = round(random(100)); qno = obj_questionasker.q; global.msc = 0; if (qno == 0) global.msg[0] =
LET'S START WITH
AN EASY ONE!!Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_255")
; if (qno == 1) global.msg[0] =
HERE'S YOUR TERRIFIC
PRIZE!Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_258")
; if (qno == 2) global.msg[0] =
ENOUGH ABOUT YOU.
LET'S TALK ABOUT ME!Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_262")
; if (qno == 3) global.msg[0] =
HERE'S ANOTHER EASY
ONE FOR YOU!Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_266")
; if (qno == 4) global.msg[0] =
DON'T 'COUNT'
ON YOUR VICTORY...Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_270")
; if (qno == 5) global.msg[0] =
LET'S PLAY MEMORY
GAME.Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_274")
; if (qno == 6) global.msg[0] =
BUT CAN YOU GET
THIS ONE???Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_278")
; if (qno == 7) global.msg[0] =
HERE'S A SIMPLE
ONE.Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_282")
; if (qno == 8) global.msg[0] =
TIME TO BREAK OUT
THE BIG GUNS!!Wait for inputClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_286")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_mettatonb_quiz_294")
; global.typer = 51; sxx = obj_mettatonb_body.x - 320; if (sxx < 0) sxx = 0; scr_blcon(sxx, obj_mettatonb_body.y - 120, 1); global.border = 0; obj_heart.x = round((global.idealborder[0] + global.idealborder[1]) / 2) - 8; obj_heart.y = round((global.idealborder[2] + global.idealborder[3]) / 2) - 8;
35
        talked = 1;
36
        global.heard = 0;
37
    }
38
}
39
if (global.hurtanim[myself] == 1)
40
{
41
    shudder = 8;
42
    alarm[3] = global.damagetimer;
gml_Object_obj_mettatonb_quiz_Alarm_3.gml

if (hurta == 0) { dmgwriter = instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter); global.damage = takedamage; with (dmgwriter) dmg = global.damage; hurta = 1; snd_play(snd_damage); alarm[8] } if (shudder < 0) shudder = -(shudder + 1); else shudder = -shudder; if (shudder == 0) { global.hurtanim[myself] = 2; exit; } alarm[3] = 2;
43
    global.hurtanim[myself] = 3;
44
}
45
if (global.hurtanim[myself] == 2)
46
{
47
    with (dmgwriter)
48
alarm[2]
49
    if (global.monsterhp[myself] >= 1)
50
    {
51
        global.hurtanim[myself] = 0;
52
        hurta = 0;
53
        global.myfight = 0;
54
        global.mnfight = 1;
55
    }
56
    else
57
    {
58
        global.myfight = 0;
59
        global.mnfight = 1;
60
        killed = 1;
61
        instance_destroy();
62
    }
63
}
64
if (global.hurtanim[myself] == 5)
65
{
66
    global.damage = 0;
67
    instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter);
68
    with (obj_dmgwriter)
69
alarm[2]
70
    global.myfight = 0;
71
    global.mnfight = 1;
72
    global.hurtanim[myself] = 0;
73
}
74
if (global.mnfight == 2)
75
{
76
    if (attacked == 0)
77
    {
78
        with (mypart1)
79
            event_user(0);
80
        global.msg[0] = 
* Mettaton.
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_mettatonb_quiz_490")
;
81
        attacked = 1;
82
        alarm[7] = 20;
83
    }
84
    if (attacked == 2)
85
    {
86
        with (obj_questionasker)
87
            event_user(0);
88
        attacked = 3;
89
    }
90
}
91
if (global.myfight == 2)
92
{
93
    if (whatiheard != -1)
94
    {
95
        if (global.heard == 0)
96
        {
97
            if (whatiheard == 0)
98
            {
99
                global.msc = 0;
100
                global.msg[0] = 
* METTATON - ATK 30 DEF 255
* His metal body renders him
invulnerable to attack.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_mettatonb_quiz_514")
;
101
                OBJ_WRITER.halt = 3;
102
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
103
                with (iii)
104
                    halt = 0;
105
                whatiheard = 9;
106
            }
107
            if (whatiheard == 3)
108
            {
109
                global.msc = 0;
110
                global.msg[0] = 
* Screaming is against the
rules.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_mettatonb_quiz_524")
;
111
                OBJ_WRITER.halt = 3;
112
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
113
                with (iii)
114
                    halt = 0;
115
            }
116
            global.heard = 1;
117
        }
118
    }
119
}
120
if (whatiheard == 3 && flex == 3 && instance_exists(OBJ_WRITER))
121
{
122
    if (OBJ_WRITER.stringno == 1)
123
    {
124
        vspeed = -4;
125
        mypart1.vspeed = -4;
126
    }
127
}
128
if (whatiheard == 3 && flex == 3 && instance_exists(OBJ_WRITER) == 0)
129
{
130
    script_execute(scr_mercystandard);
131
    if (mercy < 0)
132
        instance_destroy();
133
}
134
if (alphaup == 1 && image_alpha < 1)
135
    image_alpha += 0.05;
136
if (global.myfight == 4)
137
{
138
    if (global.mercyuse == 0)
139
    {
140
        script_execute(scr_mercystandard);
141
        if (mercy < 0)
142
            instance_destroy();
143
    }
144
}
145
if (mercymod == 222 && instance_exists(OBJ_WRITER) == 0)
146
{
147
    script_execute(scr_mercystandard);
148
    if (mercy < 0)
149
        instance_destroy();
150
}