Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_gameover

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

function scr_gameover() { if (global.chapter == 2) { if (room == room_dw_mansion_b_west_2f) global.tempflag[33]++; if (room == room_dw_mansion_east_4f_d && i_ex(obj_queen_enemy)) { global.hp[1] = global.maxhp[1]; global.hp[2] = global.maxhp[2]; global.hp[3] = global.maxhp[3]; scr_tempsave(); } if (i_ex(obj_spamton_neo_enemy)) global.tempflag[37]++; } if (global.flag[35 gameover_mode] == 0) { audio_stop_all(); snd_play(snd_hurt1); global.screenshot = sprite_create_from_surface(application_surface, 0, 0, __view_get(e__VW.WView, 0), __view_get(e__VW.HView, 0), 0, 0, 0, 0); snd_free_all(); room_goto(room_gameover ); } if (global.flag[35 gameover_mode] == 1) { global.turntimer = -1; global.flag[36 dojo_failure] = 1; global.flag[39 dojo_abort?] = 1; } if (global.flag[35 gameover_mode] == 2) { audio_stop_all(); snd_play(snd_hurt1); snd_free_all(); global.entrance = 0; global.tempflag[9] = 1; global.fighting = 0; global.interact = 0; global.hp[0] = 1; global.hp[1] = 1; global.hp[2] = 1; global.hp[3] = 1; __room = room; if (global.chapter == 2) { with (instance_create(0, 0, obj_persistentfadein)) image_alpha = 1.2; } room_goto(__room); } } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
()
2
{
3
    if (global.chapter == 2)
4
    {
5
        if (room == room_dw_mansion_b_west_2f)
6
            global.tempflag[33]++;
7
        if (room == room_dw_mansion_east_4f_d && i_ex(obj_queen_enemy))
8
        {
9
            global.hp[1] = global.maxhp[1];
10
            global.hp[2] = global.maxhp[2];
11
            global.hp[3] = global.maxhp[3];
12
            scr_tempsave
scr_tempsave

function scr_tempsave() { filechoicebk2 = global.filechoice; global.filechoice = 9; var is_valid = scr_saveprocess(global.filechoice); global.filechoice = filechoicebk2; if (!is_valid) { var error_message = instance_create(0, 0, obj_savedata_error); error_message.error_type = "temp_save_failed"; if (room != PLACE_MENU) error_message.type = "auto"; } return is_valid; }
();
13
        }
14
        if (i_ex(obj_spamton_neo_enemy))
15
            global.tempflag[37]++;
16
    }
17
    if (global.flag[35 gameover_mode] == 0)
18
    {
19
        audio_stop_all();
20
        snd_play(snd_hurt1);
21
        global.screenshot = sprite_create_from_surface(application_surface, 0, 0, __view_get(e__VW.WView, 0), __view_get(e__VW.HView, 0), 0, 0, 0, 0);
22
        snd_free_all();
23
        room_goto(room_gameover );
24
    }
25
    if (global.flag[35 gameover_mode] == 1)
26
    {
27
        global.turntimer = -1;
28
        global.flag[36 dojo_failure] = 1;
29
        global.flag[39 dojo_abort?] = 1;
30
    }
31
    if (global.flag[35 gameover_mode] == 2)
32
    {
33
        audio_stop_all();
34
        snd_play(snd_hurt1);
35
        snd_free_all();
36
        global.entrance = 0;
37
        global.tempflag[9] = 1;
38
        global.fighting = 0;
39
        global.interact = 0;
40
        global.hp[0] = 1;
41
        global.hp[1] = 1;
42
        global.hp[2] = 1;
43
        global.hp[3] = 1;
44
        __room = room;
45
        if (global.chapter == 2)
46
        {
47
            with (instance_create(0, 0, obj_persistentfadein))
48
                image_alpha = 1.2;
49
        }
50
        room_goto(__room);
51
    }
52
}
53
54
enum e__VW
55
{
56
    XView,
57
    YView,
58
    WView,
59
    HView,
60
    Angle,
61
    HBorder,
62
    VBorder,
63
    HSpeed,
64
    VSpeed,
65
    Object,
66
    Visible,
67
    XPort,
68
    YPort,
69
    WPort,
70
    HPort,
71
    Camera,
72
    SurfaceID
73
}