Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_darkness_overlay_Draw_0

(view raw script w/o annotations or w/e)
1
if (scalecon == 1 && scale > 2.2)
2
    scale -= 0.03;
3
if (scalecon == 2 && scale < 8)
4
    scale += 0.2;
5
if (scalecon == 3 && scale > 2.2)
6
    scale -= 0.2;
7
var _shadowpower_scale = 0;
8
if (i_ex(obj_spearblocker))
9
    _shadowpower_scale = lerp(0, -1, obj_spearblocker.shadowpower / 1);
10
if (!surface_exists(_surface))
11
    _surface = surface_create(room_width, room_height);
12
surface_set_target(_surface);
13
draw_clear_alpha(c_white, 0);
14
var aa = 0;
15
draw_set_color(c_black);
16
ossafe_fill_rectangle(camerax() - 10, cameray() - 10, camerax() + camerawidth() + 10, cameray() + cameraheight() + 10, false);
17
draw_set_color(c_white);
18
draw_set_blend_mode(bm_subtract);
19
if (i_ex(obj_heart))
20
    draw_sprite_ext(spr_light_vfx, image_index, obj_heart.x + 10, obj_heart.y + 10, scale + _shadowpower_scale, scale + _shadowpower_scale, 0, image_blend, 1);
21
else
22
    draw_sprite_ext(spr_light_vfx, image_index, camerax() + 310, cameray() + 230, scale + _shadowpower_scale, scale + _shadowpower_scale, 0, image_blend, 1);
23
for (var i = 0; i < instance_number(obj_gerson_darkness_overlay_light); i++)
24
{
25
    light[i] = instance_find(obj_gerson_darkness_overlay_light, i);
26
    draw_sprite_ext(spr_light_vfx, 0, light[i].x, light[i].y, light[i].image_xscale, light[i].image_yscale, 0, c_white, light[i].image_alpha);
27
}
28
draw_set_blend_mode(bm_normal);
29
surface_reset_target();
30
draw_surface_ext(_surface, 0, 0, 1, 1, 0, c_white, image_alpha);