查看: 1979|回复: 0

[已经解决] 求助,这个加点脚本怎么换人,和人物扩张脚本一起用

[复制链接]
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2016-1-31 21:01:31 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 yang1zhi 于 2016-1-31 21:09 编辑

这两个脚本怎么结合在一起。
一起使用后只有主角可以加点。切换人物无效。

看脚本,应该是把$game_party.actors都改成$game_party.waiting_actors
但是没用

只要出战人物能加点就好,待机的保留


试出来了


加点脚本
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================


  4. # 脚本使用设定:

  5. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  6. LEVEL_UP_VARIABLE = 100  # 储存角色点数的变量编号与角色id编号的差值
  7.                          # 默认情况 = 100,
  8.                          # 则是数据库里1号角色的加点数存于101号变量
  9.                          # 3号角色的加点数存于103号变量。
  10.                          # 你可以直接操作变量赠与角色可分配点数

  11. # 每增加一次点数,各项能力值的变化:357-410行
  12.                         
  13. # 使用方法介绍:

  14. # 本脚本不会取代原猩?豆δ埽?皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  15. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  16. # 1-99级全部等于一个相同数值就行了。

  17. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  18. # 默认都是0号

  19. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  20. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new

  21. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG

  22. #==============================================================================
  23. # ■ Window_Command
  24. #------------------------------------------------------------------------------
  25. #  一般的命令选择行窗口。(追加定义)
  26. #==============================================================================
  27. class Window_Command < Window_Selectable
  28.   #--------------------------------------------------------------------------
  29.   # ● 项目有效化
  30.   #     index : 项目编号
  31.   #--------------------------------------------------------------------------
  32.   def able_item(index)
  33.     draw_item(index, normal_color)
  34.   end
  35. end
  36. #==============================================================================
  37. # ■ Game_Actor
  38. #------------------------------------------------------------------------------
  39. #  处理角色的类。(再定义)
  40. #==============================================================================
  41. class Game_Actor < Game_Battler
  42.   #--------------------------------------------------------------------------
  43.   # ● 更改 EXP
  44.   #     exp : 新的 EXP
  45.   #--------------------------------------------------------------------------
  46.   def exp=(exp)
  47.     @exp = [[exp, 9999999].min, 0].max
  48.     # 升级
  49.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  50.       @level += 1
  51.       # 增加4点可自由分配的点数
  52.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  53.       # 学会特技
  54.       for j in $data_classes[@class_id].learnings
  55.         if j.level == @level
  56.           learn_skill(j.skill_id)
  57.         end
  58.       end
  59.     end
  60.     # 降级
  61.     while @exp < @exp_list[@level]
  62.       @level -= 1
  63.     end
  64.     # 修正当前的 HP 与 SP 超过最大值
  65.     @hp = [@hp, self.maxhp].min
  66.         @ap = [@hp, self.maxhp].min

  67.     @sp = [@sp, self.maxsp].min
  68.     @mp = [@sp, self.maxsp].min
  69.   end
  70. end
  71. #==============================================================================
  72. # ■ Window_Base
  73. #------------------------------------------------------------------------------
  74. #  游戏中全部窗口的超级类(追加定义)
  75. #==============================================================================
  76. class Window_Base < Window
  77.   #--------------------------------------------------------------------------
  78.   # ● 描绘 HP
  79.   #     actor : 角色
  80.   #     x     : 描画目标 X 坐标
  81.   #     y     : 描画目标 Y 坐标
  82.   #     width : 描画目标的宽
  83.   #--------------------------------------------------------------------------
  84.   def draw_actor_hp_lvup(actor, x, y)
  85.     self.contents.font.color = system_color
  86.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  87.     if $temp_hp == 0
  88.       self.contents.font.color = normal_color
  89.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  90.     else
  91.       maxhp = actor.maxhp + $temp_hp
  92.       self.contents.font.color = Color.new(255, 128, 128, 255)
  93.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  94.       self.contents.font.color = normal_color      
  95.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  96.       if $temp_hp >=0
  97.         self.contents.font.color = Color.new(255, 128, 128, 255)
  98.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  99.       else
  100.         self.contents.font.color = Color.new(255,255,0,255)
  101.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  102.       end
  103.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  104.       self.contents.font.color = normal_color
  105.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  106.     end
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 描绘 SP
  110.   #     actor : 角色
  111.   #     x     : 描画目标 X 坐标
  112.   #     y     : 描画目标 Y 坐标
  113.   #     width : 描画目标的宽
  114.   #--------------------------------------------------------------------------
  115.   def draw_actor_sp_lvup(actor, x, y)
  116.     self.contents.font.color = system_color
  117.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  118.     if $temp_sp == 0
  119.       self.contents.font.color = normal_color
  120.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  121.     else
  122.       maxsp = actor.maxsp + $temp_sp
  123.       self.contents.font.color = Color.new(255, 128, 128, 255)
  124.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  125.       self.contents.font.color = normal_color      
  126.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  127.       if $temp_sp >=0
  128.         self.contents.font.color = Color.new(255, 128, 128, 255)
  129.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  130.       else
  131.         self.contents.font.color = Color.new(255,255,0,255)
  132.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  133.       end
  134.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  135.       self.contents.font.color = normal_color
  136.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  137.     end
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 描绘能力值
  141.   #     actor : 角色
  142.   #     x     : 描画目标 X 坐标
  143.   #     y     : 描画目标 Y 坐标
  144.   #     type  : 能力值种类 (0~4)
  145.   #--------------------------------------------------------------------------
  146.   def draw_actor_lvup(actor, x, y, type)   
  147.     # 定义数字颜色
  148.     lvup = normal_color
  149.     upcolor = Color.new(255, 128, 128, 255)
  150.     self.contents.font.color = normal_color   
  151.     case type
  152.     when 0
  153.       parameter_name = $data_system.words.str
  154.       parameter_value = actor.str
  155.       parameter_value_temp = parameter_value + $temp_str
  156.       if $temp_str != 0
  157.         lvup = upcolor
  158.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  159.         if $temp_str >= 0
  160.           self.contents.font.color = lvup
  161.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  162.         else
  163.           self.contents.font.color = Color.new(255,255,0,255)
  164.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  165.         end        
  166.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  167.         self.contents.font.color = normal_color
  168.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  169.       end
  170.     when 1
  171.       parameter_name = $data_system.words.dex
  172.       parameter_value = actor.dex
  173.       parameter_value_temp = parameter_value + $temp_dex
  174.       if $temp_dex != 0
  175.         lvup = upcolor
  176.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  177.         if $temp_dex >= 0
  178.           self.contents.font.color = lvup
  179.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  180.         else
  181.           self.contents.font.color = Color.new(255,255,0,255)
  182.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  183.         end        
  184.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  185.         self.contents.font.color = normal_color
  186.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  187.       end
  188.     when 2
  189.       parameter_name = $data_system.words.agi
  190.       parameter_value = actor.agi
  191.       parameter_value_temp = parameter_value + $temp_agi
  192.       if $temp_agi != 0
  193.         lvup = upcolor
  194.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  195.         if $temp_agi >= 0
  196.           self.contents.font.color = lvup
  197.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  198.         else
  199.           self.contents.font.color = Color.new(255,255,0,255)
  200.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  201.         end        
  202.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  203.         self.contents.font.color = normal_color
  204.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  205.       end
  206.     when 3
  207.       parameter_name = $data_system.words.int
  208.       parameter_value = actor.int
  209.       parameter_value_temp = parameter_value + $temp_int
  210.       if $temp_int != 0
  211.         lvup = upcolor
  212.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  213.         if $temp_int >= 0
  214.           self.contents.font.color = lvup
  215.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  216.         else
  217.           self.contents.font.color = Color.new(255,255,0,255)
  218.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  219.         end        
  220.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  221.         self.contents.font.color = normal_color
  222.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  223.       end
  224.     when 4
  225.       parameter_name = "剩余点数"
  226.       parameter_value = $point
  227.       if $point != 0
  228.         lvup = upcolor
  229.       end
  230.     end   
  231.     self.contents.font.color = system_color
  232.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  233.     self.contents.font.color = normal_color
  234.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  235.     if type != 4
  236.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  237.     end  
  238.     self.contents.font.color = lvup
  239.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  240.     self.contents.font.color = normal_color        
  241.   end
  242. end
  243. #==============================================================================
  244. # ■ Window_lvup
  245. #------------------------------------------------------------------------------
  246. #  显示升级状态窗口。
  247. #==============================================================================
  248. class Window_Lvup < Window_Base
  249.   #--------------------------------------------------------------------------
  250.   # ● 初始化对像
  251.   #     actor : 角色
  252.   #--------------------------------------------------------------------------
  253.   def initialize(actor)
  254.     super(0, 0, 512, 320)
  255.     self.contents = Bitmap.new(width - 32, height - 32)
  256.     @actor = actor
  257.     refresh
  258.   end  
  259.   #--------------------------------------------------------------------------
  260.   # ● 刷新
  261.   #--------------------------------------------------------------------------
  262.   def refresh
  263.     self.contents.clear
  264.     draw_actor_graphic(@actor, 40, 112)
  265.     draw_actor_name(@actor, 4, 0)
  266.     draw_actor_class(@actor, 4 + 144, 0)
  267.     draw_actor_level(@actor, 96, 32)
  268.     draw_actor_state(@actor, 96, 64)   
  269.     draw_actor_hp_lvup(@actor, 96+128, 32)
  270.     draw_actor_sp_lvup(@actor, 96+128, 64)
  271.     draw_actor_lvup(@actor, 96, 128, 0)
  272.     draw_actor_lvup(@actor, 96, 160, 1)
  273.     draw_actor_lvup(@actor, 96, 192, 2)
  274.     draw_actor_lvup(@actor, 96, 224, 3)
  275.     draw_actor_lvup(@actor, 96, 256, 4)
  276.   end
  277. end
  278. #==============================================================================
  279. # ■ Window_Help
  280. #------------------------------------------------------------------------------
  281. #  特技及物品的说明、角色的状态显示的窗口。
  282. #==============================================================================
  283. class Window_Lvup_Help < Window_Base
  284.   #--------------------------------------------------------------------------
  285.   # ● 初始化对像
  286.   #--------------------------------------------------------------------------
  287.   def initialize
  288.     super(0, 320, 640, 160)
  289.     self.contents = Bitmap.new(width - 32, height - 32)
  290.     @test = "" #——这个东西用来检测,节约内存专用
  291.   end  
  292.   #--------------------------------------------------------------------------
  293.   # ● 设置文本
  294.   #--------------------------------------------------------------------------
  295.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  296.     if @test != text1
  297.       @test = text1
  298.     else
  299.       return
  300.     end   
  301.     self.contents.clear
  302.     self.contents.font.color = normal_color
  303.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  304.     if text2 != nil
  305.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  306.     end
  307.     self.contents.font.size -= 4
  308.     if text3 != nil
  309.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  310.     end
  311.     if text4 != nil
  312.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  313.     end
  314.     self.contents.font.size += 4
  315.   end
  316. end
  317. #==============================================================================
  318. # ■ Scene_lvup
  319. #------------------------------------------------------------------------------
  320. #  处理升级画面的类。
  321. #==============================================================================
  322. class Scene_Lvup
  323.   #--------------------------------------------------------------------------
  324.   # ● 初始化对像
  325.   #     actor_index : 角色索引
  326.   #     menu_index : 选项起始位置
  327.   #--------------------------------------------------------------------------
  328.   def initialize(actor_index = 0 , menu_index = 0)
  329.     @actor_index = actor_index
  330.     @menu_index = menu_index
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ● 主处理
  334.   #--------------------------------------------------------------------------
  335.   def main
  336.     s1 = "HP上升"
  337.         s2 = "MP上升"

  338.     s3 = $data_system.words.str+"上升"
  339.     s4 = $data_system.words.dex+"上升"
  340.     s5 = $data_system.words.agi+"上升"
  341.     s6 = $data_system.words.int+"上升"
  342.     s7 = "确认"
  343.     s8 = "重置"
  344.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7, s8])
  345.     @command_window.index = @menu_index
  346.     # 获取角色
  347.     @actor = $game_party.actors[@actor_index]
  348.     # 将角色的剩余点数带入
  349.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  350.     # 初始化临时量
  351.     $temp_str = 0
  352.     $temp_dex = 0
  353.     $temp_agi = 0
  354.     $temp_int = 0
  355.     $temp_hp = 0
  356.     $temp_sp = 0
  357.     #=========================================================================
  358.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  359.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  360.     #=========================================================================
  361.     # 每提升一次力量,提升多少附加能力
  362.     #=========================================================================
  363.     @str_hp = 0     # 每提升一次力量附加提升多少HP
  364.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  365.     @str_dex = 0    # 每提升一次力量附加提升多少灵巧
  366.     @str_agi = 0    # 每提升一次力量附加提升多少速度
  367.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  368.     @str_str = 5    # 每提升一次力量附加提升多少力量
  369.     #=========================================================================
  370.     # 每提升一次灵巧,提升多少附加能力
  371.     #=========================================================================
  372.     @dex_hp = 0     # 每提升一次灵巧附加提升多少HP
  373.     @dex_sp = 0     # 每提升一次灵巧附加提升多少SP
  374.     @dex_str = 0    # 每提升一次灵巧附加提升多少力量
  375.     @dex_agi = 0    # 每提升一次灵巧附加提升多少速度
  376.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  377.     @dex_dex = 5    # 每提升一次灵巧附加提升多少灵巧
  378.     #=========================================================================
  379.     # 每提升一次速度,提升多少附加能力
  380.     #=========================================================================
  381.     @agi_hp = 0     # 每提升一次速度附加提升多少HP
  382.     @agi_sp = 0     # 每提升一次速度附加提升多少SP
  383.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  384.     @agi_dex = 0    # 每提升一次速度附加提升多少灵巧
  385.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  386.     @agi_agi = 5    # 每提升一次速度附加提升多少速度
  387.     #=========================================================================
  388.     # 每提升一次魔力,提升多少附加能力
  389.     #=========================================================================
  390.     @int_hp = 0     # 每提升一次魔力附加提升多少HP
  391.     @int_sp = 0    # 每提升一次魔力附加提升多少SP
  392.     @int_str = 0   # 每提升一次魔力附加提升多少力量
  393.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  394.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  395.     @int_int = 5   # 每提升一次魔力附加提升多少魔力
  396.     #=========================================================================
  397.     # 每提升一次体力,提升多少附加能力
  398.     #=========================================================================
  399.     @hp = 10       # 每提升一次体力提升多少HP
  400.     @sp = 0       # 每提升一次体力提升多少SP
  401.     @hp_str = 0   # 每提升一次体力提升多少力量
  402.     @hp_dex = 0   # 每提升一次体力提升多少速度
  403.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  404.     @hp_int = 0   # 每提升一次体力提升多少魔力   
  405.         #=========================================================================
  406.     # 每提升一次体力,提升多少附加能力
  407.     #=========================================================================
  408.     @ap = 0       # 每提升一次体力提升多少HP
  409.     @mp = 10       # 每提升一次体力提升多少SP
  410.     @hp_str = 0   # 每提升一次体力提升多少力量
  411.     @hp_dex = 0   # 每提升一次体力提升多少速度
  412.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  413.     @hp_int = 0   # 每提升一次体力提升多少魔力   

  414.     # 定义说明文字
  415.     @text_hp_sc = "HP可以延长生存的时间!"
  416.         @text_hp_sc = "MP可以增加技能次数!"

  417.     @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
  418.     @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和必杀!"
  419.     @text_agi_sc = $data_system.words.agi + "可以提高回避、命中、逃跑成功率!"
  420.     @text_int_sc = $data_system.words.int + "可以提高魔法的效果,可以增加1点魔法!"
  421.     @text_save = "保存分配情况并返回游戏"
  422.     @text_reset= "重新分配能力点数"
  423.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  424.     @text_hp = "最大" + $data_system.words.hp + "值"
  425.     @text_sp = "最大" + $data_system.words.sp + "值"
  426.     @text_str = "最大" + $data_system.words.str + "值"
  427.     @text_dex = "最大" + $data_system.words.dex + "值"
  428.     @text_agi = "最大" + $data_system.words.agi + "值"
  429.     @text_int = "最大" + $data_system.words.int + "值"
  430.     s_disable
  431.     # 生成状态窗口
  432.     @lvup_window = Window_Lvup.new(@actor)
  433.     @lvup_window.x = 128
  434.     @lvup_window.y = 0   
  435.     # 生成帮助窗口并初始化帮助文本
  436.     @help_window = Window_Lvup_Help.new   
  437.     # 执行过渡
  438.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  439.     # 主循环
  440.     loop do
  441.       # 刷新游戏画面
  442.       Graphics.update
  443.       # 刷新输入信息
  444.       Input.update
  445.       # 刷新画面
  446.       update
  447.       # 如果切换画面就中断循环
  448.       if $scene != self
  449.         break
  450.       end
  451.     end
  452.     # 准备过渡
  453.     Graphics.freeze
  454.     # 释放窗口
  455.     @command_window.dispose
  456.     @lvup_window.dispose
  457.     @help_window.dispose
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 刷新画面
  461.   #--------------------------------------------------------------------------
  462.   def update
  463.     # 刷新窗口
  464.     @command_window.update
  465.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  466.     s_disable
  467.     @lvup_window.update
  468.     #=============================================================
  469.     # 按下 B 键的情况下
  470.     #=============================================================
  471.     if Input.trigger?(Input::B)
  472.       # 演奏取消 SE
  473.       $game_system.se_play($data_system.cancel_se)
  474.       # 切换到地图画面
  475.       $scene = Scene_Map.new
  476.       return
  477.     end
  478.     #=============================================================
  479.     # 按下 C 键的情况下
  480.     #=============================================================
  481.     if Input.trigger?(Input::C)      
  482.       if @command_window.index == 6
  483.           # 演奏确定 SE
  484.         $game_system.se_play($data_system.decision_se)
  485.         # 将角色的剩余点数带回
  486.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  487.         # 将角色点数实际加上
  488.         @actor.str += $temp_str
  489.         @actor.dex += $temp_dex
  490.         @actor.agi += $temp_agi
  491.         @actor.int += $temp_int
  492.         @actor.maxhp += $temp_hp
  493.         @actor.maxsp += $temp_sp
  494.         # 切换到地图画面
  495.         $scene = Scene_Map.new
  496.         return
  497.       end
  498.       if @command_window.index == 7
  499.           # 演奏确定 SE
  500.         $game_system.se_play($data_system.cancel_se)
  501.           # 将角色的剩余点数带入
  502.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  503.           # 初始化临时量
  504.         $temp_str = 0
  505.         $temp_dex = 0
  506.         $temp_agi = 0
  507.         $temp_int = 0
  508.         $temp_hp = 0
  509.         $temp_sp = 0
  510.         @lvup_window.refresh
  511.         return
  512.       end
  513.       if $point == 0
  514.         # 演奏冻结 SE
  515.         $game_system.se_play($data_system.buzzer_se)
  516.         return
  517.       end
  518.       case @command_window.index
  519.       when 0
  520.         # 演奏确定 SE
  521.         $game_system.se_play($data_system.decision_se)
  522.         $temp_hp += @hp
  523.         $temp_sp += @sp
  524.         $temp_str += @hp_str
  525.         $temp_dex += @hp_dex
  526.         $temp_agi += @hp_agi
  527.         $temp_int += @hp_int
  528.         $point -= 1
  529.         @lvup_window.refresh
  530.         s_disable
  531.         return
  532.               when 1
  533.         # 演奏确定 SE
  534.         $game_system.se_play($data_system.decision_se)
  535.         $temp_hp += @ap
  536.         $temp_sp += @mp
  537.         $temp_str += @hp_str
  538.         $temp_dex += @hp_dex
  539.         $temp_agi += @hp_agi
  540.         $temp_int += @hp_int
  541.         $point -= 1
  542.         @lvup_window.refresh
  543.         s_disable
  544.         return

  545.       when 2
  546.         # 演奏确定 SE
  547.         $game_system.se_play($data_system.decision_se)
  548.         $temp_str += @str_str
  549.         $temp_hp += @str_hp
  550.         $temp_sp += @str_sp
  551.         $temp_dex += @str_dex
  552.         $temp_agi += @str_agi
  553.         $temp_int += @str_int
  554.         $point -= 1
  555.         @lvup_window.refresh
  556.         s_disable
  557.         return
  558.       when 3
  559.         # 演奏确定 SE
  560.         $game_system.se_play($data_system.decision_se)
  561.         $temp_dex += @dex_dex
  562.         $temp_hp += @dex_hp
  563.         $temp_sp += @dex_sp
  564.         $temp_str += @dex_str
  565.         $temp_agi += @dex_agi
  566.         $temp_int += @dex_int
  567.         $point -= 1
  568.         @lvup_window.refresh
  569.         s_disable
  570.         return
  571.       when 4
  572.         # 演奏确定 SE
  573.         $game_system.se_play($data_system.decision_se)
  574.         $temp_agi += @agi_agi
  575.         $temp_hp += @agi_hp
  576.         $temp_sp += @agi_sp
  577.         $temp_str += @agi_str
  578.         $temp_dex += @agi_dex
  579.         $temp_int += @agi_int
  580.         $point -= 1
  581.         @lvup_window.refresh
  582.         s_disable
  583.         return
  584.       when 5
  585.         # 演奏确定 SE
  586.         $game_system.se_play($data_system.decision_se)
  587.         $temp_int += @int_int
  588.         $temp_hp += @int_hp
  589.         $temp_sp += @int_sp
  590.         $temp_str += @int_str
  591.         $temp_dex += @int_dex
  592.         $temp_agi += @int_agi
  593.         $point -= 1
  594.         @lvup_window.refresh
  595.         s_disable
  596.         return
  597.       end
  598.     end
  599.     #=============================================================
  600.     # 什么都没有按下的情况
  601.     #=============================================================
  602.     case @command_window.index   
  603.     when 0  # 增加HP
  604.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  605.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  606.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  607.           when 1  # 增加MP
  608.       temptext1 = @text_hp + @ap.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  609.       temptext2 = @text_sp + @mp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  610.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)

  611.     when 2  # 增加力量
  612.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  613.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  614.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  615.     when 3  # 增加灵巧
  616.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  617.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  618.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  619.     when 4  # 增加速度
  620.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  621.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  622.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  623.     when 5  # 增加魔力
  624.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  625.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  626.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  627.     when 6 # 保存设定
  628.       @help_window.lvup_text(@text_save)
  629.     when 7 # 点数重置
  630.       @help_window.lvup_text(@text_reset)     
  631.     end
  632.     #=============================================================
  633.     # 按下R与L换人的情况
  634.     #=============================================================      
  635.     if Input.trigger?(Input::R)
  636.       # 演奏光标 SE
  637.       $game_system.se_play($data_system.cursor_se)
  638.       # 移至下一位角色
  639.       @actor_index += 1
  640.       @actor_index %= $game_party.actors.size
  641.       # 切换到别的状态画面
  642.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  643.       return
  644.     end
  645.     # 按下 L 键的情况下
  646.     if Input.trigger?(Input::L)
  647.       # 演奏光标 SE
  648.       $game_system.se_play($data_system.cursor_se)
  649.       # 移至上一位角色
  650.       @actor_index += $game_party.actors.size - 1
  651.       @actor_index %= $game_party.actors.size
  652.       # 切换到别的状态画面
  653.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  654.       return
  655.     end
  656.   end  
  657.   #--------------------------------------------------------------------------
  658.   # ● 选项明暗判断
  659.   #--------------------------------------------------------------------------
  660.   def s_disable
  661.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  662.     if $point == 0
  663.       @command_window.disable_item(0)
  664.       @command_window.disable_item(1)
  665.       @command_window.disable_item(2)
  666.       @command_window.disable_item(3)
  667.       @command_window.disable_item(4)
  668.       @command_window.disable_item(5)

  669.     else
  670.       @command_window.able_item(0)
  671.       @command_window.able_item(1)      
  672.       @command_window.able_item(2)
  673.       @command_window.able_item(3)
  674.       @command_window.able_item(4)
  675.       @command_window.able_item(5)
  676.       
  677.     end
  678.   end
  679. end

  680. #==============================================================================
  681. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  682. #==============================================================================
