Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_titan_battle_hands_manager_Step_2

(view raw script w/o annotations or w/e)
1
with (hand_1)
2
{
3
    with (obj_collidebullet)
4
    {
5
        if (variable_instance_exists(id, "parent_id"))
6
        {
7
            if (place_meeting(x, y, other.id) && parent_id != other.id)
8
                instance_destroy();
9
        }
10
    }
11
}
12
with (hand_2)
13
{
14
    with (obj_collidebullet)
15
    {
16
        if (variable_instance_exists(id, "parent_id"))
17
        {
18
            if (place_meeting(x, y, other.id) && parent_id != other.id)
19
                instance_destroy();
20
        }
21
    }
22
}
23
timer++;
24
counter += counter_speed;
25
angle_counter += angle_counter_speed;
26
hand_direction = cos(angle_counter) * 4;
27
var chand_x = 
scr_get_box
scr_get_box

function
scr_get_box(arg0)
{ switch (arg0) { case 0: return obj_growtangle.x + (obj_growtangle.sprite_width * 0.5); break; case 1: return obj_growtangle.y - (obj_growtangle.sprite_height * 0.5); break; case 2: return obj_growtangle.x - (obj_growtangle.sprite_width * 0.5); break; case 3: return obj_growtangle.y + (obj_growtangle.sprite_height * 0.5); break; case 4: return obj_growtangle.x; break; case 5: return obj_growtangle.y; break; return false; } }
(4);
28
var chand_y = (
scr_get_box
scr_get_box

function
scr_get_box(arg0)
{ switch (arg0) { case 0: return obj_growtangle.x + (obj_growtangle.sprite_width * 0.5); break; case 1: return obj_growtangle.y - (obj_growtangle.sprite_height * 0.5); break; case 2: return obj_growtangle.x - (obj_growtangle.sprite_width * 0.5); break; case 3: return obj_growtangle.y + (obj_growtangle.sprite_height * 0.5); break; case 4: return obj_growtangle.x; break; case 5: return obj_growtangle.y; break; return false; } }
(5) + (sin(counter) * 40)) - 20;
29
with (hand_1)
30
{
31
    if (fingers_broken < 4)
32
    {
33
        var xshake = 0;
34
        var yshake = 0;
35
        if (other.alarm[2] > 0)
36
        {
37
            xshake = choose(-2, 0, 2);
38
            yshake = choose(-2, 0, 2);
39
        }
40
        x = chand_x + lengthdir_x(other.hand_distance, other.hand_direction);
41
        y = chand_y + lengthdir_y(other.hand_distance, other.hand_direction);
42
        image_angle = point_direction(x, y, chand_x, chand_y);
43
        x += lengthdir_x(sin(other.wave_counter) * 20, other.hand_direction + 90);
44
        y += lengthdir_y(sin(other.wave_counter) * 20, other.hand_direction + 90);
45
        x += xshake;
46
        y += yshake;
47
        if (i_ex(finger_1))
48
        {
49
            with (finger_1)
50
            {
51
                with (obj_titan_battle_hands_manager)
52
                    finger_vector(other.id, other.master, -52, 68);
53
                image_angle = other.image_angle;
54
            }
55
        }
56
        else if ((other.alarm[0] || other.alarm[4]) && (other.timer % (40 + (other.difficulty * 2))) == 0)
57
        {
58
            other.wibbly_bullets(id, -52, 68);
59
        }
60
        if (i_ex(finger_2))
61
        {
62
            with (finger_2)
63
            {
64
                with (obj_titan_battle_hands_manager)
65
                    finger_vector(other.id, other.master, -2, 72);
66
                image_angle = other.image_angle;
67
            }
68
        }
69
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 10) % (40 + (other.difficulty * 2))) == 0)
70
        {
71
            other.wibbly_bullets(id, 0, 72);
72
        }
73
        if (i_ex(finger_3))
