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

Project1

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

[已经解决] 请问下这个合成系统怎样从主菜单中移除

[复制链接]

Lv1.梦旅人

梦石
0
星屑
128
在线时间
109 小时
注册时间
2013-8-10
帖子
46
跳转到指定楼层
1
发表于 2016-2-27 10:17:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
JAVASCRIPT 代码复制
  1. //==
  2. // Recipe Crafting MV Version 1.3b
  3. //==
  4.  
  5. /*:
  6.  * @plugindesc 带一些东西. .,让他们到其他物品!这是制作~
  7.  * @author Vlue (with additions from DragonPC and MuteDay)
  8.  *
  9.  * @param Categories
  10.  * @desc 各种类别的制作
  11.  * @default "Alchemy","Blacksmith","Tailor","Dismantle"  “炼金术”、“铁匠”,“裁缝”、“拆除”
  12.  *
  13.  * @param Dismantle Category
  14.  * @desc 拆除对象类别名称(类别名称相同)
  15.  * @default Dismantle
  16.  *
  17.  * @param User Definable Max Level
  18.  * @desc 定义的最大级别的球员可以达到制作界面(默认- 99)
  19.  * @default 99
  20.  *
  21.  * @param Category Icons
  22.  * @desc 制作的图标(指数)使用类别
  23.  * @default 219,223,225,242
  24.  *
  25.  * @param Player Level Icon
  26.  * @desc 图标显示的球员水平(如适用)在制定菜单
  27.  * @default 82
  28.  *
  29.  * @param Crafting XP Formula
  30.  * @desc 实验需要确定当前工艺水平(级)
  31.  * @default 100 * lvl
  32.  *
  33.  * @param Dismantling Base Rate
  34.  * @desc 默认的拆除成功率(每材料)
  35.  * @default 80
  36.  *
  37.  * @param Dismantling Base Return
  38.  * @desc 违约率的材料返回拆除
  39.  * @default 50
  40.  *
  41.  * @param Craft Multiple
  42.  * @desc 允许制作多个项目
  43.  * @default true
  44.  *
  45.  * @param Menu Craft Options
  46.  * @desc 是否允许制作从菜单(,看来,工艺)
  47.  * @default craft
  48.  *
  49.  * @param Display Parameters
  50.  * @desc 从配方的窗口包括/排除各种细节
  51.  * @default gold:true, chance:true, plevel:true, clevel:true
  52.  *
  53.  * @param Main Menu String
  54.  * @desc 字符串显示在主菜单的制作
  55.  * @default Crafting
  56.  *
  57.  * @param Required Level Text
  58.  * @desc 改变文本要求的水平。(默认-要求的水平:)
  59.  * @default Required level:
  60.  *
  61.  * @param Required Material Text
  62.  * @desc 改变文本所需的材料。(默认-所需材料:)
  63.  * @default Required materials:
  64.  *
  65.  * @param Returned Material Text
  66.  * @desc 改变材料返回文本。反向制作(默认-材料:返回)
  67.  * @default Returned materials:
  68.  *
  69.  * @param Reverse Recipe Prefix
  70.  * @desc 字符串附加到反向食谱配方名称(defualt -拆除)
  71.  * @default Dismantle
  72.  *
  73.  * @param Success Rate Text
  74.  * @desc 改变文本的成功率。(默认-成功率:)
  75.  * @default Success rate:
  76.  *
  77.  * @param Crafting Cost Text
  78.  * @desc 改变文本的制作成本。(默认-制作成本:)
  79.  * @default Crafting costs:
  80.  *
  81.  * @param Crafting Text
  82.  * @desc 改变制作文本。(默认-工艺)
  83.  * @default Craft
  84.  *
  85.  * @param Crafted Text
  86.  * @desc 改变了文本。(默认——精心制作!)
  87.  * @default Crafted!
  88.  *
  89.  * @param Crafting Failed
  90.  * @desc 改变制作失败的文本。(默认-制作失败!)
  91.  * @default Crafting failed!
  92.  *
  93.  * @param Dismantle Text
  94.  * @desc 改变文本拆除。(默认-拆除)
  95.  * @default Dismantle
  96.  *
  97.  * @param Dismantled Text
  98.  * @desc 改变文本拆除。(默认——了!)
  99.  * @default obtained!
  100.  *
  101.  * @param Dismantle Fail
  102.  * @desc 改变拆除失败文本(默认——没有物品了!)
  103.  * @default No items obtained!
  104.  *
  105.  * @param Max Level Test
  106.  * @desc 文本显示,当达到最大水平的职业。
  107.  * @default MAX LEVEL
  108.  *
  109.  * @param Success 0-20 Color
  110.  * @desc 改变颜色的百分比(默认- 18)
  111.  * @default 18
  112.  *
  113.  * @param Success 20-40 Color
  114.  * @desc 改变颜色的百分比(默认- 20)
  115.  * @default 20
  116.  *
  117.  * @param Success 40-60 Color
  118.  * @desc 改变颜色的百分比(默认- 20)
  119.  * @default 21
  120.  *
  121.  * @param Success 60-80 Color
  122.  * @desc 改变颜色的百分比(默认- 20)
  123.  * @default 17
  124.  *
  125.  * @param Success 80-100 Color
  126.  * @desc 改变颜色的百分比(默认- 20)
  127.  * @default 29
  128.  *
  129.  * @param Crafting Succeded Sound
  130.  * @desc 改变制作成功的声音。(区分大小写)(默认- Item3)
  131.  * @default Item3
  132.  *
  133.  * @param Success Sound Volume
  134.  * @desc 改变制作成功了音量。(默认- 90)
  135.  * @default 90
  136.  *
  137.  * @param Crafting Failed Sound
  138.  * @desc 改变制作失败的声音。(区分大小写)(默认-尖叫)
  139.  * @default Buzzer2
  140.  *
  141.  * @param Fail Sound Volume
  142.  * @desc 改变制作失败的音量。(默认- 90)
  143.  * @default 90
  144.  *
  145.  * @help 配方制作MV v1.3b !
  146. *在twitter上关注我:[url]https://twitter.com/DaimoniousTails[/url]
  147. *或facebook:[url]https://www.facebook.com/DaimoniousTailsGames/[/url]
  148. *为最近更新!
  149. *在这里找到我所有的工作:[url]http://daimonioustails.weebly.com/[/url]
  150.  *
  151.   *插件命令:
  152.  *  crafting call categoryName            (Example: crafting call Alchemy)(例子:制作调用炼金术)
  153.  *  crafting learn recipeID               (Example: crafting learn 1)(例如:制定学习1)
  154.  *  crafting forget recipeID     制作忘记recipeID
  155.  *
  156.  * Script Calls:
  157.  *  $gameParty.recipeKnown(recipeId)          (检查是否一个特定的食谱已知或不)
  158.  *  $gameparty.getCraftLevel(craftingName) (返回当前级别的具体工艺)
  159.  *
  160.  * 配方的设置
  161.  *食谱中创建一个文本文件命名的食谱。txt和放置在
  162.  *  /data 文件夹。如果你注意到你可能没有食谱
  163. *在错误的地方或者不正确命名!
  164.  *
  165.  *  <recipe#>
  166.  *   result:{type:"itemtype", id:itemId, amount:numberCrafted}   
  167.  *   <materials>                                 (itemtype is one of: "item","weapon",or "armor")
  168.  *    {type:"itemtype", id:itemId, amount:numberRequired, cons:consumed?, rate:0-100, bonus:true/false}
  169.  *    { + as many as you need }                          
  170.  *   <materials>
  171.  *   category:CategoryOfCraft                           (Name i.e. Blacksmith)
  172.  *   goldCost:costInGold                                (Number)
  173.  *   success:successRateBase                            (Number, 0 = 0%, 100 = 100%)
  174.  *   successGain:successRateChangePerLevelDifference    (Number, %)
  175.  *   level:levelRequired                                (Number)
  176.  *   xp:craftingExpEarned                               (Number)
  177.  *   xpDeprac:lossOfExpPerLevelDifference               (Number)
  178.  *   craftLevel:craftingLevelRequired                   (Number)
  179.  *   pxp:PlayerExpEarned                                (Number)
  180.  *   reverse:whetherReverseRecipe                                                (Boolean i.e. true)
  181.  *   craftMultiple:allowMultipleCrafts                  (Boolean i.e. true)
  182.  *   known:whetherRecipeIsKnownFromStart                (Boolean i.e. true)
  183.  *   returnRate:%ofMaterialsFromDismantle               (Number, 0 = 0%, 100 = 100%)
  184.  *  <recipe#>
  185.  *
  186.  *  从goldCost craftMultiple是可选的(将被设置为默认值0 - 1)
  187. *反向食谱开关结果和材料价值(成本核算结果,返回材料)
  188. *反过来食谱的机会获得材料的速度值。
  189. *奖金材料是来自拆除的材料(不包括在制作)。
  190.  *
  191.  *  Simplest recipe (example):
  192.  *   <recipe1>
  193.  *    recipe:{type:"armor", id:3, amount:1}
  194.  *    <materials>
  195.  *     {type:"armor", id:1, amount:3, cons:false}
  196.  *    <materials>
  197.  *    category:Blacksmith
  198.  *   <recipe1>
  199.  *
  200.  *  Full Recipe (example):
  201.  *   <recipe1>
  202.  *    result:{type:"armor", id:3, amount:1}
  203.  *    <materials>
  204.  *    {type:"weapon", id:3, amount:3, cons:false}
  205.  *    {type:"armor", id:2, amount:3, cons:false}
  206.  *    <materials>
  207.  *    goldCost:0
  208.  *    success:80
  209.  *    successGain:2
  210.  *    level:1
  211.  *    category:Alchemy
  212.  *    xp:10
  213.  *    xpDeprac:2
  214.  *    craftLevel:1
  215.  *    pxp:5
  216.  *    craftMultiple:true
  217.  *    known:true
  218.  *   <recipe1>
  219.  *
  220.  */
  221.  
  222. var $gameRecipes = null;
  223.  
  224. function Scene_Crafting() {
  225.                 this.initialize.apply(this, arguments);
  226.         }
  227. Scene_Crafting.prototype = Object.create(Scene_MenuBase.prototype);
  228. Scene_Crafting.prototype.constructor = Scene_Crafting;
  229.  
  230. (function() {
  231.  
  232.         var parameters = PluginManager.parameters('RecipeCrafting');
  233.         var categoryNames = eval("[" + (parameters['Categories'] || '"炼金","锻造","裁缝"') + "]");
  234.         var dismantleText = parameters['Dismantle Category'] || "Dismantle";
  235.         var categoryIcons = eval("[" + (parameters['Category Icons'] || "371,368,373,375") + "]");
  236.         var xpFormula = parameters['Crafting XP Formula'] || "20 * lvl";
  237.         var dsmBaseRate = Number(parameters['Dismantling Base Rate'] || 80);
  238.         var dsmBaseReturn = Number(parameters['Dismantling Base Return'] || 50);
  239.         var craftMultiple = (parameters['Craft Multiple'] || "true").toLowerCase() == "true";
  240.         var craftFromMenu = parameters['Menu Craft Options'] || "craft";
  241.         var craftingMenuString = parameters['Main Menu String'] || "制作技能"
  242.         var tempdParam = "gold:true, chance:true, plevel:true, clevel:true"
  243.         var displayParam = eval( "( { " + (parameters['Display Parameters'] || tempdParam) + " } )");
  244.         var playerLevelIcon = parameters['Player Level Icon'] || 82;
  245.         var reqlevel = parameters['Required Level Text'] || '制作级别:';
  246.     var reqmaterial = parameters['Required Material Text'] || '需要物品:';
  247.         var matreturn = parameters['Return Material Text'] || 'Returned materials:';
  248.         var reversePrefix = parameters['Reverse Recipe Prefix'] || 'Dismantle';
  249.     var sucRate = parameters['Success Rate Text'] || '成功率:';
  250.     var craCost = parameters['Crafting Cost Text'] || '制作成本:';
  251.     var craText = parameters['Crafting Text'] || '制作';
  252.         var dsmText = parameters['Dismantle Text'] || '拆除';
  253.     var craftedText = parameters['Crafted Text'] || '制作完成!';
  254.         var dismantledText = parameters['Dismantled Text'] || '得到!'
  255.     var craFailed = parameters['Crafting Failed'] || 'Crafting failed!';
  256.         var dsmFailed = parameters['Dismantle Fail'] || 'No items obtained!';
  257.     var MLT = parameters['Max Level Test'] || 'MAX LEVEL';
  258.     var success = parameters['Crafting Succeded Sound'] || 'Item3';
  259.     var failure = parameters['Crafting Failed Sound'] || 'Buzzer2';
  260.     var failureVol = Number(parameters['Fail Sound Volume'] || 90);
  261.     var successVol = Number(parameters['Success Sound Volume'] || 90);
  262.     var UDML = Number(parameters['User Definable Max Level'] || 99);
  263.     var colorCPV1 = Number(parameters['Success 0-20 Color'] || 18);
  264.     var colorCPV2 = Number(parameters['Success 20-40 Color'] || 20);
  265.     var colorCPV3 = Number(parameters['Success 40-60 Color'] || 21);
  266.     var colorCPV4 = Number(parameters['Success 60-80 Color'] || 17);
  267.     var colorCPV5 = Number(parameters['Success 80-100 Color'] || 29);
  268.  
  269.         var categoryEventName = "";
  270.         var craftingFromMenu = false;
  271.  
  272.         TextManager.getErrorDetails = function() {
  273.                 if($gameMap) {
  274.                         return "[Map: " + $gameMap._mapId + "] [Event: " + $gameMap._interpreter._eventId + "] : \n"
  275.                 }
  276.         }
  277.         DataManager.loadRecipeFile = function() {
  278.                 var xml = new XMLHttpRequest();
  279.                 var url = "data/Recipes.txt";
  280.                 xml.onload = function() {
  281.                         if(xml.status < 400) {
  282.                                 DataManager.createRecipes(xml.responseText);
  283.                         }
  284.                 }
  285.                 xml.open("GET",url,true);
  286.                 xml.send();
  287.         }
  288.         var crafting_DataManager_createGameObjects = DataManager.createGameObjects;
  289.         DataManager.createGameObjects = function() {
  290.                 crafting_DataManager_createGameObjects.call(this);
  291.                 this.loadRecipeFile();
  292.         }
  293.         DataManager.createRecipes = function(recipeData) {
  294.                 var recipes = [0];
  295.                 if(recipeData) {
  296.                         var numberOfRecipes = recipeData.match(/<recipe(\d+)>/g).length / 2;
  297.                         for(var i = 1;i <= numberOfRecipes;i++) {
  298.                                 var recipeString = recipeData.match(new RegExp("<recipe" + i + '>([^.]+)<recipe' + i + ">"));
  299.                                 if(recipeString) {
  300.                                         recipes.push(new Recipe(i,this.createRecipeStruct(i, recipeString)));
  301.                                 } else {
  302.                                         throw new Error("Recipe list: Could not get data for recipe ID# " + i + ". Check your setup.");
  303.                                 }
  304.                         }
  305.                 }
  306.                 $gameRecipes = recipes;
  307.         }
  308.         DataManager.createRecipeStruct = function(id, recipeData) {
  309.                 if(!recipeData[1].match(/result:/)) {
  310.                         throw new Error("Recipe List: Recipe ID# " + id + " does not have a result.")
  311.                 }
  312.                 if(recipeData[1].match(/result:/g).length > 1) {
  313.                         throw new Error("Recipe List: Possible repeated recipe ID. (ID #" + id + ")");
  314.                 }
  315.                 var recipeStruct = {};
  316.                 recipeStruct.result = recipeData[1].match(/result:(.+)/);
  317.                 recipeStruct.reverse = recipeData[1].match(/reverse:(.+)/);
  318.                 var materialData = recipeData[1].match(/<materials>([^.]+)<materials>/);
  319.                 if(materialData) {
  320.                         materialData = eval( "[" + materialData[1].split("}").join("},") + "]" );
  321.                 } else {
  322.                         throw new Error("Recipe List: Recipe ID# " + id + " does not have a proper material setup.")
  323.                 }
  324.                 recipeStruct.materials = materialData;
  325.                 recipeStruct.goldCost = recipeData[1].match(/goldCost:(.+)/);
  326.                 recipeStruct.success = recipeData[1].match(/success:(.+)/);
  327.                 recipeStruct.successGain = recipeData[1].match(/successGain:(.+)/);
  328.                 recipeStruct.level = recipeData[1].match(/level:(.+)/);
  329.                 recipeStruct.category = recipeData[1].match(/category:(.+)/);
  330.                 recipeStruct.xp = recipeData[1].match(/xp:(.+)/);
  331.                 recipeStruct.xpDeprac = recipeData[1].match(/xpDeprac:(.+)/);
  332.                 recipeStruct.craftLevel = recipeData[1].match(/craftLevel:(.+)/);
  333.                 recipeStruct.playerXp = recipeData[1].match(/pxp:(.+)/);
  334.                 recipeStruct.multiple = recipeData[1].match(/craftMultiple:(.+)/);
  335.                 recipeStruct.known = recipeData[1].match(/known:(.+)/);
  336.                 recipeStruct.returnRate = recipeData[1].match(/returnRate:(.+)/);
  337.                 return recipeStruct;
  338.         }
  339.  
  340.         function Recipe() {
  341.                 this.initialize.apply(this, arguments);
  342.         }
  343.         Recipe.prototype.initialize = function(id, recipe) {
  344.                 this._id = id;
  345.                 try {
  346.                         this._result = new Material(eval("("+recipe.result[1]+")"));
  347.                 } catch(e) {
  348.                         throw new Error("Recipe List: Recipe ID# " + id + " does not have a proper result set up.")
  349.                 }
  350.                 this._returnRate = recipe.returnRate ? Number(recipe.returnRate[1]) : dsmBaseReturn;
  351.                 this._materials = [];
  352.                 for(var i = 0;i < recipe.materials.length;i++) {
  353.                         this._materials.push(new Material(recipe.materials[i], this._returnRate));
  354.                 }
  355.                 if(this._materials.length == 0) {
  356.                         throw new Error("Recipe List: Recipe ID# " + id + " does not have any set materials.")
  357.                 }
  358.                 this._goldCost = recipe.goldCost ? Number(recipe.goldCost[1]) : 0;
  359.                 this._success = recipe.success ? Number(recipe.success[1]) : 100;
  360.                 this._successGain = recipe.successGain ? Number(recipe.successGain[1]) : 0;
  361.                 this._level = recipe.level ? Number(recipe.level[1]) : 0;
  362.                 this._category = recipe.category ? recipe.category[1] : categoryNames[0];
  363.                 this._xp = recipe.xp ? Number(recipe.xp[1]) : 100;
  364.                 this._xpDeprac = recipe.xpDeprac ?  Number(recipe.xpDeprac[1]) : 0;
  365.                 this._craftLevel = recipe.craftLevel ? Number(recipe.craftLevel[1]) : 1;
  366.                 this._pxp = recipe.playerXp ? Number(recipe.playerXp[1]) : 0;
  367.                 this._craftMultiple = (recipe.multiple ? recipe.multiple[1] : "true").toLowerCase() == "true";
  368.                 this._known = (recipe.known ? recipe.known[1] : "true").toLowerCase() == "true";
  369.                 this._reverse = (recipe.reverse ? recipe.reverse[1] : "true").toLowerCase() == "true";
  370.         }
  371.         Recipe.prototype.name = function(reverse) {
  372.                 return reverse ? reversePrefix + this._result.name() : this._result.name();
  373.         }
  374.         Recipe.prototype.hasMaterials = function(reverse) {
  375.                 if(reverse) {
  376.                         if($gameParty.numItemsCrafting(this._result._item) < 1) { return false; }
  377.                 } else {
  378.                         for(var i = 0;i < this._materials.length;i++) {
  379.                                 var material = this._materials[i];
  380.                                 if(material._bonus) { continue; }
  381.                                 if($gameParty.numItemsCrafting(material._item) < material._amount) {return false;}
  382.                         }
  383.                 }
  384.                 return true;
  385.         }
  386.         Recipe.prototype.hasGold = function() { return $gameParty.gold() >= this._goldCost;}
  387.         Recipe.prototype.hasCraftLevel = function() { return this._craftLevel <= $gameParty.craftLevel(this.categoryId());}
  388.         Recipe.prototype.hasLevel = function() { return this._level <= $gameParty.highestLevel() && this.hasCraftLevel();}
  389.         Recipe.prototype.craftable = function(reverse) { return this.hasGold() && this.hasMaterials(reverse) && this.hasLevel();}
  390.         Recipe.prototype.amountCraftable = function(reverse) {
  391.                 var amount = null;
  392.                 if(reverse) {
  393.                         return amount = $gameParty.numItemsCrafting(this._result._item);
  394.                 } else {
  395.                         for(var i = 0;i < this._materials.length;i++) {
  396.                                 var material = this._materials[i];
  397.                                 if(material._bonus) { continue; }
  398.                                 var amountNext = 0
  399.                                 if(material._consumed) {
  400.                                         amountNext = $gameParty.numItemsCrafting(material._item) / material._amount
  401.                                 } else {
  402.                                         amountNext = $gameParty.numItemsCrafting(material._item) >= material._amount ? 99 : 0
  403.                                 }
  404.                                 if(amount) {
  405.                                         if(amountNext < amount) {amount = amountNext;}
  406.                                 } else {
  407.                                         amount = amountNext;
  408.                                 }
  409.                         }
  410.                 }
  411.                 var amountGold = this._goldCost > 0 ? $gameParty.gold() / this._goldCost : 99;
  412.                 if(amountGold < amount) {amount = amountGold;}
  413.                 return Math.floor(amount);
  414.         }
  415.         Recipe.prototype.craft = function(failRate, reverse) {
  416.                 failRate = failRate || 0;
  417.                 if(reverse) { failRate = 0; }
  418.                 this.removeMaterials(reverse);
  419.                 if(failRate < this.successRate()) {
  420.                         return this.addResult(reverse);
  421.                 }
  422.                 return [];
  423.         }
  424.         Recipe.prototype.removeMaterials = function(reverse) {
  425.                 if(reverse) {
  426.                         $gameParty.gainItem(this._result._item,-1);
  427.                 } else {
  428.                         for(var i = 0;i < this._materials.length;i++) {
  429.                                 var material = this._materials[i];
  430.                                 if(material._bonus) { continue; }
  431.                                 if(material._consumed) {
  432.                                         $gameParty.gainItem(material._item, -material._amount);
  433.                                 }
  434.                         }
  435.                         $gameParty.gainGold(-this._goldCost);
  436.                 }
  437.         }
  438.         Recipe.prototype.addResult = function(reverse) {
  439.                 var newItem = [];
  440.                 if(reverse) {
  441.                         for(var i = 0;i < this._materials.length;i++) {
  442.                                 var material = this._materials[i];
  443.                                 if(Math.random() < material._rate / 100) {
  444.                                         $gameParty.gainItem(material._item, material.returnAmount());
  445.                                         newItem.push(material);
  446.                                 }
  447.                         }
  448.                 } else {
  449.                         $gameParty.gainItem(this._result._item,this._result._amount);
  450.                         newItem.push(this._result);
  451.                         $gameParty.gainCraftExp(this.categoryId(), this.xpGain());
  452.                         for(var i = 0;i < $gameParty.members().length;i++) {
  453.                                 $gameParty.members()[i].gainExp(this._pxp);
  454.                         }
  455.                 }
  456.                 return newItem;
  457.         }
  458.         Recipe.prototype.categoryId = function() { return categoryNames.indexOf(this._category);}
  459.         Recipe.prototype.xpGain = function() {
  460.                 if($gameParty.craftLevel(this.categoryId()) > UDML) { return 0; }
  461.                 var levelDiff = $gameParty.craftLevel(this.categoryId()) - this._craftLevel;
  462.                 return Math.max(this._xp - this._xpDeprac * levelDiff,0);
  463.         }
  464.         Recipe.prototype.successRate = function() {
  465.                 var levelDiff = $gameParty.craftLevel(this.categoryId()) - this._craftLevel;
  466.                 return Math.min(this._success + this._successGain * levelDiff,100);
  467.         }
  468.         Recipe.prototype.known = function() {
  469.                 return $gameParty.recipeKnown(this._id);
  470.         }
  471.  
  472.         function Material() {
  473.                 this.initialize.apply(this, arguments);
  474.         }
  475.         Material.prototype.initialize = function(material, rate) {
  476.                 if(material.type == "item") {this._item = $dataItems[material.id];}
  477.                 if(material.type == "weapon") {this._item = $dataWeapons[material.id];}
  478.                 if(material.type == "armor") {this._item = $dataArmors[material.id];}
  479.                 this._amount = material.amount;
  480.                 this._consumed = material.cons != null ? material.cons : true;
  481.                 this._rate = material.rate || dsmBaseRate;
  482.                 this._returnRate = rate || 100;
  483.                 this._bonus = material.bonus != null ? material.bonus : false;
  484.         }
  485.         Material.prototype.name = function() {
  486.                 return this._item.name;
  487.         }
  488.         Material.prototype.returnAmount = function() {
  489.                 return this._bonus ? this._amount : Math.round(Math.max(1,this._amount * (this._returnRate / 100)));
  490.         }
  491.  
  492.         var crafting_game_party_initialize = Game_Party.prototype.initialize;
  493.         Game_Party.prototype.initialize = function() {
  494.                 crafting_game_party_initialize.call(this);
  495.                 this.createRecipeData();
  496.         }
  497.         Game_Party.prototype.createRecipeData = function() {
  498.                 this._craftingLevel = new Array(categoryNames.length);
  499.                 this._craftingExp = new Array(categoryNames.length);
  500.                 for(var i = 0;i < categoryNames.length;i++) {
  501.                         this._craftingLevel[i] = 1;
  502.                         this._craftingExp[i] = 0;
  503.                 }
  504.                 this._recipesKnown = [];
  505.                 this.resetKnownRecipes();
  506.         }
  507.         Game_Party.prototype.checkRecipeVariables = function() {
  508.                 if(!this._recipesKnown) { this.createRecipeData(); }
  509.         }
  510.         Game_Party.prototype.learnRecipe = function(id) {
  511.                 this._recipesKnown[id] = true;
  512.         }
  513.         Game_Party.prototype.forgetRecipe = function(id) {
  514.                 this._recipesKnown[id] = false;
  515.         }
  516.         Game_Party.prototype.resetKnownRecipes = function() {
  517.                 if($gameRecipes) {
  518.                         for(var i = 1;i < $gameRecipes.length;i++) {
  519.                                 if($gameRecipes[i]._known) {
  520.                                         this.learnRecipe($gameRecipes[i]._id);
  521.                                 } else {
  522.                                         this.forgetRecipe($gameRecipes[i]._id);
  523.                                 }
  524.                         }
  525.                 }
  526.         }
  527.         Game_Party.prototype.recipeKnown = function(id) {
  528.                 return this._recipesKnown[id];
  529.         }
  530.         Game_Party.prototype.craftLevel = function(id) { return this._craftingLevel[id]; }
  531.         Game_Party.prototype.craftExp = function(id) { return this._craftingExp[id]; }
  532.         Game_Party.prototype.getCraftLevel = function(string) {
  533.                 var index = categoryNames.indexOf(string)
  534.                 if(index >= 0) {
  535.                         return this.craftLevel(categoryNames.indexOf(string));
  536.                 } else {
  537.                         throw new Error(TextManager.getErrorDetails() + string + " is not a valid crafting category!");
  538.                 }
  539.         }
  540.         Game_Party.prototype.craftExpNext = function(id) {
  541.                 var string = xpFormula.replace(/\lvl/g, this.craftLevel(id));
  542.                 return eval(string);
  543.         }
  544.         Game_Party.prototype.gainCraftExp = function(id, value) {
  545.                 this._craftingExp[id] += value;
  546.                 while(this.craftExp(id) >= this.craftExpNext(id)) {
  547.                         this._craftingExp[id] -= this.craftExpNext(id);
  548.                         this._craftingLevel[id]++;
  549.                 }
  550.         }
  551.         Game_Party.prototype.numItemsCrafting = function(item) {
  552.                 if(Object.keys(PluginManager.parameters('YEP_ItemCore')).length > 0) {
  553.                         return this.numIndependentItems(item);
  554.                 } else {
  555.                         return this.numItems(item);
  556.                 }
  557.         }
  558.  
  559.         function Window_RecipeList() {
  560.                 this.initialize.apply(this, arguments);
  561.         }
  562.         Window_RecipeList.prototype = Object.create(Window_Selectable.prototype);
  563.         Window_RecipeList.prototype.constructor = Window_RecipeList;
  564.         Window_RecipeList.prototype.initialize = function(x, y, w, h) {
  565.                 Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  566.                 this.resetRecipes();
  567.         }
  568.         Window_RecipeList.prototype.maxItems = function() {
  569.                 return this._data ? this._data.length : 1;
  570.         }
  571.         Window_RecipeList.prototype.item = function() {
  572.                 return this._data && this._index >= 0 ? this._data[this._index] : null;
  573.         }
  574.         Window_RecipeList.prototype.currentItemEnabled = function() {
  575.                 return this.enable(this._data[this._index]);
  576.         }
  577.         Window_RecipeList.prototype.include = function(item) {
  578.                 if(item == 0) { return false; }
  579.                 if(!item.known()) { return false; }
  580.                 if(!item.hasCraftLevel()) { return false; }
  581.                 if(this._category == "all") {return true;}
  582.                 if(this._category == dismantleText && item._reverse) {
  583.                         return item.craftable(true); }
  584.                 return this._category == item._category;
  585.         }
  586.         Window_RecipeList.prototype.setCategory = function(category) {
  587.                 if(category == this._category) { return; }
  588.                 this._category = category;
  589.                 this.resetRecipes();
  590.         }
  591.         Window_RecipeList.prototype.isReverse = function() {
  592.                 return this._category == dismantleText;
  593.         }
  594.         Window_RecipeList.prototype.resetRecipes = function() {
  595.                 this._data = [];
  596.                 for(var i = 0;i < $gameRecipes.length;i++) {
  597.                         var recipe = $gameRecipes[i];
  598.                         if(this.include(recipe)) {this._data.push(recipe);}
  599.                 }
  600.                 this.refresh();
  601.         }
  602.         Window_RecipeList.prototype.isEnabled = function(item) {
  603.                 if(item) { return item.craftable(this.isReverse()); }
  604.                 return false;
  605.         }
  606.         Window_RecipeList.prototype.drawItem = function(index) {
  607.                 var item = this._data[index];
  608.                 if(item) {
  609.                         rect = this.itemRect(index);
  610.                         rect.width -= 4;
  611.                         this.changePaintOpacity(this.isEnabled(item));
  612.                         this.drawItemName(item, rect.x, rect.y);
  613.                         if(item.amountCraftable(this.isReverse()) > 0) {
  614.                                 this.drawText("x"+String(item.amountCraftable(this.isReverse())),rect.x,rect.y,this.contents.width,"right");
  615.                         }
  616.                 }
  617.         }
  618.         Window_RecipeList.prototype.currentItem = function() {
  619.                 return this._index >= 0 ? this._data[this._index] : null;
  620.         }
  621.         Window_RecipeList.prototype.processOk = function() {
  622.                 if (this.isCurrentItemEnabled() && this.craftMenuOk()) {
  623.                         this.playOkSound();
  624.                         this.updateInputData();
  625.                         this.callOkHandler();
  626.                 } else {
  627.                         this.playBuzzerSound();
  628.                 }
  629.         }
  630.         Window_RecipeList.prototype.craftMenuOk = function() {
  631.                 if(craftingFromMenu) {
  632.                         if(craftFromMenu == "view") { return false; }
  633.                 }
  634.                 return true;
  635.         }
  636.         Window_RecipeList.prototype.refresh = function() {
  637.                 this.createContents();
  638.                 Window_Selectable.prototype.refresh.call(this);
  639.         }
  640.         Window_RecipeList.prototype.contentsHeight = function() {
  641.                 return this.maxItems() * this.lineHeight();
  642.         }
  643.         Window_RecipeList.prototype.isCurrentItemEnabled = function() {
  644.                 return this.isEnabled(this.currentItem());
  645.         }
  646.         Window_RecipeList.prototype.drawItemName = function(recipe, x, y, width) {
  647.                 var amount = recipe._result._amount;
  648.                 item = recipe._result._item;
  649.                 width = width || 312;
  650.                 if (item) {
  651.                         var iconBoxWidth = Window_Base._iconWidth + 4;
  652.                         this.resetTextColor();
  653.                         this.drawIcon(item.iconIndex, x + 2, y + 2);
  654.                         var string = recipe.name();
  655.                         if(amount > 1) { string += " (x" + amount + ")" }
  656.                         this.drawText(string, x + iconBoxWidth, y, width - iconBoxWidth);
  657.                 }
  658.         };
  659.  
  660.         function Window_RecipeDetail() {
  661.                 this.initialize.apply(this, arguments);
  662.         }
  663.         Window_RecipeDetail.prototype = Object.create(Window_Base.prototype);
  664.         Window_RecipeDetail.prototype.constructor = Window_RecipeDetail;
  665.         Window_RecipeDetail.prototype.initialize = function(x, y, w, h) {
  666.                 Window_Base.prototype.initialize.call(this, x, y, w, h);
  667.                 this._recipe = null;
  668.         }
  669.         Window_RecipeDetail.prototype.setRecipe = function(recipe, reverse) {
  670.                 if(recipe == this._recipe) {return;}
  671.                 this._recipe = recipe;
  672.                 this._reverse = reverse || false;
  673.                 this.refresh();
  674.         }
  675.         Window_RecipeDetail.prototype.refresh = function() {
  676.                 this.contents.clear();
  677.                 if(this._recipe) {
  678.                         if(!this._reverse) {
  679.                                 if(displayParam.clevel || displayParam.plevel) {this.drawCraftLevel();}
  680.                                 if(displayParam.chance) { this.drawSuccessRate(); }
  681.                                 if(displayParam.gold) {this.drawGoldCost();}
  682.                         }
  683.                         this.drawMaterials();
  684.                 }
  685.         }
  686.         Window_RecipeDetail.prototype.drawCraftLevel = function() {
  687.                 this.changePaintOpacity(this._recipe.hasLevel());
  688.                 this.changeTextColor(this.systemColor());
  689.                 this.drawText(reqlevel,0,0,this.contents.width);
  690.                 this.changeTextColor(this.normalColor());
  691.                 var xx = 0;
  692.                 var text = "";
  693.                 if(displayParam.plevel) {
  694.                         this.drawText(String(this._recipe._level),0,0,this.contents.width,"right");
  695.                         this.drawIcon(playerLevelIcon,this.contents.width - 24 - Window_Base._iconWidth,0);
  696.                         xx += 68; //HERE
  697.                         text = String(this._recipe._craftLevel) + " |";
  698.                 } else {
  699.                         text = String(this._recipe._craftLevel);
  700.                 }
  701.                 if(displayParam.clevel) {
  702.                         this.drawText(text,0,0,this.contents.width - xx,"right");
  703.                         this.drawIcon(categoryIcons[this._recipe.categoryId()],this.contents.width - 75 - xx,0); //HERE
  704.                 }
  705.         }
  706.         Window_RecipeDetail.prototype.drawMaterials = function() {
  707.                 var yy = 20;
  708.                 if(displayParam.clevel || displayParam.plevel) {yy = this.contents.fontSize + 20;}
  709.                 if(this._reverse) { yy = 0; }
  710.                 this.changePaintOpacity(this._recipe.craftable(this._reverse));
  711.                 this.changeTextColor(this.systemColor());
  712.                 this.drawText(this._reverse ? matreturn : reqmaterial,0,yy,this.width);
  713.                 yy += this.contents.fontSize + this.textPadding();
  714.                 for(var i = 0;i < this._recipe._materials.length;i++) {
  715.                         var item = this._recipe._materials[i];
  716.                         if(!this._reverse && item._bonus) { continue; }
  717.                         if(!this._reverse) { this.changePaintOpacity($gameParty.numItemsCrafting(item._item) >= item._amount); }
  718.                         this.changeTextColor(this.normalColor());
  719.                         this.drawIcon(item._item.iconIndex,12,yy);
  720.                         this.drawText(item._item.name,12+Window_Base._iconWidth,yy,this.width);
  721.                         var string = ""
  722.                         if(this._reverse) {
  723.                                 string = "x" + String(item.returnAmount()) + " (" + String(item._rate) + "%)";
  724.                         } else {
  725.                                 var itemAmount = $gameParty.numItemsCrafting(item._item);
  726.                                 this.changeTextColor(this.textColor(itemAmount >= item._amount ? 3 : 18));
  727.                                 this.drawText(itemAmount,0,yy,this.contents.width-72,'right');
  728.                                 this.changeTextColor(this.normalColor());
  729.                                 string = " / " + String(item._amount);
  730.                         }
  731.                         this.drawText(string,0,yy,this.contents.width-12,"right");
  732.                         yy += this.contents.fontSize  + this.textPadding();
  733.                 }
  734.         }
  735.         Window_RecipeDetail.prototype.drawSuccessRate = function() {
  736.                 var successRate = this._recipe.successRate();
  737.                 this.changePaintOpacity(this._recipe.craftable(this._reverse));
  738.                 this.changeTextColor(this.systemColor());
  739.                 var yy = this.contents.height - this.contents.fontSize - this.textPadding() - 6;
  740.                 this.drawText(sucRate,0,yy,this.contents.width);
  741.                 var color = [colorCPV1,colorCPV2,colorCPV3,colorCPV4,colorCPV5,colorCPV5];
  742.                 this.changeTextColor(this.textColor(color[Math.floor(successRate/20)]));
  743.                 this.drawText(successRate + "%",0,yy,this.contents.width,"right");
  744.                 this.changeTextColor(this.normalColor());
  745.         }
  746.         Window_RecipeDetail.prototype.drawGoldCost = function() {
  747.                 if(this._recipe._goldCost > 0) {
  748.                         this.changePaintOpacity(this._recipe.hasGold());
  749.                         this.changeTextColor(this.systemColor());
  750.                         this.drawText(craCost,0,this.contents.height-this.contents.fontSize*2,this.contents.width);
  751.                         this.changeTextColor(this.normalColor());
  752.                         this.drawCurrencyValue(this._recipe._goldCost,TextManager.currencyUnit,0,this.contents.height-this.contents.fontSize*2,this.contents.width)
  753.                 }
  754.         }
  755.         Window_RecipeDetail.prototype.drawCurrencyValue = function(value, unit, x, y, width) {
  756.                 var unitWidth = Math.min(80, this.textWidth(unit));
  757.                 this.resetTextColor();
  758.                 this.changePaintOpacity(this._recipe.hasGold());
  759.                 this.drawText(value, x, y, width - unitWidth - 6, 'right');
  760.                 this.changeTextColor(this.systemColor());
  761.                 this.drawText(unit, x + width - unitWidth, y, unitWidth, 'right');
  762.         }
  763.  
  764.         function Window_RecipeConfirm() {
  765.                 this.initialize.apply(this, arguments);
  766.         }
  767.         Window_RecipeConfirm.prototype = Object.create(Window_Selectable.prototype);
  768.         Window_RecipeConfirm.prototype.constructor = Window_RecipeConfirm;
  769.         Window_RecipeConfirm.prototype.initialize = function(x, y, w, h) {
  770.                 Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  771.                 this._amount = 1;
  772.                 this.refresh();
  773.         }
  774.         Window_RecipeConfirm.prototype.itemMax = function() {return 1;}
  775.         Window_RecipeConfirm.prototype.enable = function() {return true;}
  776.         Window_RecipeConfirm.prototype.refresh = function() {
  777.                 Window_Selectable.prototype.refresh.call(this);
  778.                 this.drawText(this._reverse ? dsmText : craText,0,0,this.contents.width,"center");
  779.                 if(this._recipe && this._recipe.craftable(this._reverse)) {
  780.                         this.drawText("x" + String(this._amount),0,0,this.contents.width,"right");
  781.                 }
  782.         }
  783.         Window_RecipeConfirm.prototype.activate = function() {
  784.                 Window_Selectable.prototype.activate.call(this);
  785.                 this.select(0);
  786.         }
  787.         Window_RecipeConfirm.prototype.deactivate = function() {
  788.                 Window_Selectable.prototype.deactivate.call(this);
  789.                 this.deselect();
  790.         }
  791.         Window_RecipeConfirm.prototype.setRecipe = function(recipe, reverse) {
  792.                 if(recipe == this._recipe) { return; }
  793.                 this._recipe = recipe;
  794.                 this._reverse = reverse || false;
  795.                 this._amount = 1;
  796.                 this.refresh();
  797.         }
  798.         Window_RecipeConfirm.prototype.isCursorMovable = function() {
  799.                 return this.isOpenAndActive() && craftMultiple && this._recipe._craftMultiple;
  800.         }
  801.         Window_RecipeConfirm.prototype.cursorDown = function(wrap) { this.changeAmount(-10);}
  802.         Window_RecipeConfirm.prototype.cursorUp = function(wrap) { this.changeAmount(10);}
  803.         Window_RecipeConfirm.prototype.cursorRight = function(wrap) { this.changeAmount(1);}
  804.         Window_RecipeConfirm.prototype.cursorLeft = function(wrap) { this.changeAmount(-1);}
  805.         Window_RecipeConfirm.prototype.changeAmount = function(value) {
  806.                 SoundManager.playCursor();
  807.                 this._amount += value;
  808.                 this._amount = Math.min(Math.max(this._amount,1),this._recipe.amountCraftable(this._reverse));
  809.                 this.refresh();
  810.         }
  811.         Window_RecipeConfirm.prototype.onTouch = function(triggered) {
  812.                 if (triggered && this.isTouchOkEnabled()) {
  813.                         this.processOk();
  814.                 }
  815.         };
  816.  
  817.         Scene_Crafting.prototype.initialize = function() {
  818.                 Scene_MenuBase.prototype.initialize.call(this);
  819.         }
  820.         Scene_Crafting.prototype.create = function() {
  821.                 Scene_MenuBase.prototype.create.call(this);
  822.                 this._helpWindow = new Window_Help();
  823.                 var width = Graphics.width / 2;
  824.                 var height = Graphics.height - this._helpWindow.height;
  825.                 this._listWindow = new Window_RecipeList(0,this._helpWindow.height+72,width,height-72*2);
  826.                 this._listWindow.setHandler('ok',this.listSuccess.bind(this));
  827.                 this._listWindow.setHandler('cancel',this.cancel.bind(this));
  828.                 if(!displayParam.clevel) { this._listWindow.height += this._listWindow.fittingHeight(1); }
  829.                 this._listWindow.createContents();
  830.                 this._detailWindow = new Window_RecipeDetail(width,this._listWindow.y,width,height-72*2);
  831.                 if(!displayParam.gold) { this._detailWindow.height += this._detailWindow.fittingHeight(1); }
  832.                 this._detailWindow.createContents();
  833.                 height = this._detailWindow.y + this._detailWindow.height;
  834.                 this._confirmWindow = new Window_RecipeConfirm(width,height,width,72);
  835.                 this._confirmWindow.setHandler('ok',this.craftSuccess.bind(this));
  836.                 this._confirmWindow.setHandler('cancel',this.confirmCancel.bind(this));
  837.                 if(displayParam.gold) {
  838.                         this._goldWindow = new Window_Gold();
  839.                         this._goldWindow.width = width;
  840.                         this._goldWindow.y = Graphics.height - 72;
  841.                         this._goldWindow.x = width;
  842.                 }
  843.                 this._popupWindow = new Window_RecPopup();
  844.                 this._popupWindow.setHandler('ok',this.popupOk.bind(this));
  845.                 this._popupWindow.setHandler('cancel',this.popupOk.bind(this));
  846.                 this._commandWindow = new Window_RecCategory();
  847.                 this._commandWindow.setHandler('ok',this.commandOk.bind(this));
  848.                 this._commandWindow.setHandler('cancel',this.commandCancel.bind(this));
  849.                 if(displayParam.clevel) {this._gaugeWindow = new Window_RecGauge();}
  850.                 this.addWindow(this._helpWindow);
  851.                 this.addWindow(this._listWindow);
  852.                 this.addWindow(this._detailWindow);
  853.                 this.addWindow(this._confirmWindow);
  854.                 if(this._goldWindow) {this.addWindow(this._goldWindow);}
  855.                 this.addWindow(this._popupWindow);
  856.                 this.addWindow(this._commandWindow);
  857.                 if(this._gaugeWindow) {this.addWindow(this._gaugeWindow);}
  858.         }
  859.         Scene_Crafting.prototype.popupOk = function() {
  860.                 this._popupWindow.deactivate();
  861.                 this._popupWindow.close();
  862.                 this._listWindow.activate();
  863.         }
  864.         Scene_Crafting.prototype.update = function() {
  865.                 Scene_Base.prototype.update.call(this);
  866.                 if(this._listWindow.currentItem()) {this._helpWindow.setText(this._listWindow.currentItem()._result._item.description);}
  867.                 if(this._commandWindow.isOpenAndActive()) {
  868.                         this._helpWindow.setText("");
  869.                 }
  870.                 this._detailWindow.setRecipe(this._listWindow.currentItem(),this._listWindow.isReverse());
  871.                 this._confirmWindow.setRecipe(this._listWindow.currentItem(),this._listWindow.isReverse());
  872.                 this._listWindow.setCategory(categoryNames[this._commandWindow._index]);
  873.                 if(this._gaugeWindow) { this._gaugeWindow.setCategory(categoryNames[this._commandWindow._index]);}
  874.                 if(this._listWindow.currentItem()) {
  875.                         if(this._listWindow.currentItem().craftable(this._listWindow.isReverse())) {
  876.                                 this._confirmWindow.opacity = 255;
  877.                                 this._confirmWindow.contentsOpacity = 255;
  878.                         } else {
  879.                                 this._confirmWindow.opacity = 75;
  880.                                 this._confirmWindow.contentsOpacity = 75;
  881.                         }
  882.                 }
  883.         }
  884.         Scene_Crafting.prototype.listSuccess = function() {
  885.                 this._listWindow.deactivate();
  886.                 if(this._goldWindow) {this._goldWindow.close();}
  887.                 this._confirmWindow.activate();
  888.         }
  889.         Scene_Crafting.prototype.craftSuccess = function() {
  890.                 var amount = 0;
  891.                 var items = [];
  892.                 for(var i = 0;i < this._confirmWindow._amount;i++) {
  893.                         Array.prototype.push.apply(items, this._listWindow.currentItem().craft(Math.random() * 100,this._listWindow.isReverse()));
  894.                 }
  895.                 if(items.length > 0) {
  896.                         this._popupWindow.setText(items, amount, this._listWindow.isReverse());
  897.                 } else {
  898.                         this._popupWindow.setTextFail(this._listWindow.isReverse());
  899.                 }
  900.                 this._confirmWindow.changeAmount(-1000);
  901.                 if(this._goldWindow) {this._goldWindow.refresh();}
  902.                 this._listWindow.resetRecipes();
  903.                 if(this._gaugeWindow) {this._gaugeWindow.refresh();}
  904.                 this._popupWindow.activate();
  905.                 this._detailWindow.refresh();
  906.         }
  907.         Scene_Crafting.prototype.confirmCancel = function() {
  908.                 this._confirmWindow.deactivate();
  909.                 if(this._goldWindow) {this._goldWindow.open();}
  910.                 this._listWindow.activate();
  911.         }
  912.         Scene_Crafting.prototype.commandCancel = function() {
  913.                 craftingFromMenu = false;
  914.                 this.popScene();
  915.         }
  916.         Scene_Crafting.prototype.cancel = function() {
  917.                 this._listWindow.select(-1);
  918.                 this._helpWindow.setText("");
  919.                 this._commandWindow.activate();
  920.         }
  921.         Scene_Crafting.prototype.commandOk = function() {
  922.                 this._listWindow.select(0);
  923.                 this._listWindow.activate();
  924.         }
  925.  
  926.         function Scene_CraftingSpecific() {
  927.                 this.initialize.apply(this, arguments);
  928.         }
  929.         Scene_CraftingSpecific.prototype = Object.create(Scene_Crafting.prototype);
  930.         Scene_CraftingSpecific.prototype.constructor = Scene_CraftingSpecific;
  931.         Scene_CraftingSpecific.prototype.initialize = function() {
  932.                 Scene_Crafting.prototype.initialize.call(this);
  933.         }
  934.         Scene_CraftingSpecific.prototype.create = function() {
  935.                 Scene_Crafting.prototype.create.call(this);
  936.                 this._commandWindow._index = categoryNames.indexOf(categoryEventName);
  937.                 this._commandWindow.deactivate();
  938.                 this._commandWindow.visible = false;
  939.                 this._listWindow.height += this._listWindow.fittingHeight(1);
  940.                 this._listWindow.y -= this._listWindow.fittingHeight(1);
  941.                 this._detailWindow.height += this._listWindow.fittingHeight(1);
  942.                 this._detailWindow.y -= this._listWindow.fittingHeight(1);
  943.                 this._listWindow.createContents();
  944.                 this._detailWindow.createContents();
  945.                 this._listWindow.select(0);
  946.                 this._listWindow.activate();
  947.         }
  948.         Scene_CraftingSpecific.prototype.cancel = function() { this.popScene(); }
  949.  
  950.  
  951.         function Window_RecCategory() {
  952.                 this.initialize.apply(this, arguments);
  953.         }
  954.         Window_RecCategory.prototype = Object.create(Window_HorzCommand.prototype);
  955.         Window_RecCategory.prototype.constructor = Window_RecCategory;
  956.         Window_RecCategory.prototype.initialize = function() {
  957.                 Window_HorzCommand.prototype.initialize.call(this, 0, this.fittingHeight(2));
  958.         }
  959.         Window_RecCategory.prototype.windowWidth = function() { return Graphics.width; }
  960.         Window_RecCategory.prototype.windowHeight = function() { return this.fittingHeight(1); }
  961.         Window_RecCategory.prototype.makeCommandList = function() {
  962.                 for(var i = 0;i < categoryNames.length;i++) {
  963.                         this.addCommand(categoryNames[i],categoryNames[i]);
  964.                 }
  965.         }
  966.         Window_RecCategory.prototype.itemWidth = function() {return this.width / 5;}
  967.         Window_RecCategory.prototype.drawItem = function(index) {
  968.                 this.changePaintOpacity(this.isCommandEnabled(index));
  969.                 var rect = this.itemRectForText(index);
  970.                 this.drawText(this.commandName(index),rect.x,rect.y,rect.width);
  971.                 this.drawIcon(categoryIcons[index],rect.x-Window_Base._iconWidth,rect.y+2);
  972.         }
  973.         Window_RecCategory.prototype.itemRectForText = function(index) {
  974.                 var rect = this.itemRect(index);
  975.                 rect.x += Window_Base._iconWidth;               
  976.                 rect.width -= Window_Base._iconWidth;
  977.                 return rect;
  978.         }
  979.  
  980.         function Window_RecPopup() {
  981.                 this.initialize.apply(this, arguments);
  982.         }
  983.         Window_RecPopup.prototype = Object.create(Window_Selectable.prototype);
  984.         Window_RecPopup.prototype.constructor = Window_RecPopup;
  985.         Window_RecPopup.prototype.initialize = function() {
  986.                 Window_Selectable.prototype.initialize.call(this, Graphics.width/2-this.windowWidth()/2,Graphics.height/2-this.windowHeight()/2,120,this.fittingHeight(1));
  987.                 this.openness = 0;
  988.                 this.deactivate();
  989.         }
  990.         Window_RecPopup.prototype.windowWidth = function() {return 120;}
  991.         Window_RecPopup.prototype.windowHeight = function() {return this.fittingHeight(1);}
  992.         Window_RecPopup.prototype.setText = function(results, amount, reverse) {
  993.                 this.contents.clear();
  994.                 AudioManager.playSe({name:success,volume:successVol,pitch:100,pan:0})
  995.                 var texts = [];
  996.                 var width = 0;
  997.                 var weapons = [];
  998.                 var armors = [];
  999.                 var items = [];
  1000.                 for(var i = 0;i < results.length;i++) {
  1001.                         var item = results[i];
  1002.                         var container = item.type == "weapon" ? weapons : item.type == "armor" ? armors : items;
  1003.                         if(!container[item._item.id]) { container[item._item.id] = [item._item,0]; }
  1004.                         container[item._item.id][1] += item.returnAmount();
  1005.                 }
  1006.                 var containers = [weapons, armors, items];
  1007.                 for(var i = 0;i < containers.length;i++) {
  1008.                         for(var j = 0; j < containers[i].length;j++) {
  1009.                                 var item = containers[i][j];
  1010.                                 var widthNew = 0;
  1011.                                 if(item) {
  1012.                                         var string = String(item[1]) + "x " + item[0].name + " "
  1013.                                         string += reverse ? dismantledText : craftedText;
  1014.                                         texts.push([string,item[0].iconIndex]);
  1015.                                         widthNew = this.textWidth(string) + Window_Base._iconWidth;
  1016.                                         if(widthNew > width) { width = widthNew; }
  1017.                                 }
  1018.                         }
  1019.                 }
  1020.                 this.width = width + this.standardPadding() * 2;
  1021.                 this.height = this.fittingHeight(texts.length)
  1022.                 this.x = (Graphics.width-this.width)/2;
  1023.                 this.y = (Graphics.height-this.height)/2;
  1024.                 this.createContents();
  1025.                 for(var i = 0;i < texts.length;i++) {
  1026.                         this.drawText(texts[i][0],Window_Base._iconWidth,i*this.lineHeight(),this.contents.width);
  1027.                         this.drawIcon(texts[i][1],0,i*this.lineHeight());
  1028.                 }
  1029.                 this.open();
  1030.         }
  1031.         Window_RecPopup.prototype.setTextFail = function(reverse) {
  1032.                 this.contents.clear();
  1033.                 AudioManager.playSe({name:failure,volume:failureVol,pitch:100,pan:0})
  1034.                 var text = reverse ? dsmFailed : craFailed;
  1035.                 var width = this.textWidth(text);
  1036.                 this.width = width + this.standardPadding() * 2;
  1037.                 this.height = this.fittingHeight(1);
  1038.                 this.x = (Graphics.width-width)/2;
  1039.                 this.createContents();
  1040.                 this.drawText(text,0,0,this.contents.width);
  1041.                 this.open();
  1042.         }
  1043.         Window_RecPopup.prototype.processOk = function() {
  1044.                 if (this.isCurrentItemEnabled()) {
  1045.                         this.updateInputData();
  1046.                         this.deactivate();
  1047.                         this.callOkHandler();
  1048.                 } else {
  1049.                         this.playBuzzerSound();
  1050.                 }
  1051.         }
  1052.  
  1053.         function Window_RecGauge() {
  1054.                 this.initialize.apply(this, arguments);
  1055.         }
  1056.         Window_RecGauge.prototype = Object.create(Window_Base.prototype);
  1057.         Window_RecGauge.prototype.constructor = Window_RecGauge;
  1058.         Window_RecGauge.prototype.initialize = function() {
  1059.                 Window_Selectable.prototype.initialize.call(this, 0,Graphics.height-this.fittingHeight(1),Graphics.width/2,this.fittingHeight(1));
  1060.                 this._category = "all";
  1061.         }
  1062.         Window_RecGauge.prototype.refresh = function() {
  1063.                 this.contents.clear();
  1064.                 if(this._category == "all") {return;}
  1065.                 if(this._category == dismantleText) { return; }
  1066.                 this.drawIcon(categoryIcons[this.catIndex()],0,0);
  1067.                 this.drawText($gameParty.craftLevel(this.catIndex()),Window_Base._iconWidth,0,this.contents.width);
  1068.                 var rate = $gameParty.craftExp(this.catIndex()) / $gameParty.craftExpNext(this.catIndex());
  1069.                 if($gameParty.craftLevel(this.catIndex()) == UDML) {
  1070.                         this.changeTextColor(this.textColor(20));
  1071.                         this.drawText(MLT,0,0,this.contents.width,"right");
  1072.                         this.changeTextColor(this.normalColor());
  1073.                 } else {
  1074.                         this.drawGauge(96,-3,this.contents.width-96,rate,this.tpGaugeColor1(),this.tpGaugeColor2());
  1075.                         text = String($gameParty.craftExp(this.catIndex())) + "/" + String($gameParty.craftExpNext(this.catIndex()));
  1076.                         this.drawText(text,0,0,this.contents.width,"right");
  1077.                 }
  1078.         }
  1079.         Window_RecGauge.prototype.setCategory = function(cat) {
  1080.                 if(cat == this._category) {return;}
  1081.                 this._category = cat;
  1082.                 this.refresh();
  1083.         }
  1084.         Window_RecGauge.prototype.catIndex = function() {
  1085.                 return categoryNames.indexOf(this._category);
  1086.         }
  1087.  
  1088.         var crafting_window_menucommand_addoriginalcommands = Window_MenuCommand.prototype.addOriginalCommands;
  1089.         Window_MenuCommand.prototype.addOriginalCommands = function() {
  1090.                 crafting_window_menucommand_addoriginalcommands.call(this);
  1091.                 if(craftFromMenu != "off") { this.addCommand(craftingMenuString,"crafting"); }
  1092.         }
  1093.  
  1094.         var crafting_scene_menu_createcommandwindow = Scene_Menu.prototype.createCommandWindow;
  1095.         Scene_Menu.prototype.createCommandWindow = function() {
  1096.                 crafting_scene_menu_createcommandwindow.call(this);
  1097.                 this._commandWindow.setHandler("crafting",this.commandRecipe.bind(this));
  1098.         }
  1099.         Scene_Menu.prototype.commandRecipe = function() {
  1100.                 craftingFromMenu = true;
  1101.                 SceneManager.push(Scene_Crafting);
  1102.         }
  1103.  
  1104.         var RecipeCrafting_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  1105.         Game_Interpreter.prototype.pluginCommand = function(command, args) {
  1106.                 RecipeCrafting_Game_Interpreter_pluginCommand.call(this, command, args);
  1107.                 if(command === 'crafting') {
  1108.                         if(args[0] === 'call') {
  1109.                                 categoryEventName = args[1]
  1110.                                 if(categoryNames.indexOf(categoryEventName) >= 0) {
  1111.                                         SceneManager.push(Scene_CraftingSpecific);
  1112.                                 } else {
  1113.                                         throw new Error(TextManager.getErrorDetails() + "Incorrect category name");
  1114.                                 }
  1115.                         }
  1116.                         if(args[0] === 'learn') {
  1117.                                 $gameParty.learnRecipe(args[1]);
  1118.                         }
  1119.                         if(args[0] === 'forget') {
  1120.                                 $gameParty.forgetRecipe(args[1]);
  1121.                         }
  1122.                 }
  1123.         }
  1124.  
  1125.         var recipe_scene_load_onloadsuccess = Scene_Load.prototype.onLoadSuccess;
  1126.         Scene_Load.prototype.onLoadSuccess = function() {
  1127.                 recipe_scene_load_onloadsuccess.call(this);
  1128.                 $gameParty.checkRecipeVariables();
  1129.         };
  1130.  
  1131.         //YEP-ITEMCORE
  1132.         Game_Party.prototype.numIndependentItems = function(item) {
  1133.                 if(!item) return null;
  1134.                 if (DataManager.isIndependent(item)) {
  1135.                         if (DataManager.isItem(item)) var group = this.items();
  1136.                         if (DataManager.isWeapon(item)) var group = this.weapons();
  1137.                         if (DataManager.isArmor(item)) var group = this.armors();
  1138.                         var baseItemId = item.id;
  1139.                         var amount = 0;
  1140.                         for (var i = 0; i < group.length; ++i) {
  1141.                                 var item = group[i];
  1142.                                 if (!item) continue;
  1143.                                 if (!item.baseItemId) continue;
  1144.                                 if (item.baseItemId !== baseItemId) continue;
  1145.                                 if (this.checkItemIsEquipped(item)) continue;
  1146.                                 amount++;
  1147.                         }
  1148.                         return amount;
  1149.                 } else {
  1150.                         return this.numItems(item);
  1151.                 }
  1152.         }
  1153.  
  1154.  
  1155.  
  1156.  
  1157. })();


