コード例 #1
0
        static void Main(string[] args)
        {
            //Create Object
            Vampire vampire = new Vampire();

            vampire.HitPoint = 15;
            Human human = new Human();

            human.HitPoint = 60;
            Undead undead = new Undead();

            undead.HitPoint = 80;

            //create list
            List <Creature> creatures = new List <Creature>();

            //add object into list
            creatures.Add(vampire);
            creatures.Add(human);
            creatures.Add(undead);


            //if hitpoint less then or equal to 15, able to used special ability
            UseSpecialAbilities(creatures, item => item.HitPoint <= 15);

            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Character character = new Human(0, "Jack", 100, 100);

            character.CastSpell();
            character.SetSpell(new FireSpell(30, 100, 20));
            character.CastSpell();
            character.SetSpell(new IceSpell(30, 50, 20));
            character.CastSpell();
            character.SetSpell(new CurseSpell(40, 60, 20));
            character.CastSpell();

            character = new Orc(1, "Gary", 100, 100);
            character.CastSpell();
            character.SetSpell(new FireSpell(30, 100, 20));
            character.CastSpell();
            character.SetSpell(new IceSpell(30, 50, 20));
            character.CastSpell();
            character.SetSpell(new CurseSpell(40, 60, 20));
            character.CastSpell();

            character = new Vampire(2, "Prince", 100, 100);
            character.CastSpell();
            character.SetSpell(new FireSpell(30, 100, 20));
            character.CastSpell();
            character.SetSpell(new IceSpell(30, 50, 20));
            character.CastSpell();
            character.SetSpell(new CurseSpell(40, 60, 20));
            character.CastSpell();

            Console.ReadLine();
        }
コード例 #3
0
    void Start()
    {
        Zombie  z = new Zombie();
        Vampire v = new Vampire();

        z.hitPoints = 10;
        v.hitPoints = 10;
        Debug.Log(z.TakeDamage(5));
        Debug.Log(v.TakeDamage(5));

        //int number = (int)mState;
        //Debug.Log(number);
        Vector3 pos = new Vector3();

        pos.x = Random.Range(-10f, 10f);
        pos.z = Random.Range(-10f, 10f);
        transform.position = pos;
        GameObject[] AllGameObjects = GameObject.FindObjectsOfType(typeof(GameObject)) as GameObject[];
        foreach (GameObject aGameObject in AllGameObjects)
        {
            Component aComponent = aGameObject.GetComponent(typeof(Player));
            if (aComponent != null)
            {
                playerObject = aGameObject;
            }
        }
    }
コード例 #4
0
 public void CanMakeTheCount()
 {
     Vampire dracula = new Vampire("Vlad");
     Assert.Equal("Blood", dracula.Sustenance());
     Assert.True(dracula.Base == "Human");
     Assert.False(dracula.Exists);
 }
コード例 #5
0
ファイル: MakerFactory.cs プロジェクト: dec-k/IN710-keigdl1
        public ModelMaker createModelMaker(string selected)
        {
            //Model skeleton
            ModelMaker mm = null;

            //Determine which creature to make
            switch (selected)
            {
                case "Fairy":
                    mm = new Fairy();
                    break;
                case "Frankenstein":
                    mm = new Frankenstein();
                    break;
                case "Werewolf":
                    mm = new Werewolf();
                    break;
                case "Vampire":
                    mm = new Vampire();
                    break;
                case "Witch":
                    mm = new Witch();
                    break;
                case "Skeleton":
                    mm = new Skeleton();
                    break;
            }

            return mm;
        }