74
        {
75
            with (finger_3)
76
            {
77
                with (obj_titan_battle_hands_manager)
78
                    finger_vector(other.id, other.master, 51, 68);
79
                image_angle = other.image_angle;
80
            }
81
        }
82
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 20) % (40 + (other.difficulty * 2))) == 0)
83
        {
84
            other.wibbly_bullets(id, 51, 68);
85
        }
86
        if (i_ex(finger_4))
87
        {
88
            with (finger_4)
89
            {
90
                with (obj_titan_battle_hands_manager)
91
                    finger_vector(other.id, other.master, 103, 53);
92
                image_angle = other.image_angle;
93
            }
94
        }
95
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 30) % (40 + (other.difficulty * 2))) == 0)
96
        {
97
            other.wibbly_bullets(id, 103, 53);
98
        }
99
        if (other.alarm[3] > 10 && (global.time % 3) == 0)
100
        {
101
            with (
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; }
())
102
                depth = obj_growtangle.depth - 2;
103
        }
104
    }
105
}
106
with (hand_2)
107
{
108
    if (fingers_broken < 4)
109
    {
110
        var xshake = 0;
111
        var yshake = 0;
112
        if (other.alarm[2] > 0)
113
        {
114
            xshake = choose(-2, 0, 2);
115
            yshake = choose(-2, 0, 2);
116
        }
117
        x = chand_x + lengthdir_x(other.hand_distance, other.hand_direction + 180);
118
        y = chand_y + lengthdir_y(other.hand_distance, other.hand_direction + 180);
119
        image_angle = point_direction(x, y, chand_x, chand_y);
120
        x += lengthdir_x(sin(other.wave_counter) * 20, other.hand_direction + 270);
121
        y += lengthdir_y(sin(other.wave_counter) * 20, other.hand_direction + 270);
122
        x += xshake;
123
        y += yshake;
124
        if (i_ex(finger_1))
125
        {
126
            with (finger_1)
127
            {
128
                with (obj_titan_battle_hands_manager)
129
                    finger_vector(other.id, other.master, -103, 53);
130
                image_angle = other.image_angle;
131
            }
132
        }
133
        else if ((other.alarm[0] || other.alarm[4]) && (other.timer % (40 + (other.difficulty * 2))) == 0)
134
        {
135
            other.wibbly_bullets2(id, -103, 53);
136
        }
137
        if (i_ex(finger_2))
138
        {
139
            with (finger_2)
140
            {
141
                with (obj_titan_battle_hands_manager)
142
                    finger_vector(other.id, other.master, -51, 68);
143
                image_angle = other.image_angle;
144
            }
145
        }
146
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 10) % (40 + (other.difficulty * 2))) == 0)
147
        {
148
            other.wibbly_bullets2(id, -51, 68);
149
        }
150
        if (i_ex(finger_3))
151
        {
152
            with (finger_3)
153
            {
154
                with (obj_titan_battle_hands_manager)
155
                    finger_vector(other.id, other.master, 2, 72);
156
                image_angle = other.image_angle;
157
            }
158
        }
159
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 20) % (40 + (other.difficulty * 2))) == 0)
160
        {
161
            other.wibbly_bullets2(id, 0, 72);
162
        }
163
        if (i_ex(finger_4))
164
        {
165
            with (finger_4)
166
            {
167
                with (obj_titan_battle_hands_manager)
168
                    finger_vector(other.id, other.master, 52, 68);
169
                image_angle = other.image_angle;
170
            }
171
        }
172
        else if ((other.alarm[0] || other.alarm[4]) && ((other.timer + 30) % (40 + (other.difficulty * 2))) == 0)
173
        {
174
            other.wibbly_bullets2(id, 52, 68);
175
        }
176
        if (other.alarm[3] > 10 && (global.time % 3) == 0)
177
        {
178
            with (
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; }
())
179
                depth = obj_growtangle.depth - 2;
180
        }
181
    }
182
}