Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_sethglasses_miniboss_Draw_0

related scripts: CleanUp_0Collision_obj_plat_enm_smallgloveCollision_obj_plat_susieaxe_hbxCreate_0Draw_0 Other_20PreCreate_0Step_0Step_2

(view raw script w/o annotations or w/e)
1
image_index = 0;
2
if (!surface_exists(glasssurf))
3
    glasssurf = surface_create(sprite_width + 40, sprite_height + 40);
4
var xx = x;
5
var yy = y;
6
var xs = image_xscale;
7
var ys = image_yscale;
8
var ia = image_angle;
9
surface_set_target(glasssurf);
10
draw_clear_alpha(c_black, 0);
11
var surfw = surface_get_width(glasssurf);
12
var surfh = surface_get_height(glasssurf);
13
x = 0.5 * surfw;
14
y = 0.5 * surfh;
15
image_xscale = 1;
16
image_yscale = 1;
17
image_angle = 0;
18
if (auraalph > 0)
19
    
scr_draw_outline
scr_draw_outline

function
scr_draw_outline(arg0, arg1, arg2)
{ gpu_set_fog(true, arg1, 0, 0); var __xdirA = arg0; var __xdirB = 0; var __ydirA = 0; var __ydirB = arg0; if ((image_angle % 90) != 0) { __xdirA = lengthdir_x(arg0, image_angle); __xdirB = lengthdir_x(arg0, image_angle + 90); __ydirA = lengthdir_y(arg0, image_angle + 90); __ydirB = lengthdir_y(arg0, image_angle); } draw_sprite_ext(sprite_index, image_index, x + __xdirA, y + __ydirA, image_xscale, image_yscale, image_angle, c_white, image_alpha * arg2); draw_sprite_ext(sprite_index, image_index, x - __xdirA, y - __ydirA, image_xscale, image_yscale, image_angle, c_white, image_alpha * arg2); draw_sprite_ext(sprite_index, image_index, x + __xdirB, y + __ydirB, image_xscale, image_yscale, image_angle, c_white, image_alpha * arg2); draw_sprite_ext(sprite_index, image_index, x - __xdirB, y - __ydirB, image_xscale, image_yscale, image_angle, c_white, image_alpha * arg2); gpu_set_fog(false, c_white, 0, 0); }
(1, 8421504, auraalph);
20
event_inherited();
21
shader_replace_simple_set_hook(10);
22
shader_set_uniform_f(__grayscalefade, clamp01(hp / __max_hp));
23
image_index = 1;
24
image_alpha = left_lens_opacity * imagealpha;
25
draw_self();
26
if (lefthp < (30 - (10 * simple)))
27
    draw_sprite_ext(spr_fsethglasses_cracks_l, 0, 0.5 * surfw, 0.5 * surfh, 1, 1, 0, c_white, imagealpha);
28
image_index = 2;
29
image_alpha = right_lens_opacity * imagealpha;
30
draw_self();
31
if (righthp < (30 - (10 * simple)))
32
    draw_sprite_ext(spr_fsethglasses_cracks_r, 0, 0.5 * surfw, 0.5 * surfh, 1, 1, 0, c_white, imagealpha);
33
shader_replace_simple_reset_hook();
34
image_alpha = imagealpha;
35
image_index = 0;
36
surface_reset_target();
37
x = xx;
38
y = yy;
39
image_xscale = xs;
40
image_yscale = ys;
41
image_angle = ia;
42
xx = (x - lengthdir_x(surfw, image_angle)) + lengthdir_y(surfh, image_angle);
43
yy = y - lengthdir_y(surfw, image_angle) - lengthdir_x(surfh, image_angle);
44
draw_surface_ext(glasssurf, xx, yy, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
45
if (auraalph >= 0)
46
{
47
    var t = current_time * 0.035;
48
    shader_replace_simple_set_hook(18);
49
    shader_set_uniform_f(u_alpha, auraalph);
50
    shader_set_uniform_f(u_patternangle, 50);
51
    shader_set_uniform_f(u_patterncount, 0.1);
52
    shader_set_uniform_f(u_time, 0.033 * t, 0.333 + (0.333 * t), 0.666 + (0.333 * t));
53
    shader_set_uniform_f(u_holoangle, 0);
54
    gpu_set_blendmode(bm_add);
55
    var blend = image_blend;
56
    ia = image_alpha;
57
    image_blend = c_white;
58
    image_alpha = 0.7;
59
    draw_surface_ext(glasssurf, xx, yy, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
60
    image_alpha = ia;
61
    image_blend = blend;
62
    gpu_set_blendmode(bm_normal);
63
    shader_replace_simple_reset_hook();
64
}
65
if (remaining_combo > 0)
66
    scr_plat_draw_dizzy_effects(remaining_combo, remaining_combo_max);