设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1626|回复: 2
打印 上一主题 下一主题

[已经解决] 如何将这脚本修改成跟状态一样的效果?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
3 小时
注册时间
2012-5-4
帖子
284
跳转到指定楼层
1
发表于 2012-6-30 18:25:16 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
就是选择升级加点
会出现选择加点的角色
而不是立即进入加点菜单
求修改
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  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. # 本脚本不会取代原来的升级自动加点 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  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. #==============================================================================
  22. # ■ Window_Command
  23. #------------------------------------------------------------------------------
  24. #  一般的命令选择行窗口。(追加定义)
  25. #==============================================================================
  26. class Window_Command < Window_Selectable
  27.   #--------------------------------------------------------------------------
  28.   # ● 项目有效化
  29.   #     index : 项目编号
  30.   #--------------------------------------------------------------------------
  31.   def able_item(index)
  32.     draw_item(index, normal_color)
  33.   end
  34. end
  35. #==============================================================================
  36. # ■ Game_Actor
  37. #------------------------------------------------------------------------------
  38. #  处理角色的类。(再定义)
  39. #==============================================================================

  40. class Game_Actor < Game_Battler
  41.   def level_up
  42.     @level += 1
  43.     $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  44.     for learning in self.class.learnings
  45.       learn_skill(learning.skill_id) if learning.level == @level
  46.     end
  47.   end
  48. end
  49. #==============================================================================
  50. # ■ Window_Base
  51. #------------------------------------------------------------------------------
  52. #  游戏中全部窗口的超级类(追加定义)
  53. #==============================================================================
  54. class Window_Base < Window
  55.   #--------------------------------------------------------------------------
  56.   # ● 描绘 HP
  57.   #     actor : 角色
  58.   #     x     : 描画目标 X 坐标
  59.   #     y     : 描画目标 Y 坐标
  60.   #     width : 描画目标的宽
  61.   #--------------------------------------------------------------------------
  62.   def draw_actor_hp_lvup(actor, x, y)
  63.     self.contents.font.color = system_color
  64.     self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::hp)
  65.     if $temp_hp == 0
  66.       self.contents.font.color = normal_color
  67.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  68.     else
  69.       maxhp = actor.maxhp + $temp_hp
  70.       self.contents.font.color = Color.new(255, 128, 128, 255)
  71.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  72.       self.contents.font.color = normal_color      
  73.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  74.       if $temp_hp >=0
  75.         self.contents.font.color = Color.new(255, 128, 128, 255)
  76.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  77.       else
  78.         self.contents.font.color = Color.new(255,255,0,255)
  79.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  80.       end
  81.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  82.       self.contents.font.color = normal_color
  83.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  84.     end
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 描绘 MP
  88.   #     actor : 角色
  89.   #     x     : 描画目标 X 坐标
  90.   #     y     : 描画目标 Y 坐标
  91.   #     width : 描画目标的宽
  92.   #--------------------------------------------------------------------------
  93.   def draw_actor_mp_lvup(actor, x, y)
  94.     self.contents.font.color = system_color
  95.     self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::mp)
  96.     if $temp_mp == 0
  97.       self.contents.font.color = normal_color
  98.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxmp.to_s, 2)
  99.     else
  100.       maxmp = actor.maxmp + $temp_mp
  101.       self.contents.font.color = Color.new(255, 128, 128, 255)
  102.       self.contents.draw_text(x + 120 , y, 48, 32, maxmp.to_s ,2)
  103.       self.contents.font.color = normal_color      
  104.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  105.       if $temp_mp >=0
  106.         self.contents.font.color = Color.new(255, 128, 128, 255)
  107.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  108.       else
  109.         self.contents.font.color = Color.new(255,255,0,255)
  110.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  111.       end
  112.       self.contents.draw_text(x + 200, y, 36, 32, $temp_mp.to_s, 2)
  113.       self.contents.font.color = normal_color
  114.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  115.     end
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 描绘能力值
  119.   #     actor : 角色
  120.   #     x     : 描画目标 X 坐标
  121.   #     y     : 描画目标 Y 坐标
  122.   #     type  : 能力值种类 (0~4)
  123.   #--------------------------------------------------------------------------
  124.   def draw_actor_lvup(actor, x, y, type)   
  125.     # 定义数字颜色
  126.     lvup = normal_color
  127.     upcolor = Color.new(255, 128, 128, 255)
  128.     self.contents.font.color = normal_color   
  129.     case type
  130.     when 0
  131.       parameter_name = Vocab::atk
  132.       parameter_value = actor.atk
  133.       parameter_value_temp = parameter_value + $temp_atk
  134.       if $temp_atk != 0
  135.         lvup = upcolor
  136.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  137.         if $temp_atk >= 0
  138.           self.contents.font.color = lvup
  139.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  140.         else
  141.           self.contents.font.color = Color.new(255,255,0,255)
  142.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  143.         end        
  144.         self.contents.draw_text(x + 272, y, 80, 32, $temp_atk.abs.to_s,1)
  145.         self.contents.font.color = normal_color
  146.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  147.       end
  148.     when 1
  149.       parameter_name = Vocab::def
  150.       parameter_value = actor.def
  151.       parameter_value_temp = parameter_value + $temp_def
  152.       if $temp_def != 0
  153.         lvup = upcolor
  154.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  155.         if $temp_def >= 0
  156.           self.contents.font.color = lvup
  157.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  158.         else
  159.           self.contents.font.color = Color.new(255,255,0,255)
  160.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  161.         end        
  162.         self.contents.draw_text(x + 272, y, 80, 32, $temp_def.abs.to_s,1)
  163.         self.contents.font.color = normal_color
  164.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  165.       end
  166.     when 2
  167.       parameter_name = Vocab::agi
  168.       parameter_value = actor.agi
  169.       parameter_value_temp = parameter_value + $temp_agi
  170.       if $temp_agi != 0
  171.         lvup = upcolor
  172.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  173.         if $temp_agi >= 0
  174.           self.contents.font.color = lvup
  175.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  176.         else
  177.           self.contents.font.color = Color.new(255,255,0,255)
  178.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  179.         end        
  180.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  181.         self.contents.font.color = normal_color
  182.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  183.       end
  184.     when 3
  185.       parameter_name = Vocab::spi
  186.       parameter_value = actor.spi
  187.       parameter_value_temp = parameter_value + $temp_spi
  188.       if $temp_spi != 0
  189.         lvup = upcolor
  190.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  191.         if $temp_spi >= 0
  192.           self.contents.font.color = lvup
  193.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  194.         else
  195.           self.contents.font.color = Color.new(255,255,0,255)
  196.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  197.         end        
  198.         self.contents.draw_text(x + 272, y, 80, 32, $temp_spi.abs.to_s,1)
  199.         self.contents.font.color = normal_color
  200.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  201.       end
  202.     when 4
  203.       parameter_name = "剩余点数"
  204.       parameter_value = $point
  205.       if $point != 0
  206.         lvup = upcolor
  207.       end
  208.     end   
  209.     self.contents.font.size = 16 if type == 4
  210.     self.contents.font.color = system_color
  211.     if type != 4 then
  212.       self.contents.draw_text(x, y, 120, 32, parameter_name)
  213.     else
  214.       self.contents.draw_text(x, y, 120, 24, parameter_name)
  215.     end
  216.     self.contents.font.color = normal_color
  217.     if type != 4
  218.       self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  219.     else
  220.       self.contents.draw_text(x + 68, y, 36, 24, parameter_value.to_s)   
  221.     end
  222.     if type != 4
  223.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  224.     end  
  225.     self.contents.font.color = lvup
  226.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  227.     self.contents.font.color = normal_color        
  228.   end
  229. end

  230. class Window_Lvpoint < Window_Base
  231.   def initialize
  232.     super(0,198,128,58)
  233.     refresh
  234.   end
  235.   def refresh
  236.     self.contents.clear
  237.     draw_actor_lvup(@actor, 0, 0, 4)
  238.   end
  239. end
  240. #==============================================================================
  241. # ■ Window_lvup
  242. #------------------------------------------------------------------------------
  243. #  显示升级状态窗口。
  244. #==============================================================================
  245. class Window_Lvup < Window_Base
  246.   #--------------------------------------------------------------------------
  247.   # ● 初始化对像
  248.   #     actor : 角色
  249.   #--------------------------------------------------------------------------
  250.   def initialize(actor)
  251.     super(0, 0, 416, 256)
  252.     self.contents = Bitmap.new(width - 32, height - 32)
  253.     @actor = actor
  254.     refresh
  255.   end  
  256.   #--------------------------------------------------------------------------
  257.   # ● 刷新
  258.   #--------------------------------------------------------------------------
  259.   def refresh
  260.     self.contents.clear
  261.     draw_actor_graphic(@actor, 30, 80)
  262.     draw_actor_name(@actor, 4, 0)
  263.     draw_actor_class(@actor, 96, 0)
  264.     draw_actor_level(@actor, 224, 0)
  265.     draw_actor_state(@actor, 96, 32)   
  266.     draw_actor_hp_lvup(@actor, 96, 32)
  267.     draw_actor_mp_lvup(@actor, 96, 64)
  268.     draw_actor_lvup(@actor, 4, 96, 0)
  269.     draw_actor_lvup(@actor, 4, 128, 1)
  270.     draw_actor_lvup(@actor, 4, 160, 2)
  271.     draw_actor_lvup(@actor, 4, 192, 3)
  272.   end
  273. end
  274. #==============================================================================
  275. # ■ Window_Help
  276. #------------------------------------------------------------------------------
  277. #  特技及物品的说明、角色的状态显示的窗口。
  278. #==============================================================================
  279. class Window_Lvup_Help < Window_Base
  280.   #--------------------------------------------------------------------------
  281.   # ● 初始化对像
  282.   #--------------------------------------------------------------------------
  283.   def initialize
  284.     super(0, 256, 544, 160)
  285.     self.contents = Bitmap.new(width - 32, height - 32)
  286.     @test = "" #——这个东西用来检测,节约内存专用
  287.   end  
  288.   #--------------------------------------------------------------------------
  289.   # ● 设置文本
  290.   #--------------------------------------------------------------------------
  291.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  292.     if @test != text1
  293.       @test = text1
  294.     else
  295.       return
  296.     end   
  297.     self.contents.clear
  298.     self.contents.font.color = normal_color
  299.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  300.     if text2 != nil
  301.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  302.     end
  303.     self.contents.font.size -= 4
  304.     if text3 != nil
  305.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  306.     end
  307.     if text4 != nil
  308.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  309.     end
  310.     self.contents.font.size += 4
  311.   end
  312. end
  313. #==============================================================================
  314. # ■ Scene_lvup
  315. #------------------------------------------------------------------------------
  316. #  处理升级画面的类。
  317. #==============================================================================
  318. class Scene_Lvup
  319.   #--------------------------------------------------------------------------
  320.   # ● 初始化对像
  321.   #     actor_index : 角色索引
  322.   #     menu_index : 选项起始位置
  323.   #--------------------------------------------------------------------------
  324.   def initialize(actor_index = 0 , menu_index = 0)
  325.     @actor_index = actor_index
  326.     @menu_index = menu_index
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● 主处理
  330.   #--------------------------------------------------------------------------
  331.   def main
  332.     s1 = "增加体力"
  333.     s2 = "增加"+Vocab::atk
  334.     s3 = "增加"+Vocab::def
  335.     s4 = "增加"+Vocab::agi
  336.     s5 = "增加"+Vocab::spi
  337.     s6 = "确认加点"
  338.     s7 = "点数重置"
  339.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  340.     @command_window.index = @menu_index
  341.     # 获取角色
  342.     @actor = $game_party.members[@actor_index]
  343.     # 将角色的剩余点数带入
  344.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  345.     # 初始化临时量
  346.     $temp_atk = 0
  347.     $temp_def = 0
  348.     $temp_agi = 0
  349.     $temp_spi = 0
  350.     $temp_hp = 0
  351.     $temp_mp = 0
  352.     #=========================================================================
  353.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  354.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  355.     #=========================================================================
  356.     # 每提升一次力量,提升多少附加能力
  357.     #=========================================================================
  358.     @atk_hp = 2     # 每提升一次力量附加提升多少HP
  359.     @atk_mp = 2     # 每提升一次力量附加提升多少MP
  360.     @atk_def = 1    # 每提升一次力量附加提升多少灵巧
  361.     @atk_agi = 1    # 每提升一次力量附加提升多少速度
  362.     @atk_spi = 0    # 每提升一次力量附加提升多少魔力
  363.     @atk_atk = 5    # 每提升一次力量附加提升多少力量
  364.     #=========================================================================
  365.     # 每提升一次灵巧,提升多少附加能力
  366.     #=========================================================================
  367.     @def_hp = 3     # 每提升一次灵巧附加提升多少HP
  368.     @def_mp = 2     # 每提升一次灵巧附加提升多少MP
  369.     @def_atk = 1    # 每提升一次灵巧附加提升多少力量
  370.     @def_agi = 1    # 每提升一次灵巧附加提升多少速度
  371.     @def_spi = 0    # 每提升一次灵巧附加提升多少魔力
  372.     @def_def = 5    # 每提升一次灵巧附加提升多少灵巧
  373.     #=========================================================================
  374.     # 每提升一次速度,提升多少附加能力
  375.     #=========================================================================
  376.     @agi_hp = 3     # 每提升一次速度附加提升多少HP
  377.     @agi_mp = 2     # 每提升一次速度附加提升多少MP
  378.     @agi_atk = 1    # 每提升一次速度附加提升多少力量
  379.     @agi_def = 1    # 每提升一次速度附加提升多少灵巧
  380.     @agi_spi = 0    # 每提升一次速度附加提升多少魔力
  381.     @agi_agi = 5    # 每提升一次速度附加提升多少速度
  382.     #=========================================================================
  383.     # 每提升一次魔力,提升多少附加能力
  384.     #=========================================================================
  385.     @spi_hp = 1     # 每提升一次魔力附加提升多少HP
  386.     @spi_mp = 10    # 每提升一次魔力附加提升多少MP
  387.     @spi_atk = -1   # 每提升一次魔力附加提升多少力量
  388.     @spi_def = -1   # 每提升一次魔力附加提升多少灵巧
  389.     @spi_agi = -1   # 每提升一次魔力附加提升多少速度
  390.     @spi_spi = 10   # 每提升一次魔力附加提升多少魔力
  391.     #=========================================================================
  392.     # 每提升一次体力,提升多少附加能力
  393.     #=========================================================================
  394.     @hp = 15       # 每提升一次体力提升多少HP
  395.     @mp = 10       # 每提升一次体力提升多少MP
  396.     @hp_atk = -1   # 每提升一次体力提升多少力量
  397.     @hp_def = -1   # 每提升一次体力提升多少速度
  398.     @hp_agi = -1   # 每提升一次体力提升多少灵巧
  399.     @hp_spi = -1   # 每提升一次体力提升多少魔力   
  400.     # 定义说明文字
  401.     @text_hp_sc = "体力可以增加生存的能力,可以延长生存的时间!"
  402.     @text_atk_sc = Vocab::atk + "可以增加物理攻击和物理技能的威力!"
  403.     @text_def_sc = Vocab::def + "可以提高攻击的命中率和必杀!"
  404.     @text_agi_sc = Vocab::agi + "可以提高回避、命中、逃跑成功率!"
  405.     @text_spi_sc = Vocab::spi + "可以提高魔法的效果,可以增加1点魔法!"
  406.     @text_save = "保存分配情况并返回游戏"
  407.     @text_reset= "重新分配能力点数"
  408.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  409.     @text_hp = "最大" + Vocab::hp + "值"
  410.     @text_mp = "最大" + Vocab::mp + "值"
  411.     @text_atk = "最大" + Vocab::atk + "值"
  412.     @text_def = "最大" + Vocab::def + "值"
  413.     @text_agi = "最大" + Vocab::agi + "值"
  414.     @text_spi = "最大" + Vocab::spi + "值"
  415.     s_disable
  416.     # 生成状态窗口
  417.     @lvup_window = Window_Lvup.new(@actor)
  418.     @lvup_window.x = 128
  419.     @lvup_window.y = 0   
  420.     @lvpoint_window = Window_Lvpoint.new
  421.     # 生成帮助窗口并初始化帮助文本
  422.     @help_window = Window_Lvup_Help.new   
  423.     # 执行过渡
  424.     Graphics.transition
  425.     # 主循环
  426.     loop do
  427.       # 刷新游戏画面
  428.       Graphics.update
  429.       # 刷新输入信息
  430.       Input.update
  431.       # 刷新画面
  432.       update
  433.       # 如果切换画面就中断循环
  434.       if $scene != self
  435.         break
  436.       end
  437.     end
  438.     # 准备过渡
  439.     Graphics.freeze
  440.     # 释放窗口
  441.     @lvpoint_window.dispose
  442.     @command_window.dispose
  443.     @lvup_window.dispose
  444.     @help_window.dispose
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● 刷新画面
  448.   #--------------------------------------------------------------------------
  449.   def update
  450.     # 刷新窗口
  451.     @command_window.update
  452.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  453.     s_disable
  454.     @lvup_window.update
  455.     #=============================================================
  456.     # 按下 B 键的情况下
  457.     #=============================================================
  458.     if Input.trigger?(Input::B)
  459.       # 演奏取消 SE
  460.       Sound.play_cancel
  461.       # 切换到地图画面
  462.       $scene = Scene_Map.new
  463.       return
  464.     end
  465.     #=============================================================
  466.     # 按下 C 键的情况下
  467.     #=============================================================
  468.     if Input.trigger?(Input::C)      
  469.       if @command_window.index == 5
  470.           # 演奏确定 SE
  471.         Sound.play_decision
  472.         # 将角色的剩余点数带回
  473.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  474.         # 将角色点数实际加上
  475.         @actor.atk += $temp_atk
  476.         @actor.def += $temp_def
  477.         @actor.agi += $temp_agi
  478.         @actor.spi += $temp_spi
  479.         @actor.maxhp += $temp_hp
  480.         @actor.maxmp += $temp_mp
  481.         # 切换到地图画面
  482.         $scene = Scene_Map.new
  483.         return
  484.       end
  485.       if @command_window.index == 6
  486.           # 演奏确定 SE
  487.         Sound.play_decision
  488.           # 将角色的剩余点数带入
  489.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  490.           # 初始化临时量
  491.         $temp_atk = 0
  492.         $temp_def = 0
  493.         $temp_agi = 0
  494.         $temp_spi = 0
  495.         $temp_hp = 0
  496.         $temp_mp = 0
  497.         @lvup_window.refresh
  498.         @lvpoint_window.refresh
  499.         return
  500.       end
  501.       if $point == 0
  502.         # 演奏冻结 SE
  503.         Sound.play_buzzer
  504.         return
  505.       end
  506.       case @command_window.index
  507.       when 0
  508.         # 演奏确定 SE
  509.         Sound.play_decision
  510.         $temp_hp += @hp
  511.         $temp_mp += @mp
  512.         $temp_atk += @hp_atk
  513.         $temp_def += @hp_def
  514.         $temp_agi += @hp_agi
  515.         $temp_spi += @hp_spi
  516.         $point -= 1
  517.         @lvup_window.refresh
  518.         @lvpoint_window.refresh
  519.         s_disable
  520.         return
  521.       when 1
  522.         # 演奏确定 SE
  523.         Sound.play_decision
  524.         $temp_atk += @atk_atk
  525.         $temp_hp += @atk_hp
  526.         $temp_mp += @atk_mp
  527.         $temp_def += @atk_def
  528.         $temp_agi += @atk_agi
  529.         $temp_spi += @atk_spi
  530.         $point -= 1
  531.         @lvup_window.refresh
  532.         @lvpoint_window.refresh
  533.         s_disable
  534.         return
  535.       when 2
  536.         # 演奏确定 SE
  537.         Sound.play_decision
  538.         $temp_def += @def_def
  539.         $temp_hp += @def_hp
  540.         $temp_mp += @def_mp
  541.         $temp_atk += @def_atk
  542.         $temp_agi += @def_agi
  543.         $temp_spi += @def_spi
  544.         $point -= 1
  545.         @lvup_window.refresh
  546.         @lvpoint_window.refresh
  547.         s_disable
  548.         return
  549.       when 3
  550.         # 演奏确定 SE
  551.         Sound.play_decision
  552.         $temp_agi += @agi_agi
  553.         $temp_hp += @agi_hp
  554.         $temp_mp += @agi_mp
  555.         $temp_atk += @agi_atk
  556.         $temp_def += @agi_def
  557.         $temp_spi += @agi_spi
  558.         $point -= 1
  559.         @lvup_window.refresh
  560.         @lvpoint_window.refresh
  561.         s_disable
  562.         return
  563.       when 4
  564.         # 演奏确定 SE
  565.         Sound.play_decision
  566.         $temp_spi += @spi_spi
  567.         $temp_hp += @spi_hp
  568.         $temp_mp += @spi_mp
  569.         $temp_atk += @spi_atk
  570.         $temp_def += @spi_def
  571.         $temp_agi += @spi_agi
  572.         $point -= 1
  573.         @lvup_window.refresh
  574.         @lvpoint_window.refresh
  575.         s_disable
  576.         return
  577.       end
  578.     end
  579.     #=============================================================
  580.     # 什么都没有按下的情况
  581.     #=============================================================
  582.     case @command_window.index   
  583.     when 0  # 增加体力
  584.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_atk + @hp_atk.to_s + "点   " + @text_def + @hp_def.to_s + "点"
  585.       temptext2 = @text_mp + @mp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_spi + @hp_spi.to_s + "点"
  586.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  587.     when 1  # 增加力量
  588.       temptext1 = @text_hp + @atk_hp.to_s + "点   " + @text_atk + @atk_atk.to_s + "点   " + @text_def + @atk_def.to_s + "点"
  589.       temptext2 = @text_mp + @atk_mp.to_s + "点   " + @text_agi + @atk_agi.to_s + "点   " + @text_spi + @atk_spi.to_s + "点"
  590.       @help_window.lvup_text(@text_atk_sc , @text_2 , temptext1 , temptext2)
  591.     when 2  # 增加灵巧
  592.       temptext1 = @text_hp + @def_hp.to_s + "点   " + @text_atk + @def_agi.to_s + "点   " + @text_def + @def_def.to_s + "点"
  593.       temptext2 = @text_mp + @def_mp.to_s + "点   " + @text_agi + @def_agi.to_s + "点   " + @text_spi + @def_spi.to_s + "点"
  594.       @help_window.lvup_text(@text_def_sc , @text_2 , temptext1 , temptext2)
  595.     when 3  # 增加速度
  596.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_atk + @agi_atk.to_s + "点   " + @text_def + @agi_def.to_s + "点"
  597.       temptext2 = @text_mp + @agi_mp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_spi + @agi_spi.to_s + "点"
  598.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  599.     when 4  # 增加魔力
  600.       temptext1 = @text_hp + @spi_hp.to_s + "点   " + @text_atk + @spi_atk.to_s + "点   " + @text_def + @spi_def.to_s + "点"
  601.       temptext2 = @text_mp + @spi_mp.to_s + "点   " + @text_agi + @spi_agi.to_s + "点   " + @text_spi + @spi_spi.to_s + "点"
  602.       @help_window.lvup_text(@text_spi_sc , @text_2 , temptext1 , temptext2)
  603.     when 5 # 保存设定
  604.       @help_window.lvup_text(@text_save)
  605.     when 6 # 点数重置
  606.       @help_window.lvup_text(@text_reset)     
  607.     end
  608.     #=============================================================
  609.     # 按下R与L换人的情况
  610.     #=============================================================      
  611.     if Input.trigger?(Input::R)
  612.       # 演奏光标 SE
  613.       Sound.play_cursor
  614.       # 移至下一位角色
  615.       @actor_index += 1
  616.       @actor_index %= $game_party.members.size
  617.       # 切换到别的状态画面
  618.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  619.       return
  620.     end
  621.     # 按下 L 键的情况下
  622.     if Input.trigger?(Input::L)
  623.       # 演奏光标 SE
  624.       Sound.play_cursor
  625.       # 移至上一位角色
  626.       @actor_index += $game_party.members.size - 1
  627.       @actor_index %= $game_party.members.size
  628.       # 切换到别的状态画面
  629.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  630.       return
  631.     end
  632.   end  
  633.   #--------------------------------------------------------------------------
  634.   # ● 选项明暗判断
  635.   #--------------------------------------------------------------------------
  636.   def s_disable
  637.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  638.     if $point == 0
  639.       enabled = false
  640.     else
  641.       enabled = true
  642.     end
  643.       @command_window.draw_item(0,enabled)
  644.       @command_window.draw_item(1,enabled)
  645.       @command_window.draw_item(2,enabled)
  646.       @command_window.draw_item(3,enabled)
  647.       @command_window.draw_item(4,enabled)
  648.   end
  649. end
