示例#1
0
 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);
     }
 }
示例#2
0
        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);
        }
示例#3
0
 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;
 }
示例#4
0
 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);
         }
     }
 }
示例#5
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);
                }
            }
        }
示例#6
0
 public virtual void FeatFinishRollCheck(Roll roll, RollEventArgs e)
 {
 }
示例#7
0
 public virtual void FeatPostRollCheck(Roll roll, RollEventArgs e)
 {
     FeatPostRollFinished(roll);
 }
示例#8
0
 public void FinishRollCheck(Roll roll, RollEventArgs e)
 {
     finishRollCheck?.Invoke(roll, e);
 }