查看: 5560|回复: 7

[已经过期] 求助,关于在战斗时显示立绘,立绘会根据状态改变的脚本

[复制链接]
梦石
0
星屑
493
在线时间
122 小时
注册时间
2016-2-20
回帖
126
发表于 2016-3-1 07:13:20 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 m8663431 于 2016-3-1 12:35 编辑

MV有这样的脚本么?

一直在用ACE游戏,,,因为需要在战斗时显示立绘,然后根据不同的状态立绘改变。。。比如中毒人就会变僵尸图的立绘。。。。。。
但是由于分辨率冲突,因为战斗时显示立绘,分辨率不高就会挡到敌人。。。。。这个脚本基本完善,可后来又跟系统预设的远景冲突,导致远景图片不能循环播放。这个问题至今没解决。。。

后来看MV分辨率高图也清晰,很想转战。。。不知道哪位大大知不知道MV有没有偶这种类似脚本。。。


就是,战斗时同时显示4个人或者也可以选菜单攻击画面单独显示这个人物(这个好像目前有,用过)的立绘。。。然后这个立绘,会根据不同的状态变化改变,比如破甲,衣服会撕裂。。。僵尸化,会变僵尸这种脚本
梦石
0
星屑
493
在线时间
122 小时
注册时间
2016-2-20
回帖
126
 楼主| 发表于 2016-3-2 00:13:08 | 显示全部楼层
竟然没人知道啊?
回复

使用道具 举报

梦石
0
星屑
493
在线时间
122 小时
注册时间
2016-2-20
回帖
126
 楼主| 发表于 2016-3-2 10:20:52 | 显示全部楼层
顶上去,,,,
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-3-2 16:41:48 | 显示全部楼层
PictureAnimation.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.3.0 2016/02/28 追加セル番号和変数連動機能
//                  処理負荷軽減
// 1.2.3 2016/02/07 戦闘画面使用圖片動画bug修正
// 1.2.2 2016/01/24 空のピクチャを表示しようとした際にエラーが発生する現象を修正
// 1.2.1 2016/01/16 同じ画像を指定してピクチャ表示→アニメーション準備→ピクチャ表示の順で実行した
//                  場合にエラーが発生する現象の修正
// 1.2.0 2016/01/04 セルのパターンを自由に指定できる機能を追加
//                  セルの最大数を100から200に拡大
// 1.1.2 2015/12/24 クロスフェードによる画像切替に対応しました
// 1.1.1 2015/12/21 ピクチャのファイル名を連番方式で指定できる機能を追加
//                  アニメーションの強制終了の機能を追加
// 1.0.0 2015/12/19 初版
// ----------------------------------------------------------------------------
// [Blog]   : http://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================

PictureAnimation
  1. //=============================================================================
  2. // PictureAnimation.js
  3. // ----------------------------------------------------------------------------
  4. // Copyright (c) 2015 Triacontane
  5. // This software is released under the MIT License.
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 1.3.0 2016/02/28 セル番号を変数と連動する機能を追加
  10. //                  処理の負荷を少し軽減
  11. // 1.2.3 2016/02/07 戦闘画面でもピクチャのアニメーションができるように修正
  12. // 1.2.2 2016/01/24 空のピクチャを表示しようとした際にエラーが発生する現象を修正
  13. // 1.2.1 2016/01/16 同じ画像を指定してピクチャ表示→アニメーション準備→ピクチャ表示の順で実行した
  14. //                  場合にエラーが発生する現象の修正
  15. // 1.2.0 2016/01/04 セルのパターンを自由に指定できる機能を追加
  16. //                  セルの最大数を100から200に拡大
  17. // 1.1.2 2015/12/24 クロスフェードによる画像切替に対応しました
  18. // 1.1.1 2015/12/21 ピクチャのファイル名を連番方式で指定できる機能を追加
  19. //                  アニメーションの強制終了の機能を追加
  20. // 1.0.0 2015/12/19 初版
  21. // ----------------------------------------------------------------------------
  22. // [Blog]   : [url]http://triacontane.blogspot.jp/[/url]
  23. // [Twitter]: [url]https://twitter.com/triacontane/[/url]
  24. // [GitHub] : [url]https://github.com/triacontane/[/url]
  25. //=============================================================================

  26. /*:
  27. * @plugindesc ピクチャのアニメーションプラグイン
  28. * @author トリアコンタン
  29. *
  30. * @help 指定したフレーム間隔でピクチャをアニメーションします。
  31. * アニメーションしたいセル画像(※)を用意の上
  32. * 以下のコマンドを入力してください。
  33. *
  34. * 1. ピクチャのアニメーション準備(プラグインコマンド)
  35. * 2. ピクチャの表示(通常のイベントコマンド)
  36. * 3. ピクチャのアニメーション開始(プラグインコマンド)
  37. * 4. ピクチャのアニメーション終了(プラグインコマンド)
  38. *
  39. * ※配置方法は以下の3通りがあります。
  40. *  縦 :セルを縦に並べて全体を一つのファイルにします。
  41. *  横 :セルを横に並べて全体を一つのファイルにします。
  42. *  連番:連番のセル画像を複数用意します。(original部分は任意の文字列)
  43. *   original00.png(ピクチャの表示で指定するオリジナルファイル)
  44. *   original01.png
  45. *   original02.png...
  46. *
  47. * また、単にアニメーションさせる以外にも、プラグインコマンドから
  48. * セル番号を直接指定したり、変数の値とセル番号を連動させたりできます。
  49. * 紙芝居のような演出や、条件次第で立ち絵の表示状態を変化させたりする場合に
  50. * 有効です。
  51. *
  52. * プラグインコマンド詳細
  53. *  イベントコマンド「プラグインコマンド」から実行。
  54. *  (パラメータの間は半角スペースで区切る)
  55. *
  56. *  PA_INIT or
  57. *  ピクチャのアニメーション準備 [セル数] [フレーム数] [セル配置方法] [フェード時間]
  58. *   ピクチャをアニメーション対象にする準備をします。
  59. *   「ピクチャの表示」の直前に実行してください。
  60. *   セル数   :アニメーションするセル画の数(最大200枚)
  61. *   フレーム数 :アニメーション間隔のフレーム数(最低でも1を設定)
  62. *   セル配置方向:セルの配置(縦 or 横 or 連番)
  63. *   フェード時間:画像切替に掛かるフレーム数(0にするとフェードしない)
  64. *  使用例:PA_INIT 4 10 連番 20
  65. *
  66. *  PA_START or
  67. *  ピクチャのアニメーション開始 [ピクチャ番号] [アニメーションタイプ] [カスタムパターン配列]
  68. *   指定したピクチャ番号のピクチャをアニメーションを開始します。
  69. *   一周するとアニメーションは自動で止まります。
  70. *
  71. *   アニメーションのタイプは以下の3パターンがあります。
  72. *    例:セル数が 4 の場合
  73. *     タイプ1: 1→2→3→4→1→2→3→4...
  74. *     タイプ2: 1→2→3→4→3→2→1→2...
  75. *     タイプ3: 好きな順番を配列で指定(セルの最小値は 1 です)
  76. *  使用例:PA_START 1 2
  77. *      PA_START 1 3 [1,2,1,3,1,4]
  78. *
  79. *  PA_START_LOOP or
  80. *  ピクチャのループアニメーション開始 [ピクチャ番号] [アニメーションタイプ] [カスタムパターン配列]
  81. *   指定したピクチャ番号のピクチャをアニメーションを開始します。
  82. *   明示的に終了するまでアニメーションが続きます。
  83. *  使用例:PA_START_LOOP 1 2
  84. *      PA_START_LOOP 1 3 [1,2,1,3,1,4]
  85. *
  86. *  PA_STOP or
  87. *  ピクチャのアニメーション終了 [ピクチャ番号]
  88. *   指定したピクチャ番号のピクチャをアニメーションを終了します。
  89. *   一番上のセルに戻った時点でアニメーションが止まります。
  90. *  使用例:PA_STOP 1
  91. *
  92. *  PA_STOP_FORCE or
  93. *  ピクチャのアニメーション強制終了 [ピクチャ番号]
  94. *   指定したピクチャ番号のピクチャをアニメーションを終了します。
  95. *   現在表示しているセルでアニメーションが止まります。
  96. *  使用例:PA_STOP_FORCE 1
  97. *
  98. *  PA_SET_CELL or
  99. *  ピクチャのアニメーションセル設定 [ピクチャ番号] [セル番号] [ウェイトあり]
  100. *   アニメーションのセルを直接設定します。(セルの最小値は 1 です)
  101. *   任意のタイミングでアニメーションしたい場合に有効です。
  102. *   ウェイトありを設定すると、クロスフェード中はイベントの実行を待機します。
  103. *  使用例:PA_SET_CELL 1 3 ウェイトあり
  104. *
  105. *  PA_PROG_CELL or
  106. *  ピクチャのアニメーションセル進行 [ピクチャ番号] [ウェイトあり]
  107. *   アニメーションのセルをひとつ先に進めます。
  108. *   任意のタイミングでアニメーションしたい場合に有効です。
  109. *   ウェイトありを設定すると、クロスフェード中はイベントの実行を待機します。
  110. *  使用例:PA_PROG_CELL 1 ウェイトあり
  111. *
  112. *  PA_SET_VARIABLE or
  113. *  ピクチャのアニメーションセル変数の設定 [ピクチャ番号] [変数番号]
  114. *   アニメーションのセルを指定した変数と連動させます。
  115. *   変数の値が変化すると表示しているセルも自動的に変化します。
  116. *  使用例:PA_SET_VARIABLE 1 2
  117. *
  118. * 利用規約:
  119. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  120. *  についても制限はありません。
  121. *  このプラグインはもうあなたのものです。
  122. */
  123. (function () {
  124.     'use strict';
  125.     var settings = {
  126.         /* maxCellAnimation:セル数の最大値 */
  127.         maxCellAnimation:200
  128.     };

  129.     //=============================================================================
  130.     // ローカル関数
  131.     //  プラグインパラメータやプラグインコマンドパラメータの整形やチェックをします
  132.     //=============================================================================
  133.     var getCommandName = function (command) {
  134.         return (command || '').toUpperCase();
  135.     };

  136.     var getArgArrayString = function (args, upperFlg) {
  137.         var values = getArgString(args, upperFlg);
  138.         return (values || '').split(',');
  139.     };

  140.     var getArgArrayNumber = function (args, min, max) {
  141.         var values = getArgArrayString(args, false);
  142.         if (arguments.length < 2) min = -Infinity;
  143.         if (arguments.length < 3) max = Infinity;
  144.         for (var i = 0; i < values.length; i++) values[i] = (parseInt(values[i], 10) || 0).clamp(min, max);
  145.         return values;
  146.     };

  147.     var getArgString = function (arg, upperFlg) {
  148.         arg = convertEscapeCharacters(arg);
  149.         return upperFlg ? arg.toUpperCase() : arg;
  150.     };

  151.     var getArgNumber = function (arg, min, max) {
  152.         if (arguments.length < 2) min = -Infinity;
  153.         if (arguments.length < 3) max = Infinity;
  154.         return (parseInt(convertEscapeCharacters(arg), 10) || 0).clamp(min, max);
  155.     };

  156.     var convertEscapeCharacters = function(text) {
  157.         if (text == null) text = '';
  158.         var window = SceneManager._scene._windowLayer.children[0];
  159.         return window ? window.convertEscapeCharacters(text) : text;
  160.     };

  161.     //=============================================================================
  162.     // Game_Interpreter
  163.     //  プラグインコマンドを追加定義します。
  164.     //=============================================================================
  165.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  166.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  167.         _Game_Interpreter_pluginCommand.call(this, command, args);
  168.         try {
  169.             this.pluginCommandPictureAnimation(command, args);
  170.         } catch (e) {
  171.             if ($gameTemp.isPlaytest() && Utils.isNwjs()) {
  172.                 var window = require('nw.gui').Window.get();
  173.                 if (!window.isDevToolsOpen()) {
  174.                     var devTool = window.showDevTools();
  175.                     devTool.moveTo(0, 0);
  176.                     devTool.resizeTo(Graphics.width, Graphics.height);
  177.                     window.focus();
  178.                 }
  179.             }
  180.             console.log('プラグインコマンドの実行中にエラーが発生しました。');
  181.             console.log('- コマンド名  : ' + command);
  182.             console.log('- コマンド引数 : ' + args);
  183.             console.log('- エラー原因   : ' + e.toString());
  184.         }
  185.     };

  186.     Game_Interpreter.prototype.pluginCommandPictureAnimation = function (command, args) {
  187.         var pictureNum, animationType, picture, cellNumber, frameNumber, direction, fadeDuration, wait, customArray;
  188.         switch (getCommandName(command)) {
  189.             case 'PA_INIT' :
  190.             case 'ピクチャのアニメーション準備':
  191.                 cellNumber   = getArgNumber(args[0], 1, settings.maxCellAnimation);
  192.                 frameNumber  = getArgNumber(args[1], 1, 9999);
  193.                 direction    = getArgString(args[2], true) || '縦';
  194.                 fadeDuration = getArgNumber(args[3], 0, 9999) || 0;
  195.                 $gameScreen.setPicturesAnimation(cellNumber, frameNumber, direction, fadeDuration);
  196.                 break;
  197.             case 'PA_START' :
  198.             case 'ピクチャのアニメーション開始':
  199.                 pictureNum     = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  200.                 animationType  = getArgNumber(args[1], 1, 3);
  201.                 customArray    = getArgArrayNumber(args[2], 1, settings.maxCellAnimation);
  202.                 picture        = $gameScreen.picture(pictureNum);
  203.                 if (picture) picture.startAnimation(animationType, false, customArray);
  204.                 break;
  205.             case 'PA_START_LOOP' :
  206.             case 'ピクチャのループアニメーション開始':
  207.                 pictureNum     = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  208.                 animationType  = getArgNumber(args[1], 1, 3);
  209.                 customArray    = getArgArrayNumber(args[2], 1, settings.maxCellAnimation);
  210.                 picture        = $gameScreen.picture(pictureNum);
  211.                 if (picture) picture.startAnimation(animationType, true, customArray);
  212.                 break;
  213.             case 'PA_STOP' :
  214.             case 'ピクチャのアニメーション終了':
  215.                 pictureNum    = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  216.                 picture       = $gameScreen.picture(pictureNum);
  217.                 if (picture) picture.stopAnimation(false);
  218.                 break;
  219.             case 'PA_STOP_FORCE' :
  220.             case 'ピクチャのアニメーション強制終了':
  221.                 pictureNum    = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  222.                 picture       = $gameScreen.picture(pictureNum);
  223.                 if (picture) picture.stopAnimation(true);
  224.                 break;
  225.             case 'PA_SET_CELL' :
  226.             case 'ピクチャのアニメーションセル設定':
  227.                 pictureNum    = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  228.                 cellNumber    = getArgNumber(args[1], 1, settings.maxCellAnimation);
  229.                 wait          = getArgString(args[2]);
  230.                 picture       = $gameScreen.picture(pictureNum);
  231.                 if (picture) {
  232.                     if (wait === 'ウェイトあり' || wait.toUpperCase() === 'WAIT') this.wait(picture._fadeDuration);
  233.                     picture.cell = cellNumber;
  234.                 }
  235.                 break;
  236.             case 'PA_PROG_CELL' :
  237.             case 'ピクチャのアニメーションセル進行':
  238.                 pictureNum    = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  239.                 wait          = getArgString(args[1]);
  240.                 picture       = $gameScreen.picture(pictureNum);
  241.                 if (picture) {
  242.                     if (wait === 'ウェイトあり' || wait.toUpperCase() === 'WAIT') this.wait(picture._fadeDuration);
  243.                     picture.addCellCount();
  244.                 }
  245.                 break;
  246.             case 'PA_SET_VARIABLE' :
  247.             case 'ピクチャのアニメーションセル変数の設定':
  248.                 pictureNum    = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  249.                 picture       = $gameScreen.picture(pictureNum);
  250.                 if (picture) picture.linkToVariable(getArgNumber(args[1]));
  251.                 break;
  252.         }
  253.     };

  254.     //=============================================================================
  255.     // Game_Screen
  256.     //  アニメーション関連の情報を追加で保持します。
  257.     //=============================================================================
  258.     Game_Screen.prototype.setPicturesAnimation = function(cellNumber, frameNumber, direction, fadeDuration) {
  259.         this._paCellNumber   = cellNumber;
  260.         this._paFrameNumber  = frameNumber;
  261.         this._paDirection    = direction;
  262.         this._paFadeDuration = fadeDuration;
  263.     };

  264.     Game_Screen.prototype.clearPicturesAnimation = function() {
  265.         this._paCellNumber   = 1;
  266.         this._paFrameNumber  = 1;
  267.         this._paDirection    = '';
  268.         this._paFadeDuration = 0;
  269.     };

  270.     var _Game_Screen_showPicture = Game_Screen.prototype.showPicture;
  271.     Game_Screen.prototype.showPicture = function(pictureId, name, origin, x, y,
  272.                                                  scaleX, scaleY, opacity, blendMode) {
  273.         _Game_Screen_showPicture.apply(this, arguments);
  274.         var realPictureId = this.realPictureId(pictureId);
  275.         if (this._paCellNumber > 1) {
  276.             this._pictures[realPictureId].setAnimationInit(
  277.                 this._paCellNumber, this._paFrameNumber, this._paDirection, this._paFadeDuration);
  278.             this.clearPicturesAnimation();
  279.         }
  280.     };

  281.     //=============================================================================
  282.     // Game_Picture
  283.     //  アニメーション関連の情報を追加で保持します。
  284.     //=============================================================================
  285.     var _Game_Picture_initialize = Game_Picture.prototype.initialize;
  286.     Game_Picture.prototype.initialize = function() {
  287.         _Game_Picture_initialize.call(this);
  288.         this.initAnimation();
  289.     };

  290.     Game_Picture.prototype.initAnimation = function() {
  291.         this._cellNumber        = 1;
  292.         this._frameNumber       = 1;
  293.         this._cellCount         = 0;
  294.         this._frameCount        = 0;
  295.         this._animationType     = 0;
  296.         this._customArray       = null;
  297.         this._loopFlg           = false;
  298.         this._direction         = '';
  299.         this._fadeDuration      = 0;
  300.         this._fadeDurationCount = 0;
  301.         this._prevCellCount     = 0;
  302.         this._animationFlg      = false;
  303.         this._linkedVariable    = 0;
  304.     };

  305.     Game_Picture.prototype.direction = function() {
  306.         return this._direction;
  307.     };

  308.     Game_Picture.prototype.cellNumber = function() {
  309.         return this._cellNumber;
  310.     };

  311.     Game_Picture.prototype.prevCellCount = function() {
  312.         return this._prevCellCount;
  313.     };

  314.     Game_Picture.prototype.isMulti = function() {
  315.         var dir = this.direction();
  316.         return dir === '連番' || dir === 'N';
  317.     };

  318.     /**
  319.      * The cellCount of the Game_Picture (0 to cellNumber).
  320.      *
  321.      * @property cellCount
  322.      * @type Number
  323.      */
  324.     Object.defineProperty(Game_Picture.prototype, 'cell', {
  325.         get: function() {
  326.             if (this._linkedVariable > 0) {
  327.                 return $gameVariables.value(this._linkedVariable) % this._cellNumber;
  328.             }
  329.             switch (this._animationType) {
  330.                 case 3:
  331.                     return (this._customArray[this._cellCount] - 1).clamp(0, this._cellNumber - 1);
  332.                 case 2:
  333.                     return this._cellNumber - 1 - Math.abs(this._cellCount - (this._cellNumber - 1));
  334.                 case 1:
  335.                     return this._cellCount;
  336.                 default:
  337.                     return this._cellCount;
  338.             }
  339.         },
  340.         set: function(value) {
  341.             var newCellCount = value % this.getCellNumber();
  342.             if (this._cellCount !== newCellCount) {
  343.                 this._prevCellCount     = this.cell;
  344.                 this._fadeDurationCount = this._fadeDuration;
  345.             }
  346.             this._cellCount = newCellCount;
  347.         },
  348.         configurable: true
  349.     });

  350.     Game_Picture.prototype.getCellNumber = function() {
  351.         switch (this._animationType) {
  352.             case 3:
  353.                 return this._customArray.length;
  354.             case 2:
  355.                 return (this._cellNumber - 1) * 2;
  356.             case 1:
  357.                 return this._cellNumber;
  358.             default:
  359.                 return this._cellNumber;
  360.         }
  361.     };

  362.     var _Game_Picture_update = Game_Picture.prototype.update;
  363.     Game_Picture.prototype.update = function() {
  364.         _Game_Picture_update.call(this);
  365.         if (this.isFading()) {
  366.             this.updateFading();
  367.         } else if(this.isAnimation()) {
  368.             this.updateAnimation();
  369.         }
  370.     };

  371.     Game_Picture.prototype.linkToVariable = function(variableNumber) {
  372.         this._linkedVariable = variableNumber.clamp(1, $dataSystem.variables.length);
  373.     };

  374.     Game_Picture.prototype.updateAnimation = function() {
  375.         this._frameCount = (this._frameCount + 1) % this._frameNumber;
  376.         if (this._frameCount === 0) {
  377.             this.addCellCount();
  378.             if (this._cellCount === 0 && !this._loopFlg) {
  379.                 this._animationFlg  = false;
  380.             }
  381.         }
  382.     };

  383.     Game_Picture.prototype.updateFading = function() {
  384.         this._fadeDurationCount--;
  385.     };

  386.     Game_Picture.prototype.prevCellOpacity = function() {
  387.         if (this._fadeDuration === 0) return 0;
  388.         return this.opacity() / this._fadeDuration * this._fadeDurationCount;
  389.     };

  390.     Game_Picture.prototype.addCellCount = function() {
  391.         this.cell = this._cellCount + 1;
  392.     };

  393.     Game_Picture.prototype.setAnimationInit = function(cellNumber, frameNumber, direction, fadeDuration) {
  394.         this._cellNumber   = cellNumber;
  395.         this._frameNumber  = frameNumber;
  396.         this._frameCount   = 0;
  397.         this._cellCount    = 0;
  398.         this._direction    = direction;
  399.         this._fadeDuration = fadeDuration;
  400.     };

  401.     Game_Picture.prototype.startAnimation = function(animationType, loopFlg, customArray) {
  402.         this._animationType = animationType;
  403.         this._customArray = customArray;
  404.         this._animationFlg = true;
  405.         this._loopFlg = loopFlg;
  406.     };

  407.     Game_Picture.prototype.stopAnimation = function(forceFlg) {
  408.         this._loopFlg = false;
  409.         if (forceFlg) this._animationFlg = false;
  410.     };

  411.     Game_Picture.prototype.isAnimation = function() {
  412.         return this._animationFlg;
  413.     };

  414.     Game_Picture.prototype.isFading = function() {
  415.         return this._fadeDurationCount !== 0;
  416.     };

  417.     Game_Picture.prototype.isNeedFade = function() {
  418.         return this._fadeDuration !== 0;
  419.     };

  420.     //=============================================================================
  421.     // Sprite_Picture
  422.     //  アニメーション関連の情報を追加で保持します。
  423.     //=============================================================================
  424.     var _Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
  425.     Sprite_Picture.prototype.initialize = function(pictureId) {
  426.         this._prevSprite = null;
  427.         _Sprite_Picture_initialize.apply(this, arguments);
  428.     };

  429.     var _Sprite_Picture_update = Sprite_Picture.prototype.update;
  430.     Sprite_Picture.prototype.update = function() {
  431.         _Sprite_Picture_update.call(this);
  432.         if (this.picture() != null && this.picture().name()) {
  433.             if (this.picture().isMulti() && this._bitmaps == null) {
  434.                 this.loadAnimationBitmap();
  435.             }
  436.             if (this.isBitmapReady()) {
  437.                 this.updateAnimation(this, this.picture().cell);
  438.                 if (this.picture().isNeedFade()) this.updateFading();
  439.             }
  440.         }
  441.     };

  442.     var _Sprite_Picture_updateBitmap = Sprite_Picture.prototype.updateBitmap;
  443.     Sprite_Picture.prototype.updateBitmap = function() {
  444.         _Sprite_Picture_updateBitmap.call(this);
  445.         if (this.picture() == null) {
  446.             this._bitmaps = null;
  447.             if (this._prevSprite != null) {
  448.                 this._prevSprite.bitmap = null;
  449.             }
  450.         }
  451.     };

  452.     Sprite_Picture.prototype.updateFading = function() {
  453.         if (this._prevSprite == null) {
  454.             this.makePrevSprite();
  455.         }
  456.         if (this.picture().isFading()) {
  457.             this._prevSprite.visible = true;
  458.             this.updateAnimation(this._prevSprite, this.picture().prevCellCount());
  459.             this._prevSprite.opacity = this.picture().prevCellOpacity();
  460.         } else {
  461.             this._prevSprite.visible = false;
  462.         }
  463.     };

  464.     Sprite_Picture.prototype.updateAnimation = function(sprite, cellCount) {
  465.         switch (this.picture().direction()) {
  466.             case '連番':
  467.             case 'N':
  468.                 sprite.bitmap = this._bitmaps[cellCount];
  469.                 sprite.setFrame(0, 0, sprite.bitmap.width, sprite.bitmap.height);
  470.                 break;
  471.             case '縦':
  472.             case 'V':
  473.                 var height = sprite.bitmap.height / this.picture().cellNumber();
  474.                 var y      = cellCount * height;
  475.                 sprite.setFrame(0, y, sprite.bitmap.width, height);
  476.                 break;
  477.             case '横':
  478.             case 'H':
  479.                 var width = sprite.bitmap.width / this.picture().cellNumber();
  480.                 var x     = cellCount * width;
  481.                 sprite.setFrame(x, 0, width, this.bitmap.height);
  482.                 break;
  483.         }
  484.     };

  485.     var _Sprite_Picture_loadBitmap = Sprite_Picture.prototype.loadBitmap;
  486.     Sprite_Picture.prototype.loadBitmap = function() {
  487.         _Sprite_Picture_loadBitmap.call(this);
  488.         this._bitmapReady = false;
  489.         this._bitmaps = null;
  490.     };

  491.     Sprite_Picture.prototype.loadAnimationBitmap = function() {
  492.         var cellNumber = this.picture().cellNumber();
  493.         var cellDigit = cellNumber.toString().length;
  494.         this._bitmaps = [this.bitmap];
  495.         for (var i = 1; i < cellNumber; i++) {
  496.             var filename = this._pictureName.substr(0, this._pictureName.length - cellDigit) + i.padZero(cellDigit);
  497.             this._bitmaps[i] = ImageManager.loadPicture(filename);
  498.         }
  499.         this._bitmapReady = false;
  500.     };

  501.     Sprite_Picture.prototype.makePrevSprite = function() {
  502.         this._prevSprite = new Sprite();
  503.         this._prevSprite.visible = false;
  504.         this._prevSprite.bitmap  = this.bitmap;
  505.         this.addChild(this._prevSprite);
  506.     };

  507.     Sprite_Picture.prototype.isBitmapReady = function() {
  508.         if (this._bitmapReady) return true;
  509.         var result;
  510.         if (this.picture().isMulti()) {
  511.             result = this._bitmaps.every(function(bitmap) {
  512.                 return bitmap.isReady();
  513.             });
  514.         } else {
  515.             result = this.bitmap.isReady();
  516.         }
  517.         this._bitmapReady = result;
  518.         return result;
  519.     };
  520. })();
