Class: RPG::Class
- Extended by:
- RgssDb::JsonableConstructor
- Includes:
- RgssDb::Jsonable
- Defined in:
- lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/class.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb,
lib/rgss_db/model/rpg_maker_data/vx/rpg/class_learning.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/class_learning.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class_learning.rb
Overview
The data class for class.
Defined Under Namespace
Classes: Learning
Instance Attribute Summary collapse
-
#armor_set ⇒ Object
Returns the value of attribute armor_set.
-
#element_ranks ⇒ Object
Returns the value of attribute element_ranks.
-
#exp_params ⇒ Object
Returns the value of attribute exp_params.
-
#id ⇒ Object
Returns the value of attribute id.
-
#learnings ⇒ Object
Returns the value of attribute learnings.
-
#name ⇒ Object
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
-
#position ⇒ Object
Returns the value of attribute position.
-
#skill_name ⇒ Object
Returns the value of attribute skill_name.
-
#skill_name_valid ⇒ Object
Returns the value of attribute skill_name_valid.
-
#state_ranks ⇒ Object
Returns the value of attribute state_ranks.
-
#weapon_set ⇒ Object
Returns the value of attribute weapon_set.
Attributes inherited from BaseItem
#description, #features, #icon_index, #note
Instance Method Summary collapse
- #exp_for_level(level) ⇒ Object
-
#initialize ⇒ Class
constructor
A new instance of Class.
- #to_s ⇒ Object
Methods included from RgssDb::JsonableConstructor
Methods included from RgssDb::Jsonable
Constructor Details
#initialize ⇒ Class
Returns a new instance of Class.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 11 def initialize @id = 0 @name = "" @position = 0 @weapon_set = [] @armor_set = [] @element_ranks = Table.new(1) @state_ranks = Table.new(1) @learnings = [] @skill_name_valid = false @skill_name = "" end |
Instance Attribute Details
#armor_set ⇒ Object
Returns the value of attribute armor_set.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def armor_set @armor_set end |
#element_ranks ⇒ Object
Returns the value of attribute element_ranks.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def element_ranks @element_ranks end |
#exp_params ⇒ Object
Returns the value of attribute exp_params.
35 36 37 |
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb', line 35 def exp_params @exp_params end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def id @id end |
#learnings ⇒ Object
Returns the value of attribute learnings.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def learnings @learnings end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
35 36 37 |
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb', line 35 def params @params end |
#position ⇒ Object
Returns the value of attribute position.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def position @position end |
#skill_name ⇒ Object
Returns the value of attribute skill_name.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def skill_name @skill_name end |
#skill_name_valid ⇒ Object
Returns the value of attribute skill_name_valid.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def skill_name_valid @skill_name_valid end |
#state_ranks ⇒ Object
Returns the value of attribute state_ranks.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def state_ranks @state_ranks end |
#weapon_set ⇒ Object
Returns the value of attribute weapon_set.
28 29 30 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 28 def weapon_set @weapon_set end |
Instance Method Details
#exp_for_level(level) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb', line 25 def exp_for_level(level) lv = level.to_f basis = @exp_params[0].to_f extra = @exp_params[1].to_f acc_a = @exp_params[2].to_f acc_b = @exp_params[3].to_f (basis * ((lv - 1)**(0.9 + acc_a / 250)) * lv * (lv + 1) / (6 + lv**2 / 50 / acc_b) + (lv - 1) * extra) .round.to_i end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb', line 24 def to_s @name.to_s end |