查看: 3665|回复: 3

[有事请教] YEP两插件问题求教

[复制链接]
梦石
0
星屑
5840
在线时间
109 小时
注册时间
2009-2-15
回帖
27
发表于 2018-5-16 14:41:37 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 gyhy17951 于 2018-5-16 16:46 编辑

第一个问题:YEP_X_VisualStateFX插件
1.png
视频里明明在头上,为啥我这里在脚下。
第二个问题:YEP_X_InBattleStatus插件
2.png
怎么让status出现在 3.png 这里面

先感谢大大们
梦石
0
星屑
5840
在线时间
109 小时
注册时间
2009-2-15
回帖
27
 楼主| 发表于 2018-5-16 16:43:00 | 显示全部楼层
第一个问题已经解决了,应该是我MV的问题,继续求教第二个问题
回复

使用道具 举报

梦石
0
星屑
489
在线时间
84 小时
注册时间
2018-4-16
回帖
43
发表于 2018-5-17 01:42:53 | 显示全部楼层
本帖最后由 jgf1000 于 2018-5-17 12:26 编辑

稍微改了一下不是很仔细,不保证一定能用,也不保证兼容性,但在我自己这是通过的。默认放在物品前,可自行修改。
QAQ因为我也只是个新手= =
改动基本上在486-500和823-857,就是将Party部分改成了Actor
  1. //=============================================================================
  2. // Yanfly Engine Plugins - In-Battle Status
  3. // YEP_X_InBattleStatus.js
  4. //=============================================================================

  5. var Imported = Imported || {};
  6. Imported.YEP_X_InBattleStatus = true;

  7. var Yanfly = Yanfly || {};
  8. Yanfly.IBS = Yanfly.IBS || {};

  9. //=============================================================================
  10. /*:
  11. * @plugindesc v1.00 战斗状态查看
  12. * @author Yanfly Engine Plugins
  13. *
  14. * @param ---General---
  15. * @default
  16. *
  17. * @param Command Text
  18. * @desc The text used for 'Status' command text in the Party Window.
  19. * @default Status
  20. *
  21. * @param Show Command
  22. * @desc Show the in battle 'Status' command by default?
  23. * NO - false     YES - true
  24. * @default true
  25. *
  26. * @param Window X
  27. * @desc The default X location used for the in-battle status window.
  28. * You can use formulas.
  29. * @default 0
  30. *
  31. * @param Window Y
  32. * @desc The default Y location used for the in-battle status window.
  33. * You can use formulas.
  34. * @default this.fittingHeight(2)
  35. *
  36. * @param Window Width
  37. * @desc The default width used for the in-battle status window.
  38. * You can use formulas.
  39. * @default Graphics.boxWidth
  40. *
  41. * @param Window Height
  42. * @desc The default height used for the in-battle status window.
  43. * You can use formulas.
  44. * @default Graphics.boxHeight - this.fittingHeight(2) - this.fittingHeight(4)
  45. *
  46. * @param ---Status List---
  47. * @default
  48. *
  49. * @param Status Width
  50. * @desc The width of the status list.
  51. * You can use formulas.
  52. * @default Math.max(312, Graphics.boxWidth / 4);
  53. *
  54. * @param State Help Front
  55. * @desc Text placed in front of each state's help description.
  56. * %1 - State Icon     %2 - State Name
  57. * @default \i[%1]%2
  58. *
  59. * @param State Help End
  60. * @desc Text placed in end of each state's help description.
  61. * %1 - State Icon     %2 - State Name
  62. * @default
  63. *
  64. * @param Healthy Icon
  65. * @desc Icon ID used to indicate the battler is healthy (no states).
  66. * @default 127
  67. *
  68. * @param Healthy Text
  69. * @desc Text used to label the healthy status.
  70. * @default Healthy
  71. *
  72. * @param Healthy Help
  73. * @desc Text displayed in help window when selected.
  74. * @default User is currently unaffected by status effects.
  75. *
  76. * @param ---Buffs List---
  77. * @default
  78. *
  79. * @param MaxHP Buff Text
  80. * @desc The text used to display the MaxHP Buff Name.
  81. * @default MaxHP Up
  82. *
  83. * @param MaxHP Buff Help
  84. * @desc The text used for the MaxHP help description.
  85. * %1 - Rate     %2 - Stacks     %3 - Turns
  86. * @default Raises Maximum Health to %1%.
  87. *
  88. * @param MaxMP Buff Text
  89. * @desc The text used to display the MaxMP Buff Name.
  90. * @default MaxMP Up
  91. *
  92. * @param MaxMP Buff Help
  93. * @desc The text used for the MaxMP help description.
  94. * %1 - Rate     %2 - Stacks     %3 - Turns
  95. * @default Raises Maximum Mana to %1%.
  96. *
  97. * @param ATK Buff Text
  98. * @desc The text used to display the ATK Buff Name.
  99. * @default ATK Up
  100. *
  101. * @param ATK Buff Help
  102. * @desc The text used for the ATK help description.
  103. * %1 - Rate     %2 - Stacks     %3 - Turns
  104. * @default Raises Attack to %1%.
  105. *
  106. * @param DEF Buff Text
  107. * @desc The text used to display the DEF Buff Name.
  108. * @default DEF Up
  109. *
  110. * @param DEF Buff Help
  111. * @desc The text used for the DEF help description.
  112. * %1 - Rate     %2 - Stacks     %3 - Turns
  113. * @default Raises Defense to %1%.
  114. *
  115. * @param MAT Buff Text
  116. * @desc The text used to display the MAT Buff Name.
  117. * @default MAT Up
  118. *
  119. * @param MAT Buff Help
  120. * @desc The text used for the MAT help description.
  121. * %1 - Rate     %2 - Stacks     %3 - Turns
  122. * @default Raises Magic Attack to %1%.
  123. *
  124. * @param MDF Buff Text
  125. * @desc The text used to display the MDF Buff Name.
  126. * @default MDF Up
  127. *
  128. * @param MDF Buff Help
  129. * @desc The text used for the MDF help description.
  130. * %1 - Rate     %2 - Stacks     %3 - Turns
  131. * @default Raises Magic Defense to %1%.
  132. *
  133. * @param AGI Buff Text
  134. * @desc The text used to display the AGI Buff Name.
  135. * @default AGI Up
  136. *
  137. * @param AGI Buff Help
  138. * @desc The text used for the AGI help description.
  139. * %1 - Rate     %2 - Stacks     %3 - Turns
  140. * @default Raises Agility to %1%.
  141. *
  142. * @param LUK Buff Text
  143. * @desc The text used to display the LUK Buff Name.
  144. * @default LUK Up
  145. *
  146. * @param LUK Buff Help
  147. * @desc The text used for the LUK help description.
  148. * %1 - Rate     %2 - Stacks     %3 - Turns
  149. * @default Raises Luck to %1%.
  150. *
  151. * @param ---Debuffs List---
  152. * @default
  153. *
  154. * @param MaxHP Debuff Text
  155. * @desc The text used to display the MaxHP Debuff Name.
  156. * @default MaxHP Down
  157. *
  158. * @param MaxHP Debuff Help
  159. * @desc The text used for the MaxHP help description.
  160. * %1 - Rate     %2 - Stacks     %3 - Turns
  161. * @default Lowers Maximum Health to %1%.
  162. *
  163. * @param MaxMP Debuff Text
  164. * @desc The text used to display the MaxMP Debuff Name.
  165. * @default MaxMP Down
  166. *
  167. * @param MaxMP Debuff Help
  168. * @desc The text used for the MaxMP help description.
  169. * %1 - Rate     %2 - Stacks     %3 - Turns
  170. * @default Lowers Maximum Mana to %1%.
  171. *
  172. * @param ATK Debuff Text
  173. * @desc The text used to display the ATK Debuff Name.
  174. * @default ATK Down
  175. *
  176. * @param ATK Debuff Help
  177. * @desc The text used for the ATK help description.
  178. * %1 - Rate     %2 - Stacks     %3 - Turns
  179. * @default Lowers Attack to %1%.
  180. *
  181. * @param DEF Debuff Text
  182. * @desc The text used to display the DEF Debuff Name.
  183. * @default DEF Down
  184. *
  185. * @param DEF Debuff Help
  186. * @desc The text used for the DEF help description.
  187. * %1 - Rate     %2 - Stacks     %3 - Turns
  188. * @default Lowers Defense to %1%.
  189. *
  190. * @param MAT Debuff Text
  191. * @desc The text used to display the MAT Debuff Name.
  192. * @default MAT Down
  193. *
  194. * @param MAT Debuff Help
  195. * @desc The text used for the MAT help description.
  196. * %1 - Rate     %2 - Stacks     %3 - Turns
  197. * @default Lowers Magic Attack to %1%.
  198. *
  199. * @param MDF Debuff Text
  200. * @desc The text used to display the MDF Debuff Name.
  201. * @default MDF Down
  202. *
  203. * @param MDF Debuff Help
  204. * @desc The text used for the MDF help description.
  205. * %1 - Rate     %2 - Stacks     %3 - Turns
  206. * @default Lowers Magic Defense to %1%.
  207. *
  208. * @param AGI Debuff Text
  209. * @desc The text used to display the AGI Debuff Name.
  210. * @default AGI Down
  211. *
  212. * @param AGI Debuff Help
  213. * @desc The text used for the AGI help description.
  214. * %1 - Rate     %2 - Stacks     %3 - Turns
  215. * @default Lowers Agility to %1%.
  216. *
  217. * @param LUK Debuff Text
  218. * @desc The text used to display the LUK Debuff Name.
  219. * @default LUK Down
  220. *
  221. * @param LUK Debuff Help
  222. * @desc The text used for the LUK help description.
  223. * %1 - Rate     %2 - Stacks     %3 - Turns
  224. * @default Lowers Luck to %1%.
  225. *
  226. * @help
  227. * ============================================================================
  228. * Introduction
  229. * ============================================================================
  230. *
  231. * 这个插件需要YEP_BattleEngineCore。确保这个插件放在YEP_BattleEngineCore下面
  232. *
  233. * 在战斗中,我们没有办法查看队伍当前状态,这个插件将会在队伍命令中添加
  234. * “状态”命令,允许玩家去查看角色状态。在这里,我们可以看到队员的初始
  235. * 参数和状态列表。这个玩家将可以
  236. *
  237. * 注意:如果你使用了YEP_X_BattleSysCTB,请把这个插件放在下面以提高兼容性

  238. *
  239. * ============================================================================
  240. * Notetags
  241. * ============================================================================
  242. *
  243. * 想要添加帮助文字的可以用下面的备注
  244. *
  245. * State Notetags:
  246. *
  247. *   <Help Description>
  248. *    text
  249. *    text
  250. *   </Help Description>
  251. *   这可以添加帮助文字
  252. *
  253. * ============================================================================
  254. * Text Codes
  255. * ============================================================================
  256. *
  257. * 可以使用文本代码:
  258. *
  259. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  260. *
  261. * State Help     Function
  262. *   \th[x]       - 替换为状态帮助文字
  263. *
  264. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  265. *
  266. * ============================================================================
  267. * Plugin Commands
  268. * ============================================================================
  269. *
  270. * 想要改变状态菜单命令的,可以用下面插件来设置:
  271. *
  272. * Plugin Commands:
  273. *
  274. *   ShowInBattleStatus
  275. *   - 开启战斗状态命令
  276. *
  277. *   HideInBattleStatus
  278. *   - 关闭战斗状态命令
  279. */
  280. //=============================================================================

  281. if (Imported.YEP_BattleEngineCore) {

  282. //=============================================================================
  283. // Parameter Variables
  284. //=============================================================================

  285. Yanfly.Parameters = PluginManager.parameters('YEP_X_InBattleStatus');
  286. Yanfly.Param = Yanfly.Param || {};

  287. Yanfly.Param.IBSCmdName = String(Yanfly.Parameters['Command Text']);
  288. Yanfly.Param.IBSCmdShow = eval(String(Yanfly.Parameters['Show Command']));
  289. Yanfly.Param.IBSWinX = String(Yanfly.Parameters['Window X']);
  290. Yanfly.Param.IBSWinY = String(Yanfly.Parameters['Window Y']);
  291. Yanfly.Param.IBSWinWidth = String(Yanfly.Parameters['Window Width']);
  292. Yanfly.Param.IBSWinHeight = String(Yanfly.Parameters['Window Height']);

  293. Yanfly.Param.IBSStatusListWidth = String(Yanfly.Parameters['Status Width']);
  294. Yanfly.Param.IBSStateHelp1 = String(Yanfly.Parameters['State Help Front']);
  295. Yanfly.Param.IBSStateHelp2 = String(Yanfly.Parameters['State Help End']);
  296. Yanfly.Param.IBSHealthyIcon = Number(Yanfly.Parameters['Healthy Icon']);
  297. Yanfly.Param.IBSHealthyText = String(Yanfly.Parameters['Healthy Text']);
  298. Yanfly.Param.IBSHealthyHelp = String(Yanfly.Parameters['Healthy Help']);

  299. Yanfly.Param.IBSBuffText = [];
  300. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MaxHP Buff Text']));
  301. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MaxMP Buff Text']));
  302. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['ATK Buff Text']));
  303. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['DEF Buff Text']));
  304. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MAT Buff Text']));
  305. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MDF Buff Text']));
  306. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['AGI Buff Text']));
  307. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['LUK Buff Text']));
  308. Yanfly.Param.IBSBuffHelp = [];
  309. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MaxHP Buff Help']));
  310. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MaxMP Buff Help']));
  311. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['ATK Buff Help']));
  312. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['DEF Buff Help']));
  313. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MAT Buff Help']));
  314. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MDF Buff Help']));
  315. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['AGI Buff Help']));
  316. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['LUK Buff Help']));

  317. Yanfly.Param.IBSDebuffText = [];
  318. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MaxHP Debuff Text']));
  319. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MaxMP Debuff Text']));
  320. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['ATK Debuff Text']));
  321. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['DEF Debuff Text']));
  322. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MAT Debuff Text']));
  323. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MDF Debuff Text']));
  324. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['AGI Debuff Text']));
  325. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['LUK Debuff Text']));
  326. Yanfly.Param.IBSDebuffHelp = [];
  327. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MaxHP Debuff Help']));
  328. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MaxMP Debuff Help']));
  329. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['ATK Debuff Help']));
  330. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['DEF Debuff Help']));
  331. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MAT Debuff Help']));
  332. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MDF Debuff Help']));
  333. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['AGI Debuff Help']));
  334. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['LUK Debuff Help']));

  335. //=============================================================================
  336. // DataManager
  337. //=============================================================================

  338. Yanfly.IBS.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  339. DataManager.isDatabaseLoaded = function() {
  340.   if (!Yanfly.IBS.DataManager_isDatabaseLoaded.call(this)) return false;

  341.   if (!Yanfly._loaded_YEP_X_InBattleStatus) {
  342.     this.processIBSNotetags1($dataStates);
  343.     Yanfly._loaded_YEP_X_InBattleStatus = true;
  344.   }
  345.   
  346.   return true;
  347. };

  348. DataManager.processIBSNotetags1 = function(group) {
  349.   for (var n = 1; n < group.length; n++) {
  350.     var obj = group[n];
  351.     var notedata = obj.note.split(/[\r\n]+/);

  352.     var fmt1 = Yanfly.Param.IBSStateHelp1;
  353.     obj.description = fmt1.format(obj.iconIndex, obj.name);
  354.     var descLength = obj.description.length;
  355.     var evalMode = 'none';

  356.     for (var i = 0; i < notedata.length; i++) {
  357.       var line = notedata[i];
  358.       if (line.match(/<(?:HELP|DESCRIPTION|HELP DESCRIPTION)>/i)) {
  359.         evalMode = 'help description';
  360.       } else if (line.match(/<\/(?:HELP|DESCRIPTION|HELP DESCRIPTION)>/i)) {
  361.         evalMode = 'none';
  362.       } else if (evalMode === 'help description') {
  363.         if (obj.description.length > descLength) obj.description += '\n';
  364.         obj.description += line;
  365.       }
  366.     }

  367.     var fmt2 = Yanfly.Param.IBSStateHelp2;
  368.     obj.description += fmt2.format(obj.iconIndex, obj.name);
  369.   }
  370. };

  371. //=============================================================================
  372. // Game_System
  373. //=============================================================================

  374. Yanfly.IBS.Game_System_initialize = Game_System.prototype.initialize;
  375. Game_System.prototype.initialize = function() {
  376.   Yanfly.IBS.Game_System_initialize.call(this);
  377.   this.initIBSSettings();
  378. };

  379. Game_System.prototype.initIBSSettings = function() {
  380.   this._showInBattleStatus = Yanfly.Param.IBSCmdShow;
  381. };

  382. Game_System.prototype.isShowInBattleStatus = function() {
  383.   if (this._showInBattleStatus === undefined) this.initIBSSettings();
  384.   return this._showInBattleStatus;
  385. };

  386. Game_System.prototype.setShowInBattleStatus = function(value) {
  387.   if (this._showInBattleStatus === undefined) this.initIBSSettings();
  388.   this._showInBattleStatus = value;
  389. };

  390. //=============================================================================
  391. // Game_Interpreter
  392. //=============================================================================

  393. Yanfly.IBS.Game_Interpreter_pluginCommand =
  394.     Game_Interpreter.prototype.pluginCommand;
  395. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  396.   Yanfly.IBS.Game_Interpreter_pluginCommand.call(this, command, args);
  397.   if (command === 'ShowInBattleStatus') {
  398.     $gameSystem.setShowInBattleStatus(true);
  399.   } else if (command === 'HideInBattleStatus') {
  400.     $gameSystem.setShowInBattleStatus(false);
  401.   }
  402. };

  403. //=============================================================================
  404. // Window_Base
  405. //=============================================================================

  406. Yanfly.IBS.Window_Base_convertEscapeCharacters =
  407.   Window_Base.prototype.convertEscapeCharacters;
  408. Window_Base.prototype.convertEscapeCharacters = function(text) {
  409.   text = this.convertStateHelpText(text);
  410.   return Yanfly.IBS.Window_Base_convertEscapeCharacters.call(this, text);
  411. };

  412. Window_Base.prototype.convertStateHelpText = function(text) {
  413.   text = text.replace(/\\V\[(\d+)\]/gi, function() {
  414.     return $gameVariables.value(parseInt(arguments[1]));
  415.   }.bind(this));
  416.   text = text.replace(/\\V\[(\d+)\]/gi, function() {
  417.     return $gameVariables.value(parseInt(arguments[1]));
  418.   }.bind(this));
  419.   text = text.replace(/\\TH\[(\d+)\]/gi, function() {
  420.     return $dataStates[parseInt(arguments[1])].description;
  421.   }.bind(this));
  422.   text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  423.     return $gameVariables.value(parseInt(arguments[1]));
  424.   }.bind(this));
  425.   text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  426.     return $gameVariables.value(parseInt(arguments[1]));
  427.   }.bind(this));
  428.   text = text.replace(/\x1bTH\[(\d+)\]/gi, function() {
  429.     return $dataStates[parseInt(arguments[1])].description;
  430.   }.bind(this));
  431.   return text;
  432. };

  433. if (Imported.YEP_X_MessageMacros1) {

  434. Yanfly.IBS.Window_Base_convertMacroText =
  435.     Window_Base.prototype.convertMacroText;
  436. Window_Base.prototype.convertMacroText = function(text) {
  437.   text = Yanfly.IBS.Window_Base_convertMacroText.call(this, text);
  438.   text = this.convertStateHelpText(text);
  439.   return text;
  440. };

  441. }; // Imported.YEP_X_MessageMacros1

  442. //=============================================================================
  443. // Window_Command
  444. //=============================================================================

  445. Window_Command.prototype.addCommandAt = function(index, name, symbol, en, ext) {
  446.   if (en === undefined) enabled = true;
  447.   if (ext === undefined) ext = null;
  448.   var obj = { name: name, symbol: symbol, enabled: en, ext: ext};
  449.   this._list.splice(index, 0, obj);
  450. };

  451. //=============================================================================
  452. // Window_ActorCommand
  453. //=============================================================================

  454. Yanfly.IBS.Window_ActorCommand_makeCommandList =
  455.   Window_ActorCommand.prototype.makeCommandList;
  456. Window_ActorCommand.prototype.makeCommandList = function() {
  457.   Yanfly.IBS.Window_ActorCommand_makeCommandList.call(this);
  458.   this.makeInBattleStatusCommand();
  459. };

  460. Window_ActorCommand.prototype.makeInBattleStatusCommand = function() {
  461.   if (!$gameSystem.isShowInBattleStatus()) return;
  462.   var index = this.findSymbol('item');
  463.   var text = Yanfly.Param.IBSCmdName;
  464.   this.addCommandAt(index, text, 'inBattleStatus', true);
  465. };

  466. //=============================================================================
  467. // Window_InBattleStatus
  468. //=============================================================================

  469. function Window_InBattleStatus() {
  470.     this.initialize.apply(this, arguments);
  471. }

  472. Window_InBattleStatus.prototype = Object.create(Window_Base.prototype);
  473. Window_InBattleStatus.prototype.constructor = Window_InBattleStatus;

  474. Window_InBattleStatus.prototype.initialize = function() {
  475.   var x = eval(Yanfly.Param.IBSWinX);
  476.   var y = eval(Yanfly.Param.IBSWinY);
  477.   var w = eval(Yanfly.Param.IBSWinWidth);
  478.   var h = eval(Yanfly.Param.IBSWinHeight);
  479.   this._battler = $gameParty.battleMembers()[0];
  480.   Window_Base.prototype.initialize.call(this, x, y, w, h);
  481.   this.hide();
  482. };

  483. Window_InBattleStatus.prototype.setBattler = function(battler) {
  484.   this._battler = battler;
  485.   this.refresh();
  486. };

  487. Window_InBattleStatus.prototype.refresh = function() {
  488.   this.contents.clear();
  489.   if (!this._battler) return;
  490.   var x = this.standardPadding() + eval(Yanfly.Param.IBSStatusListWidth);
  491.   this.drawActorFace(this._battler, x, 0, Window_Base._faceWidth);
  492.   var x2 = x + Window_Base._faceWidth + this.standardPadding();
  493.   var w = this.contents.width - x2;
  494.   this.drawActorSimpleStatus(this._battler, x2, 0, w);
  495.   w = this.contents.width - x;
  496.   var y = Math.ceil(this.lineHeight() * 4.5);
  497.   var h = this.contents.height - y;
  498.   if (h >= this.lineHeight() * 6) {
  499.     for (var i = 2; i < 8; ++i) {
  500.       this.drawParam(i, x, y, w, this.lineHeight());
  501.       y += this.lineHeight();
  502.     }
  503.   } else {
  504.     w = Math.floor(w / 2);
  505.     x2 = x;
  506.     for (var i = 2; i < 8; ++i) {
  507.       this.drawParam(i, x2, y, w, this.lineHeight());
  508.       if (i % 2 === 0) {
  509.         x2 += w;
  510.       } else {
  511.         x2 = x;
  512.         y += this.lineHeight();
  513.       }
  514.     }
  515.   }
  516. };

  517. Window_InBattleStatus.prototype.drawParam = function(paramId, dx, dy, dw, dh) {
  518.   this.drawDarkRect(dx, dy, dw, dh);
  519.   var level = this._battler._buffs[paramId];
  520.   var icon = this._battler.buffIconIndex(level, paramId);
  521.   this.drawIcon(icon, dx + 2, dy + 2);
  522.   dx += Window_Base._iconWidth + 4;
  523.   dw -= Window_Base._iconWidth + 4 + this.textPadding() + 2;
  524.   this.changeTextColor(this.systemColor());
  525.   this.drawText(TextManager.param(paramId), dx, dy, dw);
  526.   var value = this._battler.param(paramId);
  527.   this.changeTextColor(this.paramchangeTextColor(level));
  528.   this.drawText(Yanfly.Util.toGroup(value), dx, dy, dw, 'right');
  529. };

  530. Window_InBattleStatus.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  531.   var color = this.gaugeBackColor();
  532.   this.changePaintOpacity(false);
  533.   this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  534.   this.changePaintOpacity(true);
  535. };

  536. //=============================================================================
  537. // Window_InBattleStateList
  538. //=============================================================================

  539. function Window_InBattleStateList() {
  540.     this.initialize.apply(this, arguments);
  541. }

  542. Window_InBattleStateList.prototype = Object.create(Window_Selectable.prototype);
  543. Window_InBattleStateList.prototype.constructor = Window_InBattleStateList;

  544. Window_InBattleStateList.prototype.initialize = function(parentWindow) {
  545.   this._parentWindow = parentWindow;
  546.   this._battler = $gameParty.battleMembers()[0];
  547.   var x = parentWindow.x;
  548.   var y = parentWindow.y;
  549.   var width = eval(Yanfly.Param.IBSStatusListWidth);
  550.   width += this.standardPadding() * 2;
  551.   width = Math.ceil(width);
  552.   var height = parentWindow.height;
  553.   Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  554.   this.deactivate();
  555.   this.backOpacity = 0;
  556.   this.opacity = 0;
  557.   this.hide();
  558.   this._data = [];
  559. };

  560. Window_InBattleStateList.prototype.setStatusWindow = function(win) {
  561.   this._statusWindow = win;
  562. };

  563. Window_InBattleStateList.prototype.setBattler = function(battler) {
  564.   this._battler = battler;
  565.   this._parentWindow.setBattler(battler);
  566.   this.refresh();
  567.   this.select(0);
  568.   if (this._statusWindow) {
  569.     var index = $gameParty.battleMembers().indexOf(battler)
  570.     this._statusWindow.select(index);
  571.   }
  572. };

  573. Window_InBattleStateList.prototype.maxItems = function() {
  574.   return this._data ? this._data.length : 1;
  575. };

  576. Window_InBattleStateList.prototype.item = function() {
  577.   var index = this.index();
  578.   return this._data && index >= 0 ? this._data[index] : null;
  579. };

  580. Window_InBattleStateList.prototype.includes = function(item) {
  581.   if (!item) return false;
  582.   if (item.name.length <= 0) return false;
  583.   if (item.iconIndex <= 0) return false;
  584.   return true;
  585. };

  586. Window_InBattleStateList.prototype.makeItemList = function() {
  587.   this._data = [];
  588.   if (this._battler) {
  589.     var states = this._battler.states();
  590.     var length = states.length;
  591.     for (var i = 0; i < length; ++i) {
  592.       var state = states[i];
  593.       if (this.includes(state)) this._data.push(state);
  594.     }
  595.     for (var i = 0; i < 8; ++i) {
  596.       if (this._battler.isBuffAffected(i) ||
  597.       this._battler.isDebuffAffected(i)) {
  598.         this._data.push('buff ' + i);
  599.       }
  600.     }
  601.   }
  602.   if (this._data.length <= 0) this._data.push(null);
  603. };

  604. Window_InBattleStateList.prototype.drawItem = function(index) {
  605.   var item = this._data[index];
  606.   var rect = this.itemRect(index);
  607.   rect.width -= this.textPadding();
  608.   if (item === null) {
  609.     var icon = Yanfly.Param.IBSHealthyIcon;
  610.     var text = Yanfly.Param.IBSHealthyText;
  611.     var ibw = Window_Base._iconWidth + 4;
  612.     this.resetTextColor();
  613.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  614.     this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
  615.   } else if (typeof item === 'string' && item.match(/BUFF[ ](\d+)/i)) {
  616.     var paramId = parseInt(RegExp.$1);
  617.     var level = this._battler._buffs[paramId];
  618.     var icon = this._battler.buffIconIndex(level, paramId);
  619.     var ibw = Window_Base._iconWidth + 4;
  620.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  621.     if (level > 0) {
  622.       var text = Yanfly.Param.IBSBuffText[paramId];
  623.     } else {
  624.       var text = Yanfly.Param.IBSDebuffText[paramId];
  625.     }
  626.     this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
  627.     if (!Imported.YEP_BuffsStatesCore) return;
  628.     this.drawBuffTurns(this._battler, paramId, rect.x + 2, rect.y);
  629.     if (Yanfly.Param.BSCShowBuffRate) {
  630.       this.drawBuffRate(this._battler, paramId, rect.x + 2, rect.y);
  631.     }
  632.   } else if (item) {
  633.     this.drawItemName(item, rect.x, rect.y, rect.width);
  634.     if (!Imported.YEP_BuffsStatesCore) return;
  635.     if (item.autoRemovalTiming > 0) {
  636.       this.drawStateTurns(this._battler, item, rect.x + 2, rect.y);
  637.     }
  638.     this.drawStateCounter(this._battler, item, rect.x + 2, rect.y);
  639.   }
  640. };

  641. Window_InBattleStateList.prototype.updateHelp = function() {
  642.   if (this.item() === null) {
  643.     var text = Yanfly.Param.IBSHealthyHelp;
  644.     this._helpWindow.setText(text);
  645.   } else if (typeof this.item() === 'string' &&
  646.   this.item().match(/BUFF[ ](\d+)/i)) {
  647.     var paramId = parseInt(RegExp.$1);
  648.     var level = this._battler._buffs[paramId];
  649.     if (level > 0) {
  650.       var fmt = Yanfly.Param.IBSBuffHelp[paramId];
  651.     } else {
  652.       var fmt = Yanfly.Param.IBSDebuffHelp[paramId];
  653.     }
  654.     var rate = Math.floor(this._battler.paramBuffRate(paramId) * 100);
  655.     var turns = this._battler._buffTurns[paramId];
  656.     var text = fmt.format(rate, Math.abs(level), turns);
  657.     this._helpWindow.setText(text);
  658.   } else if (this.item()) {
  659.     this.setHelpWindowItem(this.item());
  660.   }
  661. };

  662. Window_InBattleStateList.prototype.refresh = function() {
  663.   this.makeItemList();
  664.   this.createContents();
  665.   this.drawAllItems();
  666. };

  667. Window_InBattleStateList.prototype.update = function() {
  668.   Window_Selectable.prototype.update.call(this);
  669.   if (this.active && this._battler) this.updateLeftRight();
  670. };

  671. Window_InBattleStateList.prototype.updateLeftRight = function() {
  672.   var index = $gameParty.battleMembers().indexOf(this._battler);
  673.   var current = index;
  674.   if (Input.isRepeated('left')) {
  675.     index -= 1;
  676.   } else if (Input.isRepeated('right')) {
  677.     index += 1;
  678.   }
  679.   index = index.clamp(0, $gameParty.battleMembers().length - 1);
  680.   if (current !== index) {
  681.     var battler = $gameParty.battleMembers()[index];
  682.     this.setBattler(battler);
  683.     SoundManager.playCursor();
  684.   }
  685. };

  686. //=============================================================================
  687. // Window_CTBIcon
  688. //=============================================================================

  689. if (Imported.YEP_X_BattleSysCTB) {

  690. Yanfly.IBS.Window_CTBIcon_isReduceOpacity =
  691.   Window_CTBIcon.prototype.isReduceOpacity;
  692. Window_CTBIcon.prototype.isReduceOpacity = function() {
  693.   if (SceneManager._scene._inBattleStatusWindow) {
  694.     if (SceneManager._scene._inBattleStatusWindow.visible) return true;
  695.   }
  696.   return Yanfly.IBS.Window_CTBIcon_isReduceOpacity.call(this);
  697. };

  698. }; // Imported.YEP_X_BattleSysCTB

  699. //=============================================================================
  700. // Window_BattleStatus
  701. //=============================================================================

  702. Window_BattleStatus.prototype.setInBattleStatusWindow = function(win) {
  703.   this._inBattleStatusWindow = win;
  704. };

  705. Yanfly.IBS.Window_BattleStatus_update = Window_BattleStatus.prototype.update;
  706. Window_BattleStatus.prototype.update = function() {
  707.   Yanfly.IBS.Window_BattleStatus_update.call(this);
  708.   this.processInBattleStatusTouch();
  709. };

  710. Window_BattleStatus.prototype.processInBattleStatusTouch = function() {
  711.   if (!this._inBattleStatusWindow) return;
  712.   if (!this._inBattleStatusWindow.active) return;
  713.   if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  714.     this.onInBattleStatusTouch();
  715.   }
  716. };

  717. Window_BattleStatus.prototype.onInBattleStatusTouch = function() {
  718.   var lastIndex = this.index();
  719.   var x = this.canvasToLocalX(TouchInput.x);
  720.   var y = this.canvasToLocalY(TouchInput.y);
  721.   var hitIndex = this.hitTest(x, y);
  722.   if (hitIndex >= 0) {
  723.     var actor = $gameParty.battleMembers()[hitIndex];
  724.     var win = this._inBattleStatusWindow;
  725.     if (win && actor) {
  726.       win.setBattler(actor);
  727.       SoundManager.playCursor();
  728.     }
  729.   }
  730. };

  731. //=============================================================================
  732. // Scene_Battle
  733. //=============================================================================

  734. Yanfly.IBS.Scene_Battle_createAllWindows =
  735.   Scene_Battle.prototype.createAllWindows;
  736. Scene_Battle.prototype.createAllWindows = function() {
  737.   Yanfly.IBS.Scene_Battle_createAllWindows.call(this);
  738.   this.createInBattleStatusWindows();
  739. };

  740. Scene_Battle.prototype.createInBattleStatusWindows = function() {
  741.   this._inBattleStatusWindow = new Window_InBattleStatus();
  742.   this.addChild(this._inBattleStatusWindow);
  743.   var win = this._inBattleStatusWindow;
  744.   this._inBattleStateList = new Window_InBattleStateList(win);
  745.   this._inBattleStateList.setHelpWindow(this._helpWindow);
  746.   this._inBattleStateList.setStatusWindow(this._statusWindow);
  747.   this.addChild(this._inBattleStateList);
  748.   this._inBattleStateList.setHandler('cancel', this.onInBattleStatusCancel.bind(this));
  749.   this._statusWindow.setInBattleStatusWindow(this._inBattleStateList);
  750. };

  751. Yanfly.IBS.Scene_Battle_createActorCommandWindow =
  752.   Scene_Battle.prototype.createActorCommandWindow;
  753. Scene_Battle.prototype.createActorCommandWindow = function() {
  754.   Yanfly.IBS.Scene_Battle_createActorCommandWindow.call(this);
  755.   var win = this._actorCommandWindow;
  756.   win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
  757. };

  758. Scene_Battle.prototype.commandInBattleStatus = function() {
  759.   this._helpWindow.show();
  760.   this._inBattleStatusWindow.show();
  761.   this._inBattleStateList.show();
  762.   this._inBattleStateList.activate();
  763.   this._inBattleStateList.setBattler($gameParty.battleMembers()[0]);
  764.   if (Imported.YEP_X_PartyLimitGauge) {
  765.     this._showPartyLimitGauge = $gameSystem.isShowPartyLimitGauge();
  766.     this._showTroopLimitGauge = $gameSystem.isShowTroopLimitGauge();
  767.     $gameSystem.setShowPartyLimitGauge(false);
  768.     $gameSystem.setShowTroopLimitGauge(false);
  769.   }
  770. };

  771. Scene_Battle.prototype.onInBattleStatusCancel = function() {
  772.   this._helpWindow.hide();
  773.   this._inBattleStatusWindow.hide();
  774.   this._inBattleStateList.hide();
  775.   this._inBattleStateList.deactivate();
  776.   this._actorCommandWindow.activate();
  777.   this._statusWindow.deselect();
  778.   if (Imported.YEP_X_PartyLimitGauge) {
  779.     $gameSystem.setShowPartyLimitGauge(this._showPartyLimitGauge);
  780.     $gameSystem.setShowTroopLimitGauge(this._showTroopLimitGauge);
  781.   }
  782. };

  783. Yanfly.IBS.Scene_Battle_isAnyInputWindowActive =
  784.   Scene_Battle.prototype.isAnyInputWindowActive;
  785. Scene_Battle.prototype.isAnyInputWindowActive = function() {
  786.   if (this._inBattleStateList && this._inBattleStateList.active) return true;
  787.   return Yanfly.IBS.Scene_Battle_isAnyInputWindowActive.call(this);
  788. };

  789. if (Imported.YEP_X_BattleSysCTB) {

  790. Yanfly.IBS.Scene_Battle_updateWindowPositionsCTB =
  791.   Scene_Battle.prototype.updateWindowPositionsCTB;
  792. Scene_Battle.prototype.updateWindowPositionsCTB = function() {
  793.   if (this._inBattleStatusWindow && this._inBattleStatusWindow.visible) {
  794.     return;
  795.   }
  796.   Yanfly.IBS.Scene_Battle_updateWindowPositionsCTB.call(this);
  797. };

  798. }; // Imported.YEP_X_BattleSysCTB

  799. //=============================================================================
  800. // Utilities
  801. //=============================================================================

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

  803. if (!Yanfly.Util.toGroup) {

  804. Yanfly.Util.toGroup = function(inVal) {
  805.   return inVal;
  806. }

  807. };

  808. //=============================================================================
  809. // End of File
  810. //=============================================================================
  811. };
复制代码
回复

使用道具 举报

梦石
0
星屑
5840
在线时间
109 小时
注册时间
2009-2-15
回帖
27
 楼主| 发表于 2018-5-21 11:38:10 | 显示全部楼层
jgf1000 发表于 2018-5-17 01:42
稍微改了一下不是很仔细,不保证一定能用,也不保证兼容性,但在我自己这是通过的。默认放在物品前,可自行 ...

Thanks♪(・ω・)ノ,我对API和JS不是很熟悉
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部