@@ -249,10 +249,18 @@ class ShardsOfPower | |||||
g.text spell.rules_text, :inline_format => true | g.text spell.rules_text, :inline_format => true | ||||
spell.reaches.each do |reach| | spell.reaches.each do |reach| | ||||
g.formatted_text [ | |||||
{:text => "+#{reach[0]} Reach: ", :styles => [:bold], :font => "Goudy"}, | |||||
{:text => reach[1], :font => "Goudy"}, | |||||
] | |||||
reach_cost = mana_cost = reach_rules = nil | |||||
if reach.size == 3 | |||||
g.formatted_text [ | |||||
{:text => "+#{reach[0]} Reach, #{reach[1]} Mana: ", :styles => [:bold], :font => "Goudy"}, | |||||
{:text => reach[2], :font => "Goudy"}, | |||||
] | |||||
else | |||||
g.formatted_text [ | |||||
{:text => "+#{reach[0]} Reach: ", :styles => [:bold], :font => "Goudy"}, | |||||
{:text => reach[1], :font => "Goudy"}, | |||||
] | |||||
end | |||||
end | end | ||||
spell.adds.each do |add| | spell.adds.each do |add| | ||||
@@ -1285,7 +1285,7 @@ class Spell | |||||
duplicate_spells = spells.group_by(&:name).select {| k, v| v.length > 1 } | duplicate_spells = spells.group_by(&:name).select {| k, v| v.length > 1 } | ||||
raise "Duplicate spells (on name) detected: #{duplicate_spells.collect{ |k,v| k}.to_list}" if duplicate_spells.length > 0 | raise "Duplicate spells (on name) detected: #{duplicate_spells.collect{ |k,v| k}.to_list}" if duplicate_spells.length > 0 | ||||
unpunctuated_spells = spells.select { |spell| spell.rules_text.unpunctuated? || spell.reaches.collect{|reach| reach[1]}.any?(&:unpunctuated?) || spell.adds.any? { |add| add[:effect].unpunctuated? } } | |||||
unpunctuated_spells = spells.select { |spell| spell.rules_text.unpunctuated? || spell.reaches.collect{|reach| reach.size == 2 ? reach[1] : reach[2] }.any?(&:unpunctuated?) || spell.adds.any? { |add| add[:effect].unpunctuated? } } | |||||
raise "The following spells lack punctuation: #{unpunctuated_spells.collect(&:name).to_list}" if unpunctuated_spells.length > 0 | raise "The following spells lack punctuation: #{unpunctuated_spells.collect(&:name).to_list}" if unpunctuated_spells.length > 0 | ||||