Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_dw_fcastle_foxhunt_Create_0

related scripts: Create_0 Destroy_0Draw_0Draw_76Other_11Other_12Step_0Step_2

(view raw script w/o annotations or w/e)
1
turnofflayers("DEBUG");
2
turnofflayers("NPC");
3
visible = true;
4
con = 0;
5
timer = 0;
6
init = 0;
7
foxflag = 1840;
8
pink_fox = -4;
9
bullet_flip = 0;
10
PROGRESS_FLAG = 1737;
11
_FOX_BIT_1 = 1;
12
_FOX_BIT_2 = 2;
13
_FOX_BIT_3 = 3;
14
_FOX_BIT_4 = 4;
15
_FOX_BIT_5 = 5;
16
_AQUA_BEATEN_BIT = 7;
17
_DOOR_OPEN_BIT = 8;
18
_TERA_SKIP_BIT = 9;
19
_PUSH_OFF_BIT = 7;
20
reset_tera_skip_bit = false;
21
falling_fox = -4;
22
door_is_open = scr_flag_get_ext(PROGRESS_FLAG, _DOOR_OPEN_BIT);
23
npc_rudinn = -4;
24
foxgarden = -4;
25
set_teraskip = false;
26
foxes_counted = 0;
27
encountercon = 0;
28
laughing_fox = -4;
29
last_tail_message = -1;
30
currentmsg = -1;
31
global.flag[20 other_text_command] = 0;
32
hiding_fox = -4;
33
foxgloves_layer = layer_get_id("FOXGLOVES");
34
foxgloves_layer_exists = layer_exists(foxgloves_layer);
35
foxglove_start_x = [];
36
foxglove_start_y = [];
37
foxglove_elements = [];
38
foxglove_count = 0;
39
if (foxgloves_layer_exists)
40
{
41
    var fg = layer_get_all_elements(foxgloves_layer);
42
    var fg_num = array_length(fg);
43
    for (var i = 0; i < fg_num; i++)
44
    {
45
        var elem = fg[i];
46
        if (layer_get_element_type(elem) == 4)
47
        {
48
            array_push(foxglove_elements, elem);
49
            foxglove_count++;
50
            foxglove_start_x[i] = layer_sprite_get_x(elem);
51
            foxglove_start_y[i] = layer_sprite_get_y(elem);
52
        }
53
    }
54
}
55
turnofflayers("DWCR04");
56
cutscene = 0;
57
cutInit = 0;
58
plot_check_on = true;
59
plot_post = 40;
60
plot_flag = 1455;
61
cutready = 0;
62
cutscene = -1;
63
ctimer = 0;
64
if (global.flag[plot_flag] < plot_post)
65
    cutscene = 0;
66
67
collect_fox = function(arg0 = -1)
68
{
69
    foxes_counted++;
70
    snd_play(snd_barrel_jump);
71
    with (instance_create(mean(obj_mainchara.bbox_left, obj_mainchara.bbox_right), obj_mainchara.bbox_top - 20, obj_marker))
72
    {
73
        sprite_index = spr_fcastle_foxhunt_popup;
74
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
75
        vspeed = -10;
76
        friction = 0.95;
77
        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] = arg1; target = arg0; } return _doom; }
(self, 120);
78
    }
79
    if (arg0 > 0)
80
        scr_flag_set_ext(PROGRESS_FLAG, arg0, 1);
81
    unlock_door();
