Undertale script viewer

← back to main script listing

gml_Object_obj_moldsmal_Step_0

(view raw script w/o annotations or w/e)
1
if (image_yscale < 0.9)
2
    scalevalue = 0.01;
3
if (image_yscale > 1.1)
4
    scalevalue = -0.01;
5
image_yscale += scalevalue;
6
y -= (102 * scalevalue);
7
if (global.mnfight == 3)
8
    attacked = 0;
9
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_moldsmal_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_moldsmal_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_moldsmal_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
} }
();
10
if (global.mnfight == 1)
11
{
12
    if (talked == 0)
13
    {
14
        alarm[5] = 60;
gml_Object_obj_moldsmal_Alarm_5.gml

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

blcon = instance_create((x + sprite_width) - 8, ystart - 20, obj_blconsm); mycommand = round(random(100)); if (mycommand >= 0 && mycommand < 30) global.msg[0] =
Burble
burb...
scr_gettext("obj_moldsmal_193")
; if (mycommand >= 25 && mycommand < 50) global.msg[0] =
Squorch
...
scr_gettext("obj_moldsmal_194")
; if (mycommand >= 50 && mycommand < 80) global.msg[0] =
*Slime
sounds*
scr_gettext("obj_moldsmal_195")
; if (mycommand >= 75 && mycommand <= 100) global.msg[0] =
*Sexy
wiggle*
scr_gettext("obj_moldsmal_196")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_moldsmal_198")
; 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;
16
        talked = 1;
17
        global.heard = 0;
18
    }
19
}
20
if (control_check_pressed(0))
21
{
22
    if (alarm[5] > 5 && obj_lborder.x == global.idealborder[0] && alarm[6] < 0)
gml_Object_obj_moldsmal_Alarm_6.gml

blcon = instance_create((x + sprite_width) - 8, ystart - 20, obj_blconsm); mycommand = round(random(100)); if (mycommand >= 0 && mycommand < 30) global.msg[0] =
Burble
burb...
scr_gettext("obj_moldsmal_193")
; if (mycommand >= 25 && mycommand < 50) global.msg[0] =
Squorch
...
scr_gettext("obj_moldsmal_194")
; if (mycommand >= 50 && mycommand < 80) global.msg[0] =
*Slime
sounds*
scr_gettext("obj_moldsmal_195")
; if (mycommand >= 75 && mycommand <= 100) global.msg[0] =
*Sexy
wiggle*
scr_gettext("obj_moldsmal_196")
; global.msg[1] =
Close MessageClose MessageClose Message
scr_gettext("obj_moldsmal_198")
; 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;
23
        alarm[5] = 2;
gml_Object_obj_moldsmal_Alarm_5.gml

with (blconwd) instance_destroy(); with (blcon) instance_destroy(); talked = 0; whatiheard = -1; global.mnfight = 2;
24
}
25
if (global.hurtanim[myself] == 1)
26
{
27
    shudder = 16;
28
    alarm[3] = global.damagetimer;
gml_Object_obj_moldsmal_Alarm_3.gml

if (image_index != 1) { dmgwriter = instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter); global.damage = takedamage; with (dmgwriter) dmg = global.damage; image_index = 1; snd_play(hurtsound); x = xstart; y = ystart; image_yscale = 1; scalevalue = 0; gravity = 0; } x += shudder; if (shudder < 0) shudder = -(shudder + 2); else shudder = -shudder; if (shudder == 0) { global.hurtanim[myself] = 2; exit; } alarm[3] = 2;
29
    global.hurtanim[myself] = 3;
