赞 | 1 |
VIP | 0 |
好人卡 | 18 |
积分 | 1 |
经验 | 6526 |
最后登录 | 2013-7-5 |
在线时间 | 334 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 334 小时
- 注册时间
- 2011-10-21
- 帖子
- 413
|
本帖最后由 消失的三千 于 2012-3-30 12:15 编辑
我不搞基的谢谢你的关爱(笑)
照着这个脚本转换了,不过删掉了说明,因为看起来太蛋疼了
吐槽一句:原脚本写法繁琐,原本打算优化些不过貌似这样的写法比较能让新手修改,所以没优化写法了……(这不是吐槽啊踢!)
鼓励:加油!请务必作出个很棒的游戏出来哦!- #原作者:superufo
- #转换者:消失的三千
- #原脚本出处:http://rpg.blue/thread-73243-1-1.html
- #要修改加点的属性在280~318行
- LEVEL_UP_POINT = 3 #升级时所获得的点数
- LEVEL_UP_VARIABLE = 50 #控制角色属性点的变量
- #比如说角色ID1的属性变量就是51,ID2就是52,依此推类
- class Game_Actor < Game_Battler
- def level_up
- @level += 1
- $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
- for learning in self.class.learnings
- learn_skill(learning.skill_id) if learning.level == @level
- end
- end
- end
- class Window_PointCommand < Window_Command
- def initialize
- super(0, 0)
- open
- end
- def window_width
- return 128
- end
- def make_command_list
- add_command(Vocab::param(0), :HPBoost)
- add_command(Vocab::param(1), :MPBoost)
- add_command(Vocab::param(2), :ATKBoost)
- add_command(Vocab::param(3), :DEFBoost)
- add_command(Vocab::param(4), :MATBoost)
- add_command(Vocab::param(5), :MDFBoost)
- add_command(Vocab::param(6), :AGIBoost)
- add_command(Vocab::param(7), :LUKBoost)
- add_command("重叠加点", :PointReset)
- add_command("确认加点", :PointBoost)
- end
- def point_enought
- $point > 0
- end
- end
- class Window_Base < Window
- def draw_actor_hp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, Vocab::param(0))
- if $temp_hp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.mhp.to_s, 2)
- else
- mhp = actor.mhp + $temp_hp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, mhp.to_s ,2)
- self.contents.font.color = normal_color
- if $temp_hp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 184, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 184, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 232, y, 32, 32, $temp_hp.to_s, 1)
- self.contents.font.color = normal_color
- end
- end
- def draw_actor_mp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, Vocab::param(1))
- if $temp_mp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.mmp.to_s, 2)
- else
- mmp = actor.mmp + $temp_mp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, mmp.to_s ,2)
- self.contents.font.color = normal_color
- if $temp_mp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 184, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 184, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 232, y, 32, 32, $temp_mp.to_s, 1)
- self.contents.font.color = normal_color
- end
- end
- def draw_actor_lvup(actor, x, y, type)
- lvup = normal_color
- upcolor = Color.new(255, 128, 128, 255)
- self.contents.font.color = normal_color
- case type
- when 0
- parameter_name = Vocab::param(2)
- parameter_value = actor.atk
- parameter_value_temp = parameter_value + $temp_atk
- if $temp_atk != 0
- lvup = upcolor
- if $temp_atk >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_atk.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- when 1
- parameter_name = Vocab::param(3)
- parameter_value = actor.def
- parameter_value_temp = parameter_value + $temp_def
- if $temp_def != 0
- lvup = upcolor
- if $temp_def >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_def.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- when 2
- parameter_name = Vocab::param(4)
- parameter_value = actor.mat
- parameter_value_temp = parameter_value + $temp_mat
- if $temp_mat != 0
- lvup = upcolor
- if $temp_mat >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_mat.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- when 3
- parameter_name = Vocab::param(5)
- parameter_value = actor.mdf
- parameter_value_temp = parameter_value + $temp_mdf
- if $temp_mdf != 0
- lvup = upcolor
- if $temp_mdf >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_mdf.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- when 4
- parameter_name = Vocab::param(6)
- parameter_value = actor.agi
- parameter_value_temp = parameter_value + $temp_agi
- if $temp_agi != 0
- lvup = upcolor
- if $temp_agi >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- when 5
- parameter_name = Vocab::param(7)
- parameter_value = actor.luk
- parameter_value_temp = parameter_value + $temp_luk
- if $temp_luk != 0
- lvup = upcolor
- if $temp_luk >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 205, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 205, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 205, y, 88, 32, $temp_luk.abs.to_s,1)
- self.contents.font.color = normal_color
- end
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 96, y, 36, 32, parameter_value.to_s)
- self.contents.draw_text(x + 120, y, 36, 32, "→")
- self.contents.font.color = lvup
- self.contents.draw_text(x + 156, y, 96, 32, parameter_value_temp.to_s)
- self.contents.font.color = normal_color
- end
- end
- class Window_Lvpoint < Window_Base
- def initialize
- super(416,358,128,58)
- refresh
- end
- def refresh
- self.contents.clear
- parameter_name = "剩余点数"
- parameter_value = $point
- self.contents.font.color = system_color
- self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_value.to_s,2)
- end
- end
- class Window_Lvup < Window_Base
- def initialize
- super(128, 60, 416, 256)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = $game_party.menu_actor
- refresh
- end
- def refresh
- self.contents.clear
- draw_actor_face(@actor, 0, 32)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 96, 0)
- draw_actor_level(@actor, 224, 0)
- draw_actor_hp_lvup(@actor, 96, 32)
- draw_actor_mp_lvup(@actor, 96, 56)
- draw_actor_lvup(@actor, 96, 80, 0)
- draw_actor_lvup(@actor, 96, 104, 1)
- draw_actor_lvup(@actor, 96, 128, 2)
- draw_actor_lvup(@actor, 96, 152, 3)
- draw_actor_lvup(@actor, 96, 176, 4)
- draw_actor_lvup(@actor, 96, 200, 5)
- end
- end
- class Scene_Lvup < Scene_Base
- def initialize
- @actor = $game_party.menu_actor
- set_data
- create_window
- end
- def dispose_background
- @background_sprite.dispose
- end
- def create_window
- @command_window = Window_PointCommand.new
- @command_window.set_handler(:HPBoost, method(:CommandHPBoost))
- @command_window.set_handler(:MPBoost, method(:CommandMPBoost))
- @command_window.set_handler(:ATKBoost, method(:CommandATKBoost))
- @command_window.set_handler(:DEFBoost, method(:CommandDEFBoost))
- @command_window.set_handler(:MATBoost, method(:CommandMATBoost))
- @command_window.set_handler(:MDFBoost, method(:CommandMDFBoost))
- @command_window.set_handler(:AGIBoost, method(:CommandAGIBoost))
- @command_window.set_handler(:LUKBoost, method(:CommandLUKBoost))
- @command_window.set_handler(:PointReset, method(:reset_point))
- @command_window.set_handler(:PointBoost, method(:process_point))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.y = 56
- @lvup_window = Window_Lvup.new
- @lvpoint_window = Window_Lvpoint.new
- end
- def set_data
- reset_point
-
- @hp_hp = 15;@hp_mp = 0
- @hp_atk = 0;@hp_def = 0
- @hp_mat = 0;@hp_mdf = 0
- @hp_agi = 0;@hp_luk = 0
-
- @mp_hp = 0;@mp_mp = 10
- @mp_atk = 0;@mp_def = 0
- @mp_mat = 0;@mp_mdf = 0
- @mp_agi = 0;@mp_luk = 0
-
- @atk_hp = 0;@atk_mp = 0
- @atk_atk = 1;@atk_def = 0
- @atk_mat = 0;@atk_mdf = 0
- @atk_agi = 0;@atk_luk = 0
-
- @def_hp = 0;@def_mp = 0
- @def_atk = 0;@def_def = 1
- @def_mat = 0;@def_mdf = 0
- @def_agi = 0;@def_luk = 0
-
- @mat_hp = 0;@mat_mp = 0
- @mat_atk = 0;@mat_def = 0
- @mat_mat = 1;@mat_mdf = 0
- @mat_agi = 0;@mat_luk = 0
-
- @mdf_hp = 0;@mdf_mp = 0
- @mdf_atk = 0;@mdf_def = 0
- @mdf_mat = 0;@mdf_mdf = 1
- @mdf_agi = 0;@mdf_luk = 0
-
- @agi_hp = 0;@agi_mp = 0
- @agi_atk = 0;@agi_def = 0
- @agi_mat = 0;@agi_mdf = 0
- @agi_agi = 1;@agi_luk = 0
-
- @luk_hp = 0;@luk_mp = 0
- @luk_atk = 0;@luk_def = 0
- @luk_mat = 0;@luk_mdf = 0
- @luk_agi = 0;@luk_luk = 1
- end
- def window_refresh
- @lvup_window.refresh
- @lvpoint_window.refresh
- @command_window.activate
- end
- def CommandHPBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @hp_hp
- $temp_mp += @hp_mp
- $temp_atk += @hp_atk
- $temp_def += @hp_def
- $temp_mat += @hp_mat
- $temp_mdf += @hp_mdf
- $temp_agi += @hp_agi
- $temp_luk += @hp_luk
- $point -= 1
- window_refresh
- end
- def CommandMPBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @mp_hp
- $temp_mp += @mp_mp
- $temp_atk += @mp_atk
- $temp_def += @mp_def
- $temp_mat += @mp_mat
- $temp_mdf += @mp_mdf
- $temp_agi += @mp_agi
- $temp_luk += @mp_luk
- $point -= 1
- window_refresh
- end
- def CommandATKBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @atk_hp
- $temp_mp += @atk_mp
- $temp_atk += @atk_atk
- $temp_def += @atk_def
- $temp_mat += @atk_mat
- $temp_mdf += @atk_mdf
- $temp_agi += @atk_agi
- $temp_luk += @atk_luk
- $point -= 1
- window_refresh
- end
- def CommandDEFBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @def_hp
- $temp_mp += @def_mp
- $temp_atk += @def_atk
- $temp_def += @def_def
- $temp_mat += @def_mat
- $temp_mdf += @def_mdf
- $temp_agi += @def_agi
- $temp_luk += @def_luk
- $point -= 1
- window_refresh
- end
- def CommandMATBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @mat_hp
- $temp_mp += @mat_mp
- $temp_atk += @mat_atk
- $temp_def += @mat_def
- $temp_mat += @mat_mat
- $temp_mdf += @mat_mdf
- $temp_agi += @mat_agi
- $temp_luk += @mat_luk
- $point -= 1
- window_refresh
- end
- def CommandMDFBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @mdf_hp
- $temp_mp += @mdf_mp
- $temp_atk += @mdf_atk
- $temp_def += @mdf_def
- $temp_mat += @mdf_mat
- $temp_mdf += @mdf_mdf
- $temp_agi += @mdf_agi
- $temp_luk += @mdf_luk
- $point -= 1
- window_refresh
- end
- def CommandAGIBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @agi_hp
- $temp_mp += @agi_mp
- $temp_atk += @agi_atk
- $temp_def += @agi_def
- $temp_mat += @agi_mat
- $temp_mdf += @agi_mdf
- $temp_agi += @agi_agi
- $temp_luk += @agi_luk
- $point -= 1
- window_refresh
- end
- def CommandLUKBoost
- Sound.play_buzzer if $point == 0
- @command_window.activate if $point == 0
- return if $point == 0
- $temp_hp += @luk_hp
- $temp_mp += @luk_mp
- $temp_atk += @luk_atk
- $temp_def += @luk_def
- $temp_mat += @luk_mat
- $temp_mdf += @luk_mdf
- $temp_agi += @luk_agi
- $temp_luk += @luk_luk
- $point -= 1
- window_refresh
- end
- def reset_point
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- $temp_hp = 0
- $temp_mp = 0
- $temp_atk = 0
- $temp_def = 0
- $temp_mat = 0
- $temp_mdf = 0
- $temp_agi = 0
- $temp_luk = 0
- window_refresh if @command_window != nil
- end
- def process_point
- if $temp_hp + $temp_mp + $temp_atk + $temp_def + $temp_mat + $temp_mdf + $temp_agi + $temp_luk < 1
- Sound.play_buzzer
- @command_window.activate
- return
- else
- $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
- @actor.add_param(0, $temp_hp)
- @actor.add_param(1, $temp_mp)
- @actor.add_param(2, $temp_atk)
- @actor.add_param(3, $temp_def)
- @actor.add_param(4, $temp_mat)
- @actor.add_param(5, $temp_mdf)
- @actor.add_param(6, $temp_agi)
- @actor.add_param(7, $temp_luk)
- reset_point
- end
- end
- end
复制代码 |
|