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

Project1

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

[已经解决] 求助,帮忙增添新的菜单选项

[复制链接]

Lv1.梦旅人

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

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

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

x
本帖最后由 sixapple 于 2015-8-26 21:22 编辑

我知道要在Scene_Menu里添加,但是,我后面添加的加点、换人脚本里,也有Scene_Menu部分,算是直接覆盖了前面的。
我是想把叶子的详尽任务显示界面,添加到菜单当中,并且与升级加点,换队伍顺序这两个脚本并存。
自己尝试弄了一下,菜单里倒是显示出选项了,但一点开就报错。

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

Lv1.梦旅人

梦石
0
星屑
172
在线时间
37 小时
注册时间
2009-7-5
帖子
49
2
 楼主| 发表于 2015-8-26 21:14:15 | 只看该作者
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. class Scene_Save
  6.   #--------------------------------------------------------------------------
  7.   # ● 写入存档数据
  8.   #     file : 写入用文件对像 (已经打开)
  9.   #--------------------------------------------------------------------------
  10.   def write_save_data(file)
  11.     # 生成描绘存档文件用的角色图形
  12.     characters = []
  13.     for i in 0...[$game_party.actors.size,4].min
  14.       actor = $game_party.actors[i]
  15.       characters.push([actor.character_name, actor.character_hue])
  16.     end
  17.     # 写入描绘存档文件用的角色数据
  18.     Marshal.dump(characters, file)
  19.     # 写入测量游戏时间用画面计数
  20.     Marshal.dump(Graphics.frame_count, file)
  21.     # 增加 1 次存档次数
  22.     $game_system.save_count += 1
  23.     # 保存魔法编号
  24.     # (将编辑器保存的值以随机值替换)
  25.     $game_system.magic_number = $data_system.magic_number
  26.     # 写入各种游戏对像
  27.     Marshal.dump($game_system, file)
  28.     Marshal.dump($game_switches, file)
  29.     Marshal.dump($game_variables, file)
  30.     Marshal.dump($game_self_switches, file)
  31.     Marshal.dump($game_screen, file)
  32.     Marshal.dump($game_actors, file)
  33.     Marshal.dump($game_party, file)
  34.     Marshal.dump($game_troop, file)
  35.     Marshal.dump($game_map, file)
  36.     Marshal.dump($game_player, file)
  37.   end
  38. end
  39.  
  40. class Scene_Battle
  41.   #--------------------------------------------------------------------------
  42.   # ● 设置物品或特技对像方的战斗者
  43.   #     scope : 特技或者是物品的范围
  44.   #--------------------------------------------------------------------------
  45.   def set_target_battlers(scope)
  46.     # 行动方的战斗者是敌人的情况下
  47.     if @active_battler.is_a?(Game_Enemy)
  48.       # 效果范围分支
  49.       case scope
  50.       when 1  # 敌单体
  51.         index = @active_battler.current_action.target_index
  52.         @target_battlers.push($game_party.smooth_target_actor(index))
  53.       when 2  # 敌全体
  54.         for actor in 0...[$game_party.actors.size,4].min
  55.           if $game_party.actors[actor].exist?
  56.             @target_battlers.push($game_party.actors[actor])
  57.           end
  58.         end
  59.       when 3  # 我方单体
  60.         index = @active_battler.current_action.target_index
  61.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  62.       when 4  # 我方全体
  63.         for enemy in $game_troop.enemies
  64.           if enemy.exist?
  65.             @target_battlers.push(enemy)
  66.           end
  67.         end
  68.       when 5  # 我方单体 (HP 0)
  69.         index = @active_battler.current_action.target_index
  70.         enemy = $game_troop.enemies[index]
  71.         if enemy != nil and enemy.hp0?
  72.           @target_battlers.push(enemy)
  73.         end
  74.       when 6  # 我方全体 (HP 0)
  75.         for enemy in $game_troop.enemies
  76.           if enemy != nil and enemy.hp0?
  77.             @target_battlers.push(enemy)
  78.           end
  79.         end
  80.       when 7  # 使用者
  81.         @target_battlers.push(@active_battler)
  82.       end
  83.     end
  84.     # 行动方的战斗者是角色的情况下
  85.     if @active_battler.is_a?(Game_Actor)
  86.       # 效果范围分支
  87.       case scope
  88.       when 1  # 敌单体
  89.         index = @active_battler.current_action.target_index
  90.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  91.       when 2  # 敌全体
  92.         for enemy in $game_troop.enemies
  93.           if enemy.exist?
  94.             @target_battlers.push(enemy)
  95.           end
  96.         end
  97.       when 3  # 我方单体
  98.         index = @active_battler.current_action.target_index
  99.         @target_battlers.push($game_party.smooth_target_actor(index))
  100.       when 4  # 我方全体
  101.         for actor in 0...[$game_party.actors.size,4].min
  102.           if $game_party.actors[actor].exist?
  103.             @target_battlers.push($game_party.actors[actor])
  104.           end
  105.         end
  106.       when 5  # 我方单体 (HP 0)
  107.         index = @active_battler.current_action.target_index
  108.         actor = $game_party.actors[index]
  109.         if actor != nil and actor.hp0?
  110.           @target_battlers.push(actor)
  111.         end
  112.       when 6  # 我方全体 (HP 0)
  113.         for actor in 0...[$game_party.actors.size,4].min
  114.           if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
  115.             @target_battlers.push($game_party.actors[actor])
  116.           end
  117.         end
  118.       when 7  # 使用者
  119.         @target_battlers.push(@active_battler)
  120.       end
  121.     end
  122.   end  
  123.   #--------------------------------------------------------------------------
  124.   # ● 生成行动循序
  125.   #--------------------------------------------------------------------------
  126.   def make_action_orders
  127.     # 初始化序列 @action_battlers
  128.     @action_battlers = []
  129.     # 添加敌人到 @action_battlers 序列
  130.     for enemy in $game_troop.enemies
  131.       @action_battlers.push(enemy)
  132.     end
  133.     # 添加角色到 @action_battlers 序列
  134.     for actor in 0...[$game_party.actors.size,4].min
  135.       @action_battlers.push($game_party.actors[actor])
  136.     end
  137.     # 确定全体的行动速度
  138.     for battler in @action_battlers
  139.       battler.make_action_speed
  140.     end
  141.     # 按照行动速度从大到小排列
  142.     @action_battlers.sort! {|a,b|
  143.       b.current_action.speed - a.current_action.speed }
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 开始结束战斗回合
  147.   #--------------------------------------------------------------------------
  148.   def start_phase5
  149.     # 转移到回合 5
  150.     @phase = 5
  151.         if $game_switches[79] == true
  152.   $game_variables[100] += 1
  153.   end
  154.     # 演奏战斗结束 ME
  155.     $game_system.me_play($game_system.battle_end_me)
  156.     # 还原为战斗开始前的 BGM
  157.     $game_system.bgm_play($game_temp.map_bgm)
  158.     # 初始化 EXP、金钱、宝物
  159.     exp = 0
  160.     gold = 0
  161.     treasures = []
  162.     # 循环
  163.     for enemy in $game_troop.enemies
  164.       # 敌人不是隐藏状态的情况下
  165.       unless enemy.hidden
  166.         # 获得 EXP、增加金钱
  167.         exp += enemy.exp
  168.         gold += enemy.gold
  169.         # 出现宝物判定
  170.         if rand(100) < enemy.treasure_prob
  171.           if enemy.item_id > 0
  172.             treasures.push($data_items[enemy.item_id])
  173.           end
  174.           if enemy.weapon_id > 0
  175.             treasures.push($data_weapons[enemy.weapon_id])
  176.           end
  177.           if enemy.armor_id > 0
  178.             treasures.push($data_armors[enemy.armor_id])
  179.           end
  180.         end
  181.       end
  182.     end
  183.     # 限制宝物数为 6 个
  184.     treasures = treasures[0..5]
  185.     # 获得 EXP
  186.     for i in 0...[$game_party.actors.size,4].min
  187.       actor = $game_party.actors[i]
  188.       if actor.cant_get_exp? == false
  189.         last_level = actor.level
  190.         actor.exp += exp
  191.         if actor.level > last_level
  192.           @status_window.level_up(i)
  193.         end
  194.       end
  195.     end
  196.     # 获得金钱
  197.     $game_party.gain_gold(gold)
  198.     # 获得宝物
  199.     for item in treasures
  200.       case item
  201.       when RPG::Item
  202.         $game_party.gain_item(item.id, 1)
  203.       when RPG::Weapon
  204.         $game_party.gain_weapon(item.id, 1)
  205.       when RPG::Armor
  206.         $game_party.gain_armor(item.id, 1)
  207.       end
  208.     end
  209.     # 生成战斗结果窗口
  210.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  211.     # 设置等待计数
  212.     @phase5_wait_count = 100
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ● 转到输入下一个角色的命令
  216.   #--------------------------------------------------------------------------
  217.   def phase3_next_actor
  218.     # 循环
  219.     begin
  220.       # 角色的明灭效果 OFF
  221.       if @active_battler != nil
  222.         @active_battler.blink = false
  223.       end
  224.       # 最后的角色的情况
  225.       if @actor_index == [$game_party.actors.size-1,3].min
  226.         # 开始主回合
  227.         start_phase4
  228.         return
  229.       end
  230.       # 推进角色索引
  231.       @actor_index += 1
  232.       @active_battler = $game_party.actors[@actor_index]
  233.       @active_battler.blink = true
  234.     # 如果角色是在无法接受指令的状态就再试
  235.     end until @active_battler.inputable?
  236.     # 设置角色的命令窗口
  237.     phase3_setup_command_window
  238.   end
  239. end
  240.  
  241. class Arrow_Actor < Arrow_Base  
  242.   #--------------------------------------------------------------------------
  243.   # ● 刷新画面
  244.   #--------------------------------------------------------------------------
  245.   def update
  246.     super
  247.     # 光标右
  248.     if Input.repeat?(Input::RIGHT)
  249.       $game_system.se_play($data_system.cursor_se)
  250.       @index += 1
  251.       @index %= [$game_party.actors.size,4].min
  252.     end
  253.     # 光标左
  254.     if Input.repeat?(Input::LEFT)
  255.       $game_system.se_play($data_system.cursor_se)
  256.       @index += $game_party.actors.size - 1
  257.       @index %= [$game_party.actors.size,4].min
  258.     end
  259.     # 设置活动块坐标
  260.     if self.actor != nil
  261.       self.x = self.actor.screen_x
  262.       self.y = self.actor.screen_y
  263.     end
  264.   end
  265. end
  266.  
  267. #==============================================================================
  268. # ■ Window_Target
  269. #------------------------------------------------------------------------------
  270. #  物品画面与特技画面的、使用对像角色选择窗口。
  271. #==============================================================================
  272.  
  273. class Window_Target < Window_Selectable
  274. #--------------------------------------------------------------------------
  275. # ● 初始化对像
  276. #--------------------------------------------------------------------------
  277. def initialize
  278.    super(0, 0, 336, 480)
  279.    self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
  280.    self.z += 10
  281.    @item_max = $game_party.actors.size
  282.    @top_row = 0
  283.    refresh
  284. end
  285. #--------------------------------------------------------------------------
  286. # ● 刷新
  287. #--------------------------------------------------------------------------
  288. def refresh
  289.    self.contents.clear
  290.    for i in 0...$game_party.actors.size
  291.      x = 4
  292.      y = i * 112
  293.      actor = $game_party.actors[i]
  294.      draw_actor_name(actor, x, y)
  295.      draw_actor_class(actor, x + 144, y)
  296.      draw_actor_level(actor, x + 8, y + 32)
  297.      draw_actor_state(actor, x + 8, y + 64)
  298.      draw_actor_hp(actor, x + 152, y + 32)
  299.      draw_actor_sp(actor, x + 152, y + 64)
  300.    end
  301. end  
  302. #--------------------------------------------------------------------------
  303. # ● 刷新光标矩形
  304. #--------------------------------------------------------------------------
  305. def update_cursor_rect   
  306.    # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
  307.    if @index <= -2
  308.      self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
  309.    elsif @index == -1
  310.      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
  311.    else
  312.      tpy = @index * 112 - self.oy
  313.      self.cursor_rect.set(0, tpy, self.width - 32, 96)
  314.      if @index < @top_row
  315.        @top_row = @index
  316.        self.oy = @top_row *112
  317.      end
  318.      if @index > @top_row+3
  319.        @top_row = @index-3
  320.        self.oy = @top_row *112
  321.      end
  322.    end   
  323. end
  324. end
  325. #==============================================================================
  326. # ■ Window_MenuStatus
  327. #------------------------------------------------------------------------------
  328. #  显示菜单画面和同伴状态的窗口。
  329. #==============================================================================
  330.  
  331. class Window_MenuStatus < Window_Selectable
  332.   #--------------------------------------------------------------------------
  333.   # ● 初始化目标
  334.   #--------------------------------------------------------------------------
  335.   def initialize
  336.     super(0, 0, 480, 480)
  337.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  338.     refresh
  339.     @top_row = 0
  340.     self.active = false
  341.     self.index = -1
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● 刷新
  345.   #--------------------------------------------------------------------------
  346.   def refresh
  347.     self.contents.clear
  348.     @item_max = $game_party.actors.size
  349.     for i in 0...$game_party.actors.size
  350.       x = 64
  351.       y = i * 112
  352.       if i <=3
  353.         self.contents.font.color = Color.new(255,255,0,255)
  354.         self.contents.draw_text(x,y,340,32,"[出战]",2)
  355.         self.contents.font.color = normal_color
  356.       else
  357.         self.contents.font.color = Color.new(128,128,128,255)
  358.         self.contents.draw_text(x,y,340,32,"[待机]",2)
  359.         self.contents.font.color = normal_color
  360.       end      
  361.       actor = $game_party.actors[i]
  362.       draw_actor_graphic(actor, x - 40, y + 80)
  363.       draw_actor_name(actor, x, y)
  364.       draw_actor_class(actor, x + 144, y)
  365.       draw_actor_level(actor, x, y + 32)
  366.       draw_actor_state(actor, x + 90, y + 32)
  367.       draw_actor_exp(actor, x, y + 64)
  368.       draw_actor_hp(actor, x + 236, y + 32)
  369.       draw_actor_sp(actor, x + 236, y + 64)
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 刷新光标矩形
  374.   #--------------------------------------------------------------------------
  375.   def update_cursor_rect
  376.     if @index < 0
  377.       self.cursor_rect.empty
  378.     else
  379.       tpy = @index * 112 - self.oy
  380.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  381.       if @index < @top_row
  382.         @top_row = @index
  383.         self.oy = @top_row *112
  384.       end
  385.       if @index > @top_row+3
  386.         @top_row = @index-3
  387.         self.oy = @top_row *112
  388.       end
  389.     end
  390.   end
  391. end
  392.  
  393. class Game_Party
  394.   #--------------------------------------------------------------------------
  395.   # ● 全灭判定
  396.   #--------------------------------------------------------------------------
  397.   def all_dead?
  398.     # 同伴人数为 0 的情况下
  399.     if $game_party.actors.size == 0
  400.       return false
  401.     end
  402.     # 同伴中无人 HP 在 0 以上
  403.     for i in 0..3
  404.       if @actors[i] != nil and@actors[i].hp >0
  405.         return false
  406.       end
  407.     end
  408.     # 全灭
  409.     return true
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 加入同伴
  413.   #     actor_id : 角色 ID
  414.   #--------------------------------------------------------------------------
  415.   def add_actor(actor_id)
  416.     # 获取角色
  417.     actor = $game_actors[actor_id]
  418.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  419.     if not @actors.include?(actor)
  420.       # 添加角色
  421.       @actors.push(actor)
  422.       # 还原主角
  423.       $game_player.refresh
  424.     end
  425.   end
  426. end
  427.  
  428. #==============================================================================
  429. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  430. #==============================================================================
  431.  
  432.  
  433. class Scene_Menu
  434. # --------------------------------
  435.   def initialize(menu_index = 0)
  436.     @menu_index = menu_index
  437.     @changer = 0
  438.     @where = 0
  439.     @checker = 0
  440.   end
  441. # --------------------------------
  442.   def main
  443.     s1 = $data_system.words.item
  444.     s2 = $data_system.words.skill
  445.     s3 = $data_system.words.equip
  446.     s4 = "状态"
  447.     s5 = "储存进度"
  448.     s6 = "离开游戏"
  449.     s7 = "调整队伍"
  450.     s8 = "升级加点"
  451.     s9 = "剧情任务"
  452.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8, s9])
  453.     @command_window.index = @menu_index
  454.     if $game_party.actors.size == 0
  455.       @command_window.disable_item(0)
  456.       @command_window.disable_item(1)
  457.       @command_window.disable_item(2)
  458.       @command_window.disable_item(3)
  459.     end
  460.     if $game_system.save_disabled
  461.       @command_window.disable_item(4)
  462.     end
  463.     if $game_party.actors.size == 1
  464.       @command_window.disable_item(6)
  465.     end
  466.     @playtime_window = Window_PlayTime.new
  467.     @playtime_window.x = 0
  468.     @playtime_window.y = 320
  469.     @gold_window = Window_Gold.new
  470.     @gold_window.x = 0
  471.     @gold_window.y = 416
  472.     @status_window = Window_MenuStatus.new
  473.     @status_window.x = 160
  474.     @status_window.y = 0
  475.     Graphics.transition
  476.     loop do
  477.       Graphics.update
  478.       Input.update
  479.       update
  480.       if $scene != self
  481.         break
  482.       end
  483.     end
  484.     Graphics.freeze
  485.     @command_window.dispose
  486.     @playtime_window.dispose
  487.     @gold_window.dispose
  488.     @status_window.dispose
  489.   end
  490. # --------------------------------
  491.   def update
  492.     @command_window.update
  493.     @playtime_window.update
  494.     @gold_window.update
  495.     @status_window.update
  496.     if @command_window.active
  497.       update_command
  498.       return
  499.     end
  500.     if @status_window.active
  501.       update_status
  502.       return
  503.     end
  504.   end
  505. # --------------------------------
  506.   def update_command
  507.     if Input.trigger?(Input::B)
  508.       $game_system.se_play($data_system.cancel_se)
  509.       $scene = Scene_Map.new
  510.       return
  511.     end
  512.     if Input.trigger?(Input::C)
  513.       if $game_party.actors.size == 0 and @command_window.index < 4
  514.         $game_system.se_play($data_system.buzzer_se)
  515.         return
  516.       end
  517.       if $game_party.actors.size == 1 and @command_window.index ==6
  518.         $game_system.se_play($data_system.buzzer_se)
  519.         return
  520.       end
  521.       case @command_window.index
  522.       when 0
  523.         $game_system.se_play($data_system.decision_se)
  524.         $scene = Scene_Item.new
  525.       when 1
  526.         $game_system.se_play($data_system.decision_se)
  527.         @command_window.active = false
  528.         @status_window.active = true
  529.         @status_window.index = 0
  530.       when 2
  531.         $game_system.se_play($data_system.decision_se)
  532.         @command_window.active = false
  533.         @status_window.active = true
  534.         @status_window.index = 0
  535.       when 3
  536.         $game_system.se_play($data_system.decision_se)
  537.         @command_window.active = false
  538.         @status_window.active = true
  539.         @status_window.index = 0
  540.       when 4
  541.         if $game_system.save_disabled
  542.           $game_system.se_play($data_system.buzzer_se)
  543.           return
  544.         end
  545.         $game_system.se_play($data_system.decision_se)
  546.         $scene = Scene_Save.new
  547.       when 5
  548.         $game_system.se_play($data_system.decision_se)
  549.         $scene = Scene_End.new
  550.       when 6
  551.         $game_system.se_play($data_system.decision_se)
  552.         @checker = 0
  553.         @command_window.active = false
  554.         @status_window.active = true
  555.         @status_window.index = 0
  556.       when 7
  557.         $game_system.se_play($data_system.decision_se)
  558.         @command_window.active = false
  559.         @status_window.active = true
  560.         @status_window.index = 0
  561.       when 8
  562.         $game_system.se_play($data_system.decision_se)
  563.         @command_window.active = false
  564.         @status_window.active = true
  565.         @status_window.index = 0
  566.       when 9
  567.         $scene = Scene_Mission.new
  568.       end
  569.       return
  570.     end
  571.   end
  572. # --------------------------------
  573.   def update_status
  574.     if Input.trigger?(Input::B)
  575.       $game_system.se_play($data_system.cancel_se)
  576.       @command_window.active = true
  577.       @status_window.active = false
  578.       @status_window.index = -1
  579.       return
  580.     end
  581.     if Input.trigger?(Input::C)
  582.       case @command_window.index
  583.       when 1
  584.         if $game_party.actors[@status_window.index].restriction >= 2
  585.           $game_system.se_play($data_system.buzzer_se)
  586.           return
  587.         end
  588.         $game_system.se_play($data_system.decision_se)
  589.         $scene = Scene_Skill.new(@status_window.index)
  590.       when 2
  591.         $game_system.se_play($data_system.decision_se)
  592.         $scene = Scene_Equip.new(@status_window.index)
  593.       when 3
  594.         $game_system.se_play($data_system.decision_se)
  595.         $scene = Scene_Status.new(@status_window.index)
  596.       when 6
  597.         $game_system.se_play($data_system.decision_se)
  598.         if @checker == 0
  599.           @changer = $game_party.actors[@status_window.index]
  600.           @where = @status_window.index
  601.           @checker = 1
  602.         else
  603.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  604.           $game_party.actors[@status_window.index] = @changer
  605.           @checker = 0
  606.           @status_window.refresh
  607.         end
  608.       when 7
  609.         $game_system.se_play($data_system.decision_se)
  610.         $scene = Scene_Lvup.new(@status_window.index)
  611.       when 8
  612.         $game_system.se_play($data_system.decision_se)
  613.         $scene = Scene_Charactor.new(@status_window.index)
  614.       when 9
  615.         $scene = Scene_Mission.new
  616.       end
  617.       return
  618.     end
  619.   end
  620. end
  621.  
  622.  
  623.  
  624.     #插件(升级加点,换队伍顺序,人物介绍,动态行走图)
  625.  
  626. #==============================================================================
  627. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  628. #==============================================================================
  629.  
  630.  
  631. # 作者: 柳柳
  632. #
  633. # 说明:这是功能我再比较早期的时候发布在幻森,不过那时候比较笨,方法很糟糕
  634. #       这次是拿上就可以用的。
  635. #
  636. # 感谢:Claimh的脚本使我想起这个功能重做了一遍,本想直接用他的,不过他的算法过分
  637. #       冗余了,没好意思用。
  638. #==============================================================================
  639. # 使用方法:默认情况下把静态图变为了走步图。如果想自行修改,提供功能如下:
  640. #
  641. # 角色走步图:draw_walk_actor_graphic
  642. # 角色转向图:draw_turn_actor_graphic
  643. #
  644. # 回复原有静态角色图:删除100行以后的内容。修改下面这个变量可以更改行走速度
  645. #==============================================================================
  646.  
  647. WALK_REFRESH_FRAME_SPEED = 15  # 刷新的速度,越大越慢,你可以改为3左右试试看
  648.  
  649. #==============================================================================
  650. # Window_Base
  651. #==============================================================================
  652. class Window_Base < Window
  653.   #--------------------------------------------------------------------------
  654.   # 初始化方法
  655.   #--------------------------------------------------------------------------
  656.   alias initialize_walk initialize
  657.   def initialize(x, y, width, height)
  658.     initialize_walk(x, y, width, height)
  659.     @start_walk = false
  660.     @turn_index = 0
  661.     @turn_phase = 0
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # ★  角色行走图
  665.   #     actor : 角色
  666.   #     x     : 描绘的 X 坐标
  667.   #     y     : 描绘的 Y 坐标
  668.   #--------------------------------------------------------------------------
  669.   def draw_walk_actor_graphic(actor, x, y)
  670.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  671.     cw = bitmap.width / 4
  672.     ch = bitmap.height / 4
  673.     @start_turn = true
  674.     case @turn_phase
  675.     when 0
  676.       x_x = 0
  677.     when 1
  678.       x_x = cw
  679.     when 2
  680.       x_x = cw * 2
  681.     when 3
  682.       x_x = cw * 3
  683.     end
  684.     src_rect = Rect.new(x_x, 0, cw, ch)
  685.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  686.   end
  687.   #--------------------------------------------------------------------------
  688.   # ★  角色转向图
  689.   #     actor : 角色
  690.   #     x     : 描绘的 X 坐标
  691.   #     y     : 描绘的 Y 坐标
  692.   #--------------------------------------------------------------------------
  693.   def draw_turn_actor_graphic(actor, x, y)
  694.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  695.     cw = bitmap.width / 4
  696.     ch = bitmap.height / 4
  697.     @start_turn = true
  698.     case @turn_phase
  699.     when 0
  700.       x_x = 0
  701.     when 1
  702.       x_x = ch
  703.     when 2
  704.       x_x = ch * 3
  705.     when 3
  706.       x_x = ch * 2
  707.     end
  708.     src_rect = Rect.new(0, x_x, cw, ch)
  709.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   #  更新(可别使用刷新,玩命耗费内存= =)
  713.   #--------------------------------------------------------------------------
  714.   alias walk_update update
  715.   def update
  716.     walk_update
  717.     if @start_turn == true
  718.       @turn_index += 1
  719.       if @turn_index == WALK_REFRESH_FRAME_SPEED
  720.         refresh
  721.         @turn_index = 0
  722.         @turn_phase = (@turn_phase+1)%4
  723.       end
  724.     end
  725.   end  
  726. end
  727.  
  728. #==============================================================================
  729. # Window_Base
  730. #==============================================================================
  731. class Window_Base < Window
  732.   #--------------------------------------------------------------------------
  733.   # 把原有静态图改为动态走步图
  734.   #--------------------------------------------------------------------------
  735.   def draw_actor_graphic(actor, x, y)
  736.     draw_walk_actor_graphic(actor, x, y)
  737.   end
  738. end
  739.  
  740. #==============================================================================
  741. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  742. #==============================================================================
  743.  
  744. #==============================================================================
  745. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  746. #==============================================================================
  747.  
  748.  
  749. # 脚本使用设定:
  750.  
  751. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  752. LEVEL_UP_VARIABLE = 200  # 储存角色点数的变量编号与角色id编号的差值
  753.                          # 默认情况 = 200,
  754.                          # 则是数据库里1号角色的加点数存于101号变量
  755.                          # 3号角色的加点数存于103号变量。
  756.                          # 你可以直接操作变量赠与角色可分配点数
  757.  
  758. # 每增加一次点数,各项能力值的变化:357-410行
  759.  
  760. # 使用方法介绍:
  761.  
  762. # 本脚本不会取代原升级功能 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  763. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  764. # 1-99级全部等于一个相同数值就行了。
  765.  
  766. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  767. # 默认都是0号
  768.  
  769. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  770. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  771.  
  772. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
  773.  
  774. #==============================================================================
  775. # ■ Window_Command
  776. #------------------------------------------------------------------------------
  777. #  一般的命令选择行窗口。(追加定义)
  778. #==============================================================================
  779. class Window_Command < Window_Selectable
  780.   #--------------------------------------------------------------------------
  781.   # ● 项目有效化
  782.   #     index : 项目编号
  783.   #--------------------------------------------------------------------------
  784.   def able_item(index)
  785.     draw_item(index, normal_color)
  786.   end
  787. end
  788. #==============================================================================
  789. # ■ Game_Actor
  790. #------------------------------------------------------------------------------
  791. #  处理角色的类。(再定义)
  792. #==============================================================================
  793. class Game_Actor < Game_Battler
  794.   #--------------------------------------------------------------------------
  795.   # ● 更改 EXP
  796.   #     exp : 新的 EXP
  797.   #--------------------------------------------------------------------------
  798.   def exp=(exp)
  799.     @exp = [[exp, 9999999].min, 0].max
  800.     # 升级
  801.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  802.       @level += 1
  803.       # 增加4点可自由分配的点数
  804.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  805.       # 学会特技
  806.       for j in $data_classes[@class_id].learnings
  807.         if j.level == @level
  808.           learn_skill(j.skill_id)
  809.         end
  810.       end
  811.     end
  812.     # 降级
  813.     while @exp < @exp_list[@level]
  814.       @level -= 1
  815.     end
  816.     # 修正当前的 HP 与 SP 超过最大值
  817.     @hp = [@hp, self.maxhp].min
  818.     @sp = [@sp, self.maxsp].min
  819.   end
  820. end
  821. #==============================================================================
  822. # ■ Window_Base
  823. #------------------------------------------------------------------------------
  824. #  游戏中全部窗口的超级类(追加定义)
  825. #==============================================================================
  826. class Window_Base < Window
  827.   #--------------------------------------------------------------------------
  828.   # ● 描绘 HP
  829.   #     actor : 角色
  830.   #     x     : 描画目标 X 坐标
  831.   #     y     : 描画目标 Y 坐标
  832.   #     width : 描画目标的宽
  833.   #--------------------------------------------------------------------------
  834.   def draw_actor_hp_lvup(actor, x, y)
  835.     self.contents.font.color = system_color
  836.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  837.     if $temp_hp == 0
  838.       self.contents.font.color = normal_color
  839.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  840.     else
  841.       maxhp = actor.maxhp + $temp_hp
  842.       self.contents.font.color = Color.new(255, 128, 128, 255)
  843.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  844.       self.contents.font.color = normal_color      
  845.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  846.       if $temp_hp >=0
  847.         self.contents.font.color = Color.new(255, 128, 128, 255)
  848.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  849.       else
  850.         self.contents.font.color = Color.new(255,255,0,255)
  851.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  852.       end
  853.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  854.       self.contents.font.color = normal_color
  855.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  856.     end
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● 描绘 SP
  860.   #     actor : 角色
  861.   #     x     : 描画目标 X 坐标
  862.   #     y     : 描画目标 Y 坐标
  863.   #     width : 描画目标的宽
  864.   #--------------------------------------------------------------------------
  865.   def draw_actor_sp_lvup(actor, x, y)
  866.     self.contents.font.color = system_color
  867.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  868.     if $temp_sp == 0
  869.       self.contents.font.color = normal_color
  870.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  871.     else
  872.       maxsp = actor.maxsp + $temp_sp
  873.       self.contents.font.color = Color.new(255, 128, 128, 255)
  874.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  875.       self.contents.font.color = normal_color      
  876.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  877.       if $temp_sp >=0
  878.         self.contents.font.color = Color.new(255, 128, 128, 255)
  879.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  880.       else
  881.         self.contents.font.color = Color.new(255,255,0,255)
  882.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  883.       end
  884.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  885.       self.contents.font.color = normal_color
  886.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  887.     end
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 描绘能力值
  891.   #     actor : 角色
  892.   #     x     : 描画目标 X 坐标
  893.   #     y     : 描画目标 Y 坐标
  894.   #     type  : 能力值种类 (0~4)
  895.   #--------------------------------------------------------------------------
  896.   def draw_actor_lvup(actor, x, y, type)   
  897.     # 定义数字颜色
  898.     lvup = normal_color
  899.     upcolor = Color.new(255, 128, 128, 255)
  900.     self.contents.font.color = normal_color   
  901.     case type
  902.     when 0
  903.       parameter_name = $data_system.words.str
  904.       parameter_value = actor.str
  905.       parameter_value_temp = parameter_value + $temp_str
  906.       if $temp_str != 0
  907.         lvup = upcolor
  908.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  909.         if $temp_str >= 0
  910.           self.contents.font.color = lvup
  911.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  912.         else
  913.           self.contents.font.color = Color.new(255,255,0,255)
  914.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  915.         end        
  916.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  917.         self.contents.font.color = normal_color
  918.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  919.       end
  920.     when 1
  921.       parameter_name = $data_system.words.dex
  922.       parameter_value = actor.dex
  923.       parameter_value_temp = parameter_value + $temp_dex
  924.       if $temp_dex != 0
  925.         lvup = upcolor
  926.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  927.         if $temp_dex >= 0
  928.           self.contents.font.color = lvup
  929.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  930.         else
  931.           self.contents.font.color = Color.new(255,255,0,255)
  932.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  933.         end        
  934.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  935.         self.contents.font.color = normal_color
  936.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  937.       end
  938.     when 2
  939.       parameter_name = $data_system.words.agi
  940.       parameter_value = actor.agi
  941.       parameter_value_temp = parameter_value + $temp_agi
  942.       if $temp_agi != 0
  943.         lvup = upcolor
  944.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  945.         if $temp_agi >= 0
  946.           self.contents.font.color = lvup
  947.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  948.         else
  949.           self.contents.font.color = Color.new(255,255,0,255)
  950.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  951.         end        
  952.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  953.         self.contents.font.color = normal_color
  954.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  955.       end
  956.     when 3
  957.       parameter_name = $data_system.words.int
  958.       parameter_value = actor.int
  959.       parameter_value_temp = parameter_value + $temp_int
  960.       if $temp_int != 0
  961.         lvup = upcolor
  962.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  963.         if $temp_int >= 0
  964.           self.contents.font.color = lvup
  965.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  966.         else
  967.           self.contents.font.color = Color.new(255,255,0,255)
  968.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  969.         end        
  970.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  971.         self.contents.font.color = normal_color
  972.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  973.       end
  974.     when 4
  975.       parameter_name = "剩余点数"
  976.       parameter_value = $point
  977.       if $point != 0
  978.         lvup = upcolor
  979.       end
  980.     end   
  981.     self.contents.font.color = system_color
  982.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  983.     self.contents.font.color = normal_color
  984.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  985.     if type != 4
  986.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  987.     end  
  988.     self.contents.font.color = lvup
  989.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  990.     self.contents.font.color = normal_color        
  991.   end
  992. end
  993. #==============================================================================
  994. # ■ Window_lvup
  995. #------------------------------------------------------------------------------
  996. #  显示升级状态窗口。
  997. #==============================================================================
  998. class Window_Lvup < Window_Base
  999.   #--------------------------------------------------------------------------
  1000.   # ● 初始化对像
  1001.   #     actor : 角色
  1002.   #--------------------------------------------------------------------------
  1003.   def initialize(actor)
  1004.     super(0, 0, 512, 320)
  1005.     self.contents = Bitmap.new(width - 32, height - 32)
  1006.     @actor = actor
  1007.     refresh
  1008.   end  
  1009.   #--------------------------------------------------------------------------
  1010.   # ● 刷新
  1011.   #--------------------------------------------------------------------------
  1012.   def refresh
  1013.     self.contents.clear
  1014.     draw_actor_graphic(@actor, 40, 112)
  1015.     draw_actor_name(@actor, 4, 0)
  1016.     draw_actor_class(@actor, 4 + 144, 0)
  1017.     draw_actor_level(@actor, 96, 32)
  1018.     draw_actor_state(@actor, 96, 64)   
  1019.     draw_actor_hp_lvup(@actor, 96+128, 32)
  1020.     draw_actor_sp_lvup(@actor, 96+128, 64)
  1021.     draw_actor_lvup(@actor, 96, 128, 0)
  1022.     draw_actor_lvup(@actor, 96, 160, 1)
  1023.     draw_actor_lvup(@actor, 96, 192, 2)
  1024.     draw_actor_lvup(@actor, 96, 224, 3)
  1025.     draw_actor_lvup(@actor, 96, 256, 4)
  1026.   end
  1027. end
  1028. #==============================================================================
  1029. # ■ Window_Help
  1030. #------------------------------------------------------------------------------
  1031. #  特技及物品的说明、角色的状态显示的窗口。
  1032. #==============================================================================
  1033. class Window_Lvup_Help < Window_Base
  1034.   #--------------------------------------------------------------------------
  1035.   # ● 初始化对像
  1036.   #--------------------------------------------------------------------------
  1037.   def initialize
  1038.     super(0, 320, 640, 160)
  1039.     self.contents = Bitmap.new(width - 32, height - 32)
  1040.     @test = "" #——这个东西用来检测,节约内存专用
  1041.   end  
  1042.   #--------------------------------------------------------------------------
  1043.   # ● 设置文本
  1044.   #--------------------------------------------------------------------------
  1045.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  1046.     if @test != text1
  1047.       @test = text1
  1048.     else
  1049.       return
  1050.     end   
  1051.     self.contents.clear
  1052.     self.contents.font.color = normal_color
  1053.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  1054.     if text2 != nil
  1055.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  1056.     end
  1057.     self.contents.font.size -= 4
  1058.     if text3 != nil
  1059.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  1060.     end
  1061.     if text4 != nil
  1062.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  1063.     end
  1064.     self.contents.font.size += 4
  1065.   end
  1066. end
  1067. #==============================================================================
  1068. # ■ Scene_lvup
  1069. #------------------------------------------------------------------------------
  1070. #  处理升级画面的类。
  1071. #==============================================================================
  1072. class Scene_Lvup
  1073.   #--------------------------------------------------------------------------
  1074.   # ● 初始化对像
  1075.   #     actor_index : 角色索引
  1076.   #     menu_index : 选项起始位置
  1077.   #--------------------------------------------------------------------------
  1078.   def initialize(actor_index = 0 , menu_index = 0)
  1079.     @actor_index = actor_index
  1080.     @menu_index = menu_index
  1081.   end
  1082.   #--------------------------------------------------------------------------
  1083.   # ● 主处理
  1084.   #--------------------------------------------------------------------------
  1085.   def main
  1086.     s1 = "增加体力 HP SP"
  1087.     s2 = "增加"+$data_system.words.str
  1088.     s3 = "增加"+$data_system.words.dex
  1089.     s4 = "增加"+$data_system.words.agi
  1090.     s5 = "增加"+$data_system.words.int
  1091.     s6 = "确认加点"
  1092.     s7 = "点数重置"
  1093.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  1094.     @command_window.index = @menu_index
  1095.     # 获取角色
  1096.     @actor = $game_party.actors[@actor_index]
  1097.     # 将角色的剩余点数带入
  1098.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  1099.     # 初始化临时量
  1100.     $temp_str = 0
  1101.     $temp_dex = 0
  1102.     $temp_agi = 0
  1103.     $temp_int = 0
  1104.     $temp_hp = 0
  1105.     $temp_sp = 0
  1106.     #=========================================================================
  1107.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  1108.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  1109.     #=========================================================================
  1110.     # 每提升一次力量,提升多少附加能力
  1111.     #=========================================================================
  1112.     @str_hp = 5     # 每提升一次力量附加提升多少HP
  1113.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  1114.     @str_dex = 1    # 每提升一次力量附加提升多少灵巧
  1115.     @str_agi = 1    # 每提升一次力量附加提升多少速度
  1116.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  1117.     @str_str = 3    # 每提升一次力量附加提升多少力量
  1118.     #=========================================================================
  1119.     # 每提升一次灵巧,提升多少附加能力
  1120.     #=========================================================================
  1121.     @dex_hp = 2     # 每提升一次灵巧附加提升多少HP
  1122.     @dex_sp = 3     # 每提升一次灵巧附加提升多少SP
  1123.     @dex_str = 1    # 每提升一次灵巧附加提升多少力量
  1124.     @dex_agi = 1    # 每提升一次灵巧附加提升多少速度
  1125.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  1126.     @dex_dex = 3    # 每提升一次灵巧附加提升多少灵巧
  1127.     #=========================================================================
  1128.     # 每提升一次速度,提升多少附加能力
  1129.     #=========================================================================
  1130.     @agi_hp = 0     # 每提升一次速度附加提升多少HP
  1131.     @agi_sp = 0     # 每提升一次速度附加提升多少SP
  1132.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  1133.     @agi_dex = 1    # 每提升一次速度附加提升多少灵巧
  1134.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  1135.     @agi_agi = 3    # 每提升一次速度附加提升多少速度
  1136.     #=========================================================================
  1137.     # 每提升一次魔力,提升多少附加能力
  1138.     #=========================================================================
  1139.     @int_hp = 1     # 每提升一次魔力附加提升多少HP
  1140.     @int_sp = 15    # 每提升一次魔力附加提升多少SP
  1141.     @int_str = -1   # 每提升一次魔力附加提升多少力量
  1142.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  1143.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  1144.     @int_int = 7   # 每提升一次魔力附加提升多少魔力
  1145.     #=========================================================================
  1146.     # 每提升一次体力,提升多少附加能力
  1147.     #=========================================================================
  1148.     @hp = 20       # 每提升一次体力提升多少HP
  1149.     @sp = 10       # 每提升一次体力提升多少SP
  1150.     @hp_str = 0   # 每提升一次体力提升多少力量
  1151.     @hp_dex = 0   # 每提升一次体力提升多少速度
  1152.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  1153.     @hp_int = -1   # 每提升一次体力提升多少魔力   
  1154.     # 定义说明文字
  1155.     @text_hp_sc = "体力可以增加生存的能力,增加HP与SP的最大上限!"
  1156.     @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
  1157.     @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和防御系数!"
  1158.     @text_agi_sc = $data_system.words.agi + "可以提高行动速度、逃跑成功率!"
  1159.     @text_int_sc = $data_system.words.int + "可以提高魔法攻击的效果!"
  1160.     @text_save = "保存分配情况并返回游戏"
  1161.     @text_reset= "重新分配能力点数"
  1162.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  1163.     @text_hp = "最大" + $data_system.words.hp + "值"
  1164.     @text_sp = "最大" + $data_system.words.sp + "值"
  1165.     @text_str = "最大" + $data_system.words.str + "值"
  1166.     @text_dex = "最大" + $data_system.words.dex + "值"
  1167.     @text_agi = "最大" + $data_system.words.agi + "值"
  1168.     @text_int = "最大" + $data_system.words.int + "值"
  1169.     s_disable
  1170.     # 生成状态窗口
  1171.     @lvup_window = Window_Lvup.new(@actor)
  1172.     @lvup_window.x = 128
  1173.     @lvup_window.y = 0   
  1174.     # 生成帮助窗口并初始化帮助文本
  1175.     @help_window = Window_Lvup_Help.new   
  1176.     # 执行过渡
  1177.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  1178.     # 主循环
  1179.     loop do
  1180.       # 刷新游戏画面
  1181.       Graphics.update
  1182.       # 刷新输入信息
  1183.       Input.update
  1184.       # 刷新画面
  1185.       update
  1186.       # 如果切换画面就中断循环
  1187.       if $scene != self
  1188.         break
  1189.       end
  1190.     end
  1191.     # 准备过渡
  1192.     Graphics.freeze
  1193.     # 释放窗口
  1194.     @command_window.dispose
  1195.     @lvup_window.dispose
  1196.     @help_window.dispose
  1197.   end
  1198.   #--------------------------------------------------------------------------
  1199.   # ● 刷新画面
  1200.   #--------------------------------------------------------------------------
  1201.   def update
  1202.     # 刷新窗口
  1203.     @command_window.update
  1204.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  1205.     s_disable
  1206.     @lvup_window.update
  1207.     #=============================================================
  1208.     # 按下 B 键的情况下
  1209.     #=============================================================
  1210.     if Input.trigger?(Input::B)
  1211.       # 演奏取消 SE
  1212.       $game_system.se_play($data_system.cancel_se)
  1213.       # 切换到地图画面
  1214.       $scene = Scene_Menu.new
  1215.       return
  1216.     end
  1217.     #=============================================================
  1218.     # 按下 C 键的情况下
  1219.     #=============================================================
  1220.     if Input.trigger?(Input::C)      
  1221.       if @command_window.index == 5
  1222.           # 演奏确定 SE
  1223.         $game_system.se_play($data_system.decision_se)
  1224.         # 将角色的剩余点数带回
  1225.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  1226.         # 将角色点数实际加上
  1227.         @actor.str += $temp_str
  1228.         @actor.dex += $temp_dex
  1229.         @actor.agi += $temp_agi
  1230.         @actor.int += $temp_int
  1231.         @actor.maxhp += $temp_hp
  1232.         @actor.maxsp += $temp_sp
  1233.         # 切换到地图画面
  1234.         $scene = Scene_Menu.new
  1235.         return
  1236.       end
  1237.       if @command_window.index == 6
  1238.           # 演奏确定 SE
  1239.         $game_system.se_play($data_system.cancel_se)
  1240.           # 将角色的剩余点数带入
  1241.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  1242.           # 初始化临时量
  1243.         $temp_str = 0
  1244.         $temp_dex = 0
  1245.         $temp_agi = 0
  1246.         $temp_int = 0
  1247.         $temp_hp = 0
  1248.         $temp_sp = 0
  1249.         @lvup_window.refresh
  1250.         return
  1251.       end
  1252.       if $point == 0
  1253.         # 演奏冻结 SE
  1254.         $game_system.se_play($data_system.buzzer_se)
  1255.         return
  1256.       end
  1257.       case @command_window.index
  1258.       when 0
  1259.         # 演奏确定 SE
  1260.         $game_system.se_play($data_system.decision_se)
  1261.         $temp_hp += @hp
  1262.         $temp_sp += @sp
  1263.         $temp_str += @hp_str
  1264.         $temp_dex += @hp_dex
  1265.         $temp_agi += @hp_agi
  1266.         $temp_int += @hp_int
  1267.         $point -= 1
  1268.         @lvup_window.refresh
  1269.         s_disable
  1270.         return
  1271.       when 1
  1272.         # 演奏确定 SE
  1273.         $game_system.se_play($data_system.decision_se)
  1274.         $temp_str += @str_str
  1275.         $temp_hp += @str_hp
  1276.         $temp_sp += @str_sp
  1277.         $temp_dex += @str_dex
  1278.         $temp_agi += @str_agi
  1279.         $temp_int += @str_int
  1280.         $point -= 1
  1281.         @lvup_window.refresh
  1282.         s_disable
  1283.         return
  1284.       when 2
  1285.         # 演奏确定 SE
  1286.         $game_system.se_play($data_system.decision_se)
  1287.         $temp_dex += @dex_dex
  1288.         $temp_hp += @dex_hp
  1289.         $temp_sp += @dex_sp
  1290.         $temp_str += @dex_str
  1291.         $temp_agi += @dex_agi
  1292.         $temp_int += @dex_int
  1293.         $point -= 1
  1294.         @lvup_window.refresh
  1295.         s_disable
  1296.         return
  1297.       when 3
  1298.         # 演奏确定 SE
  1299.         $game_system.se_play($data_system.decision_se)
  1300.         $temp_agi += @agi_agi
  1301.         $temp_hp += @agi_hp
  1302.         $temp_sp += @agi_sp
  1303.         $temp_str += @agi_str
  1304.         $temp_dex += @agi_dex
  1305.         $temp_int += @agi_int
  1306.         $point -= 1
  1307.         @lvup_window.refresh
  1308.         s_disable
  1309.         return
  1310.       when 4
  1311.         # 演奏确定 SE
  1312.         $game_system.se_play($data_system.decision_se)
  1313.         $temp_int += @int_int
  1314.         $temp_hp += @int_hp
  1315.         $temp_sp += @int_sp
  1316.         $temp_str += @int_str
  1317.         $temp_dex += @int_dex
  1318.         $temp_agi += @int_agi
  1319.         $point -= 1
  1320.         @lvup_window.refresh
  1321.         s_disable
  1322.         return
  1323.       end
  1324.     end
  1325.     #=============================================================
  1326.     # 什么都没有按下的情况
  1327.     #=============================================================
  1328.     case @command_window.index   
  1329.     when 0  # 增加体力
  1330.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  1331.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  1332.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  1333.     when 1  # 增加力量
  1334.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  1335.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  1336.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  1337.     when 2  # 增加灵巧
  1338.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  1339.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  1340.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  1341.     when 3  # 增加速度
  1342.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  1343.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  1344.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  1345.     when 4  # 增加魔力
  1346.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  1347.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  1348.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  1349.     when 5 # 保存设定
  1350.       @help_window.lvup_text(@text_save)
  1351.     when 6 # 点数重置
  1352.       @help_window.lvup_text(@text_reset)     
  1353.     end
  1354.     #=============================================================
  1355.     # 按下R与L换人的情况
  1356.     #=============================================================      
  1357.     if Input.trigger?(Input::R)
  1358.       # 演奏光标 SE
  1359.       $game_system.se_play($data_system.cursor_se)
  1360.       # 移至下一位角色
  1361.       @actor_index += 1
  1362.       @actor_index %= $game_party.actors.size
  1363.       # 切换到别的状态画面
  1364.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1365.       return
  1366.     end
  1367.     # 按下 L 键的情况下
  1368.     if Input.trigger?(Input::L)
  1369.       # 演奏光标 SE
  1370.       $game_system.se_play($data_system.cursor_se)
  1371.       # 移至上一位角色
  1372.       @actor_index += $game_party.actors.size - 1
  1373.       @actor_index %= $game_party.actors.size
  1374.       # 切换到别的状态画面
  1375.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1376.       return
  1377.     end
  1378.   end  
  1379.   #--------------------------------------------------------------------------
  1380.   # ● 选项明暗判断
  1381.   #--------------------------------------------------------------------------
  1382.   def s_disable
  1383.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  1384.     if $point == 0
  1385.       @command_window.disable_item(0)
  1386.       @command_window.disable_item(1)
  1387.       @command_window.disable_item(2)
  1388.       @command_window.disable_item(3)
  1389.       @command_window.disable_item(4)
  1390.     else
  1391.       @command_window.able_item(0)
  1392.       @command_window.able_item(1)      
  1393.       @command_window.able_item(2)
  1394.       @command_window.able_item(3)
  1395.       @command_window.able_item(4)
  1396.     end
  1397.   end
  1398. end
  1399.  
  1400. #==============================================================================
  1401. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1402. #==============================================================================
  1403.  
  1404. #==============================================================================
  1405. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1406. #==============================================================================


