查看: 15373|回复: 6

[已经解决] 求任务插件

[复制链接]
梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2016-2-21 20:30:52 来自手机 | 显示全部楼层 |阅读模式

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

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

×
貌似论坛除了小优的任务插件以外就没有其他的了 有木有大大知道其他的任务插件
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-2-21 21:11:26 | 显示全部楼层
回复

使用道具 举报

梦石
0
星屑
79
在线时间
39 小时
注册时间
2016-2-12
回帖
12
发表于 2016-2-24 16:45:12 | 显示全部楼层
tseyik 发表于 2016-2-21 21:11
Gameus' Quest System
http://forums.rpgmakerweb.com/index.php?/topic/49234-gameus-quest-system/
中文 ...

中文说明链接进不去了,请问还有别的链接吗{:2_276:}
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-2-24 17:26:46 | 显示全部楼层
本帖最后由 tseyik 于 2016-2-24 17:27 编辑
锡城彭于晏 发表于 2016-2-24 16:45
中文说明链接进不去了,请问还有别的链接吗


任務系統.js
GameusQuestSystem.rar (9.1 KB, 下载次数: 254)
獨立的任務編輯器
GameusQuestEditor.rar (247.68 KB, 下载次数: 231)
如果要使用這個插件,
記得在開始遊戲前記得將它的任務編輯器打開一遍(任務編輯器需先放在項目目録),json檔才會建立,
否則會出現「找不到$gameQuest.json」的錯誤。

任務系統的指令翻譯。更完整的翻譯在插件中。

Quest Add 3
在任務介面新增3號任務。

Quest NextStep 4
讓4號任務進行到下一步。

Quest BackStep 5
讓5號任務退回到上一步。現在正在進行的步驟會被回退,不管此步進行到何處。

Quest Complete 6
讓6號任務完成。如果自動報酬是開著的,那麼這個指令同時也會給出報酬。

Quest Fail 7
讓7號任務失敗。

Quest Remove 8
將8號任務從任務清單中移出。

Quest Reset 9
重置9號任務。這個任務的一切都會回到最開始接下的狀態。
特別注意到,你為這個任務自己安排的開關和變數要自己重置!

Quest Open
打開任務視窗。
這個指令只是實作了腳本中的SceneManager.push(Scene_Quest)。

