Class: GamesAndRpgParadise::Mud::Armour

Inherits:
MudObject
  • Object
show all
Includes:
RpgParadise::MUD::Wearable
Defined in:
lib/games_and_rpg_paradise/mud/armour/armour.rb

Constant Summary

Constants inherited from MudObject

MudObject::DEFAULT_NAME, MudObject::NAMESPACE

Instance Method Summary collapse

Methods inherited from MudObject

[], #add, #add_prop, #add_to_inventory, #alias_action, #can_speak?, #define_action, #describe_the_mud_object, #description?, disable_debug, #empty?, enable_debug, #enable_speak, #find, #has_inventory?, #height?, #id?, #inspect, #internal_hash?, #inventory?, #is_armour?, #is_inventory?, #is_mud_object?, #is_weapon?, #is_wearable?, #length?, #method_missing, #name=, #name?, #obtain_name_from_filename, #random_inventory_element, #report_height, #report_weight, #run, #set_description, #set_height, #set_is_an_armour, #set_is_inventory, #set_is_wearable, #set_length, #set_name, #set_object_name, #set_value, #set_weight, shall_we_debug?, #show_inventory, #store, #store_where?, #value?, #wear, #wearables?, #weight?, #who_am_i?, #wields?

Constructor Details

#initialize(*args) ⇒ Armour

#

initialize

#


23
24
25
# File 'lib/games_and_rpg_paradise/mud/armour/armour.rb', line 23

def initialize(*args)
  super(args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GamesAndRpgParadise::Mud::MudObject

Instance Method Details

#resetObject

#

reset

#


30
31
32
33
34
35
36
37
# File 'lib/games_and_rpg_paradise/mud/armour/armour.rb', line 30

def reset
  super() # Have to call it to initialize @internal_hash.
  set_armourclass :none
  set_is_an_armour
  set_is_wearable
  set_height 1
  set_weight 1
end

#set_armourclass(i = :good) ⇒ Object

#

set_armourclass

The armour class (AC) is kept as a range of different symbols, such as :weak or :good or :excellent.

#


53
54
55
# File 'lib/games_and_rpg_paradise/mud/armour/armour.rb', line 53

def set_armourclass(i = :good)
  @internal_hash[:armourclass] = i
end

#set_material_type(i = 'chain') ⇒ Object

#

set_material_type

#


42
43
44
45
# File 'lib/games_and_rpg_paradise/mud/armour/armour.rb', line 42

def set_material_type(i = 'chain')
  i = i.to_sym # We will keep the material type as Symbol.
  @internal_hash[:material_type] = i
end