Example #1
0
 public void SetUp()
 {
     spellsBook           = new SpellsBook();
     spellsBook.Spells[0] = new Spell();
     spellsBook.Spells[1] = new Spell();
     spellsBook.Spells[2] = new Spell();
 }
Example #2
0
        static void Main(string[] args)
        {
            Character character = new Archer("Test Archer");

            character.Attack = -100;
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell("Hechizo 1", 50, 10) };

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.Staff      = new Staff();
            gandalf.SpellsBook = book;

            Dwarf gimli = new Dwarf("Gimli");

            gimli.Axe    = new Axe(32);
            gimli.Helmet = new Helmet(12);
            gimli.Shield = new Shield(21);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.Attack}");

            gimli.ReceiveAttack(gandalf.Attack);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
        }
        public PlayedCharacter(Bot bot, CharacterBaseInformations informations)
        {
            InformationLevel = MessageLevel.All;// MessageLevel.Warning | MessageLevel.Error;

            if (informations == null)
            {
                throw new ArgumentNullException("informations");
            }

            Bot = bot;

            Id    = informations.id;
            Level = informations.level;
            Name  = informations.name;
            Breed = new Breeds.Breed(ObjectDataManager.Instance.Get <Breed>(informations.breed));
            Look  = informations.entityLook;
            Sex   = informations.sex;

            Inventory        = new Inventory(this);
            Stats            = new Stats.PlayerStats(this);
            SpellsBook       = new SpellsBook(this);
            SpellShortcuts   = new SpellShortcutBar(this);
            GeneralShortcuts = new GeneralShortcutBar(this);

            m_jobs           = new ObservableCollectionMT <Job>();
            m_readOnlyJobs   = new ReadOnlyObservableCollectionMT <Job>(m_jobs);
            m_emotes         = new ObservableCollectionMT <Emoticon>();
            m_readOnlyEmotes = new ReadOnlyObservableCollectionMT <Emoticon>(m_emotes);
        }
Example #4
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.AddSpell("Bola de fuego", 10, 0);
            book.AddSpell("Escudo de maná", 0, 20);

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.SpellsBook = book;
            gandalf.AddItem("Staff", 30, 20);

            Dwarf gimli = new Dwarf("Gimli");

            gimli.AddItem("Helmet", 0, 20);
            gimli.AddItem("Axe", 40, 0);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
        }
        static void Main(string[] args)
        {
            SpellsBook book   = new SpellsBook();
            WhirlWind  spell1 = new WhirlWind();
            FireBall   spell2 = new FireBall();

            book.AddSpell(spell1);
            book.AddSpell(spell2);

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.AddItem(new Staff());
            gandalf.AddItem(book);

            Dwarf gimli = new Dwarf("Gimli");

            gimli.AddItem(new Axe());
            gimli.AddItem(new Helmet());
            gimli.AddItem(new Shield());

            Console.WriteLine($"Gimli has {gimli.Health} HP points");
            Console.WriteLine($"Gandalf attacks Gimli with {gandalf.AttackValue} points.");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has {gimli.Health} HP");

            gimli.Cure();

            Console.WriteLine($"Gimli has {gimli.Health} HP");
        }
Example #6
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.Staff      = new Staff();
            gandalf.SpellsBook = book;

            Dwarf gimli = new Dwarf("Gimli");

            gimli.Axe    = new Axe();
            gimli.Helmet = new Helmet();
            gimli.Shield = new Shield();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");


            // gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
        }
