Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_scene26_gigaqueen_Step_0

(view raw script w/o annotations or w/e)
1
if (release)
2
{
3
    if (!head_init)
4
        head_init = true;
5
    if (head_x_pos < 0)
6
        head_x_pos = (camerax() + (view_wport[0] / 2)) - sprite_get_width(spr_cutscene_26_queen_giga_head);
7
    if (head_y_pos == -1)
8
        head_y_pos = cameray() + view_hport[0] + 100;
9
    head_y_pos = clamp(head_y_pos - 10, cameray() - 15, cameray() + view_hport[0] + 100);
10
    if (head_y_pos <= (cameray() - 15))
11
        release = false;
12
}
13
if (release_fast)
14
{
15
    head_y_pos = clamp(head_y_pos - 35, cameray() - 15, cameray() + view_hport[0] + 100);
16
    if (head_y_pos <= (cameray() - 15))
17
        release_fast = false;
18
}
19
if (leave)
20
{
21
    head_y_pos = clamp(head_y_pos + 10, cameray() - 15, cameray() + view_hport[0] + 100);
22
    if (head_y_pos >= (cameray() + view_hport[0] + 100))
23
        leave = false;
24
}
25
if (leave_fast)
26
{
27
    head_y_pos = clamp(head_y_pos + 30, cameray() - 15, cameray() + view_hport[0] + 100);
28
    if (head_y_pos >= (cameray() + view_hport[0] + 100))
29
        leave = false;
30
}
31
if (laugh)
32
{
33
    animsiner++;
34
    if (pilot_alpha == 0)
35
        pilot_alpha = 1;
36
    head_sprite = damaged ? spr_cutscene_27_queen_laugh_damaged : spr_cutscene_26_queen_giga_head_laugh;
37
    anim_index = animsiner / 4;
38
}
39
else
40
{
41
    animsiner = 0;
42
    anim_index = 0;
43
}
44
if (surprised)
45
{
46
    surprised = false;
47
    head_sprite = spr_cutscene_27_queen_shock_damaged;
48
    pilot_alpha = 0;
49
    if (!damaged)
50
        head_sprite = spr_cutscene_27_queen_giga_surprise;
51
}
52
if (unhappy)
53
{
54
    unhappy = false;
55
    head_sprite = spr_cutscene_26_queen_giga_head_unhappy;
56
    pilot_sprite = spr_cutscene_26_queen_pilot;
57
    pilot_alpha = 1;
58
}
59
if (static_start)
60
{
61
    static_start = false;
62
    head_sprite = spr_cutscene_27_queen_look_down_damaged;
63
    pilot_alpha = 0;
64
    static_happened = true;
65
    my_static = instance_create(252, 123, obj_ch2_queen_static);
66
    with (my_static)
67
        
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
68
    crack = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(my_static.x, my_static.y, spr_cutscene_27_queen_static_googles_crack);
69
    crack.depth = my_static.depth - 100;
70
}
71
if (static_stop)
72
{
73
    static_stop = false;
74
    static_start = false;
75
    static_happened = false;
76
    pilot_alpha = 1;
77
    if (i_ex(obj_ch2_queen_static))
78
    {
79
        instance_destroy(obj_ch2_queen_static);
80
        instance_destroy(crack);
81
    }
82
}
83
if (damagedfx)
84
{
85
    smoketimer++;
86
    if (smoketimer >= 3)
87
    {
88
        smoke = instance_create(head_x_pos + 300, head_y_pos + 120, obj_afterimage_grow);
89
        smoke.depth = depth + 200;
90
        smoke.sprite_index = spr_cakesmoke;
91
        smoke.gravity = -0.5;
92
        smoke.image_alpha = 2;
93
        smoke.hspeed = random(2);
94
        smoke.image_xscale = 2;
95
        smoke.image_yscale = 2;
96
        smoke.visible = 1;
97
        smoke = instance_create(head_x_pos + 330, head_y_pos + 180, obj_afterimage_grow);
98
        smoke.depth = depth + 200;
99
        smoke.sprite_index = spr_cakesmoke;
100
        smoke.gravity = -0.5;
101
        smoke.image_alpha = 1.6;
102
        smoke.hspeed = random(2) + 2;
103
        smoke.image_xscale = 0;
104
        smoke.image_yscale = 0;
105
        smoke.visible = 1;
106
        smoketimer = 0;
107
    }
108
    if (climb > 0)
109
        shaketimer = 0;
110
    else
111
        shaketimer++;
112
    if (shaketimer == 53)
113
    {
114
        smoke = instance_create(head_x_pos + 240, head_y_pos + 180, obj_afterimage_grow);
115
        smoke.depth = depth - 10;
116
        smoke.sprite_index = spr_plugboy_spare_electricity;
117
        smoke.hspeed = -2;
118
        smoke.gravity = -0.5;
119
        smoke.image_alpha = 1.6;
120
        smoke.hspeed = 0;
121
        smoke.image_xscale = 0;
122
        smoke.image_yscale = 0;
123
        smoke.visible = 1;
124
    }
125
    if (shaketimer >= 55 && shaketimer <= 60)
126
    {
127
        head_x_pos = rem_head_x_pos + random_range(2, -2);
128
        head_y_pos = rem_head_y_pos + random_range(1, -1);
129
    }
130
    if (shaketimer == 61)
131
        shaketimer = 0;
132
}
133
if (climb == 1)
134
{
135
    if (!head_init)
136
        head_init = true;
137
    climbtimer++;
138
    if (climbtimer == 1)
139
        rem_head_y_pos = head_y_pos;
140
    if (climbtimer == 2)
141
        
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; }
(id, "head_y_pos", rem_head_y_pos, rem_head_y_pos - 120, 30, -3, "out");
142
    if (climbtimer == 10)
143
    {
144
        var deepsnd = snd_play(snd_closet_impact);
145
        snd_pitch(deepsnd, 0.5);
146
        instance_create(0, 0, obj_shake);
147
    }
148
    if (climbtimer == 40)
149
    {
150
        climbtimer = 0;
151
        climb = 0;
152
        rem_head_y_pos = head_y_pos;
153
    }
154
}