Class: GamesAndRpgParadise::Mud::Parrot

Inherits:
Object
  • Object
show all
Includes:
Animal
Defined in:
lib/games_and_rpg_paradise/mud/animals/parrot.rb

Overview

GamesAndRpgParadise::Mud::Parrot

Constant Summary

Constants included from Living

Living::DEFAULT_HP_FOR_HUMANS

Constants included from Adverbs

Adverbs::ADVERBS_ABBREVIATED, Adverbs::ARRAY_ADVERBS

Instance Method Summary collapse

Methods included from Animal

#can_talk?, #e, #height?, #is_animal?, #pweight?, #set_description, #weight?

Methods included from Living

#can_breathe?, #can_talk?, #do_die, #do_resurrect, #is_alive?, #is_dead?, #is_poisoned?, #my_race?, #race?, #report_race, #return_default_hp, #return_race, #run, #set_stats_packages, #skills?

Methods included from Talk

#can_speak?, included, #say, #set_how

Methods included from Adverbs

all?, file?, find_adverb_for, keys, n_adverbs?, original_adverbs

Methods included from Hitpoints

#deduct_hp, #hp?, #max_hp?, #modify_health, #sync_hp

Methods included from Gender

#female?, #gender?, #has_gender?, #male?, #neuter?, #set_female, #set_male, #set_neuter, #subjective_case?

Constructor Details

#initializeParrot

#

initialize

#


26
27
28
29
# File 'lib/games_and_rpg_paradise/mud/animals/parrot.rb', line 26

def initialize
  reset
  set_description('This is a parrot.')
end

Instance Method Details

#admin_debugObject

#

admin_debug

Admin uses this.

#


57
58
59
60
61
62
63
# File 'lib/games_and_rpg_paradise/mud/animals/parrot.rb', line 57

def admin_debug
  e 'Race '+@race.to_s
  e 'height '+@height.to_s
  e 'weight '+@weight.to_s
  e 'Hp '+@hp.to_s
  e 'Strength '+@strength.to_s
end

#parrot_this_sentence(i = 'But I say to you, whoever tolerates the '\ 'lies of his brother or sister') ⇒ Object

#

parrot_this_sentence

This method can be used to make the parrot repeat a sentence.

#


70
71
72
73
74
75
76
77
78
# File 'lib/games_and_rpg_paradise/mud/animals/parrot.rb', line 70

def parrot_this_sentence(
    # i = 'to the divine law,'
    i = 'But I say to you, whoever tolerates the '\
        'lies of his brother or sister'
  )
  shorter_version = i.split(' ')[-3,3].join(' ').dup # The last 3 words are parroted.
  shorter_version[0,1] = shorter_version[0,1].upcase
  say shorter_version
end

#resetObject

#

reset

#


34
35
36
37
38
39
40
41
42
43
# File 'lib/games_and_rpg_paradise/mud/animals/parrot.rb', line 34

def reset
  @race = 'Parrot'
  @name = GamesAndRpgParadise::Mud::NameGenerator.new('Parrot',1).generate_name_string
  @strength = 20+rand(5)
  @height = 17+rand(25)
  @weight =  0.5+rand(0.5)+@height/30.0+rand(0.44).to_f
  @hp = 10+rand(15)
  @base_attack_chance = 10+rand(21) #
  @description = ''
end

#special_featuresObject

#

special_features

#


48
49
50
# File 'lib/games_and_rpg_paradise/mud/animals/parrot.rb', line 48

def special_features
  e '  - can parrot a sentence'
end