Module: CharacterTitles::Evil
- Defined in:
- lib/character_titles/evil.rb
Constant Summary collapse
- BODY_PARTS_SINGULAR =
%w(anus blood flesh skin fat death eye sight)
- BODY_PARTS =
%w(intestine colon gonad skull leg arm body head gut beast heart liver)
- VIOLENT_VERBS_AS_NOUNS =
%w(vommitter cooker roaster punisher mutalator disfigurer clawer disembowler crusher masher ravisher banisher killer grasper tearer flayer eater ripper impaler chewer sucker severer wrencher sapper reamer walker feaster devourer destroyer tormentor defiler mincer)
- ADJECTIVES =
%w(evil dark rotting putrid forgotten terrible horrible nasty sickening putrifying banished outlawed)
- NOUNS =
%w(scourage terror horror ghoul ghost beast outlaw criminal demon)
Class Method Summary collapse
- .generate ⇒ Object
- .pick_body_part ⇒ Object
- .qualifer_should_be_proper? ⇒ Boolean
- .qualifier ⇒ Object
Class Method Details
.generate ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/character_titles/evil.rb', line 25 def generate body_part = pick_body_part title = if rand(2) == 1 && !BODY_PARTS_SINGULAR.include?(body_part) "#{VIOLENT_VERBS_AS_NOUNS.sample} of #{body_part.pluralize}" else "#{body_part}#{['', '-', ' '].sample}#{VIOLENT_VERBS_AS_NOUNS.sample}" end title = "#{ADJECTIVES.sample} #{title}" if rand(3) == 1 # add an adjective to the title? title = "the #{title}" if rand(3) == 1 # should the title be proper? title = "#{title}, #{qualifier}" if rand(2) == 1 # should it include a qualifier? title.titleize.gsub('Of', 'of').gsub('The', 'the') end |
.pick_body_part ⇒ Object
21 22 23 |
# File 'lib/character_titles/evil.rb', line 21 def pick_body_part (BODY_PARTS_SINGULAR + BODY_PARTS).sample end |
.qualifer_should_be_proper? ⇒ Boolean
13 14 15 |
# File 'lib/character_titles/evil.rb', line 13 def qualifer_should_be_proper? rand(3) == 1 end |
.qualifier ⇒ Object
17 18 19 |
# File 'lib/character_titles/evil.rb', line 17 def qualifier "#{'the ' if qualifer_should_be_proper?}#{NOUNS.sample} of #{CharacterTitles::Place.generate}" end |