Пример #1
0
    public void ValueChangeCheck(string _text)
    {
        if (fastMode)
        {
            return;
        }

        if (_text.Contains(" "))
        {
            foreach (Player_universal.Ability_Typ folder in player.Ability_typs)
            {
                if (_text.Length <= folder._name.Length)
                {
                    continue;
                }
                if (TextChanger.Return_sub_string(0, folder._name.Length + 1, _text) == folder._name + " ")
                {
                    if (current_folder == null)
                    {
                        Show_Abilities(folder);
                        current_folder = folder;
                        //SetVisible(side_right,true);
                        //SetVisible(side_cost, true);
                    }

                    foreach (Ability current_ability in current_folder.abilities)
                    {
                        if (_text.Length <= folder._name.Length + current_ability._name.Length + 1)
                        {
                            continue;
                        }
                        if (TextChanger.Return_sub_string(0, folder._name.Length + current_ability._name.Length + 2, _text) == folder._name + " " + current_ability._name + " ")
                        {
                            if (_ability == null)
                            {
                                _ability = current_ability;
                                create_target_UI(battleSystem.enemies, _ability);
                                //SetVisible(side_targets, true);
                            }

                            if (_text == folder._name + " " + current_ability._name + " " + "info" + " ")
                            {
                                SetInfo();

                                //SetVisible(side_info, true);
                                //side_info.text = _ability._info;
                            }
                            else /*SetVisible(side_info, false)*/; {
                            }

                            switch (_ability._target)
                            {
                            case Target.one:
                                foreach (EnemyStats enemy in battleSystem.enemies)
                                {
                                    if (_text == folder._name + " " + current_ability._name + " " + enemy._name + " ")
                                    {
                                        battleSystem.selected_enemy = enemy;
                                        ActivateBattleTyper(current_ability);
                                        break;
                                    }
                                }
                                break;

                            case Target.multible:
                                if (_text == folder._name + " " + current_ability._name + " " + "enemies" + " ")
                                {
                                    ActivateBattleTyper(current_ability);
                                    break;
                                }
                                break;

                            case Target.self:
                                if (_text == folder._name + " " + current_ability._name + " " + "self" + " ")
                                {
                                    ActivateBattleTyper(current_ability);
                                    break;
                                }
                                break;
                            }


                            return;
                        }
                        else
                        {
                            //Empty_field(side_targets);
                            _ability = null;
                            //SetVisible(side_targets, false);
                        }
                    }
                    _ability = null;
                    //SetVisible(side_targets, false);
                    //Empty_field(side_targets);
                    return;
                }
            }
        }
        ResetUI();
    }