示例#1
0
    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();
        }
    }
示例#2
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }
示例#5
0
 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(); }
                            );
 }
示例#6
0
    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);
    }