查看: 1710|回复: 4

[已经解决] 这两个脚本不知道该怎么修改才能不冲突

[复制链接]
梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
发表于 2014-12-27 22:58:22 | 显示全部楼层 |阅读模式

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

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

×
我使用了一个是可以换人的脚本,另一个是任务栏的脚本,但是两个脚本有冲突,该怎么修改,求助。
梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-27 23:00:23 | 显示全部楼层
本帖最后由 RyanBern 于 2014-12-28 09:31 编辑

这是第一个脚本,包括了换人和升级加点系统


  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化目标
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 480, 480)
  12.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  13.     refresh
  14.     @top_row = 0
  15.     self.active = false
  16.     self.index = -1
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 刷新
  20.   #--------------------------------------------------------------------------
  21.   def refresh
  22.     self.contents.clear
  23.     @item_max = $game_party.actors.size
  24.     for i in 0...$game_party.actors.size
  25.       x = 64
  26.       y = i * 112
  27.       if i <=3
  28.         self.contents.font.color = Color.new(255,255,0,255)
  29.         self.contents.draw_text(x,y,340,32,"[出战]",2)
  30.         self.contents.font.color = normal_color
  31.       else
  32.         self.contents.font.color = Color.new(128,128,128,255)
  33.         self.contents.draw_text(x,y,340,32,"[待机]",2)
  34.         self.contents.font.color = normal_color
  35.       end      
  36.       actor = $game_party.actors[i]
  37.       draw_actor_graphic(actor, x - 40, y + 80)
  38.       draw_actor_name(actor, x, y)
  39.       draw_actor_class(actor, x + 144, y)
  40.       draw_actor_level(actor, x, y + 32)
  41.       draw_actor_state(actor, x + 90, y + 32)
  42.       draw_actor_exp(actor, x, y + 64)
  43.       draw_actor_hp(actor, x + 236, y + 32)
  44.       draw_actor_sp(actor, x + 236, y + 64)
  45.     end
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ● 刷新光标矩形
  49.   #--------------------------------------------------------------------------
  50.   def update_cursor_rect
  51.     if @index < 0
  52.       self.cursor_rect.empty
  53.     else
  54.       tpy = @index * 112 - self.oy
  55.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  56.       if @index < @top_row
  57.         @top_row = @index
  58.         self.oy = @top_row *112
  59.       end
  60.       if @index > @top_row+3
  61.         @top_row = @index-3
  62.         self.oy = @top_row *112
  63.       end
  64.     end
  65.   end
  66. end

  67. class Game_Party
  68.   #--------------------------------------------------------------------------
  69.   # ● 全灭判定
  70.   #--------------------------------------------------------------------------
  71.   def all_dead?
  72.     # 同伴人数为 0 的情况下
  73.     if $game_party.actors.size == 0
  74.       return false
  75.     end
  76.     # 同伴中无人 HP 在 0 以上
  77.     for i in 0..3
  78.       if @actors[i] != nil and@actors[i].hp >0
  79.         return false
  80.       end
  81.     end
  82.     # 全灭
  83.     return true
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ● 加入同伴
  87.   #     actor_id : 角色 ID
  88.   #--------------------------------------------------------------------------
  89.   def add_actor(actor_id)
  90.     # 获取角色
  91.     actor = $game_actors[actor_id]
  92.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  93.     if not @actors.include?(actor)
  94.       # 添加角色
  95.       @actors.push(actor)
  96.       # 还原主角
  97.       $game_player.refresh
  98.     end
  99.   end
  100. end

  101. #==============================================================================
  102. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  103. #==============================================================================


  104. class Scene_Menu
  105. # --------------------------------
  106.   def initialize(menu_index = 0)
  107.     @menu_index = menu_index
  108.     @changer = 0
  109.     @where = 0
  110.     @checker = 0
  111.   end
  112. # --------------------------------
  113.   def main
  114.     s1 = $data_system.words.item
  115.     s2 = $data_system.words.skill
  116.     s3 = $data_system.words.equip
  117.     s4 = "状态"
  118.     s5 = "储存进度"
  119.     s6 = "离开游戏"
  120.     s7 = "调整队伍"
  121.     s8 = "升级加点"
  122.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
  123.     @command_window.index = @menu_index
  124.     if $game_party.actors.size == 0
  125.       @command_window.disable_item(0)
  126.       @command_window.disable_item(1)
  127.       @command_window.disable_item(2)
  128.       @command_window.disable_item(3)
  129.     end
  130.     if $game_system.save_disabled
  131.       @command_window.disable_item(4)
  132.     end
  133.     if $game_party.actors.size == 1
  134.       @command_window.disable_item(6)
  135.     end
  136.     @playtime_window = Window_PlayTime.new
  137.     @playtime_window.x = 0
  138.     @playtime_window.y = 320
  139.     @gold_window = Window_Gold.new
  140.     @gold_window.x = 0
  141.     @gold_window.y = 416
  142.     @status_window = Window_MenuStatus.new
  143.     @status_window.x = 160
  144.     @status_window.y = 0
  145.     Graphics.transition
  146.     loop do
  147.       Graphics.update
  148.       Input.update
  149.       update
  150.       if $scene != self
  151.         break
  152.       end
  153.     end
  154.     Graphics.freeze
  155.     @command_window.dispose
  156.     @playtime_window.dispose
  157.     @gold_window.dispose
  158.     @status_window.dispose
  159.   end
  160. # --------------------------------
  161.   def update
  162.     @command_window.update
  163.     @playtime_window.update
  164.     @gold_window.update
  165.     @status_window.update
  166.     if @command_window.active
  167.       update_command
  168.       return
  169.     end
  170.     if @status_window.active
  171.       update_status
  172.       return
  173.     end
  174.   end
  175. # --------------------------------
  176.   def update_command
  177.     if Input.trigger?(Input::B)
  178.       $game_system.se_play($data_system.cancel_se)
  179.       $scene = Scene_Map.new
  180.       return
  181.     end
  182.     if Input.trigger?(Input::C)
  183.       if $game_party.actors.size == 0 and @command_window.index < 4
  184.         $game_system.se_play($data_system.buzzer_se)
  185.         return
  186.       end
  187.       if $game_party.actors.size == 1 and @command_window.index ==6
  188.         $game_system.se_play($data_system.buzzer_se)
  189.         return
  190.       end
  191.       case @command_window.index
  192.       when 0
  193.         $game_system.se_play($data_system.decision_se)
  194.         $scene = Scene_Item.new
  195.       when 1
  196.         $game_system.se_play($data_system.decision_se)
  197.         @command_window.active = false
  198.         @status_window.active = true
  199.         @status_window.index = 0
  200.       when 2
  201.         $game_system.se_play($data_system.decision_se)
  202.         @command_window.active = false
  203.         @status_window.active = true
  204.         @status_window.index = 0
  205.       when 3
  206.         $game_system.se_play($data_system.decision_se)
  207.         @command_window.active = false
  208.         @status_window.active = true
  209.         @status_window.index = 0
  210.       when 4
  211.         if $game_system.save_disabled
  212.           $game_system.se_play($data_system.buzzer_se)
  213.           return
  214.         end
  215.         $game_system.se_play($data_system.decision_se)
  216.         $scene = Scene_Save.new
  217.       when 5
  218.         $game_system.se_play($data_system.decision_se)
  219.         $scene = Scene_End.new
  220.       when 6
  221.         $game_system.se_play($data_system.decision_se)
  222.         @checker = 0
  223.         @command_window.active = false
  224.         @status_window.active = true
  225.         @status_window.index = 0
  226.       when 7
  227.         $game_system.se_play($data_system.decision_se)
  228.         @command_window.active = false
  229.         @status_window.active = true
  230.         @status_window.index = 0
  231.       when 8
  232.         $game_system.se_play($data_system.decision_se)
  233.         @command_window.active = false
  234.         @status_window.active = true
  235.         @status_window.index = 0
  236.       end
  237.       return
  238.     end
  239.   end
  240. # --------------------------------
  241.   def update_status
  242.     if Input.trigger?(Input::B)
  243.       $game_system.se_play($data_system.cancel_se)
  244.       @command_window.active = true
  245.       @status_window.active = false
  246.       @status_window.index = -1
  247.       return
  248.     end
  249.     if Input.trigger?(Input::C)
  250.       case @command_window.index
  251.       when 1
  252.         if $game_party.actors[@status_window.index].restriction >= 2
  253.           $game_system.se_play($data_system.buzzer_se)
  254.           return
  255.         end
  256.         $game_system.se_play($data_system.decision_se)
  257.         $scene = Scene_Skill.new(@status_window.index)
  258.       when 2
  259.         $game_system.se_play($data_system.decision_se)
  260.         $scene = Scene_Equip.new(@status_window.index)
  261.       when 3
  262.         $game_system.se_play($data_system.decision_se)
  263.         $scene = Scene_Status.new(@status_window.index)
  264.       when 6
  265.         $game_system.se_play($data_system.decision_se)
  266.         if @checker == 0
  267.           @changer = $game_party.actors[@status_window.index]
  268.           @where = @status_window.index
  269.           @checker = 1
  270.         else
  271.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  272.           $game_party.actors[@status_window.index] = @changer
  273.           @checker = 0
  274.           @status_window.refresh
  275.         end
  276.       when 7
  277.         $game_system.se_play($data_system.decision_se)
  278.         $scene = Scene_Lvup.new(@status_window.index)
  279.       when 8
  280.         $game_system.se_play($data_system.decision_se)
  281.         $scene = Scene_Charactor.new(@status_window.index)
  282.       end
  283.       return
  284.     end
  285.   end
  286. end



  287.     #插件(升级加点,换队伍顺序,人物介绍,动态行走图)

  288. #==============================================================================
  289. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  290. #==============================================================================


  291. # 作者: 柳柳
  292. #
  293. # 说明:这是功能我再比较早期的时候发布在幻森,不过那时候比较笨,方法很糟糕
  294. #       这次是拿上就可以用的。
  295. #
  296. # 感谢:Claimh的脚本使我想起这个功能重做了一遍,本想直接用他的,不过他的算法过分
  297. #       冗余了,没好意思用。
  298. #==============================================================================
  299. # 使用方法:默认情况下把静态图变为了走步图。如果想自行修改,提供功能如下:
  300. #
  301. # 角色走步图:draw_walk_actor_graphic
  302. # 角色转向图:draw_turn_actor_graphic
  303. #
  304. # 回复原有静态角色图:删除100行以后的内容。修改下面这个变量可以更改行走速度
  305. #==============================================================================

  306. WALK_REFRESH_FRAME_SPEED = 15  # 刷新的速度,越大越慢,你可以改为3左右试试看

  307. #==============================================================================
  308. # Window_Base
  309. #==============================================================================
  310. class Window_Base < Window
  311.   #--------------------------------------------------------------------------
  312.   # 初始化方法
  313.   #--------------------------------------------------------------------------
  314.   alias initialize_walk initialize
  315.   def initialize(x, y, width, height)
  316.     initialize_walk(x, y, width, height)
  317.     @start_walk = false
  318.     @turn_index = 0
  319.     @turn_phase = 0
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ★  角色行走图
  323.   #     actor : 角色
  324.   #     x     : 描绘的 X 坐标
  325.   #     y     : 描绘的 Y 坐标
  326.   #--------------------------------------------------------------------------
  327.   def draw_walk_actor_graphic(actor, x, y)
  328.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  329.     cw = bitmap.width / 4
  330.     ch = bitmap.height / 4
  331.     @start_turn = true
  332.     case @turn_phase
  333.     when 0
  334.       x_x = 0
  335.     when 1
  336.       x_x = cw
  337.     when 2
  338.       x_x = cw * 2
  339.     when 3
  340.       x_x = cw * 3
  341.     end
  342.     src_rect = Rect.new(x_x, 0, cw, ch)
  343.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ★  角色转向图
  347.   #     actor : 角色
  348.   #     x     : 描绘的 X 坐标
  349.   #     y     : 描绘的 Y 坐标
  350.   #--------------------------------------------------------------------------
  351.   def draw_turn_actor_graphic(actor, x, y)
  352.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  353.     cw = bitmap.width / 4
  354.     ch = bitmap.height / 4
  355.     @start_turn = true
  356.     case @turn_phase
  357.     when 0
  358.       x_x = 0
  359.     when 1
  360.       x_x = ch
  361.     when 2
  362.       x_x = ch * 3
  363.     when 3
  364.       x_x = ch * 2
  365.     end
  366.     src_rect = Rect.new(0, x_x, cw, ch)
  367.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   #  更新(可别使用刷新,玩命耗费内存= =)
  371.   #--------------------------------------------------------------------------
  372.   alias walk_update update
  373.   def update
  374.     walk_update
  375.     if @start_turn == true
  376.       @turn_index += 1
  377.       if @turn_index == WALK_REFRESH_FRAME_SPEED
  378.         refresh
  379.         @turn_index = 0
  380.         @turn_phase = (@turn_phase+1)%4
  381.       end
  382.     end
  383.   end  
  384. end

  385. #==============================================================================
  386. # Window_Base
  387. #==============================================================================
  388. class Window_Base < Window
  389.   #--------------------------------------------------------------------------
  390.   # 把原有静态图改为动态走步图
  391.   #--------------------------------------------------------------------------
  392.   def draw_actor_graphic(actor, x, y)
  393.     draw_walk_actor_graphic(actor, x, y)
  394.   end
  395. end

  396. #==============================================================================
  397. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  398. #==============================================================================

  399. #==============================================================================
  400. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  401. #==============================================================================


  402. # 脚本使用设定:

  403. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  404. LEVEL_UP_VARIABLE = 200  # 储存角色点数的变量编号与角色id编号的差值
  405.                          # 默认情况 = 200,
  406.                          # 则是数据库里1号角色的加点数存于101号变量
  407.                          # 3号角色的加点数存于103号变量。
  408.                          # 你可以直接操作变量赠与角色可分配点数

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

  412. # 本脚本不会取代原升级功能 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  413. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  414. # 1-99级全部等于一个相同数值就行了。

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

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

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

  420. #==============================================================================
  421. # ■ Window_Command
  422. #------------------------------------------------------------------------------
  423. #  一般的命令选择行窗口。(追加定义)
  424. #==============================================================================
  425. class Window_Command < Window_Selectable
  426.   #--------------------------------------------------------------------------
  427.   # ● 项目有效化
  428.   #     index : 项目编号
  429.   #--------------------------------------------------------------------------
  430.   def able_item(index)
  431.     draw_item(index, normal_color)
  432.   end
  433. end
  434. #==============================================================================
  435. # ■ Game_Actor
  436. #------------------------------------------------------------------------------
  437. #  处理角色的类。(再定义)
  438. #==============================================================================
  439. class Game_Actor < Game_Battler
  440.   #--------------------------------------------------------------------------
  441.   # ● 更改 EXP
  442.   #     exp : 新的 EXP
  443.   #--------------------------------------------------------------------------
  444.   def exp=(exp)
  445.     @exp = [[exp, 9999999].min, 0].max
  446.     # 升级
  447.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  448.       @level += 1
  449.       # 增加4点可自由分配的点数
  450.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  451.       # 学会特技
  452.       for j in $data_classes[@class_id].learnings
  453.         if j.level == @level
  454.           learn_skill(j.skill_id)
  455.         end
  456.       end
  457.     end
  458.     # 降级
  459.     while @exp < @exp_list[@level]
  460.       @level -= 1
  461.     end
  462.     # 修正当前的 HP 与 SP 超过最大值
  463.     @hp = [@hp, self.maxhp].min
  464.     @sp = [@sp, self.maxsp].min
  465.   end
  466. end
  467. #==============================================================================
  468. # ■ Window_Base
  469. #------------------------------------------------------------------------------
  470. #  游戏中全部窗口的超级类(追加定义)
  471. #==============================================================================
  472. class Window_Base < Window
  473.   #--------------------------------------------------------------------------
  474.   # ● 描绘 HP
  475.   #     actor : 角色
  476.   #     x     : 描画目标 X 坐标
  477.   #     y     : 描画目标 Y 坐标
  478.   #     width : 描画目标的宽
  479.   #--------------------------------------------------------------------------
  480.   def draw_actor_hp_lvup(actor, x, y)
  481.     self.contents.font.color = system_color
  482.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  483.     if $temp_hp == 0
  484.       self.contents.font.color = normal_color
  485.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  486.     else
  487.       maxhp = actor.maxhp + $temp_hp
  488.       self.contents.font.color = Color.new(255, 128, 128, 255)
  489.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  490.       self.contents.font.color = normal_color      
  491.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  492.       if $temp_hp >=0
  493.         self.contents.font.color = Color.new(255, 128, 128, 255)
  494.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  495.       else
  496.         self.contents.font.color = Color.new(255,255,0,255)
  497.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  498.       end
  499.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  500.       self.contents.font.color = normal_color
  501.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  502.     end
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 描绘 SP
  506.   #     actor : 角色
  507.   #     x     : 描画目标 X 坐标
  508.   #     y     : 描画目标 Y 坐标
  509.   #     width : 描画目标的宽
  510.   #--------------------------------------------------------------------------
  511.   def draw_actor_sp_lvup(actor, x, y)
  512.     self.contents.font.color = system_color
  513.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  514.     if $temp_sp == 0
  515.       self.contents.font.color = normal_color
  516.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  517.     else
  518.       maxsp = actor.maxsp + $temp_sp
  519.       self.contents.font.color = Color.new(255, 128, 128, 255)
  520.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  521.       self.contents.font.color = normal_color      
  522.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  523.       if $temp_sp >=0
  524.         self.contents.font.color = Color.new(255, 128, 128, 255)
  525.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  526.       else
  527.         self.contents.font.color = Color.new(255,255,0,255)
  528.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  529.       end
  530.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  531.       self.contents.font.color = normal_color
  532.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  533.     end
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # ● 描绘能力值
  537.   #     actor : 角色
  538.   #     x     : 描画目标 X 坐标
  539.   #     y     : 描画目标 Y 坐标
  540.   #     type  : 能力值种类 (0~4)
  541.   #--------------------------------------------------------------------------
  542.   def draw_actor_lvup(actor, x, y, type)   
  543.     # 定义数字颜色
  544.     lvup = normal_color
  545.     upcolor = Color.new(255, 128, 128, 255)
  546.     self.contents.font.color = normal_color   
  547.     case type
  548.     when 0
  549.       parameter_name = $data_system.words.str
  550.       parameter_value = actor.str
  551.       parameter_value_temp = parameter_value + $temp_str
  552.       if $temp_str != 0
  553.         lvup = upcolor
  554.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  555.         if $temp_str >= 0
  556.           self.contents.font.color = lvup
  557.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  558.         else
  559.           self.contents.font.color = Color.new(255,255,0,255)
  560.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  561.         end        
  562.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  563.         self.contents.font.color = normal_color
  564.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  565.       end
  566.     when 1
  567.       parameter_name = $data_system.words.dex
  568.       parameter_value = actor.dex
  569.       parameter_value_temp = parameter_value + $temp_dex
  570.       if $temp_dex != 0
  571.         lvup = upcolor
  572.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  573.         if $temp_dex >= 0
  574.           self.contents.font.color = lvup
  575.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  576.         else
  577.           self.contents.font.color = Color.new(255,255,0,255)
  578.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  579.         end        
  580.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  581.         self.contents.font.color = normal_color
  582.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  583.       end
  584.     when 2
  585.       parameter_name = $data_system.words.agi
  586.       parameter_value = actor.agi
  587.       parameter_value_temp = parameter_value + $temp_agi
  588.       if $temp_agi != 0
  589.         lvup = upcolor
  590.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  591.         if $temp_agi >= 0
  592.           self.contents.font.color = lvup
  593.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  594.         else
  595.           self.contents.font.color = Color.new(255,255,0,255)
  596.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  597.         end        
  598.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  599.         self.contents.font.color = normal_color
  600.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  601.       end
  602.     when 3
  603.       parameter_name = $data_system.words.int
  604.       parameter_value = actor.int
  605.       parameter_value_temp = parameter_value + $temp_int
  606.       if $temp_int != 0
  607.         lvup = upcolor
  608.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  609.         if $temp_int >= 0
  610.           self.contents.font.color = lvup
  611.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  612.         else
  613.           self.contents.font.color = Color.new(255,255,0,255)
  614.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  615.         end        
  616.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  617.         self.contents.font.color = normal_color
  618.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  619.       end
  620.     when 4
  621.       parameter_name = "剩余点数"
  622.       parameter_value = $point
  623.       if $point != 0
  624.         lvup = upcolor
  625.       end
  626.     end   
  627.     self.contents.font.color = system_color
  628.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  629.     self.contents.font.color = normal_color
  630.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  631.     if type != 4
  632.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  633.     end  
  634.     self.contents.font.color = lvup
  635.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  636.     self.contents.font.color = normal_color        
  637.   end
  638. end
  639. #==============================================================================
  640. # ■ Window_lvup
  641. #------------------------------------------------------------------------------
  642. #  显示升级状态窗口。
  643. #==============================================================================
  644. class Window_Lvup < Window_Base
  645.   #--------------------------------------------------------------------------
  646.   # ● 初始化对像
  647.   #     actor : 角色
  648.   #--------------------------------------------------------------------------
  649.   def initialize(actor)
  650.     super(0, 0, 512, 320)
  651.     self.contents = Bitmap.new(width - 32, height - 32)
  652.     @actor = actor
  653.     refresh
  654.   end  
  655.   #--------------------------------------------------------------------------
  656.   # ● 刷新
  657.   #--------------------------------------------------------------------------
  658.   def refresh
  659.     self.contents.clear
  660.     draw_actor_graphic(@actor, 40, 112)
  661.     draw_actor_name(@actor, 4, 0)
  662.     draw_actor_class(@actor, 4 + 144, 0)
  663.     draw_actor_level(@actor, 96, 32)
  664.     draw_actor_state(@actor, 96, 64)   
  665.     draw_actor_hp_lvup(@actor, 96+128, 32)
  666.     draw_actor_sp_lvup(@actor, 96+128, 64)
  667.     draw_actor_lvup(@actor, 96, 128, 0)
  668.     draw_actor_lvup(@actor, 96, 160, 1)
  669.     draw_actor_lvup(@actor, 96, 192, 2)
  670.     draw_actor_lvup(@actor, 96, 224, 3)
  671.     draw_actor_lvup(@actor, 96, 256, 4)
  672.   end
  673. end
  674. #==============================================================================
  675. # ■ Window_Help
  676. #------------------------------------------------------------------------------
  677. #  特技及物品的说明、角色的状态显示的窗口。
  678. #==============================================================================
  679. class Window_Lvup_Help < Window_Base
  680.   #--------------------------------------------------------------------------
  681.   # ● 初始化对像
  682.   #--------------------------------------------------------------------------
  683.   def initialize
  684.     super(0, 320, 640, 160)
  685.     self.contents = Bitmap.new(width - 32, height - 32)
  686.     [url=home.php?mod=space&uid=76370]@test[/url] = "" #——这个东西用来检测,节约内存专用
  687.   end  
  688.   #--------------------------------------------------------------------------
  689.   # ● 设置文本
  690.   #--------------------------------------------------------------------------
  691.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  692.     if [url=home.php?mod=space&uid=76370]@test[/url] != text1
  693.       @test = text1
  694.     else
  695.       return
  696.     end   
  697.     self.contents.clear
  698.     self.contents.font.color = normal_color
  699.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  700.     if text2 != nil
  701.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  702.     end
  703.     self.contents.font.size -= 4
  704.     if text3 != nil
  705.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  706.     end
  707.     if text4 != nil
  708.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  709.     end
  710.     self.contents.font.size += 4
  711.   end
  712. end
  713. #==============================================================================
  714. # ■ Scene_lvup
  715. #------------------------------------------------------------------------------
  716. #  处理升级画面的类。
  717. #==============================================================================
  718. class Scene_Lvup
  719.   #--------------------------------------------------------------------------
  720.   # ● 初始化对像
  721.   #     actor_index : 角色索引
  722.   #     menu_index : 选项起始位置
  723.   #--------------------------------------------------------------------------
  724.   def initialize(actor_index = 0 , menu_index = 0)
  725.     @actor_index = actor_index
  726.     @menu_index = menu_index
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● 主处理
  730.   #--------------------------------------------------------------------------
  731.   def main
  732.     s1 = "增加体力 HP SP"
  733.     s2 = "增加"+$data_system.words.str
  734.     s3 = "增加"+$data_system.words.dex
  735.     s4 = "增加"+$data_system.words.agi
  736.     s5 = "增加"+$data_system.words.int
  737.     s6 = "确认加点"
  738.     s7 = "点数重置"
  739.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  740.     @command_window.index = @menu_index
  741.     # 获取角色
  742.     @actor = $game_party.actors[@actor_index]
  743.     # 将角色的剩余点数带入
  744.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  745.     # 初始化临时量
  746.     $temp_str = 0
  747.     $temp_dex = 0
  748.     $temp_agi = 0
  749.     $temp_int = 0
  750.     $temp_hp = 0
  751.     $temp_sp = 0
  752.     #=========================================================================
  753.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  754.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  755.     #=========================================================================
  756.     # 每提升一次力量,提升多少附加能力
  757.     #=========================================================================
  758.     @str_hp = 5     # 每提升一次力量附加提升多少HP
  759.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  760.     @str_dex = 1    # 每提升一次力量附加提升多少灵巧
  761.     @str_agi = 1    # 每提升一次力量附加提升多少速度
  762.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  763.     @str_str = 3    # 每提升一次力量附加提升多少力量
  764.     #=========================================================================
  765.     # 每提升一次灵巧,提升多少附加能力
  766.     #=========================================================================
  767.     @dex_hp = 2     # 每提升一次灵巧附加提升多少HP
  768.     @dex_sp = 3     # 每提升一次灵巧附加提升多少SP
  769.     @dex_str = 1    # 每提升一次灵巧附加提升多少力量
  770.     @dex_agi = 1    # 每提升一次灵巧附加提升多少速度
  771.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  772.     @dex_dex = 3    # 每提升一次灵巧附加提升多少灵巧
  773.     #=========================================================================
  774.     # 每提升一次速度,提升多少附加能力
  775.     #=========================================================================
  776.     @agi_hp = 0     # 每提升一次速度附加提升多少HP
  777.     @agi_sp = 0     # 每提升一次速度附加提升多少SP
  778.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  779.     @agi_dex = 1    # 每提升一次速度附加提升多少灵巧
  780.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  781.     @agi_agi = 3    # 每提升一次速度附加提升多少速度
  782.     #=========================================================================
  783.     # 每提升一次魔力,提升多少附加能力
  784.     #=========================================================================
  785.     @int_hp = 1     # 每提升一次魔力附加提升多少HP
  786.     @int_sp = 15    # 每提升一次魔力附加提升多少SP
  787.     @int_str = -1   # 每提升一次魔力附加提升多少力量
  788.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  789.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  790.     @int_int = 7   # 每提升一次魔力附加提升多少魔力
  791.     #=========================================================================
  792.     # 每提升一次体力,提升多少附加能力
  793.     #=========================================================================
  794.     @hp = 20       # 每提升一次体力提升多少HP
  795.     @sp = 10       # 每提升一次体力提升多少SP
  796.     @hp_str = 0   # 每提升一次体力提升多少力量
  797.     @hp_dex = 0   # 每提升一次体力提升多少速度
  798.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  799.     @hp_int = -1   # 每提升一次体力提升多少魔力   
  800.     # 定义说明文字
  801.     @text_hp_sc = "体力可以增加生存的能力,增加HP与SP的最大上限!"
  802.     @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
  803.     @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和防御系数!"
  804.     @text_agi_sc = $data_system.words.agi + "可以提高行动速度、逃跑成功率!"
  805.     @text_int_sc = $data_system.words.int + "可以提高魔法攻击的效果!"
  806.     @text_save = "保存分配情况并返回游戏"
  807.     @text_reset= "重新分配能力点数"
  808.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  809.     @text_hp = "最大" + $data_system.words.hp + "值"
  810.     @text_sp = "最大" + $data_system.words.sp + "值"
  811.     @text_str = "最大" + $data_system.words.str + "值"
  812.     @text_dex = "最大" + $data_system.words.dex + "值"
  813.     @text_agi = "最大" + $data_system.words.agi + "值"
  814.     @text_int = "最大" + $data_system.words.int + "值"
  815.     s_disable
  816.     # 生成状态窗口
  817.     @lvup_window = Window_Lvup.new(@actor)
  818.     @lvup_window.x = 128
  819.     @lvup_window.y = 0   
  820.     # 生成帮助窗口并初始化帮助文本
  821.     @help_window = Window_Lvup_Help.new   
  822.     # 执行过渡
  823.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  824.     # 主循环
  825.     loop do
  826.       # 刷新游戏画面
  827.       Graphics.update
  828.       # 刷新输入信息
  829.       Input.update
  830.       # 刷新画面
  831.       update
  832.       # 如果切换画面就中断循环
  833.       if $scene != self
  834.         break
  835.       end
  836.     end
  837.     # 准备过渡
  838.     Graphics.freeze
  839.     # 释放窗口
  840.     @command_window.dispose
  841.     @lvup_window.dispose
  842.     @help_window.dispose
  843.   end
  844.   #--------------------------------------------------------------------------
  845.   # ● 刷新画面
  846.   #--------------------------------------------------------------------------
  847.   def update
  848.     # 刷新窗口
  849.     @command_window.update
  850.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  851.     s_disable
  852.     @lvup_window.update
  853.     #=============================================================
  854.     # 按下 B 键的情况下
  855.     #=============================================================
  856.     if Input.trigger?(Input::B)
  857.       # 演奏取消 SE
  858.       $game_system.se_play($data_system.cancel_se)
  859.       # 切换到地图画面
  860.       $scene = Scene_Menu.new
  861.       return
  862.     end
  863.     #=============================================================
  864.     # 按下 C 键的情况下
  865.     #=============================================================
  866.     if Input.trigger?(Input::C)      
  867.       if @command_window.index == 5
  868.           # 演奏确定 SE
  869.         $game_system.se_play($data_system.decision_se)
  870.         # 将角色的剩余点数带回
  871.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  872.         # 将角色点数实际加上
  873.         @actor.str += $temp_str
  874.         @actor.dex += $temp_dex
  875.         @actor.agi += $temp_agi
  876.         @actor.int += $temp_int
  877.         @actor.maxhp += $temp_hp
  878.         @actor.maxsp += $temp_sp
  879.         # 切换到地图画面
  880.         $scene = Scene_Menu.new
  881.         return
  882.       end
  883.       if @command_window.index == 6
  884.           # 演奏确定 SE
  885.         $game_system.se_play($data_system.cancel_se)
  886.           # 将角色的剩余点数带入
  887.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  888.           # 初始化临时量
  889.         $temp_str = 0
  890.         $temp_dex = 0
  891.         $temp_agi = 0
  892.         $temp_int = 0
  893.         $temp_hp = 0
  894.         $temp_sp = 0
  895.         @lvup_window.refresh
  896.         return
  897.       end
  898.       if $point == 0
  899.         # 演奏冻结 SE
  900.         $game_system.se_play($data_system.buzzer_se)
  901.         return
  902.       end
  903.       case @command_window.index
  904.       when 0
  905.         # 演奏确定 SE
  906.         $game_system.se_play($data_system.decision_se)
  907.         $temp_hp += @hp
  908.         $temp_sp += @sp
  909.         $temp_str += @hp_str
  910.         $temp_dex += @hp_dex
  911.         $temp_agi += @hp_agi
  912.         $temp_int += @hp_int
  913.         $point -= 1
  914.         @lvup_window.refresh
  915.         s_disable
  916.         return
  917.       when 1
  918.         # 演奏确定 SE
  919.         $game_system.se_play($data_system.decision_se)
  920.         $temp_str += @str_str
  921.         $temp_hp += @str_hp
  922.         $temp_sp += @str_sp
  923.         $temp_dex += @str_dex
  924.         $temp_agi += @str_agi
  925.         $temp_int += @str_int
  926.         $point -= 1
  927.         @lvup_window.refresh
  928.         s_disable
  929.         return
  930.       when 2
  931.         # 演奏确定 SE
  932.         $game_system.se_play($data_system.decision_se)
  933.         $temp_dex += @dex_dex
  934.         $temp_hp += @dex_hp
  935.         $temp_sp += @dex_sp
  936.         $temp_str += @dex_str
  937.         $temp_agi += @dex_agi
  938.         $temp_int += @dex_int
  939.         $point -= 1
  940.         @lvup_window.refresh
  941.         s_disable
  942.         return
  943.       when 3
  944.         # 演奏确定 SE
  945.         $game_system.se_play($data_system.decision_se)
  946.         $temp_agi += @agi_agi
  947.         $temp_hp += @agi_hp
  948.         $temp_sp += @agi_sp
  949.         $temp_str += @agi_str
  950.         $temp_dex += @agi_dex
  951.         $temp_int += @agi_int
  952.         $point -= 1
  953.         @lvup_window.refresh
  954.         s_disable
  955.         return
  956.       when 4
  957.         # 演奏确定 SE
  958.         $game_system.se_play($data_system.decision_se)
  959.         $temp_int += @int_int
  960.         $temp_hp += @int_hp
  961.         $temp_sp += @int_sp
  962.         $temp_str += @int_str
  963.         $temp_dex += @int_dex
  964.         $temp_agi += @int_agi
  965.         $point -= 1
  966.         @lvup_window.refresh
  967.         s_disable
  968.         return
  969.       end
  970.     end
  971.     #=============================================================
  972.     # 什么都没有按下的情况
  973.     #=============================================================
  974.     case @command_window.index   
  975.     when 0  # 增加体力
  976.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  977.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  978.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  979.     when 1  # 增加力量
  980.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  981.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  982.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  983.     when 2  # 增加灵巧
  984.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  985.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  986.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  987.     when 3  # 增加速度
  988.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  989.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  990.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  991.     when 4  # 增加魔力
  992.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  993.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  994.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  995.     when 5 # 保存设定
  996.       @help_window.lvup_text(@text_save)
  997.     when 6 # 点数重置
  998.       @help_window.lvup_text(@text_reset)     
  999.     end
  1000.     #=============================================================
  1001.     # 按下R与L换人的情况
  1002.     #=============================================================      
  1003.     if Input.trigger?(Input::R)
  1004.       # 演奏光标 SE
  1005.       $game_system.se_play($data_system.cursor_se)
  1006.       # 移至下一位角色
  1007.       @actor_index += 1
  1008.       @actor_index %= $game_party.actors.size
  1009.       # 切换到别的状态画面
  1010.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1011.       return
  1012.     end
  1013.     # 按下 L 键的情况下
  1014.     if Input.trigger?(Input::L)
  1015.       # 演奏光标 SE
  1016.       $game_system.se_play($data_system.cursor_se)
  1017.       # 移至上一位角色
  1018.       @actor_index += $game_party.actors.size - 1
  1019.       @actor_index %= $game_party.actors.size
  1020.       # 切换到别的状态画面
  1021.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1022.       return
  1023.     end
  1024.   end  
  1025.   #--------------------------------------------------------------------------
  1026.   # ● 选项明暗判断
  1027.   #--------------------------------------------------------------------------
  1028.   def s_disable
  1029.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  1030.     if $point == 0
  1031.       @command_window.disable_item(0)
  1032.       @command_window.disable_item(1)
  1033.       @command_window.disable_item(2)
  1034.       @command_window.disable_item(3)
  1035.       @command_window.disable_item(4)
  1036.     else
  1037.       @command_window.able_item(0)
  1038.       @command_window.able_item(1)      
  1039.       @command_window.able_item(2)
  1040.       @command_window.able_item(3)
  1041.       @command_window.able_item(4)
  1042.     end
  1043.   end
  1044. end

  1045. #==============================================================================
  1046. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1047. #==============================================================================

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




  
回复

