Deltarune (Chapter 1) 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(); 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()
{ remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = global.facing; for (i = target; i > 0; i -= 1) { facing[i] = 2; remx[i] = obj_mainchara.x + ((x - obj_mainchara.x) * (i / target)); remy[i] = obj_mainchara.y + ((y - obj_mainchara.y) * (i / target)); } }
();
26
            
scr_pan_to_obj
scr_pan_to_obj

function
scr_pan_to_obj(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((_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, 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
        instance_destroy();
40
    }
41
}