Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_rabbick_enemy_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
        global.typer = 50;
9
        rr = choose(0, 1, 2, 3);
10
        rando = floor(random(50));
11
        if (rando == 0)
12
            rr = 4;
13
        if (rr == 0)
14
            global.msg[0] = 
Snitter
snatter
what's the
matter
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_rabbick_enemy_slash_Step_0_gml_13_0")
;
15
        if (rr == 1)
16
            global.msg[0] = 
Duruuuu---
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_rabbick_enemy_slash_Step_0_gml_14_0")
;
17
        if (rr == 2)
18
            global.msg[0] = 
Hop,Delay 11 hop
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_rabbick_enemy_slash_Step_0_gml_15_0")
;
19
        if (rr == 3)
20
            global.msg[0] = 
Meow.
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_rabbick_enemy_slash_Step_0_gml_16_0")
;
21
        if (rr == 4)
22
            global.msg[0] = 
Bunnies are
the sequel
to frogs.
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_rabbick_enemy_slash_Step_0_gml_17_0")
;
23
        if (blown == 1)
24
        {
25
            if (rr == 0 || rr == 4)
26
                global.msg[0] = 
A soft and
clean boy.
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_rabbick_enemy_slash_Step_0_gml_21_0")
;
27
            if (rr == 1)
28
                global.msg[0] = 
A refreshing
boy.
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_rabbick_enemy_slash_Step_0_gml_22_0")
;
29
            if (rr == 2)
30
                global.msg[0] = 
A sweet and
fresh girl.
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_rabbick_enemy_slash_Step_0_gml_23_0")
;
31
            if (rr == 3)
32
                global.msg[0] = 
A nice and
tidy girl.
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_rabbick_enemy_slash_Step_0_gml_24_0")
;
33
        }
34
        
scr_enemyblcon
scr_enemyblcon

function
scr_enemyblcon(arg0, arg1, arg2)
{ if (arg2 == 0) { mywriter = instance_create(arg0, arg1, obj_writer); return mywriter; } if (arg2 == 1) { myblcon = instance_create(arg0, arg1, obj_battleblcon); return myblcon; } if (arg2 == 2) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v; return myblcon; } if (arg2 == 3) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; return myblcon; } if (arg2 == 4) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_clubs; myblcon.image_index = 0; myblcon.image_speed = 0; return myblcon; } if (arg2 == 5) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_clubs; myblcon.image_index = 1; myblcon.image_speed = 0; return myblcon; } if (arg2 == 6) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_clubs; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 7) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_r; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 8) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_tall; return myblcon; } }
(x - 160, y, 3);
35
        talked = 1;
36
        talktimer = 0;
37
    }
38
    if (talked == 1 && global.mnfight == 1)
39
    {
40
        rtimer = 0;
41
        
scr_blconskip
scr_blconskip

function
scr_blconskip(arg0)
{ if (arg0 != -1) { if (button1_p() && talktimer > arg0) talktimer = talkmax; talktimer += 1; if (talktimer >= talkmax) { with (obj_writer) instance_destroy(); global.mnfight = 2; } } if (arg0 == -1) { if (instance_exists(obj_writer) == false) global.mnfight = 2; } }
(15);
42
        if (global.mnfight == 2)
43
        {
44
            if (!instance_exists(obj_moveheart))
45
                
scr_moveheart
scr_moveheart

function
scr_moveheart()
{ return instance_create(obj_herokris.x + 10, obj_herokris.y + 40, obj_moveheart); }
();
46
            if (!instance_exists(obj_growtangle))
47
                instance_create(__view_get(e__VW.XView, 0) + 320, __view_get(e__VW.YView, 0) + 170, obj_growtangle);
48
        }
49
    }
50
    if (global.mnfight == 2 && attacked == 0)
