Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_dw_garden_newdash_Create_0

related scripts: Alarm_0Create_0 Step_0

(view raw script w/o annotations or w/e)
1
layer_set_visible("NPCs", 0);
2
layer_set_visible("DEBUG_ASSETS", 0);
3
layer_set_visible("Water_Teaparty", 0);
4
con = 0;
5
timer = 0;
6
init = 0;
7
leafpileflag = 1384;
8
teabit = 15;
9
blocking_leaf_pile_index = 0;
10
bits_that_make_chest_appearable = [1, 2, 3, 4];
11
global.pre_hospital_room = 133;
12
global.pre_hospital_entrance = 1;
13
netskie_encounterflag = 1485;
14
for (var i = 1; i <= 8; i++)
15
{
16
    rocks[i] = instance_create(0, 0, obj_rock3d);
17
    var fox = instance_create(x, y, obj_dw_garden_secretfox);
18
    fox.assign_target(rocks[i]);
19
}
20
21
add_bottom_chest = function()
22
{
23
    var could_spawn = false;
24
    for (var i = 0; i < array_length(bits_that_make_chest_appearable); i++)
25
    {
26
        if (scr_get_bitmask_value(global.flag[leafpileflag], bits_that_make_chest_appearable[i], 1) == 1)
27
        {
28
            could_spawn = true;
29
            break;
30
        }
31
    }
32
    if (!could_spawn)
33
        exit;
34
    if (scr_get_bitmask_value(global.flag[leafpileflag], blocking_leaf_pile_index, 1) == 0)
35
        exit;
36
    con = 1;
37
    var treasure_has_tail = false;
38
    if (global.flag[netskie_encounterflag] > 1)
39
    {
40
        con = 2.1;
41
        treasure_has_tail = true;
42
    }
43
    var ne_flag = netskie_encounterflag;
44
    with (scr_genmarker("netskie"))
45
    {
46
        with (instance_create(x, y, obj_treasure_fox))
47
        {
48
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
49
            has_tail = treasure_has_tail;
50
            encounterflag = ne_flag;
51
        }
52
    }
53
};
54
55
show_water_teaparty = function()
56
{
57
    var lay = layer_get_id("Water_Teaparty");
58
    if (!layer_get_visible(lay))
59
    {
60
        layer_set_visible(lay, true);
61
        var flora = scr_makenpc_fromasset(findsprite(spr_enemy_floradin_spared_water, "Water_Teaparty", c_red));
62
        flora.marker.image_blend = c_white;
63
        flora.issolid = false;
64
        
scr_setnpclogic
scr_setnpclogic

function
scr_setnpclogic(arg0, arg1, arg2)
{ if (arg0 == -4) {
scr_debug_print("Failed to add NPC logic");
exit; } if (arg0.marker.sprite_index == spr_debug_40x40) arg0.marker.visible = 0; with (instance_create(0, 0, obj_npc_wrapper)) { if (variable_struct_exists(arg1, "animspeed")) animspeed = arg1.animspeed; if (variable_struct_exists(arg1, "typer")) typer = arg1.typer; if (variable_struct_exists(arg1, "alwaysanimate")) alwaysanimate = arg1.alwaysanimate; npc = arg0; if (!variable_instance_exists(npc.id, "dialogue_side")) npc.dialogue_side = -1; setdialogue = arg2; choices = []; for (var i = 3; i < argument_count; i++) array_push(choices, argument[i]); } }
(flora, {}, function(arg0)
65
        {
66
            if (arg0)
67
            {
68
                
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; ...
("no_name");
69
                msgsetloc(0, 
* It's been so long since I last turned into a prune...Wait for input
"* It's been so long since I last turned into a prune.../", "obj_dw_garden_newdash_slash_Create_0_gml_55_0"
);
70
                msgnextloc(
* (talking to wrinkled fingers) what's new guys...Delay 11 hahaWait for inputClose Message
"* (talking to wrinkled fingers) what's new guys..^1. haha/%", "obj_dw_garden_newdash_slash_Create_0_gml_56_0"
);
71
            }
72
            else
73
            {
74
                
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; ...
("no_name");
75
                msgsetloc(0, 
* Thank you for freeing us.Wait for input
"* Thank you for freeing us./", "obj_dw_garden_newdash_slash_Create_0_gml_59_0"
);
76
                msgnextloc(
* We were stuck between those two dash gates for so long.Wait for input
"* We were stuck between those two dash gates for so long./", "obj_dw_garden_newdash_slash_Create_0_gml_60_0"
);
77
                msgnextloc(
* It's so much better being in the water.Wait for input
"* It's so much better being in the water./", "obj_dw_garden_newdash_slash_Create_0_gml_61_0"
);
78
                msgnextloc(
* It's wet and we like it.Wait for inputClose Message
"* It's wet and we like it./%", "obj_dw_garden_newdash_slash_Create_0_gml_62_0"
);
79
            }
80
        });
81
    }
82
};
83
84
if (scr_get_bitmask_value(global.flag[leafpileflag], teabit, 1) == 1)
85
{
86
    show_water_teaparty();
87
    con = 5;
88
    layer_set_visible(layer_get_id("Teaparty"), false);
89
}
90
91
knock_away = function(arg0, arg1)
92
{
93
    global.interact = 1;
94
    alarm[0]
 = 3;
gml_Object_obj_dw_garden_newdash_Alarm_0.gml

global.interact = 0;
95
    show_water_teaparty();
96
    global.flag[leafpileflag] = scr_set_bitmask_value(global.flag[leafpileflag], teabit, 1, 1);
97
    if (layer_get_element_type(arg1) == 4)
98
    {
99
        var _x = layer_sprite_get_x(arg1);
100
        var _y = layer_sprite_get_y(arg1);
101
        var _spr = layer_sprite_get_sprite(arg1);
102
        with (instance_create(_x, _y, obj_marker_fancy))
103
        {
104
            depth = layer_get_depth(arg0);
105
            sprite_index = _spr;
106
            image_index = layer_sprite_get_index(arg1);
107
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
108
            hspeed = random_range(18, 24);
109
            friction = 0.3;
110
            gravity = 1;
111
            vspeed = random_range(-16, -12);
112
            image_angle = layer_sprite_get_angle(arg1);
113
            rotation_speed = random_range(16, 24);
114
            offx = (sprite_get_width(sprite_index) * 0.5) - sprite_get_xoffset(sprite_index);
115
            offy = (sprite_get_height(sprite_index) * 0.5) - sprite_get_yoffset(sprite_index);
116
            xsub = lengthdir_x(offx * 2, image_angle);
117
            ysub = lengthdir_y(offy * 2, image_angle);
118
            x -= xsub;
119
            y -= ysub;
120
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0]
 = arg1;</code>
gml_Object_obj_dw_garden_newdash_Alarm_0.gml

global.interact = 0;
target = arg0; } return _doom; }
(self, 180);
121
            