コード例 #6
0
ファイル: Genus.cs プロジェクト: Bedengus/ULF
        public void Mensura(string genus, Persona Ego)
        {
            Console.WriteLine("Type 'roll' to randomize proportions; input anything else to use your race's standard measures.");

            genus = genus.ToLower();
            switch (genus)
            {
            case "human":
                Human.Mensura(Ego);
                break;

            case "orc":
                Orc.Mensura(Ego);
                break;

            case "vampire":
                Vampire.Mensura(Ego);
                break;

            case "dwarf":
                Dwarf.Mensura(Ego);
                break;

            case "elf":
                Elf.Mensura(Ego);
                break;

            case "werewolf":
                Werewolf.Mensura(Ego);
                break;

            default:
                break;
            }
            Ego.Caput[0]     = Math.Round((Ego.Altitudo / 8) * 1, 2);
            Ego.Caput[1]     = Math.Round(Ego.Caput[0] * 0.5, 2);
            Ego.Caput[2]     = Math.Round(Ego.Caput[0] * Ego.Caput[1], 2);
            Ego.Ocullus[0]   = Math.Round((Ego.Caput[1] / 4) * 0.5, 2);
            Ego.Ocullus[1]   = Math.Round(Ego.Ocullus[0] * 2, 2);
            Ego.Ocullus[2]   = Math.Round(Ego.Ocullus[0] * Ego.Ocullus[1], 2);
            Ego.Collum[0]    = Math.Round((Ego.Altitudo / 16) * 1, 2);
            Ego.Collum[1]    = Math.Round(Ego.Collum[0] * 1, 2);
            Ego.Collum[2]    = Math.Round(Ego.Collum[0] * Ego.Collum[1], 2);
            Ego.Cor[0]       = Math.Round((Ego.Altitudo / 16) * 1, 2);
            Ego.Cor[1]       = Math.Round(Ego.Cor[0] * 1, 2);
            Ego.Cor[2]       = Math.Round(Ego.Cor[0] * Ego.Cor[1], 2);
            Ego.Tergum[0]    = Math.Round((Ego.Altitudo / 8) * 3.5, 2);
            Ego.Tergum[1]    = Math.Round(Ego.Tergum[0] * 0.1, 2);
            Ego.Tergum[2]    = Math.Round(Ego.Tergum[0] * Ego.Tergum[1], 2);
            Ego.Bracchium[0] = Math.Round((Ego.Altitudo / 8) * 3.5, 2);
            Ego.Bracchium[1] = Math.Round(Ego.Bracchium[0] * 0.1, 2);
            Ego.Bracchium[2] = Math.Round(Ego.Bracchium[0] * Ego.Bracchium[1], 2);
            Ego.Stomachus[0] = Math.Round((Ego.Altitudo / 8) * 1, 2);
            Ego.Stomachus[1] = Math.Round(Ego.Stomachus[0] * 2, 2);
            Ego.Stomachus[2] = Math.Round(Ego.Stomachus[0] * Ego.Stomachus[1], 2);
            Ego.Crus[0]      = Math.Round((Ego.Altitudo / 2) * 1, 2);
            Ego.Crus[1]      = Math.Round(Ego.Crus[0] * 0.1, 2);
            Ego.Crus[2]      = Math.Round(Ego.Crus[0] * Ego.Crus[1], 2);
        }
コード例 #7
0
        public IActionResult OneVampire(int VampireId)
        {
            Vampire ToDisplay = _context.Vampires
                                .Include(v => v.Victims)
                                .FirstOrDefault(v => v.VampireId == VampireId);

            return(View("OneVampire", ToDisplay));
        }
コード例 #8
0
ファイル: UnitTest1.cs プロジェクト: jaatay/Lab05-Zoo
        public void IsDerivedFromClassAbove()
        {
            //arrange
            Vampire LeStat = new Vampire();

            //act

            //assert
            Assert.Equal(5, LeStat.LestatFactor);
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: IrenaBu/PredavanjaNET
        static void Main(string[] args)
        {
            Enemy[] enemies = new Enemy[2];
            enemies[0] = new Vampire("Vamp", 1, 1, 0);
            enemies[1] = new Programming("c#", 2, 3, "c#");

            for (int i = 0; i < enemies.Length; i++)
            {
                Console.WriteLine(enemies[i]);
            }
        }
コード例 #10
0
 public IActionResult SubmitVampire(Vampire FromForm)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("NewVampire"));
     }
     else
     {
         return(NewVampire());
     }
 }
