public void PostRollCheck(Roll roll, RollEventArgs e) { if (postRollCheck == null) { roll.PostRollCheckDone(this); } else { postRollCheckDoneObjects.Add(roll, new List <Object>()); postRollCheckDoneNumber.Add(roll, postRollCheck.GetInvocationList().GetLength(0)); postRollCheck?.Invoke(roll, e); } }
public void FinishDamageRoll(Roll roll, RollEventArgs e) { if (!isSpell) { Debug.WriteLine(string.Format("{0} did {1} ({2} + {3}) {4} damage to {5} with a {6}", attacker.name, roll.score, roll.score - roll.bonus, roll.bonus, damageTypes[0], defender.name, attackerWeapon.name)); } else { Debug.WriteLine(string.Format("{0} did {1} ({2} + {3}) {4} damage to {5} with {6}", attacker.name, roll.score, roll.score - roll.bonus, roll.bonus, damageTypes[0], defender.name, spell.name)); } defender.TakeDamage(this); }
public void FinishAttackRoll(Roll roll, RollEventArgs e) { RemoveThrownOrAmmunition(); if (attackRoll.Success) { Debug.WriteLine(string.Format("{0} hit {1} with an attack with an attack roll of {2} ({3} + {4}) against an AC of {5} {6}", attacker.name, defender.name, roll.score, roll.score - roll.bonus, roll.bonus, defender.AC, roll.WithAdvantagePrint())); DoDamageRoll(); } else { Debug.WriteLine(string.Format("{0} missed {1} with an attack with an attack roll of {2} ({3} + {4}) against an AC of {5} {6}", attacker.name, defender.name, roll.score, roll.score - roll.bonus, roll.bonus, defender.AC, roll.WithAdvantagePrint())); } finished = true; }
public virtual void SavingThrowFinished(Roll roll, RollEventArgs e) { if (roll.Success) { Debug.WriteLine(string.Format("{0} succeeded on their saving throw against {1}'s {2}", roll.roller, this.caster, name)); } else { Debug.WriteLine(string.Format("{0} failed on their saving throw against {1}'s {2}", roll.roller, this.caster, name)); } if (simpleSpellTargetRollDamage) { if (targetType == TargetType.SingleTarget) { if (roll.Success) { SingleTargetFail(roll.roller); } else { SingleTargetSuccess(roll.roller); } } else { finishedSavingThrows.Add(roll); if (finishedSavingThrows.Count == savingThrows.Keys.Count) { MakeDamageRoll(); } } } if (simpleSpellTargetRollEffect) { if (roll.Success) { SingleTargetFail(roll.roller); } else { SingleTargetSuccess(roll.roller); } } }
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 FeatFinishRollCheck(Roll roll, RollEventArgs e) { }
public virtual void FeatPostRollCheck(Roll roll, RollEventArgs e) { FeatPostRollFinished(roll); }
public void FinishRollCheck(Roll roll, RollEventArgs e) { finishRollCheck?.Invoke(roll, e); }