Exemplo n.º 1
0
        public void AttackGenerateRange()
        {
            var a = new Attack(10, 100);

            for (int i = 0; i < 20; i++)
            {
                int dmg = a.GenerateDamage();
                Assert.IsTrue(dmg <= 100 && dmg >= 10);
            }
        }
Exemplo n.º 2
0
        public override void RecieveAttack(Attack incoming)
        {
            Health -= (int) (incoming.GenerateDamage()*(1 - Stats.DamageReduction));

            if (Health <= (Stats.BaseHealth/2))
                Strategy = new MonsterIrritatedStrategy();

            if (Health <= (Stats.BaseHealth/3))
                Strategy = new MonsterMadStrategy();
        }
Exemplo n.º 3
0
        public void AttackLeveledGenerateFixed()
        {
            var a = new Attack(10, 10, 2);
            Assert.AreEqual(12, a.GenerateDamage());

            a = new Attack(30, 30, 2);
            Assert.AreEqual(36, a.GenerateDamage());

            a = new Attack(30, 30, 5);
            Assert.AreEqual(54, a.GenerateDamage());
        }
Exemplo n.º 4
0
        public void AttackMultipliedGenerateRange()
        {
            var a = new Attack(10, 100);
            a.MultiplyDamage(1.5);

            for (int i = 0; i < 20; i++)
            {
                int dmg = a.GenerateDamage();
                Assert.IsTrue(dmg <= 150 && dmg >= 15);
            }
        }
Exemplo n.º 5
0
 public void AttackMultipliedGenerateFixed()
 {
     var a = new Attack(10, 10);
     a.MultiplyDamage(1.5);
     Assert.AreEqual(15, a.GenerateDamage());
 }
Exemplo n.º 6
0
 public void AttackGenerateFixed()
 {
     var a = new Attack(10, 10);
     Assert.AreEqual(10, a.GenerateDamage());
 }
Exemplo n.º 7
0
 public override void ModifyOutgoing(Attack outgoing)
 {
     outgoing.MultiplyDamage(DamageMultiplier);
 }
Exemplo n.º 8
0
 public override void ModifyOutgoing(Attack outgoing)
 {
     // do nothing
 }
Exemplo n.º 9
0
 public override void RecieveAttack(Attack incoming)
 {
     Weapon.ModifyIncoming(incoming);
     Health -= (int) (incoming.GenerateDamage()*(1 - Stats.DamageReduction));
 }
Exemplo n.º 10
0
 public override void ModifyOutgoing(Attack outgoing)
 {
     outgoing.MaximumDamage = (int)(outgoing.MaximumDamage * MaxMultiplier);
     outgoing.MinimumDamage = (int)(outgoing.MinimumDamage * MinMultiplier);
 }
Exemplo n.º 11
0
 public override void ModifyIncoming(Attack incoming)
 {
     // default: do nothing
     // note: you can completely omit this method if you don't wish to modify incoming attacks
 }
Exemplo n.º 12
0
 /// <summary>
 ///     Recieves an <see cref="Attack" />, reducing the character's health after giving them
 ///     an opportunity to apply damage reduction
 /// </summary>
 /// <param name="incoming">The incoming attack</param>
 public abstract void RecieveAttack(Attack incoming);
Exemplo n.º 13
0
 public virtual void ModifyIncoming(Attack incoming)
 {
     // default: do nothing
 }
Exemplo n.º 14
0
 public override Attack GenerateAttack()
 {
     var a = new Attack(Stats.MinimumDamage, Stats.MaximumDamage, Level);
     Strategy.ModifyOutgoing(a);
     return a;
 }
Exemplo n.º 15
0
 public override void ModifyOutgoing(Attack outgoing)
 {
     // don't modify
 }
 public void ModifyOutgoing(Attack outgoing)
 {
     outgoing.MaximumDamage = (int) (outgoing.MaximumDamage*AttackMultiplier);
     outgoing.MinimumDamage = (int) (outgoing.MinimumDamage*AttackMultiplier);
 }
Exemplo n.º 17
0
 public abstract void ModifyOutgoing(Attack outgoing);
Exemplo n.º 18
0
        public override Attack GenerateAttack()
        {
            var outgoing = new Attack(Stats.MinimumDamage, Stats.MaximumDamage, Level);

            Weapon.ModifyOutgoing(outgoing);
            Drink.ModifyOutgoing(outgoing);

            // drink used up after one attack
            Drink = DrinkFactory.Create(DrinkType.NullDrink);

            return outgoing;
        }