Пример #1
0
 /// <summary>
 /// 玩家的行动部分
 /// </summary>
 private void HerosAction()
 {
     //玩家的行动
     for (int i = 0; i < heros.Count; i++)
     {
         if (heros[i].Hp == 0 || heros[i].IsDizzy())
         {
             continue;
         }
         actionIndex = i;
         textPos.Clear();
         SetSkillPos();
         DrawSkill();
         MyDraw.DrawIntroText("轮到" + heros[actionIndex].name + "行动了,请选择指令:");
         tempSkill = heros[actionIndex].skill[GetSkillChoice(heros[actionIndex])];
         MyDraw.DrawBattleMessage(heros[actionIndex].name + "选择了技能:" + tempSkill.name);
         if (tempSkill.targetType == TargetType.EnemySingle)
         {
             MyDraw.DrawIntroText("请选择目标:");
             SetEnemyPos();
             DrawEnemy();
             targetEnemy = GetEnemyChoice();
             if (targetEnemy == -1)
             {
                 i--;
                 continue;
             }
             tempSkill.UseSkillSingle(heros[actionIndex], actionIndex, enemy[targetEnemy], targetEnemy);
         }
         if (tempSkill.targetType == TargetType.EnemyMulti)
         {
             tempSkill.UseSkillMulti(heros[actionIndex], actionIndex, enemy);
         }
         if (tempSkill.targetType == TargetType.PartySingle)
         {
             MyDraw.DrawIntroText("请选择目标:");
             SetPartyPos();
             DrawParty();
             targetEnemy = GetPartyChoice();
             if (targetEnemy == -1)
             {
                 i--;
                 continue;
             }
             tempSkill.UseSkillSingle(heros[actionIndex], actionIndex, heros[targetEnemy], targetEnemy);
         }
         if (tempSkill.targetType == TargetType.PartyMulti)
         {
             tempSkill.UseSkillMulti(heros[actionIndex], actionIndex, heros);
         }
         if (tempSkill.targetType == TargetType.Self)
         {
             tempSkill.UseSkillSingle(heros[actionIndex], actionIndex, heros[actionIndex], actionIndex);
         }
     }
 }
Пример #2
0
 public void BattleStart()
 {
     while (true)
     {
         actionIndex = 0;
         targetEnemy = 0;
         MyDraw.DrawCounts(counts);
         ExeCountStartState();
         HerosAction();
         EnemyAction();
         ExeCountEndState();
         StateCountDec();
         if (IsOver())
         {
             break;
         }
         counts++;
         ClearUpState();
         MyDraw.DrawIntroText("按任意键进入下一回合");
         Console.ReadKey(true);
     }
 }