Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3s_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 (init == 0)
7
{
8
    if (i_ex(kris))
9
    {
10
        init = 1;
11
        global.flag[1055 sword_route_progress] = 3;
12
        if (global.plot < 180)
13
            global.plot = 180;
14
        global.interact = 1;
15
        obj_mainchara_board.facing = 0;
16
        var xpos = obj_mainchara_board.x;
17
        var ypos = obj_mainchara_board.y;
18
        susie = instance_create(xpos, ypos, obj_board_caterpillarchara);
19
        ralsei = instance_create(xpos, ypos, obj_board_caterpillarchara);
20
        ralsei.name = "ralsei";
21
        ralsei.facing = 0;
22
        susie.facing = 0;
23
        with (obj_board_caterpillarchara)
24
            
scr_board_b3s_interpolatecaterpillarchara
scr_board_b3s_interpolatecaterpillarchara

function
scr_board_b3s_interpolatecaterpillarchara()
{ if (i_ex(obj_mainchara_board)) { var xpos = obj_mainchara_board.x; var ypos = obj_mainchara_board.y; for (var i = 0; i < 75; i += 1) { remx[i] = x; remy[i] = y; facing[i] = 0; } var _newfacing; if (x != xpos && y != ypos) _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara_board.x, obj_mainchara_board.y)));
else _newfacing = obj_mainchara_board.facing; remx[0] = xpos; remy[0] = ypos; facing[0] = _newfacing; for (var _iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(xpos, x, _iaia / target); remy[_iaia] = lerp(ypos, y, _iaia / target); facing[_iaia] = _newfacing; } } else { return 0; } }
();
25
    }
26
}
27
if (con == 0)
28
{
29
    timer = 0;
30
    con = 1;
31
}
32
if (con == 1)
33
{
34
    timer++;
35
    if (timer == 1)
36
    {
37
        var steps = 8;
38
        var delay = 15;
39
        for (var i = 0; i < steps; i++)
40
        {
41
            with (obj_gameshow_swordroute)
42
                scr_delay_var("screencolor", merge_color(c_black, #4DAFFF, i / steps), delay * (i - 1));
43
        }
44
    }
45
    if (timer == 60)
46
    {
47
        transition.active = true;
48
        timer = 0;
49
        con = 2;
50
    }
51
}
52
if (con == 2)
53
{
54
    if (transition.completed == true)
55
    {
56
        global.currentsong[0] = snd_init("board_ocean.ogg");
57
        global.currentsong[1] = mus_loop_ext(global.currentsong[0], 1, 1);
58
        mus_volume(global.currentsong[1], 0, 0);
59
        mus_volume(global.currentsong[1], 1, 60);
60
        global.interact = 0;
61
        obj_mainchara_board.facing = 0;
62
        obj_gameshow_swordroute.drawui = true;
63
        obj_gameshow_swordroute.skip = false;
64
        con++;
65
    }
66
}
67
if (con == 10)
68
    
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++; } }
();
69
if (kpause == 1)
70
{
71
    global.interact = 1;
72
    ktimer++;
73
    if (ktimer == 1)
74
    {
75
        
scr_shakeobj_ext
scr_shakeobj_ext

function
scr_shakeobj_ext()
{ var _shakeobj = instance_create(x, y, obj_shakeobj_ext); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakexamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakeyamt = argument2; } if (argument_count >= 4) { if (argument3 != -1) _shakeobj.shakereduct = argument3; } if (argument_count >= 5) { if (argument4 != -1) _shakeobj.shakespeed = argument4; } with (_shakeobj) event_user(0); }
(1185, 4, 0);
76
        obj_mainchara.sprite_index = spr_krisu_holdcontroller_slightright;
77
    }
78
    if (ktimer == 30)
79
    {
80
        obj_mainchara.sprite_index = spr_krisu_holdcontroller;
81
        global.interact = 0;
82
        ktimer = 0;
83
        kpause = 0;
84
    }
85
}
86
if (con != 999)
87
{
88
    var trig = 0;
89
    with (obj_board_trigger)
90
    {
91
        if (
scr_onscreen
scr_onscreen

function
scr_onscreen(arg0)
{ obj = arg0; spacer = 0; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id))
92
        {
93
            if (place_meeting(x, y, obj_mainchara_board))
94
                trig = true;
95
        }
96
    }
97
    if (trig)
98
    {
99
        timer = 0;
100
        con = 999;
101
    }
102
}
103
if (con == 999)
104
{
105
    timer++;
106
    if (timer == 1)
107
    {
108
        global.interact = 1;
109
        snd_play(snd_board_escaped);
110
        marker = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(board_tilex(0), board_tiley(0), spr_pxwhite, 0, 900000, 640);
111
        marker.image_blend = c_black;
112
        marker.image_alpha = 0;
113
        mus_volume(global.currentsong[1], 0, 50);
114
    }
115
    var count = 5;
116
    for (var i = 1; i < (count + 1); i++)
117
    {
118
        if (timer == (10 * i))
119
        {
120
            obj_gameshow_swordroute.screencolor = merge_color(#003CCE, c_black, i / count);
121
            marker.image_alpha = i / count;
122
        }
123
    }
124
    if (timer == (10 * (count + 1)))
125
    {
126
        obj_gameshow_swordroute.screencolor = c_black;
127
        global.swordscreencolor = c_black;
128
        global.interact = 0;
129
        global.flag[1055 sword_route_progress] = 4;
130
        room_goto(room_board_dungeon_3);
131
    }
132
}