Class: RPG::Class
Defined Under Namespace
Classes: Learning
Instance Attribute Summary collapse
-
#exp_params ⇒ Object
Returns the value of attribute exp_params.
-
#learnings ⇒ Object
Returns the value of attribute learnings.
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from BaseItem
#description, #features, #icon_index, #id, #name, #note
Instance Method Summary collapse
- #exp_for_level(level) ⇒ Object
-
#initialize ⇒ Class
constructor
A new instance of Class.
Constructor Details
#initialize ⇒ Class
Returns a new instance of Class.
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
# File 'lib/R3EXS/RGSS3.rb', line 668 def initialize super @exp_params = [30, 20, 30, 30] @params = Table.new(8, 100) (1..99).each do |i| @params[0, i] = 400 + i * 50 @params[1, i] = 80 + i * 10 (2..5).each { |j| @params[j, i] = 15 + i * 5 / 4 } (6..7).each { |j| @params[j, i] = 30 + i * 5 / 2 } end @learnings = [] @features.push(RPG::BaseItem::Feature.new(23, 0, 1)) @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95)) @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05)) @features.push(RPG::BaseItem::Feature.new(22, 2, 0.04)) @features.push(RPG::BaseItem::Feature.new(41, 1)) @features.push(RPG::BaseItem::Feature.new(51, 1)) @features.push(RPG::BaseItem::Feature.new(52, 1)) end |
Instance Attribute Details
#exp_params ⇒ Object
Returns the value of attribute exp_params.
698 699 700 |
# File 'lib/R3EXS/RGSS3.rb', line 698 def exp_params @exp_params end |
#learnings ⇒ Object
Returns the value of attribute learnings.
700 701 702 |
# File 'lib/R3EXS/RGSS3.rb', line 700 def learnings @learnings end |
#params ⇒ Object
Returns the value of attribute params.
699 700 701 |
# File 'lib/R3EXS/RGSS3.rb', line 699 def params @params end |
Instance Method Details
#exp_for_level(level) ⇒ Object
688 689 690 691 692 693 694 695 696 |
# File 'lib/R3EXS/RGSS3.rb', line 688 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 return (basis * ((lv - 1) ** (0.9 + acc_a / 250)) * lv * (lv + 1) / (6 + lv ** 2 / 50 / acc_b) + (lv - 1) * extra).round.to_i end |