A Plugin!?

Hello everyone. I haven’t had much of a chance to check yet, but I suspect there are still very few of you reading this. I apologize once again for my absence, I’m not quite ready to return yet, but I made a new plugin and figured I should show it off!

This plugin actually builds upon my very first state, the block chance. What it does, is it solidifies Block Chance (blk) as an xparam in the engine, allowing states and armors to add to it, and actors to display it as a parameter in the status screen, with some coaxing of course.

 

With this plugin, the parameter blk can be used in the same way that att, or mat, or cev, or acc can be used. In damage formulas, or evals, or enemy ai evals or whatever you want. In order to make use of it, you’ll need some other plugins that can work with custom parameters. Yanfly’s buffs/states core is what we use all the time here, and it works perfectly for this as well.

The plugin gives us the following note tag, which can be placed on an armor or on a state:

<BLOCK CHANCE: X>

X is equal to the percent chance you want the block to happen. Eg: <Block Chance: 15> will give a 15% chance to block.

We also have two other note tags that can only be placed on an armor:

<BLOCK ANIMATION: X>

<SLAM ANIMATION: X>

These tags take the id in X and show the respective animation when a shield block or a shield slam occurs. You’ll need an action sequence plugin to make use of the slam animation, but the block animation is built into our new and improved Shield Block State:

<Custom React Effect>
if (value > 0 && this.isHpEffect() && this.isPhysical()) {
  var rnd = (Math.floor(Math.random() * 99 + 1))
  var shd = target.blk
  if (rnd < shd){  
    value -= value;
      target.startAnimation(target.equips()[1].blockAnimation, true, 0);
  }
}
</Custom React Effect>

The plugin can be downloaded here. Happy building.

Added Effect Plugin

As I said when I first created this blog a little over two months ago, occasionally I will release plugins here as well as state codes.

With this weeks state, I have made the paste code simpler by including a function that performs the state animations, and calculates the amount of time waited before the damage popup automatically. It contains a couple of different versions of the same thing, which react differently when multiple animations are played, or when there are multiple targets of a state animation.

The idea of this plugin is simply to make the paste codes easier to read. It adds the following functions to the game engine, and can either be loaded as it’s own plugin, or have the code below pasted into a .js file of your own to add the functions to the game.

performStateAnimationDmg(animationId, target, damage, ele)

  • Takes the animation number provided and calculates the number of wait frame for the animation.
  • Shows the damage popup for damage, and does the elemental resistance calculation for the element on the target.
  • causes the enemy to do it’s flinch/damage pose after being hit
  • checks after damage if the target is dead, and performs collapse if so
  • checks after collapse if the enemy was the last one, and then ends the battle if true
  • if not, waits a short period and makes the target move back to position after flinching
  • Waits an extra 30 frames after the animation before the battle system continues

performStateAnimationDmg2(animationId, target, damage, ele)

  • Useful for state animations that affect multiple targets at the same time
  • Does the same thing as listed above with the following difference:
    • The waiting 30 extra frames at the end doesn’t happen, as it stacks in an aoe situation where the same animation is played on several battlers simultaneously, causing a huge wait after damage is dealt where the engine appears to hang.

performStateAnimationDmg3(animationId, target, damage, ele)

  • This version is the same as the first function, but doesn’t cause the flinching on the target, which is useful for states that do not cause damage, but still have a state animation, or for states that heal an ally using the same function, which should cause flinching.

All of this information is also in the help description of the javascript file. Please note that with the release of this plugin I will no longer be manually showing the settimeout functions used to delay the damage popup in any new added effect states, they will all make use of this plugin from today forward.

This plugin can be found here. Make sure that the filename does not change.