Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_berdly_encounter_setup_Step_0

(view raw script w/o annotations or w/e)
1
if (fightcon == 2)
2
{
3
    counttimer += 1;
4
    if (counttimer == 1)
5
    {
6
        instance_create(x, y, o_berdly_hide_intro_markers);
7
        global.specialbattle = 3;
8
        global.encounterno = 58;
9
        encounterflag = 529;
10
        global.flag[54 encounter_pointer] = encounterflag;
11
        
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);
12
        if (global.flag[9 battle_music] != 2)
13
        {
14
            global.flag[9 battle_music] = 1;
15
            global.batmusic[0] = snd_init("berdly_chase.ogg");
16
        }
17
        global.interact = 2;
18
        if (global.flag[9 battle_music] == 1)
19
            snd_volume(global.currentsong[1], 0, 20);
20
        with (obj_mainchara)
21
            visible = 0;
22
        with (global.cinstance[0])
23
            visible = 0;
24
        with (global.cinstance[1])
25
            visible = 0;
26
        with (obj_mainchara)
27
            fun = 0;
28
        with (obj_caterpillarchara)
29
            fun = 0;
30
        wp = snd_play(snd_impact);
31
        snd_volume(wp, 0.7, 0);
32
        wp2 = snd_play(snd_weaponpull_fast);
33
        snd_volume(wp2, 0.8, 0);
34
        with (obj_ch2_scene11a)
35
        {
36
            with (coaster_kris)
37
            {
38
                stop_siner = 1;
39
                con = 1;
40
                character_sprite = spr_krisb_attack;
41
                actor.sprite_index = spr_krisb_attack;
42
            }
43
            with (coaster_susie)
44
            {
45
                stop_siner = 1;
46
                con = 1;
47
                character_sprite = spr_susieb_attack;
48
                actor.sprite_index = spr_susieb_attack;
49
                if (global.charweapon[global.char[2]] == 0)
50
                    character_sprite = spr_susieb_attack_unarmed;
51
            }
52
            with (coaster_ralsei)
53
            {
54
                stop_siner = 1;
55
                con = 1;
56
                character_sprite = spr_ralsei_battleintro;
57
                actor.sprite_index = spr_ralsei_battleintro;
58
            }
59
            with (coaster_berdly)
60
                stop_siner = 1;
61
        }
62
    }
63
    if (counttimer >= 20)
64
    {
65
        counttimer = 0;
66
        fightcon = 3;
67
        instance_create(0, 0, obj_battlecontroller);
68
        with (obj_heroparent)
69
            visible = false;
70
        instance_destroy();
71
    }
72
}