Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_treasure_room_Create_0

related scripts: Create_0 Draw_0Other_10PreCreate_0Step_1

(view raw script w/o annotations or w/e)
1
myinteract = 0;
2
talked = 0;
3
image_speed = 0;
4
itemflag = 104;
5
itemtype = "armor";
6
itemidchest = 4;
7
close = 0;
8
extratext = 0;
9
extraevent = 0;
10
tempchest = false;
11
needsitem = false;
12
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
13
{
14
    itemidchest = 0;
15
    itemflag = 1999;
16
    itemtype = "item";
17
}
18
noflag = false;
19
if (global.darkzone == 1)
20
{
21
    image_xscale = 2;
22
    image_yscale = 2;
23
}
24
if (room == room_dw_castle_west_cliff)
25
{
26
    itemidchest = 21;
27
    itemflag = 142;
28
    var qualify = 0;
29
    if (global.flag[468 spamton_no_room] > 0)
30
        qualify = 1;
31
    if (global.flag[142 got_spamton_chest] == 1)
32
        qualify = 0;
33
    if (global.flag[571 encount_spamton_neo] == 1 || global.flag[468 spamton_no_room] == 2)
34
        itemtype = "weapon";
35
    else
36
        itemtype = "armor";
37
    if (
scr_armorcheck_equipped_party
scr_armorcheck_equipped_party

function
scr_armorcheck_equipped_party(arg0)
{ var __totalwearing = 0; for (var __weari = 0; __weari < 3; __weari++) { if (global.char[__weari] != 0) __totalwearing +=
scr_armorcheck_equipped(global.char[__weari], arg0);
} return __totalwearing; }
(21) > 0 ||
scr_armorcheck_inventory
scr_armorcheck_inventory

function
scr_armorcheck_inventory(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 48; i += 1) { if (global.armor[i] == arg0) haveit = 1; if (global.armor[i] == arg0) itemcount += 1; } return haveit; }
(21) > 0 ||
scr_weaponcheck_inventory
scr_weaponcheck_inventory

function
scr_weaponcheck_inventory(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 48; i += 1) { if (global.weapon[i] == arg0) haveit = 1; if (global.weapon[i] == arg0) itemcount += 1; } return haveit; }
(21) > 0 ||
scr_weaponcheck_equipped_party
scr_weaponcheck_equipped_party

function
scr_weaponcheck_equipped_party(arg0)
{ var __totalwearing = 0; for (var __weari = 0; __weari < 3; __weari++) { if (global.char[__weari] != 0) __totalwearing +=
scr_weaponcheck_equipped(global.char[__weari], arg0);
} return __totalwearing; }
(21) > 0)
38
        qualify = 0;
39
    if (qualify == 0)
40
    {
41
        instance_destroy();
42
        visible = 0;
43
    }
