Advertisement
jerry2810

ItemCombination

Nov 3rd, 2015
4,679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   //=============================================================================
  2. // ItemCombination.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Creates an item combination system.
  7.  * @author Jeremy Cannady
  8.  *
  9.  *
  10.  * @help
  11.  *
  12.  *
  13.  *
  14.     NoteTags
  15.     <comboChance:0.95>      where 0.95 is 95%
  16.     <comboIngredient1:1,1>  where you require one item #1
  17.     <comboIngredient2:2,3>  where you require three of item #2
  18.     <comboFail:4>           If you fail you make item #4
  19.    
  20.     Plugin Commands
  21.     no spaces and the exact format, must have comboChance, at least one ingredient and the combo fail
  22.     itemComboForget 1       where you forget the recipe to combine item #1 which is a recipe
  23.     itemComboLearn 5        where you learn the recipe to make item #5
  24.     itemComboChanceChange 7,0.5 where you change item# 7 chance to combine to 0.5 which is 50%
  25.     ItemComboMenuEnabled true   where true or false enables the menu option or not
  26.  *
  27.  *
  28. */
  29.  
  30. Game_Party.prototype._CombineMenuEnabled = true;
  31. Game_Party.prototype._craftingRecipes = {};
  32. Game_Party.prototype._craftingLearnedRecipes = [];
  33.  
  34. var copyOfAddOrginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  35. Window_MenuCommand.prototype.addOriginalCommands = function() {
  36.     copyOfAddOrginalCommands.call(this)
  37.     if(this.isItemComboEnabled()){
  38.         this.addCommand('Combine', 'itemCombinationCommand', true);
  39.     };
  40. };
  41.  
  42. Window_MenuCommand.prototype.isItemComboEnabled = function() {
  43.     if($gameParty._craftingLearnedRecipes.length < 1 ){
  44.         return false;
  45.     }else if($gameParty._CombineMenuEnabled == true){
  46.         return true;
  47.     }else{
  48.         return false;
  49.     };
  50. };
  51.  
  52. var copyOfCreateCommandWindow = Scene_Menu.prototype.createCommandWindow;
  53. Scene_Menu.prototype.createCommandWindow = function() {
  54.     copyOfCreateCommandWindow.call(this);
  55.     this._commandWindow.setHandler('itemCombinationCommand',    this.commandCombinationMenu.bind(this));
  56. };
  57.  
  58. Scene_Menu.prototype.commandCombinationMenu = function() {
  59.     SceneManager.push(Scene_CraftingMenu);
  60. };
  61.  
  62. var copyOfInitializeCombo = Game_Party.prototype.initialize;
  63. Game_Party.prototype.initialize = function() {
  64.     copyOfInitializeCombo.call(this);
  65.     this.populateCraftingRecipes();
  66. };
  67.  
  68. Game_Party.prototype.populateCraftingRecipes = function() {
  69.     var lengthOfItemList = $dataItems.length;
  70.     for(var i = 1; i < lengthOfItemList; i++){
  71.         var ingredientArray = [];
  72.         if(typeof $dataItems[i].meta.comboChance !== "undefined"){
  73.             ingredientArray.push(Number($dataItems[i].id));
  74.             ingredientArray.push(Number($dataItems[i].meta.comboChance));
  75.             ingredientArray.push(Number($dataItems[i].meta.comboFail));
  76.             };
  77.         if(typeof $dataItems[i].meta.comboIngredient1 !== "undefined"){
  78.             var ingredientArrayIngredient = $dataItems[i].meta.comboIngredient1.split(',');
  79.             for(var j=0; j<2; j++) {
  80.                 ingredientArrayIngredient[j] = parseInt(ingredientArrayIngredient[j], 10);};
  81.                 ingredientArray.push(ingredientArrayIngredient);
  82.         };
  83.         if(typeof $dataItems[i].meta.comboIngredient2 !== "undefined"){
  84.             var ingredientArrayIngredient = $dataItems[i].meta.comboIngredient2.split(',');
  85.             for(var j=0; j<2; j++) {
  86.                 ingredientArrayIngredient[j] = parseInt(ingredientArrayIngredient[j], 10);};
  87.                 ingredientArray.push(ingredientArrayIngredient);
  88.         };
  89.         if(typeof $dataItems[i].meta.comboIngredient3 !== "undefined"){
  90.             var ingredientArrayIngredient = $dataItems[i].meta.comboIngredient3.split(',');
  91.             for(var j=0; j<2; j++) {
  92.                 ingredientArrayIngredient[j] = parseInt(ingredientArrayIngredient[j], 10);};
  93.                 ingredientArray.push(ingredientArrayIngredient);
  94.         };
  95.         if(typeof $dataItems[i].meta.comboIngredient4 !== "undefined"){
  96.             var ingredientArrayIngredient = $dataItems[i].meta.comboIngredient4.split(',');
  97.             for(var j=0; j<2; j++) {
  98.                 ingredientArrayIngredient[j] = parseInt(ingredientArrayIngredient[j], 10);};
  99.                 ingredientArray.push(ingredientArrayIngredient);
  100.         };
  101.         if(typeof $dataItems[i].meta.comboIngredient5 !== "undefined"){
  102.             var ingredientArrayIngredient = $dataItems[i].meta.comboIngredient5.split(',');
  103.             for(var j=0; j<2; j++) {
  104.                 ingredientArrayIngredient[j] = parseInt(ingredientArrayIngredient[j], 10);};
  105.                 ingredientArray.push(ingredientArrayIngredient);
  106.         }; 
  107.         if(typeof $dataItems[i].meta.comboChance !== "undefined"){
  108.             Game_Party.prototype._craftingRecipes[$dataItems[i].name] = ingredientArray;
  109.         };
  110.     };     
  111. };
  112.  
  113. Game_Party.prototype.canCombine = function(recipeKeyName){
  114.     var ingredientArray = $gameParty.ingredients(recipeKeyName);
  115.     var haveAllIngredients = 0;
  116.     for(i =0;i< ingredientArray.length;i++){
  117.         var itemNumber = ingredientArray[i][0];
  118.         var requiredAmount = ingredientArray[i][1];
  119.         if ($gameParty.numItems($dataItems[itemNumber]) >= requiredAmount){
  120.             haveAllIngredients += 1;
  121.         };
  122.     };
  123.     return (haveAllIngredients === $gameParty.ingredients(recipeKeyName).length);
  124. };
  125.  
  126. Game_Party.prototype.learnRecipe = function(value) {
  127.     if(this._craftingLearnedRecipes.indexOf(value) === -1){
  128.         this._craftingLearnedRecipes.push(value);
  129.     };
  130. };
  131.  
  132. Game_Party.prototype.forgetRecipe = function(value) {
  133.     //Stores the value of the index, if the value is -1 then we do not have the recipe.
  134.     var index = this._craftingLearnedRecipes.indexOf(value);
  135.     //If we do have the recipe learned then delete it from out learned recipes list.
  136.     if(this._craftingLearnedRecipes.indexOf(value) != -1){
  137.         this._craftingLearnedRecipes.splice(index,1);
  138.     };
  139. };
  140.  
  141. Game_Party.prototype.changeItemComboChance = function(recipeName, newChance) {
  142.     var recipeDetails = Game_Party.prototype._craftingRecipes[recipeName];
  143.     recipeDetails[1] = newChance;
  144. };
  145.  
  146. Game_Party.prototype.ingredients = function(recipeKeyName){
  147.     var recipeDetails = Game_Party.prototype._craftingRecipes[recipeKeyName];
  148.     var ingredientsList =[];
  149.     for(i = 3; i < recipeDetails.length; i++){
  150.         var itemNumber = recipeDetails[i];
  151.         ingredientsList.push(itemNumber);
  152.     };
  153.     return ingredientsList;
  154. };
  155.  
  156. function craftingTitleWindow() {
  157.     this.initialize.apply(this, arguments);
  158. };
  159.  
  160. craftingTitleWindow.prototype = Object.create(Window_Base.prototype);
  161. craftingTitleWindow.prototype.constructor = craftingTitleWindow;
  162.  
  163. craftingTitleWindow.prototype.initialize = function(x, y) {
  164.     var width = this.windowWidth();
  165.     var height = this.windowHeight();
  166.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  167.     this.update();
  168. };
  169.  
  170. craftingTitleWindow.prototype.windowWidth = function() {
  171.     return Graphics.width;
  172. };
  173.  
  174. craftingTitleWindow.prototype.windowHeight = function() {
  175.     return this.fittingHeight(1);
  176. };
  177.  
  178. craftingTitleWindow.prototype.drawCraftingTitle = function( x, y, width) {
  179.     var unitWidth = Math.min(80);
  180.     this.resetTextColor();
  181.     this.drawText("Item Combination Menu", x, y, width - unitWidth - 6, 'left');
  182.     this.changeTextColor(this.systemColor());
  183. };
  184.    
  185. craftingTitleWindow.prototype.update = function() {
  186.     var x = this.textPadding();
  187.     var width = this.contents.width - this.textPadding() * 2;
  188.     this.contents.clear();
  189.     this.drawCraftingTitle( 0, 0, width);
  190. };
  191.  
  192. function craftingListWindow() {
  193.     this.initialize.apply(this, arguments);
  194. }
  195.  
  196. craftingListWindow.prototype = Object.create(Window_Command.prototype);
  197. craftingListWindow.prototype.constructor = craftingListWindow;
  198.  
  199.  
  200.  
  201. craftingListWindow.prototype.initialize = function(x, y) {
  202.     Window_Command.prototype.initialize.call(this, x, y);
  203.     this.selectLast();
  204. };
  205.  
  206. craftingListWindow.prototype.update = function() {
  207.     Window_Command.prototype.update.call(this);
  208.  };
  209.  
  210. craftingListWindow.initCommandPosition = function() {
  211.     this._lastCommandSymbol = null;
  212. };
  213.  
  214. craftingListWindow.prototype.windowWidth = function() {
  215.     return 240;
  216. };
  217.  
  218. craftingListWindow.prototype.windowHeight = function() {
  219.     return Graphics.height - craftingTitleWindow.prototype.windowHeight();
  220. };
  221.  
  222. craftingListWindow.prototype.numVisibleRows = function() {
  223.     return this.maxItems();
  224. };
  225.  
  226. craftingListWindow.prototype.makeCommandList = function() {
  227.     this.addOriginalCommands();
  228. };
  229.  
  230. craftingListWindow.prototype.addOriginalCommands = function() {
  231.     var numberOfLearnedRecipes = $gameParty._craftingLearnedRecipes;
  232.     for(var i = 0; i < numberOfLearnedRecipes.length; i++){
  233.         var recipeKeyName = $gameParty._craftingLearnedRecipes[i];
  234.         var enabled = $gameParty.canCombine(recipeKeyName);
  235.         var recipeDetails = $gameParty._craftingRecipes[recipeKeyName];
  236.         var itemNumber = recipeDetails[0];
  237.         this.addCommand($dataItems[itemNumber].name, $dataItems[itemNumber].name, enabled);
  238.     };
  239.  };
  240.  
  241. craftingListWindow.prototype.isCurrentItemEnabled = function(){
  242.     var recipeKeyName = $gameParty._craftingLearnedRecipes[craftingDetailsWindow.prototype.currentItemIndex];
  243.     return $gameParty.canCombine(recipeKeyName);
  244. };
  245.  
  246. craftingListWindow.prototype.processOk = function() {
  247.     craftingListWindow._lastCommandSymbol = this.currentSymbol();
  248.     Window_Command.prototype.processOk.call(this);
  249. };
  250.  
  251. craftingListWindow.prototype.selectLast = function() {
  252.     this.selectSymbol(craftingListWindow._lastCommandSymbol);
  253. };
  254.  
  255. function craftingDetailsWindow() {
  256.     this.initialize.apply(this, arguments);
  257. };
  258.  
  259. craftingDetailsWindow.prototype = Object.create(Window_Base.prototype);
  260.  
  261. craftingDetailsWindow.prototype.constructor = craftingDetailsWindow;
  262. craftingDetailsWindow.prototype.currentItemIndex = 0;
  263.  
  264. craftingDetailsWindow.prototype.initialize = function(x, y) {
  265.     var width = this.windowWidth();
  266.     var height = this.windowHeight();
  267.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  268.     this.update();
  269. };
  270.  
  271. craftingDetailsWindow.prototype.windowWidth = function() {
  272.     return Graphics.width - craftingListWindow.prototype.windowWidth();
  273. };
  274.  
  275. craftingDetailsWindow.prototype.windowHeight = function() {
  276.     return Graphics.height - craftingTitleWindow.prototype.windowHeight();
  277. };
  278.  
  279. craftingDetailsWindow.prototype.update = function() {
  280.     Window_Base.prototype.update.call(this);
  281.     this.contents.clear();
  282.     this.drawDetailsName(0, 0, this.windowWidth());
  283.     this.drawIngredient(0, 200, this.windowWidth() / 2);
  284.     this.drawComboChance(0, this.windowHeight() - this.lineHeight() * 5,this.windowWidth());
  285. };
  286.  
  287. craftingDetailsWindow.prototype.drawDetailsName = function(x, y, width) {
  288.     var recipeKeyName = $gameParty._craftingLearnedRecipes[this.currentItemIndex];
  289.     var recipeDetails = $gameParty._craftingRecipes[recipeKeyName];
  290.     var itemNumber = recipeDetails[0];
  291.    
  292.     //Gray out the details page if we can't craft it
  293.     this.changePaintOpacity($gameParty.canCombine(recipeKeyName));
  294.    
  295.     //Draw  name
  296.     this.resetTextColor();
  297.     this.makeFontBigger();
  298.     this.drawText($dataItems[itemNumber].name, x, y, width - 32, 'center');
  299.     this.makeFontSmaller();
  300.    
  301.     ///Draw description
  302.     this.drawText($dataItems[itemNumber].description, x, y + 100 + 12, width - 32, 'center');
  303.     this.changeTextColor(this.systemColor());
  304.    
  305.     //Draw bigger icon
  306.     this.bitmapIcon = new Sprite(ImageManager.loadSystem('IconSet'));
  307.    
  308.     //Change the scale to twice as big
  309.     this.bitmapIcon.scale.x = 2;
  310.     this.bitmapIcon.scale.y = 2;
  311.     this.bitmapIcon.x = this.windowWidth()/2 - 32;
  312.     this.bitmapIcon.y = y + 50 + 12;
  313.     var pw = Window_Base._iconWidth;
  314.     var ph = Window_Base._iconHeight;
  315.     var sx = $dataItems[itemNumber].iconIndex % 16 * pw;
  316.     var sy = Math.floor($dataItems[itemNumber].iconIndex / 16) * ph;
  317.     this.addChild(this.bitmapIcon);
  318.     this.bitmapIcon.setFrame(sx, sy, 32, 32);
  319. };
  320.  
  321. craftingDetailsWindow.prototype.drawIngredient = function(x, y, width) {
  322.     this.resetTextColor();
  323.     this.drawText('Required Ingredients :', x, y-this.lineHeight(), this.windowWidth()/2+this.textWidth(':')+6, 'right');
  324.     var recipeKeyName = $gameParty._craftingLearnedRecipes[craftingDetailsWindow.prototype.currentItemIndex];
  325.     var ingredientArray = $gameParty.ingredients(recipeKeyName);
  326.     var Y = y;
  327.    
  328.     for(i = 0;i < ingredientArray.length; i++){
  329.         y = Y + 32*i + 6;
  330.         var itemNumber = ingredientArray[i][0];
  331.         var requiredAmount = ingredientArray[i][1];
  332.         var ingredient = $dataItems[itemNumber];
  333.         if ($gameParty.numItems(ingredient) >= requiredAmount){
  334.             this.resetTextColor();
  335.         }
  336.         else{
  337.             this.changeTextColor(this.hpGaugeColor1())
  338.         };
  339.         var text = $gameParty.numItems(ingredient) + '/' + requiredAmount;
  340.         var offset = 150;
  341.         this.drawText(text, this.windowWidth()/2+this.textWidth(': ')+6, y, this.windowWidth()/2, 'left');
  342.         this.drawIcon($dataItems[itemNumber].iconIndex,this.windowWidth()/2-32 , y );
  343.         this.drawText(ingredient.name, 0 , y, this.windowWidth()/2-32-6, 'right');
  344.         this.drawText(': ', this.windowWidth()/2+6 , y, this.windowWidth()/2, 'left');
  345.     };
  346.     this.resetTextColor();
  347. };
  348.  
  349. craftingDetailsWindow.prototype.drawComboChance = function(x, y, width) {
  350.     this.resetTextColor();
  351.     var recipeKeyName = $gameParty._craftingLearnedRecipes[this.currentItemIndex];
  352.     var recipeDetails = $gameParty._craftingRecipes[recipeKeyName];
  353.     var chance = recipeDetails[1] * 100;
  354.     if(chance > 75){
  355.         this.changeTextColor(this.textColor(3))
  356.     }else if(chance > 50){
  357.         this.changeTextColor(this.textColor(14))
  358.     }else if(chance > 25){
  359.         this.changeTextColor(this.textColor(20))
  360.     }else {
  361.         this.changeTextColor(this.textColor(10))
  362.     };
  363.    
  364.     this.drawText(chance + ' %', x, y, this.windowWidth() - 32 , 'center');
  365.     this.changeTextColor(this.systemColor());
  366. };
  367.  
  368. function craftingCombineCommand() {
  369.     this.initialize.apply(this, arguments);
  370. }
  371.  
  372. craftingCombineCommand.prototype = Object.create(Window_Command.prototype);
  373. craftingCombineCommand.prototype.constructor = craftingCombineCommand;
  374.  
  375. craftingCombineCommand.prototype.canCombine = false;
  376.  
  377.  
  378. craftingCombineCommand.prototype.initialize = function(x, y) {
  379.     Window_Command.prototype.initialize.call(this, x, y);
  380.     this.selectLast();
  381.     this.deselect();
  382.     this.deactivate();
  383. };
  384.  
  385. craftingCombineCommand.prototype.update = function() {
  386.     Window_Command.prototype.update.call(this);
  387.     this.drawItem(0);
  388.  };
  389.  
  390. craftingCombineCommand.prototype.initCommandPosition = function() {
  391.     this._lastCommandSymbol = null;
  392. };
  393.  
  394. craftingCombineCommand.prototype.isCurrentItemEnabled = function(){
  395.     var recipeKeyName = $gameParty._craftingLearnedRecipes[craftingDetailsWindow.prototype.currentItemIndex];
  396.     return $gameParty.canCombine(recipeKeyName);
  397. };
  398.  
  399. craftingCombineCommand.prototype.drawItem = function(index){
  400.     var rect = this.itemRectForText(index);
  401.     var recipeKeyName = $gameParty._craftingLearnedRecipes[craftingDetailsWindow.prototype.currentItemIndex];
  402.     this.changePaintOpacity($gameParty.canCombine(recipeKeyName));
  403.     this.resetTextColor();
  404.     this.addCommand("Combine", "Combine", $gameParty.canCombine(recipeKeyName));
  405.     this.drawText(this.commandName(index), rect.x , rect.y, rect.width, 'center')
  406.     this.resetTextColor();
  407. };
  408.  
  409. craftingCombineCommand.prototype.processOk = function() {
  410.     craftingCombineCommand._lastCommandSymbol = this.currentSymbol();
  411.     Window_Command.prototype.processOk.call(this);
  412. };
  413.  
  414. craftingCombineCommand.prototype.selectLast = function() {
  415.     this.selectSymbol(craftingDetailsWindow._lastCommandSymbol);
  416. };
  417.  
  418. craftingCombineCommand.prototype.maxItems = function() {
  419.     return 1;
  420. };
  421.  
  422. craftingCombineCommand.prototype.maxCols = function(){
  423.     return 1;
  424. };
  425.  
  426. craftingCombineCommand.prototype.standardPadding = function() {
  427.     return 6;
  428. };
  429.  
  430.  
  431.  
  432. function Scene_CraftingMenu() {
  433.     this.initialize.apply(this, arguments);
  434. }
  435. Scene_CraftingMenu.prototype = Object.create(Scene_MenuBase.prototype);
  436. Scene_CraftingMenu.prototype.constructor = Scene_CraftingMenu;
  437.  
  438. Scene_CraftingMenu.prototype.initialize = function() {
  439.     Scene_MenuBase.prototype.initialize.call(this);
  440. };
  441.  
  442. Scene_CraftingMenu.prototype.update = function() {
  443.     Scene_MenuBase.prototype.update.call(this);
  444.     this.updateDetails();
  445. };
  446.  
  447. Scene_CraftingMenu.prototype.updateDetails = function(){
  448.     if(this._commandItemWindow.active){
  449.         craftingDetailsWindow.prototype.currentItemIndex = this._commandItemWindow.index();
  450.     };
  451. };
  452.  
  453. Scene_CraftingMenu.prototype.create = function() {
  454.    Scene_MenuBase.prototype.create.call(this);
  455.    this.createTitleWindow();
  456.    this.createCommandWindow();
  457.    this.createDetailsWindow();
  458.    this.createCombineWindow();
  459. };
  460.  
  461. Scene_CraftingMenu.prototype.start = function() {
  462.     Scene_MenuBase.prototype.start.call(this);
  463. };
  464.    
  465. Scene_CraftingMenu.prototype.createCommandWindow = function() {
  466.     var y = craftingTitleWindow.prototype.windowHeight();
  467.     this._commandItemWindow = new craftingListWindow(0, y);
  468.     this._commandItemWindow.setHandler('ok',        this.commandCombine.bind(this));
  469.     this._commandItemWindow.setHandler('cancel',    this.commandCancel.bind(this));
  470.     this.addWindow(this._commandItemWindow);
  471. };
  472.  
  473. Scene_CraftingMenu.prototype.commandCancel = function() {
  474.     if($gamePlayer._CombineMenuEnabled === true){
  475.         SceneManager.pop();
  476.     }else{
  477.         SceneManager.goto(Scene_Map);
  478.     };
  479. };
  480.  
  481. Scene_CraftingMenu.prototype.createDetailsWindow = function() {
  482.     var x = craftingListWindow.prototype.windowWidth();
  483.     var y = craftingTitleWindow.prototype.windowHeight();
  484.     this._commandDetailsWindow = new craftingDetailsWindow(x, y);
  485.     this.addWindow(this._commandDetailsWindow );
  486. };
  487. Scene_CraftingMenu.prototype.createCombineWindow = function() {
  488.     var x1 = craftingListWindow.prototype.windowWidth();
  489.     var x2 = craftingDetailsWindow.prototype.windowWidth()/2;
  490.     var x3 = craftingCombineCommand.prototype.windowWidth()/2;
  491.     var x = x1 + x2 - x3;
  492.     var y = Graphics.height - craftingCombineCommand.prototype.windowHeight()-12;
  493.     this._commandCombineWindow = new craftingCombineCommand(x, y);
  494.     this.addWindow(this._commandCombineWindow );
  495. };
  496.  
  497. Scene_CraftingMenu.prototype.createTitleWindow = function() {
  498.     this._craftingTitleWindow = new craftingTitleWindow(0, 0);
  499.     this.addWindow(this._craftingTitleWindow);
  500. };
  501.  
  502. Scene_CraftingMenu.prototype.commandCombine = function() {
  503.     this._commandCombineWindow.selectLast();
  504.     this._commandItemWindow.deselect();
  505.     this._commandCombineWindow.activate();
  506.     this._commandCombineWindow .setHandler('ok',        this.onDetailsOk.bind(this));
  507.     this._commandCombineWindow .setHandler('cancel',    this.onDetailsCancel.bind(this));
  508. };
  509.  
  510. Scene_CraftingMenu.prototype.onDetailsOk = function() {
  511.     var recipeKeyName = $gameParty._craftingLearnedRecipes[craftingDetailsWindow.prototype.currentItemIndex];
  512.     var ingredientArray = $gameParty.ingredients(recipeKeyName);
  513.     var recipeDetails = $gameParty._craftingRecipes[recipeKeyName];
  514.     var itemNumber = recipeDetails[0];
  515.    
  516.     if($gameParty.canCombine(recipeKeyName)){
  517.         for(i = 0;i < ingredientArray.length; i++){
  518.             var requiredAmount = ingredientArray[i][1];
  519.             var ingredient = $dataItems[ingredientArray[i][0]];
  520.             $gameParty.loseItem(ingredient, requiredAmount);
  521.         };
  522.  
  523.         if(Math.random() < recipeDetails[1]){
  524.             $gameParty.gainItem($dataItems[itemNumber], 1);
  525.         }
  526.         else{
  527.             $gameParty.gainItem($dataItems[recipeDetails[2]], 1);
  528.             SoundManager.playBuzzer();
  529.         };
  530.     };
  531.     SceneManager.goto(Scene_CraftingMenu);
  532. };
  533.  
  534. Scene_CraftingMenu.prototype.onDetailsCancel = function() {
  535.     this._commandItemWindow.selectLast();
  536.     this._commandItemWindow.activate();
  537. };
  538.  
  539. var comboMenuEnabled_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  540. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  541.     comboMenuEnabled_pluginCommand.call(this, command, args);
  542.     if (command === "ItemComboMenuEnabled") {
  543.     $gameParty._CombineMenuEnabled = JSON.parse(args[0]);
  544.     };
  545. };
  546.  
  547. var itemComboLearn_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  548. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  549.     itemComboLearn_pluginCommand.call(this, command, args);
  550.     if (command === "itemComboLearn") {
  551.         var arg = $dataItems[JSON.parse(args[0])].name;
  552.         $gameParty.learnRecipe(arg);
  553.     };
  554. };
  555.  
  556. var itemComboChance_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  557. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  558.     itemComboChance_pluginCommand.call(this, command, args);
  559.     if (command === "itemComboChanceChange") {
  560.         var arg1 = $dataItems[JSON.parse(args[0])].name;
  561.         var arg2 = JSON.parse(args[1]);
  562.         $gameParty.changeItemComboChance(arg1,arg2);
  563.     };
  564. };
  565.  
  566. var itemComboForget_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  567. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  568.     itemComboForget_pluginCommand.call(this, command, args);
  569.     if (command === "itemComboForget") {
  570.         var arg = $dataItems[JSON.parse(args[0])].name;
  571.         $gameParty.forgetRecipe(arg);
  572.     };
  573. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement