Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queen_search_gun_old_Step_0

(view raw script w/o annotations or w/e)
1
if (loading > 0)
2
    exit;
3
if (smashed)
4
{
5
    timer++;
6
    if (timer >= 30)
7
    {
8
        var _xx = x + 
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, 64 * flip, -20, image_angle);
9
        var _yy = y + 
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, 64 * flip, -20, image_angle);
10
        d = instance_create(_xx, _yy, obj_regularbullet);
11
        d.sprite_index = spr_spadebullet;
12
        d.image_angle = image_angle + (flip ? 0 : 180);
13
        d.damage = damage;
14
        d.target = target;
15
        d.speed = 12;
16
        obj_queen_search_flail.broken = 1;
17
        d.direction = image_angle + (flip ? 0 : 180);
18
        instance_destroy();
19
    }
20
    exit;
21
}
22
if (bufferstate == 0 && 
scr_queen_buffercheck
scr_queen_buffercheck

function
scr_queen_buffercheck()
{ return instance_exists(obj_queen_buffercontroller) && obj_queen_buffercontroller.buffering == 1; }
())
23
{
24
    image_blend = c_gray;
25
    bufferstate = 1;
26
}
27
else if (bufferstate == 1 && !
scr_queen_buffercheck
scr_queen_buffercheck

function
scr_queen_buffercheck()
{ return instance_exists(obj_queen_buffercontroller) && obj_queen_buffercontroller.buffering == 1; }
())
28
{
29
    image_blend = c_white;
30
    bufferstate = 2;
31
}
32
if (bufferstate == 1)
33
    exit;
34
if (timer < targetTime)
35
{
36
    timer++;
37
    if (timer < 0)
38
        exit;
39
    image_angle = lerp(0, targetAngle, 
scr_ease_inout
scr_ease_inout

function
scr_ease_inout(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; if (arg1 == -3) return ease_inout_bounce(arg0, 0, 1, 1); else if (arg1 == -2) return ease_inout_elastic(arg0, 0, 1, 1); else if (arg1 == -1) return ease_inout_back(arg0, 0, 1, 1); else if (arg1 == 1) return -0.5 * cos((pi * arg0) - 1); else if (arg1 == 0) return arg0; arg0 *= 2; if (arg0 < 1) { return 0.5 *
scr_ease_in(arg0, arg1);
} else { arg0--; return 0.5 * (
scr_ease_out(arg0, arg1) + 1);
} }
(timer / targetTime, -1));
40
    if (timer >= targetTime)
41
    {
42
        var _xx = x + 
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, 64 * flip, -20, image_angle);
43
        var _yy = y + 
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, 64 * flip, -20, image_angle);
44
        d = instance_create(_xx, _yy, obj_queen_search_laser);
45
        d.damage = damage;
46
        d.target = target;
47
        d.direction = image_angle + (flip ? 0 : 180);
48
        state = 3;
49
        timer = -15;
50
        event_user(0);
51
    }
52
}