Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_shinobeetle_enemy_Draw_0

related scripts: Alarm_4Create_0Draw_0 Other_22Step_0

(view raw script w/o annotations or w/e)
1
var a = 6.5;
2
draw_set_color(c_white);
3
if (state == 3 && hurttimer >= 0)
4
    draw_sprite_ext(hurtsprite, hurttimer / 2, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
5
if (state == 0)
6
{
7
    if (flash == 1)
8
        fsiner++;
9
    siner += 0.16666666666666666;
10
    if (global.mercymod[myself] >= global.mercymax[myself] && 
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 1 && !i_ex(obj_seth_shinobeetle_controller))
11
    {
12
        draw_monster_body_part(sparedsprite, siner, x, y);
13
    }
14
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 1 && !i_ex(obj_seth_shinobeetle_controller))
15
    {
16
        if (alone == false)
17
        {
18
            alone = true;
19
            
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; with (obj_dmgwriter) { if (type == 5 && mercytimer < 8) _playsound = 0; } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; return __mercydmgwriter; }
(myself, 100);
20
        }
21
        draw_monster_body_part(spr_shinobeetle_spare_alone, siner, x, y);
22
    }
23
    else if (global.mercymod[myself] >= global.mercymax[myself])
24
    {
25
        draw_monster_body_part(sparedsprite, siner, x, y);
26
    }
27
    else
28
    {
29
        draw_sprite_ext(spr_shinobeetle_wings_l, 0, x + 24, y + 74 + (sin(siner) * 2), image_xscale, image_yscale, rightwingangle + (sin(wingsiner + a) * 30), image_blend, image_alpha);
30
        if (flash == 1)
31
            draw_sprite_ext_flash(spr_shinobeetle_wings_l, 0, x + 24, y + 74 + (sin(siner) * 2), image_xscale, image_yscale, rightwingangle + (sin(wingsiner + a) * 30), image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
32
        draw_sprite_ext(spr_shinobeetle_wings_r, 0, x + 58, y + 60 + (sin(siner) * 2), image_xscale, image_yscale, leftwingangle - (sin(wingsiner + a) * 30), image_blend, image_alpha);
33
        if (flash == 1)
34
            draw_sprite_ext_flash(spr_shinobeetle_wings_r, 0, x + 58, y + 60 + (sin(siner) * 2), image_xscale, image_yscale, leftwingangle - (sin(wingsiner + a) * 30), image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
35
        draw_monster_body_part(spr_shinobeetle_body, 0, x, y + (sin(siner) * 1.5));
36
        draw_monster_body_part(spr_shinobeetle_feet, 0, x, y);
37
        draw_monster_body_part(spr_shinobeetle_arms, 0, x, y + (sin(siner) * 3));
38
    }
39
}
40
if (becomeflash == 0)
41
    flash = 0;
42
becomeflash = 0;
43
if (wingcon == 0)
44
{
45
    wingtimer++;
46
    if (wingtimer == wingtimermax)
47
    {
48
        wingcon = 1;
49
        wingtimer = 0;
50
        wingtimermax = 60 + irandom(90);
51
    }
52
}
53
if (wingcon == 1)
54
{
55
    wingtimer++;
56
    wingsiner += 1;
57
    if (wingtimer == 20)
58
    {
59
        wingcon = 0;
60
        wingtimer = 0;
61
        wingsiner = 0;
62
    }
63
}