从433行,是设置Scene_Menu的部分。本人不懂代码,求高手指点。s9 =剧情任务那个选项是我后加的,任务脚本是《详尽任务显示界面》
回复 支持 反对

使用道具 举报

Lv4.逐梦者

「Pemercyia」


Urhurrenna

梦石
0
星屑
9397
在线时间
2748 小时
注册时间
2008-9-5
帖子
3543

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

3
发表于 2015-8-26 23:19:10 | 只看该作者
稍微整理了一下脚本,指令之间的对应已经修好,升级加点和整队都能使用,
进入任务界面弹错的原因是脚本列表里没有【Scene_Mission】这个脚本,
尝试在范例工程(任务系统原出处)里面的脚本列表全局搜索(ctrl+shift+f)“class Scene_Mission”,
然后把class直到对应的end之间的这个类放到现在的工程里来。
已修的脚本如下:
整队和加点部分

菜单部分

评分

参与人数 1星屑 +50 梦石 +1 收起 理由
RyanBern + 50 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
172
在线时间
37 小时
注册时间
2009-7-5
帖子
49
4
 楼主| 发表于 2015-8-27 05:28:50 | 只看该作者
cinderelmini 发表于 2015-8-26 23:19
稍微整理了一下脚本,指令之间的对应已经修好,升级加点和整队都能使用,
进入任务界面弹错的原因是脚本列 ...

