Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_thrash_flameattack_Step_0

(view raw script w/o annotations or w/e)
1
if (!shotfired)
2
    siner += ((1 - abs(cos((btimer / 14) * pi))) * initialspeed);
3
siner++;
4
attackangle = sin(siner / 8) * 28 * flip;
5
thrash.headangle = attackangle;
6
if (btimer >= 14 && abs(attackangle) < 26)
7
{
8
    xx = thrash.headx + 
scr_orbitx
scr_orbitx

function
scr_orbitx(arg0, arg1, arg2, arg3, arg4)
{ if (arg4 == 0) return arg2; var __theta = point_direction(arg0, arg1, arg2, arg3); var __radius = point_distance(arg0, arg1, arg2, arg3); __theta += arg4; return arg0 + lengthdir_x(__radius, __theta); }
(0, 0, -40, -4, attackangle);
9
    yy = thrash.heady + 
scr_orbity
scr_orbity

function
scr_orbity(arg0, arg1, arg2, arg3, arg4)
{ if (arg4 == 0) return arg3; var __theta = point_direction(arg0, arg1, arg2, arg3); var __radius = point_distance(arg0, arg1, arg2, arg3); __theta += arg4; return arg1 + lengthdir_y(__radius, __theta); }
(0, 0, -40, -4, attackangle);
10
    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(xx, yy, obj_thrash_flames);
11
    d.direction = attackangle + 180;
12
    d.speed = 4;
13
    d.updateimageangle = 1;
14
    d.grazepoints = grazepoints;
15
    d.lifetime = 70;
16
    shotfired = 1;
17
    shotcount++;
18
    if (shotcount == (difficulty ? 6 : 4))
19
    {
20
        btimer = 0;
21
        shotcount = 0;
22
    }
23
    else
24
    {
25
        btimer = 12;
26
    }
27
}
28
else
29
{
30
    btimer++;
31
}