查看: 6983|回复: 7

[搬运汉化] 部分插件汉化

[复制链接]
梦石
0
星屑
50
在线时间
93 小时
注册时间
2013-11-20
回帖
11
发表于 2015-10-30 11:39:02 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 苏利亚 于 2015-10-30 11:48 编辑

似乎大家都在汉化插件,为了不进行多余的重复工作,现在把我翻译的一些内容贴上来。

机翻!
机翻!
机翻!

一切功劳属于谷歌,我只是个人形润色器。
如有纰漏还请海涵。

所有插件未经测试,在大神们出手之前聊作辅助。

ATB系统1.ATB系统
  1. // File must be named "EllyeSimpleATB.js"
  2. //=============================================================================
  3. // Ellye's Simple Active Time Battle
  4. //=============================================================================
  5. /*:
  6. *
  7. * Lastest updates:
  8. * Added a parameter for the gauge name.
  9. * Added a parameter that allows the developer to select if At-End-Of-Turn effects should happen after an actor takes its action, or for everyone at the end of Turn Timer. (thanks, atreyoray)
  10. * Corrected a few bugs regarding monsters with the same agility not attacking;
  11. * Corrected a few bugs regarding Auto-Battle;
  12. * Corrected a few bugs regarding Status Effects that happened per turn.
  13. *
  14. * @plugindesc 简单的计时回合值战斗系统。
  15. * @author [url]http://steamcommunity.com/id/Ellye[/url]
  16. *
  17. * @param Agility Weight
  18. * @desc 这个数值越高,同一敏捷差值之间的时间差距越明显。
  19. * 默认值为100(权重数值为整数)。
  20. * @default 100
  21. *
  22. * @param Turn Timer
  23. * @desc 虚拟“回合”所包含的时间。
  24. * 详见帮助。
  25. * @default 150
  26. *
  27. * @param Base Fill Speed
  28. * @desc 槽值本身的填充速度,区别于人物的敏捷值。
  29. * 以同样的方式影响虚拟回合。
  30. * @default 100
  31. *
  32. * @param End-Of-Turn Effects
  33. * @desc 0= 按照各人行动执行; 1= 按照虚拟回合执行。
  34. * 详见帮助。
  35. * @default 0
  36. *
  37. * @param Gauge Name
  38. * @desc 在槽值上显示的名称。
  39. * @default AT
  40. *  
  41. * @help Turn Timer
  42. * -影响战斗第N回合发生的事件中的“回合”,或者N回合后敌人使用技能中的“回合”等。
  43. * -这里输入的数值将是虚拟回合所拥有的“敏捷”值。这个数值对玩家不可见。
  44. * End-Of-Turn Effects
  45. * -选择处理回合性状态(如中毒伤害)的方式,
  46. * -每个人按照各人行动单独执行,或是所有人按照虚拟回合每回合结束统一执行。
  47. *
  48. * 人物将会根据他们的敏捷属性采取尽可能多的行动,取代了固定轮流的方式。
  49. * 他们将获得一个从0到1000的“AT”计时槽,并且在达到1000时进行行动。
  50. * 当玩家选择指令或者播放动画时,计时将被暂停。
  51. * 你可以通过“.atb”属性使技能受ATB系统作用影响。
  52. * 例如,一个“快速打击”类型的技能在它的公式里可以写“a.atb+25000;”
  53. * 全通径需求50000ATB (多余的ATB不会丢失,并且数值可以是负数)。
  54. */

  55. //Our plugin needs to be inside a function:
  56. (function() {
  57.    
  58.     var turn_atb = 0;
  59.     var full_atb = 50000;
  60.     var parameters = PluginManager.parameters('EllyeSimpleATB');
  61.     var agi_weight = Number(parameters['Agility Weight'] || 100);
  62.     var turn_timer = Number(parameters['Turn Timer'] || 150);
  63.     var base_atb_increase = Number(parameters['Base Fill Speed'] || 100);
  64.     var end_of_turn_effects = Number(parameters['End-Of-Turn Effects'] || 0);
  65.     var gauge_name = String(parameters['Gauge Name'] || "AT");
  66.    
  67.     //==================================================
  68.     // INTERFACE
  69.     //==================================================
  70.    
  71.     //Let's increase the area for gauges in the battlescreen from the default value of 330 to 400.
  72.     Window_BattleStatus.prototype.gaugeAreaWidth = function() {
  73.     return 400;
  74.     };
  75.    
  76.     //let's change the DrawGaugeArea methods, to include our ATB gauge.
  77.     //The version with TP:
  78.     Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
  79.         this.drawActorHp(actor, rect.x + 0, rect.y, 97);
  80.         this.drawActorMp(actor, rect.x + 112, rect.y, 86);
  81.         this.drawActorTp(actor, rect.x + 213, rect.y, 86);
  82.         this.drawActorATB(actor, rect.x + 314, rect.y, 86);
  83.     };
  84.    
  85.     //The version without TP:
  86.     Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
  87.         this.drawActorHp(actor, rect.x + 0, rect.y, 130);
  88.         this.drawActorMp(actor, rect.x + 145,  rect.y, 120);
  89.         this.drawActorATB(actor, rect.x + 280,  rect.y, 120);
  90.     };
  91.    
  92.     //Let's create the method that draw the ATB gauge:
  93.     Window_Base.prototype.drawActorATB = function(actor, x, y, width) {
  94.         var color1 = "#303050";
  95.         var color2 = "#6060A0";
  96.         this.drawGauge(x, y, width, actor.atbRate(), color1, color2);
  97.         this.changeTextColor(this.systemColor());
  98.         this.drawText(gauge_name, x, y, 44);
  99.     };
  100.    
  101.     //Let's create the method for calculating ATB percent for the gauge:
  102.     Game_BattlerBase.prototype.atbRate = function() {
  103.         if (typeof this.atb !== 'undefined') {
  104.             if (this.atb / full_atb >= 1)
  105.             {
  106.                 return 1;
  107.             }
  108.             return this.atb / full_atb;
  109.         }
  110.         return 0;
  111.     };

  112.     //==================================================
  113.     // SYSTEM
  114.     //==================================================

  115.     //Let's add a new property for battlers, called "atb":
  116.     Object.defineProperties(Game_BattlerBase.prototype, {
  117.         atb: {
  118.             writable: true,
  119.             value: 0,
  120.             configurable: true,
  121.             enumerable: true
  122.         }
  123.     });

  124.    //At the start of battle, ATB values are reset to 0:
  125.     _Game_Battler_prototype_onBattleStart = Game_Battler.prototype.onBattleStart;
  126.     Game_Battler.prototype.onBattleStart = function() {
  127.         this.atb = 0;
  128.         _Game_Battler_prototype_onBattleStart.call(this);
  129.     };

  130.     //Battle starts in the new phase "atb"
  131.     _BattleManager_startBattle = BattleManager.startBattle;
  132.     BattleManager.startBattle = function() {
  133.         _BattleManager_startBattle.call(this);
  134.         $gameParty.makeActions();
  135.         $gameTroop.makeActions();
  136.         this.makeActionOrders();
  137.         this._phase = 'atb';
  138.         this._pending_atb_removal = false;
  139.     };
  140.    
  141.     //Change the end of turn:
  142.     BattleManager.updateTurnEnd = function() {
  143.         $gameParty.makeActions();
  144.         $gameTroop.makeActions();
  145.         this._phase = 'atb';
  146.     };
  147.    
  148.     //Changing the flow of battle
  149.     _BattleManager_update = BattleManager.update;
  150.     BattleManager.update = function() {
  151.         if (!this.isBusy() && !this.updateEvent())
  152.         {
  153.             switch (this._phase)
  154.             {
  155.                 case 'atb':
  156.                     this.increaseAtbGauges();
  157.                     break;
  158.                 default:
  159.                     _BattleManager_update.call(this);
  160.                     break;
  161.             }
  162.         }
  163.     };
  164.    
  165.     //Increases the ATB gauges when idle:
  166.     BattleManager.increaseAtbGauges = function() {
  167.         turn_atb += (base_atb_increase + turn_timer * (agi_weight/100));
  168.         if (turn_atb >= full_atb)
  169.         {
  170.             turn_atb -= full_atb;
  171.             $gameTroop.increaseTurn();
  172.             if (end_of_turn_effects !== 0)
  173.             {
  174.                 this.allBattleMembers().forEach(function(battler)
  175.                 {
  176.                     battler.onTurnEnd();
  177.                     this.refreshStatus();
  178.                     this._logWindow.displayAutoAffectedStatus(battler);
  179.                     this._logWindow.displayRegeneration(battler);
  180.                 }, this);
  181.             }
  182.         }
  183.         this.allBattleMembers().forEach(function(battler)
  184.         {
  185.             battler.atb += (base_atb_increase + battler.agi * (agi_weight/100));
  186.             if (battler.atb >= full_atb)
  187.             {        
  188.                 this.battlerHasFullAtb(battler);
  189.             }
  190.         }, this);
  191.         this.refreshStatus();
  192.     };

  193.     //When a Battler (might be party or enemy) has full ATB:
  194.     BattleManager.battlerHasFullAtb = function(battler) {
  195.         this._subject = battler;
  196.         this._turn_end_subject = battler;
  197.         this._pending_atb_removal = true;
  198.         if (battler.isActor())
  199.         {
  200.             battler.makeActions();
  201.             if (battler.canInput())
  202.             {
  203.                 this._actorIndex = battler.index();
  204.                 this._phase = 'input';
  205.             }
  206.             else
  207.             {
  208.                 this._phase = 'turn';
  209.             }
  210.         }
  211.         else if (battler.isEnemy())
  212.         {
  213.             battler.makeActions();
  214.             this._phase = 'turn';
  215.         }
  216.       };
  217.    
  218.     //Never jumps to another battler, we will control them individually:
  219.     BattleManager.getNextSubject = function() {
  220.         return null;
  221.     };
  222.    
  223.     //Process turn when we finish inputing command
  224.     BattleManager.selectNextCommand = function() {
  225.         do {
  226.             if (!this.actor() || !this.actor().selectNextCommand()) {
  227.                 this._phase = 'turn';
  228.                 $gameParty.requestMotionRefresh();
  229.                 break;
  230.             }
  231.         } while (!this.actor().canInput());
  232.     };
  233.    
  234.     //Don't let us jump to another character by cancelling.
  235.     BattleManager.selectPreviousCommand = function() {
  236.         do {
  237.             if (!this.actor() || !this.actor().selectPreviousCommand()) {
  238.                     return;
  239.             }
  240.         } while (!this.actor().canInput());
  241.     };
  242.    
  243.     //We need to change the OnTurnEnd method, because otherwise it will apply to all battlers whenever anyone acts:
  244.     BattleManager.endTurn = function() {
  245.         this._phase = 'turnEnd';
  246.         this._preemptive = false;
  247.         this._surprise = false;
  248.         if (typeof this._turn_end_subject !== 'undefined' && end_of_turn_effects === 0) {
  249.             this._turn_end_subject.onTurnEnd();
  250.             this.refreshStatus();
  251.             this._logWindow.displayAutoAffectedStatus(this._turn_end_subject);
  252.             this._logWindow.displayRegeneration(this._turn_end_subject);
  253.         }
  254.     };
  255.    
  256.    
  257.     //Remove the ATB value when a turn is processed:
  258.     _BattleManager_processTurn = BattleManager.processTurn;
  259.     BattleManager.processTurn = function() {
  260.         if (this._pending_atb_removal === true)
  261.         {
  262.             this._subject.atb -= full_atb;
  263.             this._pending_atb_removal = false;
  264.         }
  265.         _BattleManager_processTurn.call(this);
  266.     };
  267. })();
