コード例 #1
0
 public DTCharacter(int baseHP, EnCharacterType type)
 {
     BaseHP    = baseHP;
     Type      = type;
     CurrentHP = baseHP;
     lastHP    = CurrentHP;
 }
コード例 #2
0
    void CheckCharacterAction()
    {
        // Check and setup Action
        List <Character> characterHadActions = new List <Character>();

        DefensorTotalHP  = 0;
        AttackterTotalHP = 0;

        foreach (var c in attackers)
        {
            Character closestDefensor = FindClosestDefensor(c);
            c.UpdateClosestEnemy(closestDefensor);
            bool isHadAction = c.CheckAction();
            if (isHadAction)
            {
                characterHadActions.Add(c);
            }
            AttackterTotalHP += c.Data.CurrentHP;
        }
        foreach (var c in defensors)
        {
            bool isHadAction = c.CheckAction();
            if (isHadAction)
            {
                characterHadActions.Add(c);
            }
            DefensorTotalHP += c.Data.CurrentHP;
        }

        foreach (var c in characterHadActions)
        {
            c.DoAction();
        }

        if (!isEndGame)
        {
            isEndGame = defensors.Count == 0 || attackers.Count == 0;
            if (isEndGame)
            {
                EnCharacterType winner = defensors.Count > 0 ? EnCharacterType.Defensor : EnCharacterType.Attacker;
                battleUI.ShowResult(winner);
                miniMap.gameObject.SetActive(false);
            }
        }
    }
コード例 #3
0
ファイル: BattleUI.cs プロジェクト: wonkathi92/game-test-01
 public void ShowResult(EnCharacterType winner)
 {
     result.Show(winner, OnReplayAction, OnBackToMenuAction);
 }