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

Project1

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

[已经解决] 为何我添加了手动加点脚本后,菜单栏没显示加点

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2014-8-22
帖子
21
跳转到指定楼层
1
发表于 2014-8-22 10:57:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5.  
  6. # 脚本使用设定:
  7.  
  8. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  9. LEVEL_UP_VARIABLE = 4  # 储存角色点数的变量编号与角色id编号的差值
  10.                          # 默认情况 = 100,
  11.                          # 则是数据库里1号角色的加点数存于101号变量
  12.                          # 3号角色的加点数存于103号变量。
  13.                          # 你可以直接操作变量赠与角色可分配点数
  14.  
  15. # 每增加一次点数,各项能力值的变化:357-410行
  16.  
  17. # 使用方法介绍:
  18.  
  19. # 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  20. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  21. # 1-99级全部等于一个相同数值就行了。
  22.  
  23. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  24. # 默认都是0号
  25.  
  26. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  27. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  28.  
  29. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
  30.  
  31. #==============================================================================
  32. # ■ Window_Command
  33. #------------------------------------------------------------------------------
  34. #  一般的命令选择行窗口。(追加定义)
  35. #==============================================================================
  36. class Window_Command < Window_Selectable
  37.   #--------------------------------------------------------------------------
  38.   # ● 项目有效化
  39.   #     index : 项目编号
  40.   #--------------------------------------------------------------------------
  41.   def able_item(index)
  42.     draw_item(index, normal_color)
  43.   end
  44. end
  45. #==============================================================================
  46. # ■ Game_Actor
  47. #------------------------------------------------------------------------------
  48. #  处理角色的类。(再定义)
  49. #==============================================================================
  50. class Game_Actor < Game_Battler
  51.   #--------------------------------------------------------------------------
  52.   # ● 更改 EXP
  53.   #     exp : 新的 EXP
  54.   #--------------------------------------------------------------------------
  55.   def exp=(exp)
  56.     @exp = [[exp, 9999999].min, 0].max
  57.     # 升级
  58.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  59.       @level += 1
  60.       # 增加4点可自由分配的点数
  61.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  62.       # 学会特技
  63.       for j in $data_classes[@class_id].learnings
  64.         if j.level == @level
  65.           learn_skill(j.skill_id)
  66.         end
  67.       end
  68.     end
  69.     # 降级
  70.     while @exp < @exp_list[@level]
  71.       @level -= 1
  72.     end
  73.     # 修正当前的 HP 与 SP 超过最大值
  74.     @hp = [@hp, self.maxhp].min
  75.     @sp = [@sp, self.maxsp].min
  76.   end
  77. end
  78. #==============================================================================
  79. # ■ Window_Base
  80. #------------------------------------------------------------------------------
  81. #  游戏中全部窗口的超级类(追加定义)
  82. #==============================================================================
  83. class Window_Base < Window
  84.   #--------------------------------------------------------------------------
  85.   # ● 描绘 HP
  86.   #     actor : 角色
  87.   #     x     : 描画目标 X 坐标
  88.   #     y     : 描画目标 Y 坐标
  89.   #     width : 描画目标的宽
  90.   #--------------------------------------------------------------------------
  91.   def draw_actor_hp_lvup(actor, x, y)
  92.     self.contents.font.color = system_color
  93.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  94.     if $temp_hp == 0
  95.       self.contents.font.color = normal_color
  96.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  97.     else
  98.       maxhp = actor.maxhp + $temp_hp
  99.       self.contents.font.color = Color.new(255, 128, 128, 255)
  100.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  101.       self.contents.font.color = normal_color      
  102.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  103.       if $temp_hp >=0
  104.         self.contents.font.color = Color.new(255, 128, 128, 255)
  105.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  106.       else
  107.         self.contents.font.color = Color.new(255,255,0,255)
  108.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  109.       end
  110.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  111.       self.contents.font.color = normal_color
  112.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  113.     end
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● 描绘 SP
  117.   #     actor : 角色
  118.   #     x     : 描画目标 X 坐标
  119.   #     y     : 描画目标 Y 坐标
  120.   #     width : 描画目标的宽
  121.   #--------------------------------------------------------------------------
  122.   def draw_actor_sp_lvup(actor, x, y)
  123.     self.contents.font.color = system_color
  124.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  125.     if $temp_sp == 0
  126.       self.contents.font.color = normal_color
  127.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  128.     else
  129.       maxsp = actor.maxsp + $temp_sp
  130.       self.contents.font.color = Color.new(255, 128, 128, 255)
  131.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  132.       self.contents.font.color = normal_color      
  133.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  134.       if $temp_sp >=0
  135.         self.contents.font.color = Color.new(255, 128, 128, 255)
  136.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  137.       else
  138.         self.contents.font.color = Color.new(255,255,0,255)
  139.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  140.       end
  141.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  142.       self.contents.font.color = normal_color
  143.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  144.     end
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 描绘能力值
  148.   #     actor : 角色
  149.   #     x     : 描画目标 X 坐标
  150.   #     y     : 描画目标 Y 坐标
  151.   #     type  : 能力值种类 (0~4)
  152.   #--------------------------------------------------------------------------
  153.   def draw_actor_lvup(actor, x, y, type)   
  154.     # 定义数字颜色
  155.     lvup = normal_color
  156.     upcolor = Color.new(255, 128, 128, 255)
  157.     self.contents.font.color = normal_color   
  158.     case type
  159.     when 0
  160.       parameter_name = $data_system.words.str
  161.       parameter_value = actor.str
  162.       parameter_value_temp = parameter_value + $temp_str
  163.       if $temp_str != 0
  164.         lvup = upcolor
  165.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  166.         if $temp_str >= 0
  167.           self.contents.font.color = lvup
  168.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  169.         else
  170.           self.contents.font.color = Color.new(255,255,0,255)
  171.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  172.         end        
  173.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  174.         self.contents.font.color = normal_color
  175.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  176.       end
  177.     when 1
  178.       parameter_name = $data_system.words.dex
  179.       parameter_value = actor.dex
  180.       parameter_value_temp = parameter_value + $temp_dex
  181.       if $temp_dex != 0
  182.         lvup = upcolor
  183.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  184.         if $temp_dex >= 0
  185.           self.contents.font.color = lvup
  186.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  187.         else
  188.           self.contents.font.color = Color.new(255,255,0,255)
  189.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  190.         end        
  191.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  192.         self.contents.font.color = normal_color
  193.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  194.       end
  195.     when 2
  196.       parameter_name = $data_system.words.agi
  197.       parameter_value = actor.agi
  198.       parameter_value_temp = parameter_value + $temp_agi
  199.       if $temp_agi != 0
  200.         lvup = upcolor
  201.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  202.         if $temp_agi >= 0
  203.           self.contents.font.color = lvup
  204.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  205.         else
  206.           self.contents.font.color = Color.new(255,255,0,255)
  207.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  208.         end        
  209.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  210.         self.contents.font.color = normal_color
  211.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  212.       end
  213.     when 3
  214.       parameter_name = $data_system.words.int
  215.       parameter_value = actor.int
  216.       parameter_value_temp = parameter_value + $temp_int
  217.       if $temp_int != 0
  218.         lvup = upcolor
  219.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  220.         if $temp_int >= 0
  221.           self.contents.font.color = lvup
  222.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  223.         else
  224.           self.contents.font.color = Color.new(255,255,0,255)
  225.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  226.         end        
  227.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  228.         self.contents.font.color = normal_color
  229.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  230.       end
  231.     when 4
  232.       parameter_name = "剩余点数"
  233.       parameter_value = $point
  234.       if $point != 0
  235.         lvup = upcolor
  236.       end
  237.     end   
  238.     self.contents.font.color = system_color
  239.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  240.     self.contents.font.color = normal_color
  241.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  242.     if type != 4
  243.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  244.     end  
  245.     self.contents.font.color = lvup
  246.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  247.     self.contents.font.color = normal_color        
  248.   end
  249. end
  250. #==============================================================================
  251. # ■ Window_lvup
  252. #------------------------------------------------------------------------------
  253. #  显示升级状态窗口。
  254. #==============================================================================
  255. class Window_Lvup < Window_Base
  256.   #--------------------------------------------------------------------------
  257.   # ● 初始化对像
  258.   #     actor : 角色
  259.   #--------------------------------------------------------------------------
  260.   def initialize(actor)
  261.     super(0, 0, 512, 320)
  262.     self.contents = Bitmap.new(width - 32, height - 32)
  263.     @actor = actor
  264.     refresh
  265.   end  
  266.   #--------------------------------------------------------------------------
  267.   # ● 刷新
  268.   #--------------------------------------------------------------------------
  269.   def refresh
  270.     self.contents.clear
  271. #    draw_actor_graphic(@actor, 40, 112)
  272.     draw_actor_name(@actor, 4, 0)
  273.     draw_actor_class(@actor, 4 + 144, 0)
  274.     draw_actor_level(@actor, 96, 32)
  275.     draw_actor_state(@actor, 96, 64)   
  276.     draw_actor_hp_lvup(@actor, 96+128, 32)
  277.     draw_actor_sp_lvup(@actor, 96+128, 64)
  278.     draw_actor_lvup(@actor, 96, 128, 0)
  279.     draw_actor_lvup(@actor, 96, 160, 1)
  280.     draw_actor_lvup(@actor, 96, 192, 2)
  281.     draw_actor_lvup(@actor, 96, 224, 3)
  282.     draw_actor_lvup(@actor, 96, 256, 4)
  283.   end
  284. end
  285. #==============================================================================
  286. # ■ Window_Help
  287. #------------------------------------------------------------------------------
  288. #  特技及物品的说明、角色的状态显示的窗口。
  289. #==============================================================================
  290. class Window_Lvup_Help < Window_Base
  291.   #--------------------------------------------------------------------------
  292.   # ● 初始化对像
  293.   #--------------------------------------------------------------------------
  294.   def initialize
  295.     super(0, 320, 640, 160)
  296.     self.contents = Bitmap.new(width - 32, height - 32)
  297.     [url=home.php?mod=space&uid=76370]@test[/url] = "" #——这个东西用来检测,节约内存专用
  298.   end  
  299.   #--------------------------------------------------------------------------
  300.   # ● 设置文本
  301.   #--------------------------------------------------------------------------
  302.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  303.     if @test != text1
  304.       @test = text1
  305.     else
  306.       return
  307.     end   
  308.     self.contents.clear
  309.     self.contents.font.color = normal_color
  310.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  311.     if text2 != nil
  312.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  313.     end
  314.     self.contents.font.size -= 4
  315.     if text3 != nil
  316.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  317.     end
  318.     if text4 != nil
  319.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  320.     end
  321.     self.contents.font.size += 4
  322.   end
  323. end
  324. #==============================================================================
  325. # ■ Scene_lvup
  326. #------------------------------------------------------------------------------
  327. #  处理升级画面的类。
  328. #==============================================================================
  329. class Scene_Lvup
  330.   #--------------------------------------------------------------------------
  331.   # ● 初始化对像
  332.   #     actor_index : 角色索引
  333.   #     menu_index : 选项起始位置
  334.   #--------------------------------------------------------------------------
  335.   def initialize(actor_index = 0 , menu_index = 0)
  336.     @actor_index = actor_index
  337.     @menu_index = menu_index
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 主处理
  341.   #--------------------------------------------------------------------------
  342.   def main
  343.     s1 = "增加HP SP"
  344.     s2 = "增加"+$data_system.words.str
  345.     s3 = "增加"+$data_system.words.dex
  346.     s4 = "增加"+$data_system.words.agi
  347.     s5 = "增加"+$data_system.words.int
  348.     s6 = "确认加点"
  349.     s7 = "点数重置"
  350.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  351.     @command_window.index = @menu_index
  352.     # 获取角色
  353.     @actor = $game_party.actors[@actor_index]
  354.     # 将角色的剩余点数带入
  355.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  356.     # 初始化临时量
  357.     $temp_str = 0
  358.     $temp_dex = 0
  359.     $temp_agi = 0
  360.     $temp_int = 0
  361.     $temp_hp = 0
  362.     $temp_sp = 0
  363.     #=========================================================================
  364.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  365.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  366.     #=========================================================================
  367.     # 每提升一次力量,提升多少附加能力
  368.     #=========================================================================
  369.     @str_hp = 2     # 每提升一次力量附加提升多少HP
  370.     @str_sp = 2     # 每提升一次力量附加提升多少SP
  371.     @str_dex = 1    # 每提升一次力量附加提升多少灵巧
  372.     @str_agi = 1    # 每提升一次力量附加提升多少速度
  373.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  374.     @str_str = 5    # 每提升一次力量附加提升多少力量
  375.     #=========================================================================
  376.     # 每提升一次灵巧,提升多少附加能力
  377.     #=========================================================================
  378.     @dex_hp = 3     # 每提升一次灵巧附加提升多少HP
  379.     @dex_sp = 2     # 每提升一次灵巧附加提升多少SP
  380.     @dex_str = 1    # 每提升一次灵巧附加提升多少力量
  381.     @dex_agi = 1    # 每提升一次灵巧附加提升多少速度
  382.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  383.     @dex_dex = 5    # 每提升一次灵巧附加提升多少灵巧
  384.     #=========================================================================
  385.     # 每提升一次速度,提升多少附加能力
  386.     #=========================================================================
  387.     @agi_hp = 3     # 每提升一次速度附加提升多少HP
  388.     @agi_sp = 2     # 每提升一次速度附加提升多少SP
  389.     @agi_str = 1    # 每提升一次速度附加提升多少力量
  390.     @agi_dex = 1    # 每提升一次速度附加提升多少灵巧
  391.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  392.     @agi_agi = 5    # 每提升一次速度附加提升多少速度
  393.     #=========================================================================
  394.     # 每提升一次魔力,提升多少附加能力
  395.     #=========================================================================
  396.     @int_hp = 1     # 每提升一次魔力附加提升多少HP
  397.     @int_sp = 10    # 每提升一次魔力附加提升多少SP
  398.     @int_str = -1   # 每提升一次魔力附加提升多少力量
  399.     @int_dex = -1   # 每提升一次魔力附加提升多少灵巧
  400.     @int_agi = -1   # 每提升一次魔力附加提升多少速度
  401.     @int_int = 10   # 每提升一次魔力附加提升多少魔力
  402.     #=========================================================================
  403.     # 每提升一次体力,提升多少附加能力
  404.     #=========================================================================
  405.     @hp = 15       # 每提升一次体力提升多少HP
  406.     @sp = 10       # 每提升一次体力提升多少SP
  407.     @hp_str = -1   # 每提升一次体力提升多少力量
  408.     @hp_dex = -1   # 每提升一次体力提升多少速度
  409.     @hp_agi = -1   # 每提升一次体力提升多少灵巧
  410.     @hp_int = -1   # 每提升一次体力提升多少魔力   
  411.     # 定义说明文字
  412.     @text_hp_sc = "HP是维持生命的指标,SP是使用魔法损耗的力量。"
  413.     @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力。"
  414.     @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和必杀。"
  415.     @text_agi_sc = $data_system.words.agi + "可以提高回避、逃跑成功率。"
  416.     @text_int_sc = $data_system.words.int + "可以提高魔法的效果。"
  417.     @text_save = "保存分配情况并返回游戏"
  418.     @text_reset= "重新分配能力点数"
  419.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  420.     @text_hp = "最大" + $data_system.words.hp + "值"
  421.     @text_sp = "最大" + $data_system.words.sp + "值"
  422.     @text_str = "最大" + $data_system.words.str + "值"
  423.     @text_dex = "最大" + $data_system.words.dex + "值"
  424.     @text_agi = "最大" + $data_system.words.agi + "值"
  425.     @text_int = "最大" + $data_system.words.int + "值"
  426.     s_disable
  427.     # 生成状态窗口
  428.     @lvup_window = Window_Lvup.new(@actor)
  429.     @lvup_window.x = 128
  430.     @lvup_window.y = 0   
  431.     # 生成帮助窗口并初始化帮助文本
  432.     @help_window = Window_Lvup_Help.new   
  433.     # 执行过渡
  434.     Graphics.transition(20, "Graphics/Transitions/" + $data_system.battle_transition)
  435.     # 主循环
  436.     loop do
  437.       # 刷新游戏画面
  438.       Graphics.update
  439.       # 刷新输入信息
  440.       Input.update
  441.       # 刷新画面
  442.       update
  443.       # 如果切换画面就中断循环
  444.       if $scene != self
  445.         break
  446.       end
  447.     end
  448.     # 准备过渡
  449.     Graphics.freeze
  450.     # 释放窗口
  451.     @command_window.dispose
  452.     @lvup_window.dispose
  453.     @help_window.dispose
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● 刷新画面
  457.   #--------------------------------------------------------------------------
  458.   def update
  459.     # 刷新窗口
  460.     @command_window.update
  461.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  462.     s_disable
  463.     @lvup_window.update
  464.     #=============================================================
  465.     # 按下 B 键的情况下
  466.     #=============================================================
  467.     if Input.trigger?(Input::B)
  468.       # 演奏取消 SE
  469.       $game_system.se_play($data_system.cancel_se)
  470.       # 切换到地图画面
  471.       $scene = Scene_Menu.new(5)
  472.       return
  473.     end
  474.     #=============================================================
  475.     # 按下 C 键的情况下
  476.     #=============================================================
  477.     if Input.trigger?(Input::C)      
  478.       if @command_window.index == 5
  479.           # 演奏确定 SE
  480.         $game_system.se_play($data_system.decision_se)
  481.         # 将角色的剩余点数带回
  482.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  483.         # 将角色点数实际加上
  484.         @actor.str += $temp_str
  485.         @actor.dex += $temp_dex
  486.         @actor.agi += $temp_agi
  487.         @actor.int += $temp_int
  488.         @actor.maxhp += $temp_hp
  489.         @actor.maxsp += $temp_sp
  490.         # 切换到地图画面
  491.         $scene = Scene_Menu.new(5)
  492.       return
  493.       end
  494.       if @command_window.index == 6
  495.           # 演奏确定 SE
  496.         $game_system.se_play($data_system.cancel_se)
  497.           # 将角色的剩余点数带入
  498.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  499.           # 初始化临时量
  500.         $temp_str = 0
  501.         $temp_dex = 0
  502.         $temp_agi = 0
  503.         $temp_int = 0
  504.         $temp_hp = 0
  505.         $temp_sp = 0
  506.         @lvup_window.refresh
  507.         return
  508.       end
  509.       if $point == 0
  510.         # 演奏冻结 SE
  511.         $game_system.se_play($data_system.buzzer_se)
  512.         return
  513.       end
  514.       case @command_window.index
  515.       when 0
  516.         # 演奏确定 SE
  517.         $game_system.se_play($data_system.decision_se)
  518.         $temp_hp += @hp
  519.         $temp_sp += @sp
  520.         $temp_str += @hp_str
  521.         $temp_dex += @hp_dex
  522.         $temp_agi += @hp_agi
  523.         $temp_int += @hp_int
  524.         $point -= 1
  525.         @lvup_window.refresh
  526.         s_disable
  527.         return
  528.       when 1
  529.         # 演奏确定 SE
  530.         $game_system.se_play($data_system.decision_se)
  531.         $temp_str += @str_str
  532.         $temp_hp += @str_hp
  533.         $temp_sp += @str_sp
  534.         $temp_dex += @str_dex
  535.         $temp_agi += @str_agi
  536.         $temp_int += @str_int
  537.         $point -= 1
  538.         @lvup_window.refresh
  539.         s_disable
  540.         return
  541.       when 2
  542.         # 演奏确定 SE
  543.         $game_system.se_play($data_system.decision_se)
  544.         $temp_dex += @dex_dex
  545.         $temp_hp += @dex_hp
  546.         $temp_sp += @dex_sp
  547.         $temp_str += @dex_str
  548.         $temp_agi += @dex_agi
  549.         $temp_int += @dex_int
  550.         $point -= 1
  551.         @lvup_window.refresh
  552.         s_disable
  553.         return
  554.       when 3
  555.         # 演奏确定 SE
  556.         $game_system.se_play($data_system.decision_se)
  557.         $temp_agi += @agi_agi
  558.         $temp_hp += @agi_hp
  559.         $temp_sp += @agi_sp
  560.         $temp_str += @agi_str
  561.         $temp_dex += @agi_dex
  562.         $temp_int += @agi_int
  563.         $point -= 1
  564.         @lvup_window.refresh
  565.         s_disable
  566.         return
  567.       when 4
  568.         # 演奏确定 SE
  569.         $game_system.se_play($data_system.decision_se)
  570.         $temp_int += @int_int
  571.         $temp_hp += @int_hp
  572.         $temp_sp += @int_sp
  573.         $temp_str += @int_str
  574.         $temp_dex += @int_dex
  575.         $temp_agi += @int_agi
  576.         $point -= 1
  577.         @lvup_window.refresh
  578.         s_disable
  579.         return
  580.       end
  581.     end
  582.     #=============================================================
  583.     # 什么都没有按下的情况
  584.     #=============================================================
  585.     case @command_window.index   
  586.     when 0  # 增加体力
  587.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  588.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  589.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  590.     when 1  # 增加力量
  591.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  592.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  593.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  594.     when 2  # 增加灵巧
  595.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  596.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  597.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  598.     when 3  # 增加速度
  599.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  600.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  601.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  602.     when 4  # 增加魔力
  603.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  604.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  605.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  606.     when 5 # 保存设定
  607.       @help_window.lvup_text(@text_save)
  608.     when 6 # 点数重置
  609.       @help_window.lvup_text(@text_reset)     
  610.     end
  611.     #=============================================================
  612.     # 按下R与L换人的情况
  613.     #=============================================================      
  614.     if Input.trigger?(Input::R)
  615.       # 演奏光标 SE
  616.       $game_system.se_play($data_system.cursor_se)
  617.       # 移至下一位角色
  618.       @actor_index += 1
  619.       @actor_index %= $game_party.actors.size
  620.       # 切换到别的状态画面
  621.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  622.       return
  623.     end
  624.     # 按下 L 键的情况下
  625.     if Input.trigger?(Input::L)
  626.       # 演奏光标 SE
  627.       $game_system.se_play($data_system.cursor_se)
  628.       # 移至上一位角色
  629.       @actor_index += $game_party.actors.size - 1
  630.       @actor_index %= $game_party.actors.size
  631.       # 切换到别的状态画面
  632.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  633.       return
  634.     end
  635.   end  
  636.   #--------------------------------------------------------------------------
  637.   # ● 选项明暗判断
  638.   #--------------------------------------------------------------------------
  639.   def s_disable
  640.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  641.     if $point == 0
  642.       @command_window.disable_item(0)
  643.       @command_window.disable_item(1)
  644.       @command_window.disable_item(2)
  645.       @command_window.disable_item(3)
  646.       @command_window.disable_item(4)
  647.     else
  648.       @command_window.able_item(0)
  649.       @command_window.able_item(1)      
  650.       @command_window.able_item(2)
  651.       @command_window.able_item(3)
  652.       @command_window.able_item(4)
  653.     end
  654.   end
  655. end
  656.  
  657. #==============================================================================
  658. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  659. #==============================================================================