使用了这个合成插件,但想在制定地方才能使用,制作事件通过插件命令呼出制作菜单,但主菜单的这个选项不知道该怎么取消,求大神赐教,感谢

Lv2.观梦者

梦石
0
星屑
637
在线时间
164 小时
注册时间
2012-4-18
帖子
264
2
发表于 2016-2-27 10:48:36 手机端发表。 | 只看该作者
在插件编辑器中把这个插件的 craftFromMenu这一条属性从 craft改成off
来自: Android客户端
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
637
在线时间
164 小时
注册时间
2012-4-18
帖子
264
3
发表于 2016-2-27 10:50:37 手机端发表。 | 只看该作者
输错了,是这一条: Menu Craft Options
来自: Android客户端
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
128
在线时间
109 小时
注册时间
2013-8-10
帖子
46
4
 楼主| 发表于 2016-2-27 11:27:04 | 只看该作者
salvareless 发表于 2016-2-27 10:50
输错了,是这一条: Menu Craft Options

感谢,已经可以了。
能请教你下,这个帖子的问题怎么处理呢。半身对话
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
637
在线时间
164 小时
注册时间
2012-4-18
帖子
264
5
发表于 2016-2-27 11:34:38 手机端发表。 | 只看该作者
我看过你发的那个帖子,对于你说的那个插件,我也有没办法←_←不过,如果是我自己要用的话,可能我会去改window的消息函数里面关于显示脸图的函数,把这个函数显示的脸图的值调大一些,然后把做一套大号的脸图。反正对话时显示的脸图是直接指定的,和人物原来的脸图无关。不过具体就要看情况了,我用了fuki对话框,所以不需要这样的效果。如果楼主要做AVG式的对话,可能对这个效果的需求比较大吧。
来自: Android客户端
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-7 23:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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