Project1
标题:
战斗界面垂直震动?
[打印本页]
作者:
LaVanaPordego
时间:
2023-4-9 22:29
标题:
战斗界面垂直震动?
各位大佬们,请问有没有战斗界面舞台垂直震动的插件?
排除插件:LiuYue(无效),WAY(装上核心也不行)和Olivia(地图界面有效,战斗界面失效)
作者:
夏的66rpg
时间:
2023-4-9 22:29
//=============================================================================
// ★ Screen Shake Effects ★ 1.0.0
//=============================================================================
/*:
* @plugindesc ▶动画 动画中SE触发屏幕振动[2019/07/07] 作者:Aries
* @author Aries
* @param ▶▶插件信息
* @type []
* @default ["名称: Aries_ShakeEffects","作者: Aries","版本: 2019/07/07","更新: ariesofsheratan.itch.io/001l-screen-effects","主页: ariesofsheratan.itch.io"]
* @param
*
* @help
* @param Shake Type
* @text 屏幕振动模式(全局)
* @type select
* @option 默认
* @value Standard
* @option 随机
* @value Random
* @option 水平
* @value Horizontal
* @option 垂直
* @value Vertical
* @default Random
*
* @param Shake SE
* @text 触发屏幕振动的SE文件✚
* @default Skill2
*
* @param 振动强度
* @type number
* @min 0
* @default 20
*/
/*
〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
============================================================================
--------------------------------------
〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
*/
// ★ Evaluate Parameters
var Aries = Aries || {};
Aries.P001L_SSE = {};
Aries.P001L_SSE.Param = PluginManager.parameters('Aries_ShakeEffects');
switch (String(Aries.P001L_SSE.Param["Shake Type"]).toUpperCase()) {
case 'STANDARD': Aries.P001L_SSE.ShakeType = 0; break;
case 'RANDOM': Aries.P001L_SSE.ShakeType = 1; break;
case 'HORIZONTAL': Aries.P001L_SSE.ShakeType = 2; break;
case 'VERTICAL': Aries.P001L_SSE.ShakeType = 3; break;
default: Aries.P001L_SSE.ShakeType = 1; break;
}
Aries.P001L_SSE.ShakeSE = String(Aries.P001L_SSE.Param["Shake SE"]);
var _aries_p001l_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_aries_p001l_pluginCommand.call(this, command, args);
if (command === 'AriesScreenShakeType') {
switch (args[0].toUpperCase()) {
case 'STANDARD':
Aries.P001L_SSE.ShakeType = 0;
break;
case 'RANDOM':
Aries.P001L_SSE.ShakeType = 1;
break;
case 'HORIZONTAL':
Aries.P001L_SSE.ShakeType = 2;
break;
case 'VERTICAL':
Aries.P001L_SSE.ShakeType = 3;
break;
default:
;
}
}
};
Aries.P001L_SSE.setScreenShakeType = function(type) {
switch (type.toUpperCase()) {
case 'STANDARD':
Aries.P001L_SSE.ShakeType = 0;
break;
case 'RANDOM':
Aries.P001L_SSE.ShakeType = 1;
break;
case 'HORIZONTAL':
Aries.P001L_SSE.ShakeType = 2;
break;
case 'VERTICAL':
Aries.P001L_SSE.ShakeType = 3;
break;
default:
;
}
};
// ★ Sprite_Animation
// -----------------------------------------------------------------------------
var _aries_p001l_processTimingData = Sprite_Animation.prototype.processTimingData;
Sprite_Animation.prototype.processTimingData = function(timing) {
if (timing.se != null && timing.se.name.toUpperCase() == Aries.P001L_SSE.ShakeSE.toUpperCase()) {
var shakepwr = timing.flashColor[0] * 0.03529411764705882352941176470588;
var shakespd = timing.flashColor[1] * 0.03529411764705882352941176470588;
var shakedur = Number(Aries.P001L_SSE.Param["振动强度"]);
$gameScreen.startShake(shakepwr, shakespd, shakedur);
} else {
_aries_p001l_processTimingData.call(this, timing);
}
};
// ★ Game_Screen
// -----------------------------------------------------------------------------
var _aries_p001l_gameScreen_clearShake = Game_Screen.prototype.clearShake;
Game_Screen.prototype.clearShake = function() {
_aries_p001l_gameScreen_clearShake.call(this);
this._shakeVector = new Point(0, 0);
};
var _aries_p001l_gameScreen_startShake = Game_Screen.prototype.startShake;
Game_Screen.prototype.startShake = function(power, speed, duration) {
_aries_p001l_gameScreen_startShake.call(this, power, speed, duration);
this._shakeVector = new Point(0, 0);
};
Game_Screen.prototype.shakeVector = function() {
return this._shakeVector;
};
var _aries_p001l_gameScreen_updateShake = Game_Screen.prototype.updateShake;
Game_Screen.prototype.updateShake = function() {
switch (Aries.P001L_SSE.ShakeType) {
case 0:
_aries_p001l_gameScreen_updateShake.call(this);
break;
case 1:
this.updateShakeRandom();
break;
case 2:
this.updateShakeOscillate(1, 0);
break;
case 3:
this.updateShakeOscillate(0, 1);
break;
default:
_aries_p001l_gameScreen_updateShake.call(this);
}
};
Game_Screen.prototype.updateShakeRandom = function() {
if (this._shakeDuration > 0 || this._shake !== 0) {
var shakeX = (Math.randomInt(this._shakePower) - Math.randomInt(this._shakePower)) * (Math.min(this._shakeDuration, 30) * 0.5);
var shakeY = (Math.randomInt(this._shakePower) - Math.randomInt(this._shakePower)) * (Math.min(this._shakeDuration, 30) * 0.5);
var delta = (this._shakePower * this._shakeSpeed * this._shakeDirection) / (11 - this._shakeSpeed);
if (this._shakeDuration <= 1) {
this._shake = 0;
this._shakeVector.x = 0;
this._shakeVector.y = 0;
} else {
this._shake = 0;
this._shakeVector.x = shakeX;
this._shakeVector.y = shakeY;
}
this._shakeDuration--;
}
};
Game_Screen.prototype.updateShakeOscillate = function(h, v) {
if (this._shakeDuration > 0 || this._shake !== 0) {
var delta = (this._shakePower * (2 * this._shakeSpeed) * this._shakeDirection) / 5;
if (this._shakeDuration <= 1 && this._shake * (this._shake + delta) < 0) {
this._shake = 0;
} else {
this._shake += delta;
}
if (this._shake > this._shakePower * 2) {
this._shakeDirection = -1;
}
if (this._shake < - this._shakePower * 2) {
this._shakeDirection = 1;
}
this._shakePower *= 0.9;
this._shakeDuration--;
}
};
Spriteset_Base.prototype.updatePosition = function() {
var screen = $gameScreen;
var scale = screen.zoomScale();
this.scale.x = scale;
this.scale.y = scale;
this.x = Math.round(-screen.zoomX() * (scale - 1));
this.y = Math.round(-screen.zoomY() * (scale - 1));
switch (Aries.P001L_SSE.ShakeType) {
case 0: // default
this.x += Math.round(screen.shake());
break;
case 1: // alldir
this.x += Math.round(screen._shakeVector.x);
this.y += Math.round(screen._shakeVector.y);
break;
case 2: // horiz
this.x += Math.round(screen.shake());
break;
case 3: // vert
this.y += Math.round(screen.shake());
break;
default: // default!
this.x += Math.round(screen.shake());
}
};
复制代码
作者:
中华国哥
时间:
2023-4-10 11:32
把战斗序列3关了,试试。
作者:
LaVanaPordego
时间:
2023-4-11 01:38
中华国哥 发表于 2023-4-10 11:32
把战斗序列3关了,试试。
解决了,谢谢大佬
作者:
LaVanaPordego
时间:
2023-4-11 01:40
夏的66rpg 发表于 2023-4-10 10:48
保存了,谢谢大佬!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1