コード例 #11
0
        private void Start()
        {
            if (!testingEnabled)
            {
                return;
            }

            var spriteStore = FindObjectOfType <SpriteStore>();

            spriteStore.Setup();

            var itemStore = FindObjectOfType <ItemStore>();

            itemStore.Setup();

            var travelManager = FindObjectOfType <TravelManager>();

            travelManager.NewParty();

            travelManager.CurrentBiome = testingBiome;

            var numBandits = Random.Range(MinBandits, MaxBandits + 1);

            var bandits = new List <Entity>();

            for (var i = 0; i < 1; i++)
            {
                Entity bandit = new Spider();

                bandits.Add(bandit);

                bandit = new Titan();

                bandits.Add(bandit);

                bandit = new Treant();

                bandits.Add(bandit);

                bandit = new Vampire();

                bandits.Add(bandit);

                bandit = new Zombie();

                bandits.Add(bandit);
            }

            var combatManager = FindObjectOfType <CombatManager>();

            combatManager.Enemies = bandits;

            combatManager.LoadCombatScene();
        }
コード例 #12
0
    void Start()
    {
        Zombie  Z = new Zombie();
        Vampire V = new Vampire();

        //Z.HitPoints = 10;
        //V.HitPoints = 10;    don't need these defined because they are initialized in the Monster constructor.
        Debug.Log(Z.TakeDamage(5));
        Debug.Log(V.TakeDamage(5));
        Debug.Log(Z.ToString());
        Debug.Log(V.ToString());
    }
