Chronicles of Darkness grimoire-Artifact PDF https://git.lain.church/TheStranjer/ShardsOfPower
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

80 行
1.5KB

  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. attr_accessor :authors
  16. def initialize(
  17. death: 0,
  18. fate: 0,
  19. forces: 0,
  20. life: 0,
  21. matter: 0,
  22. mind: 0,
  23. prime: 0,
  24. space: 0,
  25. spirit: 0,
  26. time: 0,
  27. name:,
  28. practice:,
  29. primary_factor:,
  30. withstand: nil,
  31. suggested_rote_skills:,
  32. reaches: [],
  33. rules_text:,
  34. authors:,
  35. adds: [])
  36. @death = death
  37. @fate = fate
  38. @forces = forces
  39. @life = life
  40. @matter = matter
  41. @mind = mind
  42. @prime = prime
  43. @space = space
  44. @spirit = spirit
  45. @time = time
  46. @name = name
  47. @practice = practice
  48. @primary_factor = primary_factor
  49. @withstand = withstand
  50. @suggested_rote_skills = suggested_rote_skills
  51. @reaches = reaches
  52. @rules_text = rules_text
  53. @authors = authors
  54. @adds = adds
  55. end
  56. def primary_arcanum
  57. ARCANA.max { |arcanum1, arcanum2| self.send(arcanum1) <=> self.send(arcanum2) }
  58. end
  59. def full_title
  60. "#{name} (#{arcana_with_dots.join(', ')})"
  61. end
  62. def arcana
  63. ARCANA.select { |arcanum| self.send(arcanum) > 0}
  64. end
  65. def arcana_with_dots
  66. arcana.collect { |arcanum| arcanum_with_dots(arcanum) }
  67. end
  68. def arcanum_with_dots(arcanum)
  69. [arcanum, self.send(arcanum)].to_arcanum_with_dots
  70. end
  71. end