Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_heartenemy_Step_0

(view raw script w/o annotations or w/e)
1
if (global.monster[myself] == 1)
2
{
3
    if (global.mnfight == 1 && talked == 0)
4
    {
5
        scr_randomtarget
scr_randomtarget

function scr_randomtarget() { abletotarget = 1; if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0) abletotarget = 0; mytarget = choose(0, 1, 2); if (abletotarget == 1) { while (global.charcantarget[mytarget] == 0) mytarget = choose(0, 1, 2); } else { mytarget = 3; } global.targeted[mytarget] = 1; }
();
6
        if (!instance_exists(obj_darkener))
7
            instance_create(0, 0, obj_darkener);
8
        hb = instance_create(x - 100, y, obj_heartblcon);
9
        hb.sprite_index = choose(spr_heartblcon_0, spr_heartblcon_1);
10
        if (acting == 2)
11
            hb.sprite_index = spr_heartblcon_2;
12
        if (acting == 3)
13
            hb.sprite_index = spr_heartblcon_3;
14
        talked = 1;
15
        talktimer = 0;
16
    }
17
    if (talked == 1 && global.mnfight == 1)
18
    {
19
        rtimer = 0;
20
        if (button1_p() && talktimer > 15)
21
            talktimer = talkmax;
22
        talktimer += 1;
23
        if (talktimer >= talkmax)
24
        {
25
            with (obj_heartblcon)
26
                instance_destroy();
27
            global.mnfight = 2;
28
        }
29
        if (global.mnfight == 2)
30
        {
31
            if (!instance_exists(obj_moveheart))
32
                scr_moveheart
scr_moveheart

function scr_moveheart() { return instance_create(obj_herokris.x + 10, obj_herokris.y + 40, obj_moveheart); }
();
33
            if (!instance_exists(obj_growtangle))
34
                instance_create(__view_get(e__VW.XView, 0) + 320, __view_get(e__VW.YView, 0) + 170, obj_growtangle);
35
        }
36
    }
37
    if (global.mnfight == 2 && attacked == 0)
38
    {
39
        with (obj_heartblcon)
40
            instance_destroy();
41
        rtimer += 1;
42
        if (rtimer == 12)
43
        {
44
            rr = scr_monsterpop
scr_monsterpop

function scr_monsterpop() { return global.monster[0] + global.monster[1] + global.monster[2]; }
();
45
            global.turntimer = 140;
46
            if (rr == 1)
47
            {
48
                dc = instance_create(x, y, obj_spinheart);
49
                dc.type = 0;
50
                dc.target = mytarget;
51
                dc.damage = global.monsterat[myself] * 5;
52
            }
53
            else
54
            {
55
                dc = instance_create(x, y, obj_heartshaper);
56
                dc.type = 0;
57
                dc.target = mytarget;
58
                dc.damage = global.monsterat[myself] * 5;
59
                if (global.encounterno == 9)
60
                    global.turntimer = 100;
61
            }
62
            turns += 1;
63
            attacked = 1;
64
            global.typer = 6;
65
            global.fc = 0;
66
            rr = choose(0, 1, 2, 3, 4);
67
            if (rr == 0)
68
                global.battlemsg[0] = 
* Hathy's body beats audibly.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_79_0")
;
69
            if (rr == 1)
70
                global.battlemsg[0] = 
* Hathy smiled a darling smile.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_80_0")
;
71
            if (rr == 2)
72
                global.battlemsg[0] = 
* Hathy is whispering a lovely spell.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_81_0")
;
73
            if (rr == 3)
74
                global.battlemsg[0] = 
* Hathy has a little secret.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_82_0")
;
75
            if (rr == 4)
76
                global.battlemsg[0] = 
* Smells like a soft kiss.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_83_0")
;
77
            if (global.monsterstatus[myself] == 1)
78
                global.battlemsg[0] = 
* Hathy's beat slows.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_84_0")
;
79
            if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
80
                global.battlemsg[0] = 
* Hathy's beat seems to stutter.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_85_0")
;
81
            if (global.mercymod[myself] >= global.mercymax[myself])
82
                global.msg[0] = 
* Hathy is skipping beats.
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_86_0")
;
83
        }
84
        else
85
        {
86
            global.turntimer = 120;
87
        }
88
    }
89
    if (global.mnfight == 2)
90
    {
91
        if (global.turntimer <= 1)
92
        {
93
            if (instance_exists(obj_hathyfightevent) && firstturn == 0)
94
            {
95
                if (checkhp1 <= global.hp[1])
96
                {
97
                    if (checkhp2 <= global.hp[2])
98
                    {
99
                        with (obj_battlecontroller)
100
                            noreturn = 1;
101
                        with (obj_hathyfightevent)
102
                            con = 15;
103
                    }
104
                }
105
            }
106
            firstturn = 1;
107
            if (battlecancel == 1)
108
                global.mercymod[myself] = 999;
109
        }
110
    }
111
}
112
if (global.myfight == 3)
113
{
114
    xx = __view_get(e__VW.XView, 0);
115
    yy = __view_get(e__VW.YView, 0);
116
    if (acting == 1 && actcon == 0)
117
    {
118
        actcon = 1;
119
        global.msg[0] = 
* HATHY - AT 7 DF 0
* I am a \cYlittle kiss\cW.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_127_0")
;
120
        scr_battletext_default
scr_battletext_default

function scr_battletext_default() { global.fc = 0; global.typer = 4; scr_battletext(); return battlewriter; }
();
121
    }
122
    if (acting == 2 && actcon == 0)
123
    {
124
        rr = choose(0, 1, 2);
125
        global.msg[0] = 
* You told Hathy it has cool tentacles.Delay 11
* It began to think about this...Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_136_0")
;
126
        if (rr == 1)
127
            global.msg[0] = 
* You called Hathy a sweetheart.Delay 11
* It began to think about this...Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_137_0")
;
128
        if (rr == 2)
129
            global.msg[0] = 
* You told Hathy its teeth look like knives.Delay 11
* It began to think about this...Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_138_0")
;
130
        scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(myself, 100);
131
        scr_battletext_default
scr_battletext_default

function scr_battletext_default() { global.fc = 0; global.typer = 4; scr_battletext(); return battlewriter; }
();
132
        battlecancel = 1;
133
        actcon = 1;
134
    }
135
    if (acting == 3 && actcon == 0)
136
    {
137
        global.msg[0] = 
* You ordered Ralsei to flatter all the enemies!Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_147_0")
;
138
        scr_ralface
scr_ralface

function scr_ralface(arg0, arg1) { global.msg[arg0] = scr_84_get_subst_string(
\TX \F0 \E~1 \FR \TR Close Message
scr_84_get_lang_string("scr_ralface_slash_scr_ralface_gml_1_0")
, string(arg1)); }
(1, 0);
139
        rr = choose(0, 1, 2);
140
        global.msg[2] = 
* Out of anyone,Delay 11 I'm glad we randomly encountered all of you.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_150_0")
;
141
        if (rr == 1)
142
            global.msg[2] = 
* I'm making tea later...Delay 11
* Umm,Delay 11 would you like any?Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_151_0")
;
143
        if (rr == 2)
144
            global.msg[2] = 
* We don't need EXP.Delay 11
* Just encountering your smile is reward enough.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_152_0")
;
145
        scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(0, 100);
146
        scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(1, 100);
147
        scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(2, 100);
148
        actcon = 1;
149
        scr_battletext_default
scr_battletext_default

function scr_battletext_default() { global.fc = 0; global.typer = 4; scr_battletext(); return battlewriter; }
();
150
    }
151
    if (acting == 4 && actcon == 0)
152
    {
153
        actcon = 1;
154
        if (global.plot < 150)
155
        {
156
            global.msg[0] = 
* You and Ralsei warned Hathy about Susie.Delay 11
* The enemy went on guard.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_168_0")
;
157
            if (scr_monsterpop
scr_monsterpop

function scr_monsterpop() { return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
158
                global.msg[0] = 
* You and Ralsei warned the enemies about Susie.Delay 11
* Everyone went on guard.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_170_0")
;
159
            for (i = 0; i < 3; i += 1)
160
            {
161
                global.monstercomment[i] = 
(Warned)
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_173_0")
;
162
                global.automiss[i] = 1;
163
            }
164
        }
165
        else
166
        {
167
            global.msg[0] = 
* You ordered Susie to flatter all the enemies!Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_179_0")
;
168
            scr_susface
scr_susface

function scr_susface(arg0, arg1) { global.msg[arg0] = scr_84_get_subst_string(
\TX \F0 \E~1 \FS \TS Close Message
scr_84_get_lang_string("scr_susface_slash_scr_susface_gml_1_0")
, string(arg1)); }
(1, 2);
169
            rr = choose(0, 1, 2);
170
            global.msg[2] = 
* Can't believe my bozo teammates...Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_182_0")
;
171
            global.msg[3] = 
\E0* ... came back here just to see YOU guys.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_183_0")
;
172
            if (rr == 1)
173
                global.msg[3] = 
\E0* ... wanted to fight someone like YOU so much.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_184_0")
;
174
            if (rr == 2)
175
                global.msg[3] = 
\E0* ... have a THING for weaklings like you.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_185_0")
;
176
            scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(0, 100);
177
            scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(1, 100);
178
            scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(2, 100);
179
        }
180
        scr_battletext_default
scr_battletext_default

function scr_battletext_default() { global.fc = 0; global.typer = 4; scr_battletext(); return battlewriter; }
();
181
    }
182
    if (actcon == 1 && !instance_exists(obj_writer))
183
    {
184
        actcon = 0;
185
        scr_attackphase
scr_attackphase

function scr_attackphase() { with (obj_battlecontroller) { techwon = 0; if (scr_monsterpop() == 0) techwon = 1; if (techwon == 0) { fightphase = 1; global.charturn = 3; if (global.charaction[0] == 4 || global.charaction[0] == 2) fightphase = 0; if (global.charaction[1] == 4 || global.charaction[1] == 2) fightphase = 0; if (global.charaction[2] == 4 || global.charaction[2] == 2) fightphase = 0; if (global.myfight == 4) fightphase = 1; if (fightphase == 1) { global.myfight = 1; instance_create(xx + 2, yy + 365, obj_attackpress); } else { global.myfight = 4; instance_create(0, 0, obj_spellphase); } } else { scr_wincombat(); } } }
();
186
    }
187
    if (actcon == 5 && instance_exists(obj_writer) == false)
188
    {
189
        global.battleat[1] = 90;
190
        global.battleat[2] = 90;
191
        actcon = 6;
192
        with (obj_herosusie)
193
        {
194
            attacktimer = 0;
195
            state = 1;
196
            points = 100 + round(random(40));
197
            global.faceaction[myself] = 0;
198
            if (global.automiss[0] == 1)
199
                points = 0;
200
            if (global.automiss[0] == 0)
201
            {
202
                with (obj_event_manager)
203
                    trigger_event(UnknownEnum.Value_0, UnknownEnum.Value_22);
204
            }
205
        }
206
        alarm[4] = 50;
207
    }
208
    if (actcon == 7)
209
    {
210
        global.msg[0] = 
* Where'd you get it?Delay 11
* Heh heh heh heh.Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_223_0")
;
211
        scr_ralface
scr_ralface

function scr_ralface(arg0, arg1) { global.msg[arg0] = scr_84_get_subst_string(
\TX \F0 \E~1 \FR \TR Close Message
scr_84_get_lang_string("scr_ralface_slash_scr_ralface_gml_1_0")
, string(arg1)); }
(1, 3);
212
        global.msg[2] = 
* (Umm,Delay 11 Kris,Delay 11 maybe Susie shouldn't ACT anymore...)Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_225_0")
;
213
        if (global.automiss[0] == 1)
214
        {
215
            global.msg[0] = 
\E7* H-hey,Delay 11 what gives!?Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_228_0")
;
216
            scr_ralface
scr_ralface

function scr_ralface(arg0, arg1) { global.msg[arg0] = scr_84_get_subst_string(
\TX \F0 \E~1 \FR \TR Close Message
scr_84_get_lang_string("scr_ralface_slash_scr_ralface_gml_1_0")
, string(arg1)); }
(1, 3);
217
            global.msg[2] = 
* (Wow,Delay 11 that was close,Delay 11 Kris...)Wait for input
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_230_0")
;
218
            global.msg[3] = 
* (Maybe Susie shouldn't ACT anymore...)Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Step_0_gml_231_0")
;
219
        }
220
        scr_battletext
scr_battletext

function scr_battletext() { xx = __view_get(e__VW.XView, 0); yy = __view_get(e__VW.YView, 0); if (global.fc != 0) battlewriter = instance_create(xx + 30, yy + 376, obj_writer); if (global.fc == 0) battlewriter = instance_create(xx + 30, yy + 376, obj_writer); myface = instance_create(xx + 26, yy + 380, obj_face); with (battlewriter) { dialoguer = 1; facer = 1; if (global.fc == 0 && originalcharline == 33) charline = 26; } return battlewriter; } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
();
221
        actcon = 1;
222
    }
223
}
224
if (global.myfight == 7)
225
    hspeed = 15;
226
227
enum e__VW
228
{
229
    XView,
230
    YView,
231
    WView,
232
    HView,
233
    Angle,
234
    HBorder,
235
    VBorder,
236
    HSpeed,
237
    VSpeed,
238
    Object,
239
    Visible,
240
    XPort,
241
    YPort,
242
    WPort,
243
    HPort,
244
    Camera,
245
    SurfaceID
246
}
247
248
enum UnknownEnum
249
{
250
    Value_0,
251
    Value_22 = 22
252
}