查看: 1901|回复: 2

[已经解决] 请问如何暂时清除1号角色的任务?

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

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

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

×
游戏里有两条线的主角,
想请教一下各位大
一号线主角时候用 1号线主角的任务,清空2号线主角的任务
二号线主角时用 2号角色的任务,清空1号主角的任务

途中 变更1号角色时,在载入1号角色的任务,清空2号角色的任务 这种效果肿么做呀?
类似于两个背包的那种赶脚。  谢谢各位大。

用的任务脚本是下面这个
  1. =begin
  2. --------------------------------------------------------------------------
  3. 详尽任务显示界面 v2.1
  4. --------------------------------------------------------------------------
  5. By 叶子

  6. 日期与更新
  7. 3-29-2006 -v1.0
  8. 4-3-2006  -v2.0
  9. -可以改变文字颜色,显示变量,显示图标,显示图片
  10. -大幅简化了编写任务内容的过程,加入自动换行功能
  11. -精简了窗口,使其还可以用作图鉴系统、日记系统等等
  12. 4-6-2006  -v2.1
  13. -增加了获得全部任务与删除全部任务命令
  14. -改正通假字,修改了示例任务3
  15. --------------------------------------------------------------------------
  16. 顾名思义,就是显示任务资料的界面
  17. 任务资料要预先在这里设定好
  18. 下载范例工程,能帮助你更快更好地掌握使用方法
  19. --------------------------------------------------------------------------
  20. 使用方法:

  21. 1、召唤任务显示界面:$scene = Scene_Task.new

  22. 可以在事件中的“脚本”指令加入这段东西,又或者修改 Scene_Menu 来增加一个显示
  23. 任务的选项。如果是修改 Scene_Menu 增加选项的话,在脚本倒数第30行左右,
  24. 把 $scene = Scene_Map.new 修改成 $scene = Scene_Menu.new(任务界面index)

  25. 2、设置任务资料

  26.   2.1、相关内容解析
  27.   
  28.   所有内容文字必须用双引号括住
  29.   
  30.   名称:任务的名字(显示在左边窗口中),大小为208×32,如果全部为文字的话,
  31.         够放九个全角字符
  32.         
  33.   简介:任务的介绍(显示在右边窗口中),宽368,高不限
  34.   
  35.         文字可以自动换行
  36.   
  37.    2.1.1、控制码解析
  38.    
  39.    名称和内容均可用控制码,注意两条反斜线都要打!
  40.    
  41.    \\v[n] 显示n号变量
  42.    \\c[n] 改变字体颜色。
  43.           n=1~7 时同“显示文章”的\c[n],n=8 时为半透明色,n=9 时为系统色(青色)
  44.    \\n 显示i号角色名字
  45.    \\i[文件名] 显示图标
  46.    \\p[文件名] 显示图片
  47.    
  48.    2.1.2、高级:内嵌表达式
  49.         
  50.    请参考帮助-脚本入门-字符串-内嵌表达式相关内容。
  51.    它可以用来在任务的名称和简介那里显示变量。
  52.    常用的表达式(注意不要漏了井号和大括号):
  53.    #{$game_variables[n]}       ——插入n号变量的值
  54.    #{$game_party.item_number(n)}  ——插入持有n号物品数量
  55.                                       同理还有weapon_number,armor_number
  56.    还可以预先定义一个变量,再插入(例子见示例任务3-灵魂线)
  57.    
  58.   2.2、注意事项
  59.   
  60.    2.2.1、括号、逗号和双引号 [ ] , " 必须使用半角符号(英文输入),
  61.           引号内的内容则没有关系
  62.          
  63.    2.2.2、单引号 ' 和双引号 " 的区别:
  64.           为了不出错误,全部用双引号吧!当然如果你对Ruby很熟悉,那就没所谓了
  65.   
  66.   2.3、开始设置吧!
  67.   从107行开始设置任务资料,可以参考示例任务来设置,请仔细阅读附加讲解
  68.   
  69. 3、接受任务

  70. 事件里的“脚本”指令输入:get_task(任务ID)
  71. 例如 get_task(1) 就是接受1号任务

  72.   3.1、获得全部任务
  73.   
  74.   事件里的“脚本”指令输入:get_all_task
  75.   这个功能基本上是用来在编写好所有任务资料后测试排版的
  76.   

  77. 4、完成/删除任务

  78. 事件里的“脚本”指令输入:finish_task(任务ID)
  79. 例如 finish_task(1) 就是完成1号任务

  80. 注意:本脚本不负责完成任务后的奖励之类的东西,请自行在事件中判断,
  81.        这里的完成任务指的是从任务列表中删去此任务

  82.   4.1、删除全部任务
  83.   
  84.   事件里的“脚本”指令输入:finish_all_task
  85.   作为获得全部任务的对应功能存在,似乎不会怎么用到
  86. =end

  87. class Scene_Task
  88.   # 这里设置任务内容翻页音效
  89.   CHANGE_PAGE_SE = "Audio/SE/046-Book01"
  90. end

  91. class Game_Party
  92.   #--------------------------------------------------------------------------
  93.   # ● 设置任务资料
  94.   #--------------------------------------------------------------------------
  95.   def get_tasks_info
  96.     @tasks_info = []
  97. #-----------------------------
  98.     名称 = "\\c[0]hha"
  99.     #----
  100.     目标 = "
  101. hahhahahahahahahhaha"
  102. @tasks_info[9998] = Game_Task.new(名称, 目标)

  103. #-----------------------------
  104.   end
  105. end  
  106. #==============================================================================
  107. # ■ Interpreter
  108. #------------------------------------------------------------------------------
  109. #  执行事件命令的解释器。本类在 Game_System 类
  110. # 与 Game_Event 类的内部使用。
  111. #==============================================================================

  112. class Interpreter
  113.   #--------------------------------------------------------------------------
  114.   # ● 接受任务
  115.   #--------------------------------------------------------------------------
  116.   def get_task(id)
  117.     task = $game_party.tasks_info[id]
  118.     return true if (task.nil? or $game_party.current_tasks.include?(task.id))
  119.     $game_party.current_tasks.unshift(task.id)
  120.     return true
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 获得全部任务
  124.   #--------------------------------------------------------------------------
  125.   def get_all_task
  126.     # 清空当前任务
  127.     $game_party.current_tasks.clear
  128.     for task in $game_party.tasks_info
  129.       next if task.nil?
  130.       $game_party.current_tasks.unshift(task.id)
  131.     end
  132.     return true
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● 完成/放弃任务
  136.   #--------------------------------------------------------------------------
  137.   def finish_task(id)
  138.     task = $game_party.tasks_info[id]
  139.     return true if task.nil?
  140.     $game_party.current_tasks.delete(task.id)
  141.     return true
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● 删除全部任务
  145.   #--------------------------------------------------------------------------
  146.   def finish_all_task
  147.     $game_party.current_tasks.clear
  148.     return true
  149.   end
  150. end

  151. #==============================================================================
  152. # ■ Game_Party
  153. #------------------------------------------------------------------------------
  154. #  处理同伴的类。包含金钱以及物品的信息。本类的实例
  155. # 请参考 $game_party。
  156. #==============================================================================

  157. class Game_Party
  158.   #--------------------------------------------------------------------------
  159.   # ● 定义实例变量
  160.   #--------------------------------------------------------------------------
  161.   attr_writer     :latest_task                  # 上次查看的任务
  162.   #--------------------------------------------------------------------------
  163.   # ● 取得任务资料
  164.   #--------------------------------------------------------------------------
  165.   def tasks_info
  166.     if @tasks_info.nil?
  167.       get_tasks_info
  168.     end
  169.     return @tasks_info
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 取得当前任务
  173.   #--------------------------------------------------------------------------
  174.   def current_tasks
  175.     if @current_tasks.nil?
  176.       @current_tasks = []
  177.     end
  178.     return @current_tasks
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 上次查看的任务
  182.   #--------------------------------------------------------------------------
  183.   def latest_task
  184.     if !current_tasks.include?(@latest_task)
  185.       @latest_task = current_tasks[0]
  186.     end
  187.     return @latest_task
  188.   end
  189. end

  190. #==============================================================================
  191. # ■ Game_Task
  192. #------------------------------------------------------------------------------
  193. #  处理任务的类。包含任务的信息。
  194. #==============================================================================

  195. class Game_Task
  196.   attr_accessor   :name                   # 名称
  197.   attr_accessor   :briefing               # 简介
  198.   def initialize(name, briefing)
  199.     @name = name
  200.     @briefing = briefing
  201.   end
  202.   def height
  203.     text = @briefing.clone
  204.     x = 0
  205.     y = 64
  206.     min_y = 0
  207.     # 限制文字处理
  208.     begin
  209.       last_text = text.clone
  210.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  211.     end until text == last_text
  212.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  213.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  214.     end
  215.     # 为了方便、将 "\\\" 变换为 "\000"
  216.     text.gsub!(/\\\\/) { "\000" }
  217.     # "\C" 变为 "\001"
  218.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  219.     # "\I" 变为 "\002"
  220.     text.gsub!(/\\[Ii]/) { "\002" }
  221.     # "\P" 变为 "\003"
  222.     text.gsub!(/\\[Pp]/) { "\003" }
  223.     # c 获取 1 个字 (如果不能取得文字就循环)
  224.     while ((c = text.slice!(/./m)) != nil)
  225.       # \\ 的情况下
  226.       if c == "\000"
  227.         # 还原为本来的文字
  228.         c = "\"
  229.       end
  230.       # \C[n] 的情况下
  231.       if c == "\001"
  232.         # 更改文字色
  233.         text.sub!(/\[([0-9]+)\]/, "")
  234.         # 下面的文字
  235.         next
  236.       end
  237.       # 图标的情况下
  238.       if c == "\002"
  239.         icon_name = ''
  240.         while ((cha = text.slice!(/./m)) != ']')
  241.           next if cha == '['
  242.           icon_name += cha
  243.         end
  244.         icon = RPG::Cache.icon(icon_name)
  245.         if x + icon.width > 368
  246.           x = 0
  247.           y += [32, min_y].max
  248.           min_y = 0
  249.         end
  250.         x += 28
  251.         next
  252.       end
  253.       # 图片的情况下
  254.       if c == "\003"
  255.         pic_name = ''
  256.         while ((cha = text.slice!(/./m)) != ']')
  257.           next if cha == '['
  258.           pic_name += cha
  259.         end
  260.         pic = RPG::Cache.picture(pic_name)
  261.         if x + pic.width > 368
  262.           x = 0
  263.           y += [32, min_y].max
  264.           min_y = 0
  265.         end
  266.         x += pic.width
  267.         min_y = [pic.height, 32].max
  268.         next
  269.       end
  270.       # 另起一行文字的情况下
  271.       if c == "\n"
  272.         y += [32, min_y].max
  273.         min_y = 0
  274.         x = 0
  275.         # 下面的文字
  276.         next
  277.       end
  278.       # 自动换行处理
  279.       if x + 22 > 368
  280.         y += [32, min_y].max
  281.         min_y = 0
  282.         x = 0
  283.       end
  284.       # x 为要描绘文字的加法运算
  285.       x += 22
  286.     end
  287.     return (y + [32, min_y].max)
  288.   end
  289.   def id
  290.     return $game_party.tasks_info.index(self)
  291.   end
  292. end

  293. #==============================================================================
  294. # ■ Window_Task_Name
  295. #------------------------------------------------------------------------------
  296. #  任务名称显示窗口。
  297. #==============================================================================

  298. class Window_Task_Name < Window_Selectable
  299.   #--------------------------------------------------------------------------
  300.   # ● 初始化对像
  301.   #--------------------------------------------------------------------------
  302.   def initialize(tasks)
  303.     super(60, 80, 251, 353)
  304.     self.opacity = 0
  305.     @tasks = []
  306.     for id in tasks
  307.       @tasks.push($game_party.tasks_info[id])
  308.     end
  309.     @item_max = tasks.size
  310.     self.contents = Bitmap.new(
  311.     self.width - 32, @item_max == 0 ? 32 : @item_max * 32)
  312.     refresh
  313.     self.index = 0
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● 刷新
  317.   #--------------------------------------------------------------------------
  318.   def refresh
  319.     self.contents.clear
  320.     if @tasks != []
  321.       for task in @tasks
  322.         draw_item(task)
  323.       end
  324.     else
  325.       draw_blank
  326.     end
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● 描绘项目
  330.   #--------------------------------------------------------------------------
  331.   def draw_item(task)
  332.     text = task.name.clone
  333.     x = 0
  334.     y = @tasks.index(task) * 32
  335.     # 限制文字处理
  336.     begin
  337.       last_text = text.clone
  338.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  339.     end until text == last_text
  340.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  341.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  342.     end
  343.     # 为了方便、将 "\\\" 变换为 "\000"
  344.     text.gsub!(/\\\\/) { "\000" }
  345.     # "\\C" 变为 "\001"
  346.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  347.     # "\I" 变为 "\002"
  348.     text.gsub!(/\\[Ii]/) { "\002" }
  349.     # "\P" 变为 "\003"
  350.     text.gsub!(/\\[Pp]/) { "\003" }
  351.     # c 获取 1 个字 (如果不能取得文字就循环)
  352.     while ((c = text.slice!(/./m)) != nil)
  353.       # \\ 的情况下
  354.       if c == "\000"
  355.         # 还原为本来的文字
  356.         c = "\"
  357.       end
  358.       # \C[n] 的情况下
  359.       if c == "\001"
  360.         # 更改文字色
  361.         text.sub!(/\[([0-9]+)\]/, "")
  362.         color = $1.to_i
  363.         if color >= 0 and color <= 7
  364.           self.contents.font.color = text_color(color)
  365.         elsif color == 8
  366.           self.contents.font.color = disabled_color
  367.         elsif color == 9
  368.           self.contents.font.color = system_color
  369.         end
  370.         # 下面的文字
  371.         next
  372.       end
  373.       # 图标的情况下
  374.       if c == "\002"
  375.         icon_name = ''
  376.         while ((cha = text.slice!(/./m)) != ']')
  377.           next if cha == '['
  378.           icon_name += cha
  379.         end
  380.         icon = RPG::Cache.icon(icon_name)
  381.         if x + icon.width > self.contents.width
  382.           x = 0
  383.           y += [32, min_y].max
  384.           min_y = 0
  385.         end
  386.         self.contents.blt(x + 4, y + 4, icon, Rect.new(0, 0, 24, 24))
  387.         x += 28
  388.         next
  389.       end
  390.       # 图片的情况下
  391.       if c == "\003"
  392.         pic_name = ''
  393.         while ((cha = text.slice!(/./m)) != ']')
  394.           next if cha == '['
  395.           pic_name += cha
  396.         end
  397.         pic = RPG::Cache.picture(pic_name)
  398.         if x + pic.width > self.contents.width
  399.           x = 0
  400.           y += [32, min_y].max
  401.           min_y = 0
  402.         end
  403.         self.contents.blt(x + 4, y, pic, Rect.new(0, 0, pic.width, pic.height))
  404.         x += pic.width
  405.         next
  406.       end
  407.       # 描绘文字
  408.            self.contents.font.size = 20
  409.       self.contents.draw_text(4 + x, y-1, 40, 32, c)
  410.       # x 为要描绘文字的加法运算
  411.       x += self.contents.text_size(c).width
  412.     end
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 描绘空行
  416.   #--------------------------------------------------------------------------
  417.   def draw_blank
  418.     self.contents.font.color = disabled_color
  419.     rect = Rect.new(4, 0, self.contents.width - 8, 32)
  420.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  421.     self.contents.draw_text(rect, '当前没有任何任务')
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 获取任务
  425.   #--------------------------------------------------------------------------
  426.   def task
  427.     return @tasks[self.index]
  428.   end
  429. end
  430.   
  431. #==============================================================================
  432. # ■ Window_Task
  433. #------------------------------------------------------------------------------
  434. #  任务内容显示窗口。
  435. #==============================================================================

  436. class Window_Task < Window_Base
  437.   #--------------------------------------------------------------------------
  438.   # ● 初始化对像
  439.   #--------------------------------------------------------------------------
  440.   def initialize(task_id)
  441.     super(330, 45, 470, 440)
  442.     self.opacity = 0
  443.     refresh(task_id)
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ● 刷新内容
  447.   #--------------------------------------------------------------------------
  448.   def refresh(task_id)
  449.     self.oy = 0
  450.     self.visible = true
  451.     return if task_id.nil?
  452.     task = $game_party.tasks_info[task_id]
  453.     if !task.nil?
  454.       self.contents = Bitmap.new(self.width - 32, task.height)
  455.     else
  456.       self.contents = Bitmap.new(self.width - 32, self.height - 32)
  457.       return
  458.     end
  459.     self.contents.font.color = normal_color
  460.     # 描绘任务内容
  461.     draw_task_info(task)
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # ● 描绘任务内容
  465.   #--------------------------------------------------------------------------
  466. def draw_task_info(task)
  467.     # 记录文字x坐标
  468.     x = 0
  469.     # 记录文字y坐标
  470.     y = 0
  471.     # 记录换行时y坐标最小加值
  472.     min_y = 0
  473.     self.contents.font.color = normal_color
  474.     # 描绘任务简介
  475.     text = task.briefing.clone
  476.     # 限制文字处理
  477.     begin
  478.       last_text = text.clone
  479.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  480.     end until text == last_text
  481.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  482.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  483.     end
  484.     # 为了方便、将 "\\\" 变换为 "\000"
  485.     text.gsub!(/\\\\/) { "\000" }
  486.     # "\C" 变为 "\001"
  487.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  488.     # "\I" 变为 "\002"
  489.     text.gsub!(/\\[Ii]/) { "\002" }
  490.     # "\P" 变为 "\003"
  491.     text.gsub!(/\\[Pp]/) { "\003" }
  492.     # c 获取 1 个字 (如果不能取得文字就循环)
  493.     while ((c = text.slice!(/./m)) != nil)
  494.       # \\ 的情况下
  495.       if c == "\000"
  496.         # 还原为本来的文字
  497.         c = "\"
  498.       end
  499.       # \C[n] 的情况下
  500.       if c == "\001"
  501.         # 更改文字色
  502.         text.sub!(/\[([0-9]+)\]/, "")
  503.         color = $1.to_i
  504.         if color >= 0 and color <= 7
  505.           self.contents.font.color = text_color(color)
  506.         elsif color == 8
  507.           self.contents.font.color = disabled_color
  508.         elsif color == 9
  509.           self.contents.font.color = system_color
  510.         end
  511.         # 下面的文字
  512.         next
  513.       end
  514.       # 图标的情况下
  515.       if c == "\002"
  516.         icon_name = ''
  517.         while ((cha = text.slice!(/./m)) != ']')
  518.           next if cha == '['
  519.           icon_name += cha
  520.         end
  521.         icon = RPG::Cache.icon(icon_name)
  522.         if x + icon.width > self.contents.width
  523.           x = 0
  524.           y += [32, min_y].max
  525.           min_y = 0
  526.         end
  527.         self.contents.blt(x + 4, y + 4, icon, Rect.new(0, 0, 24, 24))
  528.         x += 28
  529.         next
  530.       end
  531.       # 图片的情况下
  532.       if c == "\003"
  533.         pic_name = ''
  534.         while ((cha = text.slice!(/./m)) != ']')
  535.           next if cha == '['
  536.           pic_name += cha
  537.         end
  538.         pic = RPG::Cache.picture(pic_name)
  539.         if x + pic.width > self.contents.width
  540.           x = 0
  541.           y += [24, min_y].max
  542.           min_y = 0
  543.         end
  544.         self.contents.blt(x + 4, y, pic, Rect.new(0, 0, pic.width, pic.height))
  545.         x += pic.width
  546.         min_y = [pic.height, 24].max
  547.         next
  548.       end
  549.       # 另起一行文字的情况下
  550.       if c == "\n"
  551.         y += [24, min_y].max
  552.         min_y = 0
  553.         x = 0
  554.         # 下面的文字
  555.         next
  556.       end
  557.       # 自动换行处理
  558.       if x + self.contents.text_size(c).width > self.contents.width
  559.         y += [24, min_y].max
  560.         min_y = 0
  561.         x = 0
  562.       end
  563.       # 描绘文字
  564.      self.contents.font.size = 18
  565.       self.contents.draw_text(4 + x, y, 40, 32, c)
  566.       # x 为要描绘文字的加法运算
  567.       x += self.contents.text_size(c).width
  568.     end
  569.   end
  570. end

  571. #==============================================================================
  572. # ■ Scene_Task
  573. #------------------------------------------------------------------------------
  574. #  处理任务画面的类。
  575. #==============================================================================

  576. class Scene_Task
  577.   #--------------------------------------------------------------------------
  578.   # ● 主处理
  579.   #--------------------------------------------------------------------------
  580.   def main
  581.     # 刷新任务资料
  582.     $game_party.get_tasks_info
  583.     # 生成任务名称窗口
  584.     @rw = Sprite.new
  585.     @rw.bitmap = Bitmap.new("Graphics/menu/luoben.png")
  586.     @rw1 = Sprite.new
  587.     @task_names_window = Window_Task_Name.new($game_party.current_tasks)
  588.     @task_names_window.active = true
  589.     if $game_party.current_tasks != []
  590.       @task_names_window.index = $game_party.current_tasks.index($game_party.latest_task)
  591.     end
  592.     # 生成任务内容窗口
  593.     @task_info_window = Window_Task.new($game_party.latest_task)
  594.     @task_info_window.active = true
  595.     @task_names_window.windowskin = RPG::Cache.windowskin("2")
  596.     @task_names_window.x = 70
  597.     @task_names_window.y = 100
  598.     # 执行过渡
  599.     Graphics.transition
  600.     # 主循环
  601.     loop do
  602.       # 刷新游戏画面
  603.       Graphics.update
  604.       # 刷新输入信息
  605.       Input.update
  606.       # 刷新画面
  607.       update
  608.       # 如果画面被切换的话就中断循环
  609.       if $scene != self
  610.         break
  611.       end
  612.     end
  613.     # 准备过渡
  614.     Graphics.freeze
  615.     # 释放窗口
  616.     @rw.dispose
  617.     @task_names_window.dispose
  618.     @task_info_window.dispose
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● 刷新画面
  622.   #--------------------------------------------------------------------------
  623.   def update
  624.       if $game_party.latest_task != @task_names_window.task.id
  625.       @task_info_window.refresh(@task_names_window.task.id)
  626.       $game_party.latest_task = @task_names_window.task.id
  627.     end
  628.     # 刷新窗口
  629.     @task_names_window.update
  630.     @task_info_window.update
  631.     update_task_names_window
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ● 刷新任务名称窗口
  635.   #--------------------------------------------------------------------------
  636.   def update_task_names_window
  637.     # 按下 B 键的情况下
  638.     if Input.trigger?(Input::B)
  639.       # 演奏取消 SE
  640.       $game_system.se_play($data_system.cancel_se)
  641.       # 这里设置返回的场景,返回地图是Scene_Map.new,菜单是Scene_Menu.new(任务界面index)
  642.   $scene = Scene_Menu.new(6) #Storm 改
  643.       return
  644.     end
  645.     # 按下 C 键的情况下
  646.     if Input.trigger?(Input::C)
  647.       # 无任务可显示的话
  648.       if @task_names_window.task == nil
  649.         # 演奏冻结 SE
  650.         $game_system.se_play($data_system.buzzer_se)
  651.         return
  652.       end
  653.       # 如果光标没有移动的话,翻页
  654.       if $game_party.latest_task == @task_names_window.task.id
  655.         if @task_info_window.oy + @task_info_window.height - 32 > @task_info_window.contents.height
  656.           @task_info_window.oy = 0
  657.         else
  658.           @task_info_window.oy += 480-32
  659.         end
  660.         if @task_info_window.contents.height > @task_info_window.height - 32
  661.           # 演奏翻页 SE
  662.           Audio.se_play(CHANGE_PAGE_SE)
  663.         end
  664.       else
  665.         @task_info_window.refresh(@task_names_window.task.id)
  666.         $game_party.latest_task = @task_names_window.task.id
  667.         # 演奏确定 SE
  668.         $game_system.se_play($data_system.decision_se)      
  669.         end
  670.       end
  671.     end
  672.   end
复制代码

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-1-9 16:44:01 | 显示全部楼层
本帖最后由 taroxd 于 2015-1-9 16:46 编辑

不熟悉XP的脚本,因此只给个思路,麻烦不要追问。自己理解一下吧。

(不兼容原存档,不可以复制粘贴后直接使用)

  1. class Game_Party

  2.   def current_tasks
  3.     @array_of_cuurent_tasks ||= []
  4.     route = 现在是几号线
  5.     @array_of_cuurent_tasks[route] ||= []
  6.   end
  7. end
复制代码

评分

参与人数 1星屑 +200 收起 理由
hys111111 + 200 感谢回答

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-8-7
回帖
53
 楼主| 发表于 2015-1-9 23:37:51 | 显示全部楼层
好吧,谢谢大…
我是脚本白,除了很基础的一些,完全看不懂 o(╯□╰)o
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部