Example #1
0
        public override void generateActionCombat(Creature user, List <GameObject> creatures)
        {
            //SelectionList()
            if (!setup)
            {
                AI.waitingForInput = true;
                CombatList temp = new CombatList(new List <object>(user.abilities));
                temp.Add("Back");
                temp.Name = "Abilities";
                Client.OverlordObject.Children.ToList()[0].GetComponent <SelectionListComponent>().ListObjects = new List <object>()
                {
                    temp,
                    "Ble",
                    "Bla"
                };
                Client.OverlordObject.Children.ToList()[0].GetComponent <SelectionListComponent>().currentlySelected = true;

                setup = true;
            }

            if (AI.abilityInput != null && AI.targetInput != -1)
            {
                this.nextAbility = AI.abilityInput;
                this.nextTarget  = AI.targetInput;

                foreach (var item in Client.OverlordObject.Children)
                {
                    item.GetComponent <SelectionListComponent>().cleanup();
                }
                AI.abilityInput    = null;
                AI.targetInput     = -1;
                AI.waitingForInput = false;
                setup = false;
            }
        }
Example #2
0
        public void TestNoObjects()
        {
            var fixture = new Fixture().Customize(new AutoNSubstituteCustomization());

            var combatObject = Substitute.For <ICombatObject>();

            CombatList list = fixture.Create <CombatList>();

            List <CombatList.Target> result;

            CombatList.BestTargetResult targetResult = list.GetBestTargets(1, combatObject, out result, 1, 0);

            result.Should().BeEmpty();
            targetResult.Should().Be(CombatList.BestTargetResult.NoneInRange);
        }
Example #3
0
        public override void generateActionCombat(Creature user, List<GameObject> creatures)
        {
            //SelectionList()
            if (!setup)
            {
                AI.waitingForInput = true;
                CombatList temp = new CombatList(new List<object>(user.abilities));
                temp.Add("Back");
                temp.Name = "Abilities";
                Client.OverlordObject.Children.ToList()[0].GetComponent<SelectionListComponent>().ListObjects = new List<object>()
                    {
                        temp,
                        "Ble",
                        "Bla"
                    };
                Client.OverlordObject.Children.ToList()[0].GetComponent<SelectionListComponent>().currentlySelected = true;

                setup = true;
            }

            if (AI.abilityInput != null && AI.targetInput != -1)
            {
                this.nextAbility = AI.abilityInput;
                this.nextTarget = AI.targetInput;

                foreach (var item in Client.OverlordObject.Children)
                {
                    item.GetComponent<SelectionListComponent>().cleanup();
                }
                AI.abilityInput = null;
                AI.targetInput = -1;
                AI.waitingForInput = false;
                setup = false;
            }
        }