Bolter.cs 781 B

1234567891011121314151617181920212223242526272829
  1. using Infrastructure;
  2. namespace Domain.Weapons;
  3. public class Bolter : Weapon
  4. {
  5. public override int DamageAmount(int successDegree)
  6. {
  7. var throws = new List<int>();
  8. for (var i = 0; i < successDegree; i++)
  9. {
  10. var currentThrow = DiceService.RollDices(3, 10);
  11. throws.Add(currentThrow);
  12. }
  13. return throws.Sum() + 5 * successDegree;
  14. }
  15. public override int Attack(int bonusCt, int ct, string amo = null, bool? isHorde = null)
  16. {
  17. int successDegree;
  18. var ctDice = ct - DiceService.RollDices(1, 100) + bonusCt;
  19. if (ctDice > 0)
  20. successDegree = 1 + Utilities.Round(ctDice, 10);
  21. else
  22. successDegree = 0;
  23. return DamageAmount(successDegree);
  24. }
  25. }