void generateCombatMessage() { string message; if (this.hit) { if (this.damageDealt > 0) { message = string.Format("{0} {1} {2} and deals {3} damage!", attacker.Name, Combat.AttackVerb(damageDealt, damageType).SFormOfVerb(), target.Name, damageDealt.ToString()); } else { message = string.Format("{0} {1} {2}, but doesn't deal any damage.", attacker.Name, Combat.AttackVerb(damageDealt, damageType).SFormOfVerb(), target.Name); } } else { message = string.Format("{0} misses.", attacker.Name); } this.combatMessage = message.CapitaliseFirstLetter(); }
public static bool RollToHit(int accuracy) { return(Combat.RandomNumber(100) <= accuracy); }