复制代码


人物扩张脚本
  1. # 赠品:人物扩张脚本
  2. # 窗口界面部分来自 桜雅 在土 XRXS26
  3. module BFS_Setting
  4.   # 待机人物是否获得经验
  5.   BACKWARD_EXP_GAINABLE = false
  6.   # 3人以下的时候,菜单是否拉伸大小(建议不要使用)
  7.   MENU_STATUS_STRETCH   = false
  8.   # 进入键
  9.   MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT
  10.   # 离开键
  11.   MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  
  12.   # 可更换角色最小编号
  13.   MENU_MEMBER_CHANGE_INDEX_MIN = 0
  14.   # 不能待机的角色编号
  15.   FORCETOBATTLE_ACTORS         = [1]  
  16.   # 不能加入战斗的角色编号
  17.   UMBATTLABLE_ACTORS           = []   
  18.   # 不能移动的角色编号
  19.   UNMOVABLE_ACTORS             = []
  20.   # 列数
  21.   COLUMN_MAX = 1
  22.   # 光标高度
  23.   CURSOR_HEIGHT = 96
  24.   # 一行的高度
  25.   LINE_HEIGHT = 116
  26. end
  27. class Game_Temp
  28.   attr_accessor :friends_need_refresh
  29.   alias rwkz_ini initialize
  30.   def initialize
  31.     rwkz_ini
  32.     @friend_need_refresh = false
  33.   end
  34. end
  35. class Scene_Map
  36.   alias rwkz_main main
  37.   def main
  38.     if $game_temp.friends_need_refresh
  39.       BFS_Friends.delete_all_friends
  40.       BFS_Friends.prepare_for_transferring
  41.       $game_temp.friends_need_refresh = false
  42.     end
  43.     rwkz_main
  44.   end
  45. end
  46. class Game_Party
  47.   attr_accessor :waiting_actors
  48.   def gain_exp(exp)
  49.     for i in 0...$game_party.actors.size
  50.       actor = $game_party.actors[i]
  51.       if actor.cant_get_exp? == false
  52.         actor.exp += exp
  53.       end
  54.     end
  55.     if BFS_Setting::BACKWARD_EXP_GAINABLE
  56.       for i in 0...$game_party.waiting_actors.size
  57.         actor = $game_party.waiting_actors[i]
  58.         if actor.cant_get_exp? == false
  59.           actor.exp += exp
  60.         end
  61.       end
  62.     end
  63.   end
  64.   alias rk initialize
  65.   def initialize
  66.     rk
  67.     @waiting_actors = []
  68.   end
  69.   def remove_actor(actor_id)
  70.     if @actors.size == 1
  71.       p "数据库中的角色数量会变为0,为了游戏的正常运行,请不要这样做。"
  72.       p "因此,系统可能会忽略此次操作,见谅"
  73.       p "如有特殊情况,请在脚本中删除这段文字"
  74.       return
  75.     end
  76.     switch_leader if actor_id == $game_party.actors[0].id
  77.     if @actors.include?($game_actors[actor_id])
  78.       @actors.delete($game_actors[actor_id])
  79.       if @waiting_actors != []
  80.         waiting_leader = @waiting_actors[0]
  81.         @waiting_actors.delete_at(0)
  82.         @actors.push(waiting_leader)
  83.       end
  84.     else
  85.       if @waiting_actors.include?($game_actors[actor_id])
  86.         @waiting_actors.delete($game_actors[actor_id])
  87.       else
  88.         return
  89.       end
  90.     end
  91.     friend_party_update
  92.     BFS_Friends.delete_all_friends
  93.     BFS_Friends.prepare_for_transferring
  94.     $game_player.refresh
  95.     $scene.spriteset.dispose
  96.     $scene.spriteset = Spriteset_Map.new
  97.     $scene.hud_update
  98.   end
  99.   def add_actor(actor_id)
  100.     actor = $game_actors[actor_id]
  101.     unless @actors.include?(actor) or @waiting_actors.include?(actor)
  102.       if @actors.size < $game_variables[1]
  103.         @actors.push(actor)
  104.         $game_player.refresh
  105.         friend_party_update
  106.         BFS_Friends.add(actor_id)
  107.         $scene.spriteset.dispose
  108.         $scene.spriteset = Spriteset_Map.new
  109.         BFS_Friends.weapon_recheck
  110.       else
  111.         if @waiting_actors.size < $game_variables[2]
  112.           @waiting_actors.push(actor)
  113.         end
  114.       end
  115.     end
  116.   end
  117. end
  118. #==============================================================================
  119. # --- XRXS. 第二カーソル 機構 ---
  120. #------------------------------------------------------------------------------
  121. #     ウィンドウに .index2 プロパティを追加します。
  122. #==============================================================================
  123. module XRXS_Cursor2
  124.   #--------------------------------------------------------------------------
  125.   # ● オブジェクト初期化
  126.   #--------------------------------------------------------------------------
  127.   def initialize(x, y, w, h)
  128.     super(x, y, h, w)
  129.     # 補助ウィンドウ(透明)を作成:カーソル専用
  130.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  131.     @xrxsc2_window.opacity = 0
  132.     @xrxsc2_window.active = false
  133.     @xrxsc2_window.index = -1
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ○ 第二カーソルの設置
  137.   #--------------------------------------------------------------------------
  138.   def index2
  139.     return @xrxsc2_window.index
  140.   end
  141.   def index2=(index)
  142.     @xrxsc2_window.index = index
  143.     if index == -1
  144.       @xrxsc2_window.cursor_rect.empty
  145.     else
  146.       @xrxsc2_window.x = self.x
  147.       @xrxsc2_window.y = self.y
  148.       @xrxsc2_window.cursor_rect = self.cursor_rect
  149.     end
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ○ 先頭の行の設定
  153.   #--------------------------------------------------------------------------
  154.   def top_row=(row)
  155.     super
  156.     # 補助ウィンドウの oy を更新
  157.     pre_oy = @xrxsc2_window.oy
  158.     @xrxsc2_window.oy = self.oy
  159.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ○ 解放
  163.   #--------------------------------------------------------------------------
  164.   def dispose
  165.     @xrxsc2_window.dispose
  166.     super
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ○ X, Y 座標
  170.   #--------------------------------------------------------------------------
  171.   def x=(n)
  172.     super
  173.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  174.   end
  175.   def y=(n)
  176.     super
  177.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  178.   end
  179. end
  180. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  181. # by 桜雅 在土

  182. #==============================================================================
  183. # ■ Window_MenuStatus
  184. #==============================================================================
  185. class Window_MenuStatus < Window_Selectable
  186.   #--------------------------------------------------------------------------
  187.   # ○ インクルード
  188.   #--------------------------------------------------------------------------
  189.   include XRXS_Cursor2
  190.   #--------------------------------------------------------------------------
  191.   # ● 公開インスタンス変数
  192.   #--------------------------------------------------------------------------
  193.   attr_reader   :column_max             # 列数
  194.   #--------------------------------------------------------------------------
  195.   # ● オブジェクト初期化
  196.   #--------------------------------------------------------------------------
  197.   def initialize
  198.     h = 480
  199.     if MENU_STATUS_STRETCH
  200.       h = $game_variables[1] * 116 + 16
  201.     end
  202.     super(0, 0, 480, h)
  203.     h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
  204.     self.contents = Bitmap.new(width - 32, h)
  205.     self.active = false
  206.     self.index = -1
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # ○ 1 ページに表示できる行数の取得
  210.   #--------------------------------------------------------------------------
  211.   def page_row_max
  212.     if MENU_STATUS_STRETCH
  213.       return $game_variables[1]          # 戦闘パーティ最大数
  214.     else
  215.       return [$game_variables[1], 4].max # 戦闘パーティ最大数(最低4)
  216.     end
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ○ 先頭の行の取得
  220.   #--------------------------------------------------------------------------
  221.   def top_row
  222.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
  223.     return self.oy / LINE_HEIGHT
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ○ 先頭の行の設定
  227.   #--------------------------------------------------------------------------
  228.   def top_row=(row)
  229.     super
  230.     self.oy = self.oy/32 * LINE_HEIGHT
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● カーソルの矩形更新
  234.   #--------------------------------------------------------------------------
  235.   def update_cursor_rect
  236.     super
  237.     unless @index < 0
  238.       y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
  239.       self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
  240.     end
  241.   end
  242. end
  243. #==============================================================================
  244. # ■ Scene_Menu
  245. #==============================================================================
  246. class Scene_Menu
  247.   include BFS_Setting
  248.   #--------------------------------------------------------------------------
  249.   # ● フレーム更新
  250.   #--------------------------------------------------------------------------
  251.   alias xrxs26ax_update update
  252.   def update
  253.     # インデックスを保存
  254.     @status_index = @status_window.index
  255.     # 呼び戻す
  256.     xrxs26ax_update
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  260.   #--------------------------------------------------------------------------
  261.   alias xrxs26ax_update_command update_command
  262.   def update_command
  263.     # 呼び戻す
  264.     xrxs26ax_update_command
  265.     # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
  266.     if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
  267.        @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
  268.        if $game_map.map_id  == 6
  269.       # 決定 SE を演奏
  270.       $game_system.se_play($data_system.decision_se)
  271.       # カーソル位置を記憶
  272.       @command_index_before_menu_member_change = @command_window.index
  273.       # 入れ替えウィンドウへ移行
  274.       @command_window.active = false
  275.       @command_window.index = -1
  276.       @status_window.active = true
  277.       @status_window.index = 0
  278.     else
  279.       end
  280.     end
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  284.   #--------------------------------------------------------------------------
  285.   alias xrxs26ax_update_status update_status
  286.   def update_status
  287.     # 呼び戻す
  288.     if @command_window.index != -1
  289.       xrxs26ax_update_status
  290.       return
  291.     end
  292.     # B ボタンか入れ替え終了キーが押されたとき
  293.     if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
  294.         @status_window.index2 == -1 and
  295.         @status_index%@status_window.column_max == 0)
  296.       # キャンセル SE を演奏
  297.       $game_system.se_play($data_system.cancel_se)
  298.       # コマンドウィンドウをアクティブにする
  299.       @command_window.active = true
  300.       @command_window.index = 0
  301.       @status_window.active = false
  302.       @status_window.index = -1
  303.       return
  304.     end
  305.     # B ボタンが押されたとき
  306.     if Input.trigger?(Input::B) and @status_window.index2 >= 0
  307.       @status_window.index = @status_window.index2
  308.       @status_window.index2 = -1
  309.       return
  310.     end
  311.     # 決定キーが押されたとき
  312.     if Input.trigger?(Input::C)
  313.       if @status_window.index2 == -1
  314.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  315.           # ブザー SE を演奏
  316.           $game_system.se_play($data_system.buzzer_se)
  317.           return
  318.         end
  319.         # 決定 SE を演奏
  320.         $game_system.se_play($data_system.decision_se)
  321.         # メンバーの入れ替え一人目の決定
  322.         @status_window.index2 = @status_window.index
  323.       else
  324.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  325.           # ブザー SE を演奏
  326.           $game_system.se_play($data_system.buzzer_se)
  327.           return
  328.         end
  329.         # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
  330.         if (@status_window.index < $game_variables[1] or
  331.             @status_window.index2 < $game_variables[1]) and
  332.            (UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  333.             UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  334.           # ブザー SE を演奏
  335.           $game_system.se_play($data_system.buzzer_se)
  336.           return
  337.         end
  338.         # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
  339.         if (@status_window.index >= $game_variables[1] or
  340.             @status_window.index2 >= $game_variables[1]) and
  341.            (FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  342.             FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  343.           # ブザー SE を演奏
  344.           $game_system.se_play($data_system.buzzer_se)
  345.           return
  346.         end
  347.         # 決定 SE を演奏
  348.         $game_system.se_play($data_system.decision_se)
  349.         # メンバーの入れ替え二人目の決定と入れ替えの実行
  350.         actor2 = @status_window.all_actors[@status_window.index]
  351.         actor = @status_window.all_actors[@status_window.index2]
  352.         @status_window.all_actors[@status_window.index2] = actor2
  353.         @status_window.all_actors[@status_window.index] = actor
  354.         $game_party.actors.clear
  355.         $game_party.waiting_actors.clear
  356.         for i in [email]0...@status_window.all_actors.size[/email]
  357.           if i < $game_variables[1]
  358.             $game_party.actors.push(@status_window.all_actors[i])
  359.           else
  360.             $game_party.waiting_actors.push(@status_window.all_actors[i])
  361.           end
  362.         end
  363.         $game_temp.friends_need_refresh = true
  364.         @status_window.index = @status_window.index2
  365.         @status_window.index2 = -1
  366.         $game_party.friend_party_update
  367.         # プレイヤーをリフレッシュ
  368.         $game_player.refresh
  369.         # ステータスウィンドウをリフレッシュ
  370.         @status_window.refresh
  371.       end
  372.       return
  373.     end
  374.   end
  375. end
  376. #==============================================================================
  377. # ■ Window_MenuStatus
  378. #==============================================================================
  379. class Window_MenuStatus < Window_Selectable
  380.   #--------------------------------------------------------------------------
  381.   # ○ インクルード
  382.   #--------------------------------------------------------------------------
  383.   include BFS_Setting
  384.   #--------------------------------------------------------------------------
  385.   # ● 公開インスタンス変数
  386.   #--------------------------------------------------------------------------
  387.   attr_reader   :newitem_window
  388.   attr_reader   :all_actors
  389.   attr_reader   :bottomkeyhelp_window
  390.   #--------------------------------------------------------------------------
  391.   # ● オブジェクト初期化
  392.   #--------------------------------------------------------------------------
  393.   alias xrxs26bx_initialize initialize
  394.   def initialize
  395.     # 呼び戻す
  396.     xrxs26bx_initialize
  397.     # 寄生してウィンドウを作成
  398.     # ボトルキーヘルプウィンドウ
  399.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  400.     @bottomkeyhelp_window.visible = false
  401.     # 設定変更
  402.     self.height   = 448
  403.     self.contents = Bitmap.new(width - 32, height - 32)
  404.     @all_actors = $game_party.actors + $game_party.waiting_actors
  405.     refresh
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● リフレッシュ
  409.   #--------------------------------------------------------------------------
  410.   def refresh
  411.     self.contents.clear
  412.     @item_max = @all_actors.size
  413.     @column_max = 2
  414.     y = ($game_variables[1]+1)/2 * 64 + 28
  415.     self.contents.font.size = 16
  416.     self.contents.font.color = system_color
  417.     self.contents.draw_text(4, 0, 92, 28, "参战")
  418.     self.contents.draw_text(4, y, 92, 28, "休息")
  419.     for i in [email]0...@all_actors.size[/email]
  420.       x = 64 + i%2 * 224
  421.       y = i/2 *  72 + 24
  422.       actor = @all_actors[i]
  423.       if i >= $game_variables[1]
  424.         y += 32
  425.         self.contents.font.color = disabled_color
  426.         self.contents.draw_text(x, y, 120, 32, actor.name)
  427.       else
  428.         draw_actor_name(actor   , x     , y     )
  429.       end
  430.       draw_actor_graphic(actor, x - 40, y + 64)
  431.       draw_actor_level(actor  , x + 94, y     )
  432.       draw_actor_hp(actor     , x, y + 16)
  433.       draw_actor_sp(actor     , x, y + 32)
  434.       draw_actor_state(actor  , x, y + 48)
  435.     end
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ○ フレーム更新
  439.   #--------------------------------------------------------------------------
  440.   def update
  441.     # ウィンドウを更新
  442.     @bottomkeyhelp_window.update
  443.     super
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ○ 解放
  447.   #--------------------------------------------------------------------------
  448.   def dispose
  449.     @bottomkeyhelp_window.dispose
  450.     super
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● カーソルの矩形更新
  454.   #--------------------------------------------------------------------------
  455.   def update_cursor_rect
  456.     if @index < 0
  457.       self.cursor_rect.empty
  458.     else
  459.       y = @index/2 * 72 + 28
  460.       if @index >= $game_variables[1]
  461.         y += 32
  462.       end
  463.       self.cursor_rect.set(@index%2 * 224, y, 224, 72)
  464.     end
  465.   end
  466. end
  467. #==============================================================================
  468. # ■ Scene_Menu
  469. #==============================================================================
  470. class Scene_Menu
  471.   #--------------------------------------------------------------------------
  472.   # ● フレーム更新
  473.   #--------------------------------------------------------------------------
  474.   alias xrxs26bx_update update
  475.   def update
  476.     # 登録
  477.     if @bottomkeyhelp_window.nil?
  478.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  479.       @bottomkeyhelp_window.visible = true
  480.       set_keyhelp1
  481.     end
  482.     # 呼び戻す
  483.     xrxs26bx_update
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  487.   #--------------------------------------------------------------------------
  488.   alias xrxs26bx_update_command update_command
  489.   def update_command
  490.     # 呼び戻す
  491.     xrxs26bx_update_command
  492.     # 入れ替え移行キーが押されたとき
  493.     if @command_window.index == -1 and @status_window.active
  494.       set_keyhelp2
  495.     end
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  499.   #--------------------------------------------------------------------------
  500.   alias xrxs26bx_update_status update_status
  501.   def update_status
  502.     # 保存
  503.     last_index = @status_window.index2
  504.     # 呼び戻す
  505.     xrxs26bx_update_status
  506.     #
  507.     if last_index != @status_window.index2
  508.       # 一人目を選択した場合
  509.       if @status_window.index2 >= 0
  510.         set_keyhelp3
  511.       else
  512.         set_keyhelp2
  513.       end
  514.     end
  515.     # 戻った場合
  516.     unless @status_window.active
  517.       set_keyhelp1
  518.     end
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ○ キーヘルプを設定 1
  522.   #--------------------------------------------------------------------------
  523.   def set_keyhelp1
  524.     @bottomkeyhelp_window.clear
  525.     @bottomkeyhelp_window.add("B","关闭本窗口")
  526.     @bottomkeyhelp_window.add("C","确定")
  527.     @bottomkeyhelp_window.add("→","人物顺序调整")
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ○ キーヘルプを設定 2
  531.   #--------------------------------------------------------------------------
  532.   def set_keyhelp2
  533.     @bottomkeyhelp_window.clear
  534.     @bottomkeyhelp_window.add("←,B","返回")
  535.     @bottomkeyhelp_window.add("C","第一个人物确定")
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ○ キーヘルプを設定 3
  539.   #--------------------------------------------------------------------------
  540.   def set_keyhelp3
  541.     @bottomkeyhelp_window.clear
  542.     @bottomkeyhelp_window.add("B","返回")
  543.     @bottomkeyhelp_window.add("C","第二个人物确定")
  544.   end
  545. end



  546. #==============================================================================
  547. # □ Window_BottomKeyHelp
  548. #------------------------------------------------------------------------------
  549. #     画面下で操作説明をする透明なウィンドウです。
  550. #==============================================================================
  551. class Window_BottomKeyHelp < Window_Base
  552.   #--------------------------------------------------------------------------
  553.   # ○ オブジェクト初期化
  554.   #--------------------------------------------------------------------------
  555.   def initialize
  556.     super(0, 432, 640, 64)
  557.     self.contents = Bitmap.new(width - 32, height - 32)
  558.     self.opacity = 0
  559.     clear
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ○ クリア
  563.   #--------------------------------------------------------------------------
  564.   def clear
  565.     self.contents.clear
  566.     @now_x = 608
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ○ 追加
  570.   #--------------------------------------------------------------------------
  571.   def add(key, explanation)
  572.     # 計算
  573.     self.contents.font.size = 20
  574.     x  = self.contents.text_size(key).width
  575.     self.contents.font.size = 16
  576.     x += self.contents.text_size(explanation).width + 8
  577.     @now_x -= x
  578.     # 描写
  579.     self.contents.font.size = 20
  580.     self.contents.font.color = system_color
  581.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  582.     self.contents.font.size = 16
  583.     self.contents.font.color = normal_color
  584.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  585.     # 余白
  586.     @now_x -= 32
  587.   end
  588. end

  589. #==============================================================================
  590. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  591. #==============================================================================
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部