Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_mizzleencounter_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    var dontbell = false;
4
    if (global.flag[1798] == 1)
5
        dontbell = 1;
6
    if (!dontbell)
7
    {
8
        var bellpos = 
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; }
("gen", "bellbingbong");
9
        bell = instance_create(bellpos[0], bellpos[1], obj_bell_small_playable);
10
        
scr_size
scr_size

function
scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{ with (arg2) { image_xscale = arg0; image_yscale = arg1; } }
(2, 2, bell);
11
    }
12
    else
13
    {
14
        belltime = -999;
15
    }
16
    init = 1;
17
}
18
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
19
{
20
    if (keyboard_check(ord("W")) && keyboard_check_pressed(ord("V")))
21
    {
22
        var pos = -4;
23
        with (obj_climbloc)
24
            pos = id;
25
        setxy(bell.x, pos.y, 1049);
26
    }
27
}
28
if (belltime == 0)
29
{
30
    if (bell.con == 1)
31
    {
32
        global.flag[1544] = 1;
33
        belltime = 1;
34
        bell.canring = false;
35
        with (obj_dw_church_watercooler)
36
        {
37
            if (con == 0)
38
            {
39
                con = 1;
40
                doappear = 1;
41
            }
42
            mizzle.con = 20;
43
            mizzle.alerted = 1;
44
            with (mizzle)
45
                scr_delay_var("con", 30, 30);
46
        }
47
        with (obj_event_manager)
48
            trigger_event(UnknownEnum.Value_0, UnknownEnum.Value_27);
49
    }
50
}
51
if (i_ex(bell))
52
{
53
    if (belltime < 20)
54
    {
55
        var trig = 0;
56
        with (obj_battleback)
57
        {
58
            if (image_alpha == 1)
59
                trig = 1;
60
        }
61
        if (trig == 1)
62
        {
63
            safe_delete(bell);
64
            belltime = -1;
65
        }
66
    }
67
}
68
69
enum UnknownEnum
70
{
71
    Value_0,
72
    Value_27 = 27
73
}