vince761 vince761
关注数: 3 粉丝数: 49 发帖数: 3,095 关注贴吧数: 17
求问这个JS插件脚本怎么调用 /*-------------------------------------------------------------------------- キャラチップの見た目をオリジナルエフェクトに変更します。 エフェクトは巨大な魔物のようなものにするのが一般的です。 通常のキャラチップのように-a、-b、-cを用意します。 -aは敵、-bは同盟、-cは待機です。 使用方法: クラスの条件表示のキーワードにanimationを設定します。 クラスのカスタムパラメータに {animationId: 0}のように設定します。 作成者: サファイアソフト http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fsrpgstudio.com%2F&urlrefer=d5f27ea48bf194c0b6e7dec346ba3af5 更新履歴: 2018/08/26 公開 --------------------------------------------------------------------------*/ (function() { var alias1 = CustomCharChipGroup._configureCustomCharChip; CustomCharChipGroup._configureCustomCharChip = function(groupArray) { alias1.call(this, groupArray); groupArray.push(CustomCharChip.Anime); }; CustomCharChip.Anime = defineObject(BaseCustomCharChip, { _dynamicAnime: null, _animeData: null, initialize: function() { // マップ上での描画とメニュー上での描画でオブジェクトを変更する this._dynamicAnime = createObject(DynamicAnimeEx); this._animeSimple = createObject(NonBattleAnimeSimple); }, setupCustomCharChip: function(unit) { var pos; var anime = this._getTargetAnime(unit); if (anime === null) { return; } pos = LayoutControl.getMapAnimationPos(0, 0, anime); this._dynamicAnime.startDynamicAnime(anime, pos.x, pos.y); this._dynamicAnime.setLoopMode(true); this._dynamicAnime.getAnimeMotion().lockSound(); this._animeData = anime; }, moveCustomCharChip: function() { if (this._animeData === null) { return; } this._dynamicAnime.moveDynamicAnime(); return MoveResult.CONTINUE; }, drawCustomCharChip: function(cpData) { if (this._animeData === null) { return; } this._setDynamicAnimeColor(cpData); this._dynamicAnime.drawDynamicAnime(cpData.xPixel, cpData.yPixel); this._drawInfo(cpData.xPixel, cpData.yPixel, cpData); }, drawMenuCharChip: function(cpData) { var frameIndex; var x = cpData.xPixel; var y = cpData.yPixel; if (this._animeData === null) { return; } if (cpData.unit.getDirection() === DirectionType.NULL) { x += this._getMenuOffsetX(); y += this._getMenuOffsetY(); frameIndex = this._dynamicAnime.getAnimeMotion().getFrameIndex(); this._dynamicAnime.getAnimeMotion().setFrameIndex(this._getFrameIndex(), false); } this._setDynamicAnimeColor(cpData); this._dynamicAnime.drawDynamicAnime(x, y); this._drawInfo(x, y, cpData); if (cpData.unit.getDirection() === DirectionType.NULL) { this._dynamicAnime.getAnimeMotion().setFrameIndex(frameIndex, false); } }, getKeyword: function() { return 'animation'; }, _setDynamicAnimeColor: function(cpData) { var colorIndex = cpData.unit.getUnitType(); if (cpData.unit.isWait()) { colorIndex = 3; } this._dynamicAnime.getAnimeMotion().getAnimeRenderParam().motionColorIndex = colorIndex; }, _drawInfo: function(x, y, cpData) { // HPゲージを描画する位置を決定する。 // エフェクトによって最適な位置は異なる。 this._drawHpGauge(x, y + 10, cpData); this._drawStateIcon(x, y - 20, cpData); }, _getTargetAnime: function(unit) { var id = this._getOriginalAnimeId(unit); var list = root.getBaseData().getEffectAnimationList(false); return list.getDataFromId(id); }, _getOriginalAnimeId: function(unit) { if (unit.getClass().custom.animationId === 'undefined') { return 0; } return unit.getClass().custom.animationId; }, _getMenuOffsetX: function() { // メニュー上での描画位置を決定する。 // エフェクトによって最適な位置は異なる。 return 0; }, _getMenuOffsetY: function() { return 0; }, _getFrameIndex: function() { // ユニットメニューではエフェクトはアニメーションしないので、どのフレームを表示するか指定する return 0; }, _getSpriteIndex: function() { return 0; } } ); var DynamicAnimeEx = defineObject(DynamicAnime, { drawDynamicAnime: function(xPixel, yPixel) { if (this._motion === null) { return; } this._motion.setSpriteOffset(xPixel, yPixel); this._motion.drawMotion(0, 0); } } ); })();
1 下一页