51
    {
52
        rtimer += 1;
53
        if (rtimer == 12)
54
        {
55
            rr = choose(0, 1);
56
            if (rr == 0)
57
            {
58
                dc = instance_create(x, y, obj_dbulletcontroller);
59
                dc.type = 30;
60
                dc.target = mytarget;
61
                dc.damage = global.monsterat[myself] * 5;
62
                dc.grazepoints = 9;
63
                dc.timepoints = 3;
64
            }
65
            else
66
            {
67
                dc = instance_create(x, y, obj_dbulletcontroller);
68
                dc.type = 32;
69
                dc.target = mytarget;
70
                dc.damage = global.monsterat[myself] * 5;
71
                dc.grazepoints = 9;
72
                dc.timepoints = 3;
73
            }
74
            turns += 1;
75
            global.turntimer = 170;
76
            attacked = 1;
77
            global.typer = 6;
78
            global.fc = 0;
79
            rr = choose(0, 1, 2, 3);
80
            if (rr == 0)
81
                global.battlemsg[0] = 
* Rabbick is looking for a couch to get stuck under.
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_rabbick_enemy_slash_Step_0_gml_79_0")
;
82
            if (rr == 1)
83
                global.battlemsg[0] = 
* Rabbick emits a musty groan.
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_rabbick_enemy_slash_Step_0_gml_80_0")
;
84
            if (rr == 2)
85
                global.battlemsg[0] = 
* Rabbick ambiently damages the soil.
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_rabbick_enemy_slash_Step_0_gml_81_0")
;
86
            if (rr == 3)
87
                global.battlemsg[0] = 
* The battlefield is filled with the smell of dusty mustard.
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_rabbick_enemy_slash_Step_0_gml_82_0")
;
88
            if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
89
                global.battlemsg[0] = 
* Rabbick is starting to look wispy.
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_rabbick_enemy_slash_Step_0_gml_83_0")
;
90
            if (global.mercymod[myself] >= global.mercymax[myself])
91
                global.msg[0] = 
* Rabbick is now nice and clean.
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_rabbick_enemy_slash_Step_0_gml_84_0")
;
92
        }
93
        else
94
        {
95
            global.turntimer = 120;
96
        }
97
    }
98
    if (global.mnfight == 2)
99
    {
100
        if (global.turntimer <= 1)
101
        {
102
            if (battlecancel == 1)
103
                global.mercymod[myself] = 999;
104
            if (battlecancel == 2)
105
            {
106
                with (obj_battlecontroller)
107
                    noreturn = 1;
108
                con = 1;
109
                battlecancel = 3;
110
            }
111
        }
112
    }
113
}
114
if (global.myfight == 3)
115
{
116
    xx = __view_get(e__VW.XView, 0);
117
    yy = __view_get(e__VW.YView, 0);
118
    if (acting == 1 && actcon == 0)
119
    {
120
        actcon = 1;
121
        global.msg[0] = 
* RABBICK - AT 8 DF 1
* This dusty bunny needs a bit
of spring cleaning.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_rabbick_enemy_slash_Step_0_gml_118_0")
;
122
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
123
    }
124
    if (acting == 2 && actcon == 0)
125
    {
126
        blowall = 0;
127
        input_name = 
scr_get_input_name
scr_get_input_name

function
scr_get_input_name(arg0)
{ var _control = "[?]"; if (global.is_console || obj_gamecontroller.gamepad_active) { _control = global.input_g[arg0]; if (_control == gp_padr) return "\\*D "; if (_control == gp_padl) return "\\*A "; if (_control == global.button0) return "\\*Z "; if (_control == global.button1) return "\\*X "; if (_control == global.button2) return "\\*C "; } var left_bracket = (global.lang == "en") ? "[" : "["; var right_bracket = (global.lang == "en") ? "]" : "]"; _control = left_bracket + global.asc_def[global.input_k[arg0]] + right_bracket; if (!is_string(_control)) _control = "[?]"; else return _control; }
(4);
128
        global.msg[0] = 
scr_84_get_subst_string
scr_84_get_subst_string

function
scr_84_get_subst_string()
{ var str = argument[0]; var sub_id = 1; length = string_length(str); pos = 0; while (sub_id < argument_count) { var sub = "~" + string(sub_id); str = string_replace_all(str, sub, argument[sub_id]); sub_id = sub_id + 1; } return str; }
(
* Press ~1 repeatedly to blow air!
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_rabbick_enemy_slash_Step_0_gml_128_0")
, input_name);
129
        if (blown == 0)
130
        {
131
            actcon = 10;
132
            blowing = 1;
133
            blowtimer = 90;
134
            
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
135
        }
136
        if (blown == 1)
137
        {
138
            global.msg[0] = 
* Kris breathed on the Rabbick.Delay 11
* It blew away entirely...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_rabbick_enemy_slash_Step_0_gml_138_0")
;
139
            
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
140
            actcon = 20;
141
        }
142
    }
143
    if (acting == 3 && actcon == 0)
144
    {
145
        blowall = 1;
146
        input_name = 
scr_get_input_name
scr_get_input_name

function
scr_get_input_name(arg0)
{ var _control = "[?]"; if (global.is_console || obj_gamecontroller.gamepad_active) { _control = global.input_g[arg0]; if (_control == gp_padr) return "\\*D "; if (_control == gp_padl) return "\\*A "; if (_control == global.button0) return "\\*Z "; if (_control == global.button1) return "\\*X "; if (_control == global.button2) return "\\*C "; } var left_bracket = (global.lang == "en") ? "[" : "["; var right_bracket = (global.lang == "en") ? "]" : "]"; _control = left_bracket + global.asc_def[global.input_k[arg0]] + right_bracket; if (!is_string(_control)) _control = "[?]"; else return _control; }
(4);
147
        global.msg[0] = 
scr_84_get_subst_string
scr_84_get_subst_string

function
scr_84_get_subst_string()
{ var str = argument[0]; var sub_id = 1; length = string_length(str); pos = 0; while (sub_id < argument_count) { var sub = "~" + string(sub_id); str = string_replace_all(str, sub, argument[sub_id]); sub_id = sub_id + 1; } return str; }
(
* Press ~1 repeatedly to blow air!
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_rabbick_enemy_slash_Step_0_gml_150_0")
, input_name);
148
        actcon = 10;
149
        blowing = 1;
150
        blowtimer = 90;
151
        obj_rabbick_enemy.bunnycount = 0;
152
        obj_rabbick_enemy.bunnyid = id;
153
        with (obj_rabbick_enemy)
154
        {
155
            if (blown == 0)
156
                bunnyid.bunnycount += 1;
157
            blowbuffer = 2;
158
            blow_wait = 0;
159
            blowall = 1;
160
            blowing = 1;
161
            blowtimer = 90;
162
        }
163
        if (bunnycount == 0)
164
        {
165
            with (obj_rabbick_enemy)
166
            {
167
                blowing = 0;
168
                blowtimer = -1;
169
                actcon = 30;
170
                global.msg[0] = 
* The bunnies were blown away!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_rabbick_enemy_slash_Step_0_gml_175_0")
;
171
            }
172
        }
173
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
174
    }
175
    if (acting == 4 && actcon == 0)
176
    {
177
        actcon = 1;
178
        global.msg[0] = 
* You and Ralsei warned Rabbick 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_rabbick_enemy_slash_Step_0_gml_186_0")
;
179
        if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
180
            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_rabbick_enemy_slash_Step_0_gml_188_0")
;
181
        for (i = 0; i < 3; i += 1)
182
        {
183
            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_rabbick_enemy_slash_Step_0_gml_191_0")
;
184
            global.automiss[i] = 1;
185
        }
186
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
187
    }
188
    if (actcon == 10 && blowing == 0)
189
    {
190
        with (obj_writer)
191
            instance_destroy();
192
        actcon = 1;
193
    }
194
    if (actcon == 20 && !instance_exists(obj_writer))
195
    {
196
        event_user(10);
197
        actcon = 1;
198
    }
199
    if (actcon == 30 && !instance_exists(obj_writer))
200
    {
201
        with (obj_rabbick_enemy)
202
            event_user(10);
203
        actcon = 1;
204
    }
205
    if (actcon == 1 && !instance_exists(obj_writer))
206
    {
207
        actcon = 0;
208
        
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();
} } }
();
209
    }
210
    if (blowing == 1)
211
    {
212
        if (blow_wait == 1)
213
            blowtimer -= 1;
214
        blowbuffer -= 1;
215
        if (blowamt > 0 && blowanimtimer <= 0)
216
            blowamt -= 1;
217
        if (blowbuffer <= 0 && button1_p())
218
        {
219
            blow_wait = 1;
220
            snd_stop(snd_whistlebreath);
221
            blowsnd = snd_play(snd_whistlebreath);
222
            snd_pitch(blowsnd, 1 + (blowamt / 100));
223
            onoff = 0;
224
            shakeamt = 5;
225
            blowamt += 12;
226
            blowbuffer = 2;
227
            blowanimtimer = 20;
228
            repeat (6)
229
                event_user(2);
230
        }
231
        if (blowtimer <= 0)
232
            blowing = 0;
233
        if (blowamt >= 100)
234
        {
235
            if (blown == 0)
236
            {
237
                
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(myself, 100);
238
                blown = 1;
239
                blowing = 0;
240
                blowanimtimer = 0;
241
                repeat (15)
242
                    event_user(2);
243
            }
244
        }
245
        if (blowing == 0)
246
        {
247
        }
248
    }
249
}
250
251
enum e__VW
252
{
253
    XView,
254
    YView,
255
    WView,
256
    HView,
257
    Angle,
258
    HBorder,
259
    VBorder,
260
    HSpeed,
261
    VSpeed,
262
    Object,
263
    Visible,
264
    XPort,
265
    YPort,
266
    WPort,
267
    HPort,
268
    Camera,
269
    SurfaceID
270
}