Class: Player

Inherits:
Job show all
Defined in:
lib/lotrd/m-player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Player

Returns a new instance of Player.



7
8
9
10
11
12
13
14
# File 'lib/lotrd/m-player.rb', line 7

def initialize(name)
    @name = name
    @gold = 0
    @balance = 0
    @weapon = nil
    @armour = nil
    @achievements = []
end

Instance Attribute Details

#achievementsObject

Returns the value of attribute achievements.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def achievements
  @achievements
end

#agiObject

Returns the value of attribute agi.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def agi
  @agi
end

#armourObject

Returns the value of attribute armour.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def armour
  @armour
end

#balanceObject

Returns the value of attribute balance.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def balance
  @balance
end

#dexObject

Returns the value of attribute dex.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def dex
  @dex
end

#goldObject

Returns the value of attribute gold.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def gold
  @gold
end

#hpObject

Returns the value of attribute hp.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def hp
  @hp
end

#intObject

Returns the value of attribute int.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def int
  @int
end

#lckObject

Returns the value of attribute lck.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def lck
  @lck
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/lotrd/m-player.rb', line 4

def name
  @name
end

#strObject

Returns the value of attribute str.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def str
  @str
end

#weaponObject

Returns the value of attribute weapon.



5
6
7
# File 'lib/lotrd/m-player.rb', line 5

def weapon
  @weapon
end

Instance Method Details

#beastObject



32
33
34
# File 'lib/lotrd/m-player.rb', line 32

def beast
    super
end

#dwarfObject



24
25
26
# File 'lib/lotrd/m-player.rb', line 24

def dwarf
    super
end

#elfObject



16
17
18
# File 'lib/lotrd/m-player.rb', line 16

def elf
    super
end

#godObject



28
29
30
# File 'lib/lotrd/m-player.rb', line 28

def god
    super
end

#humanObject



20
21
22
# File 'lib/lotrd/m-player.rb', line 20

def human
    super
end

#knightObject



40
41
42
# File 'lib/lotrd/m-player.rb', line 40

def knight
    super
end

#mageObject



36
37
38
# File 'lib/lotrd/m-player.rb', line 36

def mage
    super
end

#rangerObject



48
49
50
# File 'lib/lotrd/m-player.rb', line 48

def ranger
    super
end

#rogueObject



44
45
46
# File 'lib/lotrd/m-player.rb', line 44

def rogue
    super
end