public void TestMxSwithequalD() { BattleMethod M = new BattleMethod(); int result = M.SXS(50, "fire", 25, "water", 1, 2); int Expected = 2; Assert.AreEqual(Expected, result); }
public void TestMxMwithequalD() { BattleMethod M = new BattleMethod(); int result = M.MXM(25, 25, 1, 2); int Expected = -1; Assert.AreEqual(Expected, result); }
public void TestMXSwithplayer1() { BattleMethod M = new BattleMethod(); int result = M.SXS(50, "fire", 5, "water", 1, 2); int Expected = 1; Assert.AreEqual(Expected, result); }
public void TestMxMwithplayer2() { BattleMethod M = new BattleMethod(); int result = M.MXM(25, 100, 1, 2); int Expected = 2; Assert.AreEqual(Expected, result); }
/// <summary> /// 敵のAIにそって自動で行動する /// </summary> /// <param name="actionEnemy">行動する敵キャラ</param> private void EnemyAction(BattleCharacter actionEnemy) { if (!actionEnemy.EC.HaveSpecialAI) { List <BattleActiveSkill> useableSkill = new List <BattleActiveSkill>(); foreach (E_BattleActiveSkill skillID in actionEnemy.EC.HaveBattleActtiveSkillID) { BattleActiveSkill skill = this.activeEffectFuncs.GetBattleActiveSkill(skillID); if (actionEnemy.Bsp >= skill.NeedBattleSkillPoint) { if (skill.EffectType != E_BattleActiveEffectType.HP回復 || BattleMethod.GetLowerHpChara(this.enemyList, 0.5) != null) { useableSkill.Add(this.activeEffectFuncs.GetBattleActiveSkill(skillID)); } } } int action = UnityEngine.Random.Range(0, useableSkill.Count + 1); if (action == useableSkill.Count) { //通常攻撃 if (actionEnemy.NormalAttackToAllTurn > 0) { NormalAttack(actionEnemy, GetAliveList(this.allyList)); } else if (GetAttractingCharacter(actionEnemy.Element, this.allyList) != null) { NormalAttack(actionEnemy, GetAttractingCharacter(actionEnemy.Element, this.allyList)); } else { NormalAttack(actionEnemy, ListManager.GetRandomIndex <BattleCharacter>(GetAliveList(this.allyList))); } } else { InvokeEffect(actionEnemy, useableSkill[action]); //スキル発動 } } else { //特殊な処理 actionEnemy.EC.EnemyAI.EnemyActionFunc(this.enemyList, this.allyList, actionEnemy, this.activeEffectFuncs); AdvanceTurn(); } }