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); }
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); } } }
public virtual void MakeDamageRoll() { DamageRoll damageRoll = new DamageRoll(this); damageRoll.DoRoll(); }
public virtual void GetDamageDice(DamageRoll roll) { roll.diceFaces = new List <int>(damageDice); roll.numberOfDice = new List <int>(damageDiceNumber); }
public void DoDamageRoll() { damageRoll = new DamageRoll(this); damageRoll.DoRoll(); }