Creating decision-making AI with FSM