Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_jigsawryenemy_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
        if (rr == 0)
11
            global.msg[0] = 
H... hurting
people is
cool..
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_jigsawryenemy_slash_Step_0_gml_11_0")
;
12
        if (rr == 1)
13
            global.msg[0] = 
P... Put up
your d-dukes,
bubbo...
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_jigsawryenemy_slash_Step_0_gml_12_0")
;
14
        if (rr == 2)
15
            global.msg[0] = 
F... Fighting?
I love
fighting...
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_jigsawryenemy_slash_Step_0_gml_13_0")
;
16
        if (rr == 3)
17
            global.msg[0] = 
I... I have
a rent
payment
to make...
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_jigsawryenemy_slash_Step_0_gml_14_0")
;
18
        if (global.mercymod[myself] >= 100)
19
        {
20
            if (rr == 0 || rr == 1)
21
                global.msg[0] = 
I always
wanted a
friend just
like you.
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_jigsawryenemy_slash_Step_0_gml_18_0")
;
22
            if (rr == 2 || rr == 3)
23
                global.msg[0] = 
We're friends
now, la la~
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_jigsawryenemy_slash_Step_0_gml_19_0")
;
24
        }
25
        if (traitorp == 1)
26
        {
27
            if (rr == 0 || rr == 1)
28
                global.msg[0] = 
WHADDA WORLD!
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_jigsawryenemy_slash_Step_0_gml_24_0")
;
29
            if (rr == 2 || rr == 3)
30
                global.msg[0] = 
I'M TOO YOUNG
TO DIE!!!
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_jigsawryenemy_slash_Step_0_gml_25_0")
;
31
        }
32
        if (traitorp == 2)
33
        {
34
            if (rr == 0 || rr == 1)
35
                global.msg[0] = 
BARRY!!!
THEY GOT
BARRY!!!
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_jigsawryenemy_slash_Step_0_gml_29_0")
;
36
            if (rr == 2 || rr == 3)
37
                global.msg[0] = 
BARRY!!
HANG IN
THERE BARRY!
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_jigsawryenemy_slash_Step_0_gml_30_0")
;
38
        }
39
        traitorp = 0;
40
        
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);
41
        talked = 1;
42
        talktimer = 0;
43
    }
44
    if (talked == 1 && global.mnfight == 1)
45
    {
46
        rtimer = 0;
47
        
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);
48
        if (global.mnfight == 2)
49
        {
50
            if (!instance_exists(obj_moveheart))
51
                
scr_moveheart
scr_moveheart

function
scr_moveheart()
{ return instance_create(obj_herokris.x + 10, obj_herokris.y + 40, obj_moveheart); }
();
52
            if (!instance_exists(obj_growtangle))
53
                instance_create(__view_get(e__VW.XView, 0) + 320, __view_get(e__VW.YView, 0) + 170, obj_growtangle);
54
        }
55
    }
56
    if (global.mnfight == 2 && attacked == 0)
57
    {
58
        rtimer += 1;
59
        if (rtimer == 12)
60
        {
61
            global.flag[20 other_text_command] = 0;
62
            rr = choose(0);
63
            if (rr == 0)
64
            {
65
                tellme = 0;
66
                with (obj_dbulletcontroller)
67
                {
68
                    if (type >= 80 && type <= 84)
69
                        obj_jigsawryenemy.tellme = 1;
70
                }
71
                if (tellme == 0)
72
                {
73
                    dc = instance_create(x, y, obj_dbulletcontroller);
74
                    dc.grazepoints = 4;
75
                    dc.timepoints = 2;
76
                    metotal = 0;
77
                    for (i = 0; i < 3; i += 1)
78
                    {
79
                        if (global.monstertype[i] == 15 && global.monster[i] == 1Enemy (placeholder/G-BODY))
80
                            metotal += 1;
81
                    }
82
                    dc.type = 80 + metotal;
83
                    dc.target = mytarget;
84
                    dc.damage = global.monsterat[myself] * 5;
85
                }
86
            }
87
            turns += 1;
88
            global.turntimer = 140;
89
            attacked = 1;
90
            global.typer = 6;
91
            global.fc = 0;
92
            rr = choose(0, 1, 2, 3, 4);
93
            if (rr == 0)
94
                global.battlemsg[0] = 
* Jigsawry is pretending to march.
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_jigsawryenemy_slash_Step_0_gml_89_0")
;
95
            if (rr == 1)
96
                global.battlemsg[0] = 
* Jigsawry is trying to calculate this month's rent.
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_jigsawryenemy_slash_Step_0_gml_90_0")
;
97
            if (rr == 2)
98
                global.battlemsg[0] = 
* Jigsawry thought of its boss and felt afraid.
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_jigsawryenemy_slash_Step_0_gml_91_0")
;
99
            if (rr == 3)
100
                global.battlemsg[0] = 
* Jigsawry is wishing it could quit its job.
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_jigsawryenemy_slash_Step_0_gml_92_0")
;
101
            if (rr == 4)
102
                global.battlemsg[0] = 
* Smells like cardboard.
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_jigsawryenemy_slash_Step_0_gml_93_0")
;
103
            if (global.monsterstatus[myself] == 1)
104
                global.battlemsg[0] = 
* Jigsawry looks exhausted.
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_jigsawryenemy_slash_Step_0_gml_94_0")
;
105
            if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
106
                global.battlemsg[0] = 
* Jigsawry's edges are fraying.
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_jigsawryenemy_slash_Step_0_gml_95_0")
;
107
            if (global.mercymod[myself] >= global.mercymax[myself])
108
                global.msg[0] = 
* Jigsawry looks happy about its life.
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_jigsawryenemy_slash_Step_0_gml_96_0")
;
109
        }
110
        else
111
        {
112
            global.turntimer = 120;
113
        }
114
    }
