Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_homealone_vent_overlay_Draw_0

(view raw script w/o annotations or w/e)
1
if (!is_active)
2
    exit;
3
if (!i_ex(obj_homealone_heart))
4
{
5
    if (room == room_lw_noellehouse_closet)
6
    {
7
        draw_set_color(c_black);
8
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + view_wport[0], 99, false);
9
        draw_set_color(c_white);
10
    }
11
    else if (room == room_lw_noellehouse_dess)
12
    {
13
        draw_set_color(c_black);
14
        ossafe_fill_rectangle(0, 0, view_wport[0], 45, false);
15
        ossafe_fill_rectangle(0, cameray(), 19, view_hport[0], false);
16
        draw_set_color(c_white);
17
        gpu_set_blendenable(false);
18
        gpu_set_colorwriteenable(false, false, false, true);
19
        draw_set_alpha(0);
20
        ossafe_fill_rectangle(camerax() + 20, 46, 260, 219, false);
21
        ossafe_fill_rectangle(125, 220, 164, cameray() + view_hport[0], false);
22
        draw_set_alpha(1);
23
        gpu_set_blendenable(true);
24
        gpu_set_colorwriteenable(true, true, true, true);
25
        gpu_set_blendmode_ext(bm_dest_alpha, bm_inv_dest_alpha);
26
        gpu_set_alphatestenable(true);
27
        draw_set_color(c_black);
28
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + view_wport[0], cameray() + view_hport[0], false);
29
        draw_set_color(c_white);
30
        d3d_set_fog(false, c_black, 0, 0);
31
        gpu_set_alphatestenable(false);
32
        gpu_set_blendmode(bm_normal);
33
    }
34
    else if (room == room_lw_noellehouse_noelle)
35
    {
36
        gpu_set_blendenable(false);
37
        gpu_set_colorwriteenable(false, false, false, true);
38
        draw_sprite_ext(bg_noellehouse_noelle_mask, 0, 0, 0, 1, 1, 0, c_white, 1);
39
        gpu_set_blendenable(true);
40
        gpu_set_colorwriteenable(true, true, true, true);
41
        gpu_set_blendmode_ext(bm_dest_alpha, bm_inv_dest_alpha);
42
        gpu_set_alphatestenable(true);
43
        draw_set_color(c_black);
44
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + view_wport[0], cameray() + view_hport[0], false);
45
        draw_set_color(c_white);
46
        d3d_set_fog(false, c_black, 0, 0);
47
        gpu_set_alphatestenable(false);
48
        gpu_set_blendmode(bm_normal);
49
    }
50
    else if (room == room_lw_noellehouse_bathroom)
51
    {
52
        draw_set_color(c_black);
53
        ossafe_fill_rectangle(0, 0, camerax() + view_wport[0], 39, false);
54
        ossafe_fill_rectangle(0, 0, 78, cameray() + view_hport[0], false);
55
        draw_set_color(c_white);
56
    }
57
    else if (room == room_lw_noellehouse_kitchen)
58
    {
59
        draw_set_color(c_black);
60
        ossafe_fill_rectangle(0, 0, 79, room_height, false);
61
        ossafe_fill_rectangle(0, 0, room_width, 29, false);
62
        ossafe_fill_rectangle(0, 220, 119, room_height, false);
63
        ossafe_fill_rectangle(160, 220, room_width, room_height, false);
64
        ossafe_fill_rectangle(648, 29, room_width, room_height, false);
65
        draw_set_color(c_white);
66
    }
