Ejemplo n.º 1
0
 private void HandleUnitBattleResult(UnitBattleResultEvent e)
 {
     switch (e.Result)
     {
         case BattleResult.Success:
             {
                 //Move attacker to defender's position
                 RemovePiece(e.DefenderPosition);
                 MovePiece(e.AttackerPosition, e.DefenderPosition);
                 break;
             }
         case BattleResult.Fail:
             {
                 //Remove attacker
                 RemovePiece(e.AttackerPosition);
                 break;
             }
         case BattleResult.Split:
             {
                 //Remove both attacker and defender
                 RemovePiece(e.AttackerPosition);
                 RemovePiece(e.DefenderPosition);
                 break;
             }
         default:
             {
                 break;
             }
     }
 }
Ejemplo n.º 2
0
 private void HandleUnitBattleResult(UnitBattleResultEvent e)
 {
     if (e.Result.Equals(BattleResult.Success) || e.Result.Equals(BattleResult.Split))
     {
         // get position of defender and disable cover
         GameObject cover;
         if (coverBoardPositions.TryGetValue(e.DefenderPosition, out cover))
         {
             cover.SetActive(false);
             coverBoardPositions.Remove(e.DefenderPosition);
         }
     }
 }
Ejemplo n.º 3
0
 private void HandleUnitBattleResult(UnitBattleResultEvent e)
 {
     action = true;
 }
Ejemplo n.º 4
0
 public void HandleUnitBattleResult(UnitBattleResultEvent e)
 {
     //Check if defender is a flag
     if (e.Defender.Rank.Equals(UnitRank.Flag))
     {
         //Attacker won
         win = true;
         winner = e.Attacker.Owner;
     }
     else if (e.Attacker.Rank.Equals(UnitRank.Flag) && e.Result.Equals(BattleResult.Fail))
     {
         //In the weird case that the attacker is a flag and it failed...
         win = true;
         winner = e.Defender.Owner;
     }
     moveWithoutChallengeCount = -1;
 }