Esempio n. 1
0
    public override void Enter()
    {
        base.Enter();
        aa    = turn.ability.GetComponent <AbilityArea>();
        tiles = aa.GetTilesInArea(board, pos);
        board.SelectTiles(tiles);
        FindTargets();
        RefreshPrimaryStatPanel(turn.actor.tile.pos);
        SetTarget(0);
        if (turn.targets.Count > 0)
        {
            //only show indicator for player units
            if (driver.Current == Drivers.Human)
            {
                hitSuccessIndicator.Show();
            }
            SetTarget(0);
        }

        // Only show this UI for AI controlled units
        if (driver.Current == Drivers.Computer)
        {
            StartCoroutine(ComputerDisplayAbilitySelection());
        }
    }
 public override void Enter()
 {
     base.Enter();
     aa    = turn.ability.GetComponent <AbilityArea>();
     tiles = aa.GetTilesInArea(board, pos);
     board.SelectTiles(tiles);
     FindTargets();
     RefreshPrimaryStatPanel(turn.actor.tile.pos);
     SetTarget(0);
 }
Esempio n. 3
0
 public override void Enter()
 {
     base.Enter();
     aa    = turn.phaser.GetComponent <AbilityArea>();
     tiles = aa.GetTilesInArea(board, pos);
     board.SelectTiles(tiles, Color.magenta);
     // Find the targets in ability area
     FindTargets();
     RefreshPrimaryStatPanel(turn.actor.tile.pos);
     SetTarget(0);
     attackSuccessIndicator.Show();
 }
Esempio n. 4
0
 public override void Enter()
 {
     base.Enter();
     aa     = turn.phaser.GetComponent <AbilityArea>();
     tiles  = aa.GetTilesInArea(board, pos);
     points = turn.abilityRange.Select(tile => tile.pos).ToList();
     ConfineInTargetRange(points);
     board.SelectTiles(tiles, Color.magenta);
     // Find the targets in ability area
     FindTargets();
     RefreshPrimaryStatPanel(turn.actor.tile.pos);
 }
Esempio n. 5
0
    public override void Enter()
    {
        base.Enter();
        range = turn.ability.GetComponent <AbilityRange>();
        area  = turn.ability.GetComponent <AbilityArea>();
        SelectCells();
        statPanelController.ShowPrimary(turn.actor.gameObject);

        if (range.directionOriented)
        {
            RefreshSecondaryStatPanel(currentCell);
        }
    }
    public override void Enter()
    {
        base.Enter ();
        aa = turn.ability.GetComponent<AbilityArea> ();
        tiles = aa.GetTilesInArea (board, pos);
        board.SelectTiles (tiles);
        FindTargets ();
        RefreshPrimaryStatPanel (turn.actor.tile.pos);

        if (turn.targets.Count > 0) {
            hitSuccessIndicator.Show ();
            SetTarget (0);
        }
    }
Esempio n. 7
0
        private void RateFireLocation(PlanOfAttack poa, AttackOption attackOption)
        {
            AbilityArea area  = poa.ability.GetComponent <AbilityArea>();
            List <Tile> tiles = area.GetTilesInArea(bc.board, attackOption.target.pos);

            attackOption.areaTargets   = tiles;
            attackOption.isCasterMatch = IsAbilityTargetMatch(poa, actor.tile);

            for (int i = 0; i < tiles.Count; ++i)
            {
                Tile tile = tiles[i];
                if (actor.tile == tiles[i] || !poa.ability.IsTarget(tile))
                {
                    continue;
                }

                bool isMatch = IsAbilityTargetMatch(poa, tile);
                attackOption.AddMark(tile, isMatch);
            }
        }
