Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_yellow_punishmentgun_Create_0

related scripts: CleanUp_0Collision_obj_plat_playerCollision_obj_plat_susieaxe_hbxCreate_0 Destroy_0Draw_0Draw_72Other_20Other_4Step_0Step_2

(view raw script w/o annotations or w/e)
1
plat_name = stringsetloc(
Litebuster
"Litebuster", "obj_plat_enm_yellow_punishmentgun_slash_Create_0_gml_4_0"
);
2
plat_desc = stringsetloc(
This'll deal some damage.
"This'll deal some damage.", "obj_plat_enm_yellow_punishmentgun_slash_Create_0_gml_5_0"
);
3
event_inherited();
4
difficulty = 0;
5
hspeed = 0;
6
aim = 0;
7
aim_error = 0;
8
x_home = xstart;
9
y_home = ystart;
10
target_angle = 0;
11
killed = false;
12
stun_duration = 60;
13
talkcon = -1;
14
attacking = false;
15
var ui = instance_create(0, 0, obj_plat_punishmentgun_ui);
16
ui.depth = 1610;
17
laser_width = 0;
18
orbsize = 0;
19
player_hurt = false;
20
hurt_counter = 0;
21
con = -1;
22
contimer = 0;
23
fx_timer = 0;
24
fx_timer_decimal = 0;
25
laser_timer = 0;
26
charge_seconds = 0;
27
charge_fx_speed = 0.2;
28
charge_maxseconds = 90;
29
attacktimer = -1;
30
hit = 0;
31
image_speed = 0.25;
32
gtime = 10;
33
windimmune = true;
34
contact_damage = 0;
35
image_speed = 0;
36
rotation_speed = 3;
37
rotation_speed_target = 3;
38
rotation_flip = 1;
39
stored_speed = 0;
40
attackstyle = 0;
41
shaketimer = 0;
42
movetype = 1;
43
_remx = 0;
44
_remy = 0;
45
init = 0;
46
target_angle = 90;
47
hit_angle_speed = 0;
48
hit_angle_offset = 0;
49
position_index = 0;
50
attackvolley = 0;
51
auraalph = 0;
52
phase = 0;
53
gunspin = 0;
54
chargesound = -4;
55
coindrops = 30;
56
57
spawn_death_coins = function()
58
{
59
    if (coindrops == 0)
60
        exit;
61
    scr_plat_makecoins(x, y, -coindrops, 90, 90, 8, 4, depth);
62
    var seconds_remaining = ceil(charge_maxseconds - charge_seconds);
63
    var bonuscoins = 5 * floor(max(0, seconds_remaining - 10) / 10);
64
    if (bonuscoins > 0)
65
        scr_plat_makecoins(x, y, bonuscoins, 90, 90, 8, 4, depth);
66
    coindrops = 0;
67
};
68
69
hp = 28;
70
maxhp = hp;
71
next_phase_hp = [25, 22, 17, 12, 5, -1];
72
73
on_phase_change = function(arg0)
74
{
75
};
76
77
rings_particle_system = instance_create_depth(x, y, depth + 1, obj_custom_particle_system);
78
rings_particle_system.default_particle_data.fadeout_speed = 0.09090909090909091;
79
rings_particle_system.default_particle_data.sprite_index = spr_yellow_punish_gun_rings;
80
rings_particle_system.default_particle_data.image_alpha = 2;
81
rings_particle_system.default_particle_data.image_speed = 0;
82
rings_particle_system.default_particle_data.friction = 0.05;
83
rings_particle_system.default_particle_data.lifetime = 22;
84
rings_particle_system.auto_cleanup = false;
85
86
rings_particle_system.particle_step_func = function(arg0)
87
{
88
    if (!global.pause_plat)
89
    {
90
        arg0.custom_data[0] = arg0.custom_data[0] + 1;
91
        if (instance_exists(arg0.custom_data[1]))
92
        {
93
            var diff = arg0.custom_data[1].x - arg0.x;
94
            arg0.x += lerp(0, diff, 1 - (clamp(arg0.custom_data[0] - 4, 0, 10) / 10));
95
        }
96
        arg0.image_xscale -= 0.045454545454545456;
97
        arg0.image_yscale -= 0.045454545454545456;
98
    }
99
};
100
101
rings_particle_systembg = instance_create_depth(x, y, depth + 1, obj_custom_particle_system);
102
rings_particle_systembg.default_particle_data.fadeout_speed = 0.09090909090909091;
103
rings_particle_systembg.default_particle_data.sprite_index = spr_yellow_punish_gun_rings;
104
rings_particle_systembg.default_particle_data.image_alpha = 2;
105
rings_particle_systembg.default_particle_data.image_speed = 0;
106
rings_particle_systembg.default_particle_data.friction = 0.05;
107
rings_particle_systembg.default_particle_data.lifetime = 22;
108
rings_particle_systembg.auto_cleanup = false;
109
110
rings_particle_systembg.particle_step_func = function(arg0)
111
{
112
    if (!global.pause_plat)
113
    {
114
        arg0.custom_data[0] = arg0.custom_data[0] + 1;
115
        if (instance_exists(arg0.custom_data[1]))
116
        {
117
            var diff = arg0.custom_data[1].x - arg0.x;
118
            arg0.x += lerp(0, diff * 2, 1 - (clamp(arg0.custom_data[0] - 4, 0, 10) / 10));
119
        }
120
        arg0.image_xscale -= 0.045454545454545456;
121
        arg0.image_yscale -= 0.045454545454545456;
122
    }
123
};
124
125
rings_particle_struct = 
126
{
127
    image_blend: c_white,
128
    image_xscale: 2,
129
    image_yscale: 2,
130
    hspeed: 0,
131
    vspeed: 0,
132
    image_angle: 0,
133
    image_index: 0,
134
    custom_data: [0, 0]
135
};
136
chunks_particle_system = instance_create_depth(x, y, depth + 1, obj_custom_particle_system);
137
chunks_particle_system.shader = 2;
138
chunks_particle_system.shader2_greyscale_fade = 0;
139
chunks_particle_system.default_particle_data.lifetime = 60;
140
chunks_particle_system.default_particle_data.sprite_index = spr_punishgun_shard;
141
chunks_particle_system.default_particle_data.image_alpha = 1;
142
chunks_particle_system.default_particle_data.image_speed = 0;
143
chunks_particle_system.default_particle_data.gravity = 1;
144
chunks_particle_system.auto_cleanup = false;
145
146
chunks_particle_system.particle_step_func = function(arg0)
147
{
148
    if (!global.pause_plat)
149
        arg0.image_angle += (arg0.hspeed + arg0.vspeed) / 2;
150
};
151
152
chunks_particle_struct = 
153
{
154
    hspeed: 0,
155
    vspeed: 0,
156
    image_angle: 0,
157
    image_index: 0
158
};
159
sparks_particle_system = instance_create_depth(x, y, depth + 1, obj_custom_particle_system);
160
sparks_particle_system.default_particle_data.animation_mode = true;
161
sparks_particle_system.default_particle_data.sprite_index = spr_vfx_twinkle;
162
sparks_particle_system.default_particle_data.image_alpha = 1;
163
sparks_particle_system.default_particle_data.image_speed = 0.5;
164
sparks_particle_system.default_particle_data.friction = 0.1;
165
sparks_particle_system.auto_cleanup = false;
166
sparks_particle_struct = 
167
{
168
    hspeed: 0,
169
    vspeed: 0,
170
    image_xscale: 2,
171
    image_yscale: 2,
172
    image_blend: c_white
173
};
174
petal_color = 65535;
175
176
spawn_charge_effects = function()
177
{
178
    var killtime = 22;
179
    var xbonus = 0.2;
180
    var col = merge_color(c_orange, c_red, charge_fx_speed * 0.3);
181
    var xx = lengthdir_x(1, image_angle + 180);
182
    var yy = lengthdir_y(1, image_angle + 180);
183
    rings_particle_system.depth = depth - 1;
184
    rings_particle_system.x = x - (120 * xx);
185
    rings_particle_system.y = y - (120 * yy);
186
    rings_particle_systembg.depth = depth + 1;
187
    rings_particle_systembg.x = x - (120 * xx);
188
    rings_particle_systembg.y = y - (120 * yy);
189
    rings_particle_struct.image_yscale = 2 + xbonus;
190
    rings_particle_struct.image_blend = col;
191
    rings_particle_struct.image_angle = ((image_angle + 45) % 90) - 45 - 90;
192
    rings_particle_struct.hspeed = 12 * xx;
193
    rings_particle_struct.vspeed = 12 * yy;
194
    rings_particle_struct.image_index = 0;
195
    rings_particle_struct.custom_data = [0, id];
196
    rings_particle_system.emit(rings_particle_struct);
197
    rings_particle_struct.image_index = 1;
198
    rings_particle_systembg.emit(rings_particle_struct);
199
};
200
201
get_hurt = function(arg0)
202
{
203
};
204
205
orbs = [];