67
}
68
else
69
{
70
    if (!is_init)
71
    {
72
        is_init = true;
73
        if (room == room_lw_noellehouse_kitchen)
74
        {
75
            kitchen_exit = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(120, 220, spr_pixel_white);
76
            with (kitchen_exit)
77
            {
78
                image_blend = #201E33;
79
                image_xscale = 10;
80
                image_yscale = 10;
81
                depth = 999990;
82
            }
83
        }
84
    }
85
    if (room == room_lw_noellehouse_noelle)
86
        exit;
87
    gpu_set_blendenable(false);
88
    gpu_set_colorwriteenable(false, false, false, true);
89
    if (room == room_lw_noellehouse_noelle)
90
        draw_sprite_ext(bg_noellehouse_noelle_mask, 0, 0, 0, 1, 1, 0, c_white, 1);
91
    draw_set_alpha(0);
92
    if (obj_homealone_heart.visible)
93
    {
94
        d_circle(obj_homealone_heart.x + 4, obj_homealone_heart.y, circle_radius, false);
95
        draw_set_alpha(1);
96
        
scr_draw_circle_lowres
scr_draw_circle_lowres

function
scr_draw_circle_lowres(arg0, arg1, arg2, arg3, arg4 = false)
{ if (!instance_exists(obj_lowres_circle_manager)) instance_create_depth(0, 0, 0, obj_lowres_circle_manager); with (obj_lowres_circle_manager) draw_func(arg0, arg1, arg2, arg3, arg4); }
(obj_homealone_heart.x + 4, obj_homealone_heart.y, circle_radius, false, true);
97
        draw_set_alpha(0);
98
    }
99
    if (room == room_lw_noellehouse_closet)
100
        ossafe_fill_rectangle(camerax(), 100, camerax() + view_wport[0], cameray() + view_hport[0], false);
101
    if (room == room_lw_noellehouse_dess)
102
    {
103
        ossafe_fill_rectangle(20, 46, 260, 219, false);
104
        var block_door = (!scr_sideb_active() || global.plot > 63) && global.plot == 66;
105
        if (block_door)
106
            ossafe_fill_rectangle(125, 220, 164, cameray() + view_hport[0], false);
107
        if (i_ex(obj_homealone_dess_closet_controller))
108
        {
109
            if (obj_homealone_dess_closet_controller.con > 0)
110
                ossafe_fill_rectangle(108, 1, camerax() + view_wport[0], 120, false);
111
        }
112
    }
113
    if (room == room_lw_noellehouse_kitchen)
114
        ossafe_fill_rectangle(80, 30, 647, 219, false);
115
    if (room == room_lw_noellehouse_bathroom)
116
        ossafe_fill_rectangle(79, 40, 260, 240, false);
117
    draw_set_alpha(1);
118
    gpu_set_blendenable(true);
119
    gpu_set_colorwriteenable(true, true, true, true);
120
    gpu_set_blendmode_ext(bm_dest_alpha, bm_inv_dest_alpha);
121
    gpu_set_alphatestenable(true);
122
    draw_set_color(c_black);
123
    ossafe_fill_rectangle(camerax(), cameray(), camerax() + view_wport[0], cameray() + view_hport[0], false);
124
    draw_set_color(c_white);
125
    d3d_set_fog(false, c_black, 0, 0);
126
    gpu_set_alphatestenable(false);
127
    gpu_set_blendmode(bm_normal);
128
    draw_set_alpha(1);
129
}
130
if (room == room_lw_noellehouse_dess)
131
{
132
    if (global.plot >= 66)
133
    {
134
        draw_set_color(c_black);
135
        draw_set_alpha(0.5);
136
        ossafe_fill_rectangle(0, 45, 108, room_height, false);
137
        ossafe_fill_rectangle(109, 120, room_width + 200, room_height, false);
138
        draw_set_alpha(1);
139
        if (dess_closet_fade_in)
140
            dess_closet_alpha = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(dess_closet_alpha, dess_closet_alpha_target, 0.025);
141
        draw_set_alpha(dess_closet_alpha);
142
        ossafe_fill_rectangle(109, 45, room_width, 119, false);
143
        draw_set_alpha(1);
144
        ossafe_fill_rectangle(0, 0, 108, 45, false);
145
        draw_set_color(c_white);
146
    }
147
    if (dess_closet_cover)
148
    {
149
        draw_sprite_ext(spr_pixel_white, 0, x, -20, 100, 16.5, 0, c_black, 1);
150
        draw_sprite_ext(spr_pixel_white, 0, 260, y + 30, 30, 23, 0, c_black, 1);
151
    }
152
}