Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_bqueen_breath_controller_Draw_0

(view raw script w/o annotations or w/e)
1
draw_sprite_ext(sprite_index, image_index, x, y + 133, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
2
timer++;
3
timer2++;
4
if (introtimer == 0)
5
{
6
    repeat (34)
7
    {
8
        siner += (0.28 * amplitude);
9
        if (difficulty == 0)
10
            siner += 0.2;
11
        amplitude = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(amplitude, maxamplitude, 0.03);
12
    }
13
    introtimer = 34;
14
}
15
introtimer++;
16
if (introtimer < 35 || introtimer > 70)
17
{
18
    siner += (0.28 * amplitude);
19
    if (difficulty == 0)
20
        siner += 0.2;
21
    amplitude = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(amplitude, maxamplitude, 0.03);
22
}
23
place1 = 270 + (sin(siner / 6) * 40 * amplitude);
24
place2 = 270 + (sin((siner + 50) / 6) * 40 * amplitude);
25
if (introtimer < 35)
26
    exit;
27
if (timer > 9)
28
{
29
    bulletcount++;
30
    if (bulletcount == bulletcountmax)
31
    {
32
        timer = 3;
33
        bulletcount = 0;
34
        if (difficulty == 0)
35
            bulletcountmax = choose(2, 3, 4);
36
        if (difficulty == 1)
37
            bulletcountmax = choose(2, 3, 4, 5);
38
    }
39
    else
40
    {
41
        snd_stop(snd_rocket);
42
        snd_play_pitch(snd_rocket, 0.5 + random(1));
43
        d = instance_create(x, y, obj_bqueen_breath);
44
        with (d)
45
            
scr_afterimage_grow
scr_afterimage_grow

function
scr_afterimage_grow()
{ afterimage = instance_create(x, y, obj_afterimage_grow); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
46
        d.damage = damage;
47
        d.target = target;
48
        d.type = 1;
49
        d.image_angle = obj_bqueen_breath_controller.place1;
50
        d.depth = bulletdepth;
51
        d.rotator_target = id;
52
        timer = 5;
53
    }
54
}
55
if (timer2 > 9 && difficulty == 1)
56
{
57
    bulletcount2++;
58
    if (bulletcount2 == bulletcount2max)
59
    {
60
        timer2 = 3;
61
        bulletcount2 = 0;
62
        if (difficulty == 0)
63
            bulletcountmax = choose(1, 2, 3, 4);
64
        if (difficulty == 1)
65
            bulletcount2max = choose(2, 3, 4, 5);
66
    }
67
    else
68
    {
69
        snd_stop(snd_rocket);
70
        snd_play_pitch(snd_rocket, 0.5 + random(1));
71
        d = instance_create(x, y, obj_bqueen_breath);
72
        with (d)
73
            
scr_afterimage_grow
scr_afterimage_grow

function
scr_afterimage_grow()
{ afterimage = instance_create(x, y, obj_afterimage_grow); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
74
        d.damage = damage;
75
        d.target = target;
76
        d.type = 2;
77
        d.image_angle = obj_bqueen_breath_controller.place2;
78
        d.depth = bulletdepth;
79
        d.rotator_target = id;
80
        timer2 = 5;
81
    }
82
}
83
if (global.turntimer < 3)
84
    instance_destroy();