Пример #1
0
 public void PlayTurn()
 {
     if (endGameState.stateMachine.computerHand.IsAnyTightBondInHand())
     {
         if (endGameState.stateMachine.computerHand.AreTighBondCardsSame())
         {
             TightBondUnit tightBondUnit = endGameState.stateMachine.computerHand.GetTightBondUnit(lastPlayedTightBond);
             if (!tightBondUnit.ToRow.currentRow.IsWeatherEffectOnRow())
             {
                 Debug.Log("Imma Gonna play TightBond!");
                 lastPlayedTightBond = tightBondUnit.Title;
                 EnemyTurn.PlaceCardOnBoard(endGameState.stateMachine.enemyHand, tightBondUnit);
                 endGameState.stateMachine.turnState.currentState = Classes.EnumClasses.BattleState.PlayerTurn;
                 ChangeState(endGameState.playTightBondState);
             }
             else
             {
                 //PlayClearWeather
                 ChangeState(endGameState.playClearSkiesState);
             }
         }
         else
         {
             //PlayLowestCardState
             ChangeState(endGameState.playLowestCardState);
         }
     }
     else
     {
         //PlayLowestCardState
         ChangeState(endGameState.playLowestCardState);
     }
 }
Пример #2
0
    public TightBondUnit GetTightBondUnit(string name)
    {
        TightBondUnit tightBondUnit   = null;
        var           tightBondGroups = tightBondCards.GroupBy(c => c.Title);

        foreach (var tightBondGroup in tightBondGroups)
        {
            if (tightBondGroup.Key == name)
            {
                tightBondUnit = tightBondGroup.First();
            }
        }
        if (tightBondUnit == null)
        {
            tightBondUnit = tightBondCards.First();
        }
        tightBondCards.Remove(tightBondUnit);
        return(tightBondUnit);
    }
Пример #3
0
        public UnitCard CreateUnitCard(int id, string title, CardType type, Faction faction, string slug, int attackValue, Ability ability)
        {
            UnitCard unitCard = null;

            switch (ability)
            {
            case Ability.None:
            {
                unitCard = new NormalUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.Spy:
            {
                unitCard = new SpyUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.MoraleBoost:
            {
                unitCard = new MoraleBoostUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.Medic:
            {
                unitCard = new MedicUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.TightBond:
            {
                unitCard = new TightBondUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.Hero:
            {
                unitCard = new HeroUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.Agile:
            {
                break;
            }

            case Ability.Muster:
            {
                unitCard = new MusterUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            case Ability.Scorch:
            {
                unitCard = new ScorchUnit(id, title, type, faction, slug, attackValue, ability);
                break;
            }

            default:
                break;
            }

            return(unitCard);
        }