Skip to content

Instantly share code, notes, and snippets.

@jicksta
Last active March 19, 2018 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jicksta/1c19a8f1118b2c393c5c318a6f3395c0 to your computer and use it in GitHub Desktop.
Save jicksta/1c19a8f1118b2c393c5c318a6f3395c0 to your computer and use it in GitHub Desktop.
Script to roll d4s on the D&D Eladrin (UA) tables for determining dynamic personality trait and flaw by season
#!/usr/bin/env ruby
require 'active_support/all'
SEASONS = {
autumn: {
description: "Autumn is the season of peace and goodwill, when summer’s harvest is shared with all. Eladrin adopt this personality when overcome with contentment.",
traits: [
"If someone is in need, you never withhold aid.",
"You share what you have, with little regard to your own needs.",
"There are no simple meals, only lavish feasts.",
"You stock up on fine food and drink. You hate going without such comforts."
],
flaws: [
"You trust others without thought.",
"You give to the point that you leave yourself without necessary supplies.",
"Everyone is your friend, or a potential friend.",
"You spend excessively on creature comforts."
]
},
winter: {
description: "Winter is the season of dolor, when the vibrant energy of the world slumbers. It is a time of sadness and regret, entered when eladrin are overcome with sorrow.",
traits: [
"The worst case is the most likely case.",
"You preserve what you have. Better to hunger today and have food for tomorrow.",
"The world is full of dangers. You never let your guard drop.",
"A penny spent is a penny lost forever."
],
flaws: [
"Everything dies eventually. Why bother building anything that is meant to last?",
"Nothing matters to you, and you allow others to guide your actions.",
"Your needs come first. In winter, all must watch out for themselves.",
"You speak only to point of the flaws in others' plans."
]
},
spring: {
description: "Spring is the season of cheerfulness and unfettered celebration, marked by merriment as winter’s sorrow passes. Eladrin enter this state when overcome with joy.",
traits: [
"Every day is the great day of your life.",
"You do everything with enthusiasm, even the most mundane chores.",
"You love music and song. You supply a tune yourself if no one else can.",
"You can't stay still."
],
flaws: [
"You overdrink.",
"Toil is for drudges. Yours should be a life of leisure.",
"A pretty face infatuates you in an insant, but your fancy passes with equal speed.",
"Anything worth doing is worth overdoing."
]
},
summer: {
description: "Summer is the season of boldness and aggression, a time of unfettered energy. Eladrin enter this state when overcome with fury.",
traits: [
"You believe that direct confrontation is the best way to solve problems",
"Overwhelming force can solve almost anything. The tougher the problem, the more force you apply.",
"You stand tall and strong so that others can lean on you.",
"You maintain an intimidating front. Better to prevent fights with a show of force than be led to harm others."
],
flaws: [
"You are stubborn. Let others change.",
"The best option is one that is swift, unexpected, and overwhelming.",
"Punch first. Talk later.",
"Your fury can carry you through anything."
]
}
}
CURRENT_SEASON = if ARGV.empty?
SEASONS.values.each do |season|
puts
puts season[:description]
end
exit
elsif ARGV.first =~ /^(rand(om)?|roll|d4|new|any)$/i
# require 'active_support/core_ext/array/random_access'
SEASONS.keys.sample
else
ARGV.first.downcase.to_sym.tap do |param|
abort "Unrecognized season #{param.inspect}" unless SEASONS.include?(param)
end
end
SEASON_DETAILS = {
season: CURRENT_SEASON.to_s.capitalize,
description: SEASONS[CURRENT_SEASON][:description],
trait: SEASONS[CURRENT_SEASON][:traits].sample,
flaw: SEASONS[CURRENT_SEASON][:flaws].sample
}
puts %{
%{description}
TRAIT: %{trait}
FLAW: %{flaw}
} % SEASON_DETAILS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment