public Reposition(Battlefield attackerBattlefield, Battlefield opponentBattlefield, UICustomBtn endRepositioningBtn, GameObject youCanRepositionNowText, GameObject btnsBackground) { this.attackerBattlefield = attackerBattlefield; this.opponentBattlefield = opponentBattlefield; this.endRepositioningBtn = endRepositioningBtn; this.youCanRepositionNowGameObject = youCanRepositionNowText; ClearSelection(); youCanRepositionNowText.SetActive(true); btnsBackground.SetActive(currentBattleStatesFactory == playerBattleStatesFactory); if (!alreadyAskedTip && currentBattleStatesFactory == playerBattleStatesFactory) { TipDragAndDrop.AskToUseTips(); alreadyAskedTip = true; } endRepositioningBtn.onClicked = OnEndRepositioningBtnClicked; if (currentBattleStatesFactory == enemyBattleStatesFactory) { new EnemyAI().Reposition(attackerBattlefield, endRepositioningBtn); } else { endRepositioningBtn.gameObject.SetActive(true); } }
public override void ExecuteAction() { if (shouldDisplayPlaceCardsNowTip) { shouldDisplayPlaceCardsNowTip = false; TipDragAndDrop.ShowPlaceCardsNowTip(); } else if (PlayerIsTryingToReposition()) { ClearSelections(); shouldDisplayPlaceCardsNowTip = true; // I suspect the lag of bringing this UI to the screen was the cause of a bug in which the card couldn't be dropped. // That's why the PlaceCardsTip is not being displayed immediatelly. } else if (ReceivedValidInput()) { Card card = hand.RemoveCardFromSelectedIndex(); bool smooth = currentBattleStatesFactory == enemyBattleStatesFactory; if (smooth) { battlefield.PutCardInSelectedIndexWithSmoothMovement(card); } else { battlefield.PutCardInSelectedIndexThenTeleportToSlot(card); } cardWasSuccessfullyPlaced = true; placeCardSFXRequest.RequestPlaying(); card.ChangeToHorizontalVersion(); } }
private void Start() { if (shouldAskForTip) { TipDragAndDrop.AskToUseTips(); shouldAskForTip = false; } }
private void OnEnable() { if (shouldDisplayTipOnEnable) { TipDragAndDrop.AskToUseTips(); shouldDisplayTipOnEnable = false; } StartCoroutine(OnAFrameAfterEnabled()); }
public Attack( Battlefield attackerBattlefield, Battlefield opponentBattleField, UICustomBtn endTurnBtn, UICustomBtn repositionAgainBtn, GameObject toActivate, CustomPopUp popUpOpener, PreMadeAudioRequest confirmOnUselessAtackSFXRequisitor, PreMadeAudioRequest onCancelUselessAtackSFXRequisitor ) { this.attackerBattlefield = attackerBattlefield; this.opponentBattleField = opponentBattleField; obfWasFullAtBeggining = opponentBattleField.IsFull(); this.repositionAgainBtn = repositionAgainBtn; this.toActivate = toActivate; this.confirmOnUselessAtackSFXRequisitor = confirmOnUselessAtackSFXRequisitor; this.onCancelUselessAtackSFXRequisitor = onCancelUselessAtackSFXRequisitor; toActivate.SetActive(true); ClearSelections(); if (currentBattleStatesFactory == enemyBattleStatesFactory) { new EnemyAI().Attack(MAX_AMOUNT_OF_ATTACKS, enemyBattlefield: attackerBattlefield, playerBattlefield: opponentBattleField); } else { if (shouldAskForTip) { TipDragAndDrop.AskToUseTips(); shouldAskForTip = false; } } attackersThatHaveNotAttacked = ListCardsThatCanAttackDuringThisState(); TOTAL_OF_ATTACKERS = attackersThatHaveNotAttacked.Count + GetAmountOfCardsThatAlreadyAttacked(); this.endTurnBtn = endTurnBtn; this.popUpOpener = popUpOpener; if (currentBattleStatesFactory == playerBattleStatesFactory) { endTurnBtn.onClicked = OnClickedEndTurnBtn; endTurnBtn.gameObject.SetActive(true); repositionAgainBtn.onClicked = OnClickedRepositionAgainBtn; repositionAgainBtn.gameObject.SetActive(true); } }
public EndTurn(Battlefield battlefield, Deck deck, Hand hand, GameObject toDeactivate) { this.battlefield = battlefield; this.deck = deck; this.hand = hand; toDeactivate.SetActive(false); // It might be active if there was a Bonus Reposition State TipDragAndDrop.HideBonusRepositioningTip(); }
public BonusReposition ( Hand playerHand, Battlefield battlefield, Deck deck, PreMadeAudioRequest placeCardSFX, GameObject btnsBackground, CustomPopUp customPopUpOpener, Hand opponentHand, Deck opponentDeck, Text endRepositioningBtnText ) : base ( playerHand, battlefield, deck, placeCardSFX, btnsBackground, customPopUpOpener ) { this.opponentHand = opponentHand; this.opponentDeck = opponentDeck; if (currentBattleStatesFactory == playerBattleStatesFactory) { endRepositioningBtnText.text = "Pass ->"; TipDragAndDrop.ShowBonusRepositioningTip(); } if (!EnemyIsCompletelyDefeated()) { GiveHandBackToDeck(); GiveBattlefieldBackToHand(); } }
private void Ask() { TipDragAndDrop.AskToUseTips(); }
protected void OnGoToRepositionState() { TipDragAndDrop.HidePlaceCardsNowTip(); }