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(); } }
public void OpenWithBGM // With Custom Cancel / With BGM ( string title, string warningMessage, string confirmBtnMessage, string cancelBtnMessage, OnBtnClicked onConfirm, OnBtnClicked onCancel, PreMadeAudioRequest openingBGM ) { openingBGM.RequestPlaying(); Open(title, warningMessage, confirmBtnMessage, cancelBtnMessage, onConfirm, onCancel); }
public void OpenDisplayingUnblockedCardsOfClass ( string title, string warningMessage, string confirmBtnMessage, OnBtnClicked onConfirm, PreMadeAudioRequest openingBGM, Classes classeOfCardsToShow ) { openingBGM.RequestPlaying(); cardsDisplay.ShowUnlockedCardsOfClass(classeOfCardsToShow); OpenAndMakeUncloseable(title, warningMessage, confirmBtnMessage, "", onConfirm: () => { cardsDisplay.ClearAttributes(); onConfirm(); }, onCancel: () => {} ); customCancelBtn.gameObject.SetActive(false); }
public void OpenDisplayingRewardCards ( string title, string warningMessage, string confirmBtnMessage, OnBtnClicked onConfirm, PreMadeAudioRequest openingBGM, Card[] cards ) { openingBGM.RequestPlaying(); cardsDisplay.ShowCards(cards); OpenAndMakeUncloseable(title, warningMessage, confirmBtnMessage, "", onConfirm: () => { onConfirm(); cardsDisplay.ClearAttributes(); }, onCancel: () => {} ); customCancelBtn.gameObject.SetActive(false); }
public void OpenDisplayingCardsToChoose ( string title, string warningMessage, string confirmBtnMessage, string cancelBtnMessage, OnBtnClicked onConfirm, OnBtnClicked onCancel, PreMadeAudioRequest openingBGM, Card[] cards ) { openingBGM.RequestPlaying(); cardsDisplay.ShowCards(cards); OpenAndMakeUncloseable(title, warningMessage, confirmBtnMessage, cancelBtnMessage, onConfirm: () => { onConfirm(); cardsDisplay.ClearAttributes(); }, onCancel: () => { onCancel(); cardsDisplay.ClearAttributes(); } ); }
private bool HandleUselessAttacks() { Card myCard = attackerBattlefield.GetSelectedCard(); bool isUseless = !myCard.IgnoreOpponentsBlock && myCard.AttackPower == 1 && opponentBattleField.IsThereACardInFrontOf(opponentBattleField.GetSelectedIndex()); if (currentBattleStatesFactory == playerBattleStatesFactory) { if (isUseless) { popUpOpener.Open ( title: "Protected", warningMessage: ColorHexCodes.BeginWhite + "Your " + ColorHexCodes.BeginLightRed + "Attack Power" + ColorHexCodes.End + " of " + ColorHexCodes.BeginLightRed + "1" + ColorHexCodes.End + " was not enough to deal damage because cards behind others are 'Protected'</color>" + "\n" + ColorHexCodes.BeginLightGreen + "DAMAGE = 1/2 = 0.5 = 0 (integer)" + ColorHexCodes.End, confirmBtnMessage: "Facepalm", cancelBtnMessage: "Offend enemy", onConfirm: () => { confirmOnUselessAtackSFXRequisitor.RequestPlaying(); popUpOpener.ClosePopUpOnTop(); }, onCancel: () => { onCancelUselessAtackSFXRequisitor.RequestPlaying(); popUpOpener.ClosePopUpOnTop(); } ); } } return(isUseless); }