Class: GamesAndRpgParadise::ShakesAndFidgets::Armour

Inherits:
Object
  • Object
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

#

initialize

#


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_boostsObject

#

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|
    # _ << [key, value] if is_an_attribute?(key)
    # ^^^ Disabled for now.
  }
  return _
end

#debugObject

#

debug

#


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_entryObject

#

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

#

is_armour?

#

Returns:

  • (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_armoursObject

#

load_all_armours

#


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

#

name?

#

Returns:

  • (Boolean)


96
97
98
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 96

def name?
  @name
end

#runObject

#

run

#


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 # For now this is random.
end

#set_name(i) ⇒ Object

#

set_name

#


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

#

set_type

#


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

#

type?

#

Returns:

  • (Boolean)


74
75
76
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/armour/armour.rb', line 74

def type?
  @type
end