122
            step_func = function()
123
            {
124
                x += xsub;
125
                y += ysub;
126
                image_angle += rotation_speed;
127
                xsub = lengthdir_x(offx * 2, image_angle);
128
                ysub = lengthdir_y(offy * 2, image_angle);
129
                x -= xsub;
130
                y -= ysub;
131
            };
132
        }
133
        layer_sprite_destroy(arg1);
134
    }
135
};
136
137
if (global.plot >= 300)
138
{
139
    npc_flora_blocker = scr_makenpc_fromasset(findsprite(spr_enemy_floradin, "NPCs", c_red));
140
    npc_flora_blocker.marker.image_blend = c_white;
141
    
scr_setnpclogic
scr_setnpclogic

function
scr_setnpclogic(arg0, arg1, arg2)
{ if (arg0 == -4) {
scr_debug_print("Failed to add NPC logic");
exit; } if (arg0.marker.sprite_index == spr_debug_40x40) arg0.marker.visible = 0; with (instance_create(0, 0, obj_npc_wrapper)) { if (variable_struct_exists(arg1, "animspeed")) animspeed = arg1.animspeed; if (variable_struct_exists(arg1, "typer")) typer = arg1.typer; if (variable_struct_exists(arg1, "alwaysanimate")) alwaysanimate = arg1.alwaysanimate; npc = arg0; if (!variable_instance_exists(npc.id, "dialogue_side")) npc.dialogue_side = -1; setdialogue = arg2; choices = []; for (var i = 3; i < argument_count; i++) array_push(choices, argument[i]); } }
(npc_flora_blocker,
142
    {
143
        animspeed: 0.25
144
    }, function(arg0)
145
    {
146
        if (arg0)
147
        {
148
            
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; ...
("no_name");
149
            msgsetloc(0, 
* I want to be part of a dangerous accident first!Delay 11\nWait your turn!Wait for inputClose Message
"* I want to be part of a dangerous accident first^1!\nWait your turn!/%", "obj_dw_garden_newdash_slash_Create_0_gml_126_0"
);
150
        }
151
        else
152
        {
153
            
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; ...
("no_name");
154
            msgsetloc(0, 
* This area is closed due to dangerous dashing accidents!Wait for input
"* This area is closed due to dangerous dashing accidents!/", "obj_dw_garden_newdash_slash_Create_0_gml_129_0"
);
155
            msgnextloc(
* If you want to return to CLIFFs,Delay 11 go through the top left of DINER!Wait for inputClose Message
"* If you want to return to CLIFFs^1, go through the top left of DINER!/%", "obj_dw_garden_newdash_slash_Create_0_gml_130_0"
);
156
        }
157
    });
158
}