Undertale script viewer

← back to main script listing

gml_Object_obj_finalknight_Step_0

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

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
8
            alarm[5] = global.monsterinstance[0].alarm[5];
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
9
    }
10
    if (global.monster[1] == 1)
11
    {
12
        if (global.monsterinstance[1].alarm[5] > alarm[5])
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
13
            alarm[5] = global.monsterinstance[1].alarm[5];
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
14
    }
15
    if (global.monster[2] == 1)
16
    {
17
        if (global.monsterinstance[2].alarm[5] > alarm[5])
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
18
            alarm[5] = global.monsterinstance[2].alarm[5];
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
19
    }
20
}
21
if (global.mnfight == 1)
22
{
23
    if (talked == 0)
24
    {
25
        alarm[5] = 110;
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
26
        alarm[6] = 1;
gml_Object_obj_finalknight_Alarm_6.gml

gg = floor(random(3)); mycommand = round(random(100)); if (mycommand < 20) global.msg[0] =
Good
knight.
scr_gettext("obj_finalknight_275")
; if (mycommand >= 20) global.msg[0] =
Fare
well.
scr_gettext("obj_finalknight_279")
; if (mycommand >= 40) global.msg[0] =
Adieu.
scr_gettext("obj_finalknight_283")
; if (mycommand >= 60) global.msg[0] =
Close
your
eyes...
scr_gettext("obj_finalknight_287")
; if (mycommand >= 80) global.msg[0] =
Goodbye.
scr_gettext("obj_finalknight_291")
; if (asleep > 0) global.msg[0] =
Zzzz...
scr_gettext("obj_finalknight_295")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_finalknight_298")
; if (talk != 3) { global.typer = 1; global.msc = 0; blconwd = instance_create(x + 210, y - 20, OBJ_INSTAWRITER); } if (talk == 3) { global.msg[0] =
......
......
......
......
......
......
......
......
It's OK.
scr_gettext("obj_finalknight_308")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_finalknight_309")
; global.typer = 5; global.msc = 0; blconwd = instance_create(x + 210, y - 20, OBJ_INSTAWRITER); talk = 0; } attacked = 0; if (asleep == 0) global.border = 17; obj_heart.x = round((global.idealborder[0] + global.idealborder[1]) / 2) - 8; obj_heart.y = round((global.idealborder[2] + global.idealborder[3]) / 2) - 8;
27
        talked = 1;
28
        global.heard = 0;
29
    }
30
}
31
if (control_check_pressed(0))
32
{
33
    if (alarm[5] > 5 && obj_lborder.x == global.idealborder[0] && alarm[6] < 0)
gml_Object_obj_finalknight_Alarm_6.gml

gg = floor(random(3)); mycommand = round(random(100)); if (mycommand < 20) global.msg[0] =
Good
knight.
scr_gettext("obj_finalknight_275")
; if (mycommand >= 20) global.msg[0] =
Fare
well.
scr_gettext("obj_finalknight_279")
; if (mycommand >= 40) global.msg[0] =
Adieu.
scr_gettext("obj_finalknight_283")
; if (mycommand >= 60) global.msg[0] =
Close
your
eyes...
scr_gettext("obj_finalknight_287")
; if (mycommand >= 80) global.msg[0] =
Goodbye.
scr_gettext("obj_finalknight_291")
; if (asleep > 0) global.msg[0] =
Zzzz...
scr_gettext("obj_finalknight_295")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_finalknight_298")
; if (talk != 3) { global.typer = 1; global.msc = 0; blconwd = instance_create(x + 210, y - 20, OBJ_INSTAWRITER); } if (talk == 3) { global.msg[0] =
......
......
......
......
......
......
......
......
It's OK.
scr_gettext("obj_finalknight_308")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_finalknight_309")
; global.typer = 5; global.msc = 0; blconwd = instance_create(x + 210, y - 20, OBJ_INSTAWRITER); talk = 0; } attacked = 0; if (asleep == 0) global.border = 17; obj_heart.x = round((global.idealborder[0] + global.idealborder[1]) / 2) - 8; obj_heart.y = round((global.idealborder[2] + global.idealborder[3]) / 2) - 8;
34
        alarm[5] = 2;
gml_Object_obj_finalknight_Alarm_5.gml

with (blconwd) instance_destroy(); talked = 0; global.mnfight = 2; if (asleep == 0) global.border = 18;
35
}
36
if (global.hurtanim[myself] == 1)
37
{
38
    shudder = 8;
39
    alarm[3] = global.damagetimer;
gml_Object_obj_finalknight_Alarm_3.gml

if (mypart1.pause != 1) { dmgwriter = instance_create(x, y + 160, obj_dmgwriter); global.damage = takedamage; with (dmgwriter) dmg = global.damage; mypart1.pause = 1; asleep = 0; mypart1.asleep = 0; snd_play(snd_damage); alarm[8] = 11; } if (sha == 0) sha = x; x = sha + shudder; if (shudder < 0) shudder = -(shudder + 1); else shudder = -shudder; if (shudder == 0) { sha = 0; global.hurtanim[myself] = 2; exit; } alarm[3] = 2;
40
    global.hurtanim[myself] = 3;
41
}
42
if (global.hurtanim[myself] == 2)
43
{
44
    global.monsterhp[myself] -= takedamage;
45
    with (dmgwriter)
46
alarm[2]
47
    if (global.monsterhp[myself] >= 1)
48
    {
49
        global.hurtanim[myself] = 0;
50
        mypart1.pause = 0;
51
        global.myfight = 0;
52
        global.mnfight = 1;
53
    }
54
    else
55
    {
56
        global.myfight = 0;
57
        global.mnfight = 1;
58
        killed = 1;
59
        instance_destroy();
60
    }
61
}
62
if (global.hurtanim[myself] == 5)
63
{
64
    global.damage = 0;
65
    instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter);
66
    with (obj_dmgwriter)
67
alarm[2]
68
    global.myfight = 0;
69
    global.mnfight = 1;
70
    global.hurtanim[myself] = 0;
71
}
72
if (global.mnfight == 2)
73
{
74
    if (attacked == 0)
75
    {
76
        pop = scr_monstersum
scr_monstersum

return global.monster[0] + global.monster[1] + global.monster[2];
();
77
        global.turntimer = 150;
78
        global.firingrate = 7;
79
        if (pop == 3)
80
            global.firingrate = global.firingrate * 2.4;
81
        if (pop == 2)
82
            global.firingrate = global.firingrate * 1.7;
83
        if (asleep == 0)
84
        {
85
            if (mycommand > 75 && pop == 1)
86
            {
87
                global.turntimer = 150;
88
                gen = instance_create(x, y, obj_hammergen);
89
            }
90
            else
91
            {
92
                global.firingrate = 9;
93
                gen = instance_create((global.idealborder[0] + (c_borderwidth
c_borderwidth

if (argument0 == 0) return obj_rborder.x - obj_lborder.x; if (argument0 == 1) return global.idealborder[1] - global.idealborder[0];
(0) / 2)) - 20, global.idealborder[2] - 40, obj_skyorb);
94
            }
95
        }
96
        if (mycommand >= 0)
97
            global.msg[0] = 
* Knight Knight smashes her
morningstar.
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_finalknight_515")
;
98
        if (mycommand >= 25)
99
            global.msg[0] = 
* Knight Knight breathes deeply.
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_finalknight_516")
;
100
        if (mycommand >= 50)
101
            global.msg[0] = 
* Knight Knight watches quietly.
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_finalknight_517")
;
102
        if (mycommand >= 75)
103
            global.msg[0] = 
* Knight Knight's armor emits
a dark sheen.
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_finalknight_518")
;
104
        if (mycommand >= 90)
105
            global.msg[0] = 
* Smells like stardust.
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_finalknight_519")
;
106
        if (asleep > 0)
107
            global.msg[0] = 
* Knight Knight is snoring.
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_finalknight_520")
;
108
        attacked = 1;
109
    }
110
    if (asleep == 1 && pop == 1)
111
    {
112
        attacked = 1;
113
        global.turntimer = -1;
114
        global.mnfight = 3;
115
    }
116
    whatiheard = -1;
117
}
118
if (global.myfight == 2)
119
{
120
    if (whatiheard != -1)
121
    {
122
        if (global.heard == 0)
123
        {
124
            if (whatiheard == 0)
125
            {
126
                global.msc = 0;
127
                global.msg[0] = 
* KNIGHT KNIGHT - ATK 36 DEF 36
* This megaton mercenary wields
the Good Morningstar.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_finalknight_553")
;
128
                OBJ_WRITER.halt = 3;
129
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
130
                with (iii)
131
                    halt = 0;
132
                whatiheard = 9;
133
            }
134
            if (whatiheard == 3)
135
            {
136
                global.msc = 0;
137
                global.msg[0] = 
* You ask Knight Knight about
her day.Delay 11
* There's no response.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_finalknight_562")
;
138
                talk += 1;
139
                if (talk == 3)
140
                    global.msg[0] = 
* You ask Knight Knight about
her day.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_finalknight_566")
;
141
                if (asleep == 1)
142
                {
143
                    global.msg[0] = 
* You talk to Knight Knight.Delay 11
* She hums something in
her sleep...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_finalknight_570")
;
144
                    talk = 0;
145
                }
146
                OBJ_WRITER.halt = 3;
147
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
148
                with (iii)
149
                    halt = 0;
150
            }
151
            if (whatiheard == 1)
152
            {
153
                global.msc = 0;
154
                mercymod += 20;
155
                if (sleepy == 0)
156
                {
157
                    global.msg[0] = 
* You sing an old lullaby.Delay 11
* Knight Knight starts to look
sleepy...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_finalknight_586")
;
158
                    if (global.flag[81 status_shyren] == 2)
159
                        global.msg[0] = 
* You sing Shyren's song.Delay 11
* Knight Knight starts to look
sleepy...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_finalknight_588")
;
160
                }
161
                if (sleepy == 1)
162
                    global.msg[0] = 
* You keep singing.Delay 11
* Knight Knight closes its
eyes a bit...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_finalknight_592")
;
163
                if (asleep == 1)
164
                    global.msg[0] = 
* You keep singing.Delay 11
* Nothing happened.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_finalknight_596")
;
165
                if (sleepy > 1 && asleep == 0)
166
                {
167
                    global.msg[0] = 
* You keep singing.Delay 11
* Knight Knight falls asleep.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_finalknight_601")
;
168
                    mercymod = 200;
169
                    asleep = 1;
170
                    global.monsterdef[myself] = -30;
171
                }
172
                sleepy += 1;
173
                if (global.flag[81 status_shyren] == 2)
174
                    sleepy += 1;
175
                if (sleepy > 0)
176
                    mypart1.asleep = 1;
177
                if (asleep == 1)
178
                    mypart1.asleep = 2;
179
                OBJ_WRITER.halt = 3;
180
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
181
                with (iii)
182
                    halt = 0;
183
            }
184
            global.heard = 1;
185
        }
186
    }
187
}
188
if (global.myfight == 4)
189
{
190
    if (global.mercyuse == 0)
191
    {
192
        script_execute(scr_mercystandard);
193
        if (mercy < 0)
194
            instance_destroy();
195
    }
196
}
197
if (mercymod == 222 && instance_exists(OBJ_WRITER) == 0)
198
{
199
    script_execute(scr_mercystandard);
200
    if (mercy < 0)
201
        instance_destroy();
202
}