Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_endcombat_ch1

(view raw script w/o annotations or w/e)
1
function scr_endcombat_ch1
scr_endcombat_ch1

function scr_endcombat_ch1() { global.fighting = 0; if (global.specialbattle == 0 || global.specialbattle == 2 || global.specialbattle == 3) { if (global.specialbattle == 2) { with (obj_mainchara_ch1) { cutscene = 1; x = global.charinstance[0].x; y = global.charinstance[0].y; } with (global.cinstance[0]) { x = global.charinstance[1].x; y = global.charinstance[1].y; } with (global.cinstance[1]) { x = global.charinstance[2].x; y = global.charinstance[2].y; } with (obj_caterpillarchara_ch1) scr_caterpillar_interpolate_ch1(); scr_pan_to_obj_ch1(obj_mainchara_ch1, 30); with (obj_mainchara_ch1) visible = 1; with (obj_caterpillarchara_ch1) visible = 1; } instance_create_ch1(0, 0, obj_endbattle_ch1); with (obj_monsterparent_ch1) instance_destroy(); with (obj_bulletparent_ch1) instance_destroy(); with (obj_heroparent_ch1) instance_destroy(); instance_destroy(); } }
()
2
{
3
    global.fighting = 0;
4
    if (global.specialbattle == 0 || global.specialbattle == 2 || global.specialbattle == 3)
5
    {
6
        if (global.specialbattle == 2)
7
        {
8
            with (obj_mainchara_ch1)
9
            {
10
                cutscene = 1;
11
                x = global.charinstance[0].x;
12
                y = global.charinstance[0].y;
13
            }
14
            with (global.cinstance[0])
15
            {
16
                x = global.charinstance[1].x;
17
                y = global.charinstance[1].y;
18
            }
19
            with (global.cinstance[1])
20
            {
21
                x = global.charinstance[2].x;
22
                y = global.charinstance[2].y;
23
            }
24
            with (obj_caterpillarchara_ch1)
25
                scr_caterpillar_interpolate_ch1
scr_caterpillar_interpolate_ch1

function scr_caterpillar_interpolate_ch1() { remx[0] = obj_mainchara_ch1.x; remy[0] = obj_mainchara_ch1.y; facing[0] = global.facing; for (i = target; i > 0; i -= 1) { facing[i] = 2; remx[i] = obj_mainchara_ch1.x + ((x - obj_mainchara_ch1.x) * (i / target)); remy[i] = obj_mainchara_ch1.y + ((y - obj_mainchara_ch1.y) * (i / target)); } }
();
26
            scr_pan_to_obj_ch1
scr_pan_to_obj_ch1

function scr_pan_to_obj_ch1(arg0, arg1) { _wd = arg0.x - floor((__view_get(e__VW.WView, 0) / 2) - (arg0.sprite_width / 2)); _ht = arg0.y - floor((__view_get(e__VW.HView, 0) / 2) - (arg0.sprite_height / 2)); _vx = _wd; _vy = _ht; if (_vx < 0) _vx = 0; if (_vx > (room_width - _vx)) _vx = room_width - _vx; if (_vy < 0) _vy = 0; if (_vy > (room_height - __view_get(e__VW.HView, 0))) _vy = room_height - __view_get(e__VW.HView, 0); scr_pan_ch1((_vx - __view_get(e__VW.XView, 0)) / arg1, (_vy - __view_get(e__VW.YView, 0)) / arg1, arg1); } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(obj_mainchara_ch1, 30);
27
            with (obj_mainchara_ch1)
28
                visible = 1;
29
            with (obj_caterpillarchara_ch1)
30
                visible = 1;
31
        }
32
        instance_create_ch1(0, 0, obj_endbattle_ch1);
33
        with (obj_monsterparent_ch1)
34
            instance_destroy();
35
        with (obj_bulletparent_ch1)
36
            instance_destroy();
37
        with (obj_heroparent_ch1)
38
            instance_destroy();
39
        instance_destroy();
40
    }
41
}