Class: GamesAndRpgParadise::ShakesAndFidgets::Armour
- Inherits:
-
Object
- Object
- GamesAndRpgParadise::ShakesAndFidgets::Armour
show all
- Includes:
- Shared
- Defined in:
- lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb
Overview
GamesAndRpgParadise::ShakesAndFidgets::Armour
Instance Method Summary
collapse
Methods included from Shared
#calculate_cost_for_n_increase_of_attribute, #fetch_user_input, #load_yaml, #report_name, #save_character, #user_input
Constructor Details
#initialize(run_already = true) ⇒ Armour
19
20
21
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 19
def initialize(run_already = true)
run if run_already
end
|
Instance Method Details
#attribute_boosts ⇒ Object
#
attribute_boosts
This method returns an array how much we do an attribute boost.
#
55
56
57
58
59
60
61
62
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 55
def attribute_boosts
_ = []
@armour.each_pair { |key, value|
}
return _
end
|
#debug ⇒ Object
88
89
90
91
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 88
def debug
e @name
e type?
end
|
#fetch_random_entry ⇒ Object
#
fetch_random_entry
This is mostly a test method. It fetches a random entry.
#
35
36
37
38
39
40
41
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 35
def fetch_random_entry
random_entry = @armours.keys.sample
@armour = @armours[random_entry]
set_name(random_entry)
set_type(@armour['Layer'])
remove_instance_variable(:@armours)
end
|
#is_armour? ⇒ Boolean
46
47
48
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 46
def is_armour?
true
end
|
#load_all_armours ⇒ Object
26
27
28
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 26
def load_all_armours
@armours = load_yaml(ARMOURS)
end
|
#name? ⇒ Boolean
Also known as:
name
96
97
98
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 96
def name?
@name
end
|
#run ⇒ Object
103
104
105
106
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 103
def run
load_all_armours
fetch_random_entry end
|
#set_name(i) ⇒ Object
81
82
83
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 81
def set_name(i)
@name = i
end
|
#set_type(i) ⇒ Object
67
68
69
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 67
def set_type(i)
@type = i
end
|
#type? ⇒ Boolean
74
75
76
|
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 74
def type?
@type
end
|