//=============================================================================
// Spriteset_Battle
//=============================================================================
Yanfly.ASP3.Game_Screen_prototype_startShake = Game_Screen.prototype.startShake;
Game_Screen.prototype.startShake = function(power, speed, duration){
Yanfly.ASP3.Game_Screen_prototype_startShake.call(this, power, speed, duration);
this._randomRateX = [-1, 0, 1][Math.randomInt(3)];
this._randomRateY = [-1, 0, 1][Math.randomInt(3)];
};
Spriteset_Battle.prototype.updatePosition = function() {
var zoom = $gameScreen.zoomScale();
var clamp = BattleManager.cameraClamp();
this.scale.x = zoom;
this.scale.y = zoom;
var screenX = -1 * $gameScreen.zoomX() * zoom + Graphics.boxWidth / 2;
var screenY = -1 * $gameScreen.zoomY() * zoom + Graphics.boxHeight / 2;
if (clamp && zoom >= 1.0) {
var clampX1 = -Graphics.boxWidth * zoom + Graphics.boxWidth;
var clampY2 = -Graphics.boxHeight * zoom + Graphics.boxHeight;
this.x = Math.round(screenX.clamp(clampX1, 0));
this.y = Math.round(screenY.clamp(clampY2, 0));
} else if (clamp && zoom < 1.0) {
this.x = Math.round((Graphics.boxWidth - Graphics.boxWidth * zoom) / 2);
this.y = Math.round((Graphics.boxHeight - Graphics.boxHeight * zoom) / 2);
} else {
this.x = Math.round(screenX);
this.y = Math.round(screenY);
}
if($gameScreen._shakeDuration % 10 == 0){
$gameScreen._randomRateX = [-1, 0, 1][Math.randomInt(3)];
$gameScreen._randomRateY = [-1, 0, 1][Math.randomInt(3)];
}
this.x += Math.round($gameScreen.shake()*($gameScreen._randomRateX || 1));
this.y += Math.round($gameScreen.shake()*($gameScreen._randomRateY || 1));//震动加Y轴
};