Class: Configs::Natures
- Defined in:
- scripts/00800 Studio/00000 Configs/00001 Natures.rb
Overview
Configuration of natures
Instance Attribute Summary collapse
-
#data ⇒ Array<Array<Integer>]
Get the nature data.
-
#db_symbol_to_id ⇒ Hash<Symbol => Integer>
Get the nature ids.
Instance Method Summary collapse
-
#[](db_symbol) ⇒ Array<Integer>
Get an ability data by id or db_symbol.
-
#initialize ⇒ Natures
constructor
A new instance of Natures.
- #to_json
Constructor Details
#initialize ⇒ Natures
Returns a new instance of Natures.
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 |
# File 'scripts/00800 Studio/00000 Configs/00001 Natures.rb', line 12 def initialize @data = [ [0, 100, 100, 100, 100, 100], [1, 110, 90, 100, 100, 100], [2, 110, 100, 90, 100, 100], [3, 110, 100, 100, 90, 100], [4, 110, 100, 100, 100, 90], [5, 90, 110, 100, 100, 100], [6, 100, 100, 100, 100, 100], [7, 100, 110, 90, 100, 100], [8, 100, 110, 100, 90, 100], [9, 100, 110, 100, 100, 90], [10, 90, 100, 110, 100, 100], [11, 100, 90, 110, 100, 100], [12, 100, 100, 100, 100, 100], [13, 100, 100, 110, 90, 100], [14, 100, 100, 110, 100, 90], [15, 90, 100, 100, 110, 100], [16, 100, 90, 100, 110, 100], [17, 100, 100, 90, 110, 100], [18, 100, 100, 100, 100, 100], [19, 100, 100, 100, 110, 90], [20, 90, 100, 100, 100, 110], [21, 100, 90, 100, 100, 110], [22, 100, 100, 90, 100, 110], [23, 100, 100, 100, 90, 110], [24, 100, 100, 100, 100, 100] ] @db_symbol_to_id = { hardy: 0, lonely: 1, brave: 2, adamant: 3, naughty: 4, bold: 5, docile: 6, relaxed: 7, impish: 8, lax: 9, timid: 10, hasty: 11, serious: 12, jolly: 13, naive: 14, modest: 15, mild: 16, quiet: 17, bashful: 18, rash: 19, calm: 20, gentle: 21, sassy: 22, careful: 23, quirky: 24 } end |
Instance Attribute Details
#data ⇒ Array<Array<Integer>]
Get the nature data
6 7 8 |
# File 'scripts/00800 Studio/00000 Configs/00001 Natures.rb', line 6 def data @data end |
#db_symbol_to_id ⇒ Hash<Symbol => Integer>
Get the nature ids
10 11 12 |
# File 'scripts/00800 Studio/00000 Configs/00001 Natures.rb', line 10 def db_symbol_to_id @db_symbol_to_id end |
Instance Method Details
#[](db_symbol) ⇒ Array<Integer>
Get an ability data by id or db_symbol
72 73 74 75 76 |
# File 'scripts/00800 Studio/00000 Configs/00001 Natures.rb', line 72 def [](db_symbol) return @data[@db_symbol_to_id[db_symbol] || 0] || @data.first if db_symbol.is_a?(Symbol) return @data[db_symbol] || @data.first end |
#to_json
78 79 80 81 82 83 84 |
# File 'scripts/00800 Studio/00000 Configs/00001 Natures.rb', line 78 def to_json(*) { klass: self.class.to_s, data: @data, db_symbol_to_id: @db_symbol_to_id }.to_json end |