Class: Player

Inherits:
Job show all
Defined in:
lib/lotrd/model/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
15
# File 'lib/lotrd/model/player.rb', line 7

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

Instance Attribute Details

#achievementsObject

Returns the value of attribute achievements.



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

def achievements
  @achievements
end

#agiObject

Returns the value of attribute agi.



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

def agi
  @agi
end

#armourObject

Returns the value of attribute armour.



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

def armour
  @armour
end

#balanceObject

Returns the value of attribute balance.



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

def balance
  @balance
end

#defObject

Returns the value of attribute def.



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

def def
  @def
end

#dexObject

Returns the value of attribute dex.



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

def dex
  @dex
end

#goldObject

Returns the value of attribute gold.



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

def gold
  @gold
end

#hpObject

Returns the value of attribute hp.



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

def hp
  @hp
end

#intObject

Returns the value of attribute int.



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

def int
  @int
end

#lckObject

Returns the value of attribute lck.



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

def lck
  @lck
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#resObject

Returns the value of attribute res.



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

def res
  @res
end

#strObject

Returns the value of attribute str.



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

def str
  @str
end

#weaponObject

Returns the value of attribute weapon.



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

def weapon
  @weapon
end

Instance Method Details

#beastObject



33
34
35
# File 'lib/lotrd/model/player.rb', line 33

def beast
    super
end

#dwarfObject



25
26
27
# File 'lib/lotrd/model/player.rb', line 25

def dwarf
    super
end

#elfObject



17
18
19
# File 'lib/lotrd/model/player.rb', line 17

def elf
    super
end

#godObject



29
30
31
# File 'lib/lotrd/model/player.rb', line 29

def god
    super
end

#humanObject



21
22
23
# File 'lib/lotrd/model/player.rb', line 21

def human
    super
end

#knightObject



41
42
43
# File 'lib/lotrd/model/player.rb', line 41

def knight
    super
end

#mageObject



37
38
39
# File 'lib/lotrd/model/player.rb', line 37

def mage
    super
end

#rangerObject



49
50
51
# File 'lib/lotrd/model/player.rb', line 49

def ranger
    super
end

#rogueObject



45
46
47
# File 'lib/lotrd/model/player.rb', line 45

def rogue
    super
end