function enemy_dummy_ai() { x_spd = 0; y_spd = 0; switch(state) { case "IDLE": if hitstun_timer == hitstun_max { state = "COUNTER"; set_sprite(sEnemyDummyCounter); } facing_x = sign(global.player.x - x); facing_y = sign(global.player.y + sprite_height - y); break; case "COUNTER": if animation_end() { if facing_y == -1 var _hb = enemy_create_hitboxBC(144, 384, 0, -192, 10); else var _hb = enemy_create_hitboxML(384, 144, 0, -96, 10); _hb.damage = 2; state = "ATTACK"; set_sprite(sEnemyDummyAttack); } break; case "ATTACK": if animation_end() { state = "IDLE"; set_sprite(sEnemyDummyIdle); } break; } }