faker-game 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5df9d6e889533031c5625a783dd1f1bcef551c5
4
- data.tar.gz: 467d241b707d41e3bcd76b77cdce10c3308109fc
3
+ metadata.gz: b59c0069eb8a0aea073b59629ed14c21051aec1c
4
+ data.tar.gz: b45ec218b606154e12cddd49cc7acd0fc98e427e
5
5
  SHA512:
6
- metadata.gz: 7644d8ae28a66f114dd0406ea031a69f495eae0ce64fb9b43ee2e74c63198fbdf96c92d4f12261c2fdb11d30d86fdf784c15b407d35ef9e353ebd9594b06b01b
7
- data.tar.gz: 5f11251ee2a9fe79664906e961aa6647f6376f689a4dd031054424ad8cd49376c1a3124a53ca8b36d5722f8edba928cd34f910477a695eb5d56ec1280adb54b1
6
+ metadata.gz: e194b3bf7685f28616d9c27a39d70d02f7733c2bbf1696c1a0062e26d0a861aab5f4cbe44ee39fc540daba03ddb5ed5cdd7b2654b84027b4e7f5b583995041ed
7
+ data.tar.gz: 54334da7bc1a4b608e842781885c09b3da5545658de1634c24ae102a494ffce9c77801552ab9cf2f44f80ed8c34ef817e016b86353e2139b59711834ce824bd8
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
data/README.md CHANGED
@@ -1,18 +1,20 @@
1
- # Faker::Game
1
+ # faker-game
2
2
 
3
- ## Game Franchise Name
3
+ ## Faker::Game
4
+
5
+ ### Game Franchise Name
4
6
 
5
7
  ```ruby
6
8
  Faker::Game.franchise # => "Titan Battler"
7
9
  ```
8
10
 
9
- ## Game Ability Measurement
11
+ ### Game Ability Measurement
10
12
 
11
13
  ```ruby
12
14
  Faker::Game.ability_measurement # => "Mana"
13
15
  ```
14
16
 
15
- ## Game Currency
17
+ ### Game Currency
16
18
 
17
19
  Generates the singular form of an in-game currency.
18
20
 
@@ -20,19 +22,19 @@ Generates the singular form of an in-game currency.
20
22
  Faker::Game.currency # => "Gem"
21
23
  ```
22
24
 
23
- ## Hero
25
+ ### Hero
24
26
 
25
27
  ```ruby
26
28
  Faker::Game.hero # => "Knight"
27
29
  ```
28
30
 
29
- ## Enemy
31
+ ### Enemy
30
32
 
31
33
  ```ruby
32
34
  Faker::Game.enemy # => "Ghoul"
33
35
  ```
34
36
 
35
- ## Complex Game Name Prefix
37
+ ### Complex Game Name Prefix
36
38
 
37
39
  Includes the name of a fictitious game creator.
38
40
 
@@ -40,13 +42,13 @@ Includes the name of a fictitious game creator.
40
42
  Faker::Game.prefix # => "Ryley Lang's Witch Fighter"
41
43
  ```
42
44
 
43
- ## Game Subtitle
45
+ ### Game Subtitle
44
46
 
45
47
  ```ruby
46
48
  Faker::Game.subtitle # => "Silver Titans"
47
49
  ```
48
50
 
49
- ## Game Name
51
+ ### Game Name
50
52
 
51
53
  Generates a full game name, sometimes with a franchise title.
52
54
 
@@ -54,7 +56,7 @@ Generates a full game name, sometimes with a franchise title.
54
56
  Faker::Game.name # => "Ghoul Killer IV"
55
57
  ```
56
58
 
57
- ## Game Name with Franchise
59
+ ### Game Name with Franchise
58
60
 
59
61
  Forces a franchise prefix.
60
62
 
@@ -62,6 +64,56 @@ Forces a franchise prefix.
62
64
  Faker::Game.name_with_franchise # => "Aida Bahringer's Insurgent Hunter 4: Iron Tangos"
63
65
  ```
64
66
 
