faker-game 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -0
- data/faker-game.gemspec +1 -0
- data/lib/faker/game.rb +3 -1
- data/lib/faker/game/achievement.rb +44 -0
- data/lib/faker/game/character_title.rb +34 -34
- data/lib/faker/game/place.rb +2 -5
- data/lib/faker/game/version.rb +1 -1
- metadata +22 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77993ffdbad7cc29f0397753e6b3356a57c48c26
|
4
|
+
data.tar.gz: 510e7e1ea39ee13cc666d2b10969e53168882ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e04420ef7893b7b8f3f136dd27ef31ad5745b35b908059b4249ca430edc08987063a3984a8dcabf631033270f657e6ec02f7488f4775f11e6945764dcf08450
|
7
|
+
data.tar.gz: 82ff92c5e4893849166ab70cf24082dc61f18d63f05e58df0eaaedf626c5d42c4df56fb2131c4b8e3e6adb588bc1b4e48c3ebc0a0ea45ac13598a0a1434ff52d
|
data/README.md
CHANGED
@@ -92,6 +92,40 @@ Chance of either a neutral, evil, or good title.
|
|
92
92
|
Faker::Game::Character.name_with_title # => "Byrwren Tyrwindearthborn, the Guard of Winterrealm"
|
93
93
|
```
|
94
94
|
|
95
|
+
## Faker::Game::Achivement
|
96
|
+
|
97
|
+
### Name
|
98
|
+
|
99
|
+
Selects one of the following achievement names at random.
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
Faker::Game::Achievement.name # => "Gather 170 Orbs"
|
103
|
+
```
|
104
|
+
|
105
|
+
### Assassination Achievement
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
Faker::Game::Achievement.assassination # => "Kill The Dark Wrencher Of Beasts"
|
109
|
+
```
|
110
|
+
|
111
|
+
### Earn X Things
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
Faker::Game::Achievement.earn # => "Find 1070 Gems"
|
115
|
+
```
|
116
|
+
|
117
|
+
### Discover a Place
|
118
|
+
|
119
|
+
```ruby
|
120
|
+
Faker::Game::Achievement.discover # => "Discover The Icy South"
|
121
|
+
```
|
122
|
+
|
123
|
+
### Kill X Enemies
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
Faker::Game::Achievement.kill_enemies # => "Kill 240 Insurgents"
|
127
|
+
```
|
128
|
+
|
95
129
|
## Faker::Game::CharacterTitle
|
96
130
|
|
97
131
|
Poke around the source for all sorts of helpers for generating these.
|
data/faker-game.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
spec.add_dependency 'faker', '~> 1'
|
20
|
+
spec.add_dependency 'activesupport', '>= 4.1.0', '< 5.1'
|
20
21
|
spec.add_development_dependency "bundler", "~> 1.11"
|
21
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
23
|
end
|
data/lib/faker/game.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'faker'
|
2
|
+
require 'active_support/core_ext/string/inflections'
|
2
3
|
require 'faker/game/character_title'
|
3
4
|
require 'faker/game/place'
|
4
5
|
require 'faker/game/character'
|
6
|
+
require 'faker/game/achievement'
|
5
7
|
|
6
8
|
module Faker
|
7
9
|
module Game
|
@@ -15,7 +17,7 @@ module Faker
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def currency
|
18
|
-
%w(Credit Point Gem Orb).sample
|
20
|
+
%w(Credit Point Gem Orb Coin).sample
|
19
21
|
end
|
20
22
|
|
21
23
|
def hero
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Faker
|
2
|
+
module Game
|
3
|
+
module Achievement
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def assassination_verb
|
7
|
+
%w(Kill Assassinate Beat Destroy Overcome Vanqiush).sample
|
8
|
+
end
|
9
|
+
|
10
|
+
def assassination
|
11
|
+
"#{assassination_verb} #{CharacterTitle.evil_proper}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def earn_verb
|
15
|
+
%w(Earn Discover Harvest Gather).sample
|
16
|
+
end
|
17
|
+
|
18
|
+
def earn
|
19
|
+
"#{earn_verb} #{rand(200) * 10} #{Faker::Game.currency.pluralize}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def discover_verb
|
23
|
+
%w(Discover Find Uncover Reach).sample
|
24
|
+
end
|
25
|
+
|
26
|
+
def discover
|
27
|
+
"#{discover_verb} #{Place.name}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def kill_verb
|
31
|
+
%w(Kill).sample
|
32
|
+
end
|
33
|
+
|
34
|
+
def kill_enemies
|
35
|
+
"#{kill_verb} #{rand(200) * 10} #{Faker::Game.enemy.pluralize}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def name
|
39
|
+
send %w(assassination earn discover kill_enemies).sample
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -13,54 +13,63 @@ module Faker
|
|
13
13
|
NEUTRAL_ADJECTIVES = %w(stalwart honest faithful haggard tireless)
|
14
14
|
|
15
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
16
|
def evil
|
25
17
|
send %w(evil_base evil_proper evil_with_qualifier).sample
|
26
18
|
end
|
27
19
|
|
28
|
-
def
|
29
|
-
|
20
|
+
def neutral
|
21
|
+
send %w(neutral_base neutral_proper neutral_with_adjective).sample
|
30
22
|
end
|
31
23
|
|
32
|
-
def
|
33
|
-
|
24
|
+
def good
|
25
|
+
send %w(good_base good_proper good_with_qualifier).sample
|
34
26
|
end
|
35
27
|
|
36
|
-
def
|
37
|
-
|
28
|
+
def evil_proper
|
29
|
+
"the #{evil_base}".titleize
|
38
30
|
end
|
31
|
+
|
32
|
+
private
|
39
33
|
|
40
|
-
def
|
41
|
-
"#{
|
34
|
+
def evil_base
|
35
|
+
"#{(EVIL_ADJECTIVES + [nil]).sample} #{evil_descriptor}".titleize
|
42
36
|
end
|
43
37
|
|
44
|
-
def
|
45
|
-
"
|
38
|
+
def evil_with_qualifier
|
39
|
+
"#{send %w(evil_base evil_proper).sample}, #{evil_qualifier}".titleize
|
46
40
|
end
|
47
41
|
|
48
|
-
def
|
49
|
-
|
42
|
+
def evil_qualifier
|
43
|
+
"#{['the ', nil].sample}#{EVIL_NOUNS.sample} of #{Place.name}"
|
50
44
|
end
|
51
45
|
|
52
|
-
|
46
|
+
def evil_descriptor
|
47
|
+
body_part = (EVIL_BODY_PARTS_SINGULAR + EVIL_BODY_PARTS).sample
|
48
|
+
singular = EVIL_BODY_PARTS_SINGULAR.include? body_part
|
53
49
|
|
54
|
-
|
55
|
-
|
50
|
+
!singular && rand(2) == 1 ?
|
51
|
+
"#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample} of #{body_part.pluralize}" :
|
52
|
+
"#{body_part}#{word_separator}#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample}"
|
56
53
|
end
|
57
54
|
|
58
55
|
def neutral_base
|
59
56
|
"#{NEUTRAL_PROFESSIONS.sample} of #{Place.name}"
|
60
57
|
end
|
61
58
|
|
62
|
-
def
|
63
|
-
"
|
59
|
+
def neutral_proper
|
60
|
+
"the #{neutral_base}".titleize
|
61
|
+
end
|
62
|
+
|
63
|
+
def neutral_with_adjective
|
64
|
+
"#{send %w(neutral_base neutral_proper).sample} #{NEUTRAL_ADJECTIVES.sample}".titleize
|
65
|
+
end
|
66
|
+
|
67
|
+
def good_with_qualifier
|
68
|
+
"#{good_base} #{good_qualifier}".titleize
|
69
|
+
end
|
70
|
+
|
71
|
+
def good_proper
|
72
|
+
"the #{good_base}".titleize
|
64
73
|
end
|
65
74
|
|
66
75
|
def good_qualifier
|
@@ -71,15 +80,6 @@ module Faker
|
|
71
80
|
"#{GOOD_NOUNS.sample}#{['-', nil].sample}#{GOOD_VERBS_AS_NOUNS.sample}"
|
72
81
|
end
|
73
82
|
|
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
83
|
def word_separator
|
84
84
|
['', '-', ' '].sample
|
85
85
|
end
|
data/lib/faker/game/place.rb
CHANGED
@@ -2,16 +2,13 @@ module Faker
|
|
2
2
|
module Game
|
3
3
|
module Place
|
4
4
|
class << self
|
5
|
-
ADJECTIVES = %w(northern southern western eastern cold wintery snowy rugged dark crimson red bloody haunted)
|
5
|
+
ADJECTIVES = %w(northern southern western eastern cold wintery snowy rugged dark crimson icy red bloody haunted)
|
6
6
|
MODIFIERS = %w(world land realm)
|
7
7
|
PLACES = %w(winter plains south east north west caves caverns towers)
|
8
8
|
PLACES_NEEDING_MODIFIER = %w(under over hinter grass water wet)
|
9
9
|
|
10
10
|
def name
|
11
|
-
|
12
|
-
name_with_adjective,
|
13
|
-
simple_name,
|
14
|
-
proper_name].sample
|
11
|
+
send(%w(name_with_modifier name_with_adjective simple_name proper_name).sample).titleize
|
15
12
|
end
|
16
13
|
|
17
14
|
def name_with_modifier
|
data/lib/faker/game/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Bielinski
|
@@ -24,6 +24,26 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.1.0
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '5.1'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 4.1.0
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.1'
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: bundler
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,6 +89,7 @@ files:
|
|
69
89
|
- bin/setup
|
70
90
|
- faker-game.gemspec
|
71
91
|
- lib/faker/game.rb
|
92
|
+
- lib/faker/game/achievement.rb
|
72
93
|
- lib/faker/game/character.rb
|
73
94
|
- lib/faker/game/character_title.rb
|
74
95
|
- lib/faker/game/place.rb
|