Gameus Quest System
  1. //=============================================================================
  2. // Gameus Quest System
  3. // Author gameus
  4. // Version 1.0
  5. // CHT version fixed by JEK.
  6. //-----------------------------------------------------------------------------
  7. // Intro:
  8. // This is a (for the most part) basic quest system. Has a basic layout to help
  9. // players keep track of all the different quests they might encounter. Also
  10. // gives you plenty of commands and script calls to keep track of said quests
  11. // behind the scenes.
  12. //
  13. // Features:
  14. // Simple UI to keep track of quests with some customization options
  15. // Friendly commands to track/complete/fail/reset/count/progress quests
  16. // Auto rewards upon quest completion (optional)
  17. // Quest categories (optional)
  18. // Full blown quest editor included
  19. //
  20. //
  21. // Instructions:
  22. // Place in your plugins folder and save as 'GameusQuestSystem.js'
  23. // Configure the options as you please.
  24. //
  25. // I highly recommend checking out the demo (includes Quest Editor)
  26. //  [url]http://jugglingcode.com/scripts/MV/QuestSystem/Demo.zip[/url]
  27. //
  28. // Credits:
  29. // gameus ~ For creating it.
  30. //-----------------------------------------------------------------------------
  31. // 简介
  32. // 这是一个(大多情况下)基础的任务系统。这个系统拥有基本的输出方式,帮助玩家们
  33. // 追踪并关注各种他们可能遭遇到的不同任务。本系统也同样给予一些实用的脚本指令
  34. // 和插件命令,帮助使用者在场景之间取得、维护、控制这些任务的流程。
  35. //
  36. // 功能和特色:
  37. // 简单的使用者介面,方便追踪那些有着自定义选项的任务。
  38. // 提供友善的指令以追踪、控制、重置和计算各种任务
  39. // 任务完成自动提供报酬(可选)
  40. // 提供任务类别(可选)
  41. // 包括了完善独立的任务编辑器
  42. //
  43. //
  44. // 安装指示
  45. // 将程式码放置在插件资料夹下并另存为'GameusQuestSystem.js',
  46. // 按照你的需求配置选项即可。
  47. //
  48. // 我非常建议你可以参看本插件的范例档(附带任务编辑器):
  49. //  [url]http://jugglingcode.com/scripts/MV/QuestSystem/Demo.zip[/url]
  50. //
  51. // 致谢名单
  52. // gameus ~ 本插件制作者
  53. //=============================================================================

  54. /*:
  55. * @plugindesc v1.0 - 一个简单的,具有许多可自行设定选项的任务系统。
  56. * @author gameus
  57. *
  58. * @param Auto Rewards
  59. * @desc 自动报酬,是否在完成任务最後一步时自动给予报酬。预设为true。
  60. * @default true
  61. *
  62. * @param ---------------
  63. *
  64. * @param ---文字翻译---
  65. *
  66. * @param ---------------
  67. *
  68. * @param Hidden Reward Text
  69. * @desc 用来显示未知报酬,预设:??????
  70. * @default ??????
  71. *
  72. * @param No Quests Text
  73. * @desc 预设:没有任务
  74. * @default 没有任务
  75. *
  76. * @param All Word
  77. * @desc 预设:全部
  78. * @default 全部
  79. *
  80. * @param Completed Word
  81. * @desc 预设:已完成
  82. * @default 已完成
  83. *
  84. * @param Failed Word
  85. * @desc 预设:已失败
  86. * @default 已失败
  87. *
  88. * @param In-Progress Word
  89. * @desc 预设:进行中
  90. * @default 进行中
  91. *
  92. * @param Steps Word
  93. * @desc 预设:阶段
  94. * @default 阶段
  95. *
  96. * @param Rewards Word
  97. * @desc 预设:报酬
  98. * @default 报酬
  99. *
  100. * @param ---------------
  101. *
  102. * @param ---显示选项---
  103. *
  104. * @param ---------------
  105. *
  106. * @param Reverse Layout
  107. * @desc 是否反转任务清单顺序,预设为false
  108. * @default false
  109. *
  110. * @param Filter Position
  111. * @desc 过滤视窗(预设显示"全部")的位置。可以选择上(Top)或下(Bottom)。
  112. * @default Top
  113. *
  114. * @param Use Categories
  115. * @desc 是否使用自订子类别,例如"支线", "特殊", "隐藏"等任务类。预设为true
  116. * @default true
  117. *
  118. * @param Show Empty Categories
  119. * @desc 是否显示空类别。0:不显示,1:灰阶显示,2:显示,但在其下显示"没有任务"
  120. * @default 0
  121. *
  122. * @param Show Quest Count
  123. * @desc 是否显示每类的任务数量。预设为true
  124. * @default true
  125. *
  126. * @param Bullet Character
  127. * @desc 用於显示在阶段和报酬之前的角色。例如直接输入「疾风丸」,不需引号。
  128. * @default -
  129. *
  130. * @param Max Steps
  131. * @desc 定义一个任务一次所显示的最大阶段。
  132. * 只会显示已完成或进行中的阶段。当然是从後往前显示。
  133. * @default 3
  134. *
  135. * @param ---------------
  136. *
  137. * @param ---图片和图示选项---
  138. *
  139. * @param ---------------
  140. *
  141. * @param Use Icons
  142. * @desc 是否允许显示任务图示。预设为true
  143. * @default true
  144. *
  145. * @param Completed Image
  146. * @desc 用於绘制在已完成任务上的图片。如果没有图片请留白。
  147. *
  148. * @param Completed Image Opacity
  149. * @desc 已完成图片的透明度。
  150. * @default 128
  151. *
  152. * @param Failed Image
  153. * @desc 用於绘制在已失败任务上的图片。如果没有图片请留白。
  154. *
  155. * @param Failed Image Opacity
  156. * @desc 已完成图片的透明度。
  157. * @default 128
  158. *
  159. * @help
  160. * 回报与插件和编辑器有关的Bug,请至:
  161. *   [url]http://forums.rpgmakerweb.com/index.php?/topic/49234-gameus-quest-system/[/url]
  162. * 在回报之前,请先确认你是否使用了过期的插件。
  163. *
  164. * 我非常建议你可以参看本插件的范例档(附带任务编辑器):
  165. *   [url]http://jugglingcode.com/scripts/MV/QuestSystem/Demo.zip[/url]
  166. * ----------------------------------------------------
  167. * 插件指令清单
  168. * QuestID:任务编号
  169. * ----------------------------------------------------
  170. * Quest Add QuestID
  171. *   在任务介面新增任务。
  172. *
  173. * Quest NextStep QuestID
  174. *   让任务进行到下一步。
  175. *
  176. * Quest BackStep QuestID
  177. *   让任务退回到上一步。现在正在进行的步骤会被回退,不管此步进行到何处。
  178. *
  179. * Quest Complete QuestID
  180. *   让任务完成。如果自动报酬是开着的,那麽这个指令同时也会给出报酬。
  181. *
  182. * Quest Fail QuestID
  183. *   让任务失败。
  184. *
  185. * Quest Remove QuestID
  186. *   将任务从任务清单中移出。
  187. *
  188. * Quest Reset QuestID
  189. *   重置任务。这个任务的一切都会回到最开始接下的状态。
  190. *   特别注意到,你为这个任务自己安排的开关和变数要自己重置!
  191. *
  192. * Quest Open
  193. *   打开任务视窗。意义等同於SceneManager.push(Scene_Quest)。
  194. *
  195. * ----------------------------------------------------
  196. * 这里是可以使用在条件分歧里的脚本指令清单
  197. * ----------------------------------------------------
  198. * SceneManager.push(Scene_Quest)
  199. *   打开任务视窗。与Quest Open相同但适用於跨插件呼叫,或对SceneManager.push特别喜爱者。
  200. *
  201. * $gameQuests.get(quest_id).completed()
  202. * $gameQuests.get(quest_id).failed()
  203. * $gameQuests.get(quest_id).inProgress()
  204. *   用於取得某个任务的状态和进度。
  205. *   注意:即使队伍在可能并没有该任务的情形下,依然会回传true/false!
  206. *
  207. * $gameParty.hasQuest(quest_id)
  208. *   用於取得队伍是否开启了这项任务。请与上面的指令合并使用以避免误判。
  209. *
  210. * $gameParty.hasQuests([quest ids], filter)
  211. *   此指令一次检测队伍是否开启了某些任务,以及它们是否全部在某个类别中。请勿与上面的指令搞混。
  212. *   过滤子可以是"progress"(进行中)、"completed"(已完成)或"failed"(已失败)。
  213. *   如果以上条件都满足,则回传true。
  214. *   例如,可以使用在接取某任务前,确认该任务必须完成的一海票前置任务。
  215. *
  216. * $gameQuests.get(quest_id).currentStep === step_number
  217. *   用於取得某个任务正进行到哪个阶段。阶段数从0开始。
  218. *   注意:即使该任务并未开启,此指令仍然会回传数字!请与$gameParty.hasQuest(quest_id)并用!
  219. *
  220. * $gameQuests.get(quest_id).status === "status"
  221. *   用於取得某个任务的状态。
  222. *   "status"可以是"progress"(进行中)、"completed"(已完成)或"failed"(已失败)。
  223. *  
  224. * $gameQuests.totalQuests(filter)
  225. *   用於取得某状态下有多少任务。
  226. *   过滤子可以是"progress"(进行中)、"completed"(已完成)或"failed"(已失败)。
  227. *   这个指令会取得该状态所有类别的任务,不管队伍是否拥有!
  228. *
  229. * $gameParty.totalQuests(filter)
  230. *   与上面指令相同,但只会取得队伍拥有的任务。
  231. *
  232. */

  233. // Import 'Quest System'
  234. var GameusScripts = GameusScripts || {};
  235. GameusScripts["Config"] = GameusScripts["Config"] || {};
  236. GameusScripts["QuestSystem"] = 1.0;
  237. GameusScripts["Config"]["QuestSystem"] = PluginManager.parameters("GameusQuestSystem");

  238. // Initialize global quest variables
  239. var $dataQuests = null;
  240. var $gameQuests = null;


  241. // Load quest data
  242. DataManager._databaseFiles.push(
  243.     {name: "$dataQuests", src: "Quests.json"}
  244.    
  245. );

  246. //---------------------------------------------------------------------------------------------
  247. // Alias methods
  248. //---------------------------------------------------------------------------------------------
  249.     gameus_Quest_Party_Initialize = Game_Party.prototype.initialize;
  250.     gameus_Quest_Data_Initialize  = DataManager.createGameObjects;
  251.     gameus_Quest_Save_Data        = DataManager.makeSaveContents;
  252.     gameus_Quest_Load_Data        = DataManager.extractSaveContents;
  253.     gameus_Quest_Plugin_Commands  = Game_Interpreter.prototype.pluginCommand;
  254.    
  255. //---------------------------------------------------------------------------------------------
  256. // Plugin Commands
  257. //---------------------------------------------------------------------------------------------
  258.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  259.         gameus_Quest_Plugin_Commands.call(this, command, args);
  260.         if (command.toLowerCase() === "quest") {
  261.             switch (args[0].toLowerCase()) {
  262.             case 'open':
  263.                 SceneManager.push(Scene_Quest);
  264.                 break;
  265.             case 'add':
  266.                 $gameParty.addQuest(Number(args[1]));
  267.                 break;
  268.             case 'remove':
  269.                 $gameParty.removeQuest(Number(args[1]));
  270.                 break;
  271.             case 'complete':
  272.                 $gameQuests.get(Number(args[1])).complete();
  273.                 break;
  274.             case 'fail':
  275.                 $gameQuests.get(Number(args[1])).fail();
  276.                 break;
  277.             case 'reset':
  278.                 $gameQuests.get(Number(args[1])).reset();
  279.                 break;
  280.             case 'nextstep':
  281.                 $gameQuests.get(Number(args[1])).nextStep();
  282.                 break;
  283.             case 'backstep':
  284.                 $gameQuests.get(Number(args[1])).backStep();
  285.                 break;
  286.             }
  287.         }
  288.     };
  289. //---------------------------------------------------------------------------------------------
  290. // DataManager
  291. //---------------------------------------------------------------------------------------------
  292.     DataManager.makeSaveContents = function() {
  293.         contents = gameus_Quest_Save_Data.call(this);
  294.         // Include the quests in the save file
  295.         contents.quests = $gameQuests;
  296.         return contents;
  297.     };
  298.    
  299.     DataManager.extractSaveContents = function(contents) {
  300.         gameus_Quest_Load_Data.call(this, contents);
  301.         // Then take them back because we really don't trust banks
  302.         $gameQuests = contents.quests;
  303.     };
  304.    
  305.     DataManager.createGameObjects = function() {
  306.         gameus_Quest_Data_Initialize.call(this);
  307.         // Create global quests
  308.         $gameQuests = new Game_Quests();
  309.     };
  310.    
  311. //---------------------------------------------------------------------------------------------
  312. // Game_Party
  313. //---------------------------------------------------------------------------------------------
  314.     Game_Party.prototype.initialize = function() {
  315.         gameus_Quest_Party_Initialize.call(this);
  316.         // Initialize quest data
  317.         this.quests = [];
  318.     };
  319.    
  320.     Game_Party.prototype.addQuest = function(quest_id) {
  321.         // Does party already have quest?
  322.         if (this.quests.indexOf(quest_id) < 0) {
  323.             // If not, give that crap to them. They don't have a choice now.
  324.             this.quests.push(quest_id);
  325.         }
  326.     };
  327.    
  328.     // Removes the quest from the party. NOTE: This does NOT reset the quest
  329.     Game_Party.prototype.removeQuest = function(quest_id) {
  330.         // Check if quest exists
  331.         if (this.quests.indexOf(quest_id) > -1) {
  332.             // I was wrong...
  333.             var index = this.quests.indexOf(quest_id);
  334.             this.quests.splice(index, 1);
  335.         }
  336.     };
  337.    
  338.     // Returns total number of quests the party has
  339.     // filter can be "all", "progress" "completed" or "failed"
  340.     Game_Party.prototype.totalQuests = function(filter) {
  341.         // Returns a list of ALL quests
  342.         if (filter === undefined || filter === "all")
  343.             return this.quests.length;
  344.         // Time to cycle through quests....(dammit, I did this exact thing in the quest list window)
  345.         var count = 0;
  346.         for (var i = 0; i < this.quests.length; i += 1) {
  347.             var q = $gameQuest.get(this.quests[i]);
  348.             if (q.status === filter.toLowerCase())
  349.                 count += 1;
  350.         }
  351.         return count;
  352.     };
  353.    
  354.     // Gets all quest id's
  355.     Game_Party.prototype.getQuests = function(filter) {
  356.         // Returns a list of ALL quests
  357.         if (filter === undefined || filter === "all")
  358.             return this.quests;
  359.         // Time to cycle through quests....(dammit, I did this exact thing in the quest list window)
  360.         var data = [];
  361.         for (var i = 0; i < this.quests.length; i += 1) {
  362.             var q = $gameQuest.get(this.quests[i]);
  363.             if (q.status === filter.toLowerCase())
  364.                 data.push(q.questId);
  365.         }
  366.         return data;
  367.     };
  368.    
  369.     // This method is actually extremely useless. Ignore it for now.
  370.     Game_Party.prototype.getQuest = function(index) {
  371.         return $gameQuests.get(this.quests[index]);
  372.     };
  373.    
  374.     Game_Party.prototype.hasQuest = function(quest_id){
  375.         // Returns whether or not they have the quest
  376.         return this.quests.indexOf(quest_id) > -1;
  377.     };
  378.    
  379.     // This checks a list of quests and its status.
  380.     // If the party has all and they match the input filter, it returns true
  381.     // Used to check a range of quests completion
  382.     Game_Party.prototype.hasQuests = function(quests, filter) {
  383.         flag = true;
  384.         for (var i = 0; i < quests.length; i += 1) {
  385.             if (!this.hasQuest(quests[i]))
  386.                 flag = false;
  387.             if ($gameQuests.get(quests[i]).status !== filter)
  388.                 flag = false;
  389.         }
  390.         return flag;
  391.     }
  392.    
  393. //---------------------------------------------------------------------------------------------
  394. // Game_Quest
  395. //---------------------------------------------------------------------------------------------
  396.     function Game_Quest() {
  397.         this.initialize.apply(this, arguments);
  398.     };
  399.    
  400.     Game_Quest.prototype.initialize = function(questId) {
  401.         var questData = $dataQuests[questId];
  402.         this.questId = questId;
  403.         this.rawData = questData;
  404.         this.cat = questData.cat;
  405.         this.name = questData.name;
  406.         this.desc = questData.desc;
  407.         this.rewards = questData.rewards;
  408.         this.icon = questData.icon;
  409.         this.steps = questData.steps;
  410.         this.maxSteps = this.steps.length;
  411.         this.currentStep = 0;
  412.         this.status = "progress";
  413.     };
  414.    
  415.     Game_Quest.prototype.giveRewards = function() {
  416.         for (var i = 0; i < this.rewards.length; i += 1) {
  417.             var reward = this.rewards[i];
  418.             switch (reward[0]) {
  419.                 case "item":
  420.                     item = $dataItems[reward[1]];
  421.                     $gameParty.gainItem(item, Number(reward[2]));
  422.                     break;
  423.                 case "armor":
  424.                     item = $dataArmors[reward[1]];
  425.                     $gameParty.gainItem(item, Number(reward[2]));
  426.                     break;
  427.                 case "weapon":
  428.                     item = $dataWeapons[reward[1]];
  429.                     $gameParty.gainItem(item, Number(reward[2]));
  430.                     break;
  431.                 case "xp":
  432.                     for (var j = 0; j < $gameParty.members().length; j++) {
  433.                         $gameParty.members()[j].gainExp(reward[1]);
  434.                     };
  435.                     break;
  436.                 case "gold":
  437.                     $gameParty.gainGold(Number(reward[1]));
  438.                     break;
  439.             }
  440.         }
  441.     };
  442.    
  443.     Game_Quest.prototype.completed = function() {
  444.         return this.status == "completed";
  445.     }
  446.    
  447.     Game_Quest.prototype.inProgress = function() {
  448.         return this.status == "progress";
  449.     }
  450.    
  451.     Game_Quest.prototype.failed = function() {
  452.         return this.status == "failed";
  453.     }
  454.    
  455.     Game_Quest.prototype.nextStep = function() {
  456.         this.currentStep = this.currentStep + 1 > this.maxSteps - 1 ? this.maxSteps - 1 : this.currentStep + 1;
  457.     };
  458.    
  459.     Game_Quest.prototype.backStep = function() {
  460.         this.currentStep = this.currentStep - 1 < 0 ? 0 : this.currentStep - 1;
  461.     };
  462.    
  463.     Game_Quest.prototype.currentStep = function() {
  464.         return this.currentStep;
  465.     };
  466.    
  467.     Game_Quest.prototype.fail = function() {
  468.         this.status = "failed";
  469.     };
  470.    
  471.     Game_Quest.prototype.complete = function() {
  472.         if ((GameusScripts["Config"]["QuestSystem"]["Auto Rewards"] || "false").toLowerCase() === "true") {
  473.             this.giveRewards();
  474.         }
  475.         this.currentStep = this.maxSteps - 1;
  476.         this.status = "completed";
  477.     };
  478.    
  479.     Game_Quest.prototype.reset = function() {
  480.         this.status = "progress";
  481.         this.currentStep = 0;
  482.     };

  483. //---------------------------------------------------------------------------------------------
  484. // Game_Quests
  485. //---------------------------------------------------------------------------------------------
  486.     function Game_Quests() {
  487.         this.initialize.apply(this, arguments);
  488.     };
  489.    
  490.     Game_Quests.prototype.initialize = function() {
  491.         this.data = [];
  492.     };
  493.    
  494.     Game_Quests.prototype.get = function(quest_id) {
  495.         if ($dataQuests[quest_id]) {
  496.             if (!this.data[quest_id]) {
  497.                 this.data[quest_id] = new Game_Quest(quest_id);
  498.             }
  499.             return this.data[quest_id];
  500.         }
  501.         return null;
  502.     };
  503.    
  504.     Game_Quests.prototype.categories = function() {
  505.         if ($dataQuests[0])
  506.             return $dataQuests[0];
  507.         return null;
  508.     };
  509.    
  510.     Game_Quests.prototype.totalQuests = function(filter) {
  511.         // Returns a list of ALL quests
  512.         if (filter === undefined || filter === "all")
  513.             return $dataQuests.length;
  514.         // Time to cycle through quests....(dammit, I did this exact thing in the quest list window)
  515.         var count = 0;
  516.         for (var i = 0; i < $dataQuests.length; i += 1) {
  517.             var q = this.get(this.quests[i]);
  518.             if (q.status === filter.toLowerCase())
  519.                 count += 1;
  520.         }
  521.         return data;
  522.     };
  523. //---------------------------------------------------------------------------------------------
  524. // Window_Base
  525. //---------------------------------------------------------------------------------------------
  526.     Window_Base.prototype.sliceText = function(text, width) {
  527.         var words = text.split(" ");
  528.         if (words.length === 1)
  529.             return words;
  530.         var result = [];
  531.         var current_text = words.shift();
  532.         for (var i = 0; i < words.length; i += 1) {
  533.             var word = words[i];
  534.             var textW = this.contents.measureTextWidth(current_text + " " + word);
  535.             if (textW > width) {
  536.                 result.push(current_text);
  537.                 current_text = word;
  538.             } else {
  539.                 current_text += " " + word;
  540.             }
  541.             if (i >= words.length - 1)
  542.                 result.push(current_text)
  543.         }
  544.         return result
  545.     }
  546. //---------------------------------------------------------------------------------------------
  547. // Window_QuestInfo
  548. //---------------------------------------------------------------------------------------------
  549.     function Window_QuestInfo() {
  550.         this.initialize.apply(this, arguments);
  551.     }
  552.    
  553.     Window_QuestInfo.prototype = Object.create(Window_Selectable.prototype);
  554.     Window_QuestInfo.prototype.constructor = Window_QuestInfo;
  555.    
  556.     Window_QuestInfo.prototype.initialize = function() {
  557.         var xx = (GameusScripts["Config"]["QuestSystem"]["Reverse Layout"] || "false").toLowerCase() === "true" ? 0 : 320;
  558.         this.failedImg = GameusScripts["Config"]["QuestSystem"]["Failed Image"] || '';
  559.         this.completedImg = GameusScripts["Config"]["QuestSystem"]["Completed Image"] || '';
  560.         if (this.failedImg !== '')
  561.             this.failedImg = ImageManager.loadPicture(this.failedImg, 0);
  562.         if (this.completedImg !== '')
  563.             this.completedImg = ImageManager.loadPicture(this.completedImg, 0);
  564.         this.quest = 0;
  565.         this.offY = 0;
  566.         this.lineY = 0;
  567.         this.resizeFlag = false;
  568.         Window_Selectable.prototype.initialize.call(this, xx, 0, Graphics.boxWidth - 320, Graphics.boxHeight);
  569.         this.questBitmap = new Bitmap(this.contentsWidth(), this.contentsHeight());
  570.         this.refresh();
  571.     };
  572.    
  573.     Window_QuestInfo.prototype.setQuest = function(quest_id) {
  574.         this.quest = quest_id;
  575.         this.offY = 0;
  576.         this.resizeFlag = false;
  577.         this.createQuestBitmap();
  578.         this.refresh();
  579.     };
  580.    
  581.     Window_QuestInfo.prototype.refresh = function() {
  582.         this.contents.clear();
  583.         if (this.quest > 0) {
  584.             this.contents.blt(this.questBitmap, 0, this.offY, this.contentsWidth(), this.contentsHeight(), 0, 0, this.contentsWidth(), this.contentsHeight());
  585.         }
  586.     }
  587.    
  588.     // This function is used to keep track of the height of the bitmap, has to be called after every line of text drawn
  589.     Window_QuestInfo.prototype.write = function() {
  590.         this.lineY += this.lineHeight() + this.textPadding();
  591.         if (this.lineY > this.questBitmap.height) {
  592.             this.questBitmap.resize(this.questBitmap.width, this.lineY);
  593.             this.resizeFlag = true;
  594.         }
  595.     }
  596.         
  597.     Window_QuestInfo.prototype.createQuestBitmap = function() {
  598.         this.questBitmap.clear();
  599.         if (this.quest > 0) {
  600.             this.questBitmap.paintOpacity = 255;
  601.             var q = $gameQuests.get(this.quest);
  602.             this.drawQuestInfo(q);
  603.             this.drawQuestSteps(q);
  604.             this.drawQuestRewards(q);
  605.             // Check for resize, then redraw
  606.             if (this.resizeFlag) {
  607.                 this.resizeFlag = false;
  608.                 this.createQuestBitmap();
  609.             }
  610.             if (this.failedImg !== '' && q.status === "failed") {
  611.                 this.questBitmap.paintOpacity = Number(GameusScripts["Config"]["QuestSystem"]["Failed Image Opacity"] || 128);
  612.                 this.questBitmap.blt(this.failedImg, 0, 0, this.failedImg.width, this.failedImg.height,
  613.                     this.contentsWidth() / 2 - this.failedImg.width / 2,
  614.                     this.contentsHeight() / 2 - this.failedImg.height / 2);
  615.             }
  616.             if (this.completedImg !== '' && q.status === "completed") {
  617.                 this.questBitmap.paintOpacity = Number(GameusScripts["Config"]["QuestSystem"]["Completed Image Opacity"] || 128);
  618.                 this.questBitmap.blt(this.completedImg, 0, 0, this.completedImg.width, this.completedImg.height,
  619.                     this.contentsWidth() / 2 - this.completedImg.width / 2,
  620.                     this.contentsHeight() / 2 - this.completedImg.height / 2);
  621.             }
  622.         }
  623.     };
  624.    
  625.     Window_QuestInfo.prototype.drawQuestInfo = function(q) {
  626.         var headerX = 0;
  627.         this.questBitmap.paintOpacity = 255;
  628.         this.lineY = 0;
  629.         if (q.icon > -1) {
  630.             this.drawIcon(q.icon, 0, this.lineY);
  631.             headerX = 40;
  632.         }
  633.         this.questBitmap.textColor = this.systemColor();
  634.         this.questBitmap.drawText(q.name, headerX, this.lineY, this.contentsWidth() - headerX, this.lineHeight());
  635.         this.write();
  636.         this.questBitmap.textColor = this.normalColor();
  637.         var lines = this.sliceText(q.desc, this.contentsWidth());
  638.         for (var i = 0; i < lines.length; i += 1) {
  639.             this.questBitmap.drawText(lines[i], 0, this.lineY, this.contentsWidth(), this.lineHeight());
  640.             this.write();
  641.         }
  642.         this.drawHorzLine(this.lineY);
  643.         this.write();
  644.     }
  645.    
  646.     Window_QuestInfo.prototype.drawQuestSteps = function(q) {
  647.         // Draw the quest steps
  648.         var bullet = String(GameusScripts["Config"]["QuestSystem"]["Bullet Character"] || "-" ) + " ";
  649.         this.questBitmap.textColor = this.systemColor();
  650.         this.questBitmap.drawText("进度", 0, this.lineY, this.contentsWidth(), this.lineHeight());
  651.         this.write();
  652.         this.questBitmap.textColor = this.normalColor();
  653.         var maxSteps = Number(GameusScripts["Config"]["QuestSystem"]["Max Steps"] || 3);
  654.         if (maxSteps === 0)
  655.             maxSteps = q.steps.length;
  656.         if (q.currentStep >= q.steps.length)
  657.             q.currentStep = q.steps.length - 1;
  658.         var startStep = Math.max(0, q.currentStep - maxSteps + 1);
  659.         var drawableSteps = q.steps.slice(startStep, q.currentStep + 1);
  660.         for (var i = 0; i < drawableSteps.length; i += 1) {
  661.             var step = drawableSteps[i];
  662.             var stepText = bullet + step[0];
  663.             if (step[1] === true) {
  664.                 var varVal = $gameVariables.value(step[2]);
  665.                 var maxVal = step[3];
  666.                 if (step[4])
  667.                     stepText += " " + String(Math.floor(varVal / maxVal * 100)) + "%";
  668.                 else
  669.                     stepText += " " + String(varVal) + " / " + String(maxVal);
  670.             }   
  671.             lines = this.sliceText(stepText, this.contentsWidth());
  672.             var done = i + startStep < q.currentStep || (q.status === "completed" || q.status === "failed");
  673.             this.questBitmap.paintOpacity = done ? 160 : 255
  674.             for (var j = 0; j < lines.length; j += 1) {
  675.                 var bulletOffset = 0;
  676.                 if (j > 0)
  677.                     bulletOffset += this.contents.measureTextWidth(bullet);
  678.                 this.questBitmap.drawText(lines[j], bulletOffset, this.lineY, this.contentsWidth(), this.lineHeight());
  679.                 this.write();
  680.             }
  681.         }
  682.         this.drawHorzLine(this.lineY);
  683.         this.write();
  684.     }
  685.    
  686.     Window_QuestInfo.prototype.drawQuestRewards = function(q) {
  687.         var bullet = String(GameusScripts["Config"]["QuestSystem"]["Bullet Character"] || "-" ) + " ";
  688.         // Draw Rewards
  689.         this.questBitmap.textColor = this.systemColor();
  690.         this.questBitmap.drawText("奖励", 0, this.lineY, this.contentsWidth(), this.lineHeight());
  691.         this.write();
  692.         this.questBitmap.textColor = this.normalColor();
  693.         for (var i = 0; i < q.rewards.length; i += 1) {
  694.             var reward = q.rewards[i];
  695.             // If the reward is hidden and quest not completed yet...
  696.             if (reward[3] === true && q.status !== "completed") {
  697.                 // Draw this shit as hidden
  698.                 var hidden = bullet + (GameusScripts["Config"]["QuestSystem"]["Hidden Reward Text"] || "??????");
  699.                 this.questBitmap.drawText(hidden, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  700.                 this.write();
  701.                 continue;
  702.             }
  703.             var item = null;
  704.             var amount = null;
  705.             var done = (q.status === "completed" || q.status === "failed");
  706.             this.questBitmap.paintOpacity = done ? 160 : 255
  707.             switch (reward[0]) {
  708.                 case "item":
  709.                     item = $dataItems[reward[1]];
  710.                     amount = reward[2];
  711.                     this.questBitmap.drawText(bullet, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  712.                     this.drawItemName(item, this.contents.measureTextWidth(bullet), this.lineY, this.contentsWidth());
  713.                     this.questBitmap.drawText("x" + String(amount), 0, this.lineY, this.contentsWidth(), this.lineHeight(), "right");
  714.                     this.write();
  715.                     break;
  716.                 case "armor":
  717.                     item = $dataArmors[reward[1]];
  718.                     amount = reward[2];
  719.                     this.questBitmap.drawText(bullet, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  720.                     this.drawItemName(item, this.contents.measureTextWidth(bullet), this.lineY, this.contentsWidth());
  721.                     this.questBitmap.drawText("x" + String(amount), 0, this.lineY, this.contentsWidth(), this.lineHeight(), "right");
  722.                     this.write();
  723.                     break;
  724.                 case "weapon":
  725.                     item = $dataWeapons[reward[1]];
  726.                     amount = reward[2];
  727.                     this.questBitmap.drawText(bullet, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  728.                     this.drawItemName(item, this.contents.measureTextWidth(bullet), this.lineY, this.contentsWidth());
  729.                     this.questBitmap.drawText("x" + String(amount), 0, this.lineY, this.contentsWidth(), this.lineHeight(), "right");
  730.                     this.write();
  731.                     break;
  732.                 case "xp":
  733.                     amount = reward[1];
  734.                     this.questBitmap.drawText(bullet + TextManager.exp, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  735.                     this.questBitmap.drawText("x" + String(amount), 0, this.lineY, this.contentsWidth(), this.lineHeight(), "right");
  736.                     this.write();
  737.                     break;
  738.                 case "gold":
  739.                     amount = reward[1];
  740.                     this.questBitmap.drawText(bullet + TextManager.currencyUnit, 0, this.lineY, this.contentsWidth(), this.lineHeight());
  741.                     this.questBitmap.drawText("x" + String(amount), 0, this.lineY, this.contentsWidth(), this.lineHeight(), "right");
  742.                     this.write();
  743.                     break;
  744.                 case "custom":
  745.                     amount = this.sliceText(bullet + reward[1], this.contentsWidth());
  746.                     for (var j = 0; j < amount.length; j += 1) {
  747.                         var bulletOffset = 0;
  748.                         if (j > 0)
  749.                             bulletOffset += this.contents.measureTextWidth(bullet);
  750.                         this.questBitmap.drawText(amount[j], bulletOffset, this.lineY, this.contentsWidth(), this.lineHeight());
  751.                         this.write();
  752.                     }
  753.                     break;
  754.             }
  755.         }
  756.     }
  757.    
  758.     // Borrow some drawing methods since we're drawing to a secondary bitmap
  759.     Window_QuestInfo.prototype.drawItemName = function(item, x, y, width) {
  760.         width = width || 312;
  761.         if (item) {
  762.             var iconBoxWidth = Window_Base._iconWidth + 8;
  763.             this.questBitmap.textColor = this.normalColor();
  764.             this.drawIcon(item.iconIndex, x - 2, y + 2);
  765.             this.questBitmap.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth, this.lineHeight());
  766.         }
  767.     };
  768.    
  769.     Window_QuestInfo.prototype.drawIcon = function(iconIndex, x, y) {
  770.         var bitmap = ImageManager.loadSystem('IconSet');
  771.         var pw = Window_Base._iconWidth;
  772.         var ph = Window_Base._iconHeight;
  773.         var sx = iconIndex % 16 * pw;
  774.         var sy = Math.floor(iconIndex / 16) * ph;
  775.         this.questBitmap.blt(bitmap, sx, sy, pw, ph, x, y);
  776.     };
  777.    
  778.     Window_QuestInfo.prototype.drawHorzLine = function(y) {
  779.         var lineY = y + this.lineHeight() / 2 - 1;
  780.         this.questBitmap.paintOpacity = 48;
  781.         this.questBitmap.fillRect(0, lineY, this.contentsWidth(), 2, this.normalColor());
  782.         this.questBitmap.paintOpacity = 255;
  783.     };
  784.    
  785.     // Update the up/down arrows to indicate scrolling is available
  786.     Window_QuestInfo.prototype.updateArrows = function() {
  787.         this.downArrowVisible = (this.questBitmap.height > this.contentsHeight() && this.offY < this.questBitmap.height - this.contentsHeight());
  788.         this.upArrowVisible = this.offY > 0;
  789.     };
  790.    
  791.     // Override the arrow key controls so we can scroll instead, let's be honest, that's way cooler
  792.     Window_QuestInfo.prototype.isCursorMovable = function() {
  793.         return (this.isOpenAndActive());
  794.     };

  795.     Window_QuestInfo.prototype.cursorDown = function(wrap) {
  796.         if (this.questBitmap.height > this.contentsHeight() && this.offY < this.questBitmap.height - this.contentsHeight()) {
  797.             SoundManager.playCursor();
  798.             this.offY += this.lineHeight() + this.textPadding();
  799.             this.refresh();
  800.         }
  801.     };

  802.     Window_QuestInfo.prototype.cursorUp = function(wrap) {
  803.         if (this.offY > 0) {
  804.             SoundManager.playCursor();
  805.             this.offY -= this.lineHeight() + this.textPadding();
  806.             if (this.offY < 0)
  807.                 this.offY = 0;
  808.             this.refresh();
  809.         }
  810.     };
  811.    
  812.     Window_QuestInfo.prototype.cursorPagedown = function() {
  813.         this.cursorDown();
  814.     };

  815.     Window_QuestInfo.prototype.cursorPageup = function() {
  816.         this.cursorUp();
  817.     };

  818.     Window_QuestInfo.prototype.cursorRight = function(wrap) {
  819.         // We are basically...
  820.     };

  821.     Window_QuestInfo.prototype.cursorLeft = function(wrap) {
  822.         // ...screwing the system
  823.     };
  824.    
  825. //---------------------------------------------------------------------------------------------
  826. // Window_Quests
  827. //---------------------------------------------------------------------------------------------
  828.     function Window_Quests() {
  829.         this.initialize.apply(this, arguments);
  830.     };

  831.     Window_Quests.prototype = Object.create(Window_Command.prototype);
  832.     Window_Quests.prototype.constructor = Window_Quests;
  833.    
  834.     Window_Quests.prototype.initialize = function() {
  835.         var xx = (GameusScripts["Config"]["QuestSystem"]["Reverse Layout"] || "false").toLowerCase() === "true" ? Graphics.boxWidth - 320 : 0;
  836.         var yy = String(GameusScripts["Config"]["QuestSystem"]["Filter Position"]).toLowerCase() === "top" ? this.fittingHeight(1) : 0;
  837.         // Stores all quests available from $gameParty
  838.         this.qFilters = ["all", "progress", "completed", "failed"];
  839.         this.filterIndex = 0;
  840.         this.data = [];
  841.         this.cats = $gameQuests.categories();
  842.         this.expanded = [];
  843.         for (var i = 0; i < this.cats.length; i += 1)
  844.             this.expanded[i] = false;
  845.         this.filter = "all";
  846.         this.refreshQuests();
  847.         Window_Command.prototype.initialize.call(this, xx, yy);
  848.     };
  849.    
  850.     Window_Quests.prototype.windowWidth = function() {
  851.         return 320;
  852.     };

  853.     Window_Quests.prototype.numVisibleRows = function() {
  854.         return 10;
  855.     };
  856.    
  857.     Window_Quests.prototype.windowHeight = function() {
  858.         return Graphics.boxHeight - this.fittingHeight(1)
  859.     }
  860.    
  861.     Window_Quests.prototype.drawItem = function(index) {
  862.         var item = this._list[index];
  863.         var rect = this.itemRectForText(index);
  864.         var align = this.itemTextAlign();
  865.         this.resetTextColor();
  866.         this.changePaintOpacity(this.isCommandEnabled(index));
  867.         var tempX = 0;
  868.         if (item.symbol === "quest") {
  869.             var q = $gameQuests.get(Number(item.ext));
  870.             if (q.icon > -1 && (GameusScripts["Config"]["QuestSystem"]["Use Icons"]).toLowerCase() === "true") {
  871.                 this.drawIcon(q.icon, rect.x + 8, rect.y + 2);
  872.                 tempX = 40;
  873.             }
  874.         }
  875.         this.drawText(this.commandName(index), rect.x + tempX / 2, rect.y, rect.width, align);
  876.     };
  877.    
  878.    
  879.     Window_Quests.prototype.questData = function(quest_id) {
  880.         return $gameQuests.get(quest_id);
  881.     };
  882.    
  883.     Window_Quests.prototype.refreshQuests = function() {
  884.         this.data = $gameParty.getQuests();
  885.         this.cats = $gameQuests.categories();
  886.         this.counter = [];
  887.         for (var i = 0; i < this.cats.length; i += 1)
  888.             this.expanded[i] = false;
  889.         for (var i = 0; i < this.cats.length; i += 1) {
  890.             this.counter[i] = 0;
  891.             for (var j = 0; j < this.data.length; j += 1) {
  892.                 var q = $gameQuests.get(this.data[j]);
  893.                 if (q.cat == i && (this.filter == q.status || this.filter == "all"))
  894.                     this.counter[i] += 1;
  895.             }
  896.         }
  897.     };

  898.     Window_Quests.prototype.setFilter = function(filter) {
  899.         this.filter = filter;
  900.     };

  901.     Window_Quests.prototype.toggle = function(cat) {
  902.         this.expanded[cat] = !this.expanded[cat];
  903.         this.refresh();
  904.     };
  905.    
  906.     Window_Quests.prototype.makeCommandList = function() {
  907.         var q;
  908.         var flag = false;
  909.         var count = "";
  910.         var useCats   = (GameusScripts["Config"]["QuestSystem"]['Use Categories'] || "false").toLowerCase();
  911.         var catMode   = Number(GameusScripts["Config"]["QuestSystem"]["Show Empty Categories"] || 0);
  912.         var showCount = (GameusScripts["Config"]["QuestSystem"]["Show Quest Count"] || "false").toLowerCase();
  913.         if (useCats === "true") {
  914.             for (var i = 0; i < this.cats.length; i += 1) {
  915.                 flag = true;
  916.                 if (showCount === "true")
  917.                     count = " (" + String(this.counter[i]) + ")";
  918.                 if (catMode == 1 && this.counter[i] == 0)
  919.                     flag = false;
  920.                 if (catMode > 0 || this.counter[i] > 0)
  921.                     this.addCommand(this.cats[i] + count, "cat", flag, String(i));
  922.                 if (this.expanded[i]) {
  923.                     flag = false;
  924.                     for (var j = 0; j < this.data.length; j += 1) {
  925.                         q = $gameQuests.get(this.data[j]);
  926.                         if ((q.status == this.filter || this.filter == "all") && i == q.cat) {
  927.                             flag = true;
  928.                             this.addCommand("  " + q.name, "quest", true, q.questId);
  929.                         }
  930.                     }
  931.                     if (!flag)
  932.                         this.addCommand("  " + GameusScripts["Config"]["QuestSystem"]["No Quests Text"] || "No Quests", "none");
  933.                 }
  934.             }
  935.         } else {
  936.             for (var i = 0; i < this.data.length; i += 1) {
  937.                 q = $gameQuests.get(this.data[i]);
  938.                 if (q.status == this.filter || this.filter == "all")
  939.                     this.addCommand(q.name, "quest", true, q.questId);
  940.             }
  941.         }
  942.         if (this._list.length < 1) {
  943.             this.addCommand(GameusScripts["Config"]["QuestSystem"]["No Quests Text"] || "No Quests", "none");
  944.         }
  945.     };
  946.    
  947.     Window_Quests.prototype.cursorRight = function(wrap) {
  948.         this.filterIndex = this.filterIndex + 1 > 3 ? 0 : this.filterIndex + 1;
  949.         this.filter = this.qFilters[this.filterIndex];
  950.         this.refreshQuests();
  951.         this.refresh();
  952.         this.select(0);
  953.     };

  954.     Window_Quests.prototype.cursorLeft = function(wrap) {
  955.         this.filterIndex = this.filterIndex - 1 < 0 ? 3 : this.filterIndex - 1;
  956.         this.filter = this.qFilters[this.filterIndex];
  957.         this.refreshQuests();
  958.         this.refresh();
  959.         this.select(0);
  960.     };
  961. //---------------------------------------------------------------------------------------------
  962. // Window_QuestFilter
  963. //---------------------------------------------------------------------------------------------
  964.     function Window_QuestFilter() {
  965.         this.initialize.apply(this, arguments);
  966.     }

  967.     Window_QuestFilter.prototype = Object.create(Window_Base.prototype);
  968.     Window_QuestFilter.prototype.constructor = Window_QuestFilter;

  969.     Window_QuestFilter.prototype.initialize = function() {
  970.         this.qFilters = [
  971.             GameusScripts["Config"]["QuestSystem"]["All Word"],
  972.             GameusScripts["Config"]["QuestSystem"]["In-Progress Word"],
  973.             GameusScripts["Config"]["QuestSystem"]["Completed Word"],
  974.             GameusScripts["Config"]["QuestSystem"]["Failed Word"],
  975.         ];
  976.         var xx = (GameusScripts["Config"]["QuestSystem"]["Reverse Layout"] || "false").toLowerCase() === "true" ? Graphics.boxWidth - 320 : 0;
  977.         var yy = String(GameusScripts["Config"]["QuestSystem"]["Filter Position"]).toLowerCase() === "top" ? 0 : Graphics.boxHeight - this.windowHeight();
  978.         this.filterIndex = 0;
  979.         this.filter = "";
  980.         var width = this.windowWidth();
  981.         var height = this.windowHeight();
  982.         Window_Base.prototype.initialize.call(this, xx, yy, width, height);
  983.         this.refresh();
  984.     };

  985.     Window_QuestFilter.prototype.windowWidth = function() {
  986.         return 320;
  987.     };

  988.     Window_QuestFilter.prototype.windowHeight = function() {
  989.         return this.fittingHeight(1);
  990.     };

  991.     Window_QuestFilter.prototype.refresh = function() {
  992.         if (this.filter == this.qFilters[this.filterIndex])
  993.             return;
  994.         this.filter = this.qFilters[this.filterIndex];
  995.         this.contents.clear();
  996.         this.drawText(this.filter, 0, 0, this.contentsWidth(), "center");
  997.     };
  998. //---------------------------------------------------------------------------------------------
  999. // Scene_Quest
  1000. //---------------------------------------------------------------------------------------------
  1001.     function Scene_Quest() {
  1002.         this.initialize.apply(this, arguments);
  1003.     };

  1004.     Scene_Quest.prototype = Object.create(Scene_MenuBase.prototype);
  1005.     Scene_Quest.prototype.constructor = Scene_Quest;   

  1006.     Scene_Quest.prototype.initialize = function() {
  1007.         Scene_MenuBase.prototype.initialize.call(this);
  1008.     };
  1009.    
  1010.     Scene_Quest.prototype.create = function() {
  1011.         Scene_MenuBase.prototype.create.call(this);
  1012.         this.qFilters = ["all", "progress", "completed", "failed"];
  1013.         this.createQuestWindow();
  1014.     };
  1015.    
  1016.     Scene_Quest.prototype.createQuestWindow = function() {
  1017.         this.oldIndex = 0;
  1018.         this.questWindow = new Window_Quests();
  1019.         this.questWindow.setHandler("cat", this.handleCategory.bind(this));
  1020.         this.questWindow.setHandler("quest", this.handleQuest.bind(this));
  1021.         this.questWindow.setHandler("cancel", this.popScene.bind(this));
  1022.         this.addWindow(this.questWindow);
  1023.         this.questInfo = new Window_QuestInfo();
  1024.         this.questInfo.setHandler("cancel", this.cancelInfo.bind(this));
  1025.         this.addWindow(this.questInfo);
  1026.         this.questFilter = new Window_QuestFilter();
  1027.         this.addWindow(this.questFilter);
  1028.     };
  1029.    
  1030.     Scene_Quest.prototype.update = function() {
  1031.         var index = this.questWindow.index();
  1032.         if (this.oldIndex != index) {
  1033.             var q = this.questWindow._list[index];
  1034.             if (q.symbol === "quest")
  1035.                 this.questInfo.setQuest(q.ext);
  1036.             else
  1037.                 this.questInfo.setQuest(-1);
  1038.             this.oldIndex = index;
  1039.         }
  1040.         this.questFilter.filterIndex = this.questWindow.filterIndex;
  1041.         this.questFilter.refresh();
  1042.         Scene_Base.prototype.update.call(this);
  1043.     };
  1044.    
  1045.     Scene_Quest.prototype.cancelInfo = function() {
  1046.         this.questWindow.activate();
  1047.         this.questInfo.deactivate();
  1048.     }
  1049.    
  1050.     Scene_Quest.prototype.handleQuest = function() {
  1051.         this.questWindow.deactivate();
  1052.         this.questInfo.activate();
  1053.     };
  1054.    
  1055.     Scene_Quest.prototype.handleCategory = function() {
  1056.         var catIndex = this.questWindow.currentExt();
  1057.         this.questWindow.toggle(catIndex);
  1058.         this.questWindow.refresh();
  1059.         this.questWindow.activate();
  1060.     };

  1061.     // This is used to open up the Quest Log from the menu
  1062.     // Used in conjunction with Yanfly's Menu plugin
  1063.     Scene_Menu.prototype.commandQuest = function() {
  1064.         SceneManager.push(Scene_Quest);
  1065.     };
  1066.    
  1067. // TextManager.quest = "任务";
复制代码
回复

使用道具 举报

梦石
0
星屑
79
在线时间
39 小时
注册时间
2016-2-12
回帖
12
发表于 2016-2-24 19:33:08 | 显示全部楼层
tseyik 发表于 2016-2-24 17:26
任務系統.js

獨立的任務編輯器

{:2_267:}万分感谢
回复

使用道具 举报

梦石
0
星屑
289
在线时间
89 小时
注册时间
2012-9-29
回帖
20
发表于 2020-7-31 11:14:24 | 显示全部楼层
基本上,這個任務先這樣設定......這內容完全不是重點。



然後去地圖上新增一個事件,可以什麼話都不說,把以下插件命令加進去。
這個指令代表在任務視窗中增加1號任務,如上圖編號所示。



接著可以隨便設定這個任務的走向,請使用 Quest NextStep 1指令,
後面的1指的是任務ID,不是跳幾步喔。




至於我的MMM是這樣設定的。就照著它的格式去寫大致上沒有問題。
我寫在 9 會讓任務選項出現在選單最上方OTZ
TextManager.quest只是純粹為了配合它的格式......
如果你完全不想動到 js 檔,就直接把 TextManager.quest 改成「"任務"」(要有引號)就好。




如下圖,



完整說明

* ----------------------------------------------------
* 插件指令清單
* QuestID:任務編號
* ----------------------------------------------------
* Quest Add QuestID
*   在任務介面新增任務。
*
* Quest NextStep QuestID
*   讓任務進行到下一步。
*
* Quest BackStep QuestID
*   讓任務退回到上一步。現在正在進行的步驟會被回退,不管此步進行到何處。
*
* Quest Complete QuestID
*   讓任務完成。如果自動報酬是開著的,那麼這個指令同時也會給出報酬。
*
* Quest Fail QuestID
*   讓任務失敗。
*
* Quest Remove QuestID
*   將任務從任務清單中移出。
*
* Quest Reset QuestID
*   重置任務。這個任務的一切都會回到最開始接下的狀態。
*   特別注意到,你為這個任務自己安排的開關和變數要自己重置!
*
* Quest Open
*   打開任務視窗。意義等同於SceneManager.push(Scene_Quest)。
*
* ----------------------------------------------------
* 這裡是可以使用在條件分歧裡的腳本指令清單
* ----------------------------------------------------
* SceneManager.push(Scene_Quest)
*   打開任務視窗。與Quest Open相同但適用於跨插件呼叫,或對SceneManager.push特別喜愛者。
*
* $gameQuests.get(quest_id).completed()
* $gameQuests.get(quest_id).failed()
* $gameQuests.get(quest_id).inProgress()
*   用於取得某個任務的狀態和進度。
*   注意:即使隊伍在可能並沒有該任務的情形下,依然會回傳true/false!
*
* $gameParty.hasQuest(quest_id)
*   用於取得隊伍是否開啟了這項任務。請與上面的指令合併使用以避免誤判。
*
* $gameParty.hasQuests([quest ids], filter)
*   此指令一次檢測隊伍是否開啟了某些任務,以及它們是否全部在某個類別中。請勿與上面的指令搞混。
*   過濾子可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*   如果以上條件都滿足,則回傳true。
*   例如,可以使用在接取某任務前,確認該任務必須完成的一海票前置任務。
*
* $gameQuests.get(quest_id).currentStep
* 取得某個任務正進行到哪個階段數。可以藉由"控制變數"事件的腳本取得任務階段id
* $gameQuests.get(quest_id).currentStep === step_number
*   用於取得某個任務正進行到哪個階段。階段數從0開始。
*   注意:即使該任務並未開啟,此指令仍然會回傳數字!請與$gameParty.hasQuest(quest_id)並用!
*
* $gameQuests.get(quest_id).status === "status"
*   用於取得某個任務的狀態。
*   "status"可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*  
* $gameQuests.totalQuests(filter)
*   用於取得某狀態下有多少任務。
*   過濾子可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。
*   這個指令會取得該狀態所有類別的任務,不管隊伍是否擁有!
*
* $gameParty.totalQuests(filter)
*   與上面指令相同,但只會取得隊伍擁有的任務。
*
* ============================================================================


最後,
在巴哈姆特論壇那裏 ,中文化作者JEK同時修復了一個很小的bug而我將此中文化做個小幅度更新


GameusQuestSystem中文化.zip

9.7 KB, 下载次数: 127

繁體

回复 1 0

使用道具 举报

梦石
0
星屑
1121
在线时间
200 小时
注册时间
2020-9-28
回帖
43
发表于 2023-5-19 07:53:30 | 显示全部楼层
wasami007 发表于 2020-7-31 11:14
基本上,這個任務先這樣設定......這內容完全不是重點。

$gameParty.hasQuests([quest ids], filter)
*   此指令一次檢測隊伍是否開啟了某些任務,以及它們是否全部在某個類別中。請勿與上面的指令搞混。
*   過濾子可以是"progress"(進行中)、"completed"(已完成)或"failed"(已失敗)。

我的设置是 $gameParty.hasQuests([1], filter)
1任务是无效的,要第几階段,要怎么弄,我没看懂?
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部