Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_ch5_DWCR03_Create_0

(view raw script w/o annotations or w/e)
1
plot_check_on = true;
2
plot_post = 70;
3
plot_flag = 1455;
4
tempflag_index = 61;
5
turnofflayers("DEBUG");
6
turnofflayers("NPCs");
7
if (
scr_debug
scr_debug

function
scr_debug()
{ return global.debug == 1; }
())
8
    
scr_setparty
scr_setparty

function
scr_setparty(arg0 = false, arg1 = false, arg2 = false)
{ var kris = obj_mainchara; var slot = 0; var __make = true; if (!i_ex(kris)) __make = false;
scr_losechar();
safe_delete(obj_caterpillarchara); if (arg0 == true) {
scr_getchar(2);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 2, slot))
{ halign = (global.darkzone == 0) ? 3 : 6; valign = (global.darkzone == 0) ? 6 : 16; x -= halign; y -= valign; } } slot++; } if (arg1 == true) {
scr_getchar(3);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 3, slot))
{ halign = 2; valign = 12; x -= halign; y -= valign; } } slot++; } if (arg2 == true) {
scr_getchar(4);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 4, slot))
{ halign = (global.darkzone == 0) ? 2 : 4; valign = (global.darkzone == 0) ? 9 : 18; x -= halign; y -= valign; } } slot++; } } function setparty(arg0 = false, arg1 = false, arg2 = false) { var kris = 1198; var slot = 0; var __make = true; if (!i_ex(kris)) __make = false;
scr_losechar();
safe_delete(obj_caterpillarchara); if (arg0 == true) {
scr_getchar(2);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 2, slot))
{ halign = (global.darkzone == 0) ? 3 : 6; valign = (global.darkzone == 0) ? 6 : 16; x -= halign; y -= valign; } } slot++; } if (arg1 == true) {
scr_getchar(3);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 3, slot))
{ halign = 2; valign = 12; x -= halign; y -= valign; } } slot++; } if (arg2 == true) {
scr_getchar(4);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 4, slot))
...
(1, 1);
9
con = -1;
10
customcon = 0;
11
timer = 0;
12
init = 0;
13
waiting = false;
14
shadow_alpha = 0.5;
15
visible = true;
16
blackall = 
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; }
(0, 0, spr_whitepixel);
17
blackall.image_blend = c_black;
18
blackall.image_alpha = 0;
19
blackall.image_xscale = room_width;
20
blackall.image_yscale = room_height;
21
blackall.depth = 25050;
22
orange_marker = -4;
23
orange_marker2 = -4;
24
green_marker = -4;
25
npc_aqua_netskie = -4;
26
npc_shinobeetle = -4;
27
if (plot_check_on == false || 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ return global.flag[arg0]; } function scr_flag_name_get(arg0) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } function scr_flag_get_ext(arg0, arg1, arg2 = 1) { if (arg1 < 0)
scr_flag_get(arg0);
else return scr_get_bitmask_value(global.flag[arg0], arg1, arg2); }
(plot_flag) < plot_post)
28
{
29
    con = 0;
30
}
31
else
32
{
33
    con = 999;
34
    with (obj_custom_interactable_solid)
35
        instance_destroy();
36
    if (global.flag[1455] == 100)
37
    {
38
        if (global.flag[676] == 1)
39
        {
40
            npc_aqua_netskie = scr_makenpc_fromasset(findsprite(spr_enemy_aqua_idle_fox, "NPCs"));
41
            
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_aqua_netskie,
42
            {
43
                animspeed: 0.25,
44
                alwaysanimate: true
45
            }, function(arg0)
46
            {
47
                
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");
48
                msgsetloc(0, 
* Mites and fleas,Delay 11 kee kee,Delay 11 I found so many mites and fleas!Wait for inputClose Message
"* Mites and fleas^1, kee kee^1, I found so many mites and fleas!/%", "obj_ch5_DWCR03_slash_Create_0_gml_49_0"
);
49
            });
50
            npc_shinobeetle = scr_makenpc_fromasset(findsprite(spr_shinobeetle_spare, "NPCs"));
51
            
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_shinobeetle,
52
            {
53
                animspeed: 0.25,
54
                alwaysanimate: true
55
            }, function(arg0)
56
            {
57
                
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");
58
                msgsetloc(0, 
* I,Delay 11 I'm not a mite...Wait for inputClose Message
"* I^1, I'm not a mite.../%", "obj_ch5_DWCR03_slash_Create_0_gml_54_0"
);
59
            });
60
        }
