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 = sign(oPlayer.x - x); break; case "COUNTER": if animation_end() { enemy_create_hitbox(384, 96, facing * 192, 0, 12); state = "ATTACK"; set_sprite(sEnemyDummyCounter); } break; case "ATTACK": if animation_end() { state = "IDLE"; set_sprite(sEnemyDummyIdle); } break; } }