Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_mushroomstack_helpers

(view raw script w/o annotations or w/e)
1
function scr_mushroomstack_biteprompt(arg0)
2
{
3
    if (obj_mainchara.holding_item != -4)
4
    {
5
        
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");
6
        msgsetloc(0, 
* (Something else bit it first.)Wait for inputClose Message
"* (Something else bit it first.)/%", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_4_0"
);
7
    }
8
    else if (instance_number(obj_dw_garden_physicsshroom) >= 50)
9
    {
10
        
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");
11
        msgsetloc(0, 
* (There's too many mushroom for there to be much room.)Wait for inputClose Message
"* (There's too many mushroom for there to be much room.)/%", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_7_0"
);
12
    }
13
    else
14
    {
15
        var shroomstacksize = 0;
16
        var manager = 869;
17
        if (!i_ex(manager))
18
            manager = 342;
19
        if (!i_ex(manager))
20
            manager = 220;
21
        with (obj_dw_garden_shroomstack)
22
        {
23
            if (mytarget == "kris")
24
                shroomstacksize = array_length(stack);
25
        }
26
        if (shroomstacksize < manager.stackmaxsize)
27
        {
28
            var many_mode = !i_ex(obj_dw_garden_mushrooms) || global.flag[1364] >= 3;
29
            var ultra_mode = manager == 220;
30
            var sun_mode = room == room_dw_fcastle_heldmushrooms;
31
            
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");
32
            if (many_mode)
33
            {
34
                if (ultra_mode)
35
                {
36
                    if (sun_mode)
37
                    {
38
                        
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");
39
                        global.choicemsg[0] = stringsetloc(
#Bite
"#Bite", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_24_0"
);
40
                        global.choicemsg[1] = stringsetloc(
#Don't bite
"#Don't bite", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_25_0"
);
41
                        msgsetloc(0, 
* (Take all bite(s(s(s)))?)Wait for input
"* (Take all bite(s(s(s)))?)/", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_26_0"
);
42
                        msgnext("\\C2 ");
43
                    }
44
                    else
45
                    {
46
                        
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");
47
                        global.choicemsg[0] = stringsetloc(
#Bite 50x
"#Bite 50x", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_30_0"
);
48
                        global.choicemsg[1] = stringsetloc(
#Don't bite
"#Don't bite", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_31_0"
);
49
                        msgsetloc(0, 
* (Take a bite(s(s))?)Wait for input
"* (Take a bite(s(s))?)/", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_32_0"
);
50
                        msgnext("\\C2 ");
51
                    }
52
                }
53
                else
54
                {
55
                    global.choicemsg[0] = stringsetloc(
#Bite 2x
"#Bite 2x", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_36_0"
);
56
                    global.choicemsg[1] = stringsetloc(
#Bite 4x
"#Bite 4x", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_37_0"
);
57
                    global.choicemsg[2] = stringsetloc(
Bite 6x
"Bite 6x", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_38_0"
);
58
                    global.choicemsg[3] = stringsetloc(
Don't bite
"Don't bite", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_39_0"
);
59
                    msgsetloc(0, 
* (Take a bite(s)?)Wait for input
"* (Take a bite(s)?)/", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_40_0"
);
60
                    msgnext("\\C4 ");
61
                }
62
            }
63
            else
64
            {
65
                global.choicemsg[0] = stringsetloc(
#Bite it
"#Bite it", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_44_0"
);
66
                global.choicemsg[1] = stringsetloc(
#Do not bite
"#Do not bite", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_45_0"
);
67
                if (arg0)
68
                    msgsetloc(0, 
* (Take a bite?)Wait for input
"* (Take a bite?)/", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_47_0"
);
69
                else
70
                    msgsetloc(0, 
* (It looks soft and delicious.Delay 11 Take a bite?)Wait for input
"* (It looks soft and delicious^1. Take a bite?)/", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_49_0"
);
71
                msgnext("\\C2 ");
72
            }
73
            return 1;
74
        }
75
        else
76
        {
77
            
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");
78
            msgsetloc(0, 
* (You feel full.)
* (Vertically.)Wait for inputClose Message
"* (You feel full.)&* (Vertically.)/%", "scr_mushroomstack_helpers_slash_scr_mushroomstack_helpers_gml_56_0"
);
79
        }
80
    }
81
}
82
83
function scr_mushroomstack_biteresolution()
84
{
85
    var manager = 869;
86
    if (!i_ex(manager))
87
        manager = 342;
88
    if (!i_ex(manager))
89
        manager = 220;
90
    var many_mode = !i_ex(obj_dw_garden_mushrooms) || global.flag[1364] >= 3;
91
    var ultra_mode = manager == 220;
92
    var sun_mode = room == room_dw_fcastle_heldmushrooms;
93
    if (global.choice == 0)
94
    {
95
        var npc = other.npc;
96
        if (many_mode)
97
        {
98
            if (ultra_mode)
99
            {
100
                if (sun_mode)
101
                {
102
                    with (manager)
103
                        pick_up_big_shroom(npc);
104
                }
105
                else
106
                {
107
                    with (manager)
108
                    {
109
                        global.flag[1364] += 50;
110
                        repeat (50)
111
                            addshroom(npc);
112
                    }
113
                }
114
            }
115
            else
116
            {
117
                with (manager)
118
                {
119
                    global.flag[1364] += 2;
120
                    addshroom(npc);
121
                    addshroom(npc);
122
                }
123
            }
124
        }
125
        else
126
        {
127
            with (manager)
128
            {
129
                global.flag[1364] += 1;
130
                addshroom(npc);
131
            }
132
        }
133
    }
134
    else if (many_mode && !ultra_mode)
135
    {
136
        var npc = other.npc;
137
        with (manager)
138
        {
139
            if (global.choice == 1)
140
            {
141
                global.flag[1364] += 4;
142
                addshroom(npc);
143
                addshroom(npc);
144
                addshroom(npc);
145
                addshroom(npc);
146
            }
147
            else if (global.choice == 2)
148
            {
149
                global.flag[1364] += 6;
150
                addshroom(npc);
151
                addshroom(npc);
152
                addshroom(npc);
153
                addshroom(npc);
154
                addshroom(npc);
155
                addshroom(npc);
156
            }
157
        }
158
    }
159
}
160
161
function scr_shroomstack_addshroom(arg0)
162
{
163
    var targ = -4;
164
    with (obj_dw_garden_shroomstack)
165
    {
166
        if (mytarget == "kris")
167
            targ = id;
168
    }
169
    if (!i_ex(targ))
170
        targ = instance_create(x, y, obj_dw_garden_shroomstack);
171
    if (array_length(targ.stack) >= stackmaxsize)
172
        exit;
173
    array_push(targ.stack, 955);
174
    array_push(targ.xdist, 0);
175
    array_push(targ.ydist, 0);
176
    array_push(targ.size, 0.1);
177
    snd_stop(snd_crowngrowth);
178
    snd_play(snd_crowngrowth, 0.8, min(1.4 + (0.05 * array_length(targ.stack)), 2.7));
179
}