Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_endcombat

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

function scr_endcombat() { global.fighting = 0; if (global.specialbattle == 0 || global.specialbattle == 2 || global.specialbattle == 3) { if (global.specialbattle == 2) { with (obj_mainchara) { 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) scr_caterpillar_interpolate(); scr_pan_to_obj(obj_mainchara, 30); with (obj_mainchara) visible = 1; with (obj_caterpillarchara) visible = 1; } instance_create(0, 0, obj_endbattle); with (obj_monsterparent) instance_destroy(); with (obj_bulletparent) instance_destroy(); with (obj_heroparent) instance_destroy(); global.charinstance[0] = obj_mainchara; global.charinstance[1] = global.cinstance[0]; global.charinstance[2] = global.cinstance[1]; 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)
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)
25
                scr_caterpillar_interpolate
scr_caterpillar_interpolate

function scr_caterpillar_interpolate() { _newfacing = scr_facing_letter_to_number(scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y))); remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
26
            scr_pan_to_obj
scr_pan_to_obj

function scr_pan_to_obj(arg0, arg1) { _panx = arg0.x - floor((__view_get(e__VW.WView, 0) / 2) - (arg0.sprite_width / 2)); _pany = arg0.y - floor((__view_get(e__VW.HView, 0) / 2) - (arg0.sprite_height / 2)); if (_panx < 0) _panx = 0; if (_panx >= (room_width - __view_get(e__VW.WView, 0))) _panx = room_width - __view_get(e__VW.WView, 0); if (_pany < 0) _pany = 0; if (_pany >= (room_height - __view_get(e__VW.HView, 0))) _pany = room_height - __view_get(e__VW.HView, 0); scr_pan_lerp(_panx, _pany, arg1); } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(obj_mainchara, 30);
27
            with (obj_mainchara)
28
                visible = 1;
29
            with (obj_caterpillarchara)
30
                visible = 1;
31
        }
32
        instance_create(0, 0, obj_endbattle);
33
        with (obj_monsterparent)
34
            instance_destroy();
35
        with (obj_bulletparent)
36
            instance_destroy();
37
        with (obj_heroparent)
38
            instance_destroy();
39
        global.charinstance[0] = obj_mainchara;
40
        global.charinstance[1] = global.cinstance[0];
41
        global.charinstance[2] = global.cinstance[1];
42
        instance_destroy();
43
    }
44
}