Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2s_swordmanager_Step_0

(view raw script w/o annotations or w/e)
1
if (kris == 0)
2
{
3
    with (obj_mainchara_board)
4
        other.kris = id;
5
}
6
if (con == 0)
7
{
8
    obj_gameshow_swordroute.drawui = false;
9
    global.interact = 1;
10
    obj_mainchara_board.facing = 2;
11
    timer = 0;
12
    con = 1;
13
}
14
if (con == 1)
15
{
16
    timer++;
17
    if (timer == 1)
18
    {
19
        var steps = 8;
20
        var delay = 15;
21
        for (var i = 0; i < steps; i++)
22
        {
23
            with (obj_gameshow_swordroute)
24
                scr_delay_var("screencolor", merge_color(c_black, #E2FF81, i / steps), delay * (i - 1));
25
        }
26
    }
27
    if (timer == 60)
28
    {
29
        transition.active = true;
30
        timer = 0;
31
        con = 2;
32
    }
33
}
34
if (con == 2)
35
{
36
    if (transition.completed == true)
37
    {
38
        snd_free_all();
39
        
scr_musicer
scr_musicer

function
scr_musicer(arg0 = "dogcheck.ogg", arg1 = 0.7, arg2 = 1, arg3 = 0, arg4 = -1)
{ var musicer = instance_create_depth(0, 0, 0, obj_musicer_gen); musicer.song = arg0; musicer.volume = arg1; musicer.pitch = arg2; musicer.delay = arg3; musicer.fadein = arg4; return musicer; }
("board_ocean.ogg");
40
        global.interact = 0;
41
        obj_mainchara_board.facing = 0;
42
        obj_gameshow_swordroute.drawui = true;
43
        obj_gameshow_swordroute.skip = false;
44
        con++;
45
    }
46
}
47
if (con == 10)
48
    
scr_board_sword_repeat
scr_board_sword_repeat

function
scr_board_sword_repeat()
{ timer++; if (timer == 1) { with (obj_board_squaretransition) instance_destroy(); obj_mainchara_board.facing = 2; global.interact = 1; with (instance_create(board_tilex(0), board_tiley(-1), obj_puzzlecloset_tvturnon)) { width = 384; height = 288; } } if (timer == 15) { if (room == room_board_1_sword || room == room_board_2_sword || room == room_board_3_sword)
scr_musicer("board_ocean.ogg", 1, undefined, undefined, 60);
with (obj_puzzlecloset_tvturnon) turnon = true; snd = snd_play_x(snd_tv_poweron, 0.4, 0.5); snd_volume(snd, 0, 15); snd = snd_play_x(snd_tv_poweron, 0.6, 2); snd_volume(snd, 0, 15); } if (timer == 18) { with (obj_board_screenColorChanger) { if (x >= 128 && x <= 512 && y >= 64 && y <= 320) { init = 0; force = 8; active = 1; roomstart = 60; } } } if (timer < 30) global.interact = 1; if (timer == 30) { global.swordboardeath = 0; global.interact = 0; con++; } }
();
49
if (obj_board_controller.violence == false)
50
{
51
    if (kris.xp > 0)
52
        obj_board_controller.violence = true;
53
}
54
if (scon == 0)
55
{
56
    obj_board_controller.violence = false;
57
    if (kris.sword == true)
58
    {
59
        scon = 1;
60
        obj_board_controller.violence = true;
61
    }
62
}
63
if (scon == 1)
64
{
65
    if (kris.swordlv == 2)
66
    {
67
        scon = -1;
68
        scr_delay_var("scon", 1.9, 30);
69
        snd_volume(global.currentsong[1], 0, 30);
70
    }
71
}
72
if (scon == 1.9)
73
{
74
    snd_stop(global.currentsong[1]);
75
    mus_initloop("board_ocean.ogg");
76
    scon = 2;
77
}