复制代码



装备核心2.装备核心
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Equip Core
  3. // YEP_EquipCore.js
  4. // Version: 1.01
  5. //=============================================================================

  6. var Imported = Imported || {};
  7. Imported.YEP_EquipCore = true;

  8. var Yanfly = Yanfly || {};
  9. Yanfly.Equip = Yanfly.Equip || {};

  10. //=============================================================================
  11. /*:
  12. * @plugindesc 更灵活的装备系统。
  13. * 各职业拥有独特的装备槽。
  14. * @author Yanfly Engine Plugins
  15. *
  16. * @param ---General---
  17. * @default
  18. *
  19. * @param Text Align
  20. * @desc 在指令窗口中如何对齐文字。
  21. * left(靠左)  center(居中)  right(靠右)
  22. * @default center
  23. *
  24. * @param Finish Command
  25. * @desc 用于退出装备界面的指令名称。
  26. * @default 完成
  27. *
  28. * @param Remove Text
  29. * @desc 用于装备界面中卸下装备的指令名称。
  30. * @default 清除
  31. *
  32. * @param Remove Icon
  33. * @desc 用于装备界面中卸下装备的指令图标序号。
  34. * @default 16
  35. *
  36. * @param Empty Text
  37. * @desc 用于表示装备位置留空的名称。
  38. * @default <空>
  39. *
  40. * @param Empty Icon
  41. * @desc 用于留空装备位置的图标序号。
  42. * @default 16
  43. *
  44. * @param ---Rules---
  45. * @default
  46. *
  47. * @param Non-Removable Types
  48. * @desc 这种装备槽类型必须始终处于被装备的状态,不可留空。
  49. * 用空格分隔类型ID
  50. * @default 1
  51. *
  52. * @param Non-Optimized Types
  53. * @desc 这种装备槽类型不会受自动优化法则影响,当玩家使用最优搭配时会被忽略。
  54. * 用空格分隔类型ID
  55. * @default 5
  56. *
  57. * @help
  58. * ============================================================================
  59. * 简介
  60. * ============================================================================
  61. *
  62. * 本插件会改变装备系统的各个方面,有以下改变。
  63. *
  64. * 1. 装备界面
  65. * 装备界面会看起来有所区别。这主要是为了使界面看起来更加整齐,并且方便玩家熟悉
  66. * 所有功能。此外,指令窗口被调整以更好地适应未来可能的扩展插件————在指令窗口或
  67. * 者装备界面中添加进新的命令。
  68. *
  69. * 2. 装备处理
  70. * 人物将不再使用通用的装备槽类型设置。现在,不同的职业可以通过在职业备注中简单
  71. * 地标记来使用不同的设置。此外,过去名称一致的装备类型依然被视作不同的类型,而
  72. * 现在,名称一致的装备类型将会被视作同一个类型。
  73. *
  74. * 3. 装备设置
  75. * 现在,装备类型可以设置为允许被卸下或不允许被卸下。例如,本插件可以将武器槽设
  76. * 置为必须始终被某个项目装备,并且玩家不可手动使其留空(另一方面,游戏中也可通
  77. * 过事件实现这一功能)。此外,可以限制某些最好手动决定的装备不被自动优化法则作
  78. * 用影响(如饰品)。
  79. *
  80. * 4. 参数控制
  81. * 装备参数现在可以通过备注调整,以拥有更高的数据或特有的数值(通过代码),这使
  82. * 得装备不再是静态的,而是动态的,并且可以在游戏过程中更改。
  83. *
  84. * ============================================================================
  85. * 备注
  86. * ============================================================================
  87. *
  88. * 你可以通过以下备注来改变职业装备设置。
  89. *
  90. * 职业备注:
  91. *   <Equip Slot: x>      例如: <Equip Slot: 1, 2, 3, 4, 5, 5, 5, 5>
  92. *   <Equip Slot: x, x, x>
  93. *   改变该职业的装备槽为 X。可以使用相同的数字重复同一装备类型,这意味着该职业
  94. *   可装备多个该类型的装备。装备类型ID位于数据库类型设定中。
  95. *
  96. *   如果你不喜欢用上面的方法来设置装备槽,可以使用以下备注代替:
  97. *
  98. *   <Equip Slot>            示例: <Equip Slot>
  99. *    string                        Weapon
  100. *    string                        Armor
  101. *    string                        Accessory
  102. *    string                        Accessory
  103. *   </Equip Slot>                 </Equip Slot>
  104. *   将更换的装备类型名称插入字符串中。名称区分大小写,所以如果字符串中的名称不
  105. *   完全一致的话,被设置的装备槽将不会生效。插入多个相同名称意味着该职业可以装
  106. *   备该类型的多个装备。和上一种备注的运行效果完全一样。
  107. *
  108. * 武器和盔甲备注:
  109. *   <stat: +x>
  110. *   <stat: -x>
  111. *   允许该武器或盔甲增加或减少X属性值。可以用“hp”,“mp”,“atk”,“def”,“mat”,
  112. *   “mdf”,“agi”或者“luk”代替“stat”来改变独特的stat。这将允许装备属性超过系统
  113. *   默认的最大值。在这里改变基础参数。
  114. *
  115. * ============================================================================
  116. * 疯狂模式 - 定制参数
  117. * ============================================================================
  118. *
  119. *   <Custom Parameters>     示例: <Custom Parameters>
  120. *    code                          atk = $gameVariables.value(1);
  121. *    code                          mat = atk / 2;
  122. *    code                          all = $gameParty.members().length;
  123. *    code                         </Custom Parameters>
  124. *   </Code Parameters>
  125. *   允许参数通过代码调整获得特定的比例。下列参数可被定义:‘maxhp’,‘maxmp’,
  126. *   ‘atk’,‘def’,‘mat’,‘mdf’,‘agi’,‘luk’和‘all’。参数‘all’将会影响所有参数。  
  127. *   在这里的改变不会影响基础参数,而是叠加在基础参数上。
  128. *
  129. * ============================================================================
  130. * 更新日志
  131. * ============================================================================
  132. *
  133. * Version 1.01:
  134. * - Fixed a bug that did not update the stats properly when compared.
  135. *
  136. * Version 1.00:
  137. * - Finished plugin!
  138. */
  139. //=============================================================================

  140. //=============================================================================
  141. // Parameter Variables
  142. //=============================================================================

  143. Yanfly.Parameters = PluginManager.parameters('YEP_EquipCore');
  144. Yanfly.Param = Yanfly.Param || {};
  145. Yanfly.Icon = Yanfly.Icon || {};

  146. Yanfly.Param.EquipTextAlign = String(Yanfly.Parameters['Text Align']);
  147. Yanfly.Param.EquipFinishCmd = String(Yanfly.Parameters['Finish Command']);
  148. Yanfly.Param.EquipRemoveText = String(Yanfly.Parameters['Remove Text']);
  149. Yanfly.Icon.RemoveEquip = Number(Yanfly.Parameters['Remove Icon']);
  150. Yanfly.Param.EquipEmptyText = String(Yanfly.Parameters['Empty Text']);
  151. Yanfly.Icon.EmptyEquip = Number(Yanfly.Parameters['Empty Icon']);
  152. Yanfly.Data = String(Yanfly.Parameters['Non-Removable Types']);
  153. Yanfly.Data = Yanfly.Data.split(' ');
  154. Yanfly.Param.EquipNonRemove = [];
  155. for (Yanfly.i = 0; Yanfly.i < Yanfly.Data.length; ++Yanfly.i) {
  156.   Yanfly.Param.EquipNonRemove.push(parseInt(Yanfly.Data[Yanfly.i]));
  157. };
  158. Yanfly.Data = String(Yanfly.Parameters['Non-Optimized Types']);
  159. Yanfly.Data = Yanfly.Data.split(' ');
  160. Yanfly.Param.EquipNonOptimized = [];
  161. for (Yanfly.i = 0; Yanfly.i < Yanfly.Data.length; ++Yanfly.i) {
  162.   Yanfly.Param.EquipNonOptimized.push(parseInt(Yanfly.Data[Yanfly.i]));
  163. };

  164. //=============================================================================
  165. // DataManager
  166. //=============================================================================

  167. Yanfly.Equip.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  168. DataManager.isDatabaseLoaded = function() {
  169.     if (!Yanfly.Equip.DataManager_isDatabaseLoaded.call(this)) return false;
  170.                 DataManager.processEquipNotetags1($dataClasses);
  171.     DataManager.processEquipNotetags2($dataWeapons);
  172.     DataManager.processEquipNotetags2($dataArmors);
  173.                 return true;
  174. };

  175. DataManager.processEquipNotetags1 = function(group) {
  176.         var note1 = /<(?:EQUIP SLOT|equip slots):[ ]*(\d+(?:\s*,\s*\d+)*)>/i;
  177.   var note2 = /<(?:EQUIP SLOT|equip slots)>/i;
  178.   var note3 = /<\/(?:EQUIP SLOT|equip slots)>/i;
  179.         for (var n = 1; n < group.length; n++) {
  180.                 var obj = group[n];
  181.                 var notedata = obj.note.split(/[\r\n]+/);

  182.     obj.equipSlots = [];
  183.     var equipSlots = false;

  184.                 for (var i = 0; i < notedata.length; i++) {
  185.                         var line = notedata[i];
  186.                         if (line.match(note1)) {
  187.         var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
  188.         obj.equipSlots = obj.equipSlots.concat(array);
  189.                         } else if (line.match(note2)) {
  190.         equipSlots = true;
  191.       } else if (line.match(note3)) {
  192.         equipSlots = false;
  193.       } else if (equipSlots && line.match(/[ ]*(.*)/i)) {
  194.         var name = String(RegExp.$1);
  195.         var slotId = $dataSystem.equipTypes.indexOf(name);
  196.         if (slotId >= 0) obj.equipSlots.push(slotId);
  197.       }
  198.                 }
  199.     if (obj.equipSlots.length <= 0) this.setDefaultEquipSlots(obj);
  200.         }
  201. };

  202. DataManager.setDefaultEquipSlots = function(obj) {
  203.     for (var i = 1; i < $dataSystem.equipTypes.length; ++i) {
  204.       var name = $dataSystem.equipTypes[i];
  205.       var slotId = $dataSystem.equipTypes.indexOf(name);
  206.       if (slotId >= 0) obj.equipSlots.push(slotId);
  207.     }
  208. };

  209. DataManager.processEquipNotetags2 = function(group) {
  210.         var note1 = /<(?:PARAMETER EVAL|custom parameter|custom parameters)>/i;
  211.   var note2 = /<\/(?:PARAMETER EVAL|custom parameter|custom parameters)>/i;
  212.   var note3 = /<(.*):[ ]([\+\-]\d+)>/i;
  213.         for (var n = 1; n < group.length; n++) {
  214.                 var obj = group[n];
  215.                 var notedata = obj.note.split(/[\r\n]+/);

  216.     obj.parameterEval = '';
  217.     var parameterEval = false;

  218.                 for (var i = 0; i < notedata.length; i++) {
  219.                         var line = notedata[i];
  220.                         if (line.match(note1)) {
  221.         parameterEval = true;
  222.                         } else if (line.match(note2)) {
  223.         parameterEval = false;
  224.       } else if (parameterEval) {
  225.         obj.parameterEval = obj.parameterEval + line + '\n';
  226.       } else if (line.match(note3)) {
  227.         var stat = String(RegExp.$1).toUpperCase();
  228.                                 var value = parseInt(RegExp.$2);
  229.                                 switch (stat) {
  230.                                         case 'HP':
  231.                       case 'MAXHP':
  232.                       case 'MAX HP':
  233.                                                 obj.params[0] = value;
  234.                                                 break;
  235.                                         case 'MP':
  236.                       case 'MAXMP':
  237.                       case 'MAX MP':
  238.                       case 'SP':
  239.                       case 'MAXSP':
  240.                       case 'MAX SP':
  241.                                                 obj.params[1] = value;
  242.                                                 break;
  243.                                         case 'ATK':
  244.                       case 'STR':
  245.                                                 obj.params[2] = value;
  246.                                                 break;
  247.                                         case 'DEF':
  248.                                                 obj.params[3] = value;
  249.                                                 break;
  250.                                         case 'MAT':
  251.                       case 'INT' || 'SPI':
  252.                                                 obj.params[4] = value;
  253.                                                 break;
  254.                                         case 'MDF':
  255.                       case 'RES':
  256.                                                 obj.params[5] = value;
  257.                                                 break;
  258.                                         case 'AGI':
  259.                       case 'SPD':
  260.                                                 obj.params[6] = value;
  261.                                                 break;
  262.                                         case 'LUK':
  263.                                                 obj.params[7] = value;
  264.                                                 break;
  265.           }
  266.                         }
  267.                 }
  268.         }
  269. };

  270. //=============================================================================
  271. // Game_Actor
  272. //=============================================================================

  273. Game_Actor.prototype.initEquips = function(equips) {
  274.     var array = [];
  275.     for (var i = 0; i < equips.length; ++i) {
  276.       var equipId = equips[i];
  277.       if (equipId <= 0) continue;
  278.       var equipType = $dataSystem.equipTypes[i + 1];
  279.       if (equipType === $dataSystem.equipTypes[1] ||
  280.       (i === 1 && this.isDualWield())) {
  281.         var equip = $dataWeapons[equipId];
  282.       } else {
  283.         var equip = $dataArmors[equipId];
  284.       }
  285.       array.push(equip);
  286.     }
  287.     var slots = this.equipSlots();
  288.     var maxSlots = slots.length;
  289.     this._equips = [];
  290.     for (var i = 0; i < maxSlots; ++i) {
  291.       this._equips[i] = new Game_Item();
  292.     }
  293.     for (var i = 0; i < array.length; ++i) {
  294.       var equip = array[i];
  295.       if (!equip) continue;
  296.       var etypeId = equip.etypeId;
  297.       if (!slots.contains(etypeId)) continue;
  298.       var slotId = slots.indexOf(etypeId);
  299.       if (this._equips[slotId].isWeapon() && this.isDualWield()) slotId += 1;
  300.       this._equips[slotId].setObject(equip);
  301.     }
  302.     this.releaseUnequippableItems(true);
  303.     this.recoverAll();
  304.     this.refresh();
  305. };

  306. Game_Actor.prototype.equipSlots = function() {
  307.     var slots = this.currentClass().equipSlots.slice();
  308.     if (slots.length >= 2 && this.isDualWield()) slots[1] = 1;
  309.     return slots;
  310. };

  311. Yanfly.Equip.Game_Actor_equips = Game_Actor.prototype.equips;
  312. Game_Actor.prototype.equips = function() {
  313.     for (var i = 0; i < this.currentClass().equipSlots.length; ++i) {
  314.       if (!this._equips[i]) this._equips[i] = new Game_Item();
  315.     }
  316.     return Yanfly.Equip.Game_Actor_equips.call(this);
  317. };

  318. Yanfly.Equip.Game_Actor_changeEquip = Game_Actor.prototype.changeEquip;
  319. Game_Actor.prototype.changeEquip = function(slotId, item) {
  320.     if (!this._equips[slotId]) this._equips[slotId] = new Game_Item();
  321.     Yanfly.Equip.Game_Actor_changeEquip.call(this, slotId, item);
  322. };

  323. Yanfly.Equip.Game_Actor_forceChangeEquip =
  324.     Game_Actor.prototype.forceChangeEquip;
  325. Game_Actor.prototype.forceChangeEquip = function(slotId, item) {
  326.     if (!this._equips[slotId]) this._equips[slotId] = new Game_Item();
  327.     Yanfly.Equip.Game_Actor_forceChangeEquip.call(this, slotId, item);
  328. };

  329. Yanfly.Equip.Game_Actor_isEquipChangeOk = Game_Actor.prototype.isEquipChangeOk;
  330. Game_Actor.prototype.isEquipChangeOk = function(slotId) {
  331.     if ($gameTemp._clearEquipments) {
  332.       var typeId = this.equipSlots()[slotId];
  333.       if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
  334.     }
  335.     if ($gameTemp._optimizeEquipments) {
  336.       var typeId = this.equipSlots()[slotId];
  337.       if (Yanfly.Param.EquipNonOptimized.contains(typeId)) return false;
  338.     }
  339.     return Yanfly.Equip.Game_Actor_isEquipChangeOk.call(this, slotId);
  340. };

  341. Yanfly.Equip.Game_Actor_paramPlus = Game_Actor.prototype.paramPlus;
  342. Game_Actor.prototype.paramPlus = function(paramId) {
  343.     value = Yanfly.Equip.Game_Actor_paramPlus.call(this, paramId);
  344.     var equips = this.equips();
  345.     for (var i = 0; i < equips.length; i++) {
  346.       var item = equips[i];
  347.       if (!item) continue;
  348.       value += this.customParamPlus(item, paramId);
  349.       value += this.evalParamPlus(item, paramId);
  350.     }

  351.     return value;
  352. };

  353. Game_Actor.prototype.customParamPlus = function(item, paramId) {
  354.     return 0;
  355. };

  356. Game_Actor.prototype.evalParamPlus = function(item, paramId) {
  357.     if (!item) return 0;
  358.     if (!item.parameterEval || item.parameterEval === '') return 0;
  359.     var value = 0;
  360.     var hp = 0;
  361.     var maxhp = 0;
  362.     var mhp = 0;
  363.     var mp = 0;
  364.     var maxmp = 0;
  365.     var mmp = 0;
  366.     var sp = 0;
  367.     var maxsp = 0;
  368.     var msp = 0;
  369.     var atk = 0;
  370.     var str = 0;
  371.     var def = 0;
  372.     var mat = 0;
  373.     var int = 0;
  374.     var spi = 0;
  375.     var mdf = 0;
  376.     var res = 0;
  377.     var agi = 0;
  378.     var spd = 0;
  379.     var luk = 0;
  380.     var all = 0;
  381.     var a = this;
  382.     var user = this;
  383.     var s = $gameSwitches._data;
  384.     var v = $gameVariables._data;
  385.     eval(item.parameterEval);
  386.     switch (paramId) {
  387.       case 0:
  388.         value += hp + maxhp + mhp;
  389.         break;
  390.       case 1:
  391.         value += mp + maxmp + mmp + sp + maxsp + msp;
  392.         break;
  393.       case 2:
  394.         value += atk + str;
  395.         break;
  396.       case 3:
  397.         value += def;
  398.         break;
  399.       case 4:
  400.         value += mat + int + spi;
  401.         break;
  402.       case 5:
  403.         value += mdf + res;
  404.         break;
  405.       case 6:
  406.         value += agi + spd;
  407.         break;
  408.       case 7:
  409.         value += luk;
  410.         break;
  411.     }
  412.     return value + all;
  413. };

  414. //=============================================================================
  415. // Window_EquipCommand
  416. //=============================================================================

  417. Window_EquipCommand.prototype.windowWidth = function() {
  418.     return 240;
  419. };

  420. Window_EquipCommand.prototype.maxCols = function() {
  421.     return 1;
  422. };

  423. Window_EquipCommand.prototype.windowHeight = function() {
  424.     return this.fittingHeight(this.numVisibleRows());
  425. };

  426. Window_EquipCommand.prototype.numVisibleRows = function() {
  427.     return 4;
  428. };

  429. Window_EquipCommand.prototype.itemTextAlign = function() {
  430.     return Yanfly.Param.EquipTextAlign;
  431. };

  432. Yanfly.Equip.Window_EquipCommand_makeCommandList =
  433.     Window_EquipCommand.prototype.makeCommandList;
  434. Window_EquipCommand.prototype.makeCommandList = function() {
  435.     Yanfly.Equip.Window_EquipCommand_makeCommandList.call(this);
  436.     this.addCustomCommand();
  437.     this.addFinishCommand();
  438. };

  439. Window_EquipCommand.prototype.addCustomCommand = function() {
  440. };

  441. Window_EquipCommand.prototype.addFinishCommand = function() {
  442.     this.addCommand(Yanfly.Param.EquipFinishCmd, 'cancel');
  443. };

  444. //=============================================================================
  445. // Window_EquipSlot
  446. //=============================================================================

  447. Yanfly.Equip.Window_EquipSlot_setActor = Window_EquipSlot.prototype.setActor;
  448. Window_EquipSlot.prototype.setActor = function(actor) {
  449.     this.setSlotNameWidth(actor);
  450.     Yanfly.Equip.Window_EquipSlot_setActor.call(this, actor);
  451. };

  452. Window_EquipSlot.prototype.isEnabled = function(index) {
  453.     if (this._actor) {
  454.       return Yanfly.Equip.Game_Actor_isEquipChangeOk.call(this._actor, index);
  455.     } else {
  456.       return false;
  457.     }
  458. };

  459. Window_EquipSlot.prototype.drawItem = function(index) {
  460.     if (!this._actor) return;
  461.     var rect = this.itemRectForText(index);
  462.     this.changeTextColor(this.systemColor());
  463.     this.changePaintOpacity(this.isEnabled(index));
  464.     var ww1 = this._nameWidth;
  465.     this.drawText(this.slotName(index), rect.x, rect.y, ww1);
  466.     var ww2 = rect.width - ww1;
  467.     var item = this._actor.equips()[index];
  468.     if (item) {
  469.       this.drawItemName(item, rect.x + ww1, rect.y, ww2);
  470.     } else {
  471.       this.drawEmptySlot(rect.x + ww1, rect.y, ww2);
  472.     }
  473.     this.changePaintOpacity(true);
  474. };

  475. Window_EquipSlot.prototype.setSlotNameWidth = function(actor) {
  476.     if (!actor) return;
  477.     this._nameWidth = 0;
  478.     for (var i = 0; i < actor.equipSlots().length; ++i) {
  479.       var text = $dataSystem.equipTypes[actor.equipSlots()[i]] + ' ';
  480.       this._nameWidth = Math.max(this._nameWidth, this.textWidth(text));
  481.     }
  482. };

  483. Window_EquipSlot.prototype.drawEmptySlot = function(wx, wy, ww) {
  484.     this.changePaintOpacity(false);
  485.     var ibw = Window_Base._iconWidth + 4;
  486.     this.resetTextColor();
  487.     this.drawIcon(Yanfly.Icon.EmptyEquip, wx + 2, wy + 2);
  488.     var text = Yanfly.Param.EquipEmptyText;
  489.     this.drawText(text, wx + ibw, wy, ww - ibw);
  490. };

  491. //=============================================================================
  492. // Window_EquipItem
  493. //=============================================================================

  494. Window_EquipItem.prototype.maxCols = function() {
  495.     return 1;
  496. };

  497. Yanfly.Equip.Window_EquipItem_setSlotId = Window_EquipItem.prototype.setSlotId;
  498. Window_EquipItem.prototype.setSlotId = function(slotId) {
  499.     // do nothing
  500. };

  501. Yanfly.Equip.Window_EquipItem_includes = Window_EquipItem.prototype.includes;
  502. Window_EquipItem.prototype.includes = function(item) {
  503.     if (item === null && this._actor && this._data.length > 0) {
  504.       var typeId = this._actor.equipSlots()[this._slotId];
  505.       if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
  506.     }
  507.     return Yanfly.Equip.Window_EquipItem_includes.call(this, item);
  508. };

  509. Yanfly.Equip.Window_EquipItem_isEnabled =
  510.     Window_EquipItem.prototype.isEnabled;
  511. Window_EquipItem.prototype.isEnabled = function(item) {
  512.     if (item === null && this._actor) {
  513.       var typeId = this._actor.equipSlots()[this._slotId];
  514.       if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
  515.     }
  516.     return Yanfly.Equip.Window_EquipItem_isEnabled.call(this, item);
  517. };

  518. Yanfly.Equip.Window_EquipItem_drawItem = Window_EquipItem.prototype.drawItem;
  519. Window_EquipItem.prototype.drawItem = function(index) {
  520.     var item = this._data[index];
  521.     if (item === null) {
  522.       this.drawRemoveEquip(index);
  523.     } else {
  524.       Yanfly.Equip.Window_EquipItem_drawItem.call(this, index);
  525.     }
  526. };

  527. Window_EquipItem.prototype.drawRemoveEquip = function(index) {
  528.     if (!this.isEnabled(null)) return;
  529.     var rect = this.itemRect(index);
  530.     rect.width -= this.textPadding();
  531.     this.changePaintOpacity(true);
  532.     var ibw = Window_Base._iconWidth + 4;
  533.     this.resetTextColor();
  534.     this.drawIcon(Yanfly.Icon.RemoveEquip, rect.x + 2, rect.y + 2);
  535.     var text = Yanfly.Param.EquipRemoveText;
  536.     this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
  537. };

  538. //=============================================================================
  539. // Window_StatCompare
  540. //=============================================================================

  541. function Window_StatCompare() {
  542.     this.initialize.apply(this, arguments);
  543. }

  544. Window_StatCompare.prototype = Object.create(Window_Base.prototype);
  545. Window_StatCompare.prototype.constructor = Window_StatCompare;

  546. Window_StatCompare.prototype.initialize = function(wx, wy, ww, wh) {
  547.     Window_Base.prototype.initialize.call(this, wx, wy, ww, wh);
  548.     this._actor = null;
  549.     this._tempActor = null;
  550.     this.refresh();
  551. };

  552. Window_StatCompare.prototype.createWidths = function() {
  553.                 this._paramNameWidth = 0;
  554.                 this._paramValueWidth = 0;
  555.                 this._arrowWidth = this.textWidth('\u2192' + ' ');
  556.                 var buffer = this.textWidth(' ');
  557.                 for (var i = 0; i < 8; ++i) {
  558.                         var value1 = this.textWidth(TextManager.param(i));
  559.                         var value2 = this.textWidth(Yanfly.Util.toGroup(this._actor.paramMax(i)));
  560.                         this._paramNameWidth = Math.max(value1, this._paramNameWidth);
  561.                         this._paramValueWidth = Math.max(value2, this._paramValueWidth);
  562.                 }
  563.                 this._bonusValueWidth = this._paramValueWidth;
  564.                 this._bonusValueWidth += this.textWidth('(+)') + buffer;
  565.                 this._paramNameWidth += buffer;
  566.                 this._paramValueWidth;
  567.                 if (this._paramNameWidth + this._paramValueWidth * 2 + this._arrowWidth +
  568.                         this._bonusValueWidth > this.contents.width) this._bonusValueWidth = 0;
  569. };

  570. Window_StatCompare.prototype.setActor = function(actor) {
  571.     if (this._actor === actor) return;
  572.     this._actor = actor;
  573.                 this.createWidths();
  574.     this.refresh();
  575. };

  576. Window_StatCompare.prototype.refresh = function() {
  577.     this.contents.clear();
  578.     if (!this._actor) return;
  579.     for (var i = 0; i < 8; ++i) {
  580.         this.drawItem(0, this.lineHeight() * i, i);
  581.     }
  582. };

  583. Window_StatCompare.prototype.setTempActor = function(tempActor) {
  584.     if (this._tempActor === tempActor) return;
  585.     this._tempActor = tempActor;
  586.     this.refresh();
  587. };

  588. Window_StatCompare.prototype.drawItem = function(x, y, paramId) {
  589.                 this.drawDarkRect(x, y, this.contents.width, this.lineHeight());
  590.                 this.drawParamName(y, paramId);
  591.     this.drawCurrentParam(y, paramId);
  592.                 this.drawRightArrow(y);
  593.     if (!this._tempActor) return;
  594.                 this.drawNewParam(y, paramId);
  595.                 this.drawParamDifference(y, paramId);
  596. };

  597. Window_StatCompare.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  598.     var color = this.gaugeBackColor();
  599.     this.changePaintOpacity(false);
  600.     this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  601.     this.changePaintOpacity(true);
  602. };

  603. Window_StatCompare.prototype.drawParamName = function(y, paramId) {
  604.     var x = this.textPadding();
  605.                 this.changeTextColor(this.systemColor());
  606.     this.drawText(TextManager.param(paramId), x, y, this._paramNameWidth);
  607. };

  608. Window_StatCompare.prototype.drawCurrentParam = function(y, paramId) {
  609.     var x = this.contents.width - this.textPadding();
  610.                 x -= this._paramValueWidth * 2 + this._arrowWidth + this._bonusValueWidth;
  611.                 this.resetTextColor();
  612.                 var actorparam = Yanfly.Util.toGroup(this._actor.param(paramId));
  613.     this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
  614. };

  615. Window_StatCompare.prototype.drawRightArrow = function(y) {
  616.                 var x = this.contents.width - this.textPadding();
  617.                 x -= this._paramValueWidth + this._arrowWidth + this._bonusValueWidth;
  618.                 var dw = this.textWidth('\u2192' + ' ');
  619.                 this.changeTextColor(this.systemColor());
  620.     this.drawText('\u2192', x, y, dw, 'center');
  621. };

  622. Window_StatCompare.prototype.drawNewParam = function(y, paramId) {
  623.                 var x = this.contents.width - this.textPadding();
  624.                 x -= this._paramValueWidth + this._bonusValueWidth;
  625.                 var newValue = this._tempActor.param(paramId);
  626.     var diffvalue = newValue - this._actor.param(paramId);
  627.                 var actorparam = Yanfly.Util.toGroup(newValue);
  628.                 this.changeTextColor(this.paramchangeTextColor(diffvalue));
  629.     this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
  630. };

  631. Window_StatCompare.prototype.drawParamDifference = function(y, paramId) {
  632.                 var x = this.contents.width - this.textPadding();
  633.                 x -= this._bonusValueWidth;
  634.                 var newValue = this._tempActor.param(paramId);
  635.     var diffvalue = newValue - this._actor.param(paramId);
  636.                 if (diffvalue === 0) return;
  637.                 var actorparam = Yanfly.Util.toGroup(newValue);
  638.     this.changeTextColor(this.paramchangeTextColor(diffvalue));
  639.                 var text = Yanfly.Util.toGroup(diffvalue);
  640.                 if (diffvalue > 0) {
  641.                         text = ' (+' + text + ')';
  642.                 } else {
  643.                         text = ' (' + text + ')';
  644.                 }
  645.     this.drawText(text, x, y, this._bonusValueWidth, 'left');
  646. };

  647. //=============================================================================
  648. // Scene_Equip
  649. //=============================================================================

  650. Scene_Equip.prototype.create = function() {
  651.     Scene_MenuBase.prototype.create.call(this);
  652.     this.createHelpWindow();
  653.     this.createCommandWindow();
  654.     this.createStatusWindow();
  655.     this.createSlotWindow();
  656.     this.createItemWindow();
  657.     this.createCompareWindow();
  658.     this.refreshActor();
  659. };

  660. Scene_Equip.prototype.createCommandWindow = function() {
  661.     var wy = this._helpWindow.height;
  662.     this._commandWindow = new Window_EquipCommand(0, wy, 240);
  663.     this._commandWindow.setHelpWindow(this._helpWindow);
  664.     this._commandWindow.setHandler('equip', this.commandEquip.bind(this));
  665.     this._commandWindow.setHandler('optimize', this.commandOptimize.bind(this));
  666.     this._commandWindow.setHandler('clear', this.commandClear.bind(this));
  667.     this._commandWindow.setHandler('cancel', this.popScene.bind(this));
  668.     this._commandWindow.setHandler('pagedown', this.nextActor.bind(this));
  669.     this._commandWindow.setHandler('pageup', this.previousActor.bind(this));
  670.     this.addWindow(this._commandWindow);
  671. };

  672. Scene_Equip.prototype.createStatusWindow = function() {
  673.     var wx = this._commandWindow.width;
  674.     var wy = this._helpWindow.height;
  675.     var ww = Graphics.boxWidth - wx;
  676.     var wh = this._commandWindow.height;
  677.     this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh);
  678.     this.addWindow(this._statusWindow);
  679. };

  680. Scene_Equip.prototype.createSlotWindow = function() {
  681.     var wy = this._commandWindow.y + this._commandWindow.height;
  682.     var ww = Graphics.boxWidth / 2;
  683.     var wh = Graphics.boxHeight - wy;
  684.     this._slotWindow = new Window_EquipSlot(0, wy, ww, wh);
  685.     this._slotWindow.setHelpWindow(this._helpWindow);
  686.     this._slotWindow.setHandler('ok',       this.onSlotOk.bind(this));
  687.     this._slotWindow.setHandler('cancel',   this.onSlotCancel.bind(this));
  688.     this.addWindow(this._slotWindow);
  689. };

  690. Scene_Equip.prototype.createItemWindow = function() {
  691.     var wy = this._slotWindow.y;
  692.     var ww = Graphics.boxWidth / 2;
  693.     var wh = Graphics.boxHeight - wy;
  694.     this._itemWindow = new Window_EquipItem(0, wy, ww, wh);
  695.     this._itemWindow.setHelpWindow(this._helpWindow);
  696.     this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  697.     this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  698.     this._slotWindow.setItemWindow(this._itemWindow);
  699.     this.addWindow(this._itemWindow);
  700.     this._itemWindow.hide();
  701. };

  702. Scene_Equip.prototype.createCompareWindow = function() {
  703.     var wx = this._itemWindow.width;
  704.                 var wy = this._itemWindow.y;
  705.                 var ww = Graphics.boxWidth - wx;
  706.                 var wh = Graphics.boxHeight - wy;
  707.                 this._compareWindow = new Window_StatCompare(wx, wy, ww, wh);
  708.     this._slotWindow.setStatusWindow(this._compareWindow);
  709.                 this._itemWindow.setStatusWindow(this._compareWindow);
  710.     this.addWindow(this._compareWindow);
  711. };

  712. Yanfly.Equip.Scene_Equip_refreshActor = Scene_Equip.prototype.refreshActor;
  713. Scene_Equip.prototype.refreshActor = function() {
  714.     Yanfly.Equip.Scene_Equip_refreshActor.call(this);
  715.     this._compareWindow.setActor(this.actor());
  716. };

  717. Yanfly.Equip.Scene_Equip_commandOptimize =
  718.     Scene_Equip.prototype.commandOptimize;
  719. Scene_Equip.prototype.commandOptimize = function() {
  720.     $gameTemp._optimizeEquipments = true;
  721.     Yanfly.Equip.Scene_Equip_commandOptimize.call(this);
  722.     $gameTemp._optimizeEquipments = false;
  723.     this._compareWindow.refresh();
  724.     this._statusWindow.refresh();
  725. };

  726. Yanfly.Equip.Scene_Equip_commandClear = Scene_Equip.prototype.commandClear;
  727. Scene_Equip.prototype.commandClear = function() {
  728.     $gameTemp._clearEquipments = true;
  729.     Yanfly.Equip.Scene_Equip_commandClear.call(this);
  730.     $gameTemp._clearEquipments = false;
  731.     this._compareWindow.refresh();
  732.     this._statusWindow.refresh();
  733. };

  734. Yanfly.Equip.Scene_Equip_onSlotOk = Scene_Equip.prototype.onSlotOk;
  735. Scene_Equip.prototype.onSlotOk = function() {
  736.     var slotId = this._slotWindow.index();
  737.     Yanfly.Equip.Window_EquipItem_setSlotId.call(this._itemWindow, slotId);
  738.     Yanfly.Equip.Scene_Equip_onSlotOk.call(this);
  739.     this._itemWindow.show();
  740. };

  741. Yanfly.Equip.Scene_Equip_onItemOk = Scene_Equip.prototype.onItemOk;
  742. Scene_Equip.prototype.onItemOk = function() {
  743.     var hpRate = this.actor().hp / this.actor().mhp;
  744.     var mpRate = this.actor().mp / this.actor().mmp;
  745.     Yanfly.Equip.Scene_Equip_onItemOk.call(this);
  746.     this.actor().setHp(parseInt(this.actor().mhp * hpRate));
  747.                 this.actor().setMp(parseInt(this.actor().mmp * mpRate));
  748.     this._itemWindow.hide();
  749.     this._statusWindow.refresh();
  750. };

  751. Yanfly.Equip.Scene_Equip_onItemCancel = Scene_Equip.prototype.onItemCancel;
  752. Scene_Equip.prototype.onItemCancel = function() {
  753.     Yanfly.Equip.Scene_Equip_onItemCancel.call(this);
  754.     this._itemWindow.hide();
  755. };

  756. //=============================================================================
  757. // Utilities
  758. //=============================================================================

  759. Yanfly.Util = Yanfly.Util || {};

  760. if (!Yanfly.Util.toGroup) {
  761.                 Yanfly.Util.toGroup = function(inVal) {
  762.                                 return inVal;
  763.                 }
  764. };

  765. //=============================================================================
  766. // End of File
  767. //=============================================================================
