lib/content_generators_module.rb
# Generates a random hero story, when a hero is created in GameApp/new_game
Generates a random hero story, when a hero is created in GameApp/new_game
Generates a random hero story when a hero is created in GameApp / new_game
def hero_story_generator
    occupation = %w(student teacher builder programmer father mother doctor musician artist soldier policeman detective).sample
    sentiment = ["looked up to", "distrusted", "admired", "trusted", "cared about", "counseled", "ignored", "respected"].sample
    event = ["the war", "the divorce", "the haunting", "the invasion", "you were fired", "these damn monsters", "you were told about the prophecy"].sample
    activity = %w(wander survive explore journey fight play).sample
    motivation = ["that's the only thing you have left", "that's what matters now", "you need something to hold on to", "it keeps you sane", "you just love it", "your mom told you to", "because you made a promise, long ago"].sample
    hero_story = "You wake up. Nightmares, again. You were a #{occupation}, once. People #{sentiment} you. But that was before #{event}. Now, you #{activity} because #{motivation}. Time to get moving."
  end
def hero_story_generator occupation = %w( student teacher builder programmer father mother doctor musician artist soldier policeman detective ) . sample sentiment = [ "looked up to" , "distrusted" , "admired" , "trusted" , "cared about" , "counseled" , "ignored" , "respected" ] . sample event = [ "the war" , "the divorce" , "the haunting" , "the invasion" , "you were fired" , "these damn monsters" , "you were told about the prophecy" ] . sample activity = %w( wander survive explore journey fight play ) . sample motivation = [ "that's the only thing you have left" , "that's what matters now" , "you need something to hold on to" , "it keeps you sane" , "you just love it" , "your mom told you to" , "because you made a promise, long ago" ] . sample hero_story = "You wake up. Nightmares, again. You were a #{occupation}, once. People #{sentiment} you. But that was before #{event}. Now, you #{activity} because #{motivation}. Time to get moving." end
Generates a random hero story, when a hero is created in GameApp/new_game
Generates a random hero story when a hero is created in GameApp / new_game