Skip to content

Commit

Permalink
Add basic goals, conflicts, last names
Browse files Browse the repository at this point in the history
  • Loading branch information
hoverbird committed Jul 15, 2011
1 parent 03acd3b commit 999beb0
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 35 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source "http://rubygems.org"

group :default do
gem "chance"
gem "thin"
gem "sinatra"
gem "sinatra-reloader"
end
4 changes: 4 additions & 0 deletions lib/storying/character_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ def name
@names ||= Storying.names[gender].random
end

def full_name
@full_name ||= [name, Storying.last_names.random].join(' ')
end

end
end
4 changes: 2 additions & 2 deletions story_elements/conflicts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- a coup d'etat
- a sudden illness
- a plague of locusts
- a viral epedemic
- kidnapping and murder threats
6 changes: 6 additions & 0 deletions story_elements/goals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- the adoration of the masses
- a sizable fee
- glory
- love
- control of the United Nations
201 changes: 201 additions & 0 deletions story_elements/last_names.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
---
- Lawson
- Franklin
- Kelley
- Peters
- Austin
- Sims
- Chavez
- Elliott
- Lawrence
- Greene
- Weaver
- Carpenter
- Armstrong
- Riley
- Fox
- Harper
- Ruiz
- Andrews
- Lane
- Bradley
- Cunningham
- Hart
- Snyder
- Duncan
- Carroll
- Olson
- Watkins
- Ray
- Willis
- Wagner
- Arnold
- Matthews
- Berry
- Pierce
- Payne
- Stephens
- Gardner
- Spencer
- Hudson
- Perkins
- Dunn
- Hawkins
- Stone
- Rose
- Ferguson
- Knight
- Grant
- Nichols
- Mills
- Palmer
- Daniels
- Black
- Hunt
- Robertson
- Rice
- Holmes
- Shaw
- Gordon
- Burns
- Reyes
- Ramos
- Dixon
- Warren
- Kennedy
- Morales
- Mason
- Boyd
- Henry
- Crawford
- Hicks
- Hunter
- Porter
- Tucker
- Stevens
- Simpson
- Webb
- Wells
- Freeman
- Murray
- Gomez
- Ortiz
- Marshall
- Cruz
- Mcdonald
- Gibson
- Harrison
- Ellis
- Fisher
- Reynolds
- Owens
- Jordan
- West
- Cole
- Woods
- Wallace
- Sullivan
- Graham
- Hamilton
- Ford
- Myers
- Hayes
- Diaz
- Griffin
- Russell
- Alexander
- Bryant
- Gonzales
- Foster
- Simmons
- Butler
- Washington
- Flores
- Hughes
- Patterson
- Long
- Powell
- Perry
- Jenkins
- Coleman
- Henderson
- Ross
- Barnes
- Wood
- Bennett
- Price
- Sanders
- Kelly
- Brooks
- Watson
- James
- Ramirez
- Gray
- Peterson
- Torres
- Ward
- Howard
- Cox
- Richardson
- Cooper
- Rivera
- Bailey
- Murphy
- Bell
- Morgan
- Cook
- Reed
- Rogers
- Morris
- Sanchez
- Stewart
- Collins
- Edwards
- Evans
- Parker
- Campbell
- Phillips
- Turner
- Roberts
- Perez
- Mitchell
- Carter
- Nelson
- Gonzalez
- Baker
- Adams
- Green
- Scott
- Hill
- Lopez
- Wright
- King
- Hernandez
- Young
- Allen
- Hall
- Walker
- Lee
- Lewis
- Rodriguez
- Clark
- Robinson
- Martinez
- Garcia
- Thompson
- Martin
- Harris
- White
- Jackson
- Thomas
- Anderson
- Taylor
- Moore
- Wilson
- Miller
- Davis
- Brown
- Jones
- Williams
- Johnson
- Smith
2 changes: 0 additions & 2 deletions story_elements/relationships_to_character.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
- loyal companion
- parent
- rival
- servant
- best friend
18 changes: 9 additions & 9 deletions storying.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
%w(rubygems bundler/setup chance yaml erb sinatra).each {|library| require library}
%w(rubygems bundler/setup chance yaml erb sinatra thin sinatra/reloader).each {|library| require library}

module Storying
ROOT = File.dirname(__FILE__)
STORY_ELEMENTS_PATH = ROOT + "/story_elements"
LIB_PATH = ROOT + "/lib/storying/"
TEMPLATE_PATH = ROOT + "/templates"
TEMPLATES = Dir.glob(TEMPLATE_PATH + "/*.erb").map {|f| File.read f}#.map {|f| f.split('/')[-1].split('.')[0].to_sym }

