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; }
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); }
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; }
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); } } }
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; } }
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); } }
public BattleTargetConfirm(BattleQueueTime time, BattleZone range, BattleManhattanDistanceZone target) : base(time) { m_Range = range; m_Target = target; }
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))); }
public void UntapCardsInBattleZoneAndManaZone() { BattleZone.UntapCards(); ManaZone.UntapCards(); }
public BattleTargetSelect(BattleQueueTime time, BattleZone range) : base(time) { m_Range = range; }