Example #7
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.AddSpell(new SpellOne());
            book.AddSpell(new SpellOne());

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.AddItem(book);

            Dwarf gimli = new Dwarf("Gimli");

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Someone cured Gimli. Gimli now has ❤️ {gimli.Health}");

            DarkArcher darkArcher = new DarkArcher("Orc Commander");

            darkArcher.Pv = 5;
            DarkBow darkBow = new DarkBow();

            darkArcher.AddItem(darkBow);
            darkArcher.ReceiveAttack(gimli.AttackValue);
            gimli.MorePv(darkArcher.ChechHealth());
        }
        public void TestingChangeSpellsBook()
        {
            SpellsBook magicBook2 = new SpellsBook();

            this.testingWizard.SpellsBook = magicBook2;

            Assert.AreEqual(this.testingWizard.SpellsBook, magicBook2);
        }
 public void Setup()
 {
     // Arrange.
     this.merlin            = new Wizard("Merlin");
     this.wingardiumLeviosa = new Spell();
     this.deathNote         = new SpellsBook();
     this.grandpaStick      = new Staff();
 }
 public void Update(SpellListMessage msg)
 {
     if (msg == null)
     {
         throw new ArgumentNullException("msg");
     }
     SpellsBook.Update(msg);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="TargetId"></param>
 /// <param name="category"></param>
 /// <returns></returns>
 public IEnumerable <Spells.Spell> GetAvailableSpells(int?TargetId, Spells.Spell.SpellCategory category)
 {
     foreach (Spells.Spell spell in SpellsBook.GetAvailableSpells(TargetId, category))
     {
         if (spell.LevelTemplate.apCost <= Stats.CurrentAP)
         {
             yield return(spell);
         }
     }
 }
Example #12
0
        public void TestSpellBookValorDefense()
        {
            const int  expected = 70;
            SpellsBook test     = new SpellsBook();

            test.Spells = new Spell[] { new Spell() };


            Assert.AreEqual(expected, test.DefenseValue);
        }
Example #13
0
        public void Setup()
        {
            Spell[]    spells     = new Spell[] { new Spell() };
            SpellsBook spellsBook = new SpellsBook();

            spellsBook.Spells = spells;
            wizard.SpellsBook = spellsBook;
            Staff staff = new Staff();

            wizard.Staff = staff;
        }
        public void Setup()
        {
            wizard     = new Wizard("Gandalf");
            spellsBook = new SpellsBook();
            staff      = new Staff();
            spell      = new Spell();

            spellsBook.Spells = new Spell[] { spell };
            wizard.SpellsBook = spellsBook;
            wizard.Staff      = staff;
        }
        public void SpellBookAttackValue_No_Spells()
        {
            SpellsBook spellsBook = new SpellsBook();

            ISpells[] hechizos = new ISpells[] {};
            spellsBook.Spells = hechizos;
            int spellBookAttack = spellsBook.AttackValue;
            int expected        = 0;

            Assert.AreEqual(expected, spellBookAttack);
        }
        public void SpellBookDefenseValue_Whit_Two_Spells()
        {
            SpellsBook spellsBook = new SpellsBook();

            ISpells[] hechizos = new ISpells[] { new Spell(), new SpellTwo() };
            spellsBook.Spells = hechizos;
            int spellsBookDefense = spellsBook.DefenseValue;
            int expected          = 120;

            Assert.AreEqual(expected, spellsBookDefense);
        }
        public void SpellBookDefenseValue_ExpectedValue()
        {
            SpellsBook spellBook = new SpellsBook();

            ISpells[] hechizos = new ISpells[] { new Spell() };
            spellBook.Spells = hechizos;
            int spellBookDefense = spellBook.DefenseValue;
            int expected         = 70;

            Assert.AreEqual(expected, spellBookDefense);
        }
        public void SpellBookAttackValue_With_Two_Spells()
        {
            SpellsBook spellsBook = new SpellsBook();

            ISpells[] hechizos = new ISpells[] { new Spell(), new SpellTwo() };
            spellsBook.Spells = hechizos;
            int spellBookAttack = spellsBook.AttackValue;
            int expected        = 170;

            Assert.AreEqual(expected, spellBookAttack);
        }
Example #19
0
        public void SetUp()
        {
            spellsBook = new SpellsBook();
            staff      = new Staff();
            spell      = new Spell();

            dummy             = new Wizard("Dummy");
            dummy.SpellsBook  = spellsBook;
            dummy.Staff       = staff;
            spellsBook.Spells = new Spell[] { spell };
        }
        public void Setup()
        {
            this.testingWizard = new Wizard("Merlin");
            Staff Staff = new Staff();

            this.testingWizard.Staff = Staff;

            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell(), new Spell() };
            this.testingWizard.SpellsBook = book;
        }
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };

            Wizard     gandalf    = new Wizard("Gandalf");
            Staff      staff      = new Staff();
            SpellsBook spellsBook = book;

            gandalf.AddItem(spellsBook);
            gandalf.AddItem(staff);

            Dwarf  gimli  = new Dwarf("Gimli");
            Axe    axe    = new Axe();
            Helmet helmet = new Helmet();
            Shield shield = new Shield();

            gimli.AddItem(axe);
            gimli.AddItem(helmet);
            gimli.AddItem(shield);

            Archer legolas       = new Archer("Legolas");
            Bow    bow           = new Bow();
            Shield legolasShield = new Shield();
            Helmet legolasHelmet = new Helmet();

            legolas.AddItem(bow);
            legolas.AddItem(legolasShield);
            legolas.AddItem(legolasHelmet);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");

            gimli.ReceiveAttack(gandalf);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            legolas.RemoveItem(legolasHelmet);

            gandalf.ReceiveAttack(legolas);
            Console.WriteLine($"Legolas attacks Gandalf with ⚔️ {legolas.AttackValue}");

            Console.WriteLine($"Gandalf has ❤️ {gandalf.Health}");

            legolas.ReceiveAttack(gimli);
            Console.WriteLine($"Gimli attacks Legolas with ⚔️ {gimli.AttackValue}");
            Console.WriteLine($"Legolas has ❤️ {legolas.Health}");
        }
        public void TestWzardValorDefense()
        {
            int        expected = 170;
            SpellsBook book     = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };

            Wizard test = new Wizard("Gandalf");

            test.Staff      = new Staff();
            test.SpellsBook = book;

            Assert.AreEqual(expected, test.DefenseValue);
        }