67
+ ## Faker::Game::Place
68
+
69
+ ### Place
70
+
71
+ Generates an RPGesque name for a fictional region.
72
+
73
+ ```ruby
74
+ Faker::Game::Place.name # => "The Snowy Caves"
75
+ ```
76
+
77
+ ## Faker::Game::Character
78
+
79
+ These are all RPG/fantasy-style.
80
+
81
+ ### Name
82
+
83
+ ```ruby
84
+ Faker::Game::Character.name # => "Byrlad Smithearthgrad"
85
+ ```
86
+
87
+ ### Name with Title
88
+
89
+ Chance of either a neutral, evil, or good title.
90
+
91
+ ```ruby
92
+ Faker::Game::Character.name_with_title # => "Byrwren Tyrwindearthborn, the Guard of Winterrealm"
93
+ ```
94
+
95
+ ## Faker::Game::CharacterTitle
96
+
97
+ Poke around the source for all sorts of helpers for generating these.
98
+
99
+ ## Good
100
+
101
+ ```ruby
102
+ Faker::Game::CharacterTitle.good # => "the light-bringer"
103
+ ```
104
+
105
+ ## Evil
106
+
107
+ ```ruby
108
+ Faker::Game::CharacterTitle.evil # => "horrible flesh mutilator"
109
+ ```
110
+
111
+ ## Neutral
112
+
113
+ ```ruby
114
+ Faker::Game::CharacterTitle.neutral # => "hunter of hinterland"
115
+ ```
116
+
65
117
  ## Contributing
66
118
 
67
119
  Bug reports and pull requests are welcome on GitHub at https://github.com/chrisb/faker-game.
@@ -1,4 +1,7 @@
1
1
  require 'faker'
2
+ require 'faker/game/character_title'
3
+ require 'faker/game/place'
4
+ require 'faker/game/character'
2
5
 
3
6
  module Faker
4
7
  module Game
@@ -12,15 +15,7 @@ module Faker
12
15
  end
13
16
 
14
17
  def currency
15
- %w(Credit Point Gem Orb)
16
- end
17
-
18
- def adjective
19
- %w(Gold Golden Bloodied Bloody Mighty Powerful Damaged Dark Black Silver Iron).sample
20
- end
21
-
22
- def noun
23
- %w(Power War Heart Darkness Soul Lost).sample
18
+ %w(Credit Point Gem Orb).sample
24
19
  end
25
20
 
26
21
  def hero
@@ -35,36 +30,46 @@ module Faker
35
30
  %w(Ghost Titan Banshee Witch Insurgent Thief Ghoul Monster Tango Terrorist).sample
36
31
  end
37
32
 
38
- def suffix
39
- (%w(II III IV V VI X SE HD Remastered 2 3 4) << nil).sample
40
- end
41
-
42
33
  def prefix
43
34
  "#{creator}'s #{franchise}"
44
35
  end
45
36
 
46
37
  def subtitle
47
- [ "The #{verb_noun} of #{enemy.pluralize}",
48
- "#{adjective} #{enemy.pluralize}",
49
- "#{adjective} #{hero}" ].sample
38
+ ["The #{verb_noun} of #{enemy.pluralize}",
39
+ "#{adjective} #{enemy.pluralize}",
40
+ "#{adjective} #{hero}"].sample
50
41
  end
51
42
 
52
43
  def name
53
- [ "The #{verb_noun} of #{enemy.pluralize}",
54
- "#{franchise} #{suffix}".strip,
55
- "#{enemy} #{verb_noun}",
56
- "#{adjective} #{hero}",
57
- franchise,
58
- "#{prefix}", nil ].sample || name_with_franchise
44
+ ["The #{verb_noun} of #{enemy.pluralize}",
45
+ "#{franchise} #{suffix}".strip,
46
+ "#{enemy} #{verb_noun}",
47
+ "#{adjective} #{hero}",
48
+ franchise,
49
+ "#{prefix}", nil].sample || name_with_franchise
59
50
  end
60
51
 
61
52
  def name_with_franchise
62
53
  "#{creator}'s #{franchise} #{suffix}: #{subtitle}".squish
63
54
  end
64
55
 
56
+ private
57
+
65
58
  def creator
66
59
  "#{Faker::Name.first_name} #{Faker::Name.last_name}"
67
60
  end
61
+
62
+ def adjective
63
+ %w(Gold Golden Bloodied Bloody Mighty Powerful Damaged Dark Black Silver Iron).sample
64
+ end
65
+
66
+ def noun
67
+ %w(Power War Heart Darkness Soul Lost).sample
68
+ end
69
+
70
+ def suffix
71
+ (%w(II III IV V VI X SE HD Remastered 2 3 4) << nil).sample
72
+ end
68
73
  end
69
74
  end
70
75
  end
@@ -0,0 +1,47 @@
1
+ module Faker
2
+ module Game
3
+ module Character
4
+ NEUTRAL_PREFIXES = %w(byr dy mi beo tyr)
5
+ NEUTRAL_POSTFIXES = %w(dren bor dun mar del lad ar gren grad gard born bar bel wren rend mel dar den ful ren)
6
+ NEUTRAL_ANIMALS = %w(wolf dragon bear beast)
7
+ NEUTRAL_NATURE = %w(cliff storm wind sand earth)
8
+ NEUTRAL_NOUNS = CharacterTitle::NEUTRAL_PROFESSIONS + NEUTRAL_NATURE + NEUTRAL_ANIMALS
9
+
10
+ class << self
11
+ def first_name
12
+ (NEUTRAL_PREFIXES.sample + NEUTRAL_POSTFIXES.sample)
13
+ end
14
+
15
+ def name
16
+ "#{first_name} #{surname}".titleize
17
+ end
18
+
19
+ def object
20
+ NEUTRAL_NOUNS.sample + (NEUTRAL_NOUNS + [nil]).sample.to_s
21
+ end
22
+
23
+ def prefix
24
+ (NEUTRAL_PREFIXES + [nil]).sample.to_s
25
+ end
26
+
27
+ def surname
28
+ (prefix + object + NEUTRAL_POSTFIXES.sample)
29
+ end
30
+
31
+ def name_with_title
32
+ "#{name}#{separator}#{CharacterTitle.send %w(evil neutral good).sample}"
33
+ end
34
+
35
+ private
36
+
37
+ def word_separator
38
+ ['', '-', ' '].sample
39
+ end
40
+
41
+ def separator(include_none = false)
42
+ [', ', ' - ', ': '].concat(include_none ? [''] : []).sample
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,89 @@
1
+ module Faker
2
+ module Game
3
+ module CharacterTitle
4
+ EVIL_BODY_PARTS_SINGULAR = %w(anus blood flesh skin fat death eye sight)
5
+ EVIL_BODY_PARTS = %w(intestine colon gonad skull leg arm body head gut beast heart liver)
6
+ EVIL_VIOLENT_VERBS_AS_NOUNS = %w(vommitter cooker roaster punisher mutilator 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)
7
+ EVIL_ADJECTIVES = %w(evil dark rotting putrid forgotten terrible horrible nasty sickening putrifying banished outlawed)
8
+ EVIL_NOUNS = %w(scourage terror horror ghoul ghost beast outlaw criminal demon)
9
+ GOOD_NOUNS = %w(light wonder prosperity goodness truth)
10
+ GOOD_VERBS_AS_NOUNS = %w(bringer restorer bearer guardian savior protector)
11
+ GOOD_ANTI_VERBS_AS_NOUNS = %w(vanquisher slayer destroyer cleanser healer remover)
12
+ NEUTRAL_PROFESSIONS = %w(guard hunter smith bard fletcher)
13
+ NEUTRAL_ADJECTIVES = %w(stalwart honest faithful haggard tireless)
14
+
15
+ class << self
16
+ def evil_proper
17
+ "the #{evil_base}"
18
+ end
19
+
20
+ def evil_with_qualifier
21
+ "#{send %w(evil_base evil_proper).sample}, #{evil_qualifier}"
22
+ end
23
+
24
+ def evil
25
+ send %w(evil_base evil_proper evil_with_qualifier).sample
26
+ end
27
+
28
+ def neutral_proper
29
+ "the #{neutral_base}"
30
+ end
31
+
32
+ def neutral_with_adjective
33
+ "#{send %w(neutral_base neutral_proper).sample} #{NEUTRAL_ADJECTIVES.sample}"
34
+ end
35
+
36
+ def neutral
37
+ send %w(neutral_base neutral_proper neutral_with_adjective).sample
38
+ end
39
+
40
+ def good_with_qualifier
41
+ "#{good_base} #{good_qualifier}"
42
+ end
43
+
44
+ def good_proper
45
+ "the #{good_base}"
46
+ end
47
+
48
+ def good
49
+ send %w(good_base good_proper good_with_qualifier).sample
50
+ end
51
+
52
+ private
53
+
54
+ def evil_base
55
+ "#{(EVIL_ADJECTIVES + [nil]).sample} #{evil_descriptor}"
56
+ end
57
+
58
+ def neutral_base
59
+ "#{NEUTRAL_PROFESSIONS.sample} of #{Place.name}"
60
+ end
61
+
62
+ def evil_qualifier
63
+ "#{['the ', nil].sample}#{EVIL_NOUNS.sample} of #{Place.name}"
64
+ end
65
+
66
+ def good_qualifier
67
+ "#{['the ', nil].sample}#{GOOD_ANTI_VERBS_AS_NOUNS.sample} of #{EVIL_NOUNS.sample.pluralize}"
68
+ end
69
+
70
+ def good_base
71
+ "#{GOOD_NOUNS.sample}#{['-', nil].sample}#{GOOD_VERBS_AS_NOUNS.sample}"
72
+ end
73
+
74
+ def evil_descriptor
75
+ body_part = (EVIL_BODY_PARTS_SINGULAR + EVIL_BODY_PARTS).sample
76
+ singular = EVIL_BODY_PARTS_SINGULAR.include? body_part
77
+
78
+ !singular && rand(2) == 1 ?
79
+ "#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample} of #{body_part.pluralize}" :
80
+ "#{body_part}#{word_separator}#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample}"
81
+ end
82
+
83
+ def word_separator
84
+ ['', '-', ' '].sample
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,35 @@
1
+ module Faker
2
+ module Game
3
+ module Place
4
+ class << self
5
+ ADJECTIVES = %w(northern southern western eastern cold wintery snowy rugged dark crimson red bloody haunted)
6
+ MODIFIERS = %w(world land realm)
7
+ PLACES = %w(winter plains south east north west caves caverns towers)
8
+ PLACES_NEEDING_MODIFIER = %w(under over hinter grass water wet)
9
+
10
+ def name
11
+ [name_with_modifier,
12
+ name_with_adjective,
13
+ simple_name,
14
+ proper_name].sample
15
+ end
16
+
17
+ def name_with_modifier
18
+ PLACES_NEEDING_MODIFIER.sample + MODIFIERS.sample
19
+ end
20
+
21
+ def name_with_adjective
22
+ "#{ADJECTIVES.sample} #{simple_name}"
23
+ end
24
+
25
+ def simple_name
26
+ PLACES.sample
27
+ end
28
+
29
+ def proper_name
30
+ "the #{[name_with_modifier, name_with_adjective, simple_name].sample}".titleize
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,5 +1,5 @@
1
1
  module Faker
2
2
  module Game
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker-game
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Bielinski
@@ -69,6 +69,9 @@ files:
69
69
  - bin/setup
70
70
  - faker-game.gemspec
71
71
  - lib/faker/game.rb
72
+ - lib/faker/game/character.rb
73
+ - lib/faker/game/character_title.rb
74
+ - lib/faker/game/place.rb
72
75
  - lib/faker/game/version.rb
73
76
  homepage: https://github.com/chrisb/faker-game
74
77
  licenses: