Some updates

This commit is contained in:
The Stranjer 2019-07-04 19:24:58 -04:00
parent f9fbe0cbd6
commit c9a1a09ef0
3 changed files with 135 additions and 1 deletions

View File

@ -83,4 +83,80 @@ class Spell
def arcanum_with_dots(arcanum)
[arcanum, self.send(arcanum)].to_arcanum_with_dots
end
def render(rating_title = nil)
puts "\t\tCompiling #{full_title} by #{authors.join(', ')}"
pdf.outline.add_subsection_to(rating_title) do
@pdf.outline.section full_title, :destination => @pdf.page_number
end
pdf.group do |g|
unless rating_title.nil?
g.font_size Awakened2069::FONT_SIZE_SECTION
g.text rating_title
end
spell_ary = [{:text => "#{name} (", :font => "Lilith", :color => "004E6D", :size => Awakened2069::FONT_SIZE_SUBSECTION}]
g.font_size Awakened2069::FONT_SIZE_BODY
previous = false
arcana.each do |arcanum|
spell_ary << {:text => ", ", :font => "Lilith", :color => "004E6D", :size => Awakened2069::FONT_SIZE_SUBSECTION} if previous
spell_ary << {:text => arcanum.to_s.titleize, :font => "Lilith", :color => "004E6D", :size => Awakened2069::FONT_SIZE_SUBSECTION}
spell_ary << {:text => self.send(arcanum).to_dots, :color => "004E6D", :size => Awakened2069::FONT_SIZE_SUBSECTION, :character_spacing => -5}
previous = true
end
spell_ary << {:text => " )", :font => "Lilith", :styles => [], :color => "004E6D", :size => Awakened2069::FONT_SIZE_SUBSECTION, :character_spacing => -3}
g.formatted_text spell_ary
g.formatted_text [
{:text => "Practice: ", :styles => [:bold], :font => "Goudy"},
{:text => practice, :font => "Goudy"},
]
g.formatted_text [
{:text => "Primary Factor: ", :styles => [:bold], :font => "Goudy"},
{:text => primary_factor, :font => "Goudy"},
]
g.formatted_text [
{:text => "Withstand: ", :styles => [:bold], :font => "Goudy"},
{:text => withstand, :font => "Goudy"},
] if !withstand.nil?
g.formatted_text [
{:text => "Cost: ", :styles => [:bold], :font => "Goudy"},
{:text => cost, :font => "Goudy"},
] if !cost.nil?
g.formatted_text [
{:text => "Suggested Rote Skills: ", :styles => [:bold], :font => "Goudy"},
{:text => suggested_rote_skills.join(', '), :font => "Goudy"},
]
g.formatted_text [
{:text => authors.length == 1 ? "Author: " : "Authors: ", :styles => [:bold], :font => "Goudy"},
{:text => authors.join(', '), :font => "Goudy"},
]
g.text rules_text, :inline_format => true
reaches.each do |reach|
g.formatted_text [
{:text => "+#{reach[0]} Reach: ", :styles => [:bold], :font => "Goudy"},
{:text => reach[1], :font => "Goudy"},
]
end
adds.each do |add|
g.formatted_text [
{:text => "#{add[:verb] ? add[:verb] : "Add"} #{add[:arcana].collect { |arcanum, rating| [arcanum, rating].to_arcanum_with_dots }.to_list(:separator => add[:separator])}: ", :styles => [:bold], :font => "Goudy"},
{:text => add[:effect], :font => "Goudy"},
]
end
end
end
end

View File

