Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_tree_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (changetree)
4
        sprite_index = treeoverride;
5
    if (image_blend == c_blue)
6
        image_blend = c_white;
7
    init = 1;
8
}
9
if (wither == 1)
10
{
11
    wither = 2;
12
    sprite_index = spr_board_tree_withered;
13
    dir = 0;
14
}
15
if (active)
16
{
17
    if (sndbuff > 0)
18
        sndbuff--;
19
    if (instance_exists(obj_board_swordhitbox))
20
    {
21
        if (place_meeting(x, y, obj_board_swordhitbox))
22
        {
23
            var sword = instance_place(x, y, obj_board_swordhitbox);
24
            if (sword.swordlv > defense)
25
            {
26
                instance_create(centerx(), centery(), obj_board_enemydefeatsplash);
27
                if (y == 64 && obj_board_swordhitbox.facing == 2)
28
                {
29
                    var extratree = instance_place(x, y - 32, object_index);
30
                    if (i_ex(extratree))
31
                    {
32
                        with (extratree)
33
                            instance_destroy();
34
                        debug_message("killed extra tree");
35
                    }
36
                }
37
                if (y == 288 && obj_board_swordhitbox.facing == 0)
38
                {
39
                    var extratree = instance_place(x, y + 32, object_index);
40
                    if (i_ex(extratree))
41
                    {
42
                        with (extratree)
43
                            instance_destroy();
44
                        debug_message("killed extra tree");
45
                    }
46
                }
47
                if (x == 480 && obj_board_swordhitbox.facing == 1)
48
                {
49
                    var extratree = instance_place(x + 32, y, object_index);
50
                    if (i_ex(extratree))
51
                    {
52
                        with (extratree)
53
                            instance_destroy();
54
                        debug_message("killed extra tree");
55
                    }
56
                }
57
                if (x == 128 && obj_board_swordhitbox.facing == 3)
58
                {
59
                    var extratree = instance_place(x - 32, y, object_index);
60
                    if (i_ex(extratree))
61
                    {
62
                        with (extratree)
63
                            instance_destroy();
64
                        debug_message("killed extra tree");
65
                    }
66
                }
67
                instance_destroy();
68
            }
69
            else if (sndbuff <= 0)
70
            {
71
                snd_stop(snd_board_sword_metal);
72
                snd_play(snd_board_sword_metal);
73
                sndbuff = 10;
74
            }
75
        }
76
    }
77
    if (room == room_board_dungeon_2)
78
    {
79
        if (instance_exists(obj_board_enemy_deer_ice_spell))
80
        {
81
            if (place_meeting(x, y, obj_board_enemy_deer_ice_spell))
82
            {
83
                snd_stop(snd_board_splash);
84
                snd_play(snd_board_splash);
85
                block = instance_create(x, y, obj_pushableblock_board);
86
                block.sprite_index = spr_board_pushableblock_ice;
87
                block.custom_sprite = spr_board_pushableblock_ice;
88
                block.image_xscale = 1;
89
                block.image_yscale = 1;
90
                var x_cell = floor(block.x / global.cell_size);
91
                var y_cell = floor((block.y + 18) / global.cell_size);
92
                var position_x = (x_cell * global.cell_size) + (global.cell_size / 2);
93
                var position_y = (y_cell * global.cell_size) + (global.cell_size / 2);
94
                block.x = position_x - 16;
95
                block.y = position_y - 16;
96
                var count = 6;
97
                for (var i = 0; i < count; i++)
98
                {
99
                    var fx = 
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; }
((block.x + 16) - 2, (block.y + 16) - 2, spr_board_snowflake, 0.3, 100000, 2);
100
                    fx.direction = ((360 / count) * i) + 45;
101
                    fx.speed = 8;
102
                    fx.friction = 0.6;
103
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(fx, 10);
104
                    fx = 
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; }
((block.x + 16) - 2, (block.y + 16) - 2, spr_board_snowflake, 0.3, 100000, 2);
105
                    fx.direction = (360 / count) * i;
106
                    fx.speed = 4;
107
                    fx.friction = 0.3;
108
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(fx, 10);
109
                }
110
                instance_destroy();
111
            }
112
        }
113
    }
114
}
115
image_speed = remspeed;
116
if (obj_board_camera.con != 0 || global.interact == 1)
117
    image_speed = 0;