Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_treasure_room_Other_10

(view raw script w/o annotations or w/e)
1
with (obj_darkcontroller)
2
    charcon = 0;
3
global.msc = 0;
4
global.typer = 5;
5
if (global.darkzone == 1)
6
    global.typer = 6;
7
global.fc = 0;
8
global.fe = 0;
9
global.interact = 1;
10
image_index = 1;
11
global.msg[0] = stringsetloc(
* (It won't open.)Wait for inputClose Message
"* (It won't open.)/%", "obj_treasure_room_slash_Other_10_gml_14_0"
);
12
if (global.flag[itemflag] == 1)
13
{
14
    global.msg[0] = stringsetloc(
* (The chest is empty.)Wait for inputClose Message
"* (The chest is empty.)/%", "obj_treasure_room_slash_Other_10_gml_18_0"
);
15
}
16
else
17
{
18
    snd_play(snd_locker);
19
    var itemgetstring = 
scr_itemget_anytype_text
scr_itemget_anytype_text

function
scr_itemget_anytype_text()
{ noroom = 0;
scr_itemget_anytype(argument[0], argument[1]);
var itemgetstring = ""; itemname = "NULL"; itemtypename = "NULL"; var _itemtype = argument1; var _itemid = argument0; if (_itemtype == "armor") {
scr_armorinfo(_itemid);
itemname = armornametemp; itemtypename = stringsetloc(
ARMORs
"ARMORs", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_22_0"
);
} else if (_itemtype == "weapon") {
scr_weaponinfo(_itemid);
itemname = weaponnametemp; itemtypename = stringsetloc(
WEAPONs
"WEAPONs", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_29_0"
);
} if (_itemtype == "item") {
scr_iteminfo(_itemid);
itemname = itemnameb; itemtypename = stringsetloc(
ITEMs
"ITEMs", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_36_0"
);
if (_pocketed) itemtypename = stringsetloc(
STORAGE
"STORAGE", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_38_0"
);
} if (_itemtype == "key") {
scr_keyiteminfo(_itemid);
itemname = tempkeyitemname; itemtypename = stringsetloc(
KEY ITEMs
"KEY ITEMs", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_44_0"
);
} if (_itemtype == "money") { noroom = 0; itemtypename = stringsetloc(
MONEY HOLE
"MONEY HOLE", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_51_0"
);
itemname = string(_itemid) + stringsetloc(
Dark Dollars
" Dark Dollars", "scr_itemget_anytype_text_slash_scr_itemget_anytype_text_gml_52_0"
);
} if (noroom == 0) itemgetstring = stringsetsubloc("* (\\cY~1\\cW was added to your \\cY~2\\cW.)", itemname, itemtypename, "obj_treasure_room_slash_Other_10_gml_76_0"); else itemgetstring = stringsetsubloc("* (You have too many \\cY~2\\cW to take \\cY~1\\c0.)", itemname, itemtypename, "obj_treasure_room_slash_Other_10_gml_83_0"); if (argument_count >= 3) itemgetstring += argument[2]; else itemgetstring += "/%"; return itemgetstring; }
(itemidchest, itemtype);
20
    msgsetsubloc(0, "* (You opened the treasure chest.^1)&* (Inside was \\cY~1\\cW.)/", itemname, "obj_treasure_room_slash_Other_10_gml_65_0");
21
    msgnext(itemgetstring);
22
    if (noroom == 0)
23
    {
24
        with (obj_event_manager)
25
            trigger_event(UnknownEnum.Value_0, UnknownEnum.Value_23, UnknownEnum.Value_939);
26
    }
27
    if (noroom == 0)
28
        global.flag[itemflag] = 1;
29
    else
30
        close = 1;
31
}
32
if (extraevent == 1)
33
{
34
    if (room == room_dw_cyber_maze_tasque && global.flag[467 chestmark_opened] == 0)
35
    {
36
        checkscreen = instance_create(1200, 520, obj_queenscreen);
37
        checkscreen.extflag = 4;
38
        checkscreen.image_index = 10;
39
        global.flag[467 chestmark_opened] = 1;
40
        extraevent = 0;
41
    }
42
}
43
myinteract = 3;
44
mydialoguer = instance_create(0, 0, obj_dialoguer);
45
talked += 1;
46
47
enum UnknownEnum
48
{
49
    Value_0,
50
    Value_23 = 23,
51
    Value_939 = 939
52
}