Esempio n. 8
0
    public void display(GameObject obj)
    {
        bool levelDataFound = false;
        bool bonusFound     = false;

        string levelText = "";
        string bonusText = "";

        AbilityGeneralData generalData = obj.GetComponent <AbilityGeneralData>();

        if (generalData)
        {
            nameLabel.text        = generalData.abilityName;
            categoryLabel.text    = generalData.abilityCategoryText;
            descriptionLabel.text = generalData.abilityDescription;
        }

        AbilityCostData costData = obj.GetComponent <AbilityCostData>();

        if (costData)
        {
            int costPanels = 0;

            if (costData.abilityMentalCost == 0 && costData.abilityPhysicalCost == 0)
            {
                costPanel.SetActive(false);
            }
            else
            {
                costPanel.SetActive(true);
            }

            if (costData.abilityMentalCost > 0)
            {
                mentalCostPanel.SetActive(true);
                costPanels++;
            }
            else
            {
                mentalCostPanel.SetActive(false);
            }

            if (costData.abilityPhysicalCost > 0)
            {
                physicalCostPanel.SetActive(true);
                costPanels++;
            }
            else
            {
                physicalCostPanel.SetActive(false);
            }

            if (costPanels == 0)
            {
                costPanel.SetActive(false);
            }
            else
            {
                costPanel.SetActive(true);

                if (costPanels > 1)
                {
                    separatorPanel.SetActive(true);
                }
                else
                {
                    separatorPanel.SetActive(false);
                }
            }

            mentalCostLabel.text   = costData.abilityMentalCost.ToString();
            physicalCostLabel.text = costData.abilityPhysicalCost.ToString();
        }

        AbilityRange abilityRange = obj.GetComponent <AbilityRange>();

        if (abilityRange)
        {
            rangeTypeLabel.text = abilityRange.getAbilityRangeDescription();
        }

        AbilityArea abilityArea = obj.GetComponent <AbilityArea>();

        if (abilityArea)
        {
            areaTypeLabel.text = abilityArea.getAbilityAreaDescription();
        }

        for (int i = 0; i < obj.transform.childCount; ++i)
        {
            Transform child = obj.transform.GetChild(i);

            if (child.name == "Bonus")
            {
                string levelChildName;

                AbilityLevelData abilityLevelData = child.GetComponent <AbilityLevelData>();

                if (abilityLevelData != null)
                {
                    levelDataFound = true;
                    levelText      = "Nivel " + abilityLevelData.level.ToString();

                    levelChildName = "Level " + abilityLevelData.level;

                    for (int j = 0; j < child.transform.childCount; ++j)
                    {
                        Transform bonusChild = child.transform.GetChild(j);

                        if (bonusChild.name == levelChildName)
                        {
                            AbilityBonus[] abilityBonusList = bonusChild.GetComponents <AbilityBonus>();
                            foreach (AbilityBonus abilityBonus in abilityBonusList)
                            {
                                bonusFound = true;

                                if (bonusText != "")
                                {
                                    bonusText += "\n";
                                }
                                bonusText += abilityBonus.getAbilityBonusDescription();
                            }

                            break;
                        }
                    }
                }
            }

            foreach (Transform effectChild in effectsPanel.transform)
            {
                Destroy(effectChild.gameObject);
            }
            if (child.name == "Effects")
            {
                for (int j = 0; j < child.childCount; ++j)
                {
                    Transform childEffect = child.transform.GetChild(j);

                    GameObject effectPanelObject = Instantiate(effectPanelPrefab);
                    effectPanelObject.transform.SetParent(effectsPanel.transform);
                    effectPanelObject.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
                    effectPanelObject.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
                    EffectPanel effectPanel = effectPanelObject.GetComponent <EffectPanel>();

                    if (effectPanel)
                    {
                        AbilityPower abilityPower = childEffect.GetComponent <AbilityPower>();
                        if (abilityPower)
                        {
                            effectPanel.powerLabel.gameObject.SetActive(true);

                            effectPanel.powerLabel.text = abilityPower.getAbilityPower().ToString() + "%";
                        }
                        else
                        {
                            effectPanel.powerLabel.gameObject.SetActive(false);
                        }

                        AbilityHitRate abilityHitRate = childEffect.GetComponent <AbilityHitRate>();
                        if (abilityHitRate)
                        {
                            effectPanel.hitRateLabel.gameObject.SetActive(true);

                            effectPanel.hitRateLabel.text = abilityHitRate.getAbilityHitRateDescription();
                        }
                        else
                        {
                            effectPanel.hitRateLabel.gameObject.SetActive(false);
                        }
                    }
                }
            }
        }

        if (levelDataFound)
        {
            levelPanel.gameObject.SetActive(true);
            levelLabel.text = levelText;
        }
        else
        {
            levelPanel.gameObject.SetActive(false);
        }

        if (bonusFound)
        {
            CentralPanelSeparator.SetActive(true);
            bonusLabel.gameObject.SetActive(true);
            bonusLabel.text = bonusText;
        }
        else
        {
            CentralPanelSeparator.SetActive(false);
            bonusLabel.gameObject.SetActive(false);
            bonusLabel.text = "";
        }
    }
Esempio n. 9
0
        void ReleaseDesignerOutlets()
        {
            if (AbilityArea != null)
            {
                AbilityArea.Dispose();
                AbilityArea = null;
            }

            if (AlignmentButton != null)
            {
                AlignmentButton.Dispose();
                AlignmentButton = null;
            }

            if (CharismaButton != null)
            {
                CharismaButton.Dispose();
                CharismaButton = null;
            }

            if (ClassButton != null)
            {
                ClassButton.Dispose();
                ClassButton = null;
            }

            if (ConstitutionButton != null)
            {
                ConstitutionButton.Dispose();
                ConstitutionButton = null;
            }

            if (CRButton != null)
            {
                CRButton.Dispose();
                CRButton = null;
            }

            if (CreatureSubtypeButton != null)
            {
                CreatureSubtypeButton.Dispose();
                CreatureSubtypeButton = null;
            }

            if (CreatureTypeButton != null)
            {
                CreatureTypeButton.Dispose();
                CreatureTypeButton = null;
            }

            if (DexterityButton != null)
            {
                DexterityButton.Dispose();
                DexterityButton = null;
            }

            if (HeaderArea != null)
            {
                HeaderArea.Dispose();
                HeaderArea = null;
            }

            if (InitButton != null)
            {
                InitButton.Dispose();
                InitButton = null;
            }

            if (IntelligenceButton != null)
            {
                IntelligenceButton.Dispose();
                IntelligenceButton = null;
            }

            if (NameButton != null)
            {
                NameButton.Dispose();
                NameButton = null;
            }

            if (RaceButton != null)
            {
                RaceButton.Dispose();
                RaceButton = null;
            }

            if (SensesButton != null)
            {
                SensesButton.Dispose();
                SensesButton = null;
            }

            if (SizeButton != null)
            {
                SizeButton.Dispose();
                SizeButton = null;
            }

            if (StrengthButton != null)
            {
                StrengthButton.Dispose();
                StrengthButton = null;
            }

            if (WisdomButton != null)
            {
                WisdomButton.Dispose();
                WisdomButton = null;
            }
        }
Esempio n. 10
0
 public override void Enter()
 {
     base.Enter();
     area  = turn.ability.GetComponent <AbilityArea>();
     cells = area.GetCellsInArea(Grid, currentCell);
 }