-
Notifications
You must be signed in to change notification settings - Fork 0
/
cultist_player.rb
88 lines (57 loc) · 1.61 KB
/
cultist_player.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# encoding: UTF-8
#
# Programación y diseño orientado a objetos
# Grado en Ingeniería Informática
#
# 2013 © Copyleft - All Wrongs Reserved
#
# Ernesto Serrano <[email protected]>
#
require_relative 'treasure'
require_relative 'monster'
require_relative 'treasure_kind'
require_relative 'combat_result'
require_relative 'dice'
require_relative 'napakalaki'
require_relative 'player'
module Napakalaki
class CultistPlayer < Player
attr_accessor :my_cultist_card
@@total_cultist_players = 0
#Constructor (lo hacemos así porque si no falla)
def initialize(player, cultist)
super(player.name)
copy_constructor(player)
@my_cultist_card = cultist
@@total_cultist_players += 1 #Incrementamos el contador de cultistPlayers
end
#Métodos
def combat_level
#En ruby super es una llamada al metodo padre, asi que lo asignamos
#a una variable y le sumamos el special_value
lvl = super
lvl += @my_cultist_card.special_value
return lvl
end
def should_convert
#Siempre devuelve false
return false
end
def oponent_level(monster)
return monster.special_value
end
def compute_gold_coins_value(treasures)
#Devolvemos el valor
return super.compute_gold_coins_value(treasures) * 2
end
def self.total_cultist_players
return @@total_cultist_players
end
#EXAMEN
def receive_present(treasure)
#Rechazamos el tesoro
"Mi secta me impide aceptar regalos"
end
#FIN EXAMEN
end
end