Exemplo n.º 1
0
        public void InitializeBattle()
        {
            testWorld testworld = new testWorld();
            var       player    = testworld.AddAgent <Player>(Gender.Female, Singleton <Human> .GetInstance(), Singleton <MageClass> .GetInstance(), "NotInstantiated", 3, 5);

            PlayerInstanceManager.SetPlayer(player);
            Assert.IsTrue(testworld.Agents.Count == 1);

            var name  = "Hostile Djin female";
            var enemy = testworld.AddAgent <NPCBase>(Gender.Female, Singleton <Djin> .GetInstance(), Singleton <WarriorClass> .GetInstance(), name, 8, 25);

            enemy.AI        = new HostileAI(enemy);
            enemy.IsHostile = true;
            enemy.ArmStarterGear();
            enemy.AddPartyMember(Gender.Male, Singleton <Narugan> .GetInstance(), Singleton <MageClass> .GetInstance(), "Narugan Mage");


            BattleFaction goodGuys = new BattleFaction(player);
            BattleFaction badGuys  = new BattleFaction(enemy);

            goodGuys.Enemies.Add(badGuys);
            badGuys.Enemies.Add(goodGuys);

            Battlefield field = Singleton <Grasslands> .GetInstance();

            Battle battle = Singleton <Battle> .GetInstance();

            battle.NewBattle(field, new BattleFaction[] { goodGuys, badGuys });
        }
Exemplo n.º 2
0
        public void playerAdded()
        {
            testWorld testworld = new testWorld();

            PlayerInstanceManager.SetPlayer(testworld.AddAgent <Player>(Gender.Female, Singleton <Human> .GetInstance(), Singleton <MageClass> .GetInstance(), "NotInstantiated", 3, 5));
            Assert.IsTrue(testworld.Agents.Count == 1);
        }
Exemplo n.º 3
0
        protected override void Initiate()
        {
            Console.Clear();
            var pallet = ParentGrid.GetPallet(typeof(SakuraBlue.Entities.Tiles.Forest).Assembly);

            map = new ParentGrid($"{AppDomain.CurrentDomain.BaseDirectory}\\Maps\\map1.bmp", pallet);

            //Player.SetPlayer(fromCharacterCreaton);

            PlayerInstanceManager.SetPlayer(map.AddAgent <Entities.Agent.Player>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Human> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "NotInstantiated", 3, 5));
            var hostileDjin = map.AddAgent <Entities.Agent.NPCBase>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Djin> .GetInstance(), Singleton <Entities.Agent.Class.WarriorClass> .GetInstance(), "Hostile Djin female", 8, 25);

            hostileDjin.AI        = new Entities.Agent.AI.HostileAI(hostileDjin);
            hostileDjin.IsHostile = true;
            hostileDjin.ArmStarterGear();
            hostileDjin.AddPartyMember(Gender.Male, Singleton <Entities.Agent.Race.Narugan> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "Narugan Mage");



            Singleton <Music> .GetInstance().Play(@"\Music\Good Night.mp3");

            keyInterface = new KeyInterface(
                new KeyHook(ConsoleKey.UpArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Up); if (desciription != null)
                                                        {
                                                            RedrawNext();
                                                        }
                            }),
                new KeyHook(ConsoleKey.DownArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Down); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.LeftArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Left); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.RightArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Right); if (desciription != null)
                                                           {
                                                               RedrawNext();
                                                           }
                            }),
                new KeyHook(ConsoleKey.Escape, () => {
                Program.currentState = Singleton <Menu.TopMenu> .GetInstance();
                Console.Clear();
                Program.currentState.RedrawNext();
            }));
        }
Exemplo n.º 4
0
        public void EnemyAdded()
        {
            testWorld testworld = new testWorld();

            PlayerInstanceManager.SetPlayer(testworld.AddAgent <Player>(Gender.Female, Singleton <Human> .GetInstance(), Singleton <MageClass> .GetInstance(), "NotInstantiated", 3, 5));
            Assert.IsTrue(testworld.Agents.Count == 1);

            var name  = "Hostile Djin female";
            var enemy = testworld.AddAgent <NPCBase>(Gender.Female, Singleton <Djin> .GetInstance(), Singleton <WarriorClass> .GetInstance(), name, 8, 25);

            enemy.AI        = new HostileAI(enemy);
            enemy.IsHostile = true;
            enemy.ArmStarterGear();
            enemy.AddPartyMember(Gender.Male, Singleton <Narugan> .GetInstance(), Singleton <MageClass> .GetInstance(), "Narugan Mage");


            Assert.IsTrue(testworld.Agents.Count == 2);
            Assert.IsTrue((testworld.Agents.FindLast(n => n.GetType() == typeof(NPCBase)) as NPCBase).Name == name);
        }
Exemplo n.º 5
0
 public NewGame(LockToken @lock) : base(@lock)
 {
     LockToken.Enforce <NewGame>(@lock);
     this.playerAsBase = this.AddAgent <Entities.Agent.Player>(Entities.Agent.Gender.Male, Singleton <Human> .GetInstance(), Singleton <WarriorClass> .GetInstance(), "John Doe", 3, 5);
     PlayerInstanceManager.SetPlayer(this.playerAsBase);
 }