复制代码

Lv1.梦旅人

梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
帖子
1484
2
发表于 2012-6-30 19:53:43 | 只看该作者
人家脚本就可以选择角色的啊 Q/W就可以 LZ这样问不是多此一举吗
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1314
在线时间
962 小时
注册时间
2012-4-30
帖子
1475

开拓者

3
发表于 2012-6-30 20:21:20 | 只看该作者
真心觉得换人的写法不怎么样。。。
全局搜索
create_command_window
加个s7 = "加点"#随便写啦
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])

改成
  1. @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
复制代码
也可以在这句下面加一句
RUBY 代码复制
  1. @command_window.draw_item(3, false)     # 无效化状态选项

RUBY 代码复制
  1. @command_window.draw_item(7, false)


再在下面“update_command_selection”里
RUBY 代码复制
  1. when 1,2,3,7#加一个7  # 技能、装备、状态
  2.         start_actor_selection

update_actor_selection

RUBY 代码复制
  1. when 7  # 状态
  2.         $scene = Scene_Lvup.new(@status_window.index,6)
  3.       end


RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================
  6.  
  7. class Scene_Menu < Scene_Base
  8.   #--------------------------------------------------------------------------
  9.   # ● 生成命令窗口
  10.   #--------------------------------------------------------------------------
  11.   def create_command_window
  12.     s1 = Vocab::item
  13.     s2 = Vocab::skill
  14.     s3 = Vocab::equip
  15.     s4 = Vocab::status
  16.     s5 = "加点"
  17.     s6 = Vocab::save
  18.     s7 = Vocab::game_end
  19.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  20.     @command_window.index = @menu_index
  21.     if $game_party.members.size == 0          # 如果队伍为空
  22.       @command_window.draw_item(0, false)     # 无效化物品选项
  23.       @command_window.draw_item(1, false)     # 无效化技能选项
  24.       @command_window.draw_item(2, false)     # 无效化装备选项
  25.       @command_window.draw_item(3, false)     # 无效化状态选项
  26.     end
  27.     if $game_system.save_disabled             # 如果禁止存档
  28.       @command_window.draw_item(4, false)     # 无效化存档选项
  29.     end
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 更新命令窗口
  33.   #--------------------------------------------------------------------------
  34.   def update_command_selection
  35.     if Input.trigger?(Input::B)
  36.       Sound.play_cancel
  37.       $scene = Scene_Map.new
  38.     elsif Input.trigger?(Input::C)
  39.       if $game_party.members.size == 0 and @command_window.index < 4
  40.         Sound.play_buzzer
  41.         return
  42.       elsif $game_system.save_disabled and @command_window.index == 4
  43.         Sound.play_buzzer
  44.         return
  45.       end
  46.       Sound.play_decision
  47.       case @command_window.index
  48.       when 0      # 物品
  49.         $scene = Scene_Item.new
  50.       when 1,2,3,4  # 技能、装备、状态
  51.         start_actor_selection
  52.       when 5      # 存档
  53.         $scene = Scene_File.new(true, false, false)
  54.       when 6      # 结束游戏
  55.         $scene = Scene_End.new
  56.       end
  57.     end
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 角色选择更新
  61.   #--------------------------------------------------------------------------
  62.   def update_actor_selection
  63.     if Input.trigger?(Input::B)
  64.       Sound.play_cancel
  65.       end_actor_selection
  66.     elsif Input.trigger?(Input::C)
  67.       $game_party.last_actor_index = @status_window.index
  68.       Sound.play_decision
  69.       case @command_window.index
  70.       when 1  # 技能
  71.         $scene = Scene_Skill.new(@status_window.index)
  72.       when 2  # 装备
  73.         $scene = Scene_Equip.new(@status_window.index)
  74.       when 3  # 状态
  75.         $scene = Scene_Status.new(@status_window.index)
  76.       when 4  # 状态
  77.         $scene = Scene_Lvup.new(@status_window.index,5)
  78.       end  
  79.     end
  80.   end
  81. end

点评

下面这个是排版好的。。  发表于 2012-6-30 21:39
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-3 13:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表