Пример #1
0
    public void SetMoveButton(
        Battle battle,
        Pokemon pokemon,
        Pokemon.Moveslot moveslot,
        BTLUI_ButtonFight moveBtn,
        bool choosingZMove = false, bool choosingMaxMove = false)
    {
        MoveData moveData = battle.GetPokemonMoveData(userPokemon: pokemon, moveID: moveslot.moveID);

        if (choosingZMove)
        {
            moveData = battle.GetPokemonZMoveData(pokemon, moveslot.moveID);
        }
        if (choosingMaxMove)
        {
            moveData = battle.GetPokemonMaxMoveData(pokemon, moveData);
        }
        if (moveData != null)
        {
            TypeData typeData  = TypeDatabase.instance.GetTypeData(moveData.moveType);
            Color    typeColor = Color.clear;
            ColorUtility.TryParseHtmlString(typeData.typeColor, out typeColor);

            moveBtn.moveTxt.text  = moveData.moveName;
            moveBtn.ppTxt.text    = moveslot.PP + "/" + moveslot.maxPP;
            moveBtn.typeTxt.text  = typeData.typeName;
            moveBtn.typeTxt.color = typeColor;

            moveBtn.moveData      = moveData;
            moveBtn.moveslot      = moveslot;
            moveBtn.hiddenByZMove = false;
            moveBtn.colorSel      = new Color(typeColor.r, typeColor.g, typeColor.b, 0.75f);
        }
        else
        {
            moveBtn.moveTxt.text  = "";
            moveBtn.ppTxt.text    = "";
            moveBtn.typeTxt.text  = "";
            moveBtn.moveData      = null;
            moveBtn.moveslot      = null;
            moveBtn.hiddenByZMove = true;
        }
        moveBtn.UnselectSelf();
    }
Пример #2
0
    public void HighlightMove(Pokemon.Moveslot moveslot)
    {
        BTLUI_ButtonFight selectedBtn = null;

        if (move1Btn.moveslot != null)
        {
            if (move1Btn.moveslot == moveslot)
            {
                selectedBtn = move1Btn;
            }
            else
            {
                move1Btn.UnselectSelf();
            }
        }
        if (move2Btn.moveslot != null)
        {
            if (move2Btn.moveslot == moveslot)
            {
                selectedBtn = move2Btn;
            }
            else
            {
                move2Btn.UnselectSelf();
            }
        }
        if (move3Btn.moveslot != null)
        {
            if (move3Btn.moveslot == moveslot)
            {
                selectedBtn = move3Btn;
            }
            else
            {
                move3Btn.UnselectSelf();
            }
        }
        if (move4Btn.moveslot != null)
        {
            if (move4Btn.moveslot == moveslot)
            {
                selectedBtn = move4Btn;
            }
            else
            {
                move4Btn.UnselectSelf();
            }
        }

        if (selectedBtn != null)
        {
            selectedBtn.SelectSelf();
            backBtn.UnselectSelf();

            MoveData moveData  = selectedBtn.moveData;
            TypeData typeData  = TypeDatabase.instance.GetTypeData(moveData.moveType);
            Color    typeColor = Color.clear;
            ColorUtility.TryParseHtmlString(typeData.typeColor, out typeColor);
            string moveText = "<color=" + typeData.typeColor + ">" + typeData.typeName + "</color>\n";
            moveText += moveData.category.ToString() + " / ";
            moveText += (moveData.basePower > 0) ? moveData.basePower + " BP / " : "";
            moveText += (moveData.accuracy > 0) ? (Mathf.FloorToInt(moveData.accuracy * 100)) + "% ACC"
                : "Never Misses";
            promptText.text = moveText;
        }
    }