@ -1,7 +1,39 @@
class Spell
def self.spells
def self.spells(pdf)
spells = []
spells << Spell.new(
:name => "Add Contact",
:forces => 1,
:practice => "Compelling",
:primary_factor => "Duration",
:withstand => "Resolve",
:suggested_rote_skills => ["Computer", "Politics", "Socialize"],
:authors => ["NEETzsche"],
:rules_text => "With this spell, the willworker can add someone to their contacts list without having to pay up for it, or have mundane computer knowledge. For the Duration of the spell, the two people may communicate as though they were on each other's contact lists.",
:reaches => [
[2, "The effect is Lasting."]
],
:pdf => pdf
)
spells << Spell.new(
:name => "Control Computer",
:forces => 2,
:practice => "Ruling",
:primary_factor => "Duration",
:suggested_rote_skills => ["Computer", "Crafts", "Science"],
:authors => ["NEETzsche"],
:rules_text => "With this spell, the willworker can control a computer or other similar digital device. He can make it do anything the device can normally do, like run or install existing apps, visit websites, or share its GPS location data. The spell cannot, however, make the device do something more sophisticated than it normally could. The willworker must know specifically what the device should do unconditionally upon casting, and cannot change her mind on its effects on-the-fly.",
:adds => [
{:arcana => { :fate => 2 }, :effect => "When Reaching as above, willworker can implant software with outright subjective parameters."},
],
:reaches => [
[1, "The willworker can implant custom software into the device, either software he has written personally beforehand or software that he envisions in his mind. The software must be computable and must not require more system resources than the device can process. For example, he could implant a program that decrypts the owner's passwords and sends them off to some third party source because that requires minimal system resources, but he could not implant a program that instantly mines the next BitCoin, because someone's smartphone likely lacks the required processing power to do this. He also could not implant software that uses conditionals that are outright subjective, like separating someone's \"shitposts\" from their \"effortposts\" and putting them in separate folders."]
],
:pdf => pdf
)
# TESTS
duplicate_spells = spells.group_by(&:name).select {| k, v| v.length > 1 }

View File

@ -220,6 +220,32 @@ class Awakened2069
pdf.text "Awakened society views the post-Internet computer networks as a bifurcate structure. The aforementioned disparate computer networks, with some of the problems and benefits of the now-antiquituous Internet, along with their mundane improvements, are typically referred to as the Lower Layer. Sometimes this is called the Fallen Layer, although that is not as popular. While it is definitely possible for someone to transmit their written or spoken thoughts, their full body motion, and even their mundane consciousness outright into these Fallen networks, can a person transmit the contents of their <i>soul</i> through it. Simply put: not really.\nThe lower layer has many systems in place. Users can communicate but cannot do so freely; government and corporate controls abound restrict who can speak to who. Ridiculous fees have been added to adding people to contact lists, so as to control who people speak to more than how much they do so. Adding someone to your contacts list is a Resources 1 expenditure. Creating a network connection where many people may speak freely to each other, like a chat room or web forum, is a Resources 2 expenditure. Naturally, this can be bypassed, either with a successful Intelligence + Computer roll (at a -2 penalty for a group chat) or a successful casting of the Forces 2 spell \"Control Computer.\" For a group setting, the willworker must use +1 Reach to create a group chat. Finally, to give these group chats plot armor, one can also purchase the Secure Forum Merit.", :inline_format => true, :indent_paragraphs => INDENT_SIZE
end
start_chapter "Spells"
Spell.spells(pdf).group_by(&:primary_arcanum).sort_by { |arcanum, spells| arcanum }.to_h.each do |arcanum, arcanum_spells|
arcanum_name = arcanum.to_s.titleize
puts "Compiling spells for #{arcanum_name}..."
start_section("#{arcanum_name} Spells")
pdf.column_box([0, pdf.cursor], :columns => 2, :width => pdf.bounds.width) do
arcanum_spells.group_by(&arcanum).sort_by { |rating, spells| rating }.to_h.each do |rating, rating_spells|
rating_title = "#{rating.to_dots} #{Spell::RANKS[rating - 1]} of #{arcanum_name}"
puts "\tCompiling #{rating_title} spells..."
pdf.outline.add_subsection_to("#{arcanum_name} Spells") do
@pdf.outline.section rating_title, :destination => @pdf.page_number
end
rating_spells.first.render(rating_title)
rating_spells
.reject { |spell| spell == rating_spells.first }
.each(&:render)
end
end
end
pdf.render_file("writeup.pdf")
end
end