Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_maushwheel_lightning_orb_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (timer < 24)
3
{
4
    obj_mauswheel_enemy.image_speed += 0.08;
5
    _pitch += 0.02;
6
    snd_pitch(snd_sneo_overpower, _pitch);
7
}
8
if (timer > 0 && timer < 16)
9
{
10
    d = instance_create(x, y, obj_rouxls_power_up_orb);
11
    d.direction = irandom(360);
12
    d.lifetime = 12;
13
    d.depth = depth + 1;
14
    d.image_blend = image_blend;
15
}
16
if (timer > 0 && timer < 24)
17
{
18
    image_xscale += 0.025;
19
    image_yscale += 0.025;
20
}
21
if (timer == 24)
22
{
23
    if (goal == 100)
24
        move_towards_point(median(obj_heart.x, obj_growtangle.x), median(obj_heart.y, obj_growtangle.y), 4.5);
25
    else
26
        move_towards_point(obj_heart.x, obj_heart.y, 5);
27
    var randoffset = irandom(360);
28
    var new_bullet = -4;
29
    new_bullet = instance_create(x + lengthdir_x(8, randoffset), y + lengthdir_y(8, randoffset), obj_mauswheel_lightning_orb_ball);
30
    scr_bullet_inherit
scr_bullet_inherit

function scr_bullet_inherit(arg0) { if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; arg0.element = element; } }
(new_bullet);
31
    new_bullet.source = id;
32
    new_bullet = instance_create(x + lengthdir_x(8, randoffset + 120), y + lengthdir_y(8, randoffset + 120), obj_mauswheel_lightning_orb_ball);
33
    scr_bullet_inherit
scr_bullet_inherit

function scr_bullet_inherit(arg0) { if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; arg0.element = element; } }
(new_bullet);
34
    new_bullet.source = id;
35
    new_bullet = instance_create(x + lengthdir_x(8, randoffset - 120), y + lengthdir_y(8, randoffset - 120), obj_mauswheel_lightning_orb_ball);
36
    scr_bullet_inherit
scr_bullet_inherit

function scr_bullet_inherit(arg0) { if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; arg0.element = element; } }
(new_bullet);
37
    new_bullet.source = id;
38
    active = false;
39
    visible = false;
40
    mask_index = spr_nothing;
41
    scr_lerpvar_instance
scr_lerpvar_instance

function scr_lerpvar_instance() { __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; }
(obj_mauswheel_enemy.id, "image_speed", obj_mauswheel_enemy.image_speed, 0.5, 8);
42
    snd_stop(snd_sneo_overpower);
43
    snd_play(snd_chargeshot_fire);
44
    with (obj_rouxls_power_up_orb)
45
        instance_destroy();
46
}
47
if (timer > 24)
48
{
49
    var new_angle = 0;
50
    var new_distance = 0;
51
    var new_goal = goal;
52
    if (x < (obj_growtangle.x - 160))
53
        new_goal = 8;
54
    with (obj_mauswheel_lightning_orb_ball)
55
    {
56
        if (other.id == source)
57
        {
58
            x += other.hspeed;
59
            y += other.vspeed;
60
            new_angle = point_direction(other.x, other.y, x, y);
61
            if (siner > 4)
62
                new_distance = point_distance(x, y, other.x, other.y);
63
            else
64
                new_distance = 8;
65
            x = other.x + lengthdir_x(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; }
(new_distance, new_goal, abs(new_goal - new_distance) * 0.03), new_angle + ((1 - (new_distance / 150)) * 6));
66
            y = other.y + lengthdir_y(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; }
(new_distance, new_goal, abs(new_goal - new_distance) * 0.03), new_angle + ((1 - (new_distance / 150)) * 6));
67
        }
68
    }
69
}
70
if (x < (camerax() - 60))
71
{
72
    with (obj_mauswheel_lightning_orb_ball)
73
    {
74
        if (other.id == source)
75
            instance_destroy();
76
    }
77
    instance_destroy();
78
}