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

Project1

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

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

[复制链接]

Lv1.梦旅人

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

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

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

x
我使用了一个是可以换人的脚本,另一个是任务栏的脚本,但是两个脚本有冲突,该怎么修改,求助。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
帖子
10
2
 楼主| 发表于 2014-12-27 23:00:23 | 只看该作者
本帖最后由 RyanBern 于 2014-12-28 09:31 编辑

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


RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================
  6.  
  7. class Window_MenuStatus < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化目标
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     super(0, 0, 480, 480)
  13.     self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
  14.     refresh
  15.     @top_row = 0
  16.     self.active = false
  17.     self.index = -1
  18.   end
  19.   #--------------------------------------------------------------------------
  20.   # ● 刷新
  21.   #--------------------------------------------------------------------------
  22.   def refresh
  23.     self.contents.clear
  24.     @item_max = $game_party.actors.size
  25.     for i in 0...$game_party.actors.size
  26.       x = 64
  27.       y = i * 112
  28.       if i <=3
  29.         self.contents.font.color = Color.new(255,255,0,255)
  30.         self.contents.draw_text(x,y,340,32,"[出战]",2)
  31.         self.contents.font.color = normal_color
  32.       else
  33.         self.contents.font.color = Color.new(128,128,128,255)
  34.         self.contents.draw_text(x,y,340,32,"[待机]",2)
  35.         self.contents.font.color = normal_color
  36.       end      
  37.       actor = $game_party.actors[i]
  38.       draw_actor_graphic(actor, x - 40, y + 80)
  39.       draw_actor_name(actor, x, y)
  40.       draw_actor_class(actor, x + 144, y)
  41.       draw_actor_level(actor, x, y + 32)
  42.       draw_actor_state(actor, x + 90, y + 32)
  43.       draw_actor_exp(actor, x, y + 64)
  44.       draw_actor_hp(actor, x + 236, y + 32)
  45.       draw_actor_sp(actor, x + 236, y + 64)
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 刷新光标矩形
  50.   #--------------------------------------------------------------------------
  51.   def update_cursor_rect
  52.     if @index < 0
  53.       self.cursor_rect.empty
  54.     else
  55.       tpy = @index * 112 - self.oy
  56.       self.cursor_rect.set(0, tpy, self.width - 32, 96)
  57.       if @index < @top_row
  58.         @top_row = @index
  59.         self.oy = @top_row *112
  60.       end
  61.       if @index > @top_row+3
  62.         @top_row = @index-3
  63.         self.oy = @top_row *112
  64.       end
  65.     end
  66.   end
  67. end
  68.  
  69. class Game_Party
  70.   #--------------------------------------------------------------------------
  71.   # ● 全灭判定
  72.   #--------------------------------------------------------------------------
  73.   def all_dead?
  74.     # 同伴人数为 0 的情况下
  75.     if $game_party.actors.size == 0
  76.       return false
  77.     end
  78.     # 同伴中无人 HP 在 0 以上
  79.     for i in 0..3
  80.       if @actors[i] != nil and@actors[i].hp >0
  81.         return false
  82.       end
  83.     end
  84.     # 全灭
  85.     return true
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 加入同伴
  89.   #     actor_id : 角色 ID
  90.   #--------------------------------------------------------------------------
  91.   def add_actor(actor_id)
  92.     # 获取角色
  93.     actor = $game_actors[actor_id]
  94.     # 同伴人数未满 4 人、本角色不在队伍中的情况下
  95.     if not @actors.include?(actor)
  96.       # 添加角色
  97.       @actors.push(actor)
  98.       # 还原主角
  99.       $game_player.refresh
  100.     end
  101.   end
  102. end
  103.  
  104. #==============================================================================
  105. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  106. #==============================================================================
  107.  
  108.  
  109. class Scene_Menu
  110. # --------------------------------
  111.   def initialize(menu_index = 0)
  112.     @menu_index = menu_index
  113.     @changer = 0
  114.     @where = 0
  115.     @checker = 0
  116.   end
  117. # --------------------------------
  118.   def main
  119.     s1 = $data_system.words.item
  120.     s2 = $data_system.words.skill
  121.     s3 = $data_system.words.equip
  122.     s4 = "状态"
  123.     s5 = "储存进度"
  124.     s6 = "离开游戏"
  125.     s7 = "调整队伍"
  126.     s8 = "升级加点"
  127.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
  128.     @command_window.index = @menu_index
  129.     if $game_party.actors.size == 0
  130.       @command_window.disable_item(0)
  131.       @command_window.disable_item(1)
  132.       @command_window.disable_item(2)
  133.       @command_window.disable_item(3)
  134.     end
  135.     if $game_system.save_disabled
  136.       @command_window.disable_item(4)
  137.     end
  138.     if $game_party.actors.size == 1
  139.       @command_window.disable_item(6)
  140.     end
  141.     @playtime_window = Window_PlayTime.new
  142.     @playtime_window.x = 0
  143.     @playtime_window.y = 320
  144.     @gold_window = Window_Gold.new
  145.     @gold_window.x = 0
  146.     @gold_window.y = 416
  147.     @status_window = Window_MenuStatus.new
  148.     @status_window.x = 160
  149.     @status_window.y = 0
  150.     Graphics.transition
  151.     loop do
  152.       Graphics.update
  153.       Input.update
  154.       update
  155.       if $scene != self
  156.         break
  157.       end
  158.     end
  159.     Graphics.freeze
  160.     @command_window.dispose
  161.     @playtime_window.dispose
  162.     @gold_window.dispose
  163.     @status_window.dispose
  164.   end
  165. # --------------------------------
  166.   def update
  167.     @command_window.update
  168.     @playtime_window.update
  169.     @gold_window.update
  170.     @status_window.update
  171.     if @command_window.active
  172.       update_command
  173.       return
  174.     end
  175.     if @status_window.active
  176.       update_status
  177.       return
  178.     end
  179.   end
  180. # --------------------------------
  181.   def update_command
  182.     if Input.trigger?(Input::B)
  183.       $game_system.se_play($data_system.cancel_se)
  184.       $scene = Scene_Map.new
  185.       return
  186.     end
  187.     if Input.trigger?(Input::C)
  188.       if $game_party.actors.size == 0 and @command_window.index < 4
  189.         $game_system.se_play($data_system.buzzer_se)
  190.         return
  191.       end
  192.       if $game_party.actors.size == 1 and @command_window.index ==6
  193.         $game_system.se_play($data_system.buzzer_se)
  194.         return
  195.       end
  196.       case @command_window.index
  197.       when 0
  198.         $game_system.se_play($data_system.decision_se)
  199.         $scene = Scene_Item.new
  200.       when 1
  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 2
  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 3
  211.         $game_system.se_play($data_system.decision_se)
  212.         @command_window.active = false
  213.         @status_window.active = true
  214.         @status_window.index = 0
  215.       when 4
  216.         if $game_system.save_disabled
  217.           $game_system.se_play($data_system.buzzer_se)
  218.           return
  219.         end
  220.         $game_system.se_play($data_system.decision_se)
  221.         $scene = Scene_Save.new
  222.       when 5
  223.         $game_system.se_play($data_system.decision_se)
  224.         $scene = Scene_End.new
  225.       when 6
  226.         $game_system.se_play($data_system.decision_se)
  227.         @checker = 0
  228.         @command_window.active = false
  229.         @status_window.active = true
  230.         @status_window.index = 0
  231.       when 7
  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.       when 8
  237.         $game_system.se_play($data_system.decision_se)
  238.         @command_window.active = false
  239.         @status_window.active = true
  240.         @status_window.index = 0
  241.       end
  242.       return
  243.     end
  244.   end
  245. # --------------------------------
  246.   def update_status
  247.     if Input.trigger?(Input::B)
  248.       $game_system.se_play($data_system.cancel_se)
  249.       @command_window.active = true
  250.       @status_window.active = false
  251.       @status_window.index = -1
  252.       return
  253.     end
  254.     if Input.trigger?(Input::C)
  255.       case @command_window.index
  256.       when 1
  257.         if $game_party.actors[@status_window.index].restriction >= 2
  258.           $game_system.se_play($data_system.buzzer_se)
  259.           return
  260.         end
  261.         $game_system.se_play($data_system.decision_se)
  262.         $scene = Scene_Skill.new(@status_window.index)
  263.       when 2
  264.         $game_system.se_play($data_system.decision_se)
  265.         $scene = Scene_Equip.new(@status_window.index)
  266.       when 3
  267.         $game_system.se_play($data_system.decision_se)
  268.         $scene = Scene_Status.new(@status_window.index)
  269.       when 6
  270.         $game_system.se_play($data_system.decision_se)
  271.         if @checker == 0
  272.           @changer = $game_party.actors[@status_window.index]
  273.           @where = @status_window.index
  274.           @checker = 1
  275.         else
  276.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  277.           $game_party.actors[@status_window.index] = @changer
  278.           @checker = 0
  279.           @status_window.refresh
  280.         end
  281.       when 7
  282.         $game_system.se_play($data_system.decision_se)
  283.         $scene = Scene_Lvup.new(@status_window.index)
  284.       when 8
  285.         $game_system.se_play($data_system.decision_se)
  286.         $scene = Scene_Charactor.new(@status_window.index)
  287.       end
  288.       return
  289.     end
  290.   end
  291. end
  292.  
  293.  
  294.  
  295.     #插件(升级加点,换队伍顺序,人物介绍,动态行走图)
  296.  
  297. #==============================================================================
  298. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  299. #==============================================================================
  300.  
  301.  
  302. # 作者: 柳柳
  303. #
  304. # 说明:这是功能我再比较早期的时候发布在幻森,不过那时候比较笨,方法很糟糕
  305. #       这次是拿上就可以用的。
  306. #
  307. # 感谢:Claimh的脚本使我想起这个功能重做了一遍,本想直接用他的,不过他的算法过分
  308. #       冗余了,没好意思用。
  309. #==============================================================================
  310. # 使用方法:默认情况下把静态图变为了走步图。如果想自行修改,提供功能如下:
  311. #
  312. # 角色走步图:draw_walk_actor_graphic
  313. # 角色转向图:draw_turn_actor_graphic
  314. #
  315. # 回复原有静态角色图:删除100行以后的内容。修改下面这个变量可以更改行走速度
  316. #==============================================================================
  317.  
  318. WALK_REFRESH_FRAME_SPEED = 15  # 刷新的速度,越大越慢,你可以改为3左右试试看
  319.  
  320. #==============================================================================
  321. # Window_Base
  322. #==============================================================================
  323. class Window_Base < Window
  324.   #--------------------------------------------------------------------------
  325.   # 初始化方法
  326.   #--------------------------------------------------------------------------
  327.   alias initialize_walk initialize
  328.   def initialize(x, y, width, height)
  329.     initialize_walk(x, y, width, height)
  330.     @start_walk = false
  331.     @turn_index = 0
  332.     @turn_phase = 0
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ★  角色行走图
  336.   #     actor : 角色
  337.   #     x     : 描绘的 X 坐标
  338.   #     y     : 描绘的 Y 坐标
  339.   #--------------------------------------------------------------------------
  340.   def draw_walk_actor_graphic(actor, x, y)
  341.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  342.     cw = bitmap.width / 4
  343.     ch = bitmap.height / 4
  344.     @start_turn = true
  345.     case @turn_phase
  346.     when 0
  347.       x_x = 0
  348.     when 1
  349.       x_x = cw
  350.     when 2
  351.       x_x = cw * 2
  352.     when 3
  353.       x_x = cw * 3
  354.     end
  355.     src_rect = Rect.new(x_x, 0, cw, ch)
  356.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ★  角色转向图
  360.   #     actor : 角色
  361.   #     x     : 描绘的 X 坐标
  362.   #     y     : 描绘的 Y 坐标
  363.   #--------------------------------------------------------------------------
  364.   def draw_turn_actor_graphic(actor, x, y)
  365.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  366.     cw = bitmap.width / 4
  367.     ch = bitmap.height / 4
  368.     @start_turn = true
  369.     case @turn_phase
  370.     when 0
  371.       x_x = 0
  372.     when 1
  373.       x_x = ch
  374.     when 2
  375.       x_x = ch * 3
  376.     when 3
  377.       x_x = ch * 2
  378.     end
  379.     src_rect = Rect.new(0, x_x, cw, ch)
  380.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   #  更新(可别使用刷新,玩命耗费内存= =)
  384.   #--------------------------------------------------------------------------
  385.   alias walk_update update
  386.   def update
  387.     walk_update
  388.     if @start_turn == true
  389.       @turn_index += 1
  390.       if @turn_index == WALK_REFRESH_FRAME_SPEED
  391.         refresh
  392.         @turn_index = 0
  393.         @turn_phase = (@turn_phase+1)%4
  394.       end
  395.     end
  396.   end  
  397. end
  398.  
  399. #==============================================================================
  400. # Window_Base
  401. #==============================================================================
  402. class Window_Base < Window
  403.   #--------------------------------------------------------------------------
  404.   # 把原有静态图改为动态走步图
  405.   #--------------------------------------------------------------------------
  406.   def draw_actor_graphic(actor, x, y)
  407.     draw_walk_actor_graphic(actor, x, y)
  408.   end
  409. end
  410.  
  411. #==============================================================================
  412. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  413. #==============================================================================
  414.  
  415. #==============================================================================
  416. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  417. #==============================================================================
  418.  
  419.  
  420. # 脚本使用设定:
  421.  
  422. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  423. LEVEL_UP_VARIABLE = 200  # 储存角色点数的变量编号与角色id编号的差值
  424.                          # 默认情况 = 200,
  425.                          # 则是数据库里1号角色的加点数存于101号变量
  426.                          # 3号角色的加点数存于103号变量。
  427.                          # 你可以直接操作变量赠与角色可分配点数
  428.  
  429. # 每增加一次点数,各项能力值的变化:357-410行
  430.  
  431. # 使用方法介绍:
  432.  
  433. # 本脚本不会取代原升级功能 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  434. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  435. # 1-99级全部等于一个相同数值就行了。
  436.  
  437. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  438. # 默认都是0号
  439.  
  440. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  441. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  442.  
  443. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
  444.  
  445. #==============================================================================
  446. # ■ Window_Command
  447. #------------------------------------------------------------------------------
  448. #  一般的命令选择行窗口。(追加定义)
  449. #==============================================================================
  450. class Window_Command < Window_Selectable
  451.   #--------------------------------------------------------------------------
  452.   # ● 项目有效化
  453.   #     index : 项目编号
  454.   #--------------------------------------------------------------------------
  455.   def able_item(index)
  456.     draw_item(index, normal_color)
  457.   end
  458. end
  459. #==============================================================================
  460. # ■ Game_Actor
  461. #------------------------------------------------------------------------------
  462. #  处理角色的类。(再定义)
  463. #==============================================================================
  464. class Game_Actor < Game_Battler
  465.   #--------------------------------------------------------------------------
  466.   # ● 更改 EXP
  467.   #     exp : 新的 EXP
  468.   #--------------------------------------------------------------------------
  469.   def exp=(exp)
  470.     @exp = [[exp, 9999999].min, 0].max
  471.     # 升级
  472.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  473.       @level += 1
  474.       # 增加4点可自由分配的点数
  475.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  476.       # 学会特技
  477.       for j in $data_classes[@class_id].learnings
  478.         if j.level == @level
  479.           learn_skill(j.skill_id)
  480.         end
  481.       end
  482.     end
  483.     # 降级
  484.     while @exp < @exp_list[@level]
  485.       @level -= 1
  486.     end
  487.     # 修正当前的 HP 与 SP 超过最大值
  488.     @hp = [@hp, self.maxhp].min
  489.     @sp = [@sp, self.maxsp].min
  490.   end
  491. end
  492. #==============================================================================
  493. # ■ Window_Base
  494. #------------------------------------------------------------------------------
  495. #  游戏中全部窗口的超级类(追加定义)
  496. #==============================================================================
  497. class Window_Base < Window
  498.   #--------------------------------------------------------------------------
  499.   # ● 描绘 HP
  500.   #     actor : 角色
  501.   #     x     : 描画目标 X 坐标
  502.   #     y     : 描画目标 Y 坐标
  503.   #     width : 描画目标的宽
  504.   #--------------------------------------------------------------------------
  505.   def draw_actor_hp_lvup(actor, x, y)
  506.     self.contents.font.color = system_color
  507.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  508.     if $temp_hp == 0
  509.       self.contents.font.color = normal_color
  510.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  511.     else
  512.       maxhp = actor.maxhp + $temp_hp
  513.       self.contents.font.color = Color.new(255, 128, 128, 255)
  514.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  515.       self.contents.font.color = normal_color      
  516.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  517.       if $temp_hp >=0
  518.         self.contents.font.color = Color.new(255, 128, 128, 255)
  519.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  520.       else
  521.         self.contents.font.color = Color.new(255,255,0,255)
  522.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  523.       end
  524.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  525.       self.contents.font.color = normal_color
  526.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  527.     end
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● 描绘 SP
  531.   #     actor : 角色
  532.   #     x     : 描画目标 X 坐标
  533.   #     y     : 描画目标 Y 坐标
  534.   #     width : 描画目标的宽
  535.   #--------------------------------------------------------------------------
  536.   def draw_actor_sp_lvup(actor, x, y)
  537.     self.contents.font.color = system_color
  538.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  539.     if $temp_sp == 0
  540.       self.contents.font.color = normal_color
  541.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  542.     else
  543.       maxsp = actor.maxsp + $temp_sp
  544.       self.contents.font.color = Color.new(255, 128, 128, 255)
  545.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  546.       self.contents.font.color = normal_color      
  547.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  548.       if $temp_sp >=0
  549.         self.contents.font.color = Color.new(255, 128, 128, 255)
  550.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  551.       else
  552.         self.contents.font.color = Color.new(255,255,0,255)
  553.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  554.       end
  555.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  556.       self.contents.font.color = normal_color
  557.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  558.     end
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # ● 描绘能力值
  562.   #     actor : 角色
  563.   #     x     : 描画目标 X 坐标
  564.   #     y     : 描画目标 Y 坐标
  565.   #     type  : 能力值种类 (0~4)
  566.   #--------------------------------------------------------------------------
  567.   def draw_actor_lvup(actor, x, y, type)   
  568.     # 定义数字颜色
  569.     lvup = normal_color
  570.     upcolor = Color.new(255, 128, 128, 255)
  571.     self.contents.font.color = normal_color   
  572.     case type
  573.     when 0
  574.       parameter_name = $data_system.words.str
  575.       parameter_value = actor.str
  576.       parameter_value_temp = parameter_value + $temp_str
  577.       if $temp_str != 0
  578.         lvup = upcolor
  579.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  580.         if $temp_str >= 0
  581.           self.contents.font.color = lvup
  582.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  583.         else
  584.           self.contents.font.color = Color.new(255,255,0,255)
  585.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  586.         end        
  587.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  588.         self.contents.font.color = normal_color
  589.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  590.       end
  591.     when 1
  592.       parameter_name = $data_system.words.dex
  593.       parameter_value = actor.dex
  594.       parameter_value_temp = parameter_value + $temp_dex
  595.       if $temp_dex != 0
  596.         lvup = upcolor
  597.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  598.         if $temp_dex >= 0
  599.           self.contents.font.color = lvup
  600.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  601.         else
  602.           self.contents.font.color = Color.new(255,255,0,255)
  603.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  604.         end        
  605.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  606.         self.contents.font.color = normal_color
  607.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  608.       end
  609.     when 2
  610.       parameter_name = $data_system.words.agi
  611.       parameter_value = actor.agi
  612.       parameter_value_temp = parameter_value + $temp_agi
  613.       if $temp_agi != 0
  614.         lvup = upcolor
  615.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  616.         if $temp_agi >= 0
  617.           self.contents.font.color = lvup
  618.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  619.         else
  620.           self.contents.font.color = Color.new(255,255,0,255)
  621.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  622.         end        
  623.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  624.         self.contents.font.color = normal_color
  625.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  626.       end
  627.     when 3
  628.       parameter_name = $data_system.words.int
  629.       parameter_value = actor.int
  630.       parameter_value_temp = parameter_value + $temp_int
  631.       if $temp_int != 0
  632.         lvup = upcolor
  633.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  634.         if $temp_int >= 0
  635.           self.contents.font.color = lvup
  636.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  637.         else
  638.           self.contents.font.color = Color.new(255,255,0,255)
  639.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  640.         end        
  641.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  642.         self.contents.font.color = normal_color
  643.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  644.       end
  645.     when 4
  646.       parameter_name = "剩余点数"
  647.       parameter_value = $point
  648.       if $point != 0
  649.         lvup = upcolor
  650.       end
  651.     end   
  652.     self.contents.font.color = system_color
  653.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  654.     self.contents.font.color = normal_color
  655.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  656.     if type != 4
  657.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  658.     end  
  659.     self.contents.font.color = lvup
  660.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  661.     self.contents.font.color = normal_color        
  662.   end
  663. end
  664. #==============================================================================
  665. # ■ Window_lvup
  666. #------------------------------------------------------------------------------
  667. #  显示升级状态窗口。
  668. #==============================================================================
  669. class Window_Lvup < Window_Base
  670.   #--------------------------------------------------------------------------
  671.   # ● 初始化对像
  672.   #     actor : 角色
  673.   #--------------------------------------------------------------------------
  674.   def initialize(actor)
  675.     super(0, 0, 512, 320)
  676.     self.contents = Bitmap.new(width - 32, height - 32)
  677.     @actor = actor
  678.     refresh
  679.   end  
  680.   #--------------------------------------------------------------------------
  681.   # ● 刷新
  682.   #--------------------------------------------------------------------------
  683.   def refresh
  684.     self.contents.clear
  685.     draw_actor_graphic(@actor, 40, 112)
  686.     draw_actor_name(@actor, 4, 0)
  687.     draw_actor_class(@actor, 4 + 144, 0)
  688.     draw_actor_level(@actor, 96, 32)
  689.     draw_actor_state(@actor, 96, 64)   
  690.     draw_actor_hp_lvup(@actor, 96+128, 32)
  691.     draw_actor_sp_lvup(@actor, 96+128, 64)
  692.     draw_actor_lvup(@actor, 96, 128, 0)
  693.     draw_actor_lvup(@actor, 96, 160, 1)
  694.     draw_actor_lvup(@actor, 96, 192, 2)
  695.     draw_actor_lvup(@actor, 96, 224, 3)
  696.     draw_actor_lvup(@actor, 96, 256, 4)
  697.   end
  698. end
  699. #==============================================================================
  700. # ■ Window_Help
  701. #------------------------------------------------------------------------------
  702. #  特技及物品的说明、角色的状态显示的窗口。
  703. #==============================================================================
  704. class Window_Lvup_Help < Window_Base
  705.   #--------------------------------------------------------------------------
  706.   # ● 初始化对像
  707.   #--------------------------------------------------------------------------
  708.   def initialize
  709.     super(0, 320, 640, 160)
  710.     self.contents = Bitmap.new(width - 32, height - 32)
  711.     [url=home.php?mod=space&uid=76370]@test[/url] = "" #——这个东西用来检测,节约内存专用
  712.   end  
  713.   #--------------------------------------------------------------------------
  714.   # ● 设置文本
  715.   #--------------------------------------------------------------------------
  716.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  717.     if [url=home.php?mod=space&uid=76370]@test[/url] != text1
  718.       @test = text1
  719.     else
  720.       return
  721.     end   
  722.     self.contents.clear
  723.     self.contents.font.color = normal_color
  724.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  725.     if text2 != nil
  726.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  727.     end
  728.     self.contents.font.size -= 4
  729.     if text3 != nil
  730.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  731.     end
  732.     if text4 != nil
  733.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  734.     end
  735.     self.contents.font.size += 4
  736.   end
  737. end
  738. #==============================================================================
  739. # ■ Scene_lvup
  740. #------------------------------------------------------------------------------
  741. #  处理升级画面的类。
  742. #==============================================================================
  743. class Scene_Lvup
  744.   #--------------------------------------------------------------------------
  745.   # ● 初始化对像
  746.   #     actor_index : 角色索引
  747.   #     menu_index : 选项起始位置
  748.   #--------------------------------------------------------------------------
  749.   def initialize(actor_index = 0 , menu_index = 0)
  750.     @actor_index = actor_index
  751.     @menu_index = menu_index
  752.   end
  753.   #--------------------------------------------------------------------------
  754.   # ● 主处理
  755.   #--------------------------------------------------------------------------
  756.   def main
  757.     s1 = "增加体力 HP SP"
  758.     s2 = "增加"+$data_system.words.str
  759.     s3 = "增加"+$data_system.words.dex
  760.     s4 = "增加"+$data_system.words.agi
  761.     s5 = "增加"+$data_system.words.int
  762.     s6 = "确认加点"
  763.     s7 = "点数重置"
  764.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  765.     @command_window.index = @menu_index
  766.     # 获取角色
  767.     @actor = $game_party.actors[@actor_index]
  768.     # 将角色的剩余点数带入
  769.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  770.     # 初始化临时量
  771.     $temp_str = 0
  772.     $temp_dex = 0
  773.     $temp_agi = 0
  774.     $temp_int = 0
  775.     $temp_hp = 0
  776.     $temp_sp = 0
  777.     #=========================================================================
  778.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  779.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  780.     #=========================================================================
  781.     # 每提升一次力量,提升多少附加能力
  782.     #=========================================================================
  783.     @str_hp = 5     # 每提升一次力量附加提升多少HP
  784.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  785.     @str_dex = 1    # 每提升一次力量附加提升多少灵巧
  786.     @str_agi = 1    # 每提升一次力量附加提升多少速度
  787.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  788.     @str_str = 3    # 每提升一次力量附加提升多少力量
  789.     #=========================================================================
  790.     # 每提升一次灵巧,提升多少附加能力
  791.     #=========================================================================
  792.     @dex_hp = 2     # 每提升一次灵巧附加提升多少HP
  793.     @dex_sp = 3     # 每提升一次灵巧附加提升多少SP
  794.     @dex_str = 1    # 每提升一次灵巧附加提升多少力量
  795.     @dex_agi = 1    # 每提升一次灵巧附加提升多少速度
  796.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  797.     @dex_dex = 3    # 每提升一次灵巧附加提升多少灵巧
  798.     #=========================================================================
  799.     # 每提升一次速度,提升多少附加能力
  800.     #=========================================================================
  801.     @agi_hp = 0     # 每提升一次速度附加提升多少HP
  802.     @agi_sp = 0     # 每提升一次速度附加提升多少SP
  803.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  804.     @agi_dex = 1    # 每提升一次速度附加提升多少灵巧
  805.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  806.     @agi_agi = 3    # 每提升一次速度附加提升多少速度
  807.     #=========================================================================
  808.     # 每提升一次魔力,提升多少附加能力
  809.     #=========================================================================
  810.     @int_hp = 1     # 每提升一次魔力附加提升多少HP
  811.     @int_sp = 15    # 每提升一次魔力附加提升多少SP
  812.     @int_str = -1   # 每提升一次魔力附加提升多少力量
  813.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  814.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  815.     @int_int = 7   # 每提升一次魔力附加提升多少魔力
  816.     #=========================================================================
  817.     # 每提升一次体力,提升多少附加能力
  818.     #=========================================================================
  819.     @hp = 20       # 每提升一次体力提升多少HP
  820.     @sp = 10       # 每提升一次体力提升多少SP
  821.     @hp_str = 0   # 每提升一次体力提升多少力量
  822.     @hp_dex = 0   # 每提升一次体力提升多少速度
  823.     @hp_agi = 0   # 每提升一次体力提升多少灵巧
  824.     @hp_int = -1   # 每提升一次体力提升多少魔力   
  825.     # 定义说明文字
  826.     @text_hp_sc = "体力可以增加生存的能力,增加HP与SP的最大上限!"
  827.     @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
  828.     @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和防御系数!"
  829.     @text_agi_sc = $data_system.words.agi + "可以提高行动速度、逃跑成功率!"
  830.     @text_int_sc = $data_system.words.int + "可以提高魔法攻击的效果!"
  831.     @text_save = "保存分配情况并返回游戏"
  832.     @text_reset= "重新分配能力点数"
  833.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  834.     @text_hp = "最大" + $data_system.words.hp + "值"
  835.     @text_sp = "最大" + $data_system.words.sp + "值"
  836.     @text_str = "最大" + $data_system.words.str + "值"
  837.     @text_dex = "最大" + $data_system.words.dex + "值"
  838.     @text_agi = "最大" + $data_system.words.agi + "值"
  839.     @text_int = "最大" + $data_system.words.int + "值"
  840.     s_disable
  841.     # 生成状态窗口
  842.     @lvup_window = Window_Lvup.new(@actor)
  843.     @lvup_window.x = 128
  844.     @lvup_window.y = 0   
  845.     # 生成帮助窗口并初始化帮助文本
  846.     @help_window = Window_Lvup_Help.new   
  847.     # 执行过渡
  848.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  849.     # 主循环
  850.     loop do
  851.       # 刷新游戏画面
  852.       Graphics.update
  853.       # 刷新输入信息
  854.       Input.update
  855.       # 刷新画面
  856.       update
  857.       # 如果切换画面就中断循环
  858.       if $scene != self
  859.         break
  860.       end
  861.     end
  862.     # 准备过渡
  863.     Graphics.freeze
  864.     # 释放窗口
  865.     @command_window.dispose
  866.     @lvup_window.dispose
  867.     @help_window.dispose
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # ● 刷新画面
  871.   #--------------------------------------------------------------------------
  872.   def update
  873.     # 刷新窗口
  874.     @command_window.update
  875.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  876.     s_disable
  877.     @lvup_window.update
  878.     #=============================================================
  879.     # 按下 B 键的情况下
  880.     #=============================================================
  881.     if Input.trigger?(Input::B)
  882.       # 演奏取消 SE
  883.       $game_system.se_play($data_system.cancel_se)
  884.       # 切换到地图画面
  885.       $scene = Scene_Menu.new
  886.       return
  887.     end
  888.     #=============================================================
  889.     # 按下 C 键的情况下
  890.     #=============================================================
  891.     if Input.trigger?(Input::C)      
  892.       if @command_window.index == 5
  893.           # 演奏确定 SE
  894.         $game_system.se_play($data_system.decision_se)
  895.         # 将角色的剩余点数带回
  896.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  897.         # 将角色点数实际加上
  898.         @actor.str += $temp_str
  899.         @actor.dex += $temp_dex
  900.         @actor.agi += $temp_agi
  901.         @actor.int += $temp_int
  902.         @actor.maxhp += $temp_hp
  903.         @actor.maxsp += $temp_sp
  904.         # 切换到地图画面
  905.         $scene = Scene_Menu.new
  906.         return
  907.       end
  908.       if @command_window.index == 6
  909.           # 演奏确定 SE
  910.         $game_system.se_play($data_system.cancel_se)
  911.           # 将角色的剩余点数带入
  912.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  913.           # 初始化临时量
  914.         $temp_str = 0
  915.         $temp_dex = 0
  916.         $temp_agi = 0
  917.         $temp_int = 0
  918.         $temp_hp = 0
  919.         $temp_sp = 0
  920.         @lvup_window.refresh
  921.         return
  922.       end
  923.       if $point == 0
  924.         # 演奏冻结 SE
  925.         $game_system.se_play($data_system.buzzer_se)
  926.         return
  927.       end
  928.       case @command_window.index
  929.       when 0
  930.         # 演奏确定 SE
  931.         $game_system.se_play($data_system.decision_se)
  932.         $temp_hp += @hp
  933.         $temp_sp += @sp
  934.         $temp_str += @hp_str
  935.         $temp_dex += @hp_dex
  936.         $temp_agi += @hp_agi
  937.         $temp_int += @hp_int
  938.         $point -= 1
  939.         @lvup_window.refresh
  940.         s_disable
  941.         return
  942.       when 1
  943.         # 演奏确定 SE
  944.         $game_system.se_play($data_system.decision_se)
  945.         $temp_str += @str_str
  946.         $temp_hp += @str_hp
  947.         $temp_sp += @str_sp
  948.         $temp_dex += @str_dex
  949.         $temp_agi += @str_agi
  950.         $temp_int += @str_int
  951.         $point -= 1
  952.         @lvup_window.refresh
  953.         s_disable
  954.         return
  955.       when 2
  956.         # 演奏确定 SE
  957.         $game_system.se_play($data_system.decision_se)
  958.         $temp_dex += @dex_dex
  959.         $temp_hp += @dex_hp
  960.         $temp_sp += @dex_sp
  961.         $temp_str += @dex_str
  962.         $temp_agi += @dex_agi
  963.         $temp_int += @dex_int
  964.         $point -= 1
  965.         @lvup_window.refresh
  966.         s_disable
  967.         return
  968.       when 3
  969.         # 演奏确定 SE
  970.         $game_system.se_play($data_system.decision_se)
  971.         $temp_agi += @agi_agi
  972.         $temp_hp += @agi_hp
  973.         $temp_sp += @agi_sp
  974.         $temp_str += @agi_str
  975.         $temp_dex += @agi_dex
  976.         $temp_int += @agi_int
  977.         $point -= 1
  978.         @lvup_window.refresh
  979.         s_disable
  980.         return
  981.       when 4
  982.         # 演奏确定 SE
  983.         $game_system.se_play($data_system.decision_se)
  984.         $temp_int += @int_int
  985.         $temp_hp += @int_hp
  986.         $temp_sp += @int_sp
  987.         $temp_str += @int_str
  988.         $temp_dex += @int_dex
  989.         $temp_agi += @int_agi
  990.         $point -= 1
  991.         @lvup_window.refresh
  992.         s_disable
  993.         return
  994.       end
  995.     end
  996.     #=============================================================
  997.     # 什么都没有按下的情况
  998.     #=============================================================
  999.     case @command_window.index   
  1000.     when 0  # 增加体力
  1001.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
  1002.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
  1003.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  1004.     when 1  # 增加力量
  1005.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  1006.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  1007.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  1008.     when 2  # 增加灵巧
  1009.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  1010.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  1011.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  1012.     when 3  # 增加速度
  1013.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  1014.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  1015.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  1016.     when 4  # 增加魔力
  1017.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  1018.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  1019.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  1020.     when 5 # 保存设定
  1021.       @help_window.lvup_text(@text_save)
  1022.     when 6 # 点数重置
  1023.       @help_window.lvup_text(@text_reset)     
  1024.     end
  1025.     #=============================================================
  1026.     # 按下R与L换人的情况
  1027.     #=============================================================      
  1028.     if Input.trigger?(Input::R)
  1029.       # 演奏光标 SE
  1030.       $game_system.se_play($data_system.cursor_se)
  1031.       # 移至下一位角色
  1032.       @actor_index += 1
  1033.       @actor_index %= $game_party.actors.size
  1034.       # 切换到别的状态画面
  1035.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1036.       return
  1037.     end
  1038.     # 按下 L 键的情况下
  1039.     if Input.trigger?(Input::L)
  1040.       # 演奏光标 SE
  1041.       $game_system.se_play($data_system.cursor_se)
  1042.       # 移至上一位角色
  1043.       @actor_index += $game_party.actors.size - 1
  1044.       @actor_index %= $game_party.actors.size
  1045.       # 切换到别的状态画面
  1046.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  1047.       return
  1048.     end
  1049.   end  
  1050.   #--------------------------------------------------------------------------
  1051.   # ● 选项明暗判断
  1052.   #--------------------------------------------------------------------------
  1053.   def s_disable
  1054.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  1055.     if $point == 0
  1056.       @command_window.disable_item(0)
  1057.       @command_window.disable_item(1)
  1058.       @command_window.disable_item(2)
  1059.       @command_window.disable_item(3)
  1060.       @command_window.disable_item(4)
  1061.     else
  1062.       @command_window.able_item(0)
  1063.       @command_window.able_item(1)      
  1064.       @command_window.able_item(2)
  1065.       @command_window.able_item(3)
  1066.       @command_window.able_item(4)
  1067.     end
  1068.   end
  1069. end
  1070.  
  1071. #==============================================================================
  1072. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1073. #==============================================================================
  1074.  
  1075. #==============================================================================
  1076. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1077. #==============================================================================




  
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
帖子
10
3
 楼主| 发表于 2014-12-27 23:01:18 | 只看该作者
本帖最后由 RyanBern 于 2014-12-28 09:32 编辑

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



RUBY 代码复制
  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. #==============================================================================
  509. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  510. #======================================================================
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

梦石
0
星屑
9532
在线时间
5073 小时
注册时间
2013-6-21
帖子
3580

开拓者贵宾剧作品鉴家

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

使用道具 举报

Lv1.梦旅人

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

弄好了,可以用,谢谢,谢谢( ゚∀゚)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 19:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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