コード例 #13
0
        public IActionResult CreateVampire(Vampire FromForm)
        {
            // Adding a new vampire to the database
            // Vampire Dracula = new Vampire()
            // {
            //     Name = "Dracula",
            //     Birthday = new DateTime(1431, 6, 6),
            //     Victims = 234
            // };

            _context.Add(FromForm);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #14
0
        public static Vampire GetEnemyObject(bool isPsychic, bool isHybrid)
        {
            var enemy = new Vampire()
            {
                Name      = "Vampire",
                Damage    = 7,
                Armour    = 2,
                HitPoints = 10,
                Hybrid    = isHybrid,
                Psychic   = isPsychic,
                Alive     = true
            };

            return(enemy);
        }
コード例 #15
0
        public IActionResult DeleteVampire(int VampireId)
        {
            // logic to determine if we should actually delete

            Vampire ToDelete = _context.Vampires.FirstOrDefault(v => v.VampireId == VampireId);

            if (ToDelete == null)
            {
                return(RedirectToAction("Index"));
            }

            _context.Remove(ToDelete);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #16
0
 void InitializeMonster(MonsterType m)
 {
     if (m == MonsterType.Empty)
     {
         return;
     }
     if (m == MonsterType.Slime)
     {
         Slime temp = new Slime();
         temp.Start();
         temp.Setmtype(MonsterType.Slime);
         Monster tempMonster = temp;
         magic.addMonster(tempMonster);
     }
     if (m == MonsterType.DoubleSwordMan)
     {
         DoubleSwordMan temp = new DoubleSwordMan();
         temp.Start();
         temp.Setmtype(MonsterType.DoubleSwordMan);
         Monster tempMonster = temp;
         magic.addMonster(tempMonster);
     }
     if (m == MonsterType.BigSpider)
     {
         BigSpider temp = new BigSpider();
         temp.Start();
         temp.Setmtype(MonsterType.BigSpider);
         Monster tempMonster = temp;
         magic.addMonster(tempMonster);
     }
     if (m == MonsterType.Vampire)
     {
         Vampire temp = new Vampire();
         temp.Start();
         temp.Setmtype(MonsterType.Vampire);
         Monster tempMonster = temp;
         magic.addMonster(tempMonster);
     }
     if (m == MonsterType.Boss_TurnMan)
     {
         Boss_TurnMan temp = new Boss_TurnMan();
         temp.Start();
         temp.Setmtype(MonsterType.Boss_TurnMan);
         Monster tempMonster = temp;
         magic.addMonster(tempMonster);
     }
 }
コード例 #17
0
        public IActionResult UpdateVampire(int VampireId, Vampire FromForm)
        {
            if (_context.Vampires.Any(v => v.VampireId == VampireId))
            {
                return(RedirectToAction("Index"));
            }
            // Retrieved.Name = FromForm.Name;
            // Retrieved.Birthday = FromForm.Birthday;
            // Retrieved.Victims = FromForm.Victims;
            // Retrieved.UpdatedAt = FromForm.UpdatedAt;

            // _context.SaveChanges();

            FromForm.VampireId = VampireId;
            _context.Update(FromForm);
            _context.Entry(FromForm).Property("CreatedAt").IsModified = false;
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #18
0
ファイル: Genus.cs プロジェクト: Bedengus/ULF
        public void Linea(string genus, Persona Ego)
        {
            genus = genus.ToLower();
            switch (genus)
            {
            case "human":
                typus = "Human";
                Human.Apto(Ego);
                break;

            case "orc":
                typus = "Orc";
                Orc.Apto(Ego);
                break;

            case "vampire":
                typus = "Vampire";
                Vampire.Apto(Ego);
                break;

            case "dwarf":
                typus = "Dwarf";
                Dwarf.Apto(Ego);
                break;

            case "elf":
                typus = "Elf";
                Elf.Apto(Ego);
                break;

            case "werewolf":
                typus = "Werewolf";
                Werewolf.Apto(Ego);
                break;

            default:
                Console.WriteLine("Currently extinct.");
                Σ.rector = "ex";
                break;
            }
            Cisterna(typus, Ego);
        }
コード例 #19
0
ファイル: Program.cs プロジェクト: mtncrawler/Zoo
        public static void Main(string[] args)
        {
            Console.WriteLine("Welcome to my World!");

            Vampire vampie = new Vampire {
                Name = "Drake", NumberOfBeatingHearts = 0
            };

            Console.WriteLine($"Vampire: {vampie.MyMotto()}");
            Console.WriteLine($"Vampire: {vampie.GoalInLife()}");
            Console.WriteLine();

            Mermaid merm = new Mermaid()
            {
                NumberOfGills = 4
            };

            Console.WriteLine($"Mermaid: Number of children = {merm.WhatAboutChildren()}");
            Console.WriteLine($"Mermaid: {merm.MyUniqueness()}");
            Console.WriteLine();

            Unicorn uni = new Unicorn();

            Console.WriteLine($"Unicorn: {uni.MagicalPower()}");
            Console.WriteLine($"Unicorn: I have {uni.HowManySpouses()} spouses.");
            Console.WriteLine($"Unicorn by interface: {uni.FlightCapability()}");
            Console.WriteLine($"Unicorn by interface: {uni.BirthPlace()}");
            Console.WriteLine();

            Centaur centie = new Centaur();

            Console.WriteLine($"Centaur: {centie.MagicalPower()}");
            Console.WriteLine($"Centaur by interface: {centie.BirthPlace()}");
            Console.WriteLine();

            Pegasus pegie = new Pegasus();

            Console.WriteLine($"Pegasus: {pegie.MagicalPower()}");
            Console.WriteLine($"Pegasus by interface: {pegie.FlightCapability()}");
            Console.WriteLine($"Pegasus by interface: {pegie.BirthPlace()}");
        }
コード例 #20
0
        static void Main(string[] args)
        {
            Werewolf newPlayer   = new Werewolf("Bozo");
            Vampire  otherPlayer = new Vampire();
            Werewolf wolfie      = new Werewolf("Wolfie");
            Skeleton skelz       = new Skeleton("Skelly");

            wolfie.Attack(skelz, 5);
            skelz.Attack(wolfie, 500);

            Barracks homeBase = new Barracks();

            homeBase.AddRecruit(newPlayer);
            homeBase.AddRecruit(otherPlayer);
            homeBase.AddRecruit(wolfie);
            homeBase.AddRecruit(skelz);

            skelz.Attack(homeBase, 3);


            homeBase.Rally();
        }
コード例 #21
0
        public static Vampire CreateVampire(object userInput, Player player)
        {
            Vampire selectedEnemyType = (Vampire)userInput;
            var     state             = selectedEnemyType.Psychic ? VampireType.Psychic.ToString() : VampireType.Hybrid.ToString(); // ToDo: this can be replaced by the enum instead of using strings

            UserDialogue.SelectedEnemy(state, selectedEnemyType.Name);

            if (selectedEnemyType.Psychic)
            {
                selectedEnemyType.Damage += 3;

                UserDialogue.DamageIncrease(selectedEnemyType.Damage);
            }
            else if (selectedEnemyType.Hybrid)
            {
                selectedEnemyType.Armour += 3;
                UserDialogue.ArmorIncrease(selectedEnemyType.Armour);
            }

            UserDialogue.ShowEnemyStats(selectedEnemyType.Damage, selectedEnemyType.Armour, selectedEnemyType.HitPoints);
            return(selectedEnemyType);
        }
コード例 #22
0
ファイル: Genus.cs プロジェクト: Bedengus/ULF
        /*public void NovaMensura(string genus){
         *                          switch(genus){
         *                                  case "human":
         *                                          Human.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  case "orc":
         *                                          Orc.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  case "vampire":
         *                                          Vampire.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  case "dwarf":
         *                                          Dwarf.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  case "elf":
         *                                          Elf.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  case "werewolf":
         *                                          Werewolf.NovaMensura(Ego.CorpusAptus);
         *                                          break;
         *                                  default:
         *                                          break;
         *                  }
         *          }*/

        public void Auto(string genus, string nomen)
        {
            genus = genus.ToLower();
            switch (genus)
            {
            case "human":
                Human.Auto(nomen);
                break;

            case "orc":
                Orc.Auto(nomen);
                break;

            case "vampire":
                Vampire.Auto(nomen);
                break;

            case "dwarf":
                Dwarf.Auto(nomen);
                break;

            case "elf":
                Elf.Auto(nomen);
                break;

            case "werewolf":
                Werewolf.Auto(nomen);
                break;

            case "quadrupod":
                Quadrupod.Auto(nomen);
                break;

            default:
                Human.Auto(nomen);
                break;
            }
        }
コード例 #23
0
        public static void Main()
        {
            Hunter VonRimmersmark = new Hunter("Erich", "Von Rimmersmark");

            Demon demon = new Demon(); // D is the type d is the object

            VonRimmersmark.Ignite(demon);
            VonRimmersmark.SplashWater(demon);
            VonRimmersmark.WieldSilver(demon);

            Ghast ghast = new Ghast(); // G is the type g is the object

            VonRimmersmark.Ignite(ghast);
            VonRimmersmark.SplashWater(ghast);

            Ghoul ghoul = new Ghoul(); // G is the type g is the object

            VonRimmersmark.SplashWater(ghoul);
            VonRimmersmark.WieldSilver(ghoul);

            Mummy mummy = new Mummy(); // M is the type m is the object

            VonRimmersmark.Ignite(mummy);

            Vampire vampire = new Vampire(); // V is the type v is the object

            VonRimmersmark.Ignite(vampire);
            VonRimmersmark.WieldSilver(vampire);

            Wight wight = new Wight(); // W is the type w is the object

            VonRimmersmark.WieldSilver(wight);

            Zombie zombie = new Zombie(); // Z is the type z is the object

            VonRimmersmark.Ignite(zombie);
        }
コード例 #24
0
ファイル: Genus.cs プロジェクト: Bedengus/ULF
        public void Cisterna(string genus, Persona Ego)
        {
            Console.WriteLine("\nYour life points, HP as hit points or PV as points de vie, and mana points, MP, are determinated by your race and statuses.");
            Console.WriteLine("Type 'roll' to see the rolls one by one or anything else to skip.");

            genus = genus.ToLower();
            switch (genus)
            {
            case "human":
                Human.Cisterna(Ego);
                break;

            case "orc":
                Orc.Cisterna(Ego);
                break;

            case "vampire":
                Vampire.Cisterna(Ego);
                break;

            case "dwarf":
                Dwarf.Cisterna(Ego);
                break;

            case "elf":
                Elf.Cisterna(Ego);
                break;

            case "werewolf":
                Werewolf.Cisterna(Ego);
                break;

            default:
                break;
            }
            Mensura(typus, Ego);
        }
コード例 #25
0
    public void SpawnPlayer(Vector3 pos)
    {
        playerVampire = new Vampire(2f, pos);

        //Based on hierarchy

        GameObject v_go = new GameObject();

        v_go.name = "Player";         //FIXME
        v_go.transform.position = playerVampire.Position;

        v_go.transform.SetParent(this.transform, true);

        SpriteRenderer v_go_sr = v_go.AddComponent <SpriteRenderer> ();

        v_go_sr.sprite           = Resources.LoadAll <Sprite>("Sprites/spriteSheet1")[20];//FIXME
        v_go_sr.sortingLayerName = "Creatures";

        v_go_sr.material = Resources.Load <Material> ("Materials/Lit2DMat");

        playerVampire.AssignMoveCallback((vampire) => { ChangeVampirePosition(vampire, v_go); });

        GetComponent <CameraControllerVampireMode> ().Begin(this.playerVampire);
    }
コード例 #26
0
        static void Main(string[] args)
        {
            Console.Title = ("=-=-DUNGEON OF DOOM!-=-=");
            Console.WriteLine("Welcome to your journey!");

            //TODO 1. Create a variable that will keep track of player score
            int score = 0;

            //TODO 2. Create the Weapon
            Weapon w1 = new Weapon(1, 15, "Abyssal Whip", 5, false);
            Weapon w2 = new Weapon(1, 6, "Rusted Knife", 3, false);
            Weapon w3 = new Weapon(1, 12, "Long Sword", 7, true);
            Weapon w4 = new Weapon(1, 10, "Combat Knife", 10, false);
            Weapon w5 = new Weapon(1, 15, "Sword", 7, false);
            Weapon w6 = new Weapon(1, 30, "Dragon Breath", 20, false);

            //Put created weapons into an array
            Weapon[] weaponList = { w1, w2, w3, w4, w5 };
            //randomly select weapon
            Random randWeapon = new Random();
            int    weapon     = randWeapon.Next(weaponList.Length);
            Weapon mainWeapon = weaponList[weapon];

            //TODO 3. Create players

            Player viking    = new Player("Viking", 70, 10, 100, 100, Race.Viking, mainWeapon);
            Player chief     = new Player("Chief", 90, 20, 120, 120, Race.Fallen, w5);
            Player deathWing = new Player("Deathwing", 95, 50, 200, 200, Race.Dragon, w6);
            Player elf       = new Player("Elf", 60, 10, 100, 100, Race.Elf, w6);
            Player caveMan   = new Player("Caveman", 40, 50, 300, 300, Race.Caveman, w2);
            Player orc       = new Player("Orc", 80, 20, 150, 150, Race.Orc, w3);
            Player gnome     = new Player("A cute Gnome", 100, 10, 50, 50, Race.Gnome, w2);
            Player native    = new Player("Native", 70, 20, 100, 100, Race.Native, w5);
            Player goblin    = new Player("Goblin", 75, 15, 80, 80, Race.Goblin, w1);



            //TODO 4. Create the outer dowhile loop that manages game
            Console.WriteLine("\nSelect your player\n" +
                              "1) Viking\n" +
                              "2) Chief\n" +
                              "3) Deathwing\n" +
                              "4) Elf\n" +
                              "5) Caveman\n" +
                              "6) Orc\n" +
                              "7) Gnome\n" +
                              "8) Native\n" +
                              "9) Goblin\n");


            ConsoleKey userPlayer = Console.ReadKey(true).Key;

            Console.Clear();
            Player selectedPlayer = viking;

            switch (userPlayer)
            {
            case ConsoleKey.D1:
                selectedPlayer = viking;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D2:
                selectedPlayer = chief;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D3:
                selectedPlayer = deathWing;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D4:
                selectedPlayer = elf;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D5:
                selectedPlayer = caveMan;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D6:
                selectedPlayer = orc;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D7:
                selectedPlayer = gnome;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D8:
                selectedPlayer = native;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            case ConsoleKey.D9:
                selectedPlayer = goblin;
                Console.WriteLine($"You have selected {selectedPlayer}!");
                break;

            default:
                Console.WriteLine("Please select a valid option!");
                break;
            }

            //counter
            bool exit = false;

            do
            {
                //TODO 5. Write a method for getting room description
                Console.WriteLine(GetRoom());
                //TODO 6. Create monsters for the player to compete against
                //create monsters here
                Rabbit  r1 = new Rabbit("Baby Rabbit", 12, 12, 50, 20, 2, 6, "That's no ordinary rabbit", true);
                Rabbit  r2 = new Rabbit();
                Vampire v1 = new Vampire("The Count", 25, 25, 40, 30, 2, 12, "One Vampire");
                Gorilla g1 = new Gorilla();
                Gorilla g2 = new Gorilla("Demonic Gorilla", 60, 60, 45, 15, 4, 13, "Uh oh, That's a big gorilla", true);
                //store monsters in collection
                Monster[] monsters = { r1, r2, v1, g1, g2 };
                //randomly generate the monster to compete against
                Random  rand    = new Random();
                int     randNbr = rand.Next(monsters.Length);
                Monster monster = monsters[randNbr];
                //show the monster in the room
                Console.WriteLine("\nIn this room: " + monster.Name);
                //TODO 7. Create a loop for the game menu

                bool reload = false;
                do
                {
                    //TODO 8. Create the menu for interaction with the monster and write it to the screen
                    #region Menu
                    Console.WriteLine("\nChoose an action:\n" +
                                      "1) Attack\n" +
                                      "2) Run\n" +
                                      "3) Player Information\n" +
                                      "4) Monster Information\n" +
                                      "5) Exit Application");
                    #endregion
                    //TODO 8a. Wait and Capture the user input for their selection in the menu
                    ConsoleKey userChoice = Console.ReadKey(true).Key;
                    //TODO 8b. Create a switch that houses the functionality based on user choice
                    Console.Clear();
                    switch (userChoice)
                    {
                    case ConsoleKey.D1:
                        Console.WriteLine("Attack!");
                        Combat.DoBattle(selectedPlayer, monster);
                        if (monster.Life <= 0)
                        {
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("\nYou killed {0}!\n", monster.Name);
                            Console.ResetColor();
                            reload = true;
                            score++;
                        }     //end if
                        break;

                    case ConsoleKey.D2:
                        Console.WriteLine("Runnnnnn!!");
                        Console.WriteLine($"{monster.Name} attacks you as you run!");
                        Combat.DoAtk(monster, selectedPlayer);
                        Console.WriteLine();
                        reload = true;
                        break;

                    case ConsoleKey.D3:
                        Console.WriteLine("Player Information: ");
                        Console.WriteLine(selectedPlayer);
                        Console.WriteLine("Monsters Defeated: " + score);
                        break;

                    case ConsoleKey.D4:
                        Console.WriteLine("Monster Information: ");
                        Console.WriteLine(monster);
                        break;

                    case ConsoleKey.D5:
                        Console.WriteLine("Disgraceful...");
                        exit = true;
                        break;

                    default:
                        Console.WriteLine("You have chosen an improper action...");
                        break;
                    }
                    if (selectedPlayer.Life <= 0)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("You are dead!\a");
                        Console.ResetColor();
                        exit = true;
                    }
                } while (!exit && !reload);
            } while (!exit);
            Console.WriteLine($"Game over!\n" +
                              $"You have defeated {score} monsters!");
            //TODO 9. If the player has died, we are going to give them a message here about how many monsters they have defeated
        } //end main
 void MoveCameraToTarget(Vampire /*FIXME*/ target)
 {
     Camera.main.transform.position = target.Position + offset;
 }
 //Must execute after VampireController
 public void Begin(Vampire target)
 {
     this.target = target;
     offset      = new Vector3(0.5f, 0.5f, -10f);
     target.AssignMoveCallback((vampire) => { MoveCameraToTarget(vampire); });
 }
コード例 #29
0
        public EditVampire(MainWindow parent, int whichVampire)
        {
            vampire = new Vampire();

            InitializeComponent();

            clanBox.ItemsSource  = Enum.GetValues(typeof(Clan));
            covenBox.ItemsSource = Enum.GetValues(typeof(Coven));

            this.whichVampire = whichVampire;
            this.parent       = parent;

            if (whichVampire < 0)
            {
                vampire = new Vampire();
            }
            else
            {
                vampire             = (Vampire)parent.City.Characters[whichVampire];
                vampireWindow.Title = vampire.Name;
            }

            nameField.Text = vampire.Name;
            nameField.Focus();
            nameField.SelectAll();

            maskField.Text        = vampire.Mask;
            clanBox.SelectedIndex = (int)vampire.Clan;
            potencyDots.Value     = vampire.Potency.Dots;

            playerField.Text       = vampire.Player;
            dirgeField.Text        = vampire.Dirge;
            covenBox.SelectedIndex = (int)vampire.Covenant;
            humanityDots.Value     = vampire.Humanity.Dots;

            conceptField.Text   = vampire.Concept;
            biographyField.Text = vampire.Biography;

            intelligenceDots.Value = vampire.Attributes[(int)Intelligence].Dots;
            witsDots.Value         = vampire.Attributes[(int)Wits].Dots;
            resolveDots.Value      = vampire.Attributes[(int)Resolve].Dots;

            strengthDots.Value  = vampire.Attributes[(int)Strength].Dots;
            dexterityDots.Value = vampire.Attributes[(int)Dexterity].Dots;
            staminaDots.Value   = vampire.Attributes[(int)Stamina].Dots;

            presenceDots.Value     = vampire.Attributes[(int)Presence].Dots;
            manipulationDots.Value = vampire.Attributes[(int)Manipulation].Dots;
            composureDots.Value    = vampire.Attributes[(int)Composure].Dots;

            academicsDots.Value     = vampire.Skills[(int)Academics].Dots;
            computerDots.Value      = vampire.Skills[(int)Computer].Dots;
            craftsDots.Value        = vampire.Skills[(int)Crafts].Dots;
            investigationDots.Value = vampire.Skills[(int)Investigation].Dots;
            medicineDots.Value      = vampire.Skills[(int)Medicine].Dots;
            occultDots.Value        = vampire.Skills[(int)Occult].Dots;
            politicsDots.Value      = vampire.Skills[(int)Politics].Dots;
            scienceDots.Value       = vampire.Skills[(int)Science].Dots;

            athleticsDots.Value = vampire.Skills[(int)Athletics].Dots;
            brawlDots.Value     = vampire.Skills[(int)Brawl].Dots;
            driveDots.Value     = vampire.Skills[(int)Drive].Dots;
            firearmsDots.Value  = vampire.Skills[(int)Firearms].Dots;
            larcenyDots.Value   = vampire.Skills[(int)Larceny].Dots;
            stealthDots.Value   = vampire.Skills[(int)Stealth].Dots;
            survivalDots.Value  = vampire.Skills[(int)Survival].Dots;
            weaponryDots.Value  = vampire.Skills[(int)Weaponry].Dots;

            animalKenDots.Value    = vampire.Skills[(int)AnimalKen].Dots;
            empathyDots.Value      = vampire.Skills[(int)Empathy].Dots;
            expressionDots.Value   = vampire.Skills[(int)Expression].Dots;
            intimidationDots.Value = vampire.Skills[(int)Intimidation].Dots;
            persuasionDots.Value   = vampire.Skills[(int)Persuasion].Dots;
            socializeDots.Value    = vampire.Skills[(int)Socialize].Dots;
            streetwiseDots.Value   = vampire.Skills[(int)Streetwise].Dots;
            subterfugeDots.Value   = vampire.Skills[(int)Subterfuge].Dots;
        }
コード例 #30
0
 public override void Paint(Level level)
 {
     base.Paint(level);
     Vampire.Place(GetTileCenter() * 16 + new Vector2(8), level.Area);
 }
コード例 #31
0
 /// <summary>
 /// Player gets hit
 /// </summary>
 /// <param name="vampire">The attacker</param>
 internal void GetHit(Vampire vampire)
 {
     //Subtract the health
     Health -= vampire.GetDamage();
 }
コード例 #32
0
 public void setVTalker(Vampire vamp)
 {
     VTalker = vamp;
 }
コード例 #33
0
ファイル: Bite.cs プロジェクト: porglezomp/LD33
 void Start()
 {
     vampire = GetComponent<Vampire>();
 }
コード例 #34
0
 void Awake()
 {
     _vampireAnimator = GetComponent<VampireAnimator>();
     _vampire = GetComponent<Vampire>();
 }