复制代码


战斗音效3.战斗音效
  1. //=============================================================================
  2. // BattleVoice.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 当人物做出指定动作时播放SE。
  6. * @author Sasuke KANNAZUKI
  7. *
  8. * @param pitch
  9. * @desc 设置所有SE的音频。
  10. * @default 100
  11. *
  12. * @param volume
  13. * @desc 设置所有SE的音量。
  14. * @default 90
  15. *
  16. * @help 本插件不提供插件命令。
  17. *
  18. * 备注格式:
  19. * 根据下列格式,在每个人物的备注内填写SE名称。
  20. * <attackVoice:filename>
  21. * -做出普通攻击时播放的音效。
  22. * <recoverVoice:filename>
  23. * -使用HP恢复魔法时播放的音效。
  24. * <friendMagicVoice:filename>
  25. * -对队友使用除HP恢复以外的魔法时播放的音效。
  26. *   -如果没有设定该项,并且设定了特技音效时,播放魔法音效。
  27. * <magicVoice:filename>
  28. * -使用魔法时播放的音效(不包括对队友使用)。
  29. * <skillVoice:filename>
  30. * -使用除魔法以外的特殊技能时播放的音效。
  31. * <damageVoice:filename>
  32. * -受到伤害时播放的音效。
  33. * <defeatedVoice:filename>
  34. * -无法战斗时播放的音效。
  35. * <victoryVoice:filename>
  36. * -战斗胜利时播放的音效。
  37. *   -如果有多人参加战斗并且设置了不同的音效,将随机选择其中一人的胜利音效。
  38. *
  39. */
  40. /*:ja
  41. * @plugindesc アクターの戦闘時の行動にボイスSEを設定します。
  42. * @author 神無月サスケ
  43. *
  44. * @param pitch
  45. * @desc ボイスSEのピッチです。この設定が全てのボイスSEの共通となります。
  46. * @default 100
  47. *
  48. * @param volume
  49. * @desc ボイスSEのボリュームです。この設定が全てのボイスSEの共通となります。
  50. * @default 90
  51. *
  52. * @help このプラグインには、プラグインコマンドはありません。
  53. *
  54. * メモ設定方法:
  55. * それぞれのアクターのメモに以下の書式で書いてください。
  56. * filename はボイスSEのファイル名にしてください。
  57. *
  58. * <attackVoice:filename>  通常攻撃の時に再生されるボイスです。
  59. * <recoverVoice:filename>   HP回復魔法を使用した時に再生されるボイスです。
  60. * <friendMagicVoice:filename>   HP回復以外の味方向け魔法を使用した時に
  61. *  再生されるボイスです。省略された場合で<magicVoice:filename>が
  62. *  設定されている場合は、そちらが再生されます。
  63. * <magicVoice:filename> 味方向け以外の魔法を使用した時に再生されるボイスです。
  64. * <skillVoice:filename>   必殺技を使用した時に再生されるボイスです。
  65. * <damageVoice:filename>    ダメージを受けた時に再生されるボイスです。
  66. * <defeatedVoice:filename>   戦闘不能になった時に再生されるボイスです。
  67. * <victoryVoice:filename>   戦闘勝利時に再生されるボイスです。
  68. *  アクターが複数いる場合は、生きているアクターの中からランダムで再生されます。
  69. *
  70. */
  71. (function() {

  72.   //
  73.   // process parameters
  74.   //
  75.   var parameters = PluginManager.parameters('BattleVoice');
  76.   var pitch = Number(parameters['pitch']) || 100;
  77.   var volume = Number(parameters['volume']) || 90;

  78.   AudioManager.createAudioByFileame = function(name){
  79.     var audio = {};
  80.     audio.name = name;
  81.     audio.pitch = pitch;
  82.     audio.volume = volume;
  83.     return audio;
  84.   };

  85.   //
  86.   // play actor voice
  87.   //
  88.   SoundManager.playActorVoice = function(actor, type){
  89.     var name = '';
  90.     switch(type){
  91.       case 'attack':
  92.         name = actor.meta.attackVoice;
  93.         break;
  94.       case 'recover':
  95.         name = actor.meta.recoverVoice;
  96.         break;
  97.       case 'friendmagic':
  98.         name = actor.meta.friendMagicVoice || actor.meta.magicVoice;
  99.         break;
  100.       case 'magic':
  101.         name = actor.meta.magicVoice;
  102.         break;
  103.       case 'skill':
  104.         name = actor.meta.skillVoice;
  105.         break;
  106.       case 'damage':
  107.         name = actor.meta.damageVoice;
  108.         break;
  109.       case 'dead':
  110.         name = actor.meta.defeatedVoice;
  111.         break;
  112.       case 'victory':
  113.         name = actor.meta.victoryVoice;
  114.         break;
  115.     }
  116.     if(name){
  117.       var audio = AudioManager.createAudioByFileame(name);
  118.       AudioManager.playSe(audio);
  119.     }
  120.   };

  121.   //
  122.   // functions for call actor voice.
  123.   //
  124.   var _Game_Actor_performAction = Game_Actor.prototype.performAction;
  125.   Game_Actor.prototype.performAction = function(action) {
  126.     _Game_Actor_performAction.call(this, action);
  127.     if (action.isAttack()) {
  128.       SoundManager.playActorVoice(this.actor(), 'attack');
  129.     } else if (action.isMagicSkill() && action.isHpRecover()) {
  130.       SoundManager.playActorVoice(this.actor(), 'recover');
  131.     } else if (action.isMagicSkill() && action.isForFriend()) {
  132.       SoundManager.playActorVoice(this.actor(), 'friendmagic');
  133.     } else if (action.isMagicSkill()) {
  134.       SoundManager.playActorVoice(this.actor(), 'magic');
  135.     } else if (action.isSkill() && !action.isGuard()) {
  136.       SoundManager.playActorVoice(this.actor(), 'skill');
  137.     }
  138.   };

  139.   var _Game_Actor_performDamage = Game_Actor.prototype.performDamage;
  140.   Game_Actor.prototype.performDamage = function() {
  141.     _Game_Actor_performDamage.call(this);
  142.     SoundManager.playActorVoice(this.actor(), 'damage');
  143.   };

  144.   var _Game_Actor_performCollapse = Game_Actor.prototype.performCollapse;
  145.   Game_Actor.prototype.performCollapse = function() {
  146.     _Game_Actor_performCollapse.call(this);
  147.     if ($gameParty.inBattle()) {
  148.       SoundManager.playActorVoice(this.actor(), 'dead');
  149.     }
  150.   };

  151.   var _BattleManager_processVictory = BattleManager.processVictory;
  152.   BattleManager.processVictory = function() {
  153.     var index = Math.randomInt($gameParty.aliveMembers().length);
  154.     var actor = $gameParty.aliveMembers()[index].actor();
  155.     SoundManager.playActorVoice(actor, 'victory');
  156.     _BattleManager_processVictory.call(this);
  157.   };

  158. })();
