Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_gameover_board_Step_0

(view raw script w/o annotations or w/e)
1
global.interact = 1;
2
if (tenna == -4)
3
{
4
    if (i_ex(obj_actor_tenna))
5
    {
6
        tenna = instance_find(obj_actor_tenna, 0);
7
        if (times_lost > 1)
8
        {
9
            with (obj_actor_tenna)
10
                sprite_index = spr_tenna_grasp;
11
        }
12
        gameover_parent.tenna_arrive = true;
13
        printval("inbattle");
14
        init = true;
15
    }
16
}
17
with (obj_couchwriter)
18
    instance_destroy();
19
if (!init)
20
    exit;
21
var canthavethatontv = stringsetloc(
* We can't have THAT on TV!!Delay 11 The SHOW MUST GO ON!!Wait for input
"* We can't have THAT on TV!^1! The SHOW MUST GO ON!!/", "obj_gameover_board_slash_Step_0_gml_34_0"
);
22
var continuewhere = stringsetloc(
* You're gonna continue RIGHT where you left off!Wait for input
"* You're gonna continue RIGHT where you left off!/", "obj_gameover_board_slash_Step_0_gml_35_0"
);
23
var littlepunishment = stringsetloc(
* ...Delay 11 Well,Delay 11 except for a LITTLE punishment.Wait for input
"* ..^1. Well^1, except for a LITTLE punishment./", "obj_gameover_board_slash_Step_0_gml_36_0"
);
24
if (con == 0 && init)
25
{
26
    timer++;
27
    if (timer == 30)
28
        con = 1;
29
}
30
if (con == 1)
31
{
32
    timer = 0;
33
    con = 8;
34
    
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; ...
("tenna");
35
    msgsetloc(0, 
* What the...!? You actually LOST!?Wait for input
"* What the...!? You actually LOST!?/", "obj_gameover_board_slash_Step_0_gml_33_0"
);
36
    var points = global.flag[1044 points];
37
    puntype = 0;
38
    if (points > 200)
39
        puntype = 0;
40
    if (points <= 200 && points > 20)
41
        puntype = 1;
42
    if (points < 1)
43
        puntype = 3;
44
    if (points < 20)
45
    {
46
        if (
scr_inventoryspace
scr_inventoryspace

function
scr_inventoryspace()
{ var freespace = 0; var inventoryspace = 12; for (var i = 0; i < inventoryspace; i++) { if (global.item[i] == 0) freespace++; } debug_message("from " + object_get_name(object_index) + ":
scr_inventoryspace(): free inventory slots=" + string(freespace));
return freespace; } function scr_pocketspace() { var pocketspace = 0; for (var i = 0; i < global.flag[64 storage_size]; i++) { if (global.pocketitem[i] == 0) pocketspace++; } debug_message("from " + object_get_name(object_index) + ": scr_pocketspace(): free pocket slots=" + string(pocketspace)); return pocketspace; }
() >= 2)
47
        {
48
            if (!
scr_itemcheck
scr_itemcheck

function
scr_itemcheck(arg0)
{ haveit = 0; itemcount = 0; for (var __i = 0; __i < 12; __i += 1) { if (global.item[__i] == arg0) haveit = 1; if (global.item[__i] == arg0) itemcount += 1; } return haveit; }
(34))
49
                puntype = 2;
50
        }
51
    }
52
    msgnext(canthavethatontv);
53
    msgnext(continuewhere);
54
    if (puntype != 2)
55
        msgnext(littlepunishment);
56
    if (times_lost > 1)
57
        msgsetloc(0, 
* GAME OVER!!!Delay 11 Another LOSS,Delay 11 another PUNISHMENT!!!Wait for input
"* GAME OVER!!^1! Another LOSS^1, another PUNISHMENT!!!/", "obj_gameover_board_slash_Step_0_gml_43_0"
);
58
    if (global.flag[1022 tenna_board_absent] == 1)
59
    {
60
        msgsetloc(0, 
* HEY!Delay 11 I was just out of the room and I heard you got a GAME OVER!!Wait for input
"* HEY^1! I was just out of the room and I heard you got a GAME OVER!!/", "obj_gameover_board_slash_Step_0_gml_47_0"
);
61
        if (times_lost <= 1)
62
        {
63
            msgnext(canthavethatontv);
64
            msgnext(continuewhere);
65
            if (puntype != 2)
66
                msgnext(littlepunishment);
67
        }
68
        else
69
        {
70
            msgnextloc(
* Another LOSS,Delay 11 another PUNISHMENT!!!Wait for input
"* Another LOSS^1, another PUNISHMENT!!!/", "obj_gameover_board_slash_Step_0_gml_57_0"
);
71
        }
72
        con = 7.1;
73
    }
74
    punishment = floor(global.flag[1044 points] / 3);
75
    if (punishment <= 0)
76
    {
77
        if (global.flag[1044 points] < 3 && global.flag[1044 points] > 0)
78
            punishment = 1;
79
        if (puntype == 0)
80
        {
81
            if (global.flag[1044 points] == 1)
82
                puntype = 1;
83
        }
84
    }
85
    if (puntype == 0)
86
        msgnextloc(
* I WILL be taking some of your POINTs!Wait for inputClose Message
"* I WILL be taking some of your POINTs!/%", "obj_gameover_board_slash_Step_0_gml_69_0"
);
87
    if (puntype == 1)
88
    {
89
        msgnextloc(
* I WILL be taking ALL of your POINTs!Wait for inputClose Message
"* I WILL be taking ALL of your POINTs!/%", "obj_gameover_board_slash_Step_0_gml_73_0"
);
90
        punishment = points;
91
    }
92
    if (puntype == 2)
93
    {
94
        punishment = 0;
95
        msgnextloc(
* Well,Delay 11 actually I would punish you,Delay 11 but you look so pathetic and hungry!Wait for input
"* Well^1, actually I would punish you^1, but you look so pathetic and hungry!/", "obj_gameover_board_slash_Step_0_gml_107_0"
);
96
        msgnextloc(
* Here!Delay 11 Take two TV Dinners and call me in the morning!Wait for inputClose Message
"* Here^1! Take two \\cYTV Dinners\\cW and call me in the morning!/%", "obj_gameover_board_slash_Step_0_gml_108_0"
);
97
        con = 4.1;
98
    }
99
    if (puntype == 3)
100
    {
101
        punishment = 0;
102
        scr_delay_var("makeangry", 1, 5);
103
        msgnextloc(
* Punishment for ME to have to watch you TANK THESE RATINGS losing at 0 POINTs!!!Wait for inputClose Message
"* Punishment for ME to have to watch you TANK THESE RATINGS losing at 0 POINTs!!!/%", "obj_gameover_board_slash_Step_0_gml_79_0"
);
104
    }
105
    var d = d_make();
106
    d.side = 0;
107
    if (global.flag[1022 tenna_board_absent] == 1)
108
        d.stay = 5;
109
}
110
if (con == 4.1)
111
{
112
    timer++;
113
    if (timer > 5)
114
    {
115
        if ((times_lost == 1 && 
scr_msgno_end
scr_msgno_end

function
scr_msgno_end(arg0 = 0)
{ if (i_ex(obj_writer)) { with (obj_writer) { if (msgno == arg0) { if (reachedend) return true; else return false; } } } else { return true; } }
(4)) || (times_lost > 1 &&
scr_msgno_end
scr_msgno_end

function
scr_msgno_end(arg0 = 0)
{ if (i_ex(obj_writer)) { with (obj_writer) { if (msgno == arg0) { if (reachedend) return true; else return false; } } } else { return true; } }
(2)))
116
        {
117
            snd_play(snd_item);
118
            
scr_itemget
scr_itemget

function
scr_itemget(arg0)
{ var __i = 0; var loop = 1; noroom = 0; _pocketed = 0; _noroominventory = 0; global.item[12] = 999; while (loop == 1) { if (global.item[__i] == 0) { global.item[__i] = arg0; break; } if (__i == 12) { _noroominventory = 1; noroom = 1; for (var __j = 0; __j < global.flag[64 storage_size]; __j++) { if (global.pocketitem[__j] == 0) { debug_message("Placed in pocket :" + string(__j)); global.pocketitem[__j] = arg0; _pocketed = 1; noroom = 0; break; } } break; } __i += 1; } script_execute(scr_iteminfo_all); debug_message("noroom=" + string(noroom)); debug_message("_pocketed=" + string(_pocketed)); debug_message("_noroominventory=" + string(_noroominventory)); }
(34);
119
            
scr_itemget
scr_itemget

function
scr_itemget(arg0)
{ var __i = 0; var loop = 1; noroom = 0; _pocketed = 0; _noroominventory = 0; global.item[12] = 999; while (loop == 1) { if (global.item[__i] == 0) { global.item[__i] = arg0; break; } if (__i == 12) { _noroominventory = 1; noroom = 1; for (var __j = 0; __j < global.flag[64 storage_size]; __j++) { if (global.pocketitem[__j] == 0) { debug_message("Placed in pocket :" + string(__j)); global.pocketitem[__j] = arg0; _pocketed = 1; noroom = 0; break; } } break; } __i += 1; } script_execute(scr_iteminfo_all); debug_message("noroom=" + string(noroom)); debug_message("_pocketed=" + string(_pocketed)); debug_message("_noroominventory=" + string(_noroominventory)); }
(34);
120
            con = 8;
121
        }
122
    }
123
}
124
if (makeangry == 1)
125
{
126
    if ((times_lost == 1 && 
scr_getmsgno_d
scr_getmsgno_d

function
scr_getmsgno_d()
{ if (instance_exists(obj_dialoguer) && instance_exists(obj_dialoguer.writer)) return obj_dialoguer.writer.msgno; }
(4)) || (times_lost > 1 &&
scr_getmsgno_d
scr_getmsgno_d

function
scr_getmsgno_d()
{ if (instance_exists(obj_dialoguer) && instance_exists(obj_dialoguer.writer)) return obj_dialoguer.writer.msgno; }
(1)))
127
    {
128
        with (obj_actor_tenna)
129
        {
130
            bounce = 1;
131
            sprite_index = spr_tenna_sad;
132
        }
133
        makeangry = 2;
134
    }
135
}
136
if (makeangry == 2)
137
{
138
    if ((times_lost == 1 && 
scr_msgno_end
scr_msgno_end

function
scr_msgno_end(arg0 = 0)
{ if (i_ex(obj_writer)) { with (obj_writer) { if (msgno == arg0) { if (reachedend) return true; else return false; } } } else { return true; } }
(4)) || (times_lost > 1 &&
scr_msgno_end
scr_msgno_end

function
scr_msgno_end(arg0 = 0)
{ if (i_ex(obj_writer)) { with (obj_writer) { if (msgno == arg0) { if (reachedend) return true; else return false; } } } else { return true; } }
(1)))
139
    {
140
        snd_play(snd_crowd_laughter_single);
141
        makeangry = 0;
142
    }
143
}
144
if (con == 8.1 && !d_ex())
145
{
146
    
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; ...
("tenna");
147
    msgsetloc(0, 
* Now I've gotta get back out of here,Delay 11 so don't lose again,Delay 11 OK!?Wait for inputClose Message
"* Now I've gotta get back out of here^1, so don't lose again^1, OK!?/%", "obj_gameover_board_slash_Step_0_gml_94_0"
);
148
    d_make();
149
    con = 8;
150
}
151
if (con == 7.1)
152
    con = 8;
153
if (con == 8 && !d_ex())
154
{
155
    con = 9;
156
    alarm[0]
 = 41;
gml_Object_obj_gameover_board_Alarm_0.gml

con++;
157
    with (obj_actor_tenna)
158
    {
159
        sprite_index = spr_tenna_hooray_armsup;
160
        bounce = 1;
161
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", x, camerax() + 480 + 320, 30, 4, "in");
162
    }
163
    gameover_parent.con = 1;
164
    gameover_parent.timer = 0;
165
}
166
if (con == 10 && !d_ex())
167
{
168
    con = 99;
169
    if (punishment > 0)
170
        
scr_board_score
scr_board_score

function
scr_board_score(arg0)
{ var scoreadder = instance_create(x, y, obj_board_scoreAdder); scoreadder.scoreamount = arg0; if (argument_count == 2) scoreadder.mysnd = argument1; } function scr_board_score_set(arg0) { global.flag[1044 points] = arg0; }
(-punishment);
171
    global.interact = 0;
172
    with (obj_mainchara_board)
173
        myhealth = maxhealth;
174
    instance_destroy();
175
}