Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_mainchara_Draw_0

(view raw script w/o annotations or w/e)
1
draw_self();
2
if (button1_p() && 
scr_debug
scr_debug

function
scr_debug()
{ return global.debug; }
())
3
{
4
    if (global.darkzone == 0)
5
    {
6
        draw_set_color(c_red);
7
        if (global.facing == 1)
8
            draw_rectangle(x + (sprite_width / 2), y + 6 + (sprite_height / 2), x + sprite_width + 13, y + sprite_height, true);
9
        if (global.facing == 3)
10
            draw_rectangle(x + (sprite_width / 2), y + 6 + (sprite_height / 2), x - 13, y + sprite_height, true);
11
        if (global.facing == 0)
12
            draw_rectangle(x + 4, y + 28, (x + sprite_width) - 4, y + sprite_height + 15, true);
13
        if (global.facing == 2)
14
            draw_rectangle(x + 3, (y + sprite_height) - 5, (x + sprite_width) - 5, y + 5, true);
15
    }
16
    if (global.darkzone == 1)
17
    {
18
        draw_set_color(c_red);
19
        if (global.facing == 1)
20
            draw_rectangle(x + (sprite_width / 2), y + 12 + (sprite_height / 2), x + sprite_width + 26, y + sprite_height, true);
21
        if (global.facing == 3)
22
            draw_rectangle(x + (sprite_width / 2), y + 12 + (sprite_height / 2), x - 26, y + sprite_height, true);
23
        if (global.facing == 0)
24
            draw_rectangle(x + 4, y + 56, (x + sprite_width) - 8, y + sprite_height + 30, true);
25
        if (global.facing == 2)
26
            draw_rectangle(x + 3, (y + sprite_height) - 10, (x + sprite_width) - 10, y + 10, true);
27
    }
28
}
29
if (battlemode == 1)
30
{
31
    becamebattle = 1;
32
    if (battlealpha < 0.8)
33
        battlealpha += 0.04;
34
    global.heartx = (x + 12) - __view_get(e__VW.XView, 0);
35
    global.hearty = (y + 40) - __view_get(e__VW.YView, 0);
36
}
37
else if (battlealpha > 0)
38
{
39
    battlealpha -= 0.08;
40
}
41
battleheart.image_alpha = battlealpha;
42
if (fun == 0)
43
{
44
    if (global.facing == 0)
45
        draw_sprite_ext(spr_krisd_heart, image_index, x, y, image_xscale, image_yscale, 0, image_blend, battlealpha);
46
    if (global.facing == 1)
47
        draw_sprite_ext(spr_krisr_heart, image_index, x, y, image_xscale, image_yscale, 0, image_blend, battlealpha);
48
    if (global.facing == 2)
49
        draw_sprite_ext(spr_krisu_heart, image_index, x, y, image_xscale, image_yscale, 0, image_blend, battlealpha);
50
    if (global.facing == 3)
51
        draw_sprite_ext(spr_krisl_heart, image_index, x, y, image_xscale, image_yscale, 0, image_blend, battlealpha);
52
}
53
else if (sprite_index == spr_krisd_slide)
54
{
55
    draw_sprite_ext(spr_krisd_slide_heart, image_index, x, y, image_xscale, image_yscale, 0, image_blend, battlealpha);
56
}
57
draw_sprite_ext(spr_heart_outline2, 0, x + 12, y + 40, 1, 1, 0, c_white, battlealpha * 2);
58
battleheart.x = x + 12;
59
battleheart.y = y + 40;
60
if (battlemode == 4)
61
{
62
    draw_set_color(c_lime);
63
    draw_set_alpha(0.5);
64
    draw_rectangle(x + 12, y + 40, x + 27, y + 49, 0);
65
    draw_line(x + 12, y + 49, x + 19, y + 57);
66
    draw_line(x + 26, y + 49, x + 19, y + 57);
67
    draw_set_alpha(1);
68
}
69
if (
scr_debug
scr_debug

function
scr_debug()
{ return global.debug; }
())
70
    draw_set_color(c_red);
71
72
enum e__VW
73
{
74
    XView,
75
    YView,
76
    WView,
77
    HView,
78
    Angle,
79
    HBorder,
80
    VBorder,
81
    HSpeed,
82
    VSpeed,
83
    Object,
84
    Visible,
85
    XPort,
86
    YPort,
87
    WPort,
88
    HPort,
89
    Camera,
90
    SurfaceID
91
}