Random Critical Animation v1.0
IntroductionAllows for playing a random animation when landing a crit.
How to use
Save it as APHO_RandomCriticalAnimation.js and put it in your plugin folder.
Fill the Animation List with a list of animations you'd like to play on crit, separated by a comma. (e.g. 1,2,4)
Specify when you want the animations to be mirrored.
[*]Never mirror - never mirrors the critical animation
[*]Mirror if target is actor - the animation will be mirrored only if the target is an actor (default RMMV behaviour)
[*]Mirror at random - the animation has a 50% chance of being mirrored.
You may also opt to use a different pool of animations for critical heals; if so you'll need to fill the heal animation list.
Script
Spoiler: code JavaScript:
//==========================================
// APHO_RandomCriticalAnimation.js
//==========================================
/*:
* @title Random Critical Animation
* @author Apho
* @plugindesc v1.0 Allows for playing a random animation when landing a crit.
*
* @param AnimList
* @text Animation List
* @type string
* @desc Pool of animation IDs to play on crit. Separate values with a comma.
*
* @param MirrorAnim
* @text Mirror Animations
* @type select
* @option Never mirror
* @value 0
* @option Mirror if target is actor
* @value 1
* @option Mirror randomly
* @value 2
* @desc When should critical animations be mirrored?
* @default 0
*
* @param AnimDelay
* @text Animation Delay
* @type number
* @desc Delay before the animation is played, in frames.
* @default 0
*
* @param HealAnim
* @text Crit Heal Animations
* @type select
* @option No animation
* @value 0
* @option Same as regular crits
* @value 1
* @option Use custom pool (defined below)
* @value 2
* @desc Should critical heals have an animation?
* @default 2
*
* @param HealAnimList
* @text Animation List (Heal)
* @type string
* @desc Pool of animation IDs to use for a crit heal. Separate values with a comma.
*
* @help
* Allows for playing a random animation on the target when landing a crit.
* Critical heals may optionally have their own animation pool.
*
* TERMS OF USE
* - Free for commercial and non-commercial use, as long as I get a free copy
* of the game.
* - Edits allowed for personal use.
* - Do not repost or claim as your own, even if edited.
*
* VERSION HISTORY
* v1.0 - 2023/7/10 - Initial release.
*/
(function(){
var parameters = PluginManager.parameters('APHO_RandomCriticalAnimation');
var AnimList = parameters['AnimList'].split(",").map(Number);
var MirrorAnim = parseInt(parameters['MirrorAnim']);
var AnimDelay = parseInt(parameters['AnimDelay']);
var HealAnim = parseInt(parameters['HealAnim']);
var HealAnimList = parameters['HealAnimList'].split(",").map(Number);
const Game_Action_apply = Game_Action.prototype.apply;
Game_Action.prototype.apply = function(target){
Game_Action_apply.call(this, target);
if(target.result().critical && $gameParty.inBattle())
{
let AnimToPlay = 0;
if(!this.isRecover() || HealAnim == 1)
{
AnimToPlay = AnimList
}else if(this.isRecover() && HealAnim == 2)
{
AnimToPlay = HealAnimList
}
if(AnimToPlay > 0)
{
let Mirror;
switch(MirrorAnim)
{
case 0:
Mirror = target.isActor();
break;
case 1:
Mirror = false;
break;
case 2:
Mirror = Math.random() < 0.5;
break;
}
target.startAnimation(AnimToPlay, Mirror, AnimDelay);
}
}
}
})();
Terms of use
[*]Free for commercial and non-commercial use, as long as I get a free copy of the game.
[*]Edits allowed for personal use.
[*]Do not repost or claim as your own, even if edited.
[*]Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
Version history
v1.0 - 2023/7/10- Initial release.
Download link
GitHub
本贴来自国际rpgmaker官方论坛作者:AphoticAmaranth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/random-critical-animation-v1-0.159163/
页:
[1]