Module: GamesParadise::MightAndMagic::HeroTypes
- Defined in:
- lib/games_paradise/might_and_magic/hero_types.rb
Overview
GamesParadise::MightAndMagic::HeroTypes
Defined Under Namespace
Classes: Archer, Barbarian, Cleric, Druid, Fighter, Ninja, Paladin, Ranger, Rogue, Sorcerer
Class Method Summary collapse
-
.random_character(i = rand(10)) ⇒ Object
# === GamesParadise::MightAndMagic::HeroTypes.random_character.
Class Method Details
.random_character(i = rand(10)) ⇒ Object
#
GamesParadise::MightAndMagic::HeroTypes.random_character
This method will randomly pick a character type.
The idea behind this method is to offer a supported class for each hero type.
#
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/games_paradise/might_and_magic/hero_types.rb', line 28 def self.random_character( i = rand(10) ) case i when 0 then Archer.new when 1 then Barbarian.new when 2 then Cleric.new when 3 then Druid.new when 4 then Fighter.new when 5 then Ninja.new when 6 then Paladin.new when 7 then Ranger.new when 8 then Rogue.new when 9 then Sorcerer.new end end |