if (!initialized) exit; if (!hit) exit; audio_stop_sound(snd_enemy_defeat_quick); snd_play(snd_enemy_defeat_quick); with (instance_create_depth(x, y, depth, obj_plat_vfx)) { sprite_index = spr_hit_vfx; image_speed = 1; } with (instance_create_depth(x, y, depth, obj_plat_vfx)) { sprite_index = spr_smokepuff; image_speed = 2; } var _col = merge_color(c_gray, other.petal_color, clamp01(other.hp / other.__max_hp)); if (hp > 0) { var _dir = irandom(360); var _len = 80 + irandom(120); snd_play_pitch(snd_creepylaugh, 0.8); var _gx = 0; var _gy = 0; if (regular_enemy) { var len = random_range(150, 180); var dir = random_range(0, 360); _gx = clamp(x + lengthdir_x(len, dir), xstart - 260, xstart + 260); _gy = clamp(y + lengthdir_y(len, dir), ystart - 60, ystart + 60); } else if (nextlerp < 2) { _gx = xstart + (targetlerp[2][0] * -320); _gy = ystart + (targetlerp[2][1] * 120); } else { _gx = xstart + (targetlerp[0][0] * -320); _gy = ystart + (targetlerp[0][1] * 120); } var _gtime = 20 + (max(0, hp - 3) * 10); with (instance_create(_gx, _gy, obj_flower_respwn)) { obj = other.object_index; extflag = other.extflag; x_home = other.x_home; colored = true; image_blend = _col; depth = other.depth; _memory.regular_enemy = other.regular_enemy; _memory.anchor_x = other.xstart; _memory.anchor_y = other.ystart; _memory._hp_init = true; _memory.__max_hp = other.__max_hp; y_home = other.y_home; __spawner = other.__spawner; hp = other.hp; alarm[0] = _gtime; alarm[1] = _gtime / 2; } with (instance_create_depth(x, y, depth, obj_flowerdie)) { fadewait = 60; colored = true; image_blend = _col; speed = 10; gx = _gx; gy = _gy; regroup_target = id; gtime = _gtime * 0.5; } } else { with (obj_plat_bulletred) { if (sprite_index == spr_faqua_knife_cracked) { if (variable_instance_exists(id, "owner") && instance_exists(owner) && owner.id == other.id) { event_user(10); scr_doom(self, 30); scr_lerpvar("image_alpha", image_alpha, 0, 30); } } } with (__spawner) instance_destroy(); spawn_death_coins(); scr_plat_hitstop_global(8); var snd = snd_play_pitch(snd_creepylaugh, 0.8); snd_pitch_time(snd, 0.4, 15); snd_volume(snd, 0, 30); with (instance_create_depth(x, y, depth, obj_flowerdie)) { speed = 12; amount = 12; } }