Undertale script viewer

← back to main script listing

gml_Object_obj_vegetoid_Step_0

(view raw script w/o annotations or w/e)
1
if (global.mnfight == 3)
2
    attacked = 0;
3
scr_blconmatch
scr_blconmatch

if (alarm[5] > 0) { if (global.monster[0] == 1) { if (global.monsterinstance[0].alarm[5] >alarm[5] alarm[5]
gml_Object_obj_vegetoid_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
} if (global.monster[1] == 1) { if (global.monsterinstance[1].alarm[5] >alarm[5] alarm[5]
gml_Object_obj_vegetoid_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
} if (global.monster[2] == 1) { if (global.monsterinstance[2].alarm[5] >alarm[5] alarm[5]
gml_Object_obj_vegetoid_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
} }
();
4
if (global.myfight == 0 && global.mnfight == 0)
5
    eat = 0;
6
if (global.mnfight == 1)
7
{
8
    if (talked == 0)
9
    {
10
        alarm[5] = 75;
gml_Object_obj_vegetoid_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
11
        alarm[6] = 1;
gml_Object_obj_vegetoid_Alarm_6.gml

blcon = instance_create((x + sprite_width) - 8, ystart, obj_blconsm); mycommand = round(random(100)); if (mycommand >= 0 && mycommand < 25) global.msg[0] =
Contains
Vitamin
A
scr_gettext("obj_vegetoid_172")
; if (mycommand >= 25 && mycommand < 50) global.msg[0] =
Part Of
A
Complete
Breakfast
scr_gettext("obj_vegetoid_173")
; if (mycommand >= 50 && mycommand <= 75) global.msg[0] =
Farmed
Locally,
Very
Locally
scr_gettext("obj_vegetoid_175")
; if (mycommand >= 75 && mycommand <= 100) global.msg[0] =
Fresh
Morning
Taste
scr_gettext("obj_vegetoid_176")
; if (ate == 1) global.msg[0] =
Ate
Your
Greens
scr_gettext("obj_vegetoid_178")
; if (whatiheard == 3) global.msg[0] =
Plants
Can't
Talk
Dummy
scr_gettext("obj_vegetoid_182")
; if (whatiheard == 4) global.msg[0] =
Eat
Your
Greens
scr_gettext("obj_vegetoid_186")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_vegetoid_190")
; global.typer = 2; blconwd = instance_create(blcon.x + 15, blcon.y + 10, OBJ_NOMSCWRITER); global.border = 3; obj_heart.x = round((global.idealborder[0] + global.idealborder[1]) / 2) - 8; obj_heart.y = round((global.idealborder[2] + global.idealborder[3]) / 2) - 8;
12
        talked = 1;
13
        global.heard = 0;
14
    }
15
}
16
if (control_check_pressed(0))
17
{
18
    if (alarm[5] > 5 && obj_lborder.x == global.idealborder[0] && alarm[6] < 0)
gml_Object_obj_vegetoid_Alarm_6.gml

blcon = instance_create((x + sprite_width) - 8, ystart, obj_blconsm); mycommand = round(random(100)); if (mycommand >= 0 && mycommand < 25) global.msg[0] =
Contains
Vitamin
A
scr_gettext("obj_vegetoid_172")
; if (mycommand >= 25 && mycommand < 50) global.msg[0] =
Part Of
A
Complete
Breakfast
scr_gettext("obj_vegetoid_173")
; if (mycommand >= 50 && mycommand <= 75) global.msg[0] =
Farmed
Locally,
Very
Locally
scr_gettext("obj_vegetoid_175")
; if (mycommand >= 75 && mycommand <= 100) global.msg[0] =
Fresh
Morning
Taste
scr_gettext("obj_vegetoid_176")
; if (ate == 1) global.msg[0] =
Ate
Your
Greens
scr_gettext("obj_vegetoid_178")
; if (whatiheard == 3) global.msg[0] =
Plants
Can't
Talk
Dummy
scr_gettext("obj_vegetoid_182")
; if (whatiheard == 4) global.msg[0] =
Eat
Your
Greens
scr_gettext("obj_vegetoid_186")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_vegetoid_190")
; global.typer = 2; blconwd = instance_create(blcon.x + 15, blcon.y + 10, OBJ_NOMSCWRITER); global.border = 3; obj_heart.x = round((global.idealborder[0] + global.idealborder[1]) / 2) - 8; obj_heart.y = round((global.idealborder[2] + global.idealborder[3]) / 2) - 8;
19
        alarm[5] = 2;
gml_Object_obj_vegetoid_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
20
}
21
if (global.hurtanim[myself] == 1)
22
{
23
    shudder = 16;
24
    alarm[3] = global.damagetimer;
gml_Object_obj_vegetoid_Alarm_3.gml

if (sprite_index != spr_vegetoidhurt) { dmgwriter = instance_create((x + (sprite_width / 2)) - 48, y + 80, obj_dmgwriter); global.damage = takedamage; with (dmgwriter) dmg = global.damage; sprite_index = spr_vegetoidhurt; snd_play(hurtsound); } x += shudder; if (shudder < 0) shudder = -(shudder + 2); else shudder = -shudder; if (shudder == 0) { global.hurtanim[myself] = 2; exit; } alarm[3] = 2;
25
    global.hurtanim[myself] = 3;
26
}
27
if (global.hurtanim[myself] == 2)
28
{
29
    global.monsterhp[myself] -= takedamage;
30
    with (dmgwriter)
31
alarm[2]
32
    if (global.monsterhp[myself] >= 1)
33
    {
34
        global.hurtanim[myself] = 0;
35
        sprite_index = spr_vegetoid;
36
        image_index = 0;
37
        global.myfight = 0;
38
        global.mnfight = 1;
39
    }
40
    else
41
    {
42
        global.myfight = 0;
43
        global.mnfight = 1;
44
        killed = 1;
45
        instance_destroy();
46
    }
47
}
48
if (global.hurtanim[myself] == 5)
49
{
50
    global.damage = 0;
51
    instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter);
52
    with (obj_dmgwriter)
53
alarm[2]
54
    global.myfight = 0;
55
    global.mnfight = 1;
56
    global.hurtanim[myself] = 0;
57
}
58
if (global.mnfight == 2)
59
{
60
    if (attacked == 0)
61
    {
62
        global.turntimer = 110;
63
        global.firingrate = 4;
64
        if (mycommand < 50)
65
        {
66
            global.firingrate = 6;
67
            if ((global.monster[0] + global.monster[1] + global.monster[2]) > 1)
68
                global.firingrate = 10;
69
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 3)
70
                global.firingrate = 16;
71
            gen = instance_create(0, 0, obj_1sidegen);
72
            if (eat == 1)
73
                gen.specgreen = 1;
74
            gen.bullettype = 6;
75
        }
76
        if (mycommand >= 50)
77
        {
78
            global.firingrate = 18;
79
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 2)
80
                global.firingrate = 30;
81
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 3)
82
                global.firingrate = 42;
83
            gen = instance_create(0, 0, obj_1sidegen);
84
            if (eat == 1)
85
                gen.specgreen = 1;
86
            gen.bullettype = 5;
87
        }
88
        gen.myself = myself;
89
        gen.dmg = global.monsteratk[myself];
90
        if (mycommand >= 0)
91
            global.msg[0] = 
* Vegetoid gave a mysterious
smile.
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_vegetoid_383")
;
92
        if (mycommand >= 30)
93
            global.msg[0] = 
* Vegetoid cackles softly.
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_vegetoid_384")
;
94
        if (mycommand >= 70)
95
            global.msg[0] = 
* Vegetoid's here for your
health.
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_vegetoid_385")
;
96
        if (mycommand >= 90)
97
            global.msg[0] = 
* It smells like steamed
carrots and peas.
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_vegetoid_386")
;
98
        if (global.monsterhp[myself] < (global.monstermaxhp[myself] / 3))
99
            global.msg[0] = 
* Vegetoid seems kind of
bruised.
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_vegetoid_387")
;
100
        attacked = 1;
101
    }
102
}
103
if (whatiheard == 1 && instance_exists(OBJ_WRITER) == 0)
104
{
105
    script_execute(scr_mercystandard);
106
    if (mercy < 8)
107
    {
108
        killed = 0;
109
        instance_destroy();
110
    }
111
}
112
if (global.myfight == 2)
113
{
114
    if (whatiheard != -1)
115
    {
116
        if (global.heard == 0)
117
        {
118
            if (whatiheard == 0)
119
            {
120
                global.msc = 0;
121
                global.msg[0] = 
* VEGETOID - ATK 6 DEF 6
* Serving Size: 1 Monster
* Not monitored by the USDAWait 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_vegetoid_414")
;
122
                OBJ_WRITER.halt = 3;
123
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
124
                with (iii)
125
                    halt = 0;
126
            }
127
            if (whatiheard == 3)
128
            {
129
                global.myfight = 0;
130
                global.mnfight = 1;
131
            }
132
            if (whatiheard == 1)
133
            {
134
                global.msc = 0;
135
                script_execute(scr_mercystandard);
136
                global.msg[0] = 
* You tried to eat Vegetoid,Delay 11
but it wasn't weakened
enough.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_vegetoid_428")
;
137
                if (mercy < 8)
138
                {
139
                    global.msg[0] = 
* You took a bite out of
Vegetoid.Delay 11
* You recovered 5 HP!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_vegetoid_431")
;
140
                    instance_create(0, 0, obj_foodsound);
141
                    script_execute(scr_recover, 5);
142
                    sprite_index = spr_vegetoidhurt;
143
                }
144
                OBJ_WRITER.halt = 3;
145
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
146
                with (iii)
147
                    halt = 0;
148
            }
149
            if (whatiheard == 4)
150
            {
151
                eat = 1;
152
                global.msc = 0;
153
                global.msg[0] = 
* You pat your stomach.Delay 11
* Vegetoid offers a healthy
meal.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_vegetoid_445")
;
154
                OBJ_WRITER.halt = 3;
155
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
156
                with (iii)
157
                    halt = 0;
158
            }
159
            global.heard = 1;
160
        }
161
    }
162
}
163
if (global.myfight == 4)
164
{
165
    if (global.mercyuse == 0)
166
    {
167
        script_execute(scr_mercystandard);
168
        if (mercy < 0)
169
        {
170
            global.flag[134 spared_vegetoid] = 1;
171
            instance_destroy();
172
        }
173
    }
174
}