Example #23
0
        public void Setup()
        {
            this.gandalf      = new Wizard("Gandalf");
            this.staff        = new Staff();
            this.spellsBook   = new SpellsBook();
            spellsBook.Spells = new Spell[] { new Spell() };
            gandalf.AddItem(staff);
            gandalf.AddItem(spellsBook);

            this.saruman             = new Wizard("Saruman");
            this.sarumanStaff        = new Staff();
            this.sarumanSpellsBook   = new SpellsBook();
            sarumanSpellsBook.Spells = new Spell[] { new Spell() };
        }
        public void Setup()
        {
            this.legolas = new Archer("Legolas");
            this.bow     = new Bow();
            this.helmet  = new Helmet();
            this.shield  = new Shield();
            legolas.AddItem(bow);
            legolas.AddItem(helmet);
            legolas.AddItem(shield);

            this.nurgargan = new Wizard("Nurgargan");
            Staff      staff = new Staff();
            SpellsBook book  = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };
            nurgargan.AddItem(staff);
            nurgargan.AddItem(book);
        }
Example #25
0
        public void Setup()
        {
            dwarf = new Dwarf("Nacho");
            dwarf.AddItem("Helmet", 0, 20);
            dwarf.AddItem("Shield", 0, 10);

            wizard = new Wizard("Jero");
            SpellsBook book = new SpellsBook();

            book.AddSpell("Bola de fuego", 10, 0);
            book.AddSpell("Escudo de maná", 0, 20);
            wizard.SpellsBook = book;

            knight = new Knight("Rodri");
            knight.AddItem("Sword", 10, 0);

            knight2 = new Knight("Rodrialter");
            knight2.AddItem("Sword", 50, 0);
        }
Example #26
0
        public void TestHealthWithBigAttack()
        {
            // Arrange.
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };
            Wizard merlin = new Wizard("Merlin");

            merlin.Staff      = new Staff();
            merlin.SpellsBook = book;

            knightProof.Shield = shield;
            knightProof.Armor  = armor;

            // Act.
            knightProof.ReceiveAttack(merlin.AttackValue);

            // Assert.
            Assert.Less(knightProof.Health, 100);
        }
Example #27
0
        public void TestHealthWithBigAttack()
        {
            // Arrange.
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };
            Wizard gandalf = new Wizard("Gandalf");

            gandalf.Staff      = new Staff();
            gandalf.SpellsBook = book;

            dwarfProof.Shield = shield;
            dwarfProof.Helmet = helmet;

            // Act.
            dwarfProof.ReceiveAttack(gandalf.AttackValue);

            // Assert.
            Assert.Less(dwarfProof.Health, 100);
        }
        public void Setup()
        {
            Armor armor = new Armor();
            DefaultDefenseItem defaultDefenseItem = new DefaultDefenseItem();
            Helmet             helmet             = new Helmet();
            Shield             shield             = new Shield();

            //attackItems
            Axe               axe               = new Axe();
            Bow               bow               = new Bow();
            DarkSword         darkSword         = new DarkSword();
            Sword             sword             = new Sword();
            DefaultAttackItem defaultAttackItem = new DefaultAttackItem();

            //healthItems
            Bandage bandage = new Bandage();
            CureBox cureBox = new CureBox();
            Poison  poison  = new Poison();

            //magicItems
            DefaultMagicItem defaultMagicItem = new DefaultMagicItem();
            Excalibur        excalibur        = new Excalibur();
            SpellsBook       spellsBook       = new SpellsBook();
            Spell            spell1           = new Spell();
            Spell            spell2           = new Spell();

            Staff staff = new Staff();


            //heroes
            Dwarf  dwarf  = new Dwarf("Enano", axe, helmet, shield);
            Elf    elf    = new Elf("Elfo", bow, armor, helmet);
            Knight knight = new Knight("Caballero", sword, armor, shield);
            Wizard wizard = new Wizard("Gandalf", staff, shield, armor, spellsBook);

            //villanos
            DarkWizard darkWizard = new DarkWizard("Saruman", staff, armor, spellsBook);
            Demonio    demonio    = new Demonio("Lanthos", sword, armor);
            Dragon     dragon     = new Dragon("Shiva", bow, armor);
            Orco       orco       = new Orco("Ugly", axe, helmet);
        }
        public PlayedCharacter(Bot bot, CharacterBaseInformations informations)
        {
            if (informations == null)
            {
                throw new ArgumentNullException("informations");
            }

            Bot = bot;

            Id    = informations.id;
            Level = informations.level;
            Name  = informations.name;
            Breed = DataProvider.Instance.Get <Breed>(informations.breed);
            Look  = informations.entityLook;
            Sex   = informations.sex;

            Inventory  = new Inventory(this);
            Stats      = new Stats.PlayerStats(this);
            SpellsBook = new SpellsBook(this);
            Shortcuts  = new ShortcutBar(this);
            Jobs       = new List <Job>();
            Emotes     = new List <Emoticon>();
        }
Example #30
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.Spells = new Spell[] { new Spell() };

            Wizard gandalf    = new Wizard("Gandalf");
            IItem  magicStaff = new Staff();

            gandalf.SpellsBook = book;
            Dwarf gimli = new Dwarf("Gimli");

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.Attack}");

            gimli.ReceiveAttack(gandalf.Attack);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
        }