复制代码



改变图块大小4.改变图块大小
  1. //=============================================================================
  2. // Change Tile Size
  3. // by Shaz
  4. // Last Update: 2015.10.21
  5. //=============================================================================

  6. /*:
  7. * @plugindesc 允许地图使用48x48以外格式的图块。
  8. * @author Shaz
  9. *
  10. * @param Tile Size
  11. * @desc 图块大小(像素)
  12. * @default 48
  13. *
  14. * @param Tileset Image Folder
  15. * @desc 游戏中图块存放的文件夹。
  16. * @default img/tilesets/
  17. *
  18. * @param Parallax Image Folder
  19. * @desc 游戏中远景图片存放的文件夹。
  20. * @default img/parallaxes/
  21. *
  22. * @help 本插件不提供插件命令。
  23. *
  24. * 在你的工程中使用48x48以外格式的图块编辑地图时,存有两个图块文件夹。
  25. * 插件中命名的文件夹放置最终大小而且高质量的自定义图块,而原本的文件夹
  26. * img/tilesets/会保存每个图块文件的副本,并放大或缩小至标准规格48x48。
  27. * 自定义大小的图块在地图编辑器中的质量可能受损,但在实际游戏运行中将表
  28. * 现为原本的质量。原文件夹可以在分配之前清除。
  29. *
  30. * 这个规则同样适用于使用了48x48以外规格的远景图。
  31. *
  32. */

  33. (function() {

  34.   var parameters = PluginManager.parameters('ChangeTileSize');
  35.   var tileSize = parseInt(parameters['Tile Size'] || 48);
  36.   var tilesetsFolder = String(parameters['Tileset Image Folder'] || 'img/tilesets/');
  37.   var parallaxesFolder = String(parameters['Parallax Image Folder'] || 'img/parallaxes/');

  38.   ImageManager.loadTileset = function(filename, hue) {
  39.     return this.loadBitmap(tilesetsFolder, filename, hue, false);
  40.   };

  41.   ImageManager.loadParallax = function(filename, hue) {
  42.       return this.loadBitmap(parallaxesFolder, filename, hue, true);
  43.   };

  44.   Game_Map.prototype.tileWidth = function() {
  45.     return tileSize;
  46.   };

  47.   Game_Map.prototype.tileHeight = function() {
  48.     return tileSize;
  49.   };

  50.   Game_Vehicle.prototype.maxAltitude = function() {
  51.     return tileSize;
  52.   };

  53. })();
