var _dentaltoy = 0; var _negative = 0; if (i_ex(obj_dentalchew)) { _dentaltoy = 1; if (target == -1 || !i_ex(target)) target = instance_find(obj_dentalchew, 0); } if (_dentaltoy) { big_timer = 0; if (!i_ex(target)) { speed = 0; _dentaltoy = 0; } else if (instance_number(true)) { for (i = 0; i < instance_number(obj_dentalchew); i++) { var _o = instance_find(obj_dentalchew, i); if (_o.action != 2) target = _o; } } } big_timer++; if (big_timer == 900) { snd_play(snd_kikkyexplosion); sprite_index = spr_kikky_bigtummy; speed = 0; kikky_has_a_big_tummy = 1; } if (active) happiness = scr_approach(happiness, -99999, 1); if (happiness < 0 && !_dentaltoy) { _negative = 1; speed = 0; } if (_negative) { shake_timer++; if (shake_timer > 20) { xx = irandom_range(2, 4) * choose(1, -1) * vibration; yy = irandom_range(2, 4) * choose(1, -1) * vibration; } if (shake_timer > 25) { xx = 0; yy = 0; shake_timer = irandom_range(-10, 0); } vibration_timer++; if (vibration_timer >= 60 && vibration < 1) { vibration_timer = 0; vibration += 0.1; } meow_timer++; if (meow_timer > (meow_max - meow_cutoff)) { if (meow_sfx != -1 && happiness > -600) snd_stop(snd_meow); meow_sfx = snd_play(snd_meow, undefined, random_range(0.3, 0.6)); meow_timer = 0; meow_max = irandom_range(40, 80); } if (happiness < -600) { meow_cutoff_timer++; if (meow_cutoff_timer > 59) { meow_cutoff_timer = 0; meow_cutoff = scr_approach(meow_cutoff, 60, 1); } } } else { vibration = 0; meow_cutoff = 0; meow_cutoff_timer = 0; } if (sprite_index == spr_kikky_bigtummy && speed > 0) { sprite_index = spr_kikky_walk; kikky_has_a_big_tummy = 0; } if (!kikky_has_a_big_tummy && !_dentaltoy && !_negative) { timer++; if (speed == 0) { if (timer > reset) { hspeed = choose(1, -1) * spd; reset = irandom_range(1, 8) * 30; timer = 0; } } else if (timer > reset) { hspeed = 0; reset = irandom_range(1, 4) * 30; timer = 0; } } if (hit_dental_toy) { sprite_index = spr_kikky_attack; timer++; if (timer > 30) { with (target) instance_destroy(); hit_dental_toy = 0; sprite_index = spr_kikky_walk; } } else if (_dentaltoy) { if (i_ex(target) && target.action == 1) { motion_set(point_direction(x, y, target.x, target.y), 8); if (point_distance(x, y, target.x, target.y) < 20) { timer = 0; hit_dental_toy = 1; image_speed = 1; speed = 0; with (obj_kikky) happiness = 100; active = 1; snd_play(snd_kikkycan); var _id = id; with (target) { action = 2; image_xscale = choose(1, -1); motion_set(point_direction(_id.x, _id.y, x, y), 12); } } } } if (speed > 0) image_xscale = sign(hspeed); if (image_xscale == 0) image_xscale = choose(1, -1); if (!hit_dental_toy) image_speed = abs(hspeed) / 2; if (x < 80) { x = 80; hspeed = -hspeed; } if (x > 540) { x = 540; hspeed = -hspeed; } if (y < 40) { y = 40; vspeed = -vspeed; } if (y > 250) { y = 250; vspeed = -vspeed; }