Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_churchb_moneyfountain_Step_0

(view raw script w/o annotations or w/e)
1
var nointeract = 0;
2
if (instance_exists(obj_dw_church_organikchaser))
3
    nointeract = true;
4
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
5
{
6
    if (keyboard_check(ord("W")) && keyboard_check_pressed(ord("0")))
7
        room_goto(room_dw_church_moneyfountain);
8
}
9
if (!init)
10
{
11
    var pos = 
scr_heromarker
scr_heromarker

function
scr_heromarker(arg0 = "", arg1 = "")
{ var ____foundmarker = -4; var xpos = -1; var ypos = -1; var objindextocheck = 1365; if (string_pos("kr", arg0) != 0) objindextocheck = 544; if (string_pos("su", arg0) != 0) objindextocheck = 522; if (string_pos("ra", arg0) != 0) objindextocheck = 75; if (string_pos("no", arg0) != 0) objindextocheck = 933; if (string_pos("gen", arg0) != 0) objindextocheck = 1365; with (objindextocheck) { if (variable_instance_exists(id, "extflag")) { if (extflag == arg1) ____foundmarker = id; } } if (instance_exists(____foundmarker)) { xpos = ____foundmarker.x; ypos = ____foundmarker.y; } if (____foundmarker == -4) { debug_message("
scr_heromarker(" + arg0 + "," + arg1 + ") Object Not Found");
return [-4, -4, -4]; } return [xpos, ypos, ____foundmarker]; } function scr_genmarker(arg0 = "") { var marker = -4; with (obj_genmarker) { if (extflag == arg0) marker = id; } return marker; }
(undefined, "fountain");
12
    fountain = instance_create(pos[0], pos[1], obj_trigger_interact);
13
    fountain.talked = 0;
14
    
scr_sizeexact
scr_sizeexact

function
scr_sizeexact(arg0, arg1, arg2 = id)
{ with (arg2) { if (!sprite_exists(sprite_index)) { debug_message("Can't size, no sprite"); exit; } var _w = sprite_get_width(sprite_index); var _h = sprite_get_width(sprite_index); image_xscale = arg0 / _w; image_yscale = arg1 / _h; } }
(pos[2].sprite_width, pos[2].sprite_height, fountain);
15
    init = 1;
16
}
17
with (plack)
18
{
19
    if (nointeract)
20
        myinteract = 0;
21
    if (myinteract == 3)
22
    {
23
        global.interact = 1;
24
        
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
25
        msgsetloc(0, 
* .ecnarbmemer ruoy wohs lliw noitanod taerg a ,Delay 11edis rehto eht ot ssap uoy nehWWait for inputClose Message
"* .ecnarbmemer ruoy wohs lliw \\cAnoitanod taerg a ^1,edis rehto eht ot ssap\\cW uoy nehW/%", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_77_0"
);
26
        d_make();
27
        myinteract = 999;
28
        talked++;
29
    }
30
    if (myinteract == 999 && !d_ex())
31
    {
32
        myinteract = 0;
33
        global.interact = 0;
34
    }
35
}
36
with (fountain)
37
{
38
    if (nointeract)
39
        myinteract = 0;
40
    if (myinteract == 3)
41
    {
42
        global.interact = 1;
43
        
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
44
        msgsetloc(0, 
* (The water is gleaming...Delay 11 gold coins are glittering inside.)Wait for inputClose Message
"* (The water is gleaming..^1. gold coins are glittering inside.)/%", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_103_0"
);
45
        if (global.flag[898] == 0)
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
48
            msgsetloc(0, 
* (The water is frozen in emptiness.)Wait for inputClose Message
"* (The water is frozen in emptiness.)/%", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_108_0"
);
49
        }
50
        d_make();
51
        myinteract = 999;
52
    }
53
    if (myinteract == 999 && !d_ex())
54
    {
55
        myinteract = 0;
56
        global.interact = 0;
57
    }
58
}
59
with (mynpc)
60
{
61
    if (nointeract)
62
        myinteract = 0;
63
    if (!variable_instance_exists(id, "myinteract"))
64
        myinteract = 0;
65
    if (myinteract == 3)
66
    {
67
        marker.sprite_index = spr_npc_organik_0_talk_differentrobe;
68
        global.interact = 1;
69
        var money = global.flag[898];
70
        var itemreceived = global.flag[1537];
71
        
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
72
        msgsetloc(0, 
* You are the donator. Your money has turned into fine gold.Wait for input
"* You are the donator. Your money has turned into fine gold./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_138_0"
);
73
        msgnextsubloc("* In total^1, you reached \\cY~1 Gold\\cW./", string(global.flag[898]), "obj_dw_churchb_moneyfountain_slash_Step_0_gml_139_0");
74
        if (other.bonus)
75
        {
76
            
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
77
            msgsetloc(0, 
* You are one of the donators.Wait for input
"* You are one of the donators./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_144_0"
);
78
            msgnextsubloc("* Between you and another^1, you reached \\cY~1 Gold\\cW./", string(global.flag[898] + other.bonus), "obj_dw_churchb_moneyfountain_slash_Step_0_gml_145_0");
79
        }
80
        if (money > 0 && money < 100)
81
            msgnextloc(
* Although small,Delay 11 such actions may inspire others.Wait for input
"* Although small^1, such actions may inspire others./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_150_0"
);
82
        if (money >= 100 && money < 500)
83
            msgnextloc(
* Although you may have felt a bit flushed,Delay 11 it was certainly the right move.Wait for input
"* Although you may have felt a bit flushed^1, it was certainly the right move./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_154_0"
);
84
        if (money >= 500 && money < 2000)
85
            msgnextloc(
* The National Mint would like to award you for your service.Wait for input
"* The National Mint would like to award you for your service./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_158_0"
);
86
        if (money >= 2000 && money < 9999)
87
            msgnextloc(
* The heavens were certainly moved to tears by your generosity.Wait for input
"* The heavens were certainly moved to tears by your generosity./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_162_0"
);
88
        if (money >= 9999)
89
        {
90
            msgnextloc(
* How absurd...Wait for input
"* How absurd.../", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_166_0"
);
91
            msgnextloc(
* You may as well give money to a spider.Wait for input
"* You may as well give money to a spider./", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_167_0"
);
92
        }
93
        msgnextloc(
* Take what is in the treasure box as if it is yours.Wait for inputClose Message
"* Take what is in the treasure box as if it is yours./%", "obj_dw_churchb_moneyfountain_slash_Step_0_gml_170_0"
);
94
        if (talked)
95
        {
96
        }
97
        d_make();
98
        myinteract = 999;
99
        talked++;
100
    }
101
    if (myinteract > 3 && d_ex())
102
    {
103
        var trig = 0;
104
        if (!i_ex(obj_writer))
105
            trig = 1;
106
        with (obj_writer)
107
        {
108
            if (halt)
109
                trig = 1;
110
        }
111
        if (!trig)
112
            marker.image_index += 0.25;
113
    }
114
    if (myinteract == 999 && !d_ex())
115
    {
116
        myinteract = 0;
117
        marker.image_index = 0;
118
        global.interact = 0;
119
    }
120
}
121
if (econ == 1)
122
{
123
    if (point_distance(obj_mainchara.x, obj_mainchara.y, mynpc.x, mynpc.y) < 120)
124
    {
125
        econ = 2;
126
        mynpc.visible = false;
127
        enemy = instance_create(mynpc.x, mynpc.y, obj_dw_church_organikchaser);
128
        enemy.encounterflag = encounterflag;
129
        enemy.encounterno = encounterno;
130
        setxy(room_width * 4, 0, mynpc);
131
    }
132
}