public IEnumerator SelectAndMoveCardOptional(HeroTurnTakerController hero, Func <Card, bool> criteria, Location toLocation, bool toBottom = false, bool optional = false, bool isPutIntoPlay = false, bool playIfMovingToPlayArea = true, List <SelectCardDecision> storedResults = null, CardSource cardSource = null)
        {
            BattleZone battleZone = null;

            if (cardSource != null)
            {
                battleZone = cardSource.BattleZone;
            }
            SelectCardDecision selectCardDecision = new SelectCardDecision(this.GameController, hero, SelectionType.MoveCard, this.GameController.FindCardsWhere(criteria, true, null, battleZone), optional, false, null, null, null, null, null, false, true, cardSource, null);

            selectCardDecision.BattleZone = battleZone;
            if (storedResults != null)
            {
                storedResults.Add(selectCardDecision);
            }
            IEnumerator coroutine = this.GameController.SelectCardAndDoAction(selectCardDecision, (SelectCardDecision d) => this.GameController.MoveCard(hero, d.SelectedCard, toLocation, toBottom, isPutIntoPlay, playIfMovingToPlayArea, null, false, null, null, null, false, false, null, false, false, false, false, cardSource), true);

            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
Exemplo n.º 2
0
 public void Update(Duel duel, Player player)
 {
     Hand.Update(duel, player.Hand);
     ManaZone.Update(duel, player.ManaZone);
     BattleZone.Update(duel, player.BattleZone);
     Deck.Update(duel, player.Deck);
     ShieldZone.Update(duel, player.ShieldZone);
     Graveyard.Update(duel, player.Graveyard);
 }
Exemplo n.º 3
0
    public void Awake()
    {
        StartBattleZone  = GameObject.Find("BattleZone").GetComponent <BattleZone>();
        dialogueTriggers = GetComponents <DialogueTrigger>();
        myCollider2D     = GetComponent <BoxCollider2D>();

        StartBattleZone.OnEndBattleZone += BossFirstAction;
        this.MaxHp = 30;
        this.Hp    = this.MaxHp;
        attack     = 1f;
    }
Exemplo n.º 4
0
    public void Set(BattleZone targets)
    {
        Clear();

        foreach (Vector2Int point in targets)
        {
            if (m_Grid[point] != null)
            {
                Transform tile = Instantiate(targetedAreaPrefab, transform);
                tile.localPosition = new Vector3(point.x, point.y, -0.5f * m_Grid[point].Height);
            }
        }
    }
Exemplo n.º 5
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         BattleZone?.Dispose();
         BattleZone = null;
         Deck?.Dispose();
         Deck = null;
         Graveyard?.Dispose();
         Graveyard = null;
         Hand?.Dispose();
         Hand = null;
         ManaZone?.Dispose();
         ManaZone = null;
         ShieldZone?.Dispose();
         ShieldZone = null;
     }
 }
Exemplo n.º 6
0
        private IEnumerator SelectAndMoveCardOptional(HeroTurnTakerController hero, Func <Card, bool> criteria, Location toLocation, bool toBottom = false, bool optional = true, bool isPutIntoPlay = false, bool playIfMovingToPlayArea = true, List <SelectCardDecision> storedResults = null, CardSource cardSource = null)
        {
            BattleZone battleZone = null;

            if (cardSource != null)
            {
                battleZone = cardSource.BattleZone;
            }
            SelectCardDecision selectCardDecision = new SelectCardDecision(GameController, hero, SelectionType.MoveCard, GameController.FindCardsWhere(criteria, realCardsOnly: true, null, battleZone), isOptional: optional, allowAutoDecide: false, null, null, null, null, null, maintainCardOrder: false, actionCanBeCancelled: true, cardSource);

            selectCardDecision.BattleZone = battleZone;
            storedResults?.Add(selectCardDecision);
            IEnumerator coroutine = GameController.SelectCardAndDoAction(selectCardDecision, (SelectCardDecision d) => GameController.MoveCard(hero, d.SelectedCard, toLocation, toBottom, isPutIntoPlay, playIfMovingToPlayArea, null, showMessage: false, null, null, null, evenIfIndestructible: false, flipFaceDown: false, null, isDiscard: false, evenIfPretendGameOver: false, shuffledTrashIntoDeck: false, doesNotEnterPlay: false, cardSource));

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
        }
Exemplo n.º 7
0
 public BattleTargetConfirm(BattleQueueTime time, BattleZone range, BattleManhattanDistanceZone target) : base(time)
 {
     m_Range  = range;
     m_Target = target;
 }
Exemplo n.º 8
0
 public void PutFromBattleZoneOnTopOfDeck(Card permanent, Duel duel)
 {
     BattleZone.Remove(permanent);
     _ = Deck.Add(new Card(permanent, false), duel, null);
     duel.CurrentTurn.CurrentStep.GameEvents.Enqueue(new PermanentPutIntoTopDeckEvent(new Player(this), new Card(permanent, true)));
 }
Exemplo n.º 9
0
 public void UntapCardsInBattleZoneAndManaZone()
 {
     BattleZone.UntapCards();
     ManaZone.UntapCards();
 }
Exemplo n.º 10
0
 public BattleTargetSelect(BattleQueueTime time, BattleZone range) : base(time)
 {
     m_Range = range;
 }