82
};
83
84
unlock_door = function()
85
{
86
    var sum = scr_flag_get_ext(PROGRESS_FLAG, _FOX_BIT_1) + scr_flag_get_ext(PROGRESS_FLAG, _FOX_BIT_2) + scr_flag_get_ext(PROGRESS_FLAG, _FOX_BIT_3) + scr_flag_get_ext(PROGRESS_FLAG, _FOX_BIT_4) + scr_flag_get_ext(PROGRESS_FLAG, _FOX_BIT_5);
87
    if (sum == 5)
88
    {
89
        with (obj_fusuma_door)
90
            can_open = true;
91
    }
92
    else
93
    {
94
    }
95
    foxes_counted = sum;
96
    var spr = findsprite(spr_dw_fcastle_foxsign);
97
    layer_sprite_index(spr, sum);
98
};
99
100
myinteract = 0;
101
yellow_con = 0;
102
yellow_timer = 0;
103
npc_shadowguy = -4;
104
fusuma_interact = -4;
105
door_interact = -4;
106
num_terakota_pushed_since_fox = 0;
107
myinteract = 0;
108
mydialoguer = -4;
109
110
on_terakota_push_off = function(arg0)
111
{
112
    if (scr_flag_get_ext(PROGRESS_FLAG, 4) == 1)
113
    {
114
        num_terakota_pushed_since_fox++;
115
        if (global.interact == 0)
116
        {
117
            var flag = scr_flag_get_ext(PROGRESS_FLAG, _PUSH_OFF_BIT, 2);
118
            if (get_remaining_terakota() == 0)
119
            {
120
                if (arg0)
121
                {
122
                    
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");
123
                    msgsetloc(0, 
Face K* Man,Delay 11 that was stupid.Wait for input
"\\EK* Man^1, that was stupid./", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_153_0"
);
124
                    msgnextloc(
Face C* Can't believe you have to push 'em all off.Wait for input
"\\EC* Can't believe you have to push 'em all off./", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_154_0"
);
125
                    
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("ralsei", "y");
126
                    msgnextloc(
Face y* Yea...Wait for inputClose Message
"\\Ey* Yea.../%", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_156_0"
);
127
                    mydialoguer = d_make();
128
                    global.interact = 1;
129
                    myinteract = 3;
130
                }
131
                else if (num_terakota_pushed_since_fox > 1 && flag < 3)
132
                {
133
                    global.choicemsg[0] = stringsetloc(
Yea...
"Yea...", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_162_0"
);
134
                    global.choicemsg[1] = stringsetloc(
I WAS#SERIOUS#!!!!!!!!#!!!!!!!!
"I WAS#SERIOUS#!!!!!!!!#!!!!!!!!", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_163_0"
);
135
                    global.choicemsg[2] = stringset("");
136
                    global.choicemsg[3] = stringset("");
137
                    global.msc = -99;
138
                    global.choice = -1;
139
                    
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; ...
("ralsei");
140
                    msgsetloc(0, 
Face H* Great job,Delay 11 Kris!Delay 11 You did it!Wait for input
"\\EH* Great job^1, Kris^1! You did it!/", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_171_0"
);
141
                    msgnextloc(
Face K* Did you,Delay 11 um,Delay 11 have fun?Wait for input
"\\EK* Did you^1, um^1, have fun?/", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_172_0"
);
142
                    msgnext("\\C2");
143
                    mydialoguer = d_make();
144
                    global.interact = 1;
145
                    myinteract = 4;
146
                    scr_flag_set_ext(PROGRESS_FLAG, _PUSH_OFF_BIT, 3, 2);
147
                }
148
            }
149
            else if (num_terakota_pushed_since_fox == 4 && flag < 1)
150
            {
151
                
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; ...
("ralsei");
152
                msgsetloc(0, 
Face J* Umm,Delay 11 Kris?Delay 11 Just a hunch,Delay 11 but...Delay 11 I don't think...Wait for input
"\\EJ* Umm^1, Kris^1? Just a hunch^1, but..^1. I don't think.../", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_182_0"
);
153
                msgnextloc(
Face M* Pushing statues off the ledge in this room...Wait for input
"\\EM* Pushing statues off the ledge in this room.../", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_183_0"
);
154
                msgnextloc(
Face K* ...Delay 11 will do anything else.Wait for inputClose Message
"\\EK* ..^1. will do anything else./%", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_184_0"
);
155
                mydialoguer = d_make();
156
                global.interact = 1;
157
                myinteract = 3;
158
                scr_flag_set_ext(PROGRESS_FLAG, _PUSH_OFF_BIT, 1, 2);
159
            }
160
            else if (num_terakota_pushed_since_fox == 10 && flag < 2)
161
            {
162
                
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; ...
("ralsei");
163
                msgsetloc(0, 
Face K* (K-Kris looks like they're having fun,Delay 11 so...)Wait for inputClose Message
"\\EK* (K-Kris looks like they're having fun^1, so...)/%", "obj_dw_fcastle_foxhunt_slash_Create_0_gml_191_0"
);
164
                mydialoguer = d_make();
165
                global.interact = 1;
166
                myinteract = 3;
167
                scr_flag_set_ext(PROGRESS_FLAG, _PUSH_OFF_BIT, 2, 2);
168
            }
169
        }
170
    }
171
};
172
173
get_remaining_terakota = function()
174
{
175
    var remaining = 0;
176
    with (obj_terracotta_stationary_overworld)
177
    {
178
        if (con == -2)
179
            continue;
180
        if (attack_pattern != -1)
181
            continue;
182
        if (extflag == "push_off_ignore")
183
            continue;
184
        if (extflag == "farpush")
185
            continue;
186
        remaining++;
187
    }
188
    return remaining;
189
};