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

Project1

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

[已经过期] 每次呼出任务脚本都会出现这样的错误

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
25 小时
注册时间
2015-3-15
帖子
12
跳转到指定楼层
1
发表于 2015-10-24 14:14:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 忆丶我的思念 于 2015-10-24 15:03 编辑


求解啊 引用任务系统之类的系统的时候都会出现这样的错误。
任何任务系统都出现这样的错误,无法呼出任务界面
包括数字君的任务系统
  1. #==============================================================================
  2. # ** 任务系统VA版 V1.0
  3. #------------------------------------------------------------------------------
  4. #    此系统中包含的脚本:
  5. #        System(module)
  6. #        Vocab(module)
  7. #        Game_Task
  8. #        Game_Map
  9. #        Game_Party
  10. #        Window_Base
  11. #        Window_TaskList
  12. #        Window_TaskData
  13. #        Window_YON
  14. #        Scene_Task
  15. #        Scene_Map
  16. #------------------------------------------------------------------------------
  17. # 使用说明
  18. #     一.召唤任务清单场景
  19. #        SceneManager.call(Scene_Task)
  20. #     二.接受任务
  21. #        $game_party.accept_task(任务id)
  22. #     三.完成任务
  23. #        $game_party.complete_task(任务id)
  24. #     四.任务失败(不删除)
  25. #        $game_party.fail_task(任务id)
  26. #     五.放弃(删除)任务
  27. #        $game_party.abandonment_task(任务id)
  28. #            还有个更直接的就是:
  29. #        $game_party.delete_task(任务id)
  30. #            默认的效果都一样,但是$game_party.abandonment_task有判定是否接受了要放
  31. #        弃的任务,而$game_party.delete_task没有,所以为了安全起见,请使用$game_party
  32. #        .abandonment_task.
  33. #     六.改变任务状态
  34. #        $game_party.change_task_status(任务id, 状态id)
  35. #            此方法只会改变任务的status变数,并不会造成该任务其他改变.
  36. #        状态id对应表
  37. #        0-未接受    1-已接受    2-完成      3-放弃      4-失败
  38. #     七.获取当前任务状态
  39. #        $game_party.task[任务id].status
  40. #        返回的数字的含义:
  41. #        0-未接受    1-已接受    2-完成      3-放弃      4-失败
  42. #     八.判断是否接受任务
  43. #        $game_party.accepted_task?(任务id)
  44. #            已接受返回true,未接受返回false.
  45. #     九.显示任务提示栏
  46. #        $game_map.show_task_tip(任务id, 提示类型)
  47. #        提示类型对应表:
  48. #        0 - 接受任务时的提示
  49. #        1 - 完成任务时的提示
  50. #        2 - 放弃任务时的提示
  51. #        3 - 任务失败时的提示
  52. #------------------------------------------------------------------------------

  53. module System
  54. #==============================================================================
  55. #--------------------------------任务设置--------------------------------------
  56. #==============================================================================
  57. #--数量------------------------------------------------------------------------
  58.   # 描绘任务资料时,线条的宽度
  59.   Task_Filament_Width = 2
  60.   # 任务进度槽的高度
  61.   Task_Gauge_Height = 10
  62.   # 任务进度槽边框的宽度
  63.   Task_Gauge_Out_Edge_Width = 1
  64.   # 文字高度
  65.   WLH = 28.8
  66.   # 提示窗口显示时间(帧)
  67.   Show_Tip_Time = 50
  68. #--按键------------------------------------------------------------------------
  69.   # 放弃任务按钮
  70.   Task_Abandonment_Task_Input = Input::C
  71.   # 左翻页按键
  72.   Task_Left_Change_Page = Input::LEFT
  73.   # 右翻页按键
  74.   Task_Right_Change_Page = Input::RIGHT
  75. #--颜色------------------------------------------------------------------------
  76.   # 描绘任务资料时,线条的颜色
  77.   Task_Filament_Color = Color.new(255, 255, 255, 127)
  78.   # 绘制确定放弃任务时疑问的文字色
  79.   Task_Query_Word_Color = Color.new(255, 255, 0)
  80.   # 没有接受的任务名字的颜色
  81.   No_Accept_Task_Color = Color.new(255, 255, 255, 127)
  82.   # 普通的任务名字的颜色
  83.   Task_Color = Color.new(255, 255, 255)
  84.   # 已经完成的任务名字的颜色
  85.   Task_Complete_Color = Color.new(255, 255, 255)
  86.   # 已经放弃的任务名字的颜色
  87.   Task_Abandonment_Color = Color.new(255, 255, 255, 127)
  88.   # 已经失败的任务名字的颜色
  89.   Task_Fail_Color = Color.new(255, 255, 255, 127)
  90.   # 提示没有任务时,显示的文字的颜色
  91.   Task_Nil_Color = Color.new(255, 255, 255, 127)
  92.   # 任务进度槽两边的颜色
  93.   Task_Gauge_Edge_Color = Color.new(0, 0, 255)
  94.   # 任务进度槽中间的颜色
  95.   Task_Gauge_Central_Color = Color.new(255, 255, 255)
  96.   # 任务进度槽外边框的颜色
  97.   Task_Gauge_Out_Edge_Color = Color.new(255, 255, 255)
  98.   # 任务进度槽阴影的颜色
  99.   Task_Gauge_Shadow_Color = Color.new(0, 0, 0, 127)
  100. #--图标------------------------------------------------------------------------
  101.   # 金钱的图标id
  102.   Task_Gold_Icon = 205
  103.   # 在没接受的任务名字前描绘图标(若不想描绘请写0)
  104.   No_Accept_Task_Icon = 98
  105.   # 在普通的任务名字前描绘图标(若不想描绘请写0)
  106.   Task_Icon = 102
  107.   # 在完成的任务名字前描绘图标(若不想描绘请写0)
  108.   Task_Complete_Icon = 101
  109.   # 在放弃的任务名字前描绘图标(若不想描绘请写0)
  110.   Task_Abandonment_Icon = 103
  111.   # 在失败的任务名字前描绘图标(若不想描绘请写0)
  112.   Task_Fail_Icon = 99
  113. #--文件名----------------------------------------------------------------------
  114.   # 在任务资料窗口下面的提示栏的图片文件名
  115.   Page_Tip = "Graphics/System/PageTip"
  116. #--任务资料--------------------------------------------------------------------
  117.   Task = []
  118.   Task[0] = { # 任务id
  119.   "Icon" => 406, # 图标id
  120.   "Name" => "遗失的手风琴",# 任务名称
  121.   "Title Help" => "委托人:音乐家", # 任务简短说明
  122.   "Caption" => "   村庄里有一个伟大的音乐家,应邀去参加一个音乐会,但是他的手风琴不见了,你能帮他找找吗?",
  123.   "Reward" => {"Item" => [[1, 1]],           # 完成任务后奖励的物品
  124.                "Weapon" => [[1, 1], [2, 1]],         # 完成任务后奖励的武器
  125.                "Armor" => [[1, 1], [2,1]],          # 完成任务后奖励的防具
  126.                "Gold" => 0,            # 完成任务后奖励的金钱
  127.                "Level_Plus" => [[0,5],[1,5]],     # 完成任务后奖励的等级
  128.                "Exp_Plus" => [[0, 5], [2, 5]]        # 完成任务后奖励的经验
  129.                },
  130.   "Can Abandonment?" => true, # 可否放弃此任务
  131.   "Level" => 3,  # 任务等级
  132.   "Max Complete Value" => 10, # 任务最大完成度
  133.   }
  134. #--方法------------------------------------------------------------------------
  135.   #----------------------------------------------------------------------------
  136.   # * 判断是否描绘任务图标
  137.   #----------------------------------------------------------------------------
  138.   def self.draw_task_icon?
  139.     if Task_Icon == 0 and Task_Complete_Icon == 0 and Task_Abandonment_Icon == 0 and Task_Fail_Icon == 0
  140.       return false
  141.     else return true
  142.     end
  143.   end
  144. end

  145. module Vocab
  146. #============================================================================
  147. #---------------------------任务用语设置-------------------------------------
  148. #============================================================================
  149. #--提示语句------------------------------------------------------------------
  150.   Task_Accept = "接受了任务:"
  151.   Task_Complete = "完成任务:"
  152.   Task_Abandonment = "放弃任务:"
  153.   Task_Fail = "任务失败:"
  154.   Task_Nil = "暂时没有任务"
  155. #--警告语句------------------------------------------------------------------
  156.   Task_Can_Not_Abandonment = "无法放弃任务[%s]"
  157.   Task_No_Accept = "你还没接受任务[%s]!"
  158. #--询问语句------------------------------------------------------------------
  159.   Task_Adandonment_Query = "你确定要放弃[%s]这个任务吗?"
  160. #--词语----------------------------------------------------------------------
  161.   Task_Difficulty = "任务难度:"
  162.   Task_Level_Word = ["简单", "容易", "中等", "困难"]
  163.   Task_Can_Abandonment_Word = ["可放弃", "不可放弃"]
  164.   Task_Status_Word = ["未接受", "已接受", "完成", "放弃", "失败"]
  165.   Task_Value = "进度"
  166. end

  167. #==============================================================================
  168. # ** Game_Task
  169. #------------------------------------------------------------------------------
  170. #   处理任务资料的类。
  171. #==============================================================================
  172. class Game_Task
  173.   #----------------------------------------------------------------------------
  174.   # * 定义实例变量
  175.   #----------------------------------------------------------------------------
  176.   attr_reader   :id
  177.   attr_reader   :task
  178.   attr_reader   :icon
  179.   attr_reader   :name
  180.   attr_reader   :title_help
  181.   attr_reader   :caption
  182.   attr_reader   :level
  183.   attr_reader   :max_complete_value
  184.   attr_reader   :status
  185.   attr_reader   :complete_value
  186.   #----------------------------------------------------------------------------
  187.   # * 初始化
  188.   #----------------------------------------------------------------------------
  189.   def initialize(id)
  190.     @id = id
  191.     @task = System::Task[@id]
  192.     @icon = @task["Icon"]
  193.     @name = @task["Name"]
  194.     @title_help = @task["Title Help"]
  195.     @caption = @task["Caption"]
  196.     @level = @task["Level"]
  197.     @reward = @task["Reward"]
  198.     @max_complete_value = @task["Max Complete Value"]
  199.     @status = 0
  200.     @complete_value = 0
  201.   end
  202.   #----------------------------------------------------------------------------
  203.   # * 获取任务奖励
  204.   #----------------------------------------------------------------------------
  205.   def reward(type, index)
  206.     case type
  207.     when -1     # 所有
  208.       return_reward = @reward
  209.     when 0      # 物品
  210.       return_reward = @reward["Item"][index]
  211.     when 1      # 武器
  212.       return_reward = @reward["Weapon"][index]
  213.     when 2      # 防具
  214.       return_reward = @reward["Armor"][index]
  215.     when 3      # 金钱
  216.       return_reward = @reward["Gold"]
  217.     when 4      # 经验
  218.       return_reward = @reward["Exp_Plus"][index]
  219.     when 5      # 等级
  220.       return_reward = @reward["Level_Plus"][index]
  221.     end
  222.     return return_reward
  223.   end
  224.   #----------------------------------------------------------------------------
  225.   # * 获取任务等级描述语
  226.   #----------------------------------------------------------------------------
  227.   def level_word
  228.     return Vocab::Task_Level_Word[@level]
  229.   end
  230.   #----------------------------------------------------------------------------
  231.   # * 获取任务状态描述语
  232.   #----------------------------------------------------------------------------
  233.   def status_word
  234.     return Vocab::Task_Status_Word[@status]
  235.   end
  236.   #----------------------------------------------------------------------------
  237.   # * 判断该任务能否放弃
  238.   #----------------------------------------------------------------------------
  239.   def can_abandonment?
  240.     return @task["Can Abandonment?"]
  241.   end
  242.   #----------------------------------------------------------------------------
  243.   # * 获取任务能否放弃的语句
  244.   #----------------------------------------------------------------------------
  245.   def abandonment_word
  246.     if can_abandonment?
  247.       return Vocab::Task_Can_Abandonment_Word[0]
  248.     else return Vocab::Task_Can_Abandonment_Word[1]
  249.     end
  250.   end
  251.   #---------------------------------------------------------------------------
  252.   # * 改变任务状态
  253.   #---------------------------------------------------------------------------
  254.   def status=(new_s)
  255.     @status = new_s
  256.     @status = 3 if @status > 3
  257.     @status = 0 if @status < 0
  258.   end
  259.   #---------------------------------------------------------------------------
  260.   # * 改变任务完成度
  261.   #---------------------------------------------------------------------------
  262.   def complete_value=(new_v)
  263.     @complete_value = new_v
  264.     @complete_value = @max_complete_value if @complete_value > @max_complete_value
  265.     @complete_value = 0 if @complete_value < 0
  266.   end
  267. end

  268. #==============================================================================
  269. # ** Game_Map
  270. #------------------------------------------------------------------------------
  271. #  管理地图的类。拥有卷动地图以及判断通行度的功能。
  272. #   本类的实例请参考 $game_map 。
  273. #==============================================================================

  274. class Game_Map
  275.   #----------------------------------------------------------------------------
  276.   # * 定义实例变量
  277.   #----------------------------------------------------------------------------
  278.   attr_reader :tip_visible
  279.   attr_reader :tip_task_id
  280.   attr_reader :tip_type
  281.   #----------------------------------------------------------------------------
  282.   # * 重命名方法
  283.   #----------------------------------------------------------------------------
  284.   alias task_tip_ini initialize
  285.   #----------------------------------------------------------------------------
  286.   # * 初始化
  287.   #----------------------------------------------------------------------------
  288.   def initialize
  289.     task_tip_ini
  290.     @tip_visible = false
  291.     @tip_task_id = 0
  292.     @tip_type = 0
  293.   end
  294.   #----------------------------------------------------------------------------
  295.   # * 显示提示栏
  296.   #----------------------------------------------------------------------------
  297.   def show_task_tip(tip_task_id, tip_type)
  298.     change_tip_visible
  299.     @tip_task_id = tip_task_id
  300.     @tip_type = tip_type
  301.   end
  302.   #----------------------------------------------------------------------------
  303.   # * 改变tip_visible(逆向)
  304.   #----------------------------------------------------------------------------
  305.   def change_tip_visible
  306.     if @tip_visible
  307.       @tip_visible = false
  308.     else @tip_visible = true
  309.     end
  310.   end
  311.   #----------------------------------------------------------------------------
  312.   # * 获取提示栏文字
  313.   #----------------------------------------------------------------------------
  314.   def tip_task_word(tip_type=nil)
  315.     if tip_type == nil
  316.       tip_type = @tip_type
  317.     end
  318.     case tip_type
  319.     when 0
  320.       word = Vocab::Task_Accept
  321.     when 1
  322.       word = Vocab::Task_Complete
  323.     when 2
  324.       word = Vocab::Task_Abandonment
  325.     when 3
  326.       word = Vocab::Task_Fail
  327.     end
  328.     return word
  329.   end
  330. end

  331. #==============================================================================
  332. # ** Game_Party
  333. #------------------------------------------------------------------------------
  334. #  管理队伍的类。保存有金钱及物品的信息。本类的实例请参考 $game_party 。
  335. #==============================================================================

  336. class Game_Party < Game_Unit
  337.   #----------------------------------------------------------------------------
  338.   # * 定义实例变量
  339.   #----------------------------------------------------------------------------
  340.   attr_reader :task
  341.   #----------------------------------------------------------------------------
  342.   # * 重命名方法
  343.   #----------------------------------------------------------------------------
  344.   alias task_ini initialize
  345.   #----------------------------------------------------------------------------
  346.   # * 初始化
  347.   #----------------------------------------------------------------------------
  348.   def initialize
  349.     task_ini
  350.     @task = []
  351.   end
  352.   #----------------------------------------------------------------------------
  353.   # * 判断是否已有该任务
  354.   #----------------------------------------------------------------------------
  355.   def accepted_task?(task_id)
  356.     if @task[task_id] != nil
  357.       return true
  358.     else return false
  359.     end
  360.   end
  361.   #----------------------------------------------------------------------------
  362.   # * 改变任务状态
  363.   #----------------------------------------------------------------------------
  364.   def change_task_status(task_id, new_status)
  365.     @task[task_id].status = new_status
  366.   end
  367.   #----------------------------------------------------------------------------
  368.   # * 接受任务
  369.   #----------------------------------------------------------------------------
  370.   def accept_task(task_id)
  371.     return false if accepted_task?(task_id) == true
  372.     @task[task_id] = Game_Task.new(task_id)
  373.     change_task_status(task_id, 1)
  374.   end
  375.   #----------------------------------------------------------------------------
  376.   # * 删除任务
  377.   #----------------------------------------------------------------------------
  378.   def delete_task(task_id)
  379.     @task.delete_at(task_id)
  380.   end
  381.   #----------------------------------------------------------------------------
  382.   # * 放弃任务
  383.   #----------------------------------------------------------------------------
  384.   def abandonment_task(task_id)
  385.     return false if accepted_task?(task_id) == false
  386.     delete_task(task_id)
  387.   end
  388.   #----------------------------------------------------------------------------
  389.   # * 任务失败
  390.   #----------------------------------------------------------------------------
  391.   def fail_task(task_id)
  392.     return false if accepted_task?(task_id) == false
  393.     change_task_status(task_id, 4)
  394.   end
  395.   #----------------------------------------------------------------------------
  396.   # * 任务完成
  397.   #----------------------------------------------------------------------------
  398.   def complete_task(task_id)
  399.     return false if accepted_task?(task_id) == false
  400.     task = @task[task_id]
  401.     reward = task.reward(-1, 0)
  402.     change_task_status(task_id, 2)
  403.     # 奖励物品
  404.     for i in 0...reward["Item"].size
  405.       $game_party.gain_item($data_items[task.reward(0, i)[0]], task.reward(0, i)[1])
  406.     end
  407.     # 奖励武器
  408.     for i in 0...reward["Weapon"].size
  409.       $game_party.gain_item($data_weapons[task.reward(1, i)[0]], task.reward(1, i)[1])
  410.     end
  411.     # 奖励防具
  412.     for i in 0...reward["Armor"].size
  413.       $game_party.gain_item($data_armors[task.reward(2, i)[0]], task.reward(2, i)[1])
  414.     end
  415.     # 奖励金钱
  416.     gain_gold(task.reward(3, 0))
  417.     # 增加等级
  418.     for i in 0...reward["Level_Plus"].size
  419.       $game_party.members[task.reward(5, i)[0]].change_level(task.reward(5, i)[1], true)
  420.     end
  421.     # 增加经验
  422.     for i in 0...reward["Exp_Plus"].size
  423.       $game_party.members[task.reward(4, i)[0]].change_exp(task.reward(4, i)[1], true)
  424.     end
  425.     delete_task(task_id)
  426.   end
  427. end

  428. #==============================================================================
  429. # ** Window_Base
  430. #------------------------------------------------------------------------------
  431. #  游戏中所有窗口的父类
  432. #==============================================================================

  433. class Window_Base < Window
  434.   #----------------------------------------------------------------------------
  435.   # * 描绘直线 by 945127391
  436.   # begin_x : 直线开始的x坐标
  437.   # begin_y : 直线开始的y坐标
  438.   # end_x   : 直线结束的x坐标
  439.   # end_y   : 直线结束的y坐标
  440.   # color   : 直线的颜色
  441.   # width   : 直线的宽度(厚度)
  442.   #----------------------------------------------------------------------------
  443.    def draw_straight_filament(begin_x, begin_y, end_x, end_y, width, color)
  444.     if begin_x == end_x
  445.       bitmap = Bitmap.new(width, end_y-begin_y)
  446.     elsif begin_y == end_y
  447.       bitmap = Bitmap.new(end_x-begin_x, width)
  448.     else return
  449.     end
  450.     bitmap.fill_rect(0, 0, bitmap.width, bitmap.height, color)
  451.     rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  452.     self.contents.blt(begin_x, begin_y, bitmap, rect)
  453.     bitmap.dispose
  454.   end
  455.   #----------------------------------------------------------------------------
  456.   # * 描绘自动换行文字 by 叶子
  457.   #                    修改 945127391
  458.   #----------------------------------------------------------------------------
  459.    def chenge_special_character(text, x=0, y=0)
  460.     # 记录换行时y坐标最小加值
  461.     min_y = 0
  462.     while ((c = text.slice!(/./m)) != nil)
  463.       # 另起一行文字的情况下
  464.       if c == "\n"
  465.         y += [System::WLH, min_y].max
  466.         min_y = 0
  467.         x = 0
  468.         # 下面的文字
  469.         next
  470.       end
  471.       # 自动换行处理
  472.       if x + self.contents.text_size(c).width > self.contents.width
  473.         y += [System::WLH, min_y].max
  474.         min_y = 0
  475.         x = 0
  476.       end
  477.       # 描绘文字
  478.       self.contents.draw_text(4 + x, y, 40, System::WLH, c)
  479.       # x 为要描绘文字的加法运算
  480.       x += self.contents.text_size(c).width
  481.     end
  482.   end
  483.   #----------------------------------------------------------------------------
  484.   # * 描绘任务进度槽
  485.   #----------------------------------------------------------------------------
  486.   def draw_task_value_gauge(x, y, width, task)
  487.     gh = System::Task_Gauge_Height
  488.     goe = System::Task_Gauge_Out_Edge_Width
  489.     w = width*task.complete_value/task.max_complete_value
  490.     self.contents.fill_rect(x+3, y+3, w, gh+goe*2, System::Task_Gauge_Shadow_Color)
  491.     self.contents.gradient_fill_rect(x+goe, y+goe, w, gh/2, System::Task_Gauge_Edge_Color, System::Task_Gauge_Out_Edge_Color, true)
  492.     self.contents.gradient_fill_rect(x+goe, y+goe+gh/2, w, gh/2, System::Task_Gauge_Out_Edge_Color, System::Task_Gauge_Edge_Color, true)
  493.     draw_straight_filament(x, y, x+width, y, goe, System::Task_Gauge_Out_Edge_Color)
  494.     draw_straight_filament(x, y+gh, x+width, y+gh, goe, System::Task_Gauge_Out_Edge_Color)
  495.     draw_straight_filament(x, y, x, y+gh, goe, System::Task_Gauge_Out_Edge_Color)
  496.     draw_straight_filament(x+width, y, x+width, y+gh, goe, System::Task_Gauge_Out_Edge_Color)
  497.   end
  498. end

  499. #==============================================================================
  500. # ** Window_TaskList
  501. #------------------------------------------------------------------------------
  502. #  把任务的名字、(状态)图标列出来的列表状窗口。
  503. #==============================================================================

  504. class Window_TaskList < Window_Command
  505.   #----------------------------------------------------------------------------
  506.   # * 定义实例变量
  507.   #----------------------------------------------------------------------------
  508.   attr_reader :list
  509.   #----------------------------------------------------------------------------
  510.   # * 初始化
  511.   #----------------------------------------------------------------------------
  512.   def initialize
  513.     super(0, 0)
  514.   end
  515.   def window_width
  516.     return 184
  517.   end
  518.   def window_height
  519.     return 416
  520.   end
  521.   def refresh
  522.     super
  523.     contents.clear
  524.     if $game_party.task.size == 0
  525.       self.contents.font.color = System::Task_Nil_Color
  526.       self.contents.draw_text(0, 0, self.contents.width, System::WLH, Vocab::Task_Nil, 1)
  527.     else
  528.       for i in 0...item_max
  529.         draw_item(i)
  530.       end
  531.     end
  532.   end
  533.   def make_command_list
  534.     @list = []
  535.     return if $game_party.task.size == 0
  536.     for i in 0...$game_party.task.size
  537.       @list.push($game_party.task[i].id)  if $game_party.task[i] != nil
  538.     end
  539.   end
  540.   def draw_item(index)
  541.     task = $game_party.task[@list[index]]
  542.     return if task == nil
  543.     if System.draw_task_icon?
  544.       case task.status
  545.       when 0
  546.         self.contents.font.color = System::Task_Color
  547.         if System::No_Accept_Task_Color.alpha > 127
  548.           enabled = true
  549.         else enabled = false
  550.         end
  551.         draw_icon(System::No_Accept_Task_Icon, 0, index*System::WLH, enabled)
  552.       when 1
  553.         self.contents.font.color = System::Task_Color
  554.         if System::Task_Color.alpha > 127
  555.           enabled = true
  556.         else enabled = false
  557.         end
  558.         draw_icon(System::Task_Icon, 0, index*System::WLH, enabled)
  559.       when 2
  560.         self.contents.font.color = System::Task_Complete_Color
  561.         if System::Task_Complete_Color.alpha > 127
  562.           enabled = true
  563.         else enabled = false
  564.         end
  565.         draw_icon(System::Task_Complete_Icon, 0, index*System::WLH, enabled)
  566.       when 3
  567.         self.contents.font.color = System::Task_Fail_Color
  568.         if System::Task_Fail_Color.alpha > 127
  569.           enabled = true
  570.         else enabled = false
  571.         end
  572.         draw_icon(System::Task_Fail_Icon, 0, index*System::WLH, enabled)
  573.       when 4
  574.         self.contents.font.color = System::Task_Abandonmet_Icon
  575.         if System::Task_Abandonmet_Color.alpha > 127
  576.           enabled = true
  577.         else enabled = false
  578.         end
  579.         draw_icon(System::Task_Abandonment_Icon, 0, index*System::WLH, enabled)
  580.       end
  581.     else
  582.       case task.status
  583.       when 0
  584.         self.contents.font.color = System::No_Accept_Task_Color
  585.         if System::Task_Color.alpha > 127
  586.           enabled = true
  587.         else enabled = false
  588.         end
  589.       when 1
  590.         self.contents.font.color = System::Task_Color
  591.         if System::Task_Color.alpha > 127
  592.           enabled = true
  593.         else enabled = false
  594.         end
  595.       when 2
  596.         self.contents.font.color = System::Task_Complete_Color
  597.         if System::Task_Complete_Color.alpha > 127
  598.           enabled = true
  599.         else enabled = false
  600.         end
  601.       when 3
  602.         self.contents.font.color = System::Task_Fail_Color
  603.         if System::Task_Fail_Color.alpha > 127
  604.           enabled = true
  605.         else enabled = false
  606.         end
  607.       when 4
  608.         self.contents.font.color = System::Task_Abandonmet_Icon
  609.         if System::Task_Abandonmet_Color.alpha > 127
  610.           enabled = true
  611.         else enabled = false
  612.         end
  613.       end
  614.       draw_icon(task.icon, 0, index*System::WLH, enabled)
  615.       enabled = true
  616.     end
  617.     self.contents.draw_text(24, index*System::WLH, self.contents.width, System::WLH, task.name)
  618.     self.contents.font.color = System::Task_Color
  619.   end
  620.   def current_item_enabled?
  621.   end
  622.   def current_symbol
  623.   end
  624.   def current_ext
  625.   end
  626. end

  627. #==============================================================================
  628. # ** Window_TaskData
  629. #------------------------------------------------------------------------------
  630. #  显示任务详细资料的窗口。
  631. #==============================================================================

  632. class Window_TaskData < Window_Base
  633.   #----------------------------------------------------------------------------
  634.   # * 定义实例变量
  635.   #----------------------------------------------------------------------------
  636.   attr_accessor :page
  637.   def initialize(task_id)
  638.     super(184, 0, 360, 416)
  639.     @page = 0
  640.     refresh(task_id)
  641.   end
  642.   def refresh(task_id)
  643.     self.contents.clear
  644.     return if task_id == nil
  645.     task = $game_party.task[task_id]
  646.     w = self.contents.width
  647.     h = self.contents.height
  648.     fw = System::Task_Filament_Width
  649.     fc = System::Task_Filament_Color
  650.     vw = self.contents.text_size(Vocab::Task_Value).width
  651.     if @page == 0
  652.       #------------------------------------------------------------------------
  653.       # * 描绘边框
  654.       #------------------------------------------------------------------------
  655.       #--横线------------------------------------------------------------------
  656.       draw_straight_filament(0, 0, w, 0, fw, fc)
  657.       draw_straight_filament(0, h-fw, w, h-fw, fw, fc)
  658.       draw_straight_filament(fw, fw+System::WLH-1, w-fw, fw+System::WLH-1, fw, fc) # 第一行与第二行的分割线
  659.       draw_straight_filament(fw, fw+System::WLH*2-2, w-fw, fw+System::WLH*2-2, fw, fc) # 第二行与第三行的分割线
  660.       draw_straight_filament(fw, fw+System::WLH*3-3, w-fw, fw+System::WLH*3-3, fw, fc) # 第三行与第四行的分割线
  661.       draw_straight_filament(fw, fw+System::WLH*4-4, w-fw, fw+System::WLH*4-4, fw, fc) # 第四行与说明文的分割线
  662.       #--竖线------------------------------------------------------------------
  663.       draw_straight_filament(0, fw, 0, h-fw, fw, fc)
  664.       draw_straight_filament(w-fw, fw, w-fw, h-fw, fw, fc)
  665.       draw_straight_filament(w/3, fw+System::WLH-1+fw, w/3, fw+System::WLH*2-2, fw, fc) # 第二行第一条竖线(等级-状态)
  666.       draw_straight_filament(w/3*2, fw+System::WLH-1+fw, w/3*2, fw+System::WLH*2-2, fw, fc) # 第二行第二条分割线(状态-可否放弃)
  667.       #------------------------------------------------------------------------
  668.       # * 描绘基本资料
  669.       #------------------------------------------------------------------------
  670.       #--第一行----------------------------------------------------------------
  671.       draw_icon(task.icon, fw+1, fw+1) # 任务图标
  672.       self.contents.draw_text(fw+1+System::WLH, fw+1, w-System::WLH, System::WLH, task.name, 1) # 任务名
  673.       #--第二行----------------------------------------------------------------
  674.       self.contents.draw_text(0, fw+System::WLH+1, w/3, System::WLH, task.level_word, 1) # 任务等级
  675.       self.contents.draw_text(w/3, fw+System::WLH+1, w/3, System::WLH, task.status_word, 1) # 任务状态
  676.       self.contents.draw_text(w/3*2, fw+System::WLH+1, w/3, System::WLH, task.abandonment_word, 1) # 任务可否放弃
  677.       self.contents.draw_text(0, fw*2+System::WLH*2-fw, w, System::WLH, task.title_help, 1) # 任务简短说明
  678.       #--第三行----------------------------------------------------------------
  679.       self.contents.draw_text(fw+1, fw*3+System::WLH*3-fw*2, w, System::WLH, Vocab::Task_Value) # 描绘进度条的名字
  680.       #------------------------------------------------------------------------
  681.       # * 描绘进度条
  682.       #------------------------------------------------------------------------
  683.       y = fw*3+System::WLH*3-3
  684.       y += (System::WLH-1)/2-(System::Task_Gauge_Height+System::Task_Gauge_Out_Edge_Width*2)/2
  685.       draw_task_value_gauge(vw+5, y, w*3-(vw+21+fw), task)
  686.       draw_current_and_max_values(0, fw*3+System::WLH*3-fw*2, w-fw-1, task.complete_value, task.max_complete_value, Color.new(255, 255, 255), Color.new(255, 255, 255)) # 描绘最大值和最小值
  687.       #------------------------------------------------------------------------
  688.       # * 描绘说明文
  689.       #------------------------------------------------------------------------
  690.       chenge_special_character(task.caption.clone, 0, fw+System::WLH*4-2)
  691.     elsif @page == 1
  692.       #------------------------------------------------------------------------
  693.       # * 描绘边框
  694.       #------------------------------------------------------------------------
  695.       #--横线------------------------------------------------------------------
  696.       draw_straight_filament(0, 0, w, 0, fw, fc)
  697.       draw_straight_filament(0, h-fw, w, h-fw, fw, fc)
  698.       draw_straight_filament(fw, fw+23, w-fw, fw+23, fw, fc) # 题目
  699.       #----头像分割线----------------------------------------------------------
  700.       for i in 0...3
  701.         draw_straight_filament(fw, fw+23+(h-fw-23)/4*(i+1), w/4, fw+23+(h-fw-23)/4*(i+1), fw, fc)
  702.         draw_straight_filament(fw+w/4, fw+23+(h-fw-23)/4*(i+1), w/2, fw+23+(h-fw-23)/4*(i+1), fw, fc)
  703.       end
  704.       for i in 0...4
  705.         draw_straight_filament(fw+w/4, fw+23+(h-fw-23)/4*(i+1)-(h-fw-23)/8, w/2, fw+23+(h-fw-23)/4*(i+1)-(h-fw-23)/8, fw, fc)
  706.       end
  707.       #----奖励分割线----------------------------------------------------------
  708.       max = (h-fw-23)/(fw+23)
  709.       for i in 0...max-1
  710.         draw_straight_filament(fw+w/2, fw+23+(h-fw-23)/max*(i+1), w, fw+23+(h-fw-23)/max*(i+1), fw, fc)
  711.       end
  712.       #--竖线------------------------------------------------------------------
  713.       draw_straight_filament(0, fw, 0, h-fw, fw, fc)
  714.       draw_straight_filament(w-fw, fw, w-fw, h-fw, fw, fc)
  715.       draw_straight_filament(w/2, fw*2+23, w/2, h-fw, fw, fc) # 中线
  716.       draw_straight_filament(w/4, fw*2+23, w/4, h-fw, fw, fc) # 头像框
  717.       #------------------------------------------------------------------------
  718.       # * 绘制题目
  719.       #------------------------------------------------------------------------
  720.       self.contents.draw_text(fw, 2, w-fw, System::WLH, "奖励表", 1)
  721.       #------------------------------------------------------------------------
  722.       # * 绘制头像及名字
  723.       #------------------------------------------------------------------------
  724.       for i in 0...$game_party.members.size
  725.         draw_actor_face($game_party.members[i], fw, fw*2+23+(h-fw-23)/4*i)
  726.         draw_actor_name($game_party.members[i], fw, fw*2+23+(h-fw-23)/4*i, w/4-fw)
  727.       end
  728.       #------------------------------------------------------------------------
  729.       # * 绘制物质奖励
  730.       #------------------------------------------------------------------------
  731.       y = fw+23
  732.       #--金钱------------------------------------------------------------------
  733.       draw_icon(System::Task_Gold_Icon, w/2+fw, y)
  734.       self.contents.draw_text(w/2+fw, y+2, w/2-fw*2, System::WLH, task.reward(3, 0), 1)
  735.       #--物品------------------------------------------------------------------
  736.       for i in 0...task.reward(-1, 0)["Item"].size
  737.         y += fw+23+1
  738.         draw_icon($data_items[task.reward(0, i)[0]].icon_index, w/2+fw, y+2)
  739.         text = sprintf("%s * %s", $data_items[task.reward(0, i)[0]].name, task.reward(0, i)[1])
  740.         self.contents.draw_text(w/2+fw+System::WLH, y+2, w/2-fw*2-System::WLH, System::WLH, text, 1)
  741.       end
  742.       #--武器------------------------------------------------------------------
  743.       for i in 0...task.reward(-1, 0)["Weapon"].size
  744.         y += fw+23+1
  745.         draw_icon($data_weapons[task.reward(1, i)[0]].icon_index, w/2+fw, y+2)
  746.         text = sprintf("%s * %s", $data_weapons[task.reward(1, i)[0]].name, task.reward(1, i)[1])
  747.         self.contents.draw_text(w/2+fw+System::WLH, y+2, w/2-fw*2-System::WLH, System::WLH, text, 1)
  748.       end
  749.       #--防具------------------------------------------------------------------
  750.       for i in 0...task.reward(-1, 0)["Armor"].size
  751.         y += fw+23+1
  752.         draw_icon($data_armors[task.reward(1, i)[0]].icon_index, w/2+fw, y+2)
  753.         text = sprintf("%s * %s", $data_armors[task.reward(1, i)[0]].name, task.reward(1, i)[1])
  754.         self.contents.draw_text(w/2+fw+System::WLH, y+2, w/2-fw*2-System::WLH, System::WLH, text, 1)
  755.       end
  756.       #------------------------------------------------------------------------
  757.       # 绘制其他奖励
  758.       #------------------------------------------------------------------------
  759.       exp = [false, false, false, false]
  760.       lv = [false, false, false, false]
  761.       for i in 0...4
  762.         x = w/4+fw
  763.         y = fw+23+(h-fw-23)/4*i
  764.         self.contents.draw_text(x, y, w/4, System::WLH, "经验值:")
  765.         y = fw+23+(h-fw-23)/4*(i+1)-(h-fw-23)/8
  766.         self.contents.draw_text(x, y, w/4, System::WLH, "等级:")
  767.       end
  768.       #--经验值----------------------------------------------------------------
  769.       for i in 0...task.reward(-1, 0)["Exp_Plus"].size
  770.         a = task.reward(4, i)[0]
  771.         y = fw+47+(h-fw-23)/4*a
  772.         self.contents.draw_text(x, y, w/4, System::WLH, task.reward(4, i)[1], 2)
  773.         exp[a] = true
  774.       end
  775.       for i in 0...exp.size
  776.         y = fw+47+(h-fw-23)/4*i
  777.         if exp[i] == false
  778.           self.contents.draw_text(x, y, w/4, System::WLH, 0, 2)
  779.         end
  780.       end
  781.       #--等级----------------------------------------------------------------
  782.       for i in 0...task.reward(-1, 0)["Level_Plus"].size
  783.         a = task.reward(5, i)[0]
  784.         y = fw+47+(h-fw-23)/4*(i+1)-(h-fw-23)/8
  785.         self.contents.draw_text(x, y, w/4, System::WLH, task.reward(5, i)[1], 2)
  786.         lv[a] = true
  787.       end
  788.       for i in 0...exp.size
  789.         y = fw+47+(h-fw-23)/4*(i+1)-(h-fw-23)/8
  790.         if lv[i] == false
  791.           self.contents.draw_text(x, y, w/4, System::WLH, 0, 2)
  792.         end
  793.       end
  794.     end
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● 绘制角色肖像图
  798.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  799.   #--------------------------------------------------------------------------
  800.   def draw_face(face_name, face_index, x, y, enabled = true)
  801.     w = self.contents.width
  802.     h = self.contents.height
  803.     fw = System::Task_Filament_Width
  804.     bitmap = Cache.face(face_name)
  805.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96-(96-w/4)-fw, 96-(96-(h-fw-23)/4)-fw)
  806.     rect.x -= (w/4-96)/2
  807.     rect.y -= ((h-fw-23)/4-96)/2
  808.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  809.     bitmap.dispose
  810.   end
  811. end

  812. #==============================================================================
  813. # ** Window_YON
  814. #------------------------------------------------------------------------------
  815. #    用来选择“是”或“否”的选单。
  816. #==============================================================================

  817. class Window_YON < Window_Command
  818.   def initialize(x, y)
  819.     super(x, y)
  820.   end
  821.   def alignment
  822.     return 1
  823.   end
  824.   def make_command_list
  825.     add_command("确定", :ok)
  826.     add_command("取消", :canael)
  827.   end
  828. end

  829. #==============================================================================
  830. # ** Scene_Task
  831. #------------------------------------------------------------------------------
  832. #  任务系统的场景的类。
  833. #==============================================================================

  834. class Scene_Task < Scene_MenuBase
  835.   #----------------------------------------------------------------------------
  836.   # * 开始处理
  837.   #----------------------------------------------------------------------------
  838.   def start
  839.     super
  840.     @tasklist = Window_TaskList.new
  841.     if $game_party.task.size != 0
  842.       @taskdata = Window_TaskData.new($game_party.task[0].id)
  843.     else @taskdata = Window_TaskData.new(nil)
  844.     end
  845.     @adandonmentquery = Window_Base.new(0, 0, 500, 48)
  846.     @adandonmentquery.x = 544/2 - @adandonmentquery.width/2
  847.     @adandonmentquery.y = 416/2 - @adandonmentquery.height/2 - 48
  848.     @adandonmentquery.visible = false
  849.     @adandonmentcommand = Window_YON.new(198, @adandonmentquery.y+48)
  850.     @adandonmentcommand.visible = false
  851.     @adandonmentcommand.active = false
  852.     @adandonmentcommand.set_handler(:ok,      method(:adandonment_task))
  853.     @adandonmentcommand.set_handler(:cancel,  method(:cancel_adandonment))
  854.     @page_tip_left = Sprite.new
  855.     @page_tip_left.bitmap = Bitmap.new(System::Page_Tip)
  856.     @page_tip_left.src_rect.height = @page_tip_left.bitmap.height/2
  857.     @page_tip_left.y = 416-@page_tip_left.bitmap.height/2
  858.     @page_tip_left.z = 9999
  859.     @page_tip_right = Sprite.new
  860.     @page_tip_right.bitmap = Bitmap.new(System::Page_Tip)
  861.     @page_tip_right.src_rect.y = @page_tip_left.bitmap.height/2
  862.     @page_tip_right.src_rect.height = @page_tip_left.bitmap.height/2
  863.     @page_tip_right.y = 416-@page_tip_left.bitmap.height/2
  864.     @page_tip_right.z = 9999
  865.     @page_tip_right.visible = false
  866.   end
  867.   #----------------------------------------------------------------------------
  868.   # * 结束处理
  869.   #----------------------------------------------------------------------------
  870.   def terminate
  871.     super
  872.     @page_tip_left.dispose
  873.     @page_tip_right.dispose
  874.   end
  875.   #----------------------------------------------------------------------------
  876.   # * 刷新场景
  877.   #----------------------------------------------------------------------------
  878.   def update
  879.     super
  880.     @page_tip_left.update
  881.     @page_tip_right.update
  882.     case @taskdata.page
  883.     when 0
  884.       @page_tip_left.visible = true
  885.       @page_tip_right.visible = false
  886.     when 1
  887.       @page_tip_left.visible = false
  888.       @page_tip_right.visible = true
  889.     end
  890.     if Input.repeat?(:B)
  891.       return_scene
  892.     elsif Input.repeat?(:DOWN)
  893.       @taskdata.refresh(@tasklist.list[@tasklist.index])
  894.     elsif Input.repeat?(:UP)
  895.       @taskdata.refresh(@tasklist.list[@tasklist.index])
  896.     elsif Input.repeat?(System::Task_Right_Change_Page)
  897.       @taskdata.page += 1 if @taskdata.page == 0
  898.       @taskdata.refresh(@tasklist.list[@tasklist.index])
  899.     elsif Input.repeat?(System::Task_Left_Change_Page)
  900.       @taskdata.page -= 1 if @taskdata.page == 1
  901.       @taskdata.refresh(@tasklist.list[@tasklist.index])
  902.     elsif Input.repeat?(System::Task_Abandonment_Task_Input)
  903.       if @tasklist.list.size != 0
  904.         @tasklist.active = false
  905.         @adandonmentquery.contents.clear
  906.         text = sprintf(Vocab::Task_Adandonment_Query, $game_party.task[@tasklist.list[@tasklist.index]].name)
  907.         @adandonmentquery.contents.draw_text(0, 0, @adandonmentquery.contents.width, System::WLH, text, 1)
  908.         @adandonmentquery.visible = true
  909.         @adandonmentcommand.visible = true
  910.         @adandonmentcommand.active = true
  911.       end
  912.     end
  913.   end
  914.   #----------------------------------------------------------------------------
  915.   # * 确定放弃
  916.   #----------------------------------------------------------------------------
  917.   def adandonment_task
  918.     $game_party.delete_task($game_party.task[@tasklist.list[@tasklist.index]].id)
  919.     @tasklist.make_command_list
  920.     @tasklist.index -= 1 if @tasklist.index > 0
  921.     @tasklist.refresh
  922.     @taskdata.page = 0
  923.     if $game_party.task.size != 0
  924.       @taskdata.refresh($game_party.task[@tasklist.list[@tasklist.index]].id)
  925.     else @taskdata.refresh(nil)
  926.     end
  927.     @tasklist.active = true
  928.     @adandonmentquery.visible = false
  929.     @adandonmentcommand.visible = false
  930.     @adandonmentcommand.active = false
  931.   end
  932.   #----------------------------------------------------------------------------
  933.   # * 取消放弃
  934.   #----------------------------------------------------------------------------
  935.   def cancel_adandonment
  936.     @tasklist.active = true
  937.     @adandonmentquery.visible = false
  938.     @adandonmentcommand.visible = false
  939.     @adandonmentcommand.active = false
  940.   end
  941. end

  942. #==============================================================================
  943. # ■ Scene_Map
  944. #------------------------------------------------------------------------------
  945. #  地图画面
  946. #==============================================================================

  947. class Scene_Map < Scene_Base
  948.   alias task_sta start
  949.   alias task_upd update
  950.   def start
  951.     task_sta
  952.     @task_tip1 = Window_Base.new(0, 0, 360, System::WLH*3+System::Task_Filament_Width+24)
  953.     @task_tip1.x = 544/2-@task_tip1.width/2
  954.     @task_tip1.y = 416/2-@task_tip1.height/2
  955.     @task_tip1.visible = false
  956.     @task_tip2 = Window_Base.new(0, 0, 360, System::WLH*2+System::Task_Filament_Width+24)
  957.     @task_tip2.x = 544/2-@task_tip2.width/2
  958.     @task_tip2.y = 416/2-@task_tip2.height/2
  959.     @task_tip2.visible = false
  960.     @tip_time = 0
  961.   end
  962.   def update
  963.     task_upd
  964.     fw = System::Task_Filament_Width
  965.     fc = System::Task_Filament_Color
  966.     if @task_tip1.visible == true or @task_tip2.visible == true
  967.       if @tip_time == System::Show_Tip_Time or Input.repeat?(:C)
  968.         if @task_tip1.visible == true
  969.           @task_tip1.visible = false
  970.         elsif @task_tip2.visible == true
  971.           @task_tip2.visible = false
  972.         end
  973.         @tip_time = 0
  974.       else @tip_time += 1
  975.       end
  976.     end
  977.     if $game_map.tip_visible == true
  978.       if $game_party.accepted_task?($game_map.tip_task_id)
  979.         task = $game_party.task[$game_map.tip_task_id]
  980.       else task = Game_Task.new($game_map.tip_task_id)
  981.       end
  982.       if System.draw_task_icon?
  983.         @task_tip1.draw_icon(System::Task_Icon, 0, 0)
  984.         x = 24
  985.         else x = 0
  986.       end
  987.       if $game_map.tip_type == 0
  988.         @task_tip1.contents.clear
  989.         @task_tip1.draw_straight_filament(0, System::WLH*2+1, @task_tip1.width, System::WLH*2+1, fw, fc)
  990.         @task_tip1.contents.draw_text(x, 0, @task_tip1.contents.width-x, System::WLH, $game_map.tip_task_word)
  991.         @task_tip1.draw_icon(task.icon, 0, System::WLH)
  992.         @task_tip1.draw_text(0, System::WLH, @task_tip1.contents.width-24, System::WLH, task.name, 1)
  993.         @task_tip1.draw_text(0, System::WLH*2+fw, @task_tip1.contents.width-24, System::WLH, task.title_help, 1)
  994.         @task_tip1.visible = true
  995.       else
  996.         @task_tip2.contents.clear
  997.         @task_tip2.contents.draw_text(x, 0, @task_tip2.contents.width-x, System::WLH, $game_map.tip_task_word)
  998.         @task_tip2.draw_icon(task.icon, 0, System::WLH)
  999.         @task_tip2.draw_text(0, System::WLH, @task_tip2.contents.width-24, System::WLH, task.name, 1)
  1000.         @task_tip2.visible = true
  1001.       end
  1002.       $game_map.change_tip_visible
  1003.     end
  1004.   end
  1005. end
复制代码
还有超级整合的系统都会出现这样的错误,怎么解决?
脚本和游戏在这,不过一些视频和字体之类的我删掉了 不影响运行  可以新建几个地图  帮我看看哪里有错。
http://pan.baidu.com/s/1o6BxH8I

Lv1.梦旅人

梦石
0
星屑
108
在线时间
5 小时
注册时间
2019-1-10
帖子
18
2
发表于 2019-1-10 19:06:50 | 只看该作者
同问同问
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 10:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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