Exemple #1
0
        public override List <SwapChoices> GetSwapMoves(PlayerSeat seat)
        {
            List <JewelID> prefJewels = new List <JewelID>()
            {
                JewelID.wrath
            };

            // Look through all of the current mohe's abilities
            IRuntimeMoheData mohe = GameController.Instance.GetPlayerController(seat).Player.Roster.CurrentMohe();

            // If there are any abilities that are uncharged, add to abilities buffer
            foreach (var abl in mohe.Abilities)
            {
                foreach (var comp in abl.AbilityComponents)
                {
                    if (comp.Has < comp.Needs && !prefJewels.Contains(comp.JewelType))
                    {
                        prefJewels.Add(comp.JewelType);
                    }
                }
            }

            // look for matches
            List <SwapChoices> matchesBuff = FindMatchesUtil.FindBestMatches(game.GameBoard.GetBoardData().GetMap(), prefJewels);

            return(matchesBuff.OrderByDescending(m => m.matches).ToList());
        }
Exemple #2
0
        public override bool Populate(PlayerSeat Seat, int pos)
        {
            Outline outty = GetComponent <Outline>();

            actionOutline = new UiActionActive(this, outty);

            seat = Seat;

            contPlayer = GameData.Instance.RuntimeGame.Players.Find(player => player.Seat == seat);
            IRoster pRoster = contPlayer.Roster;

            if (pRoster.MoheRoster.Count <= pos)
            {
                return(false);
            }

            moheData = pRoster.MoheRoster[pos];

            headerTxt = transform.Find("HeaderTxt").GetComponent <TextMeshProUGUI>();
            lvlTxt    = transform.Find("LvlTxt").GetComponent <TextMeshProUGUI>();

            transform.Find("HealthBarImg").GetComponent <UiHealthBarFiller>().Populate(moheData);
            transform.Find("ExpBarImg").GetComponent <UiExpBarFiller>().Populate(moheData);
            moheImage = transform.Find("MohePortrait").GetComponent <Image>();

            headerTxt.text = moheData.BaseMohe.Data.Name;
            lvlTxt.text    = moheData.BaseExpType.CalculateLevel(moheData.Exp).ToString();

            moheImage.sprite = moheData.BaseMohe.Data.Artwork;

            OnToggle += OnSetSwap;

            return(true);
        }
Exemple #3
0
        public IEnumerator ExecuteAiTurn(PlayerSeat seat)
        {
            // Clear board
            GameEvents.Instance.Notify <IRemoveSelectedBoard>(i => i.OnBoardRemoveSelectedCheck());

            // wait until the board state is clean.
            int count = 0;

            while (!BoardController.Instance.CanClickJewel() && count < 20)
            {
                yield return(new WaitForSeconds(1));

                Debug.Log("count: " + count.ToString());
                Debug.Log("state: " + BoardController.Instance.CurrentState.ToString());
                count++;
            }

            // Check to see if the computer can use any abilities
            IRuntimeMoheData mohe = GameController.Instance.GetPlayerController(seat).Player.Roster.CurrentMohe();

            yield return(new WaitForSeconds(.25f));

            if (mohe.UseableAbility())
            {
                Fsm.Handler.MonoBehaviour.StartCoroutine(ExecuteAiAbility(Seat));
            }
            else
            {
                Fsm.Handler.MonoBehaviour.StartCoroutine(ExecuteAiSwap(Seat));
            }

            yield return(null);
        }
Exemple #4
0
        public override bool Execute(IRuntimeJewel TriggerJewel)
        {
            PlayerSeat       pSeat = EffectPlayer == PlayerEffectSeat.Active ? GameData.Instance.RuntimeGame.TurnLogic.CurrentPlayer.Seat : GameData.Instance.RuntimeGame.TurnLogic.NextPlayer.Seat;
            IRuntimeMoheData mohe  = GameController.Instance.GetPlayerController(pSeat).Player.Roster.CurrentMohe();

            GameEvents.Instance.Notify <IMoheHeal>(i => i.OnMoheHeal(mohe.InstanceID, (int)Random.Range(MinAmt, MaxAmt)));

            return(true);
        }
Exemple #5
0
        public override List <IRuntimeAbility> GetAbilityMoves(PlayerSeat seat)
        {
            List <IRuntimeAbility> abilityChoices = new List <IRuntimeAbility>();

            // Look through all of the current mohe's abilities
            IRuntimeMoheData mohe = GameController.Instance.GetPlayerController(seat).Player.Roster.CurrentMohe();

            // If there are any abilities that are uncharged, add to abilities buffer
            foreach (var abl in mohe.Abilities)
            {
                if (abl.AbilityCharged() && GetAbilityJewel(seat, abl).Count() > 0)
                {
                    abilityChoices.Add(abl);
                }
            }
            return(abilityChoices);
        }
        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);
        }
Exemple #7
0
 protected BaseMoheMechanics(IRuntimeMoheData mohe)
 {
     Mohe = mohe;
 }
Exemple #8
0
 public HealMoheMechanic(IRuntimeMoheData Mohe) : base(Mohe)
 {
     GameEvents.Instance.AddListener(this);
     mohe = Mohe;
 }
Exemple #9
0
 public GainStatusMoheMehanic(IRuntimeMoheData Mohe) : base(Mohe)
 {
     mohe = Mohe;
 }
Exemple #10
0
 public void Populate(IRuntimeMoheData Mohe)
 {
     mohe = Mohe;
     Refresh();
 }
Exemple #11
0
 public LoseStatusMoheMechanic(IRuntimeMoheData Mohe) : base(Mohe)
 {
     mohe = Mohe;
 }
Exemple #12
0
 public GainLvlMoheMechanic(IRuntimeMoheData Mohe) : base(Mohe)
 {
     mohe = Mohe;
 }