Player.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using Warhammer.Models.Weapons;
  5. using Warhammer.Service;
  6. namespace Warhammer.Models
  7. {
  8. public class Player : BaseEntity
  9. {
  10. public string Name { get; set; }
  11. public string CharacterName { get; set; }
  12. public string Background { get; set; }
  13. public int Experience { get; set; }
  14. public int CC { get; set; }
  15. public int CT { get; set; }
  16. public int F { get; set; }
  17. public int E { get; set; }
  18. public int AG { get; set; }
  19. public int INT { get; set; }
  20. public int PER { get; set; }
  21. public int FM { get; set; }
  22. public int SOC { get; set; }
  23. public int MF { get; set; }
  24. public ICollection<Weapon> Weapons { get; set; }
  25. public int Initiative()
  26. {
  27. return DiceService.RollDices(1, 10) + DiceService.Bonus(AG);
  28. }
  29. public bool TestCC() { return DiceService.RollDices(1, 100) <= CC; }
  30. public bool TestCT() { return DiceService.RollDices(1, 100) <= CT; }
  31. public bool TestF() { return DiceService.RollDices(1, 100) <= F; }
  32. public bool TestE() { return DiceService.RollDices(1, 100) <= E; }
  33. public bool TestAG() { return DiceService.RollDices(1, 100) <= AG; }
  34. public bool TestINT() { return DiceService.RollDices(1, 100) <= INT; }
  35. public bool TestPER() { return DiceService.RollDices(1, 100) <= PER; }
  36. public bool TestFM() { return DiceService.RollDices(1, 100) <= FM; }
  37. public bool TestSOC() { return DiceService.RollDices(1, 100) <= SOC; }
  38. public bool TestMF() { return DiceService.RollDices(1, 100) <= MF; }
  39. }
  40. }