configure(:development) do |config|
require "sinatra/reloader"
config.also_reload LIB_PATH + "/*.rb"
end
TEMPLATES = Dir.glob(TEMPLATE_PATH + "/*.erb").map {|f| File.read f}

Dir.entries(LIB_PATH).sort.each do |filename|
next unless filename =~ /\.rb$/
require File.join(LIB_PATH, filename)
require File.join(LIB_PATH, filename) if filename =~ /\.rb$/
end

# Parse all of the story_elements YAML files and make accessor methods by filename
Expand All @@ -32,4 +26,10 @@ class << self
erb TEMPLATES.random, :layout => :layout
end

configure do |c|
c.also_reload "*.rb"
c.also_reload "*.yml"
c.also_reload "*.erb"
end

end
27 changes: 6 additions & 21 deletions templates/adapted_sloan.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,12 @@
<% setting = story.setting %>
<% support = story.supporting_character %>

For every time and place, there is a hero. In this case, one with a <%= hero.characteristic %> who is <%= hero.relationship_to_setting %>.
Sometimes there's a <%= hero.gender %> who's perfectly suited for <%= hero.possesive_pronoun %> time and place. For <%= hero.full_name %>, being on top of the world was being a <%= hero.relationship_to_setting %> during the heat wave of <%= (1978..2020).random %>.

Introduce supporting character (support) with a <%= support.characteristic %>.
<%= support.full_name %>, <%= hero.possesive_pronoun %> <%= support.relationship_to_hero %>, is never far from <%= hero.possesive_pronoun %> side. Ever since that day when <%= hero.name %> noticed <%= support.possesive_pronoun %> <%= support.characteristic %>.

support has always been a <%= support.relationship_to_hero %> to <%= hero.personal_pronoun('object') %>.

<% unless support.villain? %>
<% villain = Storying::SupportingCharacter.new(:story => story, :villain => true) %>
Little does our hero know, <%= hero.possesive_pronoun %> own <%= villain.relationship_to_hero %> who would threaten it all.
<% if support.villain? %>
But why has <%= support.personal_pronoun %> seemed so distant recently? Could it be the <%= story.conflict %> that threatens them both, or is <%= support.name %> hiding something?
<% else %><% villain = Storying::SupportingCharacter.new(:story => story, :villain => true) %>
Neither of them trust <%= villain.full_name %>, <%= hero.name %>'s <%= villain.relationship_to_hero %>- <%= villain.personal_pronoun %> would do anything for <%= Storying.goals.random %>. One thing is clear: when <%= story.conflict %> hits, nothing in <%= setting %> will ever be the same.
<% end %>

When <%= story.conflict %> hits, nothing in <%= setting %> will ever be the same.

<%# 1..3.random.times do %>
Apply TWIST to hero, support, or villain.
<%# puts 'twist! ' %>
<%# end %>

Each iteration: is CONFLICT a MacGuffin? If so: reveal TRUE CONFLICT. Retroactively inject seed of TRUE CONFLICT into introduction of hero, setting, support or villain.

<%# if hero_victorious? = probably %>
Decide whether hero or villain is victorious.

Apply CONSEQUENCE for hero, support, villain and/or <%= setting %>.
2 changes: 1 addition & 1 deletion templates/simple.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<% hero = story.hero %>
<% support = story.supporting_character %>

A <%= hero.gender %> with a <%= hero.characteristic %>, <%= hero.name %> is an international operative who will stop at nothing to see justice done. Sometimes <%= hero.personal_pronoun %> must journey far in search of evil; sometimes evil finds <%= hero.personal_pronoun('object') %> in <%= story.setting %>. When a <%= story.conflict %> arises, only <%= hero.possesive_pronoun %> <%= support.relationship_to_hero %> <%= support.name %> can turn the tide. In a dangerous world, one extraordinary <%= support.gender %> can mean the difference between life and death...
A <%= hero.gender %> with a <%= hero.characteristic %>, <%= hero.name %> is an international operative who will stop at nothing to see justice done. Sometimes <%= hero.personal_pronoun %> must journey far in search of evil; sometimes evil finds <%= hero.personal_pronoun('object') %> in <%= story.setting %>. When a <%= story.conflict %> arises, only <%= hero.possesive_pronoun %> <%= support.relationship_to_hero %> <%= support.full_name %> can turn the tide. In a dangerous world, one extraordinary <%= support.gender %> can mean the difference between life and death...

0 comments on commit 999beb0

Please sign in to comment.