Example #1
0
    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);
        }
    }
Example #2
0
 private void Start()
 {
     if (shouldAskForTip)
     {
         TipDragAndDrop.AskToUseTips();
         shouldAskForTip = false;
     }
 }
Example #3
0
    private void OnEnable()
    {
        if (shouldDisplayTipOnEnable)
        {
            TipDragAndDrop.AskToUseTips();
            shouldDisplayTipOnEnable = false;
        }

        StartCoroutine(OnAFrameAfterEnabled());
    }
Example #4
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);
        }
    }
Example #5
0
 private void Ask()
 {
     TipDragAndDrop.AskToUseTips();
 }