Class: GamesAndRpgParadise::Mud::Rope

Inherits:
MudObject
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/mud/objects/misc/rope.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?, #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

#initializeRope

#

initialize

#


20
21
22
23
24
25
26
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 20

def initialize
  super()
  reset
  set_description('
    This is a rope of '+length?+'.'
  )
end

Dynamic Method Handling

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

Instance Method Details

#can_become_a_lasso?Boolean

#

can_become_a_lasso?

#

Returns:

  • (Boolean)


53
54
55
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 53

def can_become_a_lasso?
  true
end

#is_a_rope?Boolean

#

is_a_rope?

#

Returns:

  • (Boolean)


46
47
48
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 46

def is_a_rope?
  true
end

#length?Boolean

#

length?

#

Returns:

  • (Boolean)


39
40
41
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 39

def length?
  @length.to_s
end

#resetObject

#

reset

#


31
32
33
34
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 31

def reset
  super()
  @length = (100..300).to_a.sample.to_s+' cm'
end

#tie_down_this_target(object) ⇒ Object

#

tie_down_this_target

#


60
61
62
63
64
65
66
67
# File 'lib/games_and_rpg_paradise/mud/objects/misc/rope.rb', line 60

def tie_down_this_target(object)
  if length? > object.width
    object.set_is_tied(true)
  else
    e 'The target '+object.name.to_s+' is too wide for the '\
      'rope.'
  end
end