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

Project1

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

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

[复制链接]

Lv1.梦旅人

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

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

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

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

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

用的任务脚本是下面这个
RUBY 代码复制
  1. =begin
  2. --------------------------------------------------------------------------
  3. 详尽任务显示界面 v2.1
  4. --------------------------------------------------------------------------
  5. By 叶子
  6.  
  7. 日期与更新
  8. 3-29-2006 -v1.0
  9. 4-3-2006  -v2.0
  10. -可以改变文字颜色,显示变量,显示图标,显示图片
  11. -大幅简化了编写任务内容的过程,加入自动换行功能
  12. -精简了窗口,使其还可以用作图鉴系统、日记系统等等
  13. 4-6-2006  -v2.1
  14. -增加了获得全部任务与删除全部任务命令
  15. -改正通假字,修改了示例任务3
  16. --------------------------------------------------------------------------
  17. 顾名思义,就是显示任务资料的界面
  18. 任务资料要预先在这里设定好
  19. 下载范例工程,能帮助你更快更好地掌握使用方法
  20. --------------------------------------------------------------------------
  21. 使用方法:
  22.  
  23. 1、召唤任务显示界面:$scene = Scene_Task.new
  24.  
  25. 可以在事件中的“脚本”指令加入这段东西,又或者修改 Scene_Menu 来增加一个显示
  26. 任务的选项。如果是修改 Scene_Menu 增加选项的话,在脚本倒数第30行左右,
  27. 把 $scene = Scene_Map.new 修改成 $scene = Scene_Menu.new(任务界面index)
  28.  
  29. 2、设置任务资料
  30.  
  31.   2.1、相关内容解析
  32.  
  33.   所有内容文字必须用双引号括住
  34.  
  35.   名称:任务的名字(显示在左边窗口中),大小为208×32,如果全部为文字的话,
  36.         够放九个全角字符
  37.        
  38.   简介:任务的介绍(显示在右边窗口中),宽368,高不限
  39.  
  40.         文字可以自动换行
  41.  
  42.    2.1.1、控制码解析
  43.    
  44.    名称和内容均可用控制码,注意两条反斜线都要打!
  45.    
  46.    \\v[n] 显示n号变量
  47.    \\c[n] 改变字体颜色。
  48.           n=1~7 时同“显示文章”的\c[n],n=8 时为半透明色,n=9 时为系统色(青色)
  49.    \\n 显示i号角色名字
  50.    \\i[文件名] 显示图标
  51.    \\p[文件名] 显示图片
  52.    
  53.    2.1.2、高级:内嵌表达式
  54.        
  55.    请参考帮助-脚本入门-字符串-内嵌表达式相关内容。
  56.    它可以用来在任务的名称和简介那里显示变量。
  57.    常用的表达式(注意不要漏了井号和大括号):
  58.    #{$game_variables[n]}       ——插入n号变量的值
  59.    #{$game_party.item_number(n)}  ——插入持有n号物品数量
  60.                                       同理还有weapon_number,armor_number
  61.    还可以预先定义一个变量,再插入(例子见示例任务3-灵魂线)
  62.    
  63.   2.2、注意事项
  64.  
  65.    2.2.1、括号、逗号和双引号 [ ] , " 必须使用半角符号(英文输入),
  66.           引号内的内容则没有关系
  67.           
  68.    2.2.2、单引号 ' 和双引号 " 的区别:
  69.           为了不出错误,全部用双引号吧!当然如果你对Ruby很熟悉,那就没所谓了
  70.  
  71.   2.3、开始设置吧!
  72.   从107行开始设置任务资料,可以参考示例任务来设置,请仔细阅读附加讲解
  73.  
  74. 3、接受任务
  75.  
  76. 事件里的“脚本”指令输入:get_task(任务ID)
  77. 例如 get_task(1) 就是接受1号任务
  78.  
  79.   3.1、获得全部任务
  80.  
  81.   事件里的“脚本”指令输入:get_all_task
  82.   这个功能基本上是用来在编写好所有任务资料后测试排版的
  83.  
  84.  
  85. 4、完成/删除任务
  86.  
  87. 事件里的“脚本”指令输入:finish_task(任务ID)
  88. 例如 finish_task(1) 就是完成1号任务
  89.  
  90. 注意:本脚本不负责完成任务后的奖励之类的东西,请自行在事件中判断,
  91.        这里的完成任务指的是从任务列表中删去此任务
  92.  
  93.   4.1、删除全部任务
  94.  
  95.   事件里的“脚本”指令输入:finish_all_task
  96.   作为获得全部任务的对应功能存在,似乎不会怎么用到
  97. =end
  98.  
  99. class Scene_Task
  100.   # 这里设置任务内容翻页音效
  101.   CHANGE_PAGE_SE = "Audio/SE/046-Book01"
  102. end
  103.  
  104. class Game_Party
  105.   #--------------------------------------------------------------------------
  106.   # ● 设置任务资料
  107.   #--------------------------------------------------------------------------
  108.   def get_tasks_info
  109.     @tasks_info = []
  110. #-----------------------------
  111.     名称 = "\\c[0]hha"
  112.     #----
  113.     目标 = "
  114. hahhahahahahahahhaha"
  115. @tasks_info[9998] = Game_Task.new(名称, 目标)
  116.  
  117. #-----------------------------
  118.   end
  119. end  
  120. #==============================================================================
  121. # ■ Interpreter
  122. #------------------------------------------------------------------------------
  123. #  执行事件命令的解释器。本类在 Game_System 类
  124. # 与 Game_Event 类的内部使用。
  125. #==============================================================================
  126.  
  127. class Interpreter
  128.   #--------------------------------------------------------------------------
  129.   # ● 接受任务
  130.   #--------------------------------------------------------------------------
  131.   def get_task(id)
  132.     task = $game_party.tasks_info[id]
  133.     return true if (task.nil? or $game_party.current_tasks.include?(task.id))
  134.     $game_party.current_tasks.unshift(task.id)
  135.     return true
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● 获得全部任务
  139.   #--------------------------------------------------------------------------
  140.   def get_all_task
  141.     # 清空当前任务
  142.     $game_party.current_tasks.clear
  143.     for task in $game_party.tasks_info
  144.       next if task.nil?
  145.       $game_party.current_tasks.unshift(task.id)
  146.     end
  147.     return true
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ● 完成/放弃任务
  151.   #--------------------------------------------------------------------------
  152.   def finish_task(id)
  153.     task = $game_party.tasks_info[id]
  154.     return true if task.nil?
  155.     $game_party.current_tasks.delete(task.id)
  156.     return true
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 删除全部任务
  160.   #--------------------------------------------------------------------------
  161.   def finish_all_task
  162.     $game_party.current_tasks.clear
  163.     return true
  164.   end
  165. end
  166.  
  167. #==============================================================================
  168. # ■ Game_Party
  169. #------------------------------------------------------------------------------
  170. #  处理同伴的类。包含金钱以及物品的信息。本类的实例
  171. # 请参考 $game_party。
  172. #==============================================================================
  173.  
  174. class Game_Party
  175.   #--------------------------------------------------------------------------
  176.   # ● 定义实例变量
  177.   #--------------------------------------------------------------------------
  178.   attr_writer     :latest_task                  # 上次查看的任务
  179.   #--------------------------------------------------------------------------
  180.   # ● 取得任务资料
  181.   #--------------------------------------------------------------------------
  182.   def tasks_info
  183.     if @tasks_info.nil?
  184.       get_tasks_info
  185.     end
  186.     return @tasks_info
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 取得当前任务
  190.   #--------------------------------------------------------------------------
  191.   def current_tasks
  192.     if @current_tasks.nil?
  193.       @current_tasks = []
  194.     end
  195.     return @current_tasks
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● 上次查看的任务
  199.   #--------------------------------------------------------------------------
  200.   def latest_task
  201.     if !current_tasks.include?(@latest_task)
  202.       @latest_task = current_tasks[0]
  203.     end
  204.     return @latest_task
  205.   end
  206. end
  207.  
  208. #==============================================================================
  209. # ■ Game_Task
  210. #------------------------------------------------------------------------------
  211. #  处理任务的类。包含任务的信息。
  212. #==============================================================================
  213.  
  214. class Game_Task
  215.   attr_accessor   :name                   # 名称
  216.   attr_accessor   :briefing               # 简介
  217.   def initialize(name, briefing)
  218.     @name = name
  219.     @briefing = briefing
  220.   end
  221.   def height
  222.     text = @briefing.clone
  223.     x = 0
  224.     y = 64
  225.     min_y = 0
  226.     # 限制文字处理
  227.     begin
  228.       last_text = text.clone
  229.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  230.     end until text == last_text
  231.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  232.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  233.     end
  234.     # 为了方便、将 "\\\\" 变换为 "\000"
  235.     text.gsub!(/\\\\/) { "\000" }
  236.     # "\C" 变为 "\001"
  237.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  238.     # "\I" 变为 "\002"
  239.     text.gsub!(/\\[Ii]/) { "\002" }
  240.     # "\P" 变为 "\003"
  241.     text.gsub!(/\\[Pp]/) { "\003" }
  242.     # c 获取 1 个字 (如果不能取得文字就循环)
  243.     while ((c = text.slice!(/./m)) != nil)
  244.       # \\ 的情况下
  245.       if c == "\000"
  246.         # 还原为本来的文字
  247.         c = "\\"
  248.       end
  249.       # \C[n] 的情况下
  250.       if c == "\001"
  251.         # 更改文字色
  252.         text.sub!(/\[([0-9]+)\]/, "")
  253.         # 下面的文字
  254.         next
  255.       end
  256.       # 图标的情况下
  257.       if c == "\002"
  258.         icon_name = ''
  259.         while ((cha = text.slice!(/./m)) != ']')
  260.           next if cha == '['
  261.           icon_name += cha
  262.         end
  263.         icon = RPG::Cache.icon(icon_name)
  264.         if x + icon.width > 368
  265.           x = 0
  266.           y += [32, min_y].max
  267.           min_y = 0
  268.         end
  269.         x += 28
  270.         next
  271.       end
  272.       # 图片的情况下
  273.       if c == "\003"
  274.         pic_name = ''
  275.         while ((cha = text.slice!(/./m)) != ']')
  276.           next if cha == '['
  277.           pic_name += cha
  278.         end
  279.         pic = RPG::Cache.picture(pic_name)
  280.         if x + pic.width > 368
  281.           x = 0
  282.           y += [32, min_y].max
  283.           min_y = 0
  284.         end
  285.         x += pic.width
  286.         min_y = [pic.height, 32].max
  287.         next
  288.       end
  289.       # 另起一行文字的情况下
  290.       if c == "\n"
  291.         y += [32, min_y].max
  292.         min_y = 0
  293.         x = 0
  294.         # 下面的文字
  295.         next
  296.       end
  297.       # 自动换行处理
  298.       if x + 22 > 368
  299.         y += [32, min_y].max
  300.         min_y = 0
  301.         x = 0
  302.       end
  303.       # x 为要描绘文字的加法运算
  304.       x += 22
  305.     end
  306.     return (y + [32, min_y].max)
  307.   end
  308.   def id
  309.     return $game_party.tasks_info.index(self)
  310.   end
  311. end
  312.  
  313. #==============================================================================
  314. # ■ Window_Task_Name
  315. #------------------------------------------------------------------------------
  316. #  任务名称显示窗口。
  317. #==============================================================================
  318.  
  319. class Window_Task_Name < Window_Selectable
  320.   #--------------------------------------------------------------------------
  321.   # ● 初始化对像
  322.   #--------------------------------------------------------------------------
  323.   def initialize(tasks)
  324.     super(60, 80, 251, 353)
  325.     self.opacity = 0
  326.     @tasks = []
  327.     for id in tasks
  328.       @tasks.push($game_party.tasks_info[id])
  329.     end
  330.     @item_max = tasks.size
  331.     self.contents = Bitmap.new(
  332.     self.width - 32, @item_max == 0 ? 32 : @item_max * 32)
  333.     refresh
  334.     self.index = 0
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● 刷新
  338.   #--------------------------------------------------------------------------
  339.   def refresh
  340.     self.contents.clear
  341.     if @tasks != []
  342.       for task in @tasks
  343.         draw_item(task)
  344.       end
  345.     else
  346.       draw_blank
  347.     end
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● 描绘项目
  351.   #--------------------------------------------------------------------------
  352.   def draw_item(task)
  353.     text = task.name.clone
  354.     x = 0
  355.     y = @tasks.index(task) * 32
  356.     # 限制文字处理
  357.     begin
  358.       last_text = text.clone
  359.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  360.     end until text == last_text
  361.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  362.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  363.     end
  364.     # 为了方便、将 "\\\\" 变换为 "\000"
  365.     text.gsub!(/\\\\/) { "\000" }
  366.     # "\\C" 变为 "\001"
  367.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  368.     # "\I" 变为 "\002"
  369.     text.gsub!(/\\[Ii]/) { "\002" }
  370.     # "\P" 变为 "\003"
  371.     text.gsub!(/\\[Pp]/) { "\003" }
  372.     # c 获取 1 个字 (如果不能取得文字就循环)
  373.     while ((c = text.slice!(/./m)) != nil)
  374.       # \\ 的情况下
  375.       if c == "\000"
  376.         # 还原为本来的文字
  377.         c = "\\"
  378.       end
  379.       # \C[n] 的情况下
  380.       if c == "\001"
  381.         # 更改文字色
  382.         text.sub!(/\[([0-9]+)\]/, "")
  383.         color = $1.to_i
  384.         if color >= 0 and color <= 7
  385.           self.contents.font.color = text_color(color)
  386.         elsif color == 8
  387.           self.contents.font.color = disabled_color
  388.         elsif color == 9
  389.           self.contents.font.color = system_color
  390.         end
  391.         # 下面的文字
  392.         next
  393.       end
  394.       # 图标的情况下
  395.       if c == "\002"
  396.         icon_name = ''
  397.         while ((cha = text.slice!(/./m)) != ']')
  398.           next if cha == '['
  399.           icon_name += cha
  400.         end
  401.         icon = RPG::Cache.icon(icon_name)
  402.         if x + icon.width > self.contents.width
  403.           x = 0
  404.           y += [32, min_y].max
  405.           min_y = 0
  406.         end
  407.         self.contents.blt(x + 4, y + 4, icon, Rect.new(0, 0, 24, 24))
  408.         x += 28
  409.         next
  410.       end
  411.       # 图片的情况下
  412.       if c == "\003"
  413.         pic_name = ''
  414.         while ((cha = text.slice!(/./m)) != ']')
  415.           next if cha == '['
  416.           pic_name += cha
  417.         end
  418.         pic = RPG::Cache.picture(pic_name)
  419.         if x + pic.width > self.contents.width
  420.           x = 0
  421.           y += [32, min_y].max
  422.           min_y = 0
  423.         end
  424.         self.contents.blt(x + 4, y, pic, Rect.new(0, 0, pic.width, pic.height))
  425.         x += pic.width
  426.         next
  427.       end
  428.       # 描绘文字
  429.            self.contents.font.size = 20
  430.       self.contents.draw_text(4 + x, y-1, 40, 32, c)
  431.       # x 为要描绘文字的加法运算
  432.       x += self.contents.text_size(c).width
  433.     end
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ● 描绘空行
  437.   #--------------------------------------------------------------------------
  438.   def draw_blank
  439.     self.contents.font.color = disabled_color
  440.     rect = Rect.new(4, 0, self.contents.width - 8, 32)
  441.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  442.     self.contents.draw_text(rect, '当前没有任何任务')
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● 获取任务
  446.   #--------------------------------------------------------------------------
  447.   def task
  448.     return @tasks[self.index]
  449.   end
  450. end
  451.  
  452. #==============================================================================
  453. # ■ Window_Task
  454. #------------------------------------------------------------------------------
  455. #  任务内容显示窗口。
  456. #==============================================================================
  457.  
  458. class Window_Task < Window_Base
  459.   #--------------------------------------------------------------------------
  460.   # ● 初始化对像
  461.   #--------------------------------------------------------------------------
  462.   def initialize(task_id)
  463.     super(330, 45, 470, 440)
  464.     self.opacity = 0
  465.     refresh(task_id)
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # ● 刷新内容
  469.   #--------------------------------------------------------------------------
  470.   def refresh(task_id)
  471.     self.oy = 0
  472.     self.visible = true
  473.     return if task_id.nil?
  474.     task = $game_party.tasks_info[task_id]
  475.     if !task.nil?
  476.       self.contents = Bitmap.new(self.width - 32, task.height)
  477.     else
  478.       self.contents = Bitmap.new(self.width - 32, self.height - 32)
  479.       return
  480.     end
  481.     self.contents.font.color = normal_color
  482.     # 描绘任务内容
  483.     draw_task_info(task)
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● 描绘任务内容
  487.   #--------------------------------------------------------------------------
  488. def draw_task_info(task)
  489.     # 记录文字x坐标
  490.     x = 0
  491.     # 记录文字y坐标
  492.     y = 0
  493.     # 记录换行时y坐标最小加值
  494.     min_y = 0
  495.     self.contents.font.color = normal_color
  496.     # 描绘任务简介
  497.     text = task.briefing.clone
  498.     # 限制文字处理
  499.     begin
  500.       last_text = text.clone
  501.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  502.     end until text == last_text
  503.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  504.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  505.     end
  506.     # 为了方便、将 "\\\\" 变换为 "\000"
  507.     text.gsub!(/\\\\/) { "\000" }
  508.     # "\C" 变为 "\001"
  509.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  510.     # "\I" 变为 "\002"
  511.     text.gsub!(/\\[Ii]/) { "\002" }
  512.     # "\P" 变为 "\003"
  513.     text.gsub!(/\\[Pp]/) { "\003" }
  514.     # c 获取 1 个字 (如果不能取得文字就循环)
  515.     while ((c = text.slice!(/./m)) != nil)
  516.       # \\ 的情况下
  517.       if c == "\000"
  518.         # 还原为本来的文字
  519.         c = "\\"
  520.       end
  521.       # \C[n] 的情况下
  522.       if c == "\001"
  523.         # 更改文字色
  524.         text.sub!(/\[([0-9]+)\]/, "")
  525.         color = $1.to_i
  526.         if color >= 0 and color <= 7
  527.           self.contents.font.color = text_color(color)
  528.         elsif color == 8
  529.           self.contents.font.color = disabled_color
  530.         elsif color == 9
  531.           self.contents.font.color = system_color
  532.         end
  533.         # 下面的文字
  534.         next
  535.       end
  536.       # 图标的情况下
  537.       if c == "\002"
  538.         icon_name = ''
  539.         while ((cha = text.slice!(/./m)) != ']')
  540.           next if cha == '['
  541.           icon_name += cha
  542.         end
  543.         icon = RPG::Cache.icon(icon_name)
  544.         if x + icon.width > self.contents.width
  545.           x = 0
  546.           y += [32, min_y].max
  547.           min_y = 0
  548.         end
  549.         self.contents.blt(x + 4, y + 4, icon, Rect.new(0, 0, 24, 24))
  550.         x += 28
  551.         next
  552.       end
  553.       # 图片的情况下
  554.       if c == "\003"
  555.         pic_name = ''
  556.         while ((cha = text.slice!(/./m)) != ']')
  557.           next if cha == '['
  558.           pic_name += cha
  559.         end
  560.         pic = RPG::Cache.picture(pic_name)
  561.         if x + pic.width > self.contents.width
  562.           x = 0
  563.           y += [24, min_y].max
  564.           min_y = 0
  565.         end
  566.         self.contents.blt(x + 4, y, pic, Rect.new(0, 0, pic.width, pic.height))
  567.         x += pic.width
  568.         min_y = [pic.height, 24].max
  569.         next
  570.       end
  571.       # 另起一行文字的情况下
  572.       if c == "\n"
  573.         y += [24, min_y].max
  574.         min_y = 0
  575.         x = 0
  576.         # 下面的文字
  577.         next
  578.       end
  579.       # 自动换行处理
  580.       if x + self.contents.text_size(c).width > self.contents.width
  581.         y += [24, min_y].max
  582.         min_y = 0
  583.         x = 0
  584.       end
  585.       # 描绘文字
  586.      self.contents.font.size = 18
  587.       self.contents.draw_text(4 + x, y, 40, 32, c)
  588.       # x 为要描绘文字的加法运算
  589.       x += self.contents.text_size(c).width
  590.     end
  591.   end
  592. end
  593.  
  594. #==============================================================================
  595. # ■ Scene_Task
  596. #------------------------------------------------------------------------------
  597. #  处理任务画面的类。
  598. #==============================================================================
  599.  
  600. class Scene_Task
  601.   #--------------------------------------------------------------------------
  602.   # ● 主处理
  603.   #--------------------------------------------------------------------------
  604.   def main
  605.     # 刷新任务资料
  606.     $game_party.get_tasks_info
  607.     # 生成任务名称窗口
  608.     @rw = Sprite.new
  609.     @rw.bitmap = Bitmap.new("Graphics/menu/luoben.png")
  610.     @rw1 = Sprite.new
  611.     @task_names_window = Window_Task_Name.new($game_party.current_tasks)
  612.     @task_names_window.active = true
  613.     if $game_party.current_tasks != []
  614.       @task_names_window.index = $game_party.current_tasks.index($game_party.latest_task)
  615.     end
  616.     # 生成任务内容窗口
  617.     @task_info_window = Window_Task.new($game_party.latest_task)
  618.     @task_info_window.active = true
  619.     @task_names_window.windowskin = RPG::Cache.windowskin("2")
  620.     @task_names_window.x = 70
  621.     @task_names_window.y = 100
  622.     # 执行过渡
  623.     Graphics.transition
  624.     # 主循环
  625.     loop do
  626.       # 刷新游戏画面
  627.       Graphics.update
  628.       # 刷新输入信息
  629.       Input.update
  630.       # 刷新画面
  631.       update
  632.       # 如果画面被切换的话就中断循环
  633.       if $scene != self
  634.         break
  635.       end
  636.     end
  637.     # 准备过渡
  638.     Graphics.freeze
  639.     # 释放窗口
  640.     @rw.dispose
  641.     @task_names_window.dispose
  642.     @task_info_window.dispose
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 刷新画面
  646.   #--------------------------------------------------------------------------
  647.   def update
  648.       if $game_party.latest_task != @task_names_window.task.id
  649.       @task_info_window.refresh(@task_names_window.task.id)
  650.       $game_party.latest_task = @task_names_window.task.id
  651.     end
  652.     # 刷新窗口
  653.     @task_names_window.update
  654.     @task_info_window.update
  655.     update_task_names_window
  656.   end
  657.   #--------------------------------------------------------------------------
  658.   # ● 刷新任务名称窗口
  659.   #--------------------------------------------------------------------------
  660.   def update_task_names_window
  661.     # 按下 B 键的情况下
  662.     if Input.trigger?(Input::B)
  663.       # 演奏取消 SE
  664.       $game_system.se_play($data_system.cancel_se)
  665.       # 这里设置返回的场景,返回地图是Scene_Map.new,菜单是Scene_Menu.new(任务界面index)
  666.   $scene = Scene_Menu.new(6) #Storm 改
  667.       return
  668.     end
  669.     # 按下 C 键的情况下
  670.     if Input.trigger?(Input::C)
  671.       # 无任务可显示的话
  672.       if @task_names_window.task == nil
  673.         # 演奏冻结 SE
  674.         $game_system.se_play($data_system.buzzer_se)
  675.         return
  676.       end
  677.       # 如果光标没有移动的话,翻页
  678.       if $game_party.latest_task == @task_names_window.task.id
  679.         if @task_info_window.oy + @task_info_window.height - 32 > @task_info_window.contents.height
  680.           @task_info_window.oy = 0
  681.         else
  682.           @task_info_window.oy += 480-32
  683.         end
  684.         if @task_info_window.contents.height > @task_info_window.height - 32
  685.           # 演奏翻页 SE
  686.           Audio.se_play(CHANGE_PAGE_SE)
  687.         end
  688.       else
  689.         @task_info_window.refresh(@task_names_window.task.id)
  690.         $game_party.latest_task = @task_names_window.task.id
  691.         # 演奏确定 SE
  692.         $game_system.se_play($data_system.decision_se)      
  693.         end
  694.       end
  695.     end
  696.   end

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2015-1-9 16:44:01 | 只看该作者
本帖最后由 taroxd 于 2015-1-9 16:46 编辑

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

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

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

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 13:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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