RT 我无法在游戏中调出加点栏

评分

参与人数 1星屑 +35 收起 理由
︶ㄣ牛排ぶ + 35 手动认可奖励

查看全部评分

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2014-8-22 11:00:35 | 只看该作者
菜单里是不会有的,因为脚本没重新定义Scene_Menu
23行写着正常调用的方法
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2014-8-22
帖子
21
3
 楼主| 发表于 2014-8-22 11:05:17 | 只看该作者
紫英晓狼1130 发表于 2014-8-22 11:00
菜单里是不会有的,因为脚本没重新定义Scene_Menu
23行写着正常调用的方法

额,我是新人,那个调用方法没看懂。能不能讲一下?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
4
发表于 2014-8-22 11:18:59 | 只看该作者
doubeizhuce 发表于 2014-8-22 11:05
额,我是新人,那个调用方法没看懂。能不能讲一下?

请参考范例 Project2.rar (192.74 KB, 下载次数: 29)
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

幻想天神

梦石
0
星屑
55
在线时间
166 小时
注册时间
2012-3-24
帖子
404
5
发表于 2014-8-22 13:39:53 | 只看该作者
本帖最后由 hys111111 于 2014-8-23 09:56 编辑

把这个脚本也给加进去
  1. #==============================================================================
  2. # ■ Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_Menu
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     menu_index : 命令光标的初期位置
  10.   #--------------------------------------------------------------------------
  11.   def initialize(menu_index = 0)
  12.     @menu_index = menu_index
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 主处理
  16.   #--------------------------------------------------------------------------
  17.   def main
  18.     # 生成命令窗口
  19.     s1 = $data_system.words.item
  20.     s2 = $data_system.words.skill
  21.     s3 = $data_system.words.equip
  22.     s4 = "状态"
  23.     s5 = "存档"
  24.     s6 = "结束游戏"
  25.     s7 = "升级加点"
  26.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
  27.     @command_window.index = @menu_index
  28.     # 同伴人数为 0 的情况下
  29.     if $game_party.actors.size == 0
  30.       # 物品、特技、装备、状态无效化
  31.       @command_window.disable_item(0)
  32.       @command_window.disable_item(1)
  33.       @command_window.disable_item(2)
  34.       @command_window.disable_item(3)
  35.     end
  36.     # 禁止存档的情况下
  37.     if $game_system.save_disabled
  38.       # 存档无效
  39.       @command_window.disable_item(4)
  40.     end
  41.     # 生成游戏时间窗口
  42.     @playtime_window = Window_PlayTime.new
  43.     @playtime_window.x = 0
  44.     @playtime_window.y = 224
  45.     # 生成步数窗口
  46.     @steps_window = Window_Steps.new
  47.     @steps_window.x = 0
  48.     @steps_window.y = 320
  49.     # 生成金钱窗口
  50.     @gold_window = Window_Gold.new
  51.     @gold_window.x = 0
  52.     @gold_window.y = 416
  53.     # 生成状态窗口
  54.     @status_window = Window_MenuStatus.new
  55.     @status_window.x = 160
  56.     @status_window.y = 0
  57.     # 执行过渡
  58.     Graphics.transition
  59.     # 主循环
  60.     loop do
  61.       # 刷新游戏画面
  62.       Graphics.update
  63.       # 刷新输入信息
  64.       Input.update
  65.       # 刷新画面
  66.       update
  67.       # 如果切换画面就中断循环
  68.       if $scene != self
  69.         break
  70.       end
  71.     end
  72.     # 准备过渡
  73.     Graphics.freeze
  74.     # 释放窗口
  75.     @command_window.dispose
  76.     @playtime_window.dispose
  77.     @steps_window.dispose
  78.     @gold_window.dispose
  79.     @status_window.dispose
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 刷新画面
  83.   #--------------------------------------------------------------------------
  84.   def update
  85.     # 刷新窗口
  86.     @command_window.update
  87.     @playtime_window.update
  88.     @steps_window.update
  89.     @gold_window.update
  90.     @status_window.update
  91.     # 命令窗口被激活的情况下: 调用 update_command
  92.     if @command_window.active
  93.       update_command
  94.       return
  95.     end
  96.     # 状态窗口被激活的情况下: 调用 update_status
  97.     if @status_window.active
  98.       update_status
  99.       return
  100.     end
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 刷新画面 (命令窗口被激活的情况下)
  104.   #--------------------------------------------------------------------------
  105.   def update_command
  106.     # 按下 B 键的情况下
  107.     if Input.trigger?(Input::B)
  108.       # 演奏取消 SE
  109.       $game_system.se_play($data_system.cancel_se)
  110.       # 切换的地图画面
  111.       $scene = Scene_Map.new
  112.       return
  113.     end
  114.     # 按下 C 键的情况下
  115.     if Input.trigger?(Input::C)
  116.       # 同伴人数为 0、存档、游戏结束以外的场合
  117.       if $game_party.actors.size == 0 and @command_window.index < 4
  118.         # 演奏冻结 SE
  119.         $game_system.se_play($data_system.buzzer_se)
  120.         return
  121.       end
  122.       # 命令窗口的光标位置分支
  123.       case @command_window.index
  124.       when 0  # 物品
  125.         # 演奏确定 SE
  126.         $game_system.se_play($data_system.decision_se)
  127.         # 切换到物品画面
  128.         $scene = Scene_Item.new
  129.       when 1  # 特技
  130.         # 演奏确定 SE
  131.         $game_system.se_play($data_system.decision_se)
  132.         # 激活状态窗口
  133.         @command_window.active = false
  134.         @status_window.active = true
  135.         @status_window.index = 0
  136.       when 2  # 装备
  137.         # 演奏确定 SE
  138.         $game_system.se_play($data_system.decision_se)
  139.         # 激活状态窗口
  140.         @command_window.active = false
  141.         @status_window.active = true
  142.         @status_window.index = 0
  143.       when 3  # 状态
  144.         # 演奏确定 SE
  145.         $game_system.se_play($data_system.decision_se)
  146.         # 激活状态窗口
  147.         @command_window.active = false
  148.         @status_window.active = true
  149.         @status_window.index = 0
  150.       when 4  # 存档
  151.         # 禁止存档的情况下
  152.         if $game_system.save_disabled
  153.           # 演奏冻结 SE
  154.           $game_system.se_play($data_system.buzzer_se)
  155.           return
  156.         end
  157.         # 演奏确定 SE
  158.         $game_system.se_play($data_system.decision_se)
  159.         # 切换到存档画面
  160.         $scene = Scene_Save.new
  161.       when 5  # 游戏结束
  162.         # 演奏确定 SE
  163.         $game_system.se_play($data_system.decision_se)
  164.         # 切换到游戏结束画面
  165.         $scene = Scene_End.new
  166.         when 6
  167.          
  168.         $game_system.se_play($data_system.decision_se)
  169.         # 激活状态窗口
  170.         @command_window.active = false
  171.         @status_window.active = true
  172.         @status_window.index = 0
  173.       end
  174.       return
  175.     end
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 刷新画面 (状态窗口被激活的情况下)
  179.   #--------------------------------------------------------------------------
  180.   def update_status
  181.     # 按下 B 键的情况下
  182.     if Input.trigger?(Input::B)
  183.       # 演奏取消 SE
  184.       $game_system.se_play($data_system.cancel_se)
  185.       # 激活命令窗口
  186.       @command_window.active = true
  187.       @status_window.active = false
  188.       @status_window.index = -1
  189.       return
  190.     end
  191.     # 按下 C 键的情况下
  192.     if Input.trigger?(Input::C)
  193.       # 命令窗口的光标位置分支
  194.       case @command_window.index
  195.       when 1  # 特技
  196.         # 本角色的行动限制在 2 以上的情况下
  197.         if $game_party.actors[@status_window.index].restriction >= 2
  198.           # 演奏冻结 SE
  199.           $game_system.se_play($data_system.buzzer_se)
  200.           return
  201.         end
  202.         # 演奏确定 SE
  203.         $game_system.se_play($data_system.decision_se)
  204.         # 切换到特技画面
  205.         $scene = Scene_Skill.new(@status_window.index)
  206.       when 2  # 装备
  207.         # 演奏确定 SE
  208.         $game_system.se_play($data_system.decision_se)
  209.         # 切换的装备画面
  210.         $scene = Scene_Equip.new(@status_window.index)
  211.       when 3  # 状态
  212.         # 演奏确定 SE
  213.         $game_system.se_play($data_system.decision_se)
  214.         # 切换到状态画面
  215.         $scene = Scene_Status.new(@status_window.index)
  216.         when 6
  217.         $scene = Scene_Lvup.new(@status_window.index,6)
  218.       end
  219.       return
  220.     end
  221.   end
  222. end
