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

Project1

 找回密码
 注册会员
搜索
查看: 1772|回复: 2
打印 上一主题 下一主题

[有事请教] 想知道怎么叠加行动图(找到疑似插件不懂用)

[复制链接]

Lv1.梦旅人

梦石
0
星屑
47
在线时间
4 小时
注册时间
2019-1-27
帖子
7
跳转到指定楼层
1
发表于 2019-1-29 18:35:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 sod778811 于 2019-1-29 21:44 编辑

因为我的游戏可以换装,然后又想可以有个小宠物跟着自己,但是不是开始就有的,可以换的。不想做成队友,就是它是个附属的感觉看看用。
所以想要知道怎么弄在人物的行动图上在加上我小宠物的行动图。大概arpg里,可以切换武器的那种应该有吧,其实我可以因为衣服的不同宠物不同一一对应做图。可是我觉得太辛苦苦了
我之前有找到一个mv游戏 是武器收集的 我看过他的插件 不知道哪个是。我大概找到我想要的可是我的看不懂怎么用

Lv1.梦旅人

梦石
0
星屑
47
在线时间
4 小时
注册时间
2019-1-27
帖子
7
2
 楼主| 发表于 2019-1-29 18:39:04 | 只看该作者
  1. //=============================================================================
  2. // CharacterGraphicExtend.js
  3. // ----------------------------------------------------------------------------
  4. // Copyright (c) 2015 Triacontane
  5. // This software is released under the MIT License.
  6. // http://opensource.org/licenses/mit-license.php
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 1.4.2 2017/02/03 メモ欄に制御文字\v[n]を使った場合に、一度マップ移動しないと反映されない問題を修正しました。
  10. // 1.4.1 2016/11/27 T_dashMotion.jsとの競合を解決
  11. // 1.4.0 2016/11/21 複数のページに対して別々の画像を割り当てる機能を追加しました。
  12. // 1.3.0 2016/07/16 以下の機能を追加しました。
  13. //                  遠景をイベントグラフィックとして利用可能
  14. //                  イベント画像の原点を変更する機能、イベント画像の画面表示位置を絶対値指定する機能
  15. // 1.2.1 2016/05/08 HalfMove.jsとの競合を解消
  16. // 1.2.0 2016/03/19 戦闘発生時にイベントを消去しない設定を追加しました。
  17. // 1.1.2 2016/03/04 本体バージョン1.1.0に合わせてキャラクターの乗算とスクリーンに対応しました。
  18. // 1.1.1 2016/01/21 競合対策(YEP_MessageCore.js)
  19. // 1.1.0 2016/01/11 キャラクターに回転角を設定する機能を追加
  20. //                  移動ルートの指定のスクリプトから、回転角、拡大率、位置調整ができる機能を追加
  21. // 1.0.0 2016/01/08 初版
  22. // ----------------------------------------------------------------------------
  23. // [Blog]   : http://triacontane.blogspot.jp/
  24. // [Twitter]: https://twitter.com/triacontane/
  25. // [GitHub] : https://github.com/triacontane/
  26. //=============================================================================

  27. /*:
  28. * @plugindesc キャラクターグラフィック表示拡張プラグイン
  29. * @author トリアコンタン
  30. *
  31. * @param イベント消去無効
  32. * @desc エンカウント発生時にイベントを一瞬消去するエフェクトを無効にします。
  33. * @default OFF
  34. *
  35. * @help イベントのグラフィック表示方法を拡張して多彩な表現を可能にします。
  36. * イベントのメモ欄に所定の書式で記入してください。
  37. * 項目はカンマで区切ってください。引数には文章の表示と同じ制御文字が使用できます。
  38. * また、ページ数に「A」と入力すると全てのページが対象になります。
  39. *
  40. * <CGピクチャ:(ページ数),(ファイル名)>
  41. * 指定したページが有効になった場合のグラフィックをピクチャ画像から取得します。
  42. * 拡張子は不要です。歩行アニメ待機アニメは無効化されます。
  43. *
  44. * 例:<CGピクチャ:1,Test> or <CGPicture:1,Test>
  45. *
  46. * 〇追加機能
  47. * 複数のページに対して別々の画像を割り当てたい場合は
  48. * ページごとにタグを作成してください。
  49. * 以下の例だと1ページ目ではaaa.pngが、2ページ目ではbbb.pngが使用されます。
  50. * 他のタグも同様です。
  51. * 例:<CGピクチャ:1,aaa><CGピクチャ:2,bbb>
  52. *
  53. * <CG敵キャラ:(ページ数),(ファイル名)>
  54. * 指定したページが有効になった場合のグラフィックを敵キャラ画像から取得します。
  55. * 拡張子は不要です。歩行アニメ待機アニメは無効化されます。
  56. *
  57. * 例:<CG敵キャラ:1,Bat> or <CGEnemy:1,Bat>
  58. *
  59. * <CGアイコン:(ページ数),(インデックス)>
  60. * 指定したページが有効になった場合のグラフィックをアイコン画像から取得します。
  61. * 歩行アニメ待機アニメは無効化されます。
  62. *
  63. * 例:<CGアイコン:1,128> or <CGIcon:1,128>
  64. *
  65. * <CGフェイス:(ページ数),(ファイル名)(インデックス)>
  66. * 指定したページが有効になった場合のグラフィックをフェイス画像から取得します。
  67. * 拡張子は不要です。歩行アニメ待機アニメは無効化されます。
  68. *
  69. * 例:<CGフェイス:1,Actor1,4> or <CGFace:1,Actor1,4>
  70. *
  71. * <CG遠景:(ページ数),(ファイル名)>
  72. * 指定したページが有効になった場合のグラフィックを遠景画像から取得します。
  73. * 拡張子は不要です。歩行アニメ待機アニメは無効化されます。
  74. *
  75. * 例:<CG遠景:1,Test> or <CGParallaxes:1,Test>
  76. *
  77. * 要注意! これらのメモ欄でファイルを指定した場合、デプロイメント時に
  78. * 未使用ファイルとして除外される可能性があります。
  79. * その場合、削除されたファイルを入れ直す等の対応が必要です。
  80. *
  81. * <CGタイル:(ページ数),(横幅),(高さ)>
  82. * 指定したページが有効になった場合のグラフィックをタイルマップ画像から取得します。
  83. * 横幅と高さを指定して本棚やベッドが一つのイベントで表現できます。
  84. * イベントの画像選択から一番左上のタイルを選択してください。
  85. *
  86. * 例:<CGタイル:1,2,2> or <CGTile:1,2,2>
  87. *
  88. * <CGシフト:(ページ数),(X座標),(Y座標)>
  89. * 指定したページが有効になった場合のグラフィック表示位置を
  90. * 指定したピクセル分ずらして表示します。
  91. *
  92. * 例:<CGシフト:1,16,-16> or <CGShift:1,16,-16>
  93. *
  94. * <CGプライオリティ:(ページ数),(プライオリティ)>
  95. * 指定したページが有効になった場合の表示優先度を設定します。
  96. * 1~9までの値を設定できます。
  97. *
  98. * 例:<CGプライオリティ:1,6> or <CGPriority:1,6>
  99. *
  100. * ※それぞれのプライオリティの値
  101. * 0 : 下層タイル
  102. * 1 : 通常キャラの下
  103. * 3 : 通常キャラと同じ
  104. * 4 : 上層タイル
  105. * 5 : 通常キャラの上
  106. * 6 : 飛行船の影
  107. * 7 : フキダシ
  108. * 8 : アニメーション
  109. * 9 : マップタッチの行き先(白く光るヤツ)
  110. *
  111. * <CG合成方法:(ページ数),(合成方法)>
  112. * 指定したページが有効になった場合のグラフィックの合成方法を設定します。
  113. * 0:通常 1:加算 2:乗算 3:スクリーン
  114. *
  115. * 例:<CG合成方法:1,2> or <CGBlendType:1,2>
  116. *
  117. * <CG拡大率:(ページ数),(X拡大率)(Y拡大率)>
  118. * 指定したページが有効になった場合のグラフィックの拡大率を設定します。
  119. * 負の値を設定すると画像が反転します。
  120. *
  121. * 例:<CG拡大率:1,100,-100> or <CGScale:1,100,-100>
  122. *
  123. * <CG回転角:(ページ数),(回転角)>
  124. * 指定したページが有効になった場合のグラフィックの回転角を設定します。
  125. * 回転の中心は、キャラクターの足下になります。0~360の範囲内で設定してください。
  126. *
  127. * 例:<CG回転角:1,180> or <CGAngle:1,180>
  128. *
  129. * <CG原点:(ページ数),(X原点)(Y原点)>
  130. * 指定したページが有効になった場合のグラフィックの原点(0...100)を設定します。
  131. * デフォルトではX原点が50、Y原点が100(画像の足下が原点になる)です。
  132. *
  133. * 例:<CG原点:1,0,0> or <CGOrigin:1,100,100>
  134. *
  135. * <CG絶対座標:(ページ数),(X座標),(Y座標)>
  136. * 指定したページが有効になった場合のグラフィック表示位置を
  137. * 絶対座標(ピクチャのようにマップのスクロールとは無関係に表示する)にします。
  138. * ただし、イベントそのものの位置は変わりません。
  139. *
  140. * 例:<CG絶対座標:1,16,-16> or <CGAbsolute:1,16,-16>
  141. *
  142. * 〇スクリプト(高度な設定。移動ルートの指定からスクリプトで実行)
  143. *
  144. * ・拡大率の設定
  145. * this.setScale((X座標),(Y座標));
  146. * 例:this.setScale(100, 100);
  147. *
  148. * ・回転角の設定
  149. * this.setAngle((回転角));
  150. * 例:this.setAngle(180);
  151. *
  152. * ・ピクセル単位位置の設定
  153. * this.shiftPosition((X座標),(Y座標));
  154. * 例:this.shiftPosition(24, 24);
  155. *
  156. * このプラグインにはプラグインコマンドはありません。
  157. *
  158. * 利用規約:
  159. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  160. *  についても制限はありません。
  161. *  このプラグインはもうあなたのものです。
  162. */
  163. (function() {
  164.     'use strict';
  165.     var pluginName = 'CharacterGraphicExtend';

  166.     var getParamBoolean = function(paramNames) {
  167.         var value = getParamOther(paramNames);
  168.         return (value || '').toUpperCase() === 'ON';
  169.     };

  170.     var getParamOther = function(paramNames) {
  171.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  172.         for (var i = 0; i < paramNames.length; i++) {
  173.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  174.             if (name) return name;
  175.         }
  176.         return null;
  177.     };

  178.     var getArgArrayString = function(args, upperFlg) {
  179.         var values = getArgString(args, upperFlg).split(',');
  180.         for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
  181.         return values;
  182.     };

  183.     var getArgString = function(args, upperFlg) {
  184.         args = convertEscapeCharacters(args);
  185.         return upperFlg ? args.toUpperCase() : args;
  186.     };

  187.     var getArgNumber = function(arg, min, max) {
  188.         if (arguments.length < 2) min = -Infinity;
  189.         if (arguments.length < 3) max = Infinity;
  190.         return (parseInt(convertEscapeCharacters(arg), 10) || 0).clamp(min, max);
  191.     };

  192.     var convertEscapeCharacters = function(text) {
  193.         if (text == null) text = '';
  194.         text = text.replace(/\\/g, '\x1b');
  195.         text = text.replace(/\x1b\x1b/g, '\\');
  196.         text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  197.             return $gameVariables.value(parseInt(arguments[1], 10));
  198.         }.bind(this));
  199.         text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
  200.             return $gameVariables.value(parseInt(arguments[1], 10));
  201.         }.bind(this));
  202.         text = text.replace(/\x1bN\[(\d+)\]/gi, function() {
  203.             var actor = parseInt(arguments[1], 10) >= 1 ? $gameActors.actor(parseInt(arguments[1], 10)) : null;
  204.             return actor ? actor.name() : '';
  205.         }.bind(this));
  206.         text = text.replace(/\x1bP\[(\d+)\]/gi, function() {
  207.             var actor = parseInt(arguments[1], 10) >= 1 ? $gameParty.members()[parseInt(arguments[1], 10) - 1] : null;
  208.             return actor ? actor.name() : '';
  209.         }.bind(this));
  210.         text = text.replace(/\x1bG/gi, TextManager.currencyUnit);
  211.         return text;
  212.     };

  213.     //=============================================================================
  214.     // パラメータの取得とバリデーション
  215.     //=============================================================================
  216.     var paramEventHideInvalid = getParamBoolean(['EventHideInvalid', 'イベント消去無効']);

  217.     //=============================================================================
  218.     // Game_CharacterBase
  219.     //  拡張するプロパティを定義します。
  220.     //=============================================================================
  221.     var _DataManager_extractMetadata = DataManager.extractMetadata;
  222.     DataManager.extractMetadata = function(data) {
  223.         _DataManager_extractMetadata.apply(this, arguments);
  224.         this.extractMetadataArray(data);
  225.     };

  226.     DataManager.extractMetadataArray = function(data) {
  227.         var re = /<([^<>:]+)(:?)([^>]*)>/g;
  228.         data.metaArray = {};
  229.         var match = true;
  230.         while (match) {
  231.             match = re.exec(data.note);
  232.             if (match) {
  233.                 var metaName = match[1];
  234.                 data.metaArray[metaName] = data.metaArray[metaName] || [];
  235.                 data.metaArray[metaName].push(match[2] === ':' ? match[3] : true);
  236.             }
  237.         }
  238.     };

  239.     //=============================================================================
  240.     // Game_CharacterBase
  241.     //  拡張するプロパティを定義します。
  242.     //=============================================================================
  243.     var _Game_CharacterBase_initMembers      = Game_CharacterBase.prototype.initMembers;
  244.     Game_CharacterBase.prototype.initMembers = function() {
  245.         _Game_CharacterBase_initMembers.apply(this, arguments);
  246.         this.clearCgInfo();
  247.     };

  248.     Game_CharacterBase.prototype.clearCgInfo = function() {
  249.         this._customResource  = null;
  250.         this._graphicColumns  = 1;
  251.         this._graphicRows     = 1;
  252.         this._additionalX     = 0;
  253.         this._additionalY     = 0;
  254.         this._customPriority  = -1;
  255.         this._scaleX          = 100;
  256.         this._scaleY          = 100;
  257.         this._tileBlockWidth  = 1;
  258.         this._tileBlockHeight = 1;
  259.         this._angle           = 0;
  260.         this._originX         = null;
  261.         this._originY         = null;
  262.         this._absoluteX       = null;
  263.         this._absoluteY       = null;
  264.         this.setBlendMode(0);
  265.     };

  266.     Game_CharacterBase.prototype.customResource = function() {
  267.         return this._customResource;
  268.     };

  269.     Game_CharacterBase.prototype.graphicColumns = function() {
  270.         return this._graphicColumns;
  271.     };

  272.     Game_CharacterBase.prototype.graphicRows = function() {
  273.         return this._graphicRows;
  274.     };

  275.     Game_CharacterBase.prototype.scaleX = function() {
  276.         return this._scaleX;
  277.     };

  278.     Game_CharacterBase.prototype.scaleY = function() {
  279.         return this._scaleY;
  280.     };

  281.     Game_CharacterBase.prototype.setScale = function(x, y) {
  282.         this._scaleX = x;
  283.         this._scaleY = y;
  284.     };

  285.     Game_CharacterBase.prototype.originX = function() {
  286.         return this._originX;
  287.     };

  288.     Game_CharacterBase.prototype.originY = function() {
  289.         return this._originY;
  290.     };

  291.     Game_CharacterBase.prototype.setOrigin = function(x, y) {
  292.         this._originX = x / 100;
  293.         this._originY = y / 100;
  294.     };

  295.     Game_CharacterBase.prototype.absoluteX = function() {
  296.         return this._absoluteX;
  297.     };

  298.     Game_CharacterBase.prototype.absoluteY = function() {
  299.         return this._absoluteY;
  300.     };

  301.     Game_CharacterBase.prototype.setAbsolute = function(x, y) {
  302.         this._absoluteX = x;
  303.         this._absoluteY = y;
  304.     };

  305.     Game_CharacterBase.prototype.angle = function() {
  306.         return this._angle;
  307.     };

  308.     Game_CharacterBase.prototype.setAngle = function(angle) {
  309.         this._angle = angle;
  310.     };

  311.     Game_CharacterBase.prototype.shiftPosition = function(x, y) {
  312.         this._additionalX = x;
  313.         this._additionalY = y;
  314.     };

  315.     Game_CharacterBase.prototype.tileBlockWidth = function() {
  316.         return this._tileBlockWidth;
  317.     };

  318.     Game_CharacterBase.prototype.tileBlockHeight = function() {
  319.         return this._tileBlockHeight;
  320.     };

  321.     var _Game_CharacterBase_pos      = Game_CharacterBase.prototype.pos;
  322.     Game_CharacterBase.prototype.pos = function(x, y) {
  323.         if (this.tileBlockWidth() >= 2) {
  324.             return (this._x - this.tileBlockWidth() / 2 <= x && this._x + this.tileBlockWidth() / 2 >= x) && this._y === y;
  325.         } else {
  326.             return _Game_CharacterBase_pos.apply(this, arguments);
  327.         }
  328.     };

  329.     var _Game_CharacterBase_screenX      = Game_CharacterBase.prototype.screenX;
  330.     Game_CharacterBase.prototype.screenX = function() {
  331.         return this.absoluteX() != null ? this.absoluteX() : _Game_CharacterBase_screenX.apply(this, arguments) + this._additionalX;
  332.     };

  333.     var _Game_CharacterBase_screenY      = Game_CharacterBase.prototype.screenY;
  334.     Game_CharacterBase.prototype.screenY = function() {
  335.         return this.absoluteY() != null ? this.absoluteY() : _Game_CharacterBase_screenY.apply(this, arguments) + this._additionalY;
  336.     };

  337.     var _Game_CharacterBase_screenZ      = Game_CharacterBase.prototype.screenZ;
  338.     Game_CharacterBase.prototype.screenZ  = function() {
  339.         return this._customPriority >= 0 ? this._customPriority : _Game_CharacterBase_screenZ.apply(this, arguments);
  340.     };

  341.     //=============================================================================
  342.     // Game_Event
  343.     //  拡張するプロパティを定義します。
  344.     //=============================================================================
  345.     Game_Event.blendModeParams = {
  346.         '1': 1, '加算': 1,
  347.         '2': 2, '乗算': 2,
  348.         '3': 3, 'スクリーン': 3
  349.     };

  350.     Game_Event.prototype.getMetaCg = function(names) {
  351.         if (!Array.isArray(names)) names = [names];
  352.         var metaParams = this.getMetaParameter(names);
  353.         if (!metaParams) return null;
  354.         var result = null;
  355.         metaParams.some(function(metaParam) {
  356.             var params = getArgArrayString(metaParam);
  357.             if (this.isValidCgeParam(params)) {
  358.                 result = params;
  359.                 if (metaParam.match(/\\v/gi)) {
  360.                     this._graphicDynamic = true;
  361.                 }
  362.             }
  363.             return result;
  364.         }.bind(this));
  365.         return result;
  366.     };

  367.     Game_Event.prototype.getMetaParameter = function(names) {
  368.         var metaParams = null;
  369.         names.some(function(name) {
  370.             if (!metaParams || metaParams[0] === '') {
  371.                 metaParams = this.event().metaArray['CG' + name];
  372.             }
  373.             return metaParams;
  374.         }.bind(this));
  375.         return metaParams;
  376.     };

  377.     Game_Event.prototype.isValidCgeParam = function(params) {
  378.         var pageIndex = getArgNumber(params[0]);
  379.         return params.length > 1 && (pageIndex === this._pageIndex + 1 || params[0].toUpperCase() === 'A');
  380.     };

  381.     var _Game_Event_refresh = Game_Event.prototype.refresh;
  382.     Game_Event.prototype.refresh = function() {
  383.         if (this._graphicDynamic) {
  384.             this._pageIndex = -1;
  385.         }
  386.         _Game_Event_refresh.apply(this, arguments);
  387.     };

  388.     var _Game_Event_setupPageSettings      = Game_Event.prototype.setupPageSettings;
  389.     Game_Event.prototype.setupPageSettings = function() {
  390.         this.clearCgInfo();
  391.         _Game_Event_setupPageSettings.apply(this, arguments);
  392.         var cgParams = this.getMetaCg(['シフト', 'Shift']);
  393.         if (cgParams) {
  394.             this.shiftPosition(getArgNumber(cgParams[1]), getArgNumber(cgParams[2]));
  395.         }
  396.         cgParams = this.getMetaCg(['プライオリティ', 'Priority']);
  397.         if (cgParams) {
  398. //            this._customPriority = getArgNumber(cgParams[1], 0, 10);
  399.             var meta = this.event().meta.CGPriority.split(',');
  400.             if (meta[0] === 'A' || Number(meta[0]) === this._pageIndex)
  401.                 this._customPriority = Number(meta[1]);
  402.             
  403.         }
  404.         cgParams = this.getMetaCg(['合成方法', 'BlendType']);
  405.         if (cgParams) {
  406.             var blendMode = Game_Event.blendModeParams[cgParams[1]] || 0;
  407.             this.setBlendMode(blendMode);
  408.         }
  409.         cgParams = this.getMetaCg(['拡大率', 'Scale']);
  410.         if (cgParams) {
  411.             this._scaleX = getArgNumber(cgParams[1]);
  412.             this._scaleY = getArgNumber(cgParams[2]);
  413.         }
  414.         cgParams = this.getMetaCg(['回転角', 'Angle']);
  415.         if (cgParams) {
  416.             this.setAngle(getArgNumber(cgParams[1], -360, 360));
  417.         }
  418.         cgParams = this.getMetaCg(['原点', 'Origin']);
  419.         if (cgParams) {
  420.             this.setOrigin(getArgNumber(cgParams[1]), getArgNumber(cgParams[2]));
  421.         }
  422.         cgParams = this.getMetaCg(['絶対座標', 'Absolute']);
  423.         if (cgParams) {
  424.             this.setAbsolute(getArgNumber(cgParams[1]), getArgNumber(cgParams[2]));
  425.         }
  426.     };

  427.     var _Game_Event_setTileImage      = Game_Event.prototype.setTileImage;
  428.     Game_Event.prototype.setTileImage = function(tileId) {
  429.         _Game_Event_setTileImage.apply(this, arguments);
  430.         var cgParams = this.getMetaCg(['タイル', 'Tile']);
  431.         if (cgParams) {
  432.             this._tileBlockWidth  = getArgNumber(cgParams[1]);
  433.             this._tileBlockHeight = getArgNumber(cgParams[2]);
  434.         }
  435.     };

  436.     var _Game_Event_setImage      = Game_Event.prototype.setImage;
  437.     Game_Event.prototype.setImage = function(characterName, characterIndex) {
  438.         var cgParams = this.getMetaCg(['ピクチャ', 'Picture']);
  439.         if (cgParams) {
  440.             this._customResource = 'Picture';
  441.             this._graphicColumns = 1;
  442.             this._graphicRows    = 1;
  443.             arguments[0]         = cgParams[1];
  444.         }
  445.         cgParams = this.getMetaCg(['敵キャラ', 'Enemy']);
  446.         if (cgParams) {
  447.             this._customResource = 'Enemy';
  448.             this._graphicColumns = 1;
  449.             this._graphicRows    = 1;
  450.             arguments[0]         = cgParams[1];
  451.         }
  452.         cgParams = this.getMetaCg(['アイコン', 'Icon']);
  453.         if (cgParams) {
  454.             this._customResource = 'System';
  455.             this._graphicColumns = 16;
  456.             this._graphicRows    = 30;
  457.             arguments[0]         = 'IconSet';
  458.             arguments[1]         = getArgNumber(cgParams[1], 0, 16 * 30 - 1);
  459.         }
  460.         cgParams = this.getMetaCg(['フェイス', 'Face']);
  461.         if (cgParams) {
  462.             this._customResource = 'Face';
  463.             this._graphicColumns = 4;
  464.             this._graphicRows    = 2;
  465.             arguments[0]         = cgParams[1];
  466.             arguments[1]         = getArgNumber(cgParams[2], 0, 4 * 2 - 1);
  467.         }
  468.         cgParams = this.getMetaCg(['遠景', 'Parallax']);
  469.         if (cgParams) {
  470.             this._customResource = 'Parallax';
  471.             this._graphicColumns = 1;
  472.             this._graphicRows    = 1;
  473.             arguments[0]         = cgParams[1];
  474.         }
  475.         //KNH
  476.         cgParams = this.getMetaCg(['Wep', 'Weapon']);
  477.         if (cgParams) {
  478.             this._customResource = 'Weapon';
  479.             this._graphicColumns = 1;
  480.             this._graphicRows    = 1;
  481.             arguments[0]         = this.getWeaponImageName();
  482.         }
  483.         _Game_Event_setImage.apply(this, arguments);
  484.     };

  485.     //=============================================================================
  486.     // Spriteset_Map
  487.     //  イベントを消去するエフェクトを無効にします。
  488.     //=============================================================================
  489.     var _Spriteset_Map_hideCharacters      = Spriteset_Map.prototype.hideCharacters;
  490.     Spriteset_Map.prototype.hideCharacters = function() {
  491.         if (!paramEventHideInvalid) _Spriteset_Map_hideCharacters.apply(this, arguments);
  492.     };

  493.     //=============================================================================
  494.     // Sprite_Character
  495.     //  拡張したプロパティに基づいてエフェクトを反映させます。
  496.     //=============================================================================
  497.     var _Sprite_Character_updateBitmap      = Sprite_Character.prototype.updateBitmap;
  498.     Sprite_Character.prototype.updateBitmap = function() {
  499.         if (this.isImageChanged()) this._customResource = this._character.customResource();
  500.         _Sprite_Character_updateBitmap.apply(this, arguments);
  501.         this.updateExtend();
  502.     };

  503.     var _Sprite_Character_update = Sprite_Character.prototype.update;
  504.     Sprite_Character.prototype.update = function() {
  505.         _Sprite_Character_update.apply(this, arguments);
  506.         if (this.updateDashMotion) {
  507.             this.resolveConflictForDashMotion();
  508.         }
  509.     };

  510.     Sprite_Character.prototype.resolveConflictForDashMotion = function() {
  511.         if (this._character.scaleY() !== 100) {
  512.             this.scale.y = this._character.scaleY() / 100 * this.scale.y;
  513.         }
  514.         if (this._character.angle() !== 0) {
  515.             var angle = this._character.angle() * Math.PI / 180;
  516.             if (this.rotation !== angle) this.rotation = angle;
  517.         }
  518.     };

  519.     Sprite_Character.prototype.updateExtend = function() {
  520.         this.scale.x = this._character.scaleX() / 100;
  521.         this.scale.y = this._character.scaleY() / 100;
  522.         var originX  = this._character.originX();
  523.         if (originX != null) this.anchor.x = originX;
  524.         var originY = this._character.originY();
  525.         if (originY != null) this.anchor.y = originY;
  526.         var angle = this._character.angle() * Math.PI / 180;
  527.         if (this.rotation !== angle) this.rotation = angle;
  528.     };

  529.     var _Sprite_Character_setFrame      = Sprite_Character.prototype.setFrame;
  530.     Sprite_Character.prototype.setFrame = function(sx, sy, pw, ph) {
  531.         _Sprite_Character_setFrame.call(this, sx, sy,
  532.             pw * this._character.tileBlockWidth(), ph * this._character.tileBlockHeight());
  533.     };

  534.     var _Sprite_Character_isImageChanged      = Sprite_Character.prototype.isImageChanged;
  535.     Sprite_Character.prototype.isImageChanged = function() {
  536.         return _Sprite_Character_isImageChanged.apply(this, arguments) ||
  537.             this._customResource !== this._character.customResource();
  538.     };

  539.     var _Sprite_Character_setCharacterBitmap      = Sprite_Character.prototype.setCharacterBitmap;
  540.     Sprite_Character.prototype.setCharacterBitmap = function() {
  541.         if (this._customResource) {
  542.             //KNH
  543.             if (this._customResource === 'Weapon') this.bitmap = ImageManager.loadBitmap('img/weapons/', this._characterName, 0);
  544.             else
  545.             this.bitmap = ImageManager['load' + this._customResource](this._characterName);
  546.         } else {
  547.             _Sprite_Character_setCharacterBitmap.apply(this, arguments);
  548.         }
  549.     };

  550.     var _Sprite_Character_characterBlockX      = Sprite_Character.prototype.characterBlockX;
  551.     Sprite_Character.prototype.characterBlockX = function() {
  552.         if (this._customResource) {
  553.             return this._characterIndex % this._character.graphicColumns();
  554.         } else {
  555.             return _Sprite_Character_characterBlockX.apply(this, arguments);
  556.         }
  557.     };

  558.     var _Sprite_Character_characterBlockY      = Sprite_Character.prototype.characterBlockY;
  559.     Sprite_Character.prototype.characterBlockY = function() {
  560.         if (this._customResource) {
  561.             return Math.floor(this._characterIndex / this._character.graphicColumns());
  562.         } else {
  563.             return _Sprite_Character_characterBlockY.apply(this, arguments);
  564.         }
  565.     };

  566.     var _Sprite_Character_patternWidth      = Sprite_Character.prototype.patternWidth;
  567.     Sprite_Character.prototype.patternWidth = function() {
  568.         if (this._customResource) {
  569.             return this.bitmap.width / this._character.graphicColumns();
  570.         } else {
  571.             return _Sprite_Character_patternWidth.apply(this, arguments);
  572.         }
  573.     };

  574.     var _Sprite_Character_patternHeight      = Sprite_Character.prototype.patternHeight;
  575.     Sprite_Character.prototype.patternHeight = function() {
  576.         if (this._customResource) {
  577.             return this.bitmap.height / this._character.graphicRows();
  578.         } else {
  579.             return _Sprite_Character_patternHeight.apply(this, arguments);
  580.         }
  581.     };

  582.     var _Sprite_Character_characterPatternX      = Sprite_Character.prototype.characterPatternX;
  583.     Sprite_Character.prototype.characterPatternX = function() {
  584.         if (this._customResource) {
  585.             return 0;
  586.         } else {
  587.             return _Sprite_Character_characterPatternX.apply(this, arguments);
  588.         }
  589.     };

  590.     var _Sprite_Character_characterPatternY      = Sprite_Character.prototype.characterPatternY;
  591.     Sprite_Character.prototype.characterPatternY = function() {
  592.         if (this._customResource) {
  593.             return 0;
  594.         } else {
  595.             return _Sprite_Character_characterPatternY.apply(this, arguments);
  596.         }
  597.     };
  598. })();
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
47
在线时间
4 小时
注册时间
2019-1-27
帖子
7
3
 楼主| 发表于 2019-1-29 18:39:42 | 只看该作者
上面的是我觉得是的插件   可是我 看不懂  翻译了也不懂怎么用
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-10 09:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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