Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_darkfruit_tree_plat_Create_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
image_speed = 0;
3
branch = instance_create(x, y, obj_ralsei_hook);
4
with (branch)
5
{
6
    sprite_index = spr_darkfruit_tree_big_branch;
7
    depth = other.depth - 1;
8
    menu_name = stringsetloc(
Hang (Branch)
"Hang (Branch)", "obj_darkfruit_tree_plat_slash_Create_0_gml_11_0"
);
9
    owner = other;
10
    image_xscale = other.image_xscale;
11
    image_yscale = other.image_yscale;
12
    hang_xoffset = 116 * image_xscale;
13
    hang_yoffset = 78 * image_xscale;
14
    can_cut_down = false;
15
}
16
_ROOM_STATE_FLAG = 1442;
17
_TREE_SMASHED_BIT = 3;
18
init = false;
19
slope = -4;
20
state = 0;
21
timer = 0;
22
fruits = [];
23
targeted_fruit = -4;
24
fruits_hit = scr_flag_get_ext(_ROOM_STATE_FLAG, 4) + scr_flag_get_ext(_ROOM_STATE_FLAG, 5) + scr_flag_get_ext(_ROOM_STATE_FLAG, 6);
25
physics = 0;
26
entity_gravity = 0;
27
collision = 0;
28
for (var i = 0; i < 3; i++)
29
{
30
    if (scr_flag_get_ext(_ROOM_STATE_FLAG, i + 4) == 1)
31
    {
32
        fruits[i] = -4;
33
    }
34
    else
35
    {
36
        fruits[i] = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(x, y, spr_fruittree_fruits);
37
        with (fruits[i])
38
        {
39
            flag = other._ROOM_STATE_FLAG;
40
            bit = i + 4;
41
            depth = other.depth - 1;
42
            image_xscale = other.image_xscale;
43
            image_yscale = other.image_yscale;
44
            state = 1;
45
            owner = other;
46
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
47
            image_index = i;
48
            image_speed = 0;
49
            
50
            fruitblast = function()
51
            {
52
                scr_flag_set_ext(flag, bit, 1);
53
                owner.targeted_fruit = self;
54
                if (obj_darkfruit_tree_plat.fruits_hit == 0)
55
                {
56
                    
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; if (global.darkzone == 1) global.typer = 89; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("susie");
57
                    msgsetsubloc(0, "\\E9* Heh^1, check it!", (global.lang == "ja") ? stringset("&\t\t\t") : stringset("&"), "obj_darkfruit_tree_plat_slash_Create_0_gml_59_0");
58
                    d_make_plat(0, 6);
59
                    scr_plat_susie_attack(self, false);
60
                }
61
                else
62
                {
63
                    scr_plat_susie_attack_fast(self, false);
64
                }
65
            };
66
            
67
            
scr_configure_platmode_act
scr_configure_platmode_act

function
scr_configure_platmode_act(arg0, arg1, arg2, arg3)
{ var helper = instance_create(x, y, obj_plat_targethelper); helper.owner = self; helper.effect = arg0; helper.char = arg1; helper.objectname = arg2; helper.description = arg3; if (!variable_instance_exists(id, "__plat_acts")) __plat_acts = []; array_push(__plat_acts, helper); return helper; } function scr_set_platmode_act_active(arg0, arg1 = "*") { if (variable_instance_exists(id, "__plat_acts")) { for (var i = 0; i < array_length(__plat_acts); i++) { if (arg1 == "*" || __plat_acts.char == arg1) active = arg0; } } } function scr_destroy_platmode_act() { if (variable_instance_exists(id, "__plat_acts")) { for (var i = 0; i < array_length(__plat_acts); i++) { with (__plat_acts[i]) instance_destroy(); } } }
(fruitblast, "su", stringsetloc(
Fruitbuster
"Fruitbuster", "obj_darkfruit_tree_plat_slash_Create_0_gml_67_0"
), stringsetloc(
Leave the fruit to me.
"Leave the fruit to me.", "obj_darkfruit_tree_plat_slash_Create_0_gml_68_0"
));
68
        }
69
    }
70
}
71
72
wreck_tree = function()
73
{
74
    for (var i = 0; i < 48; i++)
75
    {
76
        var bl = instance_create(x + (random_range(0.4, 0.6) * sprite_width), y + (random_range(0.15, 0.25) * sprite_height), obj_marker);
77
        with (bl)
78
        {
79
            sprite_index = choose(spr_bush_leaf_big, spr_bush_leaf2_big, spr_bush_leaf3_big, spr_bush_leaf, spr_bush_leaf2, spr_bush_leaf3);
80
            image_index = random_range(0, 99);
81
            hspeed = random_range(-15, 15);
82
            vspeed = random_range(-15, 15);
83
            image_blend = c_purple;
84
            image_speed = 0.3;
85
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
86
            var t = random_range(30, 120);
87
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_alpha", 1, 0, t);
88
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("hspeed", hspeed, 0, t, 7, "out");
89
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("vspeed", vspeed, 0, t, 7, "out");
90
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] target = arg0; } return _doom; }
(self, t);
91
        }
92
    }
93
    sprite_index = spr_darkfruit_tree_big_top_noleaves;
94
    with (branch)
95
        instance_destroy();
96
    scr_plat_depthcast();
97
    var stump = instance_create_depth(x, y, depth + 100, obj_marker);
98
    stump.sprite_index = spr_darkfruit_tree_big_bottom;
99
    stump.image_xscale = image_xscale;
100
    stump.image_yscale = image_yscale;
101
    state = 1;
102
    x += 160;
103
    y += 270;
104
};
105
106
fruitoffsets = [];
107
fruitoffsets[0] = [56, 14];
108
fruitoffsets[1] = [22, 36];
109
fruitoffsets[2] = [94, 24];