115
    if (global.mnfight == 2)
116
    {
117
        if (global.turntimer <= 1)
118
        {
119
            if (battlecancel == 1)
120
                global.mercymod[myself] = 999;
121
            if (battlecancel == 2)
122
            {
123
                with (obj_battlecontroller)
124
                    noreturn = 1;
125
                con = 1;
126
                battlecancel = 3;
127
            }
128
        }
129
    }
130
}
131
if (global.myfight == 3)
132
{
133
    xx = __view_get(e__VW.XView, 0);
134
    yy = __view_get(e__VW.YView, 0);
135
    if (acting == 1 && actcon == 0)
136
    {
137
        actcon = 1;
138
        global.msg[0] = 
* JIGSAWRY - AT 5 DF 0
* This mousenary is only fighting to make ends meet...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_jigsawryenemy_slash_Step_0_gml_129_0")
;
139
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
140
    }
141
    if (acting == 2 && actcon == 0)
142
    {
143
        global.msg[0] = 
* You barely lifted a finger,Delay 11 and...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_jigsawryenemy_slash_Step_0_gml_136_0")
;
144
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
145
        actcon = 3;
146
    }
147
    if (actcon == 3 && !instance_exists(obj_writer))
148
    {
149
        with (obj_jigsawryenemy)
150
            
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(myself, 100);
151
        rr = choose(0, 1, 2, 3);
152
        global.typer = 50;
153
        if (rr == 0)
154
            global.msg[0] = 
Of course
I'll be
your friend!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_jigsawryenemy_slash_Step_0_gml_152_0")
;
155
        if (rr == 1)
156
            global.msg[0] = 
Alright!
You win!
Let's be
friends!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_jigsawryenemy_slash_Step_0_gml_153_0")
;
157
        if (rr == 2)
158
            global.msg[0] = 
Friends?
I was thinking
the same
thing!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_jigsawryenemy_slash_Step_0_gml_154_0")
;
159
        if (rr == 3)
160
            global.msg[0] = 
... well,
if we HAVE
to be
friends...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_jigsawryenemy_slash_Step_0_gml_155_0")
;
161
        
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);
162
        actcon = 1;
163
    }
164
    if (acting == 3 && actcon == 0)
165
    {
166
        actcon = 1;
167
        global.msg[0] = 
* You and Ralsei warned Jigsawry 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_jigsawryenemy_slash_Step_0_gml_164_0")
;
168
        if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
169
            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_jigsawryenemy_slash_Step_0_gml_166_0")
;
170
        for (i = 0; i < 3; i += 1)
171
        {
172
            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_jigsawryenemy_slash_Step_0_gml_169_0")
;
173
            global.automiss[i] = 1;
174
        }
175
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
176
    }
177
    if (actcon == 1 && !instance_exists(obj_writer))
178
    {
179
        actcon = 0;
180
        
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();
} } }
();
181
    }
182
}
183
184
enum e__VW
185
{
186
    XView,
187
    YView,
188
    WView,
189
    HView,
190
    Angle,
191
    HBorder,
192
    VBorder,
193
    HSpeed,
194
    VSpeed,
195
    Object,
196
    Visible,
197
    XPort,
198
    YPort,
199
    WPort,
200
    HPort,
201
    Camera,
202
    SurfaceID
203
}