class Scene_Mission这个我在范例工程也搜不到啊。
额。。用了你发的脚本以后,我发现,状态栏与装备栏反过来了。
点状态会进入装备界面,点装备会进入状态界面。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
172
在线时间
37 小时
注册时间
2009-7-5
帖子
49
5
 楼主| 发表于 2015-8-27 05:47:47 | 只看该作者
cinderelmini 发表于 2015-8-26 23:19
稍微整理了一下脚本,指令之间的对应已经修好,升级加点和整队都能使用,
进入任务界面弹错的原因是脚本列 ...

自己又鼓弄了一会儿,意外的都调好了!

非常感谢您的帮助!谢谢!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
172
在线时间
37 小时
注册时间
2009-7-5
帖子
49
6
 楼主| 发表于 2015-8-27 06:00:37 | 只看该作者
本帖最后由 sixapple 于 2015-8-27 06:10 编辑
cinderelmini 发表于 2015-8-26 23:19
稍微整理了一下脚本,指令之间的对应已经修好,升级加点和整队都能使用,
进入任务界面弹错的原因是脚本列 ...


那个。。抱歉,我又发现了一个问题,实在是麻烦了。
调整队伍也出现了毛病,变换领队功能不好使
回复 支持 反对

使用道具 举报

Lv4.逐梦者