复制代码

评分

参与人数 1星屑 +200 收起 理由
︶ㄣ牛排ぶ + 200 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
206 小时
注册时间
2014-2-8
帖子
396
6
发表于 2014-8-22 22:12:55 | 只看该作者
自然还要修改菜单拦呼出加点啦。。。
刚接触RPG的新人们裤艾来这里!在这里能够帮助你们提高自身的能力,让大家来帮助每个人实现自己的创意、构想!
也许你只是正在看RPG教程的新人,或者是正在努力学着制作自己的RPG的制作者,或者是狂热的RPG游戏喜爱者,
但都不重要!
加入我们,我们会帮助你实现梦想,或者帮助你更好的运用RPG并且创造个人的一片天地!周末我们会不定时间开放RM技术讨论活动或者RM经验交流课!
加入我们,我们愿意与你共同创造奇迹,共同进步!
QQ群号:329443038  
或者联系QQ:573932914
我们和你站在同一线!
要求只有:常能上线
我们会用十分的热情接纳你!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2014-8-22
帖子
21
7
 楼主| 发表于 2014-8-23 09:46:33 | 只看该作者
风若·飘絮 发表于 2014-8-22 13:39
把这个脚本也给加进去

谢谢      
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

8
发表于 2014-8-23 11:01:15 | 只看该作者
因为这个脚本没有修改Scene_Menu···想要召唤这个界面你可以直接用事件指令的脚本
  1. $scene = Scene_Lvup.new(角色编号,返回菜单编号)
复制代码
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 20:49

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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