44
}
45
if (room == room_dw_church_darkmaze || i_ex(obj_dw_church_darkmaze))
46
{
47
    itemflag = 871;
48
    itemtype = "nothing";
49
}
50
if (room == room_dw_church_pianopiece_left || i_ex(obj_dw_church_pianopiece_left))
51
{
52
    itemflag = 894;
53
    itemtype = "item";
54
    itemidchest = 62;
55
}
56
if (room == room_dw_church_worshiproom)
57
{
58
    itemtype = "armor";
59
    itemidchest = 51;
60
    itemflag = 1517;
61
}
62
if (room == room_dw_churchb_worshiproom)
63
{
64
    itemtype = "armor";
65
    itemidchest = 52;
66
    itemflag = 1517;
67
}
68
if (room == room_dw_churchb_library || i_ex(obj_dw_churchb_library))
69
{
70
    itemtype = "item";
71
    itemidchest = 2;
72
    itemflag = 1540;
73
}
74
if (extflag == "ripseqtreasure")
75
{
76
    itemtype = "item";
77
    itemidchest = 62;
78
    itemflag = 1550;
79
}
80
if (i_ex(obj_dw_churchb_prophecymaze))
81
{
82
    itemtype = "item";
83
    itemidchest = 62;
84
    itemflag = 1581;
85
}
86
if (i_ex(obj_dw_church_sideclimb))
87
{
88
    itemtype = "armor";
89
    itemidchest = 52;
90
    itemflag = 863;
91
}
92
if (i_ex(obj_dw_church_bookshelfpuzzle))
93
{
94
    itemtype = "weapon";
95
    itemidchest = 54;
96
    itemflag = 1582;
97
}
98
if (room == room_dw_churchb_libraryconnector || i_ex(obj_dw_churchb_libraryconnector))
99
{
100
    itemtype = "item";
101
    itemidchest = 61;
102
    itemflag = 1539;
103
}
104
if (room == room_dw_churchb_gallery || i_ex(obj_dw_churchb_gallery))
105
{
106
    itemflag = 1545;
107
    itemtype = "money";
108
    itemidchest = 500;
109
}
110
if (room == room_dw_church_rightconnect || i_ex(obj_dw_church_rightconnect))
111
{
112
    itemtype = "weapon";
113
    itemidchest = 53;
114
    itemflag = 1586;
115
}
116
if (room == room_dw_church_minorlegend || i_ex(obj_dw_church_minorlegend))
117
{
118
    itemtype = "item";
119
    itemidchest = 61;
120
    itemflag = 1587;
121
}
122
if (room == room_dw_church_pianopiece_right || i_ex(obj_dw_church_pianopiece_right))
123
{
124
    itemtype = "item";
125
    itemidchest = 2;
126
    itemflag = 1588;
127
}
128
if (room == room_dw_church_trueclimbadventure || i_ex(obj_dw_church_trueclimbadventure))
129
{
130
    itemflag = 1589;
131
    itemtype = "item";
132
    itemidchest = 28;
133
}
134
if (room == room_dw_church_jackenstein || i_ex(obj_dw_church_jackenstein))
135
{
136
    itemflag = 1590;
137
    itemtype = "money";
138
    itemidchest = 500;
139
}
140
if (room == room_dw_churchc_encounter2 || i_ex(obj_dw_churchc_encounter2))
141
{
142
    itemflag = 1614;
143
    itemtype = "money";
144
    itemidchest = 100;
145
    image_blend = c_black;
146
}
147
if (room == room_dw_churchc_treasurechest || i_ex(obj_dw_churchc_treasurechest))
148
{
149
    itemflag = 1616;
150
    itemtype = "armor";
151
    itemidchest = 50;
152
}
153
if (i_ex(obj_dw_churchc_prophecies) || room == room_dw_churchc_prophecies)
154
{
155
    itemflag = 1610;
156
    itemtype = "armor";
157
    itemidchest = 53;
158
}
159
if (room == room_dw_church_dogclimb)
160
{
161
    itemflag = 1638;
162
    itemtype = "item";
163
    itemidchest = 33;
164
}
165
if (room == room_dw_churchb_moneyfountain || instance_exists(obj_dw_churchb_moneyfountain))
166
{
167
    itemflag = 1537;
168
    var val = global.flag[898] + obj_dw_churchb_moneyfountain.bonus;
169
    itemtype = "item";
170
    itemidchest = 1;
171
    if (val >= 100)
172
    {
173
        itemtype = "item";
174
        itemidchest = 62;
175
    }
176
    if (val >= 500)
177
    {
178
        itemtype = "item";
179
        itemidchest = 2;
180
    }
181
    if (val >= 2000)
182
    {
183
        itemtype = "item";
184
        itemidchest = 63;
185
    }
186
    if (val >= 9999)
187
    {
188
        itemtype = "armor";
189
        itemidchest = 54;
190
    }
191
}
192
if (room == room_dw_castle_tv_zone_3)
193
{
194
    itemflag = 1703;
195
    itemtype = "item";
196
    itemidchest = 34;
197
}
198
if (global.flag[itemflag] == 1)
199
    image_index = 1;
200
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
201
init = 0;