61
    }
62
}
63
obj_watersurface.make_reflection(1198);
64
with (obj_caterpillarchara)
65
    obj_watersurface.make_reflection(id);
66
67
debrisCircleStep = function()
68
{
69
    if (visible)
70
    {
71
        var _distToGo = point_distance(x, y, xTo, yTo);
72
        var _percent = _distToGo / dist;
73
        z = sin(_percent * pi) * 90;
74
        if (_distToGo > spd)
75
        {
76
            x += lengthdir_x(spd, direction);
77
            y += lengthdir_y(spd, direction);
78
            depth = odepth - (y - ystart);
79
        }
80
        else
81
        {
82
            x = xTo;
83
            y = yTo;
84
            
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
(id, -20);
85
        }
86
    }
87
};
88
89
debrisCircleDraw = function()
90
{
91
    draw_sprite_ext(sprite_index, image_index, x, y - z, 2, 2, 0, c_white, image_alpha);
92
};
93
94
debrisSpawnCircle = function()
95
{
96
    var _rocks = 4;
97
    for (var i = 0; i < _rocks; i++)
98
    {
99
        var _angle = (i * (360 / _rocks)) + random_range(-10, 10) + 15;
100
        var _rock = instance_create(orange_marker2.x + 10, or_pos2.y + 10, obj_marker_fancy);
101
        with (_rock)
102
        {
103
            rock = true;
104
            odepth = other.orange_marker2.depth;
105
            xTo = xstart + ((90 + random_range(-5, 25)) * cos(degtorad(_angle)));
106
            yTo = ystart + ((40 + random_range(-20, 0)) * sin(degtorad(_angle)));
107
            z = 0;
108
            sprite_index = choose(spr_wood_debris1, spr_wood_debris2, spr_wood_debris3, spr_wood_debris4);
109
            step_func = method(id, other.debrisCircleStep);
110
            draw_func = method(id, other.debrisCircleDraw);
111
            image_xscale = 2;
112
            image_yscale = 2;
113
            visible = false;
114
            direction = point_direction(xstart, ystart, xTo, yTo);
115
            dist = point_distance(xstart, ystart, xTo, yTo);
116
            spd = (dist / 15) * random_range(0.7, 1.2);
117
        }
118
        
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(_rock, "visible", true);
119
    }
120
};
121
122
debrisFallStep = function()
123
{
124
    if ((y + vspeed) > ystart)
125
    {
126
        gravity = 0;
127
        vspeed = 0;
128
        visible = false;
129
        var _splash = instance_create(x, bbox_bottom, obj_utwaterpillar);
130
        _splash.depth = depth - 1;
131
        snd_play(snd_splash, 0.5, 0.6 + random(0.2));
132
        snd_play(snd_rocket, 0.3, 1.4 + random(0.2));
133
        instance_destroy();
134
    }
135
};
136
137
debrisSpawnFall = function(arg0)
138
{
139
    var _cy = cameray();
140
    var _fallingrocks = 5;
141
    for (var i = 0; i < _fallingrocks; i++)
142
    {
143
        var _xpos = arg0 + 50 + ((i / (_fallingrocks - 1)) * 540) + irandom_range(-10, 10);
144
        var _ypos = (i % 2) ? (irandom_range(145, 200) + 40) : (irandom_range(345, 445) + 40);
145
        var _rock = instance_create(_xpos, _ypos, obj_marker_fancy);
146
        with (_rock)
147
        {
148
            rock = true;
149
            if (_ypos > 250)
150
                depth = 96000;
151
            else
152
                depth = 98000;
153
            var _falloffset = 420 + random(30) + (((i % 2) ? -1 : 1) * (i * 2) * 30);
154
            show_debug_message_concat(_falloffset);
155
            y -= _falloffset;
156
            sprite_index = choose(spr_wood_debris1, spr_wood_debris2, spr_wood_debris3, spr_wood_debris4);
157
            step_func = method(id, other.debrisFallStep);
158
            image_xscale = 2;
159
            image_yscale = 2;
160
            visible = false;
161
        }
162
        
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(_rock, "visible", true);
163
        
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(_rock, "gravity", 0.4 + random(0.4));
164
        
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(_rock, "vspeed", random(4));
165
    }
166
};