「Pemercyia」


Urhurrenna

梦石
0
星屑
9397
在线时间
2748 小时
注册时间
2008-9-5
帖子
3543

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

7
发表于 2015-8-27 13:03:53 | 只看该作者
sixapple 发表于 2015-8-27 06:00
那个。。抱歉,我又发现了一个问题,实在是麻烦了。
调整队伍也出现了毛病,变换领队功能不好使 ...

关于状态和装备弄反了很抱歉。。当时脑子晕晕的。。
只需要吧def update_status里面的when 2和when 3换一下就好。。
至于更换领队,一样在def update_status里面,
when 6加一句刷新就可以了:

  1.         $game_system.se_play($data_system.decision_se)
  2.         if @checker == 0
  3.           @changer = $game_party.actors[@status_window.index]
  4.           @where = @status_window.index
  5.           @checker = 1
  6.         else
  7.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  8.           $game_party.actors[@status_window.index] = @changer
  9.           @checker = 0
  10.           @status_window.refresh
  11.           $game_player.refresh   # 刷新队伍
  12.         end
复制代码
PS:任务系统的Scene在原来的任务系统范例工程里不可能搜不到的。。
毕竟是他自己引用的东西。。(或者这个任务Scene是你自己加的?)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
172
在线时间
37 小时
注册时间
2009-7-5
帖子
49
8
 楼主| 发表于 2015-8-27 18:22:28 | 只看该作者
cinderelmini 发表于 2015-8-27 13:03
关于状态和装备弄反了很抱歉。。当时脑子晕晕的。。
只需要吧def update_status里面的when 2和when 3换一 ...

解决了!实在是太感谢了,帮了这么多忙,谢谢!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-23 03:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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