Пример #1
0
    public PlaceCard
    (
        Hand hand,
        Battlefield battlefield,
        Deck deck,
        PreMadeAudioRequest placeCardSFX,
        GameObject btnsBackground,
        CustomPopUp customPopUpOpener
    )
    {
        this.hand                = hand;
        this.battlefield         = battlefield;
        this.deck                = deck;
        this.placeCardSFXRequest = placeCardSFX;
        this.btnsBackground      = btnsBackground;
        this.customPopUpOpener   = customPopUpOpener;

        btnsBackground.SetActive(false);

        ClearSelections();

        if (currentBattleStatesFactory == enemyBattleStatesFactory)
        {
            new EnemyAI().PlaceCard(this.hand, battlefield);
        }
    }
Пример #2
0
    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);
        }
    }
Пример #3
0
 public void Open(CustomPopUp incidentPopUpOpener)
 {
     incidentPopUpOpener.OpenAndMakeUncloseable
     (
         title,
         message.Replace("<br>", "\n"),
         confirmBtnText,
         cancelBtnText,
         ConfirmAction.Execute,
         CancelAction.Execute
     );
 }
Пример #4
0
    public OfferBuff(CustomPopUp customPopUp, Battlefield whateverBF, Battlefield theOtherBF)
    {
        this.customPopUp = customPopUp;
        this.whateverBF  = whateverBF;
        this.theOtherBF  = theOtherBF;

        customPopUp.OpenAndMakeUncloseable(
            title: "You guys die so slow",
            warningMessage: "If you wish, get a +1 Attack Power buff to all cards currently on the battlefield (your enemy's ones included)",
            confirmBtnMessage: "Buff all Attacks",
            cancelBtnMessage: "No need for buffs.",
            onConfirm: () => { BuffCards(); Proceed(); },
            onCancel: Proceed
            );
    }
Пример #5
0
 public EndGame(BattleStatesFactory winnerFactory,
                GameObject sceneCanvas,
                ThePopUpOpenerInstance popUpOpener,
                CustomPopUp customPopUpOpener,
                SceneOpener sceneOpener,
                PreMadeAudioRequest victoryBGMRequest,
                PreMadeAudioRequest defeatBGMRequest,
                PreMadeAudioRequest stopAllSFXRequest,
                PreMadeAudioRequest cricketsAudioRequest,
                PreMadeAudioRequest cryingAudioRequest)
 {
     this.winnerFactory        = winnerFactory;
     this.sceneCanvas          = sceneCanvas;
     this.popUpOpener          = popUpOpener;
     this.customPopUpOpener    = customPopUpOpener;
     this.sceneOpener          = sceneOpener;
     this.victoryBGMRequest    = victoryBGMRequest;
     this.defeatBGMRequest     = defeatBGMRequest;
     this.stopAllSFXRequest    = stopAllSFXRequest;
     this.cricketsAudioRequest = cricketsAudioRequest;
     this.cryingAudioRequest   = cryingAudioRequest;
 }
Пример #6
0
    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();
        }
    }
Пример #7
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MultiInstanceWindow              = (MultiInstanceView)target;
                this.MultiInstanceWindow.Deactivated += new EventHandler(this.MultiInstanceWindow_Deactivated);
                break;

            case 3:
                this.mMainGrid = (Grid)target;
                break;

            case 4:
                this.mConfigButton = (ToggleButton)target;
                break;

            case 5:
                this.mBatchDeleteButton = (CustomButton)target;
                break;

            case 6:
                this.SortOptionComboBox = (CustomComboBox)target;
                break;

            case 7:
                this.mEcoModeStackPanel = (StackPanel)target;
                break;

            case 8:
                this.mEcoModeHelp             = (CustomPictureBox)target;
                this.mEcoModeHelp.MouseEnter += new MouseEventHandler(this.EcoModeHelp_MouseEnter);
                this.mEcoModeHelp.MouseLeave += new MouseEventHandler(this.EcoModeHelp_MouseLeave);
                break;

            case 9:
                this.mOverlayGrid = (Grid)target;
                break;

            case 10:
                this.mConfigMenuItem         = (CustomPopUp)target;
                this.mConfigMenuItem.Opened += new EventHandler(this.mConfigMenuItem_Opened);
                break;

            case 11:
                this.mShadowBorder = (Border)target;
                break;

            case 12:
                this.mGrid = (Grid)target;
                break;

            case 13:
                this.mMaskBorder = (Border)target;
                break;

            case 14:
                ((UIElement)target).MouseEnter += new MouseEventHandler(this.Grid_MouseEnter);
                ((UIElement)target).MouseLeave += new MouseEventHandler(this.Grid_MouseLeave);
                break;

            case 15:
                ((UIElement)target).MouseEnter += new MouseEventHandler(this.Grid_MouseEnter);
                ((UIElement)target).MouseLeave += new MouseEventHandler(this.Grid_MouseLeave);
                break;

            case 16:
                this.mEcoModeHelpPopup             = (CustomPopUp)target;
                this.mEcoModeHelpPopup.MouseLeave += new MouseEventHandler(this.EcoModeHelp_MouseLeave);
                break;

            case 17:
                this.mEcoModeHelpPopupBorder = (Border)target;
                break;

            case 18:
                ((UIElement)target).MouseDown += new MouseButtonEventHandler(this.EcoModeHelpPopup_MouseDown);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CustomRam = (CustomTextBox)target;
                break;

            case 2:
                this.OrientationComboBox = (CustomComboBox)target;
                break;

            case 3:
                this.ResolutionComboBox = (CustomComboBox)target;
                break;

            case 4:
                this.CustomResolutionTextBoxes = (StackPanel)target;
                break;

            case 5:
                this.CustomResolutionWidth = (CustomTextBox)target;
                break;

            case 6:
                this.CustomResolutionHeight = (CustomTextBox)target;
                break;

            case 7:
                this.mAbi64AutoRadioButtonPanel             = (StackPanel)target;
                this.mAbi64AutoRadioButtonPanel.MouseEnter += new MouseEventHandler(this.CustomRadioButtonAuto_MouseEnter);
                this.mAbi64AutoRadioButtonPanel.MouseLeave += new MouseEventHandler(this.CustomRadioButtonAuto_MouseLeave);
                break;

            case 8:
                this.mAbi64AutoRadioButton = (CustomRadioButton)target;
                break;

            case 9:
                this.mAbi64ARMRadioButtonPanel             = (StackPanel)target;
                this.mAbi64ARMRadioButtonPanel.MouseEnter += new MouseEventHandler(this.CustomRadioButtonARM_MouseEnter);
                this.mAbi64ARMRadioButtonPanel.MouseLeave += new MouseEventHandler(this.CustomRadioButtonARM_MouseLeave);
                break;

            case 10:
                this.mAbi64ARMRadioButton = (CustomRadioButton)target;
                break;

            case 11:
                this.mDisabledAbiPopup = (CustomPopUp)target;
                break;

            case 12:
                this.mDisabledAbiPopupBorder = (Border)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }