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

Project1

 找回密码
 注册会员
搜索
查看: 1871|回复: 3

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

[复制链接]

Lv4.逐梦者

梦石
0
星屑
5190
在线时间
109 小时
注册时间
2009-2-15
帖子
34
发表于 2018-5-16 14:41:37 | 显示全部楼层 |阅读模式

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

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

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

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

先感谢大大们

Lv4.逐梦者

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

使用道具 举报

Lv2.观梦者

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

稍微改了一下不是很仔细,不保证一定能用,也不保证兼容性,但在我自己这是通过的。默认放在物品前,可自行修改。
QAQ因为我也只是个新手= =
改动基本上在486-500和823-857,就是将Party部分改成了Actor
JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // Yanfly Engine Plugins - In-Battle Status
  3. // YEP_X_InBattleStatus.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.YEP_X_InBattleStatus = true;
  8.  
  9. var Yanfly = Yanfly || {};
  10. Yanfly.IBS = Yanfly.IBS || {};
  11.  
  12. //=============================================================================
  13. /*:
  14.  * @plugindesc v1.00 战斗状态查看
  15.  * @author Yanfly Engine Plugins
  16.  *
  17.  * @param ---General---
  18.  * @default
  19.  *
  20.  * @param Command Text
  21.  * @desc The text used for 'Status' command text in the Party Window.
  22.  * @default Status
  23.  *
  24.  * @param Show Command
  25.  * @desc Show the in battle 'Status' command by default?
  26.  * NO - false     YES - true
  27.  * @default true
  28.  *
  29.  * @param Window X
  30.  * @desc The default X location used for the in-battle status window.
  31.  * You can use formulas.
  32.  * @default 0
  33.  *
  34.  * @param Window Y
  35.  * @desc The default Y location used for the in-battle status window.
  36.  * You can use formulas.
  37.  * @default this.fittingHeight(2)
  38.  *
  39.  * @param Window Width
  40.  * @desc The default width used for the in-battle status window.
  41.  * You can use formulas.
  42.  * @default Graphics.boxWidth
  43.  *
  44.  * @param Window Height
  45.  * @desc The default height used for the in-battle status window.
  46.  * You can use formulas.
  47.  * @default Graphics.boxHeight - this.fittingHeight(2) - this.fittingHeight(4)
  48.  *
  49.  * @param ---Status List---
  50.  * @default
  51.  *
  52.  * @param Status Width
  53.  * @desc The width of the status list.
  54.  * You can use formulas.
  55.  * @default Math.max(312, Graphics.boxWidth / 4);
  56.  *
  57.  * @param State Help Front
  58.  * @desc Text placed in front of each state's help description.
  59.  * %1 - State Icon     %2 - State Name
  60.  * @default \i[%1]%2
  61.  *
  62.  * @param State Help End
  63.  * @desc Text placed in end of each state's help description.
  64.  * %1 - State Icon     %2 - State Name
  65.  * @default
  66.  *
  67.  * @param Healthy Icon
  68.  * @desc Icon ID used to indicate the battler is healthy (no states).
  69.  * @default 127
  70.  *
  71.  * @param Healthy Text
  72.  * @desc Text used to label the healthy status.
  73.  * @default Healthy
  74.  *
  75.  * @param Healthy Help
  76.  * @desc Text displayed in help window when selected.
  77.  * @default User is currently unaffected by status effects.
  78.  *
  79.  * @param ---Buffs List---
  80.  * @default
  81.  *
  82.  * @param MaxHP Buff Text
  83.  * @desc The text used to display the MaxHP Buff Name.
  84.  * @default MaxHP Up
  85.  *
  86.  * @param MaxHP Buff Help
  87.  * @desc The text used for the MaxHP help description.
  88.  * %1 - Rate     %2 - Stacks     %3 - Turns
  89.  * @default Raises Maximum Health to %1%.
  90.  *
  91.  * @param MaxMP Buff Text
  92.  * @desc The text used to display the MaxMP Buff Name.
  93.  * @default MaxMP Up
  94.  *
  95.  * @param MaxMP Buff Help
  96.  * @desc The text used for the MaxMP help description.
  97.  * %1 - Rate     %2 - Stacks     %3 - Turns
  98.  * @default Raises Maximum Mana to %1%.
  99.  *
  100.  * @param ATK Buff Text
  101.  * @desc The text used to display the ATK Buff Name.
  102.  * @default ATK Up
  103.  *
  104.  * @param ATK Buff Help
  105.  * @desc The text used for the ATK help description.
  106.  * %1 - Rate     %2 - Stacks     %3 - Turns
  107.  * @default Raises Attack to %1%.
  108.  *
  109.  * @param DEF Buff Text
  110.  * @desc The text used to display the DEF Buff Name.
  111.  * @default DEF Up
  112.  *
  113.  * @param DEF Buff Help
  114.  * @desc The text used for the DEF help description.
  115.  * %1 - Rate     %2 - Stacks     %3 - Turns
  116.  * @default Raises Defense to %1%.
  117.  *
  118.  * @param MAT Buff Text
  119.  * @desc The text used to display the MAT Buff Name.
  120.  * @default MAT Up
  121.  *
  122.  * @param MAT Buff Help
  123.  * @desc The text used for the MAT help description.
  124.  * %1 - Rate     %2 - Stacks     %3 - Turns
  125.  * @default Raises Magic Attack to %1%.
  126.  *
  127.  * @param MDF Buff Text
  128.  * @desc The text used to display the MDF Buff Name.
  129.  * @default MDF Up
  130.  *
  131.  * @param MDF Buff Help
  132.  * @desc The text used for the MDF help description.
  133.  * %1 - Rate     %2 - Stacks     %3 - Turns
  134.  * @default Raises Magic Defense to %1%.
  135.  *
  136.  * @param AGI Buff Text
  137.  * @desc The text used to display the AGI Buff Name.
  138.  * @default AGI Up
  139.  *
  140.  * @param AGI Buff Help
  141.  * @desc The text used for the AGI help description.
  142.  * %1 - Rate     %2 - Stacks     %3 - Turns
  143.  * @default Raises Agility to %1%.
  144.  *
  145.  * @param LUK Buff Text
  146.  * @desc The text used to display the LUK Buff Name.
  147.  * @default LUK Up
  148.  *
  149.  * @param LUK Buff Help
  150.  * @desc The text used for the LUK help description.
  151.  * %1 - Rate     %2 - Stacks     %3 - Turns
  152.  * @default Raises Luck to %1%.
  153.  *
  154.  * @param ---Debuffs List---
  155.  * @default
  156.  *
  157.  * @param MaxHP Debuff Text
  158.  * @desc The text used to display the MaxHP Debuff Name.
  159.  * @default MaxHP Down
  160.  *
  161.  * @param MaxHP Debuff Help
  162.  * @desc The text used for the MaxHP help description.
  163.  * %1 - Rate     %2 - Stacks     %3 - Turns
  164.  * @default Lowers Maximum Health to %1%.
  165.  *
  166.  * @param MaxMP Debuff Text
  167.  * @desc The text used to display the MaxMP Debuff Name.
  168.  * @default MaxMP Down
  169.  *
  170.  * @param MaxMP Debuff Help
  171.  * @desc The text used for the MaxMP help description.
  172.  * %1 - Rate     %2 - Stacks     %3 - Turns
  173.  * @default Lowers Maximum Mana to %1%.
  174.  *
  175.  * @param ATK Debuff Text
  176.  * @desc The text used to display the ATK Debuff Name.
  177.  * @default ATK Down
  178.  *
  179.  * @param ATK Debuff Help
  180.  * @desc The text used for the ATK help description.
  181.  * %1 - Rate     %2 - Stacks     %3 - Turns
  182.  * @default Lowers Attack to %1%.
  183.  *
  184.  * @param DEF Debuff Text
  185.  * @desc The text used to display the DEF Debuff Name.
  186.  * @default DEF Down
  187.  *
  188.  * @param DEF Debuff Help
  189.  * @desc The text used for the DEF help description.
  190.  * %1 - Rate     %2 - Stacks     %3 - Turns
  191.  * @default Lowers Defense to %1%.
  192.  *
  193.  * @param MAT Debuff Text
  194.  * @desc The text used to display the MAT Debuff Name.
  195.  * @default MAT Down
  196.  *
  197.  * @param MAT Debuff Help
  198.  * @desc The text used for the MAT help description.
  199.  * %1 - Rate     %2 - Stacks     %3 - Turns
  200.  * @default Lowers Magic Attack to %1%.
  201.  *
  202.  * @param MDF Debuff Text
  203.  * @desc The text used to display the MDF Debuff Name.
  204.  * @default MDF Down
  205.  *
  206.  * @param MDF Debuff Help
  207.  * @desc The text used for the MDF help description.
  208.  * %1 - Rate     %2 - Stacks     %3 - Turns
  209.  * @default Lowers Magic Defense to %1%.
  210.  *
  211.  * @param AGI Debuff Text
  212.  * @desc The text used to display the AGI Debuff Name.
  213.  * @default AGI Down
  214.  *
  215.  * @param AGI Debuff Help
  216.  * @desc The text used for the AGI help description.
  217.  * %1 - Rate     %2 - Stacks     %3 - Turns
  218.  * @default Lowers Agility to %1%.
  219.  *
  220.  * @param LUK Debuff Text
  221.  * @desc The text used to display the LUK Debuff Name.
  222.  * @default LUK Down
  223.  *
  224.  * @param LUK Debuff Help
  225.  * @desc The text used for the LUK help description.
  226.  * %1 - Rate     %2 - Stacks     %3 - Turns
  227.  * @default Lowers Luck to %1%.
  228.  *
  229.  * @help
  230.  * ============================================================================
  231.  * Introduction
  232.  * ============================================================================
  233.  *
  234.  * 这个插件需要YEP_BattleEngineCore。确保这个插件放在YEP_BattleEngineCore下面
  235.  *
  236.  * 在战斗中,我们没有办法查看队伍当前状态,这个插件将会在队伍命令中添加
  237.  * “状态”命令,允许玩家去查看角色状态。在这里,我们可以看到队员的初始
  238.  * 参数和状态列表。这个玩家将可以
  239.  *
  240.  * 注意:如果你使用了YEP_X_BattleSysCTB,请把这个插件放在下面以提高兼容性
  241.  
  242.  *
  243.  * ============================================================================
  244.  * Notetags
  245.  * ============================================================================
  246.  *
  247.  * 想要添加帮助文字的可以用下面的备注
  248.  *
  249.  * State Notetags:
  250.  *
  251.  *   <Help Description>
  252.  *    text
  253.  *    text
  254.  *   </Help Description>
  255.  *   这可以添加帮助文字
  256.  *
  257.  * ============================================================================
  258.  * Text Codes
  259.  * ============================================================================
  260.  *
  261.  * 可以使用文本代码:
  262.  *
  263.  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  264.  *
  265.  * State Help     Function
  266.  *   \th[x]       - 替换为状态帮助文字
  267.  *
  268.  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  269.  *
  270.  * ============================================================================
  271.  * Plugin Commands
  272.  * ============================================================================
  273.  *
  274.  * 想要改变状态菜单命令的,可以用下面插件来设置:
  275.  *
  276.  * Plugin Commands:
  277.  *
  278.  *   ShowInBattleStatus
  279.  *   - 开启战斗状态命令
  280.  *
  281.  *   HideInBattleStatus
  282.  *   - 关闭战斗状态命令
  283.  */
  284. //=============================================================================
  285.  
  286. if (Imported.YEP_BattleEngineCore) {
  287.  
  288. //=============================================================================
  289. // Parameter Variables
  290. //=============================================================================
  291.  
  292. Yanfly.Parameters = PluginManager.parameters('YEP_X_InBattleStatus');
  293. Yanfly.Param = Yanfly.Param || {};
  294.  
  295. Yanfly.Param.IBSCmdName = String(Yanfly.Parameters['Command Text']);
  296. Yanfly.Param.IBSCmdShow = eval(String(Yanfly.Parameters['Show Command']));
  297. Yanfly.Param.IBSWinX = String(Yanfly.Parameters['Window X']);
  298. Yanfly.Param.IBSWinY = String(Yanfly.Parameters['Window Y']);
  299. Yanfly.Param.IBSWinWidth = String(Yanfly.Parameters['Window Width']);
  300. Yanfly.Param.IBSWinHeight = String(Yanfly.Parameters['Window Height']);
  301.  
  302. Yanfly.Param.IBSStatusListWidth = String(Yanfly.Parameters['Status Width']);
  303. Yanfly.Param.IBSStateHelp1 = String(Yanfly.Parameters['State Help Front']);
  304. Yanfly.Param.IBSStateHelp2 = String(Yanfly.Parameters['State Help End']);
  305. Yanfly.Param.IBSHealthyIcon = Number(Yanfly.Parameters['Healthy Icon']);
  306. Yanfly.Param.IBSHealthyText = String(Yanfly.Parameters['Healthy Text']);
  307. Yanfly.Param.IBSHealthyHelp = String(Yanfly.Parameters['Healthy Help']);
  308.  
  309. Yanfly.Param.IBSBuffText = [];
  310. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MaxHP Buff Text']));
  311. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MaxMP Buff Text']));
  312. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['ATK Buff Text']));
  313. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['DEF Buff Text']));
  314. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MAT Buff Text']));
  315. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['MDF Buff Text']));
  316. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['AGI Buff Text']));
  317. Yanfly.Param.IBSBuffText.push(String(Yanfly.Parameters['LUK Buff Text']));
  318. Yanfly.Param.IBSBuffHelp = [];
  319. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MaxHP Buff Help']));
  320. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MaxMP Buff Help']));
  321. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['ATK Buff Help']));
  322. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['DEF Buff Help']));
  323. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MAT Buff Help']));
  324. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['MDF Buff Help']));
  325. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['AGI Buff Help']));
  326. Yanfly.Param.IBSBuffHelp.push(String(Yanfly.Parameters['LUK Buff Help']));
  327.  
  328. Yanfly.Param.IBSDebuffText = [];
  329. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MaxHP Debuff Text']));
  330. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MaxMP Debuff Text']));
  331. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['ATK Debuff Text']));
  332. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['DEF Debuff Text']));
  333. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MAT Debuff Text']));
  334. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['MDF Debuff Text']));
  335. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['AGI Debuff Text']));
  336. Yanfly.Param.IBSDebuffText.push(String(Yanfly.Parameters['LUK Debuff Text']));
  337. Yanfly.Param.IBSDebuffHelp = [];
  338. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MaxHP Debuff Help']));
  339. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MaxMP Debuff Help']));
  340. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['ATK Debuff Help']));
  341. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['DEF Debuff Help']));
  342. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MAT Debuff Help']));
  343. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['MDF Debuff Help']));
  344. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['AGI Debuff Help']));
  345. Yanfly.Param.IBSDebuffHelp.push(String(Yanfly.Parameters['LUK Debuff Help']));
  346.  
  347. //=============================================================================
  348. // DataManager
  349. //=============================================================================
  350.  
  351. Yanfly.IBS.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  352. DataManager.isDatabaseLoaded = function() {
  353.   if (!Yanfly.IBS.DataManager_isDatabaseLoaded.call(this)) return false;
  354.  
  355.   if (!Yanfly._loaded_YEP_X_InBattleStatus) {
  356.     this.processIBSNotetags1($dataStates);
  357.     Yanfly._loaded_YEP_X_InBattleStatus = true;
  358.   }
  359.  
  360.   return true;
  361. };
  362.  
  363. DataManager.processIBSNotetags1 = function(group) {
  364.   for (var n = 1; n < group.length; n++) {
  365.     var obj = group[n];
  366.     var notedata = obj.note.split(/[\r\n]+/);
  367.  
  368.     var fmt1 = Yanfly.Param.IBSStateHelp1;
  369.     obj.description = fmt1.format(obj.iconIndex, obj.name);
  370.     var descLength = obj.description.length;
  371.     var evalMode = 'none';
  372.  
  373.     for (var i = 0; i < notedata.length; i++) {
  374.       var line = notedata[i];
  375.       if (line.match(/<(?:HELP|DESCRIPTION|HELP DESCRIPTION)>/i)) {
  376.         evalMode = 'help description';
  377.       } else if (line.match(/<\/(?:HELP|DESCRIPTION|HELP DESCRIPTION)>/i)) {
  378.         evalMode = 'none';
  379.       } else if (evalMode === 'help description') {
  380.         if (obj.description.length > descLength) obj.description += '\n';
  381.         obj.description += line;
  382.       }
  383.     }
  384.  
  385.     var fmt2 = Yanfly.Param.IBSStateHelp2;
  386.     obj.description += fmt2.format(obj.iconIndex, obj.name);
  387.   }
  388. };
  389.  
  390. //=============================================================================
  391. // Game_System
  392. //=============================================================================
  393.  
  394. Yanfly.IBS.Game_System_initialize = Game_System.prototype.initialize;
  395. Game_System.prototype.initialize = function() {
  396.   Yanfly.IBS.Game_System_initialize.call(this);
  397.   this.initIBSSettings();
  398. };
  399.  
  400. Game_System.prototype.initIBSSettings = function() {
  401.   this._showInBattleStatus = Yanfly.Param.IBSCmdShow;
  402. };
  403.  
  404. Game_System.prototype.isShowInBattleStatus = function() {
  405.   if (this._showInBattleStatus === undefined) this.initIBSSettings();
  406.   return this._showInBattleStatus;
  407. };
  408.  
  409. Game_System.prototype.setShowInBattleStatus = function(value) {
  410.   if (this._showInBattleStatus === undefined) this.initIBSSettings();
  411.   this._showInBattleStatus = value;
  412. };
  413.  
  414. //=============================================================================
  415. // Game_Interpreter
  416. //=============================================================================
  417.  
  418. Yanfly.IBS.Game_Interpreter_pluginCommand =
  419.     Game_Interpreter.prototype.pluginCommand;
  420. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  421.   Yanfly.IBS.Game_Interpreter_pluginCommand.call(this, command, args);
  422.   if (command === 'ShowInBattleStatus') {
  423.     $gameSystem.setShowInBattleStatus(true);
  424.   } else if (command === 'HideInBattleStatus') {
  425.     $gameSystem.setShowInBattleStatus(false);
  426.   }
  427. };
  428.  
  429. //=============================================================================
  430. // Window_Base
  431. //=============================================================================
  432.  
  433. Yanfly.IBS.Window_Base_convertEscapeCharacters =
  434.   Window_Base.prototype.convertEscapeCharacters;
  435. Window_Base.prototype.convertEscapeCharacters = function(text) {
  436.   text = this.convertStateHelpText(text);
  437.   return Yanfly.IBS.Window_Base_convertEscapeCharacters.call(this, text);
  438. };
  439.  
  440. Window_Base.prototype.convertStateHelpText = function(text) {
  441.   text = text.replace(/\\V\[(\d+)\]/gi, function() {
  442.     return $gameVariables.value(parseInt(arguments[1]));
  443.   }.bind(this));
  444.   text = text.replace(/\\V\[(\d+)\]/gi, function() {
  445.     return $gameVariables.value(parseInt(arguments[1]));
  446.   }.bind(this));
  447.   text = text.replace(/\\TH\[(\d+)\]/gi, function() {
  448.     return $dataStates[parseInt(arguments[1])].description;
  449.   }.bind(this));
  450.   text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  451.     return $gameVariables.value(parseInt(arguments[1]));
  452.   }.bind(this));
  453.   text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  454.     return $gameVariables.value(parseInt(arguments[1]));
  455.   }.bind(this));
  456.   text = text.replace(/\x1bTH\[(\d+)\]/gi, function() {
  457.     return $dataStates[parseInt(arguments[1])].description;
  458.   }.bind(this));
  459.   return text;
  460. };
  461.  
  462. if (Imported.YEP_X_MessageMacros1) {
  463.  
  464. Yanfly.IBS.Window_Base_convertMacroText =
  465.     Window_Base.prototype.convertMacroText;
  466. Window_Base.prototype.convertMacroText = function(text) {
  467.   text = Yanfly.IBS.Window_Base_convertMacroText.call(this, text);
  468.   text = this.convertStateHelpText(text);
  469.   return text;
  470. };
  471.  
  472. }; // Imported.YEP_X_MessageMacros1
  473.  
  474. //=============================================================================
  475. // Window_Command
  476. //=============================================================================
  477.  
  478. Window_Command.prototype.addCommandAt = function(index, name, symbol, en, ext) {
  479.   if (en === undefined) enabled = true;
  480.   if (ext === undefined) ext = null;
  481.   var obj = { name: name, symbol: symbol, enabled: en, ext: ext};
  482.   this._list.splice(index, 0, obj);
  483. };
  484.  
  485. //=============================================================================
  486. // Window_ActorCommand
  487. //=============================================================================
  488.  
  489. Yanfly.IBS.Window_ActorCommand_makeCommandList =
  490.   Window_ActorCommand.prototype.makeCommandList;
  491. Window_ActorCommand.prototype.makeCommandList = function() {
  492.   Yanfly.IBS.Window_ActorCommand_makeCommandList.call(this);
  493.   this.makeInBattleStatusCommand();
  494. };
  495.  
  496. Window_ActorCommand.prototype.makeInBattleStatusCommand = function() {
  497.   if (!$gameSystem.isShowInBattleStatus()) return;
  498.   var index = this.findSymbol('item');
  499.   var text = Yanfly.Param.IBSCmdName;
  500.   this.addCommandAt(index, text, 'inBattleStatus', true);
  501. };
  502.  
  503. //=============================================================================
  504. // Window_InBattleStatus
  505. //=============================================================================
  506.  
  507. function Window_InBattleStatus() {
  508.     this.initialize.apply(this, arguments);
  509. }
  510.  
  511. Window_InBattleStatus.prototype = Object.create(Window_Base.prototype);
  512. Window_InBattleStatus.prototype.constructor = Window_InBattleStatus;
  513.  
  514. Window_InBattleStatus.prototype.initialize = function() {
  515.   var x = eval(Yanfly.Param.IBSWinX);
  516.   var y = eval(Yanfly.Param.IBSWinY);
  517.   var w = eval(Yanfly.Param.IBSWinWidth);
  518.   var h = eval(Yanfly.Param.IBSWinHeight);
  519.   this._battler = $gameParty.battleMembers()[0];
  520.   Window_Base.prototype.initialize.call(this, x, y, w, h);
  521.   this.hide();
  522. };
  523.  
  524. Window_InBattleStatus.prototype.setBattler = function(battler) {
  525.   this._battler = battler;
  526.   this.refresh();
  527. };
  528.  
  529. Window_InBattleStatus.prototype.refresh = function() {
  530.   this.contents.clear();
  531.   if (!this._battler) return;
  532.   var x = this.standardPadding() + eval(Yanfly.Param.IBSStatusListWidth);
  533.   this.drawActorFace(this._battler, x, 0, Window_Base._faceWidth);
  534.   var x2 = x + Window_Base._faceWidth + this.standardPadding();
  535.   var w = this.contents.width - x2;
  536.   this.drawActorSimpleStatus(this._battler, x2, 0, w);
  537.   w = this.contents.width - x;
  538.   var y = Math.ceil(this.lineHeight() * 4.5);
  539.   var h = this.contents.height - y;
  540.   if (h >= this.lineHeight() * 6) {
  541.     for (var i = 2; i < 8; ++i) {
  542.       this.drawParam(i, x, y, w, this.lineHeight());
  543.       y += this.lineHeight();
  544.     }
  545.   } else {
  546.     w = Math.floor(w / 2);
  547.     x2 = x;
  548.     for (var i = 2; i < 8; ++i) {
  549.       this.drawParam(i, x2, y, w, this.lineHeight());
  550.       if (i % 2 === 0) {
  551.         x2 += w;
  552.       } else {
  553.         x2 = x;
  554.         y += this.lineHeight();
  555.       }
  556.     }
  557.   }
  558. };
  559.  
  560. Window_InBattleStatus.prototype.drawParam = function(paramId, dx, dy, dw, dh) {
  561.   this.drawDarkRect(dx, dy, dw, dh);
  562.   var level = this._battler._buffs[paramId];
  563.   var icon = this._battler.buffIconIndex(level, paramId);
  564.   this.drawIcon(icon, dx + 2, dy + 2);
  565.   dx += Window_Base._iconWidth + 4;
  566.   dw -= Window_Base._iconWidth + 4 + this.textPadding() + 2;
  567.   this.changeTextColor(this.systemColor());
  568.   this.drawText(TextManager.param(paramId), dx, dy, dw);
  569.   var value = this._battler.param(paramId);
  570.   this.changeTextColor(this.paramchangeTextColor(level));
  571.   this.drawText(Yanfly.Util.toGroup(value), dx, dy, dw, 'right');
  572. };
  573.  
  574. Window_InBattleStatus.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  575.   var color = this.gaugeBackColor();
  576.   this.changePaintOpacity(false);
  577.   this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  578.   this.changePaintOpacity(true);
  579. };
  580.  
  581. //=============================================================================
  582. // Window_InBattleStateList
  583. //=============================================================================
  584.  
  585. function Window_InBattleStateList() {
  586.     this.initialize.apply(this, arguments);
  587. }
  588.  
  589. Window_InBattleStateList.prototype = Object.create(Window_Selectable.prototype);
  590. Window_InBattleStateList.prototype.constructor = Window_InBattleStateList;
  591.  
  592. Window_InBattleStateList.prototype.initialize = function(parentWindow) {
  593.   this._parentWindow = parentWindow;
  594.   this._battler = $gameParty.battleMembers()[0];
  595.   var x = parentWindow.x;
  596.   var y = parentWindow.y;
  597.   var width = eval(Yanfly.Param.IBSStatusListWidth);
  598.   width += this.standardPadding() * 2;
  599.   width = Math.ceil(width);
  600.   var height = parentWindow.height;
  601.   Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  602.   this.deactivate();
  603.   this.backOpacity = 0;
  604.   this.opacity = 0;
  605.   this.hide();
  606.   this._data = [];
  607. };
  608.  
  609. Window_InBattleStateList.prototype.setStatusWindow = function(win) {
  610.   this._statusWindow = win;
  611. };
  612.  
  613. Window_InBattleStateList.prototype.setBattler = function(battler) {
  614.   this._battler = battler;
  615.   this._parentWindow.setBattler(battler);
  616.   this.refresh();
  617.   this.select(0);
  618.   if (this._statusWindow) {
  619.     var index = $gameParty.battleMembers().indexOf(battler)
  620.     this._statusWindow.select(index);
  621.   }
  622. };
  623.  
  624. Window_InBattleStateList.prototype.maxItems = function() {
  625.   return this._data ? this._data.length : 1;
  626. };
  627.  
  628. Window_InBattleStateList.prototype.item = function() {
  629.   var index = this.index();
  630.   return this._data && index >= 0 ? this._data[index] : null;
  631. };
  632.  
  633. Window_InBattleStateList.prototype.includes = function(item) {
  634.   if (!item) return false;
  635.   if (item.name.length <= 0) return false;
  636.   if (item.iconIndex <= 0) return false;
  637.   return true;
  638. };
  639.  
  640. Window_InBattleStateList.prototype.makeItemList = function() {
  641.   this._data = [];
  642.   if (this._battler) {
  643.     var states = this._battler.states();
  644.     var length = states.length;
  645.     for (var i = 0; i < length; ++i) {
  646.       var state = states[i];
  647.       if (this.includes(state)) this._data.push(state);
  648.     }
  649.     for (var i = 0; i < 8; ++i) {
  650.       if (this._battler.isBuffAffected(i) ||
  651.       this._battler.isDebuffAffected(i)) {
  652.         this._data.push('buff ' + i);
  653.       }
  654.     }
  655.   }
  656.   if (this._data.length <= 0) this._data.push(null);
  657. };
  658.  
  659. Window_InBattleStateList.prototype.drawItem = function(index) {
  660.   var item = this._data[index];
  661.   var rect = this.itemRect(index);
  662.   rect.width -= this.textPadding();
  663.   if (item === null) {
  664.     var icon = Yanfly.Param.IBSHealthyIcon;
  665.     var text = Yanfly.Param.IBSHealthyText;
  666.     var ibw = Window_Base._iconWidth + 4;
  667.     this.resetTextColor();
  668.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  669.     this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
  670.   } else if (typeof item === 'string' && item.match(/BUFF[ ](\d+)/i)) {
  671.     var paramId = parseInt(RegExp.$1);
  672.     var level = this._battler._buffs[paramId];
  673.     var icon = this._battler.buffIconIndex(level, paramId);
  674.     var ibw = Window_Base._iconWidth + 4;
  675.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  676.     if (level > 0) {
  677.       var text = Yanfly.Param.IBSBuffText[paramId];
  678.     } else {
  679.       var text = Yanfly.Param.IBSDebuffText[paramId];
  680.     }
  681.     this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
  682.     if (!Imported.YEP_BuffsStatesCore) return;
  683.     this.drawBuffTurns(this._battler, paramId, rect.x + 2, rect.y);
  684.     if (Yanfly.Param.BSCShowBuffRate) {
  685.       this.drawBuffRate(this._battler, paramId, rect.x + 2, rect.y);
  686.     }
  687.   } else if (item) {
  688.     this.drawItemName(item, rect.x, rect.y, rect.width);
  689.     if (!Imported.YEP_BuffsStatesCore) return;
  690.     if (item.autoRemovalTiming > 0) {
  691.       this.drawStateTurns(this._battler, item, rect.x + 2, rect.y);
  692.     }
  693.     this.drawStateCounter(this._battler, item, rect.x + 2, rect.y);
  694.   }
  695. };
  696.  
  697. Window_InBattleStateList.prototype.updateHelp = function() {
  698.   if (this.item() === null) {
  699.     var text = Yanfly.Param.IBSHealthyHelp;
  700.     this._helpWindow.setText(text);
  701.   } else if (typeof this.item() === 'string' &&
  702.   this.item().match(/BUFF[ ](\d+)/i)) {
  703.     var paramId = parseInt(RegExp.$1);
  704.     var level = this._battler._buffs[paramId];
  705.     if (level > 0) {
  706.       var fmt = Yanfly.Param.IBSBuffHelp[paramId];
  707.     } else {
  708.       var fmt = Yanfly.Param.IBSDebuffHelp[paramId];
  709.     }
  710.     var rate = Math.floor(this._battler.paramBuffRate(paramId) * 100);
  711.     var turns = this._battler._buffTurns[paramId];
  712.     var text = fmt.format(rate, Math.abs(level), turns);
  713.     this._helpWindow.setText(text);
  714.   } else if (this.item()) {
  715.     this.setHelpWindowItem(this.item());
  716.   }
  717. };
  718.  
  719. Window_InBattleStateList.prototype.refresh = function() {
  720.   this.makeItemList();
  721.   this.createContents();
  722.   this.drawAllItems();
  723. };
  724.  
  725. Window_InBattleStateList.prototype.update = function() {
  726.   Window_Selectable.prototype.update.call(this);
  727.   if (this.active && this._battler) this.updateLeftRight();
  728. };
  729.  
  730. Window_InBattleStateList.prototype.updateLeftRight = function() {
  731.   var index = $gameParty.battleMembers().indexOf(this._battler);
  732.   var current = index;
  733.   if (Input.isRepeated('left')) {
  734.     index -= 1;
  735.   } else if (Input.isRepeated('right')) {
  736.     index += 1;
  737.   }
  738.   index = index.clamp(0, $gameParty.battleMembers().length - 1);
  739.   if (current !== index) {
  740.     var battler = $gameParty.battleMembers()[index];
  741.     this.setBattler(battler);
  742.     SoundManager.playCursor();
  743.   }
  744. };
  745.  
  746. //=============================================================================
  747. // Window_CTBIcon
  748. //=============================================================================
  749.  
  750. if (Imported.YEP_X_BattleSysCTB) {
  751.  
  752. Yanfly.IBS.Window_CTBIcon_isReduceOpacity =
  753.   Window_CTBIcon.prototype.isReduceOpacity;
  754. Window_CTBIcon.prototype.isReduceOpacity = function() {
  755.   if (SceneManager._scene._inBattleStatusWindow) {
  756.     if (SceneManager._scene._inBattleStatusWindow.visible) return true;
  757.   }
  758.   return Yanfly.IBS.Window_CTBIcon_isReduceOpacity.call(this);
  759. };
  760.  
  761. }; // Imported.YEP_X_BattleSysCTB
  762.  
  763. //=============================================================================
  764. // Window_BattleStatus
  765. //=============================================================================
  766.  
  767. Window_BattleStatus.prototype.setInBattleStatusWindow = function(win) {
  768.   this._inBattleStatusWindow = win;
  769. };
  770.  
  771. Yanfly.IBS.Window_BattleStatus_update = Window_BattleStatus.prototype.update;
  772. Window_BattleStatus.prototype.update = function() {
  773.   Yanfly.IBS.Window_BattleStatus_update.call(this);
  774.   this.processInBattleStatusTouch();
  775. };
  776.  
  777. Window_BattleStatus.prototype.processInBattleStatusTouch = function() {
  778.   if (!this._inBattleStatusWindow) return;
  779.   if (!this._inBattleStatusWindow.active) return;
  780.   if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  781.     this.onInBattleStatusTouch();
  782.   }
  783. };
  784.  
  785. Window_BattleStatus.prototype.onInBattleStatusTouch = function() {
  786.   var lastIndex = this.index();
  787.   var x = this.canvasToLocalX(TouchInput.x);
  788.   var y = this.canvasToLocalY(TouchInput.y);
  789.   var hitIndex = this.hitTest(x, y);
  790.   if (hitIndex >= 0) {
  791.     var actor = $gameParty.battleMembers()[hitIndex];
  792.     var win = this._inBattleStatusWindow;
  793.     if (win && actor) {
  794.       win.setBattler(actor);
  795.       SoundManager.playCursor();
  796.     }
  797.   }
  798. };
  799.  
  800. //=============================================================================
  801. // Scene_Battle
  802. //=============================================================================
  803.  
  804. Yanfly.IBS.Scene_Battle_createAllWindows =
  805.   Scene_Battle.prototype.createAllWindows;
  806. Scene_Battle.prototype.createAllWindows = function() {
  807.   Yanfly.IBS.Scene_Battle_createAllWindows.call(this);
  808.   this.createInBattleStatusWindows();
  809. };
  810.  
  811. Scene_Battle.prototype.createInBattleStatusWindows = function() {
  812.   this._inBattleStatusWindow = new Window_InBattleStatus();
  813.   this.addChild(this._inBattleStatusWindow);
  814.   var win = this._inBattleStatusWindow;
  815.   this._inBattleStateList = new Window_InBattleStateList(win);
  816.   this._inBattleStateList.setHelpWindow(this._helpWindow);
  817.   this._inBattleStateList.setStatusWindow(this._statusWindow);
  818.   this.addChild(this._inBattleStateList);
  819.   this._inBattleStateList.setHandler('cancel', this.onInBattleStatusCancel.bind(this));
  820.   this._statusWindow.setInBattleStatusWindow(this._inBattleStateList);
  821. };
  822.  
  823. Yanfly.IBS.Scene_Battle_createActorCommandWindow =
  824.   Scene_Battle.prototype.createActorCommandWindow;
  825. Scene_Battle.prototype.createActorCommandWindow = function() {
  826.   Yanfly.IBS.Scene_Battle_createActorCommandWindow.call(this);
  827.   var win = this._actorCommandWindow;
  828.   win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
  829. };
  830.  
  831. Scene_Battle.prototype.commandInBattleStatus = function() {
  832.   this._helpWindow.show();
  833.   this._inBattleStatusWindow.show();
  834.   this._inBattleStateList.show();
  835.   this._inBattleStateList.activate();
  836.   this._inBattleStateList.setBattler($gameParty.battleMembers()[0]);
  837.   if (Imported.YEP_X_PartyLimitGauge) {
  838.     this._showPartyLimitGauge = $gameSystem.isShowPartyLimitGauge();
  839.     this._showTroopLimitGauge = $gameSystem.isShowTroopLimitGauge();
  840.     $gameSystem.setShowPartyLimitGauge(false);
  841.     $gameSystem.setShowTroopLimitGauge(false);
  842.   }
  843. };
  844.  
  845. Scene_Battle.prototype.onInBattleStatusCancel = function() {
  846.   this._helpWindow.hide();
  847.   this._inBattleStatusWindow.hide();
  848.   this._inBattleStateList.hide();
  849.   this._inBattleStateList.deactivate();
  850.   this._actorCommandWindow.activate();
  851.   this._statusWindow.deselect();
  852.   if (Imported.YEP_X_PartyLimitGauge) {
  853.     $gameSystem.setShowPartyLimitGauge(this._showPartyLimitGauge);
  854.     $gameSystem.setShowTroopLimitGauge(this._showTroopLimitGauge);
  855.   }
  856. };
  857.  
  858. Yanfly.IBS.Scene_Battle_isAnyInputWindowActive =
  859.   Scene_Battle.prototype.isAnyInputWindowActive;
  860. Scene_Battle.prototype.isAnyInputWindowActive = function() {
  861.   if (this._inBattleStateList && this._inBattleStateList.active) return true;
  862.   return Yanfly.IBS.Scene_Battle_isAnyInputWindowActive.call(this);
  863. };
  864.  
  865. if (Imported.YEP_X_BattleSysCTB) {
  866.  
  867. Yanfly.IBS.Scene_Battle_updateWindowPositionsCTB =
  868.   Scene_Battle.prototype.updateWindowPositionsCTB;
  869. Scene_Battle.prototype.updateWindowPositionsCTB = function() {
  870.   if (this._inBattleStatusWindow && this._inBattleStatusWindow.visible) {
  871.     return;
  872.   }
  873.   Yanfly.IBS.Scene_Battle_updateWindowPositionsCTB.call(this);
  874. };
  875.  
  876. }; // Imported.YEP_X_BattleSysCTB
  877.  
  878. //=============================================================================
  879. // Utilities
  880. //=============================================================================
  881.  
  882. Yanfly.Util = Yanfly.Util || {};
  883.  
  884. if (!Yanfly.Util.toGroup) {
  885.  
  886. Yanfly.Util.toGroup = function(inVal) {
  887.   return inVal;
  888. }
  889.  
  890. };
  891.  
  892. //=============================================================================
  893. // End of File
  894. //=============================================================================
  895. };
回复 支持 反对

使用道具 举报

Lv4.逐梦者

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

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 21:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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