复制代码


道具使用范围同时包括生存和死亡5.道具使用范围同时包括生存和死亡
  1. //=============================================================================
  2. // DeadOrAliveItem.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 使技能/道具在人物存活和不可战斗状态下均可生效。
  6. * @author Sasuke KANNAZUKI
  7. *
  8. * @help 本插件不提供插件命令。
  9. *
  10. * 技能/道具备注:
  11. *   <scope:oneDeadOrAlive>
  12. *   <scope:allDeadOrAlive>
  13. * 用法示例:
  14. *  - 一个用于复活队友同时HP恢复完全的技能,
  15. *    如果作用于存活的队友身上则将其HP补满。
  16. */

  17. /*:ja
  18. * @plugindesc 戦闘不能かどうかに関係なく、仲間に使える技/アイテムを作成
  19. * @author 神無月サスケ
  20. *
  21. * @help このプラグインにはプラグインコマンドはありません。
  22. *
  23. * スキル/アイテムのメモに以下のように書いてください
  24. * <scope:oneDeadOrAlive>  生死問わず仲間1体への効果になります
  25. * <scope:allDeadOrAlive> 生死問わず仲間全体への効果になります
  26. *
  27. * 使用例:
  28. * 死者をHP全快で蘇生させる技だが、生きている味方に使用してもHP全快する
  29. */

  30. (function() {

  31.   // added item.scope
  32.   // 20 : single friend (dead or alive)
  33.   // 21 : all friends (dead or alive)

  34.   //
  35.   // process data in item.note
  36.   // (for efficiency, note is processed at first.)
  37.   //
  38.   var _Scene_Boot_start = Scene_Boot.prototype.start;
  39.   Scene_Boot.prototype.start = function() {
  40.     _Scene_Boot_start.call(this);
  41.     DataManager.processItemScope();
  42.   };

  43.   DataManager.processItemScope = function() {
  44.     for (var i = 1; i < $dataSkills.length; i++) {
  45.       DataManager.checkEachItemScope($dataSkills[i]);
  46.     }
  47.     for (var i = 1; i < $dataItems.length; i++) {
  48.       DataManager.checkEachItemScope($dataItems[i]);
  49.     }
  50.   };

  51.   DataManager.checkEachItemScope = function(item) {
  52.     var result = item.meta.scope;
  53.     if (result){
  54.       if(result == 'oneDeadOrAlive') {
  55.         item.scope = 20;
  56.       } else if (result == 'allDeadOrAlive') {
  57.         item.scope = 21;
  58.       }
  59.     }
  60.   };

  61.   //
  62.   // make status "dead or alive"
  63.   //
  64.   Game_Action.prototype.isDeadOrAlive = function() {
  65.     return this.checkItemScope([20, 21]);
  66.   };

  67.   var _Game_Action_isForFriend = Game_Action.prototype.isForFriend;
  68.   Game_Action.prototype.isForFriend = function() {
  69.     if (_Game_Action_isForFriend.call(this)) {
  70.       return true;
  71.     }
  72.     return this.checkItemScope([20, 21]);
  73.   };

  74.   var _Game_Action_isForDeadFriend = Game_Action.prototype.isForDeadFriend;
  75.   Game_Action.prototype.isForDeadFriend = function() {
  76.     if (_Game_Action_isForDeadFriend.call(this)) {
  77.       return true;
  78.     }
  79.     return this.checkItemScope([20, 21]);
  80.   };

  81.   var _Game_Action_isForOne = Game_Action.prototype.isForOne;
  82.   Game_Action.prototype.isForOne = function() {
  83.     if (_Game_Action_isForOne.call(this)) {
  84.       return true;
  85.     }
  86.     return this.checkItemScope([20]);
  87.   };

  88.   var _Game_Action_isForAll = Game_Action.prototype.isForAll;
  89.   Game_Action.prototype.isForAll = function() {
  90.     if (_Game_Action_isForAll.call(this)) {
  91.       return true;
  92.     }
  93.     return this.checkItemScope([21]);
  94.   };

  95.   var _Game_Action_needsSelection = Game_Action.prototype.needsSelection;
  96.   Game_Action.prototype.needsSelection = function() {
  97.     if (_Game_Action_needsSelection.call(this)) {
  98.       return true;
  99.     }
  100.     return this.checkItemScope([20]);
  101.   };

  102.   //
  103.   // smooth/random target
  104.   //
  105.   Game_Unit.prototype.smoothTargetDeadOrAlive = function(index) {
  106.     if (index < 0) {
  107.         index = 0;
  108.     }
  109.     var member = this.members()[index];
  110.     return member ? member : this.members()[0];
  111.   };

  112.   Game_Unit.prototype.randomTargetDeadOrAlive = function() {
  113.     var randomDeadTarget = this.randomDeadTarget();
  114.     if( randomDeadTarget ) {
  115.       return randomDeadTarget;
  116.     }
  117.     return this.randomTarget();
  118.   };

  119.   var _Game_Action_decideRandomTarget =
  120.    Game_Action.prototype.decideRandomTarget;
  121.   Game_Action.prototype.decideRandomTarget = function() {
  122.     var target;
  123.     if(this.isDeadOrAlive()){
  124.       target = this.friendsUnit().randomTargetDeadOrAlive();
  125.       if (target) {
  126.         this._targetIndex = target.index;
  127.       } else {
  128.         this.clear();
  129.       }
  130.       return;
  131.     }
  132.     _Game_Action_decideRandomTarget.call(this);
  133.   };

  134.   var _Game_Action_targetsForFriends = Game_Action.prototype.targetsForFriends;
  135.   Game_Action.prototype.targetsForFriends = function() {
  136.     var targets = [];
  137.     var unit = this.friendsUnit();
  138.     if(this.isDeadOrAlive()) {
  139.       if (this.isForOne()) {
  140.         targets.push(unit.smoothTargetDeadOrAlive(this._targetIndex));
  141.       } else {
  142.         targets = unit.members();
  143.       }
  144.       return targets;
  145.     }
  146.     return _Game_Action_targetsForFriends.call(this);
  147.   };

  148.   var _Game_Action_itemTargetCandidates =
  149.    Game_Action.prototype.itemTargetCandidates;
  150.   Game_Action.prototype.itemTargetCandidates = function() {
  151.     if (!this.isValid()) {
  152.       return [];
  153.     } else if (this.isDeadOrAlive()) {
  154.       return this.friendsUnit().members();
  155.     }
  156.     return _Game_Action_itemTargetCandidates.call(this);
  157.   };

  158.   var _Game_Action_testApply = Game_Action.prototype.testApply;
  159.   Game_Action.prototype.testApply = function(target) {
  160.     if(_Game_Action_testApply.call(this, target)) {
  161.       return true;
  162.     }
  163.     // for convenience, always true
  164.     if(this.isDeadOrAlive()) {
  165.       return true;
  166.     }
  167.     return false;
  168. };

  169. })();
