Beispiel #1
0
        public int TakeDamage(int damage, DamageType damageType)
        {
            int damageTaken = damage - Combat.RandomNumber(this.damageReduction);

            this.HP -= damageTaken;
            return(damageTaken);
        }
Beispiel #2
0
 private void resolveAbilities()
 {
     if (Combat.RandomNumber(player.Speed) >= Combat.RandomNumber(monster.Speed))
     {
         prependToCombatLog(player.UseAllReadyAbilities());
         prependToCombatLog(monster.UseAllReadyAbilities());
     }
     else
     {
         prependToCombatLog(monster.UseAllReadyAbilities());
         prependToCombatLog(player.UseAllReadyAbilities());
     }
 }
Beispiel #3
0
 public void Resolve()
 {
     if (Combat.RollToHit(accuracy))
     {
         this.hit            = true;
         this.damageDealt    = Combat.RandomNumber(strength);
         this.damageReceived = target.TakeDamage(this.damageDealt, damageType);
     }
     else
     {
         this.damageDealt = this.damageReceived = 0;
         this.hit         = false;
     }
     generateCombatMessage();
 }
Beispiel #4
0
        public void Resolve()
        {
            if (Combat.RollToHit(triggerChance))
            {
                this.amountHealed = Combat.RandomNumber(effectiveness);
            }
            else
            {
                this.amountHealed = 0;
            }

            if (this.amountHealed > 0)
            {
                target.HP += amountHealed;
                this.generateCombatMessage();
            }
        }
Beispiel #5
0
 public static bool RollToHit(int accuracy)
 {
     return(Combat.RandomNumber(100) <= accuracy);
 }