复制代码

点评

日文苦手···· 大神,这个是哪个脚本,可以实现哪个功能,我不是特别懂,但在ACE我说的要两个脚本才实现的  发表于 2016-3-2 21:41
日文苦手···· 大神,这个是哪个脚本,可以实现哪个功能,我不是特别懂,但在ACE我说的要两个脚本才实现的  发表于 2016-3-2 21:40
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
发表于 2016-3-2 16:51:23 | 显示全部楼层
看不懂你再說甚麼 只是改變圖案的話 事件不是有狀態條件嗎?
回复

使用道具 举报

梦石
0
星屑
493
在线时间
122 小时
注册时间
2016-2-20
回帖
126
 楼主| 发表于 2016-3-2 21:21:33 | 显示全部楼层
小叮鈴 发表于 2016-3-2 16:51
看不懂你再說甚麼 只是改變圖案的話 事件不是有狀態條件嗎?

就是,游戏中会显示人物的立绘,不是头像。。。

类似这种,,,然后这个立绘,会根据状态的变化自定义,比如中毒了,破甲了,僵尸化了,都有不同的立绘

这个在MV里可以直接实现?

点评

啊···好吧  发表于 2016-3-3 07:58
另外插件不可能混用的,所以樓上那個插件你也不用試了....除非是同一個作者發布的插件 不燃基本上完全不可能相容  发表于 2016-3-3 00:51
好吧···  发表于 2016-3-3 00:18
插件要改非常難 妳不用考慮了  发表于 2016-3-3 00:04
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
发表于 2016-3-2 22:05:13 | 显示全部楼层
m8663431 发表于 2016-3-2 21:21
就是,游戏中会显示人物的立绘,不是头像。。。

类似这种,,,然后这个立绘,会根据状态的变化自定义, ...

你這已經改變介面了  肯定是插件

点评

对,我是直接拿一个开源的游戏改的,,,我自己是不懂脚本的。。。  发表于 2016-3-2 22:34
回复

使用道具 举报

梦石
0
星屑
57
在线时间
4 小时
注册时间
2018-6-14
回帖
6
发表于 2018-6-14 23:30:14 | 显示全部楼层
m8663431 发表于 2016-3-2 21:21
就是,游戏中会显示人物的立绘,不是头像。。。

类似这种,,,然后这个立绘,会根据状态的变化自定义, ...

楼主的这个插件还能找到吗?我在用ACE做游戏,很像用楼主这个插件。这样就可以使用平常是正常立绘状态,中毒状态下了就换成痛苦的立绘。

不知道这个插件的去哪能找到啊,可否请楼主不吝赐教。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部