Chronicles of Darkness grimoire-Artifact PDF https://git.lain.church/TheStranjer/ShardsOfPower
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.7KB

  1. class Spell
  2. ARCANA = [:death, :fate, :forces, :life, :matter, :mind, :prime, :space, :spirit, :time]
  3. RANKS = ["Initiate", "Apprentice", "Disciple", "Adept", "Master"]
  4. ARCANA.each do |arcanum|
  5. attr_accessor arcanum
  6. end
  7. attr_accessor :name,
  8. :practice,
  9. :primary_factor,
  10. :withstand,
  11. :suggested_rote_skills,
  12. :reaches,
  13. :adds,
  14. :rules_text,
  15. :cost
  16. attr_accessor :authors
  17. def initialize(
  18. death: 0,
  19. fate: 0,
  20. forces: 0,
  21. life: 0,
  22. matter: 0,
  23. mind: 0,
  24. prime: 0,
  25. space: 0,
  26. spirit: 0,
  27. time: 0,
  28. name:,
  29. practice:,
  30. primary_factor:,
  31. withstand: nil,
  32. suggested_rote_skills:,
  33. reaches: [],
  34. rules_text:,
  35. authors:,
  36. adds: [],
  37. cost: nil)
  38. @death = death
  39. @fate = fate
  40. @forces = forces
  41. @life = life
  42. @matter = matter
  43. @mind = mind
  44. @prime = prime
  45. @space = space
  46. @spirit = spirit
  47. @time = time
  48. @name = name
  49. @practice = practice
  50. @primary_factor = primary_factor
  51. @withstand = withstand
  52. @suggested_rote_skills = suggested_rote_skills
  53. @reaches = reaches
  54. @rules_text = rules_text
  55. @authors = authors
  56. @adds = adds
  57. @cost = cost
  58. end
  59. def primary_arcanum
  60. ARCANA.max { |arcanum1, arcanum2| self.send(arcanum1) <=> self.send(arcanum2) }
  61. end
  62. def full_title
  63. "#{name} (#{arcana_with_dots.join(', ')})"
  64. end
  65. def arcana
  66. ARCANA.select { |arcanum| self.send(arcanum) > 0}
  67. end
  68. def arcana_with_dots
  69. arcana.collect { |arcanum| arcanum_with_dots(arcanum) }
  70. end
  71. def arcanum_with_dots(arcanum)
  72. [arcanum, self.send(arcanum)].to_arcanum_with_dots
  73. end
  74. end