示例#1
0
        // Listen to Ability charge update

        // Refresh UI on call

        public bool Populate(PlayerSeat Seat, IRuntimeAbility Ability, int ComponentIdx)
        {
            seat         = Seat;
            ability      = Ability;
            componentIdx = ComponentIdx;

            return(Refresh());
        }
示例#2
0
        public IUiAttackCost Get(PlayerSeat seat, IRuntimeAbility ability, int componentIdx)
        {
            var obj = Get <IUiAttackCost>();

            if (!obj.Populate(seat, ability, componentIdx))
            {
                return(null);
            }
            return(obj);
        }
示例#3
0
        /// <summary>
        ///     Returns the best ability according to the current ai submodule.
        /// </summary>
        /// <returns></returns>
        public List <IRuntimeJewel> GetAbilityJewels(PlayerSeat seat, IRuntimeAbility ability)
        {
            if (!subModules.ContainsKey(CurrentAi))
            {
                throw new ArgumentOutOfRangeException(
                          CurrentAi + " is not registered as a valid archetype in this module.");
            }

            return(subModules[CurrentAi].GetAbilityJewel(seat, ability));
        }
示例#4
0
 public void OnBoardActionCheck(PlayerSeat seat, IRuntimeAbility ability)
 {
     board.OnInvokeActionEffect = null;
     board.OnCleanAbility       = null;
     if (ability != null && ability.Ability.AfterEffect != null)
     {
         board.OnInvokeActionEffect += ability.Ability.AfterEffect.Execute;
         board.OnCleanAbility       += ability.ResetAbility;
         NotifyAction();
     }
     else
     {
         NotifyEvaluate();
     }
 }
示例#5
0
        public override bool Populate(PlayerSeat Seat, int pos)
        {
            Outline outty = GetComponent <Outline>();

            actionOutline = new UiActionActive(this, outty);

            seat = Seat;

            CostPanels = new List <IUiAttackCost>();

            headerTxt = transform.Find("HeaderTxt").GetComponent <TextMeshProUGUI>();
            descTxt   = transform.Find("DescTxt").GetComponent <TextMeshProUGUI>();

            IRuntimeMoheData moheData = GameData.Instance.RuntimeGame.Players.Find(player => player.Seat == seat).Roster.CurrentMohe();

            //check to make sure the player has enough mohe for pos
            if (moheData.Abilities.Count <= pos)
            {
                return(false);
            }

            //Populate headers and desc
            ability        = moheData.Abilities[pos];
            headerTxt.text = ability.Ability.AbilityName;
            descTxt.text   = ability.Ability.Description;

            Transform costParent = transform.Find("Cost");

            foreach (Transform t in costParent)
            {
                Destroy(t.gameObject);
            }

            for (int i = 0; i < ability.AbilityComponents.Count; i++)
            {
                IUiAttackCost cost = UiAtkActionCostPooler.Instance.Get(seat, ability, i);
                cost.MBehaviour.transform.SetParent(costParent);
                cost.MBehaviour.transform.localScale = Vector3.one;
                CostPanels.Add(cost);
            }

            return(true);
        }
示例#6
0
        public override List <IRuntimeJewel> GetAbilityJewel(PlayerSeat seat, IRuntimeAbility ability)
        {
            List <IRuntimeJewel> abilityJewels = new List <IRuntimeJewel>();

            IRuntimeJewel[,] jwlMap = game.GameBoard.GetBoardData().GetMap();
            int width  = jwlMap.GetLength(0);
            int height = jwlMap.GetLength(1);

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    if (jwlMap[x, y].Data.JewelID == ability.Ability.AfterEffect.Jewel || ability.Ability.AfterEffect.Jewel == JewelID.any)
                    {
                        abilityJewels.Add(jwlMap[x, y]);
                    }
                }
            }

            return(abilityJewels);
        }
示例#7
0
 public abstract List <IRuntimeJewel> GetAbilityJewel(PlayerSeat seat, IRuntimeAbility ability);