Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_encounterbasic_Create_0

(view raw script w/o annotations or w/e)
1
global.interact = 2;
2
if (global.flag[9 battle_music] == 1)
3
    snd_volume(global.currentsong[1], 0, 20);
4
scr_encountersetup
scr_encountersetup

function
scr_encountersetup(arg0)
{ xx = __view_get(e__VW.XView, 0); yy = __view_get(e__VW.YView, 0); for (i = 0; i < 3; i += 1) { global.heromakex[i] = xx + 80; global.heromakey[i] = yy + 50 + (80 * i); global.monsterinstancetype[i] = obj_baseenemy; global.monstertype[i] = 1Enemy (placeholder/G-BODY); global.monstermakex[i] = xx + 500 + (20 * i); global.monstermakey[i] = yy + 40 + (90 * i); } global.monstertype[1] = 0(None); global.monstertype[2] = 0(None); if (global.char[0] != 0 && global.char[1] == 0 && global.char[2] == 0) global.heromakey[0] = yy + 140; if (global.char[0] != 0 && global.char[1] != 0 && global.char[2] == 0) { global.heromakey[0] = yy + 100; global.heromakey[1] = yy + 180; } global.battlemsg[0] = stringsetloc(
* It is known.
"* It is known.", "scr_encountersetup_slash_scr_encountersetup_gml_34_0"
);
switch (arg0) { case 0: break; case 1: global.monsterinstancetype[0] = obj_baseenemy; global.monstertype[0] = 1Enemy (placeholder/G-BODY); global.monstermakex[0] = xx + 480; global.monstermakey[0] = yy + 110; global.monsterinstancetype[1] = obj_baseenemy; global.monstertype[1] = 1Enemy (placeholder/G-BODY); global.monstermakex[1] = xx + 500; global.monstermakey[1] = yy + 200; global.monstertype[2] = 0(None); global.battlemsg[0] = stringsetloc(
* Test enemies showed up.
"* Test enemies showed up.", "scr_encountersetup_slash_scr_encountersetup_gml_60_0"
);
break; case 2: global.monsterinstancetype[0] = obj_lancerboss; global.monstertype[0] = 2Lancer; global.monstermakex[0] = xx + 540; global.monstermakey[0] = yy + 200; global.monstertype[1] = 0(None); global.monstertype[2] = 0(None); break; case 3: global.monsterinstancetype[0] = obj_dummyenemy; global.monstertype[0] = 3Dummy; global.monstermakex[0] = xx + 500; global.monstermakey[0] = yy + 160; if (instance_exists(obj_npc_room)) { global.monstermakex[0] = obj_npc_room.xstart; global.monstermakey[0] = obj_npc_room.ystart; } global.monstertype[1] = 0(None); global.monstertype[2] = 0(None); break; case 4: global.monsterinstancetype[0] = obj_diamondenemy; global.monstertype[0] = 5Rudinn; global.monstermakex[0] = xx + 480; global.monstermakey[0] = yy + 140; global.monstertype[1] = 0(None); global.monstertype[2] = 0(None); global.battlemsg[0] = stringsetloc(
* Rudinn drew near!
"* Rudinn drew near!", "scr_encountersetup_slash_scr_encountersetup_gml_98_0"
);
if (global.flag[500 times_rudinn_fought] >= 1) global.battlemsg[0] = stringsetloc(
* A different Rudinn from last time drew near!
"* A different Rudinn from last time drew near!", "scr_encountersetup_slash_scr_encountersetup_gml_99_0"
);
if (global.flag[500 times_rudinn_fought] == 2) global.battlemsg[0] = stringsetloc(
* Assumedly another different Rudinn appeared!
"* Assumedly another different Rudinn appeared!", "scr_encountersetup_slash_scr_encountersetup_gml_100_0"
);
break; case 5: global.monsterinstancetype[0] = obj_diamondenemy; global.monstertype[0] = 5Rudinn; global.monstermakex[0] = xx + 480; global.monstermakey[0] = yy + 110; global.monsterinstancetype[1] = obj_diamondenemy; global.monstertype[1] = 5Rudinn; global.monstermakex[1] = xx + 500; global.monstermakey[1] = yy + 200; global.monstertype[2] = 0(None); global.battlemsg[0] = stringsetloc(
* A necklace of Rudinns blocks your path.
"* A necklace of Rudinns blocks your path.", "scr_encountersetup_slash_scr_encountersetup_gml_116_0"
);
break; case 6: global.monsterinstancetype[0] = obj_diamondenemy; global.monstertype[0] = 5Rudinn; global.monstermakex[0] = xx + 480; global.monstermakey[0] = yy + 110; global.monsterinstancetype[1] = obj_heartenemy; global.monstertype[1] = 6Hathy; global.monstermakex[1] = xx + 500; global.monstermakey[1] = yy + 200; global.monstertype[2] = 0(None); global.battlemsg[0] = stringsetloc(
* Rudinn and Hathy blocked the way!
"* Rudinn and Hathy blocked the way!", "scr_encountersetup_slash_scr_encountersetup_gml_132_0"
);
break; case 7: global.monsterinstancetype[0] = obj_smallcheckers_enemy; global.monstertype[0] = 9C.Round; global.monstermakex[0] = xx + 440; ...
(global.encounterno);
5
with (obj_mainchara)
6
    visible = 0;
7
with (global.cinstance[0])
8
    visible = 0;
9
with (global.cinstance[1])
10
    visible = 0;
11
with (obj_mainchara)
12
    fun = 0;
13
with (obj_caterpillarchara)
14
    fun = 0;
15
count = 0;
16
c[0] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(obj_mainchara.x, obj_mainchara.y, spr_kris_sword_jump_down);
17
if (i_ex(global.cinstance[0]))
18
{
19
    count += 1;
20
    c[1] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(global.cinstance[0].x, global.cinstance[0].y, global.cinstance[0].rsprite);
21
    if (global.cinstance[0].rsprite == spr_susier_dark)
22
        c[1].sprite_index = spr_susier_wall;
23
    if (global.cinstance[0].name == "noelle")
24
    {
25
        var _sideb = 
scr_sideb_get_phase
scr_sideb_get_phase

function
scr_sideb_get_phase()
{ var phase = 0; if (global.flag[916 snowgrave_fail] == 0) { if (global.flag[915 snowgrave_plot] > 0 && global.flag[915 snowgrave_plot] < 4) phase = 1; if (global.flag[915 snowgrave_plot] >= 4 && global.flag[915 snowgrave_plot] < 7) phase = 2; if (global.flag[915 snowgrave_plot] >= 7 && global.flag[915 snowgrave_plot] < 20) phase = 3; if (global.flag[915 snowgrave_plot] >= 20) phase = 4; } return phase; }
();
26
        c[1].sprite_index = spr_noelleb_battleintro;
27
        if (_sideb >= 2)
28
            c[1].sprite_index = spr_noelleb_battleintro_sideb;
29
        c[1].image_speed = 0.5;
30
    }
31
}
32
if (i_ex(global.cinstance[1]))
33
{
34
    count += 1;
35
    c[2] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(global.cinstance[1].x, global.cinstance[1].y, global.cinstance[1].rsprite);
36
    if (global.cinstance[1].rsprite == spr_susier_dark)
37
        c[2].sprite_index = spr_susier_wall;
38
    if (global.cinstance[1].name == "noelle")
39
    {
40
        c[2].sprite_index = spr_noelleb_battleintro;
41
        c[2].image_speed = 0.5;
42
    }
43
}
44
for (i = 0; i < (count + 1); i += 1)
45
{
46
    c[i].direction = point_direction(c[i].x, c[i].y, global.heromakex[i], global.heromakey[i]);
47
    c[i].speed = point_distance(c[i].x, c[i].y, global.heromakex[i], global.heromakey[i]) / 10;
48
    c[i].depth = 200 - (i * 20);
49
}
50
fightcon = 1;
51
counttimer = 0;