medieval 0.3.8 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/medieval/attributes.rb +38 -0
- data/lib/medieval/battalion.rb +6 -26
- data/lib/medieval/realm.rb +10 -7
- data/lib/medieval/soldier.rb +11 -9
- data/medieval.gemspec +11 -2
- data/rdoc/classes/Medieval/Battalion.html +282 -0
- data/rdoc/classes/Medieval/Realm.html +220 -0
- data/rdoc/classes/Medieval/Soldier.html +281 -0
- data/rdoc/files/lib/extras/array_rb.html +101 -0
- data/rdoc/files/lib/medieval/battalion_rb.html +110 -0
- data/rdoc/files/lib/medieval/realm_rb.html +101 -0
- data/rdoc/files/lib/medieval/soldier_rb.html +101 -0
- data/rdoc/files/lib/medieval_rb.html +111 -0
- metadata +14 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_support/inflector'
|
3
|
+
require 'active_support/core_ext/integer/inflections'
|
4
|
+
|
5
|
+
module Medieval
|
6
|
+
module Attributes
|
7
|
+
|
8
|
+
protected
|
9
|
+
def creature_name
|
10
|
+
%w(Dragon Cyclop Wyvern Stud Dwarf Aardvark Buffalo Ant Anteater Antelope Ape Armadillo Donkey Baboon Badger Bat Bear Beaver Bee Bison Boar Bush Butterfly Camel Cat Cattle Chamois Cheetah Chicken Chimpanzee Cobra Cockroach Cormorant Coyote Crab Crane Crocodile Crow Deer Dog Dogfish Dolphin Dove Dragonfly Duck Dugong Eagle Echidna Eel Eland Elephant Elk Falcon Ferret Finch Fly Fox Frog Gaur Gazelle Gerbil Giant Panda Giraffe Gnu Goat Goose Gorilla Guanaco Guinea Gull Hamster Hare Hawk Hedgehog Heron Hippopotamus Hornet Horse Hyena Jackal Jaguar Jellyfish Kangaroo Komodo Kouprey Kudu Lark Lemur Leopard Lion Llama Loris Louse Lobster Lyrebird Magpie Mallard Manatee Meerkat Mink Mole Monkey Moose Mouse Mosquito Mule Nightingale Okapi Oryx Ostrich Otter Owl Ox Oyster Panther Partridge Peafowl Pelican Pig Pigeon Pony Porcupine Quelea Rabbit Raccoon Rail Ram Rat Raven RedDeer RedPanda Reindeer Rhinoceros Salamander Sealion Seal Seastar Shark Sheep Shrew Skunk Snail Snake Spider Squid Squirrel Swan Tapir Tarsier Tiger Toad Turkey Turtle Vicuna Walrus Wasp WaterBuffalo Weasel Whale Wolf Worm Yak Zebra).rand
|
11
|
+
end
|
12
|
+
|
13
|
+
def name_of_order
|
14
|
+
rand(100).ordinalize
|
15
|
+
end
|
16
|
+
|
17
|
+
def formation_name
|
18
|
+
%w(Battalion Legion Brigade Rank Pack Regiment Squadron Swarm Squad Division).rand
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def ability
|
23
|
+
["Agreeable", "Amused", "Brave", "Calm", "Charming", "Cheerful", "Comfortable", "Cooperative", "Courageous", "Crazy" "Delightful", "Determined", "Eager", "Elated", "Enchanting", "Encouraging", "Energetic", "Enthusiastic", "Excited", "Exuberant", "Fair", "Faithful", "Fantastic", "Fast", "Fine", "Friendly", "Funny", "Gentle", "Glorious", "Good", "Great" "Happy", "Healthy", "Helpful", "Hilarious", "Jolly", "Joyous", "Kind", "Lively", "Lovely", "Lucky", "Nice", "Obedient", "Perfect", "Pleasant", "Poor", "Proud", "Relieved", "Silly", "Smiling", "Splendid", "Successful", "Thankful", "Thoughtful", "Victorious", "Vivacious", "Witty", "Wonderful", "Zealous", "Zany", "Glamorous", "Gleaming", "Gorgeous", "Graceful", "Grotesque", "Handsome", "Homely", "Light", "Long", "Magnificent", "Misty", "Motionless", "Muddy", "Old-fashioned", "Plain", "Poised", "Precious", "Quaint", "Shiny", "Smoggy", "Sparkling", "Spotless", "Stormy", "Strange", "Ugly", "Ugliest", "Unsightly", "Unusual", "Wide-eyed", "Adorable", "Adventurous", "Aggressive", "Alert", "Attractive", "Average", "Beautiful", "Blue-eyed", "Bloody", "Blushing", "Bright", "Clean", "Clear", "Cloudy", "Colorful", "Crowded", "Cute", "Dark", "Drab", "Distinct", "Dull", "Elegant", "Excited", "Fancy", "Filthy", "Big", "Colossal", "Fat", "Gigantic", "Great", "Huge", "Immense", "Large", "Little", "Mammoth", "Massive", "Miniature", "Petite", "Puny", "Scrawny", "Short", "Small", "Tall", "Teeny", "Teeny-tiny", "Tinybroad", "Chubby", "Crooked", "Curved", "Deep", "Flat", "High", "Hollow", "Low", "Narrow", "Round", "Shallow", "Skinny", "Square", "Steep", "Straight", "Wide"].rand
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def colour
|
28
|
+
%w( White Yellow Red Green Blue Black Orange Purple).rand
|
29
|
+
end
|
30
|
+
|
31
|
+
def bravery_title
|
32
|
+
['the Brave' , 'the Great', 'the Dragon' , 'the Paesant' , 'the Saviour' , 'the Fraud' , 'be Moody', 'the Knight', 'the Archer' , 'the Soldier' , 'the Poor' , 'the Ambitious' , 'the Artist', 'the Cinic', 'The Enthusiast' , 'the Humble' , 'the Rude', 'the Lion Hearted' ].rand
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
data/lib/medieval/battalion.rb
CHANGED
@@ -1,39 +1,20 @@
|
|
1
|
-
require '
|
2
|
-
require 'active_support/inflector'
|
3
|
-
require 'active_support/core_ext/integer/inflections'
|
1
|
+
require 'medieval/attributes'
|
4
2
|
|
5
3
|
module Medieval
|
6
4
|
class Battalion
|
5
|
+
extend Attributes
|
7
6
|
class << self
|
8
7
|
def name
|
9
8
|
FORMATS.rand.call.join(' ')
|
10
9
|
end
|
11
10
|
|
11
|
+
|
12
12
|
protected
|
13
|
+
|
13
14
|
def creature_name
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def name_of_order
|
18
|
-
rand(100).ordinalize
|
19
|
-
end
|
20
|
-
|
21
|
-
def formation_name
|
22
|
-
%w(Battalion Legion Brigade Rank Pack Regiment Squadron Swarm Squad Division).rand
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
def ability
|
27
|
-
["Agreeable", "Amused", "Brave", "Calm", "Charming", "Cheerful", "Comfortable", "Cooperative", "Courageous", "Crazy" "Delightful", "Determined", "Eager", "Elated", "Enchanting", "Encouraging", "Energetic", "Enthusiastic", "Excited", "Exuberant", "Fair", "Faithful", "Fantastic", "Fast", "Fine", "Friendly", "Funny", "Gentle", "Glorious", "Good", "Great" "Happy", "Healthy", "Helpful", "Hilarious", "Jolly", "Joyous", "Kind", "Lively", "Lovely", "Lucky", "Nice", "Obedient", "Perfect", "Pleasant", "Poor", "Proud", "Relieved", "Silly", "Smiling", "Splendid", "Successful", "Thankful", "Thoughtful", "Victorious", "Vivacious", "Witty", "Wonderful", "Zealous", "Zany", "Glamorous", "Gleaming", "Gorgeous", "Graceful", "Grotesque", "Handsome", "Homely", "Light", "Long", "Magnificent", "Misty", "Motionless", "Muddy", "Old-fashioned", "Plain", "Poised", "Precious", "Quaint", "Shiny", "Smoggy", "Sparkling", "Spotless", "Stormy", "Strange", "Ugly", "Ugliest", "Unsightly", "Unusual", "Wide-eyed", "Adorable", "Adventurous", "Aggressive", "Alert", "Attractive", "Average", "Beautiful", "Blue-eyed", "Bloody", "Blushing", "Bright", "Clean", "Clear", "Cloudy", "Colorful", "Crowded", "Cute", "Dark", "Drab", "Distinct", "Dull", "Elegant", "Excited", "Fancy", "Filthy", "Big", "Colossal", "Fat", "Gigantic", "Great", "Huge", "Immense", "Large", "Little", "Mammoth", "Massive", "Miniature", "Petite", "Puny", "Scrawny", "Short", "Small", "Tall", "Teeny", "Teeny-tiny", "Tinybroad", "Chubby", "Crooked", "Curved", "Deep", "Flat", "High", "Hollow", "Low", "Narrow", "Round", "Shallow", "Skinny", "Square", "Steep", "Straight", "Wide"].rand
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
def colour
|
32
|
-
%w( White Yellow Red Green Blue Black Orange Purple).rand
|
15
|
+
super.pluralize
|
33
16
|
end
|
34
17
|
|
35
|
-
|
36
|
-
|
37
18
|
end
|
38
19
|
|
39
20
|
FORMATS = [
|
@@ -45,8 +26,7 @@ protected
|
|
45
26
|
Proc.new { ["The", colour, creature_name]},
|
46
27
|
Proc.new { ["The", ability , creature_name]}
|
47
28
|
]
|
48
|
-
|
49
|
-
|
29
|
+
|
50
30
|
end
|
51
31
|
end
|
52
32
|
|
data/lib/medieval/realm.rb
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
module Medieval
|
2
|
-
|
3
2
|
class Realm
|
3
|
+
extend Attributes
|
4
4
|
class << self
|
5
5
|
def name
|
6
|
-
|
6
|
+
FORMATS.rand.call.join('')
|
7
7
|
end
|
8
8
|
|
9
9
|
protected
|
10
|
-
|
11
|
-
%w(Dragon Cyclop Wyvern Stud Dwarf Aardvark Buffalo Ant Anteater Antelope Ape Armadillo Donkey Baboon Badger Bat Bear Beaver Bee Bison Boar Bush Butterfly Camel Cat Cattle Chamois Cheetah Chicken Chimpanzee Cobra Cockroach Cormorant Coyote Crab Crane Crocodile Crow Deer Dog Dogfish Dolphin Dove Dragonfly Duck Dugong Eagle Echidna Eel Eland Elephant Elk Falcon Ferret Finch Fly Fox Frog Gaur Gazelle Gerbil Giant Panda Giraffe Gnu Goat Goose Gorilla Guanaco Guinea Gull Hamster Hare Hawk Hedgehog Heron Hippopotamus Hornet Horse Hyena Jackal Jaguar Jellyfish Kangaroo Komodo Kouprey Kudu Lark Lemur Leopard Lion Llama Loris Louse Lobster Lyrebird Magpie Mallard Manatee Meerkat Mink Mole Monkey Moose Mouse Mosquito Mule Nightingale Okapi Oryx Ostrich Otter Owl Ox Oyster Panther Partridge Peafowl Pelican Pig Pigeon Pony Porcupine Quelea Rabbit Raccoon Rail Ram Rat Raven RedDeer RedPanda Reindeer Rhinoceros Salamander Sealion Seal Seastar Shark Sheep Shrew Skunk Snail Snake Spider Squid Squirrel Swan Tapir Tarsier Tiger Toad Turkey Turtle Vicuna Walrus Wasp WaterBuffalo Weasel Whale Wolf Worm Yak Zebra).rand.slice(0..-(rand(2)+1))
|
12
|
-
end
|
10
|
+
alias main_name creature_name
|
13
11
|
|
14
12
|
def suffix
|
15
13
|
%w(oin yar oyd aire atya uti aro yal iha).rand
|
16
14
|
end
|
17
15
|
|
18
16
|
def land_name
|
19
|
-
%w(
|
17
|
+
%w(Land County Shire Realm).rand
|
20
18
|
end
|
21
19
|
|
22
20
|
end
|
23
|
-
|
21
|
+
|
22
|
+
FORMATS = [
|
23
|
+
Proc.new {[ability, main_name, land_name]},
|
24
|
+
Proc.new {[main_name, land_name]}
|
25
|
+
]
|
26
|
+
end
|
24
27
|
|
25
28
|
end
|
data/lib/medieval/soldier.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require 'medieval/attributes'
|
2
|
+
|
1
3
|
module Medieval
|
2
4
|
class Soldier
|
3
|
-
|
5
|
+
extend Attributes
|
4
6
|
class << self
|
5
7
|
|
6
8
|
def name
|
@@ -15,15 +17,15 @@ protected
|
|
15
17
|
def last_name
|
16
18
|
%w(Abbott Abernathy Abshire Adams Altenwerth Anderson Ankunding Armstrong Auer Aufderhar Bahringer Bailey Balistreri Barrows Bartell Bartoletti Barton Bashirian Batz Bauch Baumbach Bayer Beahan Beatty Bechtelar Becker Bednar Beer Beier Berge Bergnaum Bergstrom Bernhard Bernier Bins Blanda Blick Block Bode Boehm Bogan Bogisich Borer Bosco Botsford Boyer Boyle Bradtke Brakus Braun Breitenberg Brekke Brown Bruen Buckridge Carroll Carter Cartwright Casper Cassin Champlin Christiansen Cole Collier Collins Conn Connelly Conroy Considine Corkery Cormier Corwin Cremin Crist Crona Cronin Crooks Cruickshank Cummerata Cummings Dach D'Amore Daniel Dare Daugherty Davis Deckow Denesik Dibbert Dickens Dicki Dickinson Dietrich Donnelly Dooley Douglas Doyle DuBuque Durgan Ebert Effertz Eichmann Emard Emmerich Erdman Ernser Fadel Fahey Farrell Fay Feeney Feest Feil Ferry Fisher Flatley Frami Franecki Friesen Fritsch Funk Gaylord Gerhold Gerlach Gibson Gislason Gleason Gleichner Glover Goldner Goodwin Gorczany Gottlieb Goyette Grady Graham Grant Green Greenfelder Greenholt Grimes Gulgowski Gusikowski Gutkowski Gutmann Haag Hackett Hagenes Hahn Haley Halvorson Hamill Hammes Hand Hane Hansen Harber Harris Hartmann Harvey Hauck Hayes Heaney Heathcote Hegmann Heidenreich Heller Herman Hermann Hermiston Herzog Hessel Hettinger Hickle Hilll Hills Hilpert Hintz Hirthe Hodkiewicz Hoeger Homenick Hoppe Howe Howell Hudson Huel Huels Hyatt Jacobi Jacobs Jacobson Jakubowski Jaskolski Jast Jenkins Jerde Jewess Johns Johnson Johnston Jones Kassulke Kautzer Keebler Keeling Kemmer Kerluke Kertzmann Kessler Kiehn Kihn Kilback King Kirlin Klein Kling Klocko Koch Koelpin Koepp Kohler Konopelski Koss Kovacek Kozey Krajcik Kreiger Kris Kshlerin Kub Kuhic Kuhlman Kuhn Kulas Kunde Kunze Kuphal Kutch Kuvalis Labadie Lakin Lang Langosh Langworth Larkin Larson Leannon Lebsack Ledner Leffler Legros Lehner Lemke Lesch Leuschke Lind Lindgren Littel Little Lockman Lowe Lubowitz Lueilwitz Luettgen Lynch Macejkovic Maggio Mann Mante Marks Marquardt Marvin Mayer Mayert McClure McCullough McDermott McGlynn McKenzie McLaughlin Medhurst Mertz Metz Miller Mills Mitchell Moen Mohr Monahan Moore Morar Morissette Mosciski Mraz Mueller Muller Murazik Murphy Murray Nader Nicolas Nienow Nikolaus Nitzsche Nolan Oberbrunner O'Connell O'Conner O'Hara O'Keefe O'Kon Okuneva Olson Ondricka O'Reilly Orn Ortiz Osinski Pacocha Padberg Pagac Parisian Parker Paucek Pfannerstill Pfeffer Pollich Pouros Powlowski Predovic Price Prohaska Prosacco Purdy Quigley Quitzon Rath Ratke Rau Raynor Reichel Reichert Reilly Reinger Rempel Renner Reynolds Rice Rippin Ritchie Robel Roberts Rodriguez Rogahn Rohan Rolfson Romaguera Roob Rosenbaum Rowe Ruecker Runolfsdottir Runolfsson Runte Russel Rutherford Ryan Sanford Satterfield Sauer Sawayn Schaden Schaefer Schamberger Schiller Schimmel Schinner Schmeler Schmidt Schmitt Schneider Schoen Schowalter Schroeder Schulist Schultz Schumm Schuppe Schuster Senger Shanahan Shields Simonis Sipes Skiles Smith Smitham Spencer Spinka Sporer Stamm Stanton Stark Stehr Steuber Stiedemann Stokes Stoltenberg Stracke Streich Stroman Strosin Swaniawski Swift Terry Thiel Thompson Tillman Torp Torphy Towne Toy Trantow Tremblay Treutel Tromp Turcotte Turner Ullrich Upton Vandervort Veum Volkman Von VonRueden Waelchi Walker Walsh Walter Ward Waters Watsica Weber Wehner Weimann Weissnat Welch West White Wiegand Wilderman Wilkinson Will Williamson Willms Windler Wintheiser Wisoky Wisozk Witting Wiza Wolf Wolff Wuckert Wunsch Wyman Yost Yundt Zboncak Zemlak Ziemann Zieme Zulauf).rand
|
17
19
|
end
|
18
|
-
|
19
|
-
def bravery_title
|
20
|
-
['the Brave' , 'the Great', 'the Dragon' , 'the Paesant' , 'el Salvatore' , 'the Fraud' , 'be Moody', 'the Knight', 'the Archer' , 'the Soldier' , 'the Poor' , 'the Ambitious' , 'el Artistico', 'el Cinico', 'el Entusiasta' , 'el Humilde' , 'el Maleducado', 'the Lion Hearted' ].rand
|
21
|
-
end
|
22
|
-
|
20
|
+
|
23
21
|
def origins_title
|
24
22
|
['von Muchensen' , 'of Glenshire', 'of Brandenburg', 'of Canterbury', 'of Warwick' ,"D'Agincourt"].rand
|
25
23
|
end
|
26
24
|
|
25
|
+
def nickname
|
26
|
+
"the " << [creature_name, ability, colour].rand
|
27
|
+
end
|
28
|
+
|
27
29
|
def suffix
|
28
30
|
%w(I II III IV V).rand
|
29
31
|
end
|
@@ -40,9 +42,9 @@ protected
|
|
40
42
|
Proc.new { [first_name, last_name, suffix, bravery_title] },
|
41
43
|
Proc.new { [first_name, last_name, bravery_title] },
|
42
44
|
Proc.new { [first_name, last_name, suffix] },
|
43
|
-
Proc.new { [first_name, last_name]},
|
44
|
-
Proc.new { [first_name, last_name]}
|
45
|
-
|
45
|
+
Proc.new { [first_name, nickname, last_name, origins_title]},
|
46
|
+
Proc.new { [first_name, nickname, last_name]},
|
47
|
+
Proc.new { [first_name, nickname, last_name, suffix]}
|
46
48
|
]
|
47
49
|
|
48
50
|
end
|
data/medieval.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{medieval}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["rdinca"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-01}
|
13
13
|
s.description = %q{This is a medieval names generator, inspired by faker gem. In the future it will be used for an medieval online strategy game.}
|
14
14
|
s.email = %q{radudinca@yahoo.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,10 +25,19 @@ Gem::Specification.new do |s|
|
|
25
25
|
"VERSION",
|
26
26
|
"lib/extras/array.rb",
|
27
27
|
"lib/medieval.rb",
|
28
|
+
"lib/medieval/attributes.rb",
|
28
29
|
"lib/medieval/battalion.rb",
|
29
30
|
"lib/medieval/realm.rb",
|
30
31
|
"lib/medieval/soldier.rb",
|
31
32
|
"medieval.gemspec",
|
33
|
+
"rdoc/classes/Medieval/Battalion.html",
|
34
|
+
"rdoc/classes/Medieval/Realm.html",
|
35
|
+
"rdoc/classes/Medieval/Soldier.html",
|
36
|
+
"rdoc/files/lib/extras/array_rb.html",
|
37
|
+
"rdoc/files/lib/medieval/battalion_rb.html",
|
38
|
+
"rdoc/files/lib/medieval/realm_rb.html",
|
39
|
+
"rdoc/files/lib/medieval/soldier_rb.html",
|
40
|
+
"rdoc/files/lib/medieval_rb.html",
|
32
41
|
"test/helper.rb",
|
33
42
|
"test/test_medieval.rb"
|
34
43
|
]
|
@@ -0,0 +1,282 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Medieval::Battalion</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Medieval::Battalion</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/medieval/battalion_rb.html">
|
59
|
+
lib/medieval/battalion.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000007">ability</a>
|
90
|
+
<a href="#M000008">colour</a>
|
91
|
+
<a href="#M000004">creature_name</a>
|
92
|
+
<a href="#M000006">formation_name</a>
|
93
|
+
<a href="#M000003">name</a>
|
94
|
+
<a href="#M000005">name_of_order</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
<div id="constants-list">
|
107
|
+
<h3 class="section-bar">Constants</h3>
|
108
|
+
|
109
|
+
<div class="name-list">
|
110
|
+
<table summary="Constants">
|
111
|
+
<tr class="top-aligned-row context-row">
|
112
|
+
<td class="context-item-name">FORMATS</td>
|
113
|
+
<td>=</td>
|
114
|
+
<td class="context-item-value">[ Proc.new { ["The", name_of_order, formation_name, "of", ability, colour, creature_name]}, Proc.new { ["The", name_of_order, formation_name, "of", ability, colour, creature_name]}, Proc.new { ["The", ability, colour, creature_name]}, Proc.new { ["The", name_of_order, formation_name, "of", ability, creature_name]}, Proc.new { ["The", name_of_order, formation_name, "of", colour, creature_name]}, Proc.new { ["The", colour, creature_name]}, Proc.new { ["The", ability , creature_name]}</td>
|
115
|
+
</tr>
|
116
|
+
</table>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<!-- if method_list -->
|
126
|
+
<div id="methods">
|
127
|
+
<h3 class="section-bar">Public Class methods</h3>
|
128
|
+
|
129
|
+
<div id="method-M000003" class="method-detail">
|
130
|
+
<a name="M000003"></a>
|
131
|
+
|
132
|
+
<div class="method-heading">
|
133
|
+
<a href="#M000003" class="method-signature">
|
134
|
+
<span class="method-name">name</span><span class="method-args">()</span>
|
135
|
+
</a>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="method-description">
|
139
|
+
<p><a class="source-toggle" href="#"
|
140
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
141
|
+
<div class="method-source-code" id="M000003-source">
|
142
|
+
<pre>
|
143
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 8</span>
|
144
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name</span>
|
145
|
+
<span class="ruby-constant">FORMATS</span>.<span class="ruby-identifier">rand</span>.<span class="ruby-identifier">call</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
|
146
|
+
<span class="ruby-keyword kw">end</span>
|
147
|
+
</pre>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<h3 class="section-bar">Protected Class methods</h3>
|
153
|
+
|
154
|
+
<div id="method-M000007" class="method-detail">
|
155
|
+
<a name="M000007"></a>
|
156
|
+
|
157
|
+
<div class="method-heading">
|
158
|
+
<a href="#M000007" class="method-signature">
|
159
|
+
<span class="method-name">ability</span><span class="method-args">()</span>
|
160
|
+
</a>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div class="method-description">
|
164
|
+
<p><a class="source-toggle" href="#"
|
165
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
166
|
+
<div class="method-source-code" id="M000007-source">
|
167
|
+
<pre>
|
168
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 26</span>
|
169
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ability</span>
|
170
|
+
[<span class="ruby-value str">"Agreeable"</span>, <span class="ruby-value str">"Amused"</span>, <span class="ruby-value str">"Brave"</span>, <span class="ruby-value str">"Calm"</span>, <span class="ruby-value str">"Charming"</span>, <span class="ruby-value str">"Cheerful"</span>, <span class="ruby-value str">"Comfortable"</span>, <span class="ruby-value str">"Cooperative"</span>, <span class="ruby-value str">"Courageous"</span>, <span class="ruby-value str">"Crazy"</span> <span class="ruby-value str">"Delightful"</span>, <span class="ruby-value str">"Determined"</span>, <span class="ruby-value str">"Eager"</span>, <span class="ruby-value str">"Elated"</span>, <span class="ruby-value str">"Enchanting"</span>, <span class="ruby-value str">"Encouraging"</span>, <span class="ruby-value str">"Energetic"</span>, <span class="ruby-value str">"Enthusiastic"</span>, <span class="ruby-value str">"Excited"</span>, <span class="ruby-value str">"Exuberant"</span>, <span class="ruby-value str">"Fair"</span>, <span class="ruby-value str">"Faithful"</span>, <span class="ruby-value str">"Fantastic"</span>, <span class="ruby-value str">"Fast"</span>, <span class="ruby-value str">"Fine"</span>, <span class="ruby-value str">"Friendly"</span>, <span class="ruby-value str">"Funny"</span>, <span class="ruby-value str">"Gentle"</span>, <span class="ruby-value str">"Glorious"</span>, <span class="ruby-value str">"Good"</span>, <span class="ruby-value str">"Great"</span> <span class="ruby-value str">"Happy"</span>, <span class="ruby-value str">"Healthy"</span>, <span class="ruby-value str">"Helpful"</span>, <span class="ruby-value str">"Hilarious"</span>, <span class="ruby-value str">"Jolly"</span>, <span class="ruby-value str">"Joyous"</span>, <span class="ruby-value str">"Kind"</span>, <span class="ruby-value str">"Lively"</span>, <span class="ruby-value str">"Lovely"</span>, <span class="ruby-value str">"Lucky"</span>, <span class="ruby-value str">"Nice"</span>, <span class="ruby-value str">"Obedient"</span>, <span class="ruby-value str">"Perfect"</span>, <span class="ruby-value str">"Pleasant"</span>, <span class="ruby-value str">"Poor"</span>, <span class="ruby-value str">"Proud"</span>, <span class="ruby-value str">"Relieved"</span>, <span class="ruby-value str">"Silly"</span>, <span class="ruby-value str">"Smiling"</span>, <span class="ruby-value str">"Splendid"</span>, <span class="ruby-value str">"Successful"</span>, <span class="ruby-value str">"Thankful"</span>, <span class="ruby-value str">"Thoughtful"</span>, <span class="ruby-value str">"Victorious"</span>, <span class="ruby-value str">"Vivacious"</span>, <span class="ruby-value str">"Witty"</span>, <span class="ruby-value str">"Wonderful"</span>, <span class="ruby-value str">"Zealous"</span>, <span class="ruby-value str">"Zany"</span>, <span class="ruby-value str">"Glamorous"</span>, <span class="ruby-value str">"Gleaming"</span>, <span class="ruby-value str">"Gorgeous"</span>, <span class="ruby-value str">"Graceful"</span>, <span class="ruby-value str">"Grotesque"</span>, <span class="ruby-value str">"Handsome"</span>, <span class="ruby-value str">"Homely"</span>, <span class="ruby-value str">"Light"</span>, <span class="ruby-value str">"Long"</span>, <span class="ruby-value str">"Magnificent"</span>, <span class="ruby-value str">"Misty"</span>, <span class="ruby-value str">"Motionless"</span>, <span class="ruby-value str">"Muddy"</span>, <span class="ruby-value str">"Old-fashioned"</span>, <span class="ruby-value str">"Plain"</span>, <span class="ruby-value str">"Poised"</span>, <span class="ruby-value str">"Precious"</span>, <span class="ruby-value str">"Quaint"</span>, <span class="ruby-value str">"Shiny"</span>, <span class="ruby-value str">"Smoggy"</span>, <span class="ruby-value str">"Sparkling"</span>, <span class="ruby-value str">"Spotless"</span>, <span class="ruby-value str">"Stormy"</span>, <span class="ruby-value str">"Strange"</span>, <span class="ruby-value str">"Ugly"</span>, <span class="ruby-value str">"Ugliest"</span>, <span class="ruby-value str">"Unsightly"</span>, <span class="ruby-value str">"Unusual"</span>, <span class="ruby-value str">"Wide-eyed"</span>, <span class="ruby-value str">"Adorable"</span>, <span class="ruby-value str">"Adventurous"</span>, <span class="ruby-value str">"Aggressive"</span>, <span class="ruby-value str">"Alert"</span>, <span class="ruby-value str">"Attractive"</span>, <span class="ruby-value str">"Average"</span>, <span class="ruby-value str">"Beautiful"</span>, <span class="ruby-value str">"Blue-eyed"</span>, <span class="ruby-value str">"Bloody"</span>, <span class="ruby-value str">"Blushing"</span>, <span class="ruby-value str">"Bright"</span>, <span class="ruby-value str">"Clean"</span>, <span class="ruby-value str">"Clear"</span>, <span class="ruby-value str">"Cloudy"</span>, <span class="ruby-value str">"Colorful"</span>, <span class="ruby-value str">"Crowded"</span>, <span class="ruby-value str">"Cute"</span>, <span class="ruby-value str">"Dark"</span>, <span class="ruby-value str">"Drab"</span>, <span class="ruby-value str">"Distinct"</span>, <span class="ruby-value str">"Dull"</span>, <span class="ruby-value str">"Elegant"</span>, <span class="ruby-value str">"Excited"</span>, <span class="ruby-value str">"Fancy"</span>, <span class="ruby-value str">"Filthy"</span>, <span class="ruby-value str">"Big"</span>, <span class="ruby-value str">"Colossal"</span>, <span class="ruby-value str">"Fat"</span>, <span class="ruby-value str">"Gigantic"</span>, <span class="ruby-value str">"Great"</span>, <span class="ruby-value str">"Huge"</span>, <span class="ruby-value str">"Immense"</span>, <span class="ruby-value str">"Large"</span>, <span class="ruby-value str">"Little"</span>, <span class="ruby-value str">"Mammoth"</span>, <span class="ruby-value str">"Massive"</span>, <span class="ruby-value str">"Miniature"</span>, <span class="ruby-value str">"Petite"</span>, <span class="ruby-value str">"Puny"</span>, <span class="ruby-value str">"Scrawny"</span>, <span class="ruby-value str">"Short"</span>, <span class="ruby-value str">"Small"</span>, <span class="ruby-value str">"Tall"</span>, <span class="ruby-value str">"Teeny"</span>, <span class="ruby-value str">"Teeny-tiny"</span>, <span class="ruby-value str">"Tinybroad"</span>, <span class="ruby-value str">"Chubby"</span>, <span class="ruby-value str">"Crooked"</span>, <span class="ruby-value str">"Curved"</span>, <span class="ruby-value str">"Deep"</span>, <span class="ruby-value str">"Flat"</span>, <span class="ruby-value str">"High"</span>, <span class="ruby-value str">"Hollow"</span>, <span class="ruby-value str">"Low"</span>, <span class="ruby-value str">"Narrow"</span>, <span class="ruby-value str">"Round"</span>, <span class="ruby-value str">"Shallow"</span>, <span class="ruby-value str">"Skinny"</span>, <span class="ruby-value str">"Square"</span>, <span class="ruby-value str">"Steep"</span>, <span class="ruby-value str">"Straight"</span>, <span class="ruby-value str">"Wide"</span>].<span class="ruby-identifier">rand</span>
|
171
|
+
|
172
|
+
<span class="ruby-keyword kw">end</span>
|
173
|
+
</pre>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div id="method-M000008" class="method-detail">
|
179
|
+
<a name="M000008"></a>
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<a href="#M000008" class="method-signature">
|
183
|
+
<span class="method-name">colour</span><span class="method-args">()</span>
|
184
|
+
</a>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
<p><a class="source-toggle" href="#"
|
189
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
190
|
+
<div class="method-source-code" id="M000008-source">
|
191
|
+
<pre>
|
192
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 31</span>
|
193
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">colour</span>
|
194
|
+
<span class="ruby-node">%w( White Yellow Red Green Blue Black Orange Purple)</span>.<span class="ruby-identifier">rand</span>
|
195
|
+
<span class="ruby-keyword kw">end</span>
|
196
|
+
</pre>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div id="method-M000004" class="method-detail">
|
202
|
+
<a name="M000004"></a>
|
203
|
+
|
204
|
+
<div class="method-heading">
|
205
|
+
<a href="#M000004" class="method-signature">
|
206
|
+
<span class="method-name">creature_name</span><span class="method-args">()</span>
|
207
|
+
</a>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
<p><a class="source-toggle" href="#"
|
212
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
213
|
+
<div class="method-source-code" id="M000004-source">
|
214
|
+
<pre>
|
215
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 13</span>
|
216
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">creature_name</span>
|
217
|
+
<span class="ruby-node">%w(Dragon Cyclop Wyvern Stud Dwarf Aardvark Buffalo Ant Anteater Antelope Ape Armadillo Donkey Baboon Badger Bat Bear Beaver Bee Bison Boar Bush Butterfly Camel Cat Cattle Chamois Cheetah Chicken Chimpanzee Cobra Cockroach Cormorant Coyote Crab Crane Crocodile Crow Deer Dog Dogfish Dolphin Dove Dragonfly Duck Dugong Eagle Echidna Eel Eland Elephant Elk Falcon Ferret Finch Fly Fox Frog Gaur Gazelle Gerbil Giant Panda Giraffe Gnu Goat Goose Gorilla Guanaco Guinea Gull Hamster Hare Hawk Hedgehog Heron Hippopotamus Hornet Horse Hyena Jackal Jaguar Jellyfish Kangaroo Komodo Kouprey Kudu Lark Lemur Leopard Lion Llama Loris Louse Lobster Lyrebird Magpie Mallard Manatee Meerkat Mink Mole Monkey Moose Mouse Mosquito Mule Nightingale Okapi Oryx Ostrich Otter Owl Ox Oyster Panther Partridge Peafowl Pelican Pig Pigeon Pony Porcupine Quelea Rabbit Raccoon Rail Ram Rat Raven RedDeer RedPanda Reindeer Rhinoceros Salamander Sealion Seal Seastar Shark Sheep Shrew Skunk Snail Snake Spider Squid Squirrel Swan Tapir Tarsier Tiger Toad Turkey Turtle Vicuna Walrus Wasp WaterBuffalo Weasel Whale Wolf Worm Yak Zebra)</span>.<span class="ruby-identifier">rand</span>.<span class="ruby-identifier">pluralize</span>
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
</pre>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div id="method-M000006" class="method-detail">
|
225
|
+
<a name="M000006"></a>
|
226
|
+
|
227
|
+
<div class="method-heading">
|
228
|
+
<a href="#M000006" class="method-signature">
|
229
|
+
<span class="method-name">formation_name</span><span class="method-args">()</span>
|
230
|
+
</a>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
<p><a class="source-toggle" href="#"
|
235
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
236
|
+
<div class="method-source-code" id="M000006-source">
|
237
|
+
<pre>
|
238
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 21</span>
|
239
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">formation_name</span>
|
240
|
+
<span class="ruby-node">%w(Battalion Legion Brigade Rank Pack Regiment Squadron Swarm Squad Division)</span>.<span class="ruby-identifier">rand</span>
|
241
|
+
<span class="ruby-keyword kw">end</span>
|
242
|
+
</pre>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
<div id="method-M000005" class="method-detail">
|
248
|
+
<a name="M000005"></a>
|
249
|
+
|
250
|
+
<div class="method-heading">
|
251
|
+
<a href="#M000005" class="method-signature">
|
252
|
+
<span class="method-name">name_of_order</span><span class="method-args">()</span>
|
253
|
+
</a>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div class="method-description">
|
257
|
+
<p><a class="source-toggle" href="#"
|
258
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
259
|
+
<div class="method-source-code" id="M000005-source">
|
260
|
+
<pre>
|
261
|
+
<span class="ruby-comment cmt"># File lib/medieval/battalion.rb, line 17</span>
|
262
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name_of_order</span>
|
263
|
+
<span class="ruby-identifier">rand</span>(<span class="ruby-value">100</span>).<span class="ruby-identifier">ordinalize</span>
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
265
|
+
</pre>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="validator-badges">
|
278
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
</body>
|
282
|
+
</html>
|