30
}
31
if (global.hurtanim[myself] == 2)
32
{
33
    global.monsterhp[myself] -= takedamage;
34
    with (dmgwriter)
35
alarm[2]
36
    if (global.monsterhp[myself] >= 1)
37
    {
38
        global.hurtanim[myself] = 0;
39
        image_index = 0;
40
        scalevalue = 0.01;
41
        global.myfight = 0;
42
        global.mnfight = 1;
43
    }
44
    else
45
    {
46
        global.myfight = 0;
47
        global.mnfight = 1;
48
        killed = 1;
49
        instance_destroy();
50
    }
51
}
52
if (global.hurtanim[myself] == 5)
53
{
54
    global.damage = 0;
55
    instance_create((x + (sprite_width / 2)) - 48, y - 24, obj_dmgwriter);
56
    with (obj_dmgwriter)
57
alarm[2]
58
    global.myfight = 0;
59
    global.mnfight = 1;
60
    global.hurtanim[myself] = 0;
61
}
62
if (global.mnfight == 2)
63
{
64
    if (attacked == 0)
65
    {
66
        global.turntimer = 120;
67
        if (mycommand >= 0 && mycommand <= 50)
68
        {
69
            global.firingrate = 15;
70
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 3)
71
                global.firingrate = global.firingrate * 2;
72
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 2)
73
                global.firingrate = global.firingrate * 1.5;
74
            gen = instance_create(0, 0, obj_1sidegen);
75
            gen.bullettype = 3;
76
        }
77
        else
78
        {
79
            global.firingrate = 30;
80
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 3)
81
                global.firingrate = global.firingrate * 2;
82
            if ((global.monster[0] + global.monster[1] + global.monster[2]) == 2)
83
                global.firingrate = global.firingrate * 1.5;
84
            gen = instance_create(0, 0, obj_1sidegen);
85
            gen.bullettype = 2;
86
        }
87
        gen.myself = myself;
88
        if (mycommand >= 0)
89
            global.msg[0] = 
* Moldsmal burbles 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_moldsmal_391")
;
90
        if (mycommand >= 30)
91
            global.msg[0] = 
* Moldsmal waits pensively.
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_moldsmal_392")
;
92
        if (mycommand >= 70)
93
            global.msg[0] = 
* Moldsmal is ruminating.
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_moldsmal_393")
;
94
        if (mycommand >= 90)
95
            global.msg[0] = 
* The aroma of lime gelatin
wafts through.
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_moldsmal_394")
;
96
        if (global.monsterhp[myself] < 15)
97
            global.msg[0] = 
* Moldsmal has started to spoil.
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_moldsmal_395")
;
98
        attacked = 1;
99
    }
100
}
101
if (global.myfight == 2)
102
{
103
    if (whatiheard != -1)
104
    {
105
        if (global.heard == 0)
106
        {
107
            if (whatiheard == 0)
108
            {
109
                global.msc = 0;
110
                global.msg[0] = 
* MOLDSMAL - ATK 6 DEF 0
* Stereotypical: Curvaceously
attractive, but no brains...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_moldsmal_412")
;
111
                if (global.monsteratk[myself] > 6)
112
                    global.msg[0] = 
* MOLDSMAL - ATK 12 DEF 0
* It's a different color,Delay 11 so
it's a bit stronger now.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_moldsmal_413")
;
113
                OBJ_WRITER.halt = 3;
114
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
115
                with (iii)
116
                    halt = 0;
117
            }
118
            if (whatiheard == 3)
119
            {
120
                global.flag[132 spared_moldsmal] = 1;
121
                global.msc = 0;
122
                global.msg[0] = 
* You lie immobile with Moldsmal.
* You feel like you understand
the world a little better.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_moldsmal_422")
;
123
                OBJ_WRITER.halt = 3;
124
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
125
                with (iii)
126
                    halt = 0;
127
                mercymod = 101;
128
            }
129
            if (whatiheard == 1)
130
            {
131
                global.flag[132 spared_moldsmal] = 1;
132
                global.msc = 0;
133
                global.msg[0] = 
* You wiggle your hips.
* Moldsmal wiggles back.
* What a meaningful conversation!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_moldsmal_434")
;
134
                OBJ_WRITER.halt = 3;
135
                iii = instance_create(global.idealborder[0], global.idealborder[2], OBJ_WRITER);
136
                with (iii)
137
                    halt = 0;
138
                mercymod = 101;
139
            }
140
            global.heard = 1;
141
        }
142
    }
143
}
144
if (global.myfight == 4)
145
{
146
    if (global.mercyuse == 0)
147
    {
148
        script_execute(scr_mercystandard);
149
        if (mercy < 0)
150
            instance_destroy();
151
    }
152
}