Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2savelancer_Step_0

(view raw script w/o annotations or w/e)
1
scr_board_populatevars
scr_board_populatevars

function
scr_board_populatevars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (kris == 0) { with (obj_mainchara_board) { if (name == "kris") other.kris = id; } } if (ralsei == 0) { with (obj_mainchara_board) { if (name == "ralsei") other.ralsei = id; } } if (susie == 0) { with (obj_mainchara_board) { if (name == "susie") other.susie = id; } } }
();
2
scr_gameshow_populatevars
scr_gameshow_populatevars

function
scr_gameshow_populatevars()
{ if (!variable_instance_exists(id, "kr_real")) kr_real = 0; if (!variable_instance_exists(id, "su_real")) su_real = 0; if (!variable_instance_exists(id, "ra_real")) ra_real = 0; if (!variable_instance_exists(id, "tenna")) tenna = 0; if (kr_real == 0) { with (obj_mainchara) other.kr_real = id; } if (su_real == 0) { with (obj_caterpillarchara) { if (name == "susie") other.su_real = id; } } if (ra_real == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ra_real = id; } } if (tenna == 0) { with (obj_actor_tenna) other.tenna = id; } }
();
3
if (active == 1)
4
{
5
    if (obj_board_camera.con == 0 && suwalk == 0)
6
    {
7
        if (i_ex(lancer))
8
        {
9
            ralsei.follow = false;
10
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", 3.5, 6, 2);
11
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("ralsei", 2.5, 6, 2);
12
        }
13
        else
14
        {
15
            ralsei.follow = true;
16
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", choose(1, 2, 9, 10), 6, 2);
17
        }
18
        suwalk = 1;
19
    }
20
    if (pippins.grabbed)
21
    {
22
        textcomplete = true;
23
        texttimer = 999;
24
        drawtext = false;
25
    }
26
    if (con == 0 && obj_board_camera.con == 0)
27
    {
28
        if (visitinit == 0)
29
        {
30
            visitinit = 1;
31
            shopstring = string1;
32
            if (!i_ex(lancer))
33
                shopstring = string4;
34
        }
35
    }
36
    if (shopcon == 0 && sutalk == 0)
37
    {
38
        if (i_ex(lancer))
39
        {
40
            if (textcomplete)
41
            {
42
                sutalk = 1;
43
                var _sutalk = stringsetloc(
Lancer!!!
"Lancer!!!", "obj_b2savelancer_slash_Step_0_gml_70_0"
);
44
                
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(_sutalk, "susie", 2, 80);
45
            }
46
        }
47
    }
48
    if (sutalk < 6 && shopstring == string4 && textcomplete)
49
    {
50
        sutalk = 7;
51
        sutalktimer = 0;
52
    }
53
    if (sutalk == 7)
54
    {
55
        sutalktimer++;
56
        if (sutalktimer == 1)
57
        {
58
            su_real.sprite_index = su_real.rsprite;
59
            
scr_resetgameshowcharacter_delay
scr_resetgameshowcharacter_delay

function
scr_resetgameshowcharacter_delay()
{ var _x_smooth = 0; if (argument_count == 3) _x_smooth = 1; return
scr_script_delayed(scr_resetgameshowcharacter, argument1, argument0, _x_smooth);
}
("susie", 80);
60
            var _sutalk = stringsetloc(
Damn, I wanted to get two Lancers.
"Damn, I wanted to get two Lancers.", "obj_b2savelancer_slash_Step_0_gml_91_0"
);
61
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(_sutalk, "susie", 2, 70);
62
        }
63
        if (sutalktimer == 70 && global.flag[1022 tenna_board_absent] == 0)
64
        {
65
            tenna.bounce = 1;
66
            var tetalk = stringsetloc(
Two!? Not with this union breathing down my neck!
"Two!? Not with this union breathing down my neck!", "obj_b2savelancer_slash_Step_0_gml_98_0"
);
67
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(tetalk, "tenna", 2, 100);
68
            snd_play_delay(snd_laughtrack_short_temp, 20);
69
        }
70
    }
71
    if (shopcon == 0 && !i_ex(lancer) && !bw_ex())
72
        shopcon = 1;
73
    if (shopcon == 1 && obj_board_inventory.lancer == true)
74
    {
75
        shopstring = "";
76
        shopcon = 2;
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 == "tenna") { global.typer = 80; if (global.fighting == 1) global.typer = 81; } 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 (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; ...
("lancer");
78
        if (global.flag[1048 lancer_cost] < 999)
79
        {
80
            msgsetloc(0, 
HO HO!Delay 11 FRIENDSHIP SHOULDN'T BE BOUGHT...Wait for input
"HO HO^1! FRIENDSHIP SHOULDN'T BE BOUGHT.../", "obj_b2savelancer_slash_Step_0_gml_119_0"
);
81
            msgnextloc(
BUT IF YOU HAVE TO,Delay 11 GOOD YOU DID IT DIRT CHEAP!Wait for input
"BUT IF YOU HAVE TO^1, GOOD YOU DID IT DIRT CHEAP!/", "obj_b2savelancer_slash_Step_0_gml_120_0"
);
82
            msgnextloc(
I'LL BE WAITING IN YOUR ITEMS FOR SOME CHEAP DIRT OF MY OWN.Wait for input
"I'LL BE WAITING IN YOUR ITEMS FOR SOME CHEAP DIRT OF MY OWN./", "obj_b2savelancer_slash_Step_0_gml_121_0"
);
83
            msgnextloc(
DIG,Delay 11 DIG!Wait for inputClose Message
"DIG^1, DIG!/%", "obj_b2savelancer_slash_Step_0_gml_122_0"
);
84
        }
85
        else
86
        {
87
            
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 == "tenna") { global.typer = 80; if (global.fighting == 1) global.typer = 81; } 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 (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; ...
("no_name");
88
            msgsetloc(0, 
HO HO!Delay 11 YOU BOUGHT ME WITHOUT EVEN WAITING FOR A SALE!!Wait for input
"HO HO^1! YOU BOUGHT ME WITHOUT EVEN WAITING FOR A SALE!!/", "obj_b2savelancer_slash_Step_0_gml_127_0"
);
89
            msgnextloc(
THAT'S TRUE FRIENDSHIP!!Delay 11Wait for input
"THAT'S TRUE FRIENDSHIP!^1!/", "obj_b2savelancer_slash_Step_0_gml_128_0"
);
90
            msgnextloc(
IF YOU EVER FIND YOURSELF STUCK IN THE MUD,Delay 11Wait for input
"IF YOU EVER FIND YOURSELF STUCK IN THE MUD^1,/", "obj_b2savelancer_slash_Step_0_gml_129_0"
);
91
            msgnextloc(
LET ME DIG YOU OUT!Wait for inputClose Message
"LET ME DIG YOU OUT!/%", "obj_b2savelancer_slash_Step_0_gml_130_0"
);
92
        }
93
        safe_delete(obj_board_grayregion);
94
        bw_make();
95
    }
96
    if (shopcon == 2)
97
        global.interact = 1;
98
    if (shopcon == 2 && !bw_ex())
99
    {
100
        shopcon = -1;
101
        scr_delay_var("shopcon", 3, 15);
102
    }
103
    if (shopcon == 3)
104
    {
105
        shopcon = 4;
106
        global.interact = 0;
107
        texttimer = 0;
108
        shopstring = string2;
109
        if (global.flag[1048 lancer_cost] < 999)
110
            shopstring = string3;
111
    }
112
    if (i_ex(lancer))
113
    {
114
        var _cost = 999;
115
        var leftnine = false;
116
        var rightnine = false;
117
        with (obj_board_trigger)
118
        {
119
            if (extflag == "9-1")
120
            {
121
                if (place_meeting(x, y, obj_board_grayregion))
122
                    leftnine = true;
123
            }
124
            if (extflag == "9-2")
125
            {
126
                if (place_meeting(x, y, obj_board_grayregion))
127
                    rightnine = true;
128
            }
129
        }
130
        if (leftnine && rightnine)
131
            _cost = 9;
132
        if ((leftnine && !rightnine) || (!leftnine && rightnine))
133
            _cost = 99;
134
        lancer.cost = _cost;
135
    }
136
}
137
else
138
{
139
    suwalk = 0;
140
    timer = 0;
141
    texttimer = 0;
142
    visitinit = 0;
143
    textcomplete = false;
144
    if (sutalk == 7)
145
        sutalk = 999;
146
}