Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_combo_bounce_Step_0

(view raw script w/o annotations or w/e)
1
if (active)
2
    image_blend = c_white;
3
else
4
    image_blend = merge_colour(c_white, c_navy, 0.5);
5
if (hp < (hp_max * 0.75))
6
{
7
    var a = 
scr_afterimagefast
scr_afterimagefast

function
scr_afterimagefast()
{ afterimage = instance_create(x, y, obj_afterimage); 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; afterimage.fadeSpeed = 0.08; return afterimage; }
();
8
    a.image_xscale = image_xscale * xscale * sc;
9
    a.image_yscale = image_yscale * yscale * sc;
10
    a.image_angle = angle;
11
    a.fadeSpeed = 0.25;
12
}
13
if (action == 0)
14
{
15
    with (obj_mike_battle)
16
    {
17
        x += ((other.x - x) * 0.1);
18
        y += ((other.y - y) * 0.1);
19
        action = 3;
20
    }
21
    circle_scale = 
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; }
(circle_scale, 200, 3);
22
    if (circle_scale == 200)
23
    {
24
        action = 1;
25
        with (obj_mike_battle)
26
        {
27
            x = xstart;
28
            y = ystart;
29
            visible = false;
30
            move = true;
31
            action = 0;
32
            var a = snd_play(snd_boost);
33
            sound_volume(a, 0.25, 0);
34
        }
35
    }
36
}
37
if (action == 1)
38
{
39
    circle_scale += circle_speed;
40
    circle_speed += 1;
41
    circle_alpha -= 0.05;
42
    if (circle_alpha <= 0)
43
    {
44
        action = 2;
45
        with (obj_mike_attack_controller)
46
            wave = 1;
47
    }
48
}
49
if (action == 2)
50
{
51
    timer += 1;
52
    if (timer > 15)
53
        y += (((cameray() + 120) - y) * 0.2);
54
    if (timer > 30)
55
    {
56
        action = 3;
57
        tail = 15;
58
        sound_play(snd_screenshake);
59
        motion_set(point_direction(x, y, camerax() + 200, cameray() + cameraheight()), 8);
60
        timer = 0;
61
        with (obj_mike_attack_controller)
62
            wave = 2;
63
    }
64
}
65
if (action > 0)
66
{
67
    angle += (rot_speed + speed);
68
    xscale += ((2 - xscale) * 0.2);
69
    yscale = xscale;
70
    cooldown -= 1;
71
}
72
if (action == 3)
73
{
74
    speed = 
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; }
(speed, maxspeed, 0.5);
75
    bounce -= 1;
76
    if (cooldown == 0)
77
        friction = 0;
78
    if (cooldown < 0)
79
    {
80
        if (hp > (hp_max * 0.75))
81
            active = true;
82
        rot_speed2 = 
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; }
(rot_speed2, 2 + ((1 - (hp / hp_max)) * 2), 1);
83
        rot_speed += ((rot_speed2 - rot_speed) * 0.2);
84
    }
85
    else
86
    {
87
        rot_speed = 
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; }
(rot_speed, 0, 4);
88
        active = false;
89
    }
90
}
91
if (hp <= 0 && action < 6)
92
{
93
    action = 6;
94
    timer = 0;
95
    active = false;
96
}
97
if (shake)
98
    
scr_shakescreen
scr_shakescreen

function
scr_shakescreen(arg0 = 4, arg1 = 4)
{ var shaker = instance_create(x, y, obj_shake); if (i_ex(shaker)) { shaker.shakex = arg0; shaker.shakey = arg1; } }
();
99
if (action == 6)
100
{
101
    timer += 1;
102
    if (timer > 90)
103
    {
104
        mus_volume(global.currentsong[1], 1, 100);
105
        shake = 0;
106
        with (obj_mike_attack_controller)
107
        {
108
            action = 16;
109
            wave = 0;
110
            timer = 0;
111
            mike = 3;
112
            txt_wait = 5;
113
            move_party = true;
114
        }
115
        with (obj_herokris)
116
            idlesprite = spr_krisb_idle;
117
        with (obj_herosusie)
118
        {
119
            idlesprite = spr_susieb_idle;
120
            if (global.charweapon[2] == 0)
121
                idlesprite = spr_susieb_idle_unarmed;
122
        }
123
        with (obj_heroralsei)
124
        {
125
            y = ystart;
126
            state = 0;
127
            idlesprite = spr_ralsei_idle;
128
        }
129
        with (obj_heroparent)
130
            sprite_index = idlesprite;
131
        with (obj_mike_battle)
132
        {
133
            move = false;
134
            action = 0;
135
            visible = true;
136
            y = ystart;
137
        }
138
        instance_destroy();
139
    }
140
}
141
if (hp > 1 && hp < hp_max)
142
    hp = 
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; }
(hp, 1, dot);