复制代码


战斗中更改武器6.战斗中更改武器
  1. //=============================================================================
  2. // ChangeWeaponOnBattle.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 在战斗指令中更换武器。
  6. * @author Sasuke KANNAZUKI
  7. *
  8. * @param commandName
  9. * @desc 战斗中更换装备的指令名称。
  10. * @default 装备
  11. *
  12. * @help 本插件不提供插件命令。
  13. *
  14. * - 可被更换的装备包括武器和盾牌。
  15. * - 更换装备不消耗回合数。
  16. *
  17. */

  18. /*:ja
  19. * @plugindesc 戦闘コマンドに装備変更を追加
  20. * @author 神無月サスケ
  21. *
  22. * @param commandName
  23. * @desc 装備変更のコマンド名です。
  24. * @default 装備変更
  25. *
  26. * @help このプラグインには、プラグインコマンドはありません。
  27. *
  28. * - 変更可能なのは武器と盾だけです。
  29. * - 装備変更はターンを消費しません。
  30. *
  31. */

  32. (function() {

  33.   var parameters = PluginManager.parameters('ChangeWeaponOnBattle');
  34.   var commandName = parameters['commandName'] || 'Equip';

  35.   //---------------------------------------------------------------------------
  36.   // Tiny equip status
  37.   // display only atk and def.
  38.   //
  39.   function Window_TinyEquipStatus() {
  40.     this.initialize.apply(this, arguments);
  41.   }

  42.   Window_TinyEquipStatus.prototype =
  43.    Object.create(Window_EquipStatus.prototype);
  44.   Window_TinyEquipStatus.prototype.constructor = Window_TinyEquipStatus;

  45.   Window_TinyEquipStatus.prototype.initialize = function(x, y) {
  46.     Window_EquipStatus.prototype.initialize.call(this, x, y);
  47.   };

  48.   Window_TinyEquipStatus.prototype.numVisibleRows = function() {
  49.     return 2;
  50.   };

  51.   Window_TinyEquipStatus.prototype.refresh = function() {
  52.     this.contents.clear();
  53.     if (this._actor) {
  54.       for (var i = 0; i < 2; i++) {
  55.         this.drawItem(0, this.lineHeight() * i, 2 + i);
  56.       }
  57.     }
  58.   };

  59.   //---------------------------------------------------------------------------
  60.   // Tiny equip slot
  61.   // display only a weapon, and a shield or another weapon.
  62.   //
  63.   function Window_TinyEquipSlot() {
  64.     this.initialize.apply(this, arguments);
  65.   }

  66.   Window_TinyEquipSlot.prototype = Object.create(Window_EquipSlot.prototype);
  67.   Window_TinyEquipSlot.prototype.constructor = Window_TinyEquipSlot;

  68.   Window_TinyEquipSlot.prototype.initialize  = function(x, y, width, height) {
  69.     Window_EquipSlot.prototype.initialize.call(this, x, y, width, height);
  70.   };

  71.   Window_TinyEquipSlot.prototype.maxItems = function() {
  72.     return this._actor ? 2 : 0;
  73.   };

  74.   Window_TinyEquipSlot.prototype.show = function() {
  75.     Window_EquipSlot.prototype.show.call(this);
  76.     this.showHelpWindow();
  77.   };

  78.   Window_TinyEquipSlot.prototype.hide = function() {
  79.     Window_EquipSlot.prototype.hide.call(this);
  80.     this.hideHelpWindow();
  81.   };

  82.   //---------------------------------------------------------------------------

  83.   //
  84.   // add equipment windows for check active.
  85.   //
  86.   var _Scene_Battle_isAnyInputWindowActive =
  87.    Scene_Battle.prototype.isAnyInputWindowActive;
  88.   Scene_Battle.prototype.isAnyInputWindowActive = function() {
  89.     if(_Scene_Battle_isAnyInputWindowActive.call(this)) {
  90.       return true;
  91.     }
  92.     return (this._equipSlotWindow.active || this._equipItemWindow.active);
  93.   };

  94.   //
  95.   // creat new windows for equip weapon(s) on battle
  96.   //
  97.   var _Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
  98.   Scene_Battle.prototype.createAllWindows = function() {
  99.     _Scene_Battle_createAllWindows.call(this);
  100.     this.createEquipStatusWindow();
  101.     this.createEquipSlotWindow();
  102.     this.createEquipItemWindow();
  103.   };

  104.   Scene_Battle.prototype.createEquipStatusWindow = function() {
  105.     this._equipStatusWindow =
  106.      new Window_TinyEquipStatus(0, this._helpWindow.height);
  107.     this._equipStatusWindow.hide();
  108.     this.addWindow(this._equipStatusWindow);
  109.   };

  110.   Scene_Battle.prototype.createEquipSlotWindow = function() {
  111.     var wx = this._equipStatusWindow.width;
  112.     var wy = this._helpWindow.height;
  113.     var ww = Graphics.boxWidth - this._equipStatusWindow.width;
  114.     var wh = this._equipStatusWindow.height;
  115.     this._equipSlotWindow = new Window_TinyEquipSlot(wx, wy, ww, wh);
  116.     this._equipSlotWindow.setHelpWindow(this._helpWindow);
  117.     this._equipSlotWindow.setStatusWindow(this._equipStatusWindow);
  118.     this._equipSlotWindow.setHandler('ok', this.onEquipSlotOk.bind(this));
  119.     this._equipSlotWindow.setHandler('cancel',
  120.      this.onEquipSlotCancel.bind(this));
  121.     this._equipSlotWindow.hide();
  122.     this.addWindow(this._equipSlotWindow);
  123.   };

  124.   Scene_Battle.prototype.createEquipItemWindow = function() {
  125.     var wx = 0;
  126.     var wy = this._equipStatusWindow.y + this._equipStatusWindow.height;
  127.     var ww = Graphics.boxWidth;
  128.     var wh = Graphics.boxHeight - wy - this._statusWindow.height;
  129.     this._equipItemWindow = new Window_EquipItem(wx, wy, ww, wh);
  130.     this._equipItemWindow.setHelpWindow(this._helpWindow);
  131.     this._equipItemWindow.setStatusWindow(this._equipStatusWindow);
  132.     this._equipItemWindow.setHandler('ok',     this.onEquipItemOk.bind(this));
  133.     this._equipItemWindow.setHandler('cancel',
  134.      this.onEquipItemCancel.bind(this));
  135.     this._equipSlotWindow.setItemWindow(this._equipItemWindow);
  136.     this._equipItemWindow.hide();
  137.     this.addWindow(this._equipItemWindow);
  138.   };

  139.   //
  140.   // add command to actor command window
  141.   //
  142.   var _Scene_Battle_createActorCommandWindow =
  143.    Scene_Battle.prototype.createActorCommandWindow;
  144.   Scene_Battle.prototype.createActorCommandWindow = function() {
  145.     _Scene_Battle_createActorCommandWindow.call(this);
  146.     this._actorCommandWindow.setHandler('equip', this.commandEquip.bind(this));
  147.   };

  148.   var _Window_ActorCommand_makeCommandList =
  149.    Window_ActorCommand.prototype.makeCommandList;
  150.   Window_ActorCommand.prototype.makeCommandList = function() {
  151.     _Window_ActorCommand_makeCommandList.call(this);
  152.     if (this._actor) {
  153.       this.addEquipCommand();
  154.     }
  155.   };

  156.   Window_ActorCommand.prototype.addEquipCommand = function() {
  157.     this.addCommand(commandName, 'equip');
  158.   };

  159.   //
  160.   // process handlers
  161.   //
  162.   Scene_Battle.prototype.refreshActor = function() {
  163.     var actor = BattleManager.actor();
  164.     this._equipStatusWindow.setActor(actor);
  165.     this._equipSlotWindow.setActor(actor);
  166.     this._equipItemWindow.setActor(actor);
  167.   };

  168.   Scene_Battle.prototype.commandEquip = function() {
  169.     this.refreshActor();
  170.     this._equipStatusWindow.show();
  171.     this._equipItemWindow.refresh();
  172.     this._equipItemWindow.show();
  173.     this._equipSlotWindow.refresh();
  174.     this._equipSlotWindow.show();
  175.     this._equipSlotWindow.activate();
  176.     this._equipSlotWindow.select(0);
  177.   };

  178.   Scene_Battle.prototype.onEquipSlotOk = function() {
  179.     this._equipItemWindow.activate();
  180.     this._equipItemWindow.select(0);
  181.   };

  182.   Scene_Battle.prototype.onEquipSlotCancel = function() {
  183.     this._equipStatusWindow.hide();
  184.     this._equipItemWindow.hide();
  185.     this._equipSlotWindow.hide();
  186.     this._actorCommandWindow.activate();
  187.     this._actorCommandWindow.select(0);
  188.   };

  189.   Scene_Battle.prototype.onEquipItemOk = function() {
  190.     SoundManager.playEquip();
  191.     BattleManager.actor().changeEquip(this._equipSlotWindow.index(),
  192.      this._equipItemWindow.item());
  193.     this._equipSlotWindow.activate();
  194.     this._equipSlotWindow.refresh();
  195.     this._equipItemWindow.deselect();
  196.     this._equipItemWindow.refresh();
  197.     this._equipStatusWindow.refresh();
  198.   };

  199.   Scene_Battle.prototype.onEquipItemCancel = function() {
  200.     this._equipSlotWindow.activate();
  201.     this._equipItemWindow.deselect();
  202.   };

  203. })();
