Esempio n. 1
0
    public override void AI(int[] checkValue)
    {
        // 強盜: 低攻高防,每一回合都會使用綁架封印我方一顆骰子
        // 天生技: 攻擊減1/3
        // 技能1 : 綁架 封印一顆骰子
        int       finalCheckValue = 0;
        Character target          = stateManager.getCharacter();

        mse = new MonsterSkillEffect();

        for (int i = 0; i < checkValue.Length; i++)
        {
            finalCheckValue += checkValue[i];
        }

        int s = Random.Range(0, 15000);

        if (s < 10000)
        {
            int k = Random.Range(0, target.diceStates.Length - 1);
            mse.setDisable(k, 1);
            mse.setDamage(finalCheckValue * 2 / 3);
            mse.setSkillActivated(true);
            mse.setUsingSkill(this.skill[0]);
        }

        else
        {
            mse.setDamage(finalCheckValue * 2 / 3);
        }

        target.check(mse);
    }
Esempio n. 2
0
    public override void AI(int[] checkValue)
    {
        // 踢: 怪物血量大於50%時,若骰子總和大於 6 ,攻擊加 5
        // 怪物血量小於50 %時,50%機率 : 補血補到滿
        // 發動困獸之鬥: 50% 機率 如果所有骰子都大於2,攻擊最後 *2
        int       finalCheckValue = 0;
        int       k      = Random.Range(0, 15000);
        Character target = stateManager.getCharacter();

        mse = new MonsterSkillEffect();

        if (this.Hp > this.MaxHp / 2)
        {
            for (int i = 0; i < checkValue.Length; i++)
            {
                finalCheckValue += checkValue[i];
            }

            if (finalCheckValue >= 6)
            {
                finalCheckValue += 5;

                mse.setSkillActivated(true);
                mse.setDamage(finalCheckValue);
                mse.setUsingSkill(this.skill[0]);
                Debug.Log(mse.usingSkill.name + "發動成功! -" + finalCheckValue);
                Debug.Log(mse.usingSkill.description);
            }
        }

        else
        {
            if (k < 7500)
            {
                // heal 回復一半的血

                this.recoverHP(MaxHp / 2);

                mse.setSkillActivated(true);
                mse.setHeal(MaxHp / 2);
                mse.setUsingSkill(this.skill[1]);
                Debug.Log(mse.usingSkill.name + "發動成功! -" + finalCheckValue);
                Debug.Log(mse.usingSkill.description);
            }

            else
            {
                bool isAllBiggerthan2 = true;
                for (int i = 0; i < checkValue.Length; i++)
                {
                    if (checkValue[i] < 2)
                    {
                        isAllBiggerthan2 = false;
                    }
                    finalCheckValue += checkValue[i];
                }

                if (isAllBiggerthan2)
                {
                    finalCheckValue *= 2;
                    mse.setSkillActivated(true);
                    mse.setDamage(finalCheckValue);
                    mse.setUsingSkill(this.skill[2]);
                    Debug.Log(mse.usingSkill.name + "發動成功! -" + finalCheckValue);
                    Debug.Log(mse.usingSkill.description);
                }
                else
                {
                    mse.setDamage(finalCheckValue);
                }
            }
        }

        target.check(mse);
    }
    public override void AI(int[] checkValue)
    {
        // 強盜: 低攻高防,每一回合都會使用綁架封印我方一顆骰子
        // 天生技: 攻擊減1/3
        // 技能1 : 綁架 封印一顆骰子
        int       finalCheckValue = 0;
        Character target          = stateManager.getCharacter();

        mse = new MonsterSkillEffect();

        if (stateManager.turn % 3 == 0)
        {
            //大字火
            mse.setDamage(40);
            mse.setSkillActivated(true);
            mse.setUsingSkill(this.skill[2]);
        }

        else
        {
            bool isAllOdd          = true;
            bool isAllSmallerThan5 = true;
            for (int i = 0; i < checkValue.Length; i++)
            {
                if (checkValue[i] % 2 == 0)
                {
                    isAllOdd = false;
                }

                if (checkValue[i] > 5)
                {
                    isAllSmallerThan5 = false;
                }

                finalCheckValue += checkValue[i];
            }

            if (isAllOdd)
            {
                // 封印術
                int k = Random.Range(0, target.diceStates.Length - 1);
                mse.setDisable(k, 2);
                mse.setSkillActivated(true);
                mse.setUsingSkill(this.skill[1]);
            }

            else if (isAllSmallerThan5)
            {
                // 火球術
                mse.setDamage(finalCheckValue + 10);
                mse.setSkillActivated(true);
                mse.setUsingSkill(this.skill[0]);
            }

            else
            {
                // 普通
                mse.setDamage(finalCheckValue);
                mse.setSkillActivated(false);
            }
        }

        target.check(mse);
    }