Esempio n. 1
0
        public void GetDamageDice(DamageRoll roll)
        {
            if (!isSpell)
            {
                attackerWeapon.GetDamageDice(this);
            }
            else
            {
                spell.GetDamageDice(this);
            }

            roll.diceFaces    = new List <int>(damageDiceFaces);
            roll.numberOfDice = new List <int>(damageDiceNumber);
            roll.damageTypes  = new List <string>(damageTypes);
        }
Esempio n. 2
0
        public virtual void FinishDamageRoll(Roll roll, RollEventArgs e)
        {
            //Debug.WriteLine(string.Format("{0} did {1} {2} damage to {3} with a {4}", caster.name, roll.score, damageTypes[0], rollDefender.name, name));
            DamageRoll damageRoll = roll as DamageRoll;

            if (targets == null)
            {
                foreach (Creature creature in targets)
                {
                    if (!savingThrows[creature].Success || !noneOnSave)
                    {
                        creature.TakeDamage(damageRoll.scoresPerDie, damageRoll.damageTypes, savingThrows[creature].Success);
                    }
                }
            }
            else
            {
                if (!saveRoll.Success || !noneOnSave)
                {
                    target.TakeDamage(damageRoll.scoresPerDie, damageRoll.damageTypes, saveRoll.Success);
                }
            }
        }
Esempio n. 3
0
        public virtual void MakeDamageRoll()
        {
            DamageRoll damageRoll = new DamageRoll(this);

            damageRoll.DoRoll();
        }
Esempio n. 4
0
 public virtual void GetDamageDice(DamageRoll roll)
 {
     roll.diceFaces    = new List <int>(damageDice);
     roll.numberOfDice = new List <int>(damageDiceNumber);
 }
Esempio n. 5
0
 public void DoDamageRoll()
 {
     damageRoll = new DamageRoll(this);
     damageRoll.DoRoll();
 }