Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Stat Allocation Upon Leveling v 1.1
- Created by Kio Kurashi
- Version History:
- 1.0 = Initial Version
- 1.1 = Rather breaking bug fixed (Cannot yield from root Fiber.)
- Free for commercial and personal use. Credit is not required, but appreciated.
- Known bugs: None.
- =end
- module STAT_MODULE
- VAR_CHOOSE_STAT_LEVEL = 10 #CHANGE THIS TO VARIABLE YOU WANT
- end
- class Game_Actor
- alias kurashi_level_up_stat_choice level_up
- def level_up
- @loop_count = 3
- $game_message.add("#{name} Leveled Up!!")
- while @loop_count > 0
- $game_message.add("Pick a stat to increase.\n Points to spend: #{@loop_count}")
- params = []
- choices = []
- choices.push("Strength (Current: #{self.atk})")
- choices.push("Endurance (Current: #{self.def})")
- choices.push("Speed (Current: #{self.agi})")
- choices.push("Resistance (Current: #{self.luk})")
- params.push(choices)
- params.push(0)
- setup_choices(params)
- Fiber.yield while $game_message.choice? if SceneManager.scene.is_a?(Scene_Map)
- SceneManager.scene.wait_for_message while $game_message.choice? if SceneManager.scene.is_a?(Scene_Battle)
- choice_result = $game_variables[STAT_MODULE::VAR_CHOOSE_STAT_LEVEL]
- case choice_result
- when 1
- add_param(2, 1)
- when 2
- add_param(3, 1)
- when 3
- add_param(6, 1)
- when 4
- add_param(7, 1)
- end
- @loop_count -= 1
- end
- kurashi_level_up_stat_choice
- refresh
- end
- def setup_choices(params)
- params[0].each {|s| $game_message.choices.push(s) }
- $game_message.choice_cancel_type = params[1]
- $game_message.choice_proc = Proc.new {|n|
- begin; @branch[@indent] = n;rescue;end
- $game_variables[STAT_MODULE::VAR_CHOOSE_STAT_LEVEL] = n + 1
- }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement