Module: GamesAndRpgParadise::Mud
- Defined in:
- lib/games_and_rpg_paradise/mud/living/living.rb,
lib/games_and_rpg_paradise/mud/base/base.rb,
lib/games_and_rpg_paradise/mud/food/food.rb,
lib/games_and_rpg_paradise/mud/room/room.rb,
lib/games_and_rpg_paradise/mud/arena/arena.rb,
lib/games_and_rpg_paradise/mud/shell/shell.rb,
lib/games_and_rpg_paradise/mud/weapons/axe.rb,
lib/games_and_rpg_paradise/mud/animals/bear.rb,
lib/games_and_rpg_paradise/mud/magic/spells.rb,
lib/games_and_rpg_paradise/mud/weapons/club.rb,
lib/games_and_rpg_paradise/mud/weapons/pike.rb,
lib/games_and_rpg_paradise/mud/armour/armour.rb,
lib/games_and_rpg_paradise/mud/client/client.rb,
lib/games_and_rpg_paradise/mud/combat/combat.rb,
lib/games_and_rpg_paradise/mud/gender/gender.rb,
lib/games_and_rpg_paradise/mud/ghosts/ghosts.rb,
lib/games_and_rpg_paradise/mud/skills/skills.rb,
lib/games_and_rpg_paradise/mud/weapons/sabre.rb,
lib/games_and_rpg_paradise/mud/weapons/spear.rb,
lib/games_and_rpg_paradise/mud/weapons/sword.rb,
lib/games_and_rpg_paradise/mud/animals/animal.rb,
lib/games_and_rpg_paradise/mud/animals/badger.rb,
lib/games_and_rpg_paradise/mud/animals/parrot.rb,
lib/games_and_rpg_paradise/mud/weapons/dagger.rb,
lib/games_and_rpg_paradise/mud/weapons/hammer.rb,
lib/games_and_rpg_paradise/mud/weapons/weapon.rb,
lib/games_and_rpg_paradise/mud/adverbs/adverbs.rb,
lib/games_and_rpg_paradise/mud/animals/unicorn.rb,
lib/games_and_rpg_paradise/mud/project/project.rb,
lib/games_and_rpg_paradise/mud/trading/trading.rb,
lib/games_and_rpg_paradise/mud/weapons/weapons.rb,
lib/games_and_rpg_paradise/mud/actions/juggling.rb,
lib/games_and_rpg_paradise/mud/armours/chainmail.rb,
lib/games_and_rpg_paradise/mud/can_talk/can_talk.rb,
lib/games_and_rpg_paradise/mud/humanoid/humanoid.rb,
lib/games_and_rpg_paradise/mud/monsters/monsters.rb,
lib/games_and_rpg_paradise/mud/movement/movement.rb,
lib/games_and_rpg_paradise/mud/objects/misc/rope.rb,
lib/games_and_rpg_paradise/mud/objects/book/books.rb,
lib/games_and_rpg_paradise/mud/objects/doors/door.rb,
lib/games_and_rpg_paradise/mud/room/server/server.rb,
lib/games_and_rpg_paradise/mud/weapons/broadsword.rb,
lib/games_and_rpg_paradise/mud/armours/breastplate.rb,
lib/games_and_rpg_paradise/mud/character/character.rb,
lib/games_and_rpg_paradise/mud/constants/constants.rb,
lib/games_and_rpg_paradise/mud/container/container.rb,
lib/games_and_rpg_paradise/mud/continent/continent.rb,
lib/games_and_rpg_paradise/mud/hitpoints/hitpoints.rb,
lib/games_and_rpg_paradise/mud/armours/padded_tunic.rb,
lib/games_and_rpg_paradise/mud/economy/trade_routes.rb,
lib/games_and_rpg_paradise/mud/characters/characters.rb,
lib/games_and_rpg_paradise/mud/mud_object/mud_object.rb,
lib/games_and_rpg_paradise/mud/toplevel_methods/misc.rb,
lib/games_and_rpg_paradise/mud/admin_shell/admin_shell.rb,
lib/games_and_rpg_paradise/mud/settlements/towns/event.rb,
lib/games_and_rpg_paradise/mud/actions/fall_down_action.rb,
lib/games_and_rpg_paradise/mud/armours/camouflage_cloak.rb,
lib/games_and_rpg_paradise/mud/monsters/monster_factory.rb,
lib/games_and_rpg_paradise/mud/objects/doors/steel_door.rb,
lib/games_and_rpg_paradise/requires/require_the_mud_files.rb,
lib/games_and_rpg_paradise/mud/requires/require_the_animals.rb,
lib/games_and_rpg_paradise/mud/requires/require_the_armours.rb,
lib/games_and_rpg_paradise/mud/requires/require_the_weapons.rb,
lib/games_and_rpg_paradise/mud/settlements/towns/controller.rb,
lib/games_and_rpg_paradise/mud/name_generator/name_generator.rb,
lib/games_and_rpg_paradise/mud/objects/weapons/durais_katana.rb,
lib/games_and_rpg_paradise/mud/objects/armours/falcon_breastplate.rb,
lib/games_and_rpg_paradise/mud/characters/character_creation_process.rb,
lib/games_and_rpg_paradise/mud/worlds/sarlem/eastern_realm/tai/pingrim/western_gate.rb,
lib/games_and_rpg_paradise/mud/worlds/sarlem/eastern_realm/tai/pingrim/karoshi_cemetary/entrance.rb
Overview
GamesAndRpgParadise::Mud
Defined Under Namespace
Modules: Adverbs, Animal, FallDownAction, Gender, Hitpoints, Humanoid, Juggling, Living, Movement, Sarlem, Settlements, Skills, Talk, TradeRoutes Classes: AdminShell, Arena, Armour, Axe, Badger, Base, Bear, Book, Breastplate, Broadsword, Chainmail, Character, CharacterCreationProcess, Characters, Client, Club, Combat, Container, Continent, Dagger, Door, DuraisKatana, FalconBreastplate, Food, Ghosts, Hammer, MonsterFactory, Monsters, MudObject, NameGenerator, PaddedTunic, Parrot, Pike, Room, Rope, Sabre, Shell, Spear, Spell, SteelDoor, Sword, Unicorn, Weapon, Weapons
Constant Summary collapse
- PROJECT_BASE_DIRECTORY =
#
PROJECT_BASE_DIRECTORY
Dynamically obtain the base directory of this project.
#
RbConfig::CONFIG['sitelibdir']+'/rpg_paradise/mud/'
- AVAILABLE_MONSTERS =
#
AVAILABLE_MONSTERS
#
YAML.load_file(MONSTERS_FILE)
- RPG =
#
RPG
#
ENV['RPG'].to_s+'/'
- RPG_SARLEM =
RPG+'SARLEM/'
- STD_RPG_PATH =
RPG_SARLEM+'YAML/'
- MUD_YAML_DIRECTORY =
#
MUD_YAML_DIRECTORY
#
PROJECT_BASE_DIRECTORY+'yaml/'
- SAVED_CHARACTERS =
#
SAVED_CHARACTERS
#
MUD_YAML_DIRECTORY+'saved_characters/'
- YAML_WEAPONS_FILE =
#
YAML_WEAPONS_FILE
#
MUD_YAML_DIRECTORY+'weapons.yml'
- WEAPONS_FILE =
#
WEAPONS_FILE
#
YAML_WEAPONS_FILE
- FILE_ADVERBS =
#
FILE_ADVERBS
bl $RUBY_MUD/yaml/adverbs.yml
#
GamesAndRpgParadise.project_base_directory?+'mud/yaml/adverbs/adverbs.yml'
- HUMAN_HP_BASE =
#
HUMAN_HP_BASE
#
100
- HUMAN_AGI_BASE =
#
HUMAN_AGI_BASE
#
100
- HUMAN_STR_BASE =
#
HUMAN_STR_BASE
#
100
- HUMAN_CON_BASE =
#
HUMAN_CON_BASE
#
100
- HUMAN_END_BASE =
endurance
100
- HUMAN_INT_BASE =
intelligence
100
- WORD_WRAP =
#
WORD_WRAP
#
78
- MONSTERS_FILE =
#
MONSTERS_FILE
#
"#{MUD_YAML_DIRECTORY}monsters.yml"
- FILE_FORBIDDEN_NAMES =
#
GamesAndRpgParadise::Mud::FILE_FORBIDDEN_NAMES
#
"#{GamesAndRpgParadise.project_directory?}yaml/mud/forbidden_names/forbidden_names.yml"
- FILE_MUD_ALIASES =
#
FILE_MUD_ALIASES
#
MUD_YAML_DIRECTORY+'mud_aliases.yml'
- TINTIN_FILE =
#
TINTIN_FILE
#
'/tintin/auto_generated_alias_file.md'
- FILE_TAI_NAMES =
#
RpgParadise::Mud::FILE_TAI_NAMES
#
::GamesAndRpgParadise.project_base_dir?+'sarlem/the_eastern_realm/tai/yaml/tai_names.yml'
- TAI_NAMES =
#
RpgParadise::Mud::TAI_NAMES
bl $SARLEM/YAML/tai_names.yml
#
YAML.load_file(FILE_TAI_NAMES)
- TAI_MALE_NAMES =
TAI_NAMES['tai_male_names']
- TAI_FEMALE_NAMES =
TAI_NAMES['tai_female_names']
- TAI_SURNAMES =
TAI_NAMES['tai_surnames']
Class Method Summary collapse
-
.exit_shortcuts?(i) ⇒ Boolean
# === GamesAndRpgParadise::Mud.exit_shortcuts?.
-
.inverse_exit(i) ⇒ Object
# === GamesAndRpgParadise::Mud.inverse_exit.
-
.load_shell ⇒ Object
# === GamesAndRpgParadise::Mud.load_shell ========================================================================= #.
-
.load_the_mud_objects ⇒ Object
# === GamesAndRpgParadise::Mud.load_the_mud_objects ========================================================================= #.
-
.project_base_directory? ⇒ Boolean
# === RpgParadise::Mud.project_base_directory?.
-
.require_characters ⇒ Object
# === GamesAndRpgParadise::Mud.require_characters ========================================================================= #.
-
.require_the_animals(target_dir = PROJECT_BASE_DIRECTORY+'animals/') ⇒ Object
# === RpgParadise::Mud.require_the_animals ========================================================================= #.
-
.require_the_armours(target_dir = PROJECT_BASE_DIRECTORY+'armours/') ⇒ Object
# === RpgParadise::Mud.require_the_armours ========================================================================= #.
-
.require_the_weapons(target_dir = PROJECT_BASE_DIRECTORY+'weapons/') ⇒ Object
# === GamesAndRpgParadise::Mud.require_the_weapons ========================================================================= #.
-
.return_random_tai_name ⇒ Object
# === RpgParadise::Mud.return_random_tai_name.
-
.tin_aliases(target = FILE_TINTIN) ⇒ Object
# === GamesAndRpgParadise::Mud.tin_aliases.
Instance Method Summary collapse
-
#haggle(for_this_object = Sword.new) ⇒ Object
# === haggle.
-
#project_dir? ⇒ Boolean
(also: #project_base_directory?)
# === project_dir?.
Class Method Details
.exit_shortcuts?(i) ⇒ Boolean
#
GamesAndRpgParadise::Mud.exit_shortcuts?
Expand the short-exits towards long exits.
#
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/games_and_rpg_paradise/mud/toplevel_methods/misc.rb', line 42 def self.exit_shortcuts?(i) case i when 'n' then 'north' when 'ne' then 'northeast' when 'e' then 'east' when 'se' then 'southeast' when 's' then 'south' when 'sw' then 'southwest' when 'w' then 'west' when 'nw' then 'northwest' else return i end end |
.inverse_exit(i) ⇒ Object
#
GamesAndRpgParadise::Mud.inverse_exit
We yield to us the opposite of a direction.
#
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/games_and_rpg_paradise/mud/toplevel_methods/misc.rb', line 16 def self.inverse_exit(i) case i when 'north','n' 'south' when 'northeast','ne' 'southwest' when 'east','e' 'west' when 'southeast','se' 'northwest' when 'south','s' 'north' when 'southwest','sw' 'northeast' when 'west','w' 'east' when 'northwest','nw' 'southeast' end end |
.load_shell ⇒ Object
#
GamesAndRpgParadise::Mud.load_shell
#
387 388 389 390 391 |
# File 'lib/games_and_rpg_paradise/mud/shell/shell.rb', line 387 def self.load_shell Dir[Mud::PROJECT_BASE_DIRECTORY+'shell/*.rb'].each {|this_file| require this_file } end |
.load_the_mud_objects ⇒ Object
#
GamesAndRpgParadise::Mud.load_the_mud_objects
#
33 34 35 36 37 |
# File 'lib/games_and_rpg_paradise/requires/require_the_mud_files.rb', line 33 def self.load_the_mud_objects Dir[GamesAndRpgParadise::Mud::PROJECT_BASE_DIRECTORY+'objects/**/**.rb'].each {|file| require file } end |
.project_base_directory? ⇒ Boolean
#
RpgParadise::Mud.project_base_directory?
This will return a value such as:
/Programs/Ruby/2.2.2/lib/ruby/site_ruby/2.2.0/mud/
#
29 30 31 |
# File 'lib/games_and_rpg_paradise/mud/project/project.rb', line 29 def self.project_base_directory? PROJECT_BASE_DIRECTORY end |
.require_characters ⇒ Object
#
GamesAndRpgParadise::Mud.require_characters
#
22 23 24 25 26 27 28 |
# File 'lib/games_and_rpg_paradise/requires/require_the_mud_files.rb', line 22 def self.require_characters _ = GamesAndRpgParadise.project_base_directory?+'mud/characters/*.rb' Dir[_].each {|file| require GamesAndRpgParadise.project_base_directory?+ 'mud/characters/'+File.basename(file) } end |
.require_the_animals(target_dir = PROJECT_BASE_DIRECTORY+'animals/') ⇒ Object
#
RpgParadise::Mud.require_the_animals
#
20 21 22 23 24 25 26 |
# File 'lib/games_and_rpg_paradise/mud/requires/require_the_animals.rb', line 20 def self.require_the_animals( target_dir = PROJECT_BASE_DIRECTORY+'animals/' ) Dir[target_dir+'*.rb'].each {|file| require file } end |
.require_the_armours(target_dir = PROJECT_BASE_DIRECTORY+'armours/') ⇒ Object
#
RpgParadise::Mud.require_the_armours
#
20 21 22 23 24 25 26 |
# File 'lib/games_and_rpg_paradise/mud/requires/require_the_armours.rb', line 20 def self.require_the_armours( target_dir = PROJECT_BASE_DIRECTORY+'armours/' ) Dir[target_dir+'*.rb'].each {|file| require file } end |
.require_the_weapons(target_dir = PROJECT_BASE_DIRECTORY+'weapons/') ⇒ Object
#
GamesAndRpgParadise::Mud.require_the_weapons
#
18 19 20 21 22 23 24 |
# File 'lib/games_and_rpg_paradise/mud/requires/require_the_weapons.rb', line 18 def self.require_the_weapons( target_dir = PROJECT_BASE_DIRECTORY+'weapons/' ) Dir[target_dir+'*.rb'].each {|file| require file } end |
.return_random_tai_name ⇒ Object
#
RpgParadise::Mud.return_random_tai_name
This method will return a random Tai name.
Usage examples:
RpgParadise::Mud.return_random_tai_name # => "Sawako Hishida"
RpgParadise::Mud.return_random_tai_name # => "Yuri Yoshida"
#
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/games_and_rpg_paradise/mud/name_generator/name_generator.rb', line 64 def self.return_random_tai_name surname = TAI_SURNAMES.sample.capitalize case rand(2) when 0 # Male first names go here. first_name = TAI_MALE_NAMES.sample.capitalize when 1 # Female first names go here. first_name = TAI_FEMALE_NAMES.sample.capitalize end _ = first_name+' '+surname return _ end |
.tin_aliases(target = FILE_TINTIN) ⇒ Object
#
GamesAndRpgParadise::Mud.tin_aliases
To generate it, do:
require 'std_mud.rb';StdMud.tin_aliases
#
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/games_and_rpg_paradise/mud/constants/constants.rb', line 110 def self.tin_aliases( target = FILE_TINTIN ) File.delete(target) if File.exist? target yaml_loaded = YAML.load_file(FILE_MUD_ALIASES) yaml_loaded.each_pair { |key, value| write_what_into("#alias {#{key}} {#{value}}", target) } e 'Finished writing into '+sfile(target)+'!' end |
Instance Method Details
#haggle(for_this_object = Sword.new) ⇒ Object
#
haggle
The object at hand must respond to .cost?.
#
20 21 22 23 24 25 |
# File 'lib/games_and_rpg_paradise/mud/trading/trading.rb', line 20 def haggle( for_this_object = Sword.new ) average_cost = for_this_object.cost? # The cost of the object. return average_cost end |
#project_dir? ⇒ Boolean Also known as: project_base_directory?
#
project_dir?
Tell us the project directory of this gem.
#
38 39 40 |
# File 'lib/games_and_rpg_paradise/mud/project/project.rb', line 38 def project_dir? PROJECT_BASE_DIRECTORY end |