复制代码


战斗背景滚动7.战斗背景滚动

  1. //=============================================================================
  2. // BattlebackScroll.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 战斗背景(battlebacks1)自动滚动。
  6. * @author Yoji Ojima
  7. *
  8. * @param Scroll X Variable ID
  9. * @desc 选择变量ID,以改变该变量来控制横向滚动速度。
  10. * @default 0
  11. *
  12. * @param Scroll Y Variable ID
  13. * @desc 选择变量ID,以改变该变量来控制纵向滚动速度。
  14. * @default 0
  15. *
  16. * @help 本插件不提供插件命令。
  17. */

  18. /*:ja
  19. * @plugindesc 戦闘背景(battlebacks1)を自動的にスクロールします。
  20. * @author Yoji Ojima
  21. *
  22. * @param Scroll X Variable ID
  23. * @desc 横スクロール速度を指定するための変数のIDです。
  24. * @default 0
  25. *
  26. * @param Scroll Y Variable ID
  27. * @desc 縦スクロール速度を指定するための変数のIDです。
  28. * @default 0
  29. *
  30. * @help このプラグインには、プラグインコマンドはありません。
  31. */

  32. (function() {

  33.     var parameters = PluginManager.parameters('BattlebackScroll');
  34.     var scrollXVariableId = Number(parameters['Scroll X Variable ID'] || 0);
  35.     var scrollYVariableId = Number(parameters['Scroll Y Variable ID'] || 0);

  36.     var _Spriteset_Battle_updateBattleback =
  37.             Spriteset_Battle.prototype.updateBattleback;
  38.     Spriteset_Battle.prototype.updateBattleback = function() {
  39.         _Spriteset_Battle_updateBattleback.call(this);
  40.         var scrollX = $gameVariables.value(scrollXVariableId);
  41.         var scrollY = $gameVariables.value(scrollYVariableId);
  42.         if (scrollX) {
  43.             this._back1Sprite.origin.x += scrollX / 8;
  44.         }
  45.         if (scrollY) {
  46.             this._back1Sprite.origin.y += scrollY / 8;
  47.         }
  48.     };

  49. })();
复制代码


战斗模式8.战斗模式
  1. //=============================================================================
  2. // Battle Mode
  3. // by Shaz
  4. // Last Updated: 2015.10.21
  5. //=============================================================================

  6. /*:
  7. * @plugindesc 允许在同一游戏中使用侧视图和前视图两种战斗模式。
  8. * @author Shaz
  9. *
  10. * @help 本插件不提供插件命令。
  11. *
  12. * 队伍名称前缀为SV的敌人,以侧视图的方式战斗。
  13. * 队伍名称前缀为FV的敌人,以前视图的方式战斗。
  14. * 队伍名称前缀为RV的敌人,以随机的方式战斗。
  15. * 没有前缀名称的敌人队伍,依照系统默认的方式战斗。
  16. *
  17. */

  18. (function() {
  19.   var _Game_System_isSideView = Game_System.prototype.isSideView;
  20.   Game_System.prototype.isSideView = function() {
  21.     if ($gameParty.inBattle) {
  22.       var sv = $gameTroop.isSideView();
  23.       if (sv === null) {
  24.         return _Game_System_isSideView.call(this);
  25.       } else {
  26.         return sv;
  27.       }
  28.     } else {
  29.       return _Game_System_isSideView.call(this);
  30.     }
  31.   };

  32.   var _Game_Troop_setup = Game_Troop.prototype.setup;
  33.   Game_Troop.prototype.setup = function(troopId) {
  34.     _Game_Troop_setup.call(this, troopId);

  35.     if (this.troop().name.match(/^SV/)) {
  36.       this._isSideView = true;
  37.     } else if (this.troop().name.match(/^FV/)) {
  38.       this._isSideView = false;
  39.     } else if (this.troop().name.match(/^RV/)) {
  40.       this._isSideView = Math.random() < 0.5;
  41.     } else {
  42.       this._isSideView = null;
  43.     }
  44.   };

  45.   Game_Troop.prototype.isSideView = function() {
  46.     return this._isSideView;
  47.   };
  48. })();
复制代码


战斗结果窗口9.战斗结果窗口
  1. //=============================================================================
  2. // BattleResultsPopup.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 以窗口的形式显示战斗结果。
  6. * @author Yoji Ojima
  7. *
  8. * @help 本插件不提供插件命令。
  9. */

  10. /*:ja
  11. * @plugindesc 戦闘結果の表示をポップアップ形式に変更します。
  12. * @author Yoji Ojima
  13. *
  14. * @help このプラグインには、プラグインコマンドはありません。
  15. */

  16. (function() {

  17.     var resultDisplaying = 0;

  18.     var _BattleManager_initMembers = BattleManager.initMembers;
  19.     BattleManager.initMembers = function() {
  20.         _BattleManager_initMembers.call(this);
  21.         resultDisplaying = 0;
  22.     };

  23.     var _BattleManager_update = BattleManager.update;
  24.     BattleManager.update = function() {
  25.         _BattleManager_update.call(this);
  26.         if (resultDisplaying > 0) {
  27.             if (++resultDisplaying >= 60) {
  28.                 if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
  29.                     resultDisplaying = 0;
  30.                 }
  31.             }
  32.         }
  33.     };

  34.     var _BattleManager_isBusy = BattleManager.isBusy;
  35.     BattleManager.isBusy = function() {
  36.         return _BattleManager_isBusy.call(this) || resultDisplaying > 0;
  37.     };

  38.     BattleManager.displayVictoryMessage = function() {
  39.     };

  40.     BattleManager.displayRewards = function() {
  41.         resultDisplaying = 1;
  42.     };

  43.     Game_Actor.prototype.shouldDisplayLevelUp = function() {
  44.         return false;
  45.     };

  46.     var _Scene_Battle_update = Scene_Battle.prototype.update;
  47.     Scene_Battle.prototype.update = function() {
  48.         _Scene_Battle_update.call(this);
  49.         if (resultDisplaying > 30 && !this._resultWindow) {
  50.             this._resultWindow = new Window_BattleResults();
  51.             this.addWindow(this._resultWindow);
  52.         }
  53.     };

  54.     var _Scene_Battle_stop = Scene_Battle.prototype.stop;
  55.     Scene_Battle.prototype.stop = function() {
  56.         _Scene_Battle_stop.call(this);
  57.         if (this._resultWindow) {
  58.             this._resultWindow.close();
  59.         }
  60.     };

  61.     function Window_BattleResults() {
  62.         this.initialize.apply(this, arguments);
  63.     }

  64.     Window_BattleResults.prototype = Object.create(Window_Base.prototype);
  65.     Window_BattleResults.prototype.constructor = Window_BattleResults;

  66.     Window_BattleResults.prototype.initialize = function() {
  67.         var rewards = BattleManager._rewards;
  68.         var width = 400;
  69.         var height = this.fittingHeight(Math.min(9, rewards.items.length + 1));
  70.         var statusHeight = this.fittingHeight(4);
  71.         var x = (Graphics.boxWidth - width) / 2;
  72.         var y = (Graphics.boxHeight - statusHeight - height) / 2;
  73.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  74.         this.refresh();
  75.         this.openness = 0;
  76.         this.open();
  77.     };

  78.     Window_BattleResults.prototype.refresh = function() {
  79.         var x = this.textPadding();
  80.         var y = 0;
  81.         var width = this.contents.width;
  82.         var lineHeight = this.lineHeight();
  83.         var rewards = BattleManager._rewards;
  84.         var items = rewards.items;
  85.         this.contents.clear();

  86.         this.resetTextColor();
  87.         this.drawText(rewards.exp, x, y);
  88.         x += this.textWidth(rewards.exp) + 6;
  89.         this.changeTextColor(this.systemColor());
  90.         this.drawText(TextManager.expA, x, y);
  91.         x += this.textWidth(TextManager.expA + '  ');

  92.         this.resetTextColor();
  93.         this.drawText(rewards.gold, x, y);
  94.         x += this.textWidth(rewards.gold) + 6;
  95.         this.changeTextColor(this.systemColor());
  96.         this.drawText(TextManager.currencyUnit, x, y);

  97.         x = 0;
  98.         y += lineHeight;

  99.         items.forEach(function(item) {
  100.             this.drawItemName(item, x, y, width);
  101.             y += lineHeight;
  102.         }, this);
  103.     };

  104. })();
复制代码


温馨提示 暴力汉化 在除日语外所有环境下均使用汉语 如需保留英文版本 请自行备份。

插件汉化.rar

17.2 KB, 下载次数: 287

评分

参与人数 2星屑 +6 梦石 +1 收起 理由
余烬之中 + 1 搬运
grayuncle + 6

查看全部评分

梦石
0
星屑
1564
在线时间
523 小时
注册时间
2015-8-23
回帖
83
发表于 2015-10-30 12:14:16 | 显示全部楼层
支持支持~太感谢了
回复

使用道具 举报

梦石
0
星屑
451
在线时间
228 小时
注册时间
2015-2-23
回帖
233
发表于 2015-10-30 14:22:13 | 显示全部楼层
我来几个不重复的,就不另外发帖了,LZ可以等以后全了,收集到一起。

下面的文件解压后,把里面的JS文件复制到工程目录 js\plugins 文件夹里。

翻译这个确实有点累,特别是长篇幅的说明。

敌人图鉴.rar (2.79 KB, 下载次数: 229)
改变角色装备类型.rar (1.71 KB, 下载次数: 166)
公共事件选择.rar (1.79 KB, 下载次数: 182)
固定战斗人员.rar (884 Bytes, 下载次数: 166)
逃离地牢.rar (1.6 KB, 下载次数: 158)
武器所使用的技能设置.rar (1.51 KB, 下载次数: 3090)
制作XP特效,找我。
回复

使用道具 举报

梦石
0
星屑
80
在线时间
243 小时
注册时间
2007-2-10
回帖
46

开拓者

发表于 2015-10-30 14:46:34 | 显示全部楼层
应该保留原文,添加汉化,这样防止机翻出错可以自己对照一下

在注释开头插入“/*:”加上下面的语言代码可以将注释内容标注为相应的语言。例如,将代码标注为中文的注释就是:“/*:zh”。被标注为对应语言的代码只会在对应语言版本的RM编辑器中生效。未标注语言的部分(通常为英语)则作为默认语言显示。

点评

因为我的版本可以能破解过的缘故?中文语境好像不起作用……还是显示的英文  发表于 2015-10-30 15:06
。。。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
31 小时
注册时间
2015-10-26
回帖
23
发表于 2015-10-30 14:47:30 | 显示全部楼层
本帖最后由 zhangjiki 于 2015-10-30 14:50 编辑

浩大的工程,但愿有人能持之以恒的注解哦~我们这些非人类语言小白就靠你们了。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
26 小时
注册时间
2015-10-13
回帖
16
发表于 2015-10-30 18:00:23 | 显示全部楼层
66666233谢谢楼主
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-10-30 20:04:05 | 显示全部楼层
支持楼主.
回复

使用道具 举报

梦石
0
星屑
1669
在线时间
230 小时
注册时间
2018-12-9
回帖
131
发表于 2023-4-18 19:53:25 | 显示全部楼层
感谢大佬分享
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部