使用道具 举报

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-27 23:01:18 | 显示全部楼层
本帖最后由 RyanBern 于 2014-12-28 09:32 编辑

这是第二脚本,是任务系统的脚本



  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # Game_System
  6. #------------------------------------------------------------------------------
  7. # 添加内容
  8. #==============================================================================
  9. class Game_System
  10.   attr_accessor :mission #现在执行的任务
  11.   attr_accessor :partmission
  12.   alias carol3_ini initialize
  13.   def initialize
  14.     carol3_ini
  15.     @mission = ""
  16.     @partmission = []
  17.   end
  18. end
  19. #==============================================================================
  20. # ■ Scene_Title
  21. #------------------------------------------------------------------------------
  22. #  处理标题画面的类。
  23. #==============================================================================
  24. class Scene_Title
  25.   alias carol3_title1 main
  26.   def main
  27.     $map_infos = load_data("Data/MapInfos.rxdata")
  28.     for key in $map_infos.keys
  29.       $map_infos[key] = $map_infos[key].name
  30.     end
  31.     $任务 = ""
  32.     $支线 = nil
  33.     $支线完成 = nil
  34.     carol3_title1
  35.   end
  36. end
  37. class Scene_Map
  38.   alias carol3_update update
  39.   def update
  40.     carol3_update
  41.     if $支线 != nil
  42.       for i in 0...$game_system.partmission.size
  43.         if $game_system.partmission[i] == $支线
  44.           $支线 = nil
  45.           break
  46.         end
  47.       end
  48.       if $支线 != nil
  49.         $game_system.partmission.push($支线)
  50.         $支线 = nil
  51.       end
  52.     end
  53.     if $支线完成 != nil
  54.       for i in 0...$game_system.partmission.size
  55.         if $game_system.partmission[i] == $支线完成
  56.           $game_system.partmission.delete($game_system.partmission[i])
  57.           break
  58.         end
  59.       end
  60.       $支线完成 = nil
  61.     end
  62.   end
  63. end
  64. #==============================================================================
  65. # Window_MenuStatus
  66. #------------------------------------------------------------------------------
  67. # 显示菜单画面和同伴状态的窗口。
  68. #==============================================================================
  69. class Window_MenuStatus < Window_Selectable
  70.   #--------------------------------------------------------------------------
  71.   # ● 初始化目标
  72.   #--------------------------------------------------------------------------
  73.   def initialize
  74.     super(0, 0, 480, 384)
  75.     self.contents = Bitmap.new(width - 32, height - 32)
  76.     self.active = false
  77.     self.index = -1
  78.     @position = 0
  79.     @count = 0
  80.     @oldposition = 0
  81.     refresh
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 刷新
  85.   #--------------------------------------------------------------------------
  86.   def refresh
  87.     self.contents.clear
  88.     @item_max = $game_party.actors.size
  89.     for i in 0...$game_party.actors.size
  90.       x = 64
  91.       y = i * 90
  92.       actor = $game_party.actors[i]
  93.       self.contents.font.size = 18
  94.       draw_actor_active_graphic(actor, x - 40, y + 50)
  95.       draw_actor_name(actor, x, y)
  96.       draw_actor_class(actor, x + 144, y)
  97.       draw_actor_level(actor, x, y + 25)
  98.       draw_actor_state(actor, x + 90, y + 25)
  99.       draw_actor_exp(actor, x, y + 50)
  100.       draw_actor_hp(actor, x + 236, y + 25)
  101.       draw_actor_sp(actor, x + 236, y + 50)
  102.     end
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● 绘制行走图
  106.   #--------------------------------------------------------------------------
  107.   def draw_actor_active_graphic(actor, x, y)
  108.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  109.     cw = bitmap.width / 4
  110.     ch = bitmap.height / 4
  111.     p = @position * cw
  112.     src_rect = Rect.new(p, 0, cw, ch)
  113.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● 刷新光标矩形
  117.   #--------------------------------------------------------------------------
  118.   def update_cursor_rect
  119.     if @index < 0
  120.       self.cursor_rect.empty
  121.     else
  122.       self.cursor_rect.set(0, @index *90-5, self.width - 32, 90)
  123.     end
  124.   end  
  125.   def update
  126.     super
  127.     @count += 1
  128.     @count %= 15
  129.     if @count == 0
  130.       @position = (@position + 1) % 4
  131.     end
  132.     if @position != @oldposition
  133.       @oldposition = @position
  134.       refresh
  135.     end
  136.   end
  137. end
  138. #==============================================================================
  139. # ■ Game_Map
  140. #------------------------------------------------------------------------------
  141. #  处理地图的类。包含卷动以及可以通行的判断功能。
  142. # 本类的实例请参考 $game_map 。
  143. #==============================================================================
  144. class Game_Map
  145.   def name
  146.     return $map_infos[@map_id]
  147.   end
  148. end
  149. #==============================================================================
  150. # Window_RecordBook
  151. #------------------------------------------------------------------------------
  152. # 菜单界面表示信息的窗口
  153. #==============================================================================
  154. class Window_RecordBook < Window_Base
  155.   #--------------------------------------------------------------------------
  156.   # ● 初始化对象
  157.   #--------------------------------------------------------------------------
  158.   def initialize
  159.     super(160, 384, 480, 480)
  160.     self.contents = Bitmap.new(width - 32, height - 32)
  161.     if $任务 == ""
  162.       $任务 = $game_system.mission
  163.     else
  164.       $game_system.mission = $任务
  165.     end
  166.     refresh
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● 刷新画面
  170.   #--------------------------------------------------------------------------
  171.   def refresh
  172.     self.contents.clear
  173.     self.contents.font.color = system_color
  174.     self.contents.font.size = 20
  175.     cx = self.contents.text_size("现在地点").width + 24
  176.     self.contents.draw_text(4, 0, cx, 24, "现在地点")
  177.     self.contents.font.color = normal_color
  178.     self.contents.draw_text(4 + cx, 0, 444 - cx, 24, $game_map.name.to_s)  
  179.     self.contents.font.color = system_color
  180.     cx = self.contents.text_size("主线任务").width + 24
  181.     self.contents.draw_text(4, 32, cx, 24, "主线任务")
  182.     self.contents.font.color = Color.new(240,250,75,255)
  183.     self.contents.draw_text(4 + cx, 32, 444 - cx, 24, $game_system.mission.to_s)  
  184.     self.contents.font.color = system_color
  185.     cx = self.contents.text_size("支线任务").width + 24
  186.     self.contents.draw_text(4, 96, cx, 24, "支线任务")
  187.     self.contents.font.color = normal_color
  188.     for i in 0...$game_system.partmission.size
  189.       self.contents.draw_text(4 + cx, 96 + i * 32, 444 - cx, 24, $game_system.partmission[i].to_s)
  190.     end
  191.   end
  192. end
  193. #==============================================================================
  194. # ■ Scene_Menu
  195. #------------------------------------------------------------------------------
  196. #  处理菜单画面的类。
  197. #==============================================================================
  198. class Scene_Menu
  199.   #--------------------------------------------------------------------------
  200.   # ● 初始化对像
  201.   # menu_index : 命令光标的初期位置
  202.   #--------------------------------------------------------------------------
  203.   def initialize(menu_index = 0)
  204.     @menu_index = menu_index
  205.     @切换状态暂停 = ""
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 主处理
  209.   #--------------------------------------------------------------------------
  210.   def main
  211.     # 生成命令窗口
  212.     s1 = " 使用物品"#$data_system.words.item
  213.     s2 = " 使用技能"#$data_system.words.skill
  214.     s3 = " 更改装备"#$data_system.words.equip
  215.     s4 = " 查看状态"
  216.     s5 = " 储存游戏"
  217.     s6 = " 结束游戏"
  218.     s7 = " 查看任务"
  219.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  220.     @command_window.index = @menu_index
  221.     # 同伴人数为 0 的情况下
  222.     if $game_party.actors.size == 0
  223.       # 物品、特技、装备、状态无效化
  224.       @command_window.disable_item(0)
  225.       @command_window.disable_item(1)
  226.       @command_window.disable_item(2)
  227.       @command_window.disable_item(3)
  228.     end
  229.     # 禁止存档的情况下
  230.     if $game_system.save_disabled
  231.       # 存档无效
  232.       @command_window.disable_item(4)
  233.     end
  234.     # 生成游戏时间窗口
  235.     @playtime_window = Window_PlayTime.new
  236.     @playtime_window.x = 0
  237.     @playtime_window.y = 256
  238.     # 生成金钱窗口
  239.     @gold_window = Window_Gold.new
  240.     @gold_window.x = 0
  241.     @gold_window.y = 416
  242.     # 生成状态窗口
  243.     @status_window = Window_MenuStatus.new
  244.     @status_window.x = 160
  245.     @status_window.y = 0
  246.     #—— 生成天书窗口
  247.     @recordbook_window = Window_RecordBook.new
  248.     @recordbook_window.z = 1000
  249.     #—— 生成外边框窗口
  250.     @outside_window = Window_Outside.new
  251.     @outside_window.visible = true
  252.     @outside_window.z = 1001
  253.     # 执行过渡
  254.     Graphics.transition
  255.     # 主循环
  256.     loop do
  257.       # 刷新游戏画面
  258.       Graphics.update
  259.       # 刷新输入信息
  260.       Input.update
  261.       # 刷新画面
  262.       update
  263.       # 如果切换画面就中断循环
  264.       if $scene != self
  265.         break
  266.       end
  267.     end
  268.     # 准备过渡
  269.     Graphics.freeze
  270.     # 释放窗口
  271.     @command_window.dispose
  272.     @playtime_window.dispose
  273.     @gold_window.dispose
  274.     @status_window.dispose
  275.     @outside_window.dispose
  276.     @recordbook_window.dispose
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 刷新画面
  280.   #--------------------------------------------------------------------------
  281.   def update
  282.     # 刷新窗口
  283.     @command_window.update
  284.     @playtime_window.update
  285.     @gold_window.update
  286.     @status_window.update
  287.     # 命令窗口被激活的情况下: 调用 update_command
  288.     if @command_window.active
  289.       update_command
  290.       return
  291.     end
  292.     # 状态窗口被激活的情况下: 调用 update_status
  293.     if @status_window.active
  294.       update_status
  295.       return
  296.     end
  297.     if @outside_window.visible == false
  298.       update_recordbook
  299.       return
  300.     end
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● 刷新画面 (命令窗口被激活的情况下)
  304.   #--------------------------------------------------------------------------
  305.   def update_command
  306.     # 按下 B 键的情况下
  307.     if Input.trigger?(Input::B)
  308.       # 演奏取消 SE
  309.       $game_system.se_play($data_system.cancel_se)
  310.       # 切换的地图画面
  311.       $scene = Scene_Map.new
  312.       return
  313.     end
  314.     # 按下 C 键的情况下
  315.     if Input.trigger?(Input::C)
  316.       # 同伴人数为 0、存档、游戏结束以外的场合
  317.       if $game_party.actors.size == 0 and @command_window.index < 4
  318.         # 演奏冻结 SE
  319.         $game_system.se_play($data_system.buzzer_se)
  320.         return
  321.       end
  322.       # 命令窗口的光标位置分支
  323.       case @command_window.index
  324.       when 0 # 物品
  325.         # 演奏确定 SE
  326.         $game_system.se_play($data_system.decision_se)
  327.         # 切换到物品画面
  328.         $scene = Scene_Item.new
  329.       when 1 # 特技
  330.         # 演奏确定 SE
  331.         $game_system.se_play($data_system.decision_se)
  332.         # 激活状态窗口
  333.         @command_window.active = false
  334.         @status_window.active = true
  335.         @status_window.index = 0
  336.       when 2 # 装备
  337.         # 演奏确定 SE
  338.         $game_system.se_play($data_system.decision_se)
  339.         # 激活状态窗口
  340.         @command_window.active = false
  341.         @status_window.active = true
  342.         @status_window.index = 0
  343.       when 3 # 状态
  344.         # 演奏确定 SE
  345.         $game_system.se_play($data_system.decision_se)
  346.         # 激活状态窗口
  347.         @command_window.active = false
  348.         @status_window.active = true
  349.         @status_window.index = 0
  350.       when 4 # 存档
  351.         # 禁止存档的情况下
  352.         if $game_system.save_disabled
  353.           # 演奏冻结 SE
  354.           $game_system.se_play($data_system.buzzer_se)
  355.           return
  356.         end
  357.         # 演奏确定 SE
  358.         $game_system.se_play($data_system.decision_se)
  359.         # 切换到存档画面
  360.         $scene = Scene_Save.new
  361.       when 5 # 游戏结束
  362.         # 演奏确定 SE
  363.         $game_system.se_play($data_system.decision_se)
  364.         # 切换到游戏结束画面
  365.         $scene = Scene_End.new
  366.       when 6 # 查看任务
  367.         # 演奏确定 SE
  368.         $game_system.se_play($data_system.decision_se)
  369.         @command_window.active = false
  370.         @outside_window.visible = false
  371.       end
  372.       return
  373.     end
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 刷新画面 (查看天书的情况下)
  377.   #--------------------------------------------------------------------------
  378.   def update_recordbook
  379.     if @切换状态暂停 == "天书消失"
  380.       if @recordbook_window.y < 384
  381.         @recordbook_window.y +=64
  382.         @status_window.y -= 16
  383.         return
  384.       else
  385.         @切换状态暂停 = ""
  386.         @outside_window.visible = true
  387.         @command_window.active = true
  388.       end
  389.     else
  390.       if @recordbook_window.y >0
  391.         @recordbook_window.y -= 32
  392.         @status_window.y += 8
  393.         return
  394.       else
  395.         @status_window.visible = false
  396.         if Input.trigger?(Input::B)
  397.           @切换状态暂停 = "天书消失"
  398.           $game_system.se_play($data_system.cancel_se)
  399.           @status_window.visible = true
  400.           return
  401.         end
  402.       end
  403.     end
  404.   end  
  405.   #--------------------------------------------------------------------------
  406.   # ● 刷新画面 (状态窗口被激活的情况下)
  407.   #--------------------------------------------------------------------------
  408.   def update_status
  409.     # 按下 B 键的情况下
  410.     if Input.trigger?(Input::B)
  411.       # 演奏取消 SE
  412.       $game_system.se_play($data_system.cancel_se)
  413.       # 激活命令窗口
  414.       @command_window.active = true
  415.       @status_window.active = false
  416.       @status_window.index = -1
  417.       return
  418.     end
  419.     # 按下 C 键的情况下
  420.     if Input.trigger?(Input::C)
  421.       # 命令窗口的光标位置分支
  422.       case @command_window.index
  423.       when 1 # 特技
  424.         # 本角色的行动限制在 2 以上的情况下
  425.         if $game_party.actors[@status_window.index].restriction >= 2
  426.           # 演奏冻结 SE
  427.           $game_system.se_play($data_system.buzzer_se)
  428.           return
  429.         end
  430.         # 演奏确定 SE
  431.         $game_system.se_play($data_system.decision_se)
  432.         # 切换到特技画面
  433.         $scene = Scene_Skill.new(@status_window.index)
  434.       when 2 # 装备
  435.         # 演奏确定 SE
  436.         $game_system.se_play($data_system.decision_se)
  437.         # 切换的装备画面
  438.         $scene = Scene_Equip.new(@status_window.index)
  439.       when 3 # 状态
  440.         # 演奏确定 SE
  441.         $game_system.se_play($data_system.decision_se)
  442.         # 切换到状态画面
  443.         $scene = Scene_Status.new(@status_window.index)
  444.       end
  445.       return
  446.     end
  447.   end
  448. end
  449. #==============================================================================
  450. # Window_Outside
  451. #------------------------------------------------------------------------------
  452. # 外边框窗口
  453. #==============================================================================
  454. class Window_Outside < Window_Base
  455.   #--------------------------------------------------------------------------
  456.   # ● 初始化对象
  457.   #--------------------------------------------------------------------------
  458.   def initialize
  459.     super(160, 384, 480, 96)
  460.     self.back_opacity = 0
  461.   end
  462. end
  463. #==============================================================================
  464. # ■ Window_PlayTime
  465. #------------------------------------------------------------------------------
  466. # 菜单画面的系统时间表示
  467. #==============================================================================
  468. class Window_PlayTime < Window_Base
  469.   #--------------------------------------------------------------------------
  470.   # ● 初始化对像
  471.   #--------------------------------------------------------------------------
  472.   def initialize
  473.     super(0, 0, 160, 128)
  474.     self.contents = Bitmap.new(width - 32, height - 32)
  475.     self.contents.font.size = 18
  476.     refresh
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 刷新
  480.   #--------------------------------------------------------------------------
  481.   def refresh
  482.     self.contents.clear
  483.     self.contents.font.color = system_color
  484.     self.contents.font.color = text_color(6)
  485.     time = Time.now
  486.     text = time.strftime("%x %X")
  487.     self.contents.draw_text(-2, 32, 130, 32, text, 2)
  488.     @total_sec = Graphics.frame_count / Graphics.frame_rate
  489.     hour = @total_sec / 60 / 60
  490.     min = @total_sec / 60 % 60
  491.     sec = @total_sec % 60
  492.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  493.     self.contents.font.color = normal_color
  494.     self.contents.draw_text(4, 0, 160, 32, "日期与游戏时间")
  495.     self.contents.draw_text(-2, 64, 130, 32, text, 2)
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 更新
  499.   #--------------------------------------------------------------------------
  500.   def update
  501.     super
  502.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  503.       refresh
  504.     end
  505.   end
  506. end

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

使用道具 举报

梦石
0
星屑
9557
在线时间
5074 小时
注册时间
2013-6-21
回帖
3459

开拓者贵宾剧作品鉴家

发表于 2014-12-28 10:53:01 | 显示全部楼层
整合完成,可以拿去看看效果。
为了界面整洁,去掉了任务系统的显示系统时间窗口,换回了游戏默认的时间窗口,感觉那个不是很有必要。
Project6.rar (194.7 KB, 下载次数: 52)
回复

使用道具 举报

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-28 12:40:46 | 显示全部楼层
RyanBern 发表于 2014-12-28 10:53
整合完成,可以拿去看看效果。
为了界面整洁,去掉了任务系统的显示系统时间窗口,换回了游戏默认的时间窗 ...

弄好了,可以用,谢谢,谢谢( ゚∀゚)
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部