AP - Blocking


~ Blocking ~
​



 
​


For the latest updates please visit my blog. This is merely an introduction topic.
​


 
​


► Introduction


This plugin introduces what I call "Block Rate" and "Block Reduction". The Block Rate determines the likeliness of blocking an incoming attack. Blocking an attack basically means negating some of the incoming damage altogether. You don't necessarily need to equip a shield to block damage. Every actor has a block rate that is (by default) based on their DEF and AGI params. Of course you can change the formula or use notetags to change the Block Rate of a specific actor.


Everytime a block occurs the "Block Reduction" comes into play. This value determines the amount of damage that will be blocked. By default, this is a flat percentage (30%) but you can also use a formula or change the Block Reduction Percentage for each actor individually.


You can use this plugin with Yanfly's Status Menu! If you want to add the Block Rate and Block Reduction to the Attributes List just use “PhyBlockRate”, “MagBlockRate”, “CerBlockRate” and “blockReduction”.


► Notetags


► ACTORS, ENEMIES

Spoiler
<Physical Block Rate: x%>


Sets this actor's or enemy's physical block rate to x%.


It will then further be augmented by equipment etc.


This notetag will ignore the default plugin parameter setting.


<Magical Block Rate: x%>


Sets this actor's or enemy's magical block rate to x%.


It will then further be augmented by equipment etc.


This notetag will ignore the default plugin parameter setting.


<Certain Block Rate: x%>


Sets this actor's or enemy's certain block rate to x%.


It will then further be augmented by equipment etc.


This notetag will ignore the default plugin parameter setting.


<Block Reduction: x%>


Sets this actor's or enemy's block damage reduction to x%.


It will then further be augmented by equipment etc.


This notetag will ignore the default plugin parameter setting.


<Block Flat: x>
 Sets this actor's or enemy's flat damage reduction to x.
 It will then further be augmented by equipment etc.
 This notetag will ignore the default plugin parameter setting.


You can use a formula with the variables: user, v[x], s[x].


User refers to the battler in question, s[x] to switch x and


v[x] to variable x.



► CLASSES, WEAPONS, ARMOURS, STATES

Spoiler
<Physical Block Rate: +x%> or <Physical Block Rate: -x%>


Increases or decreases physical Block Rate by x%. Note that this is an additive


alteration of the value. It's simply added onto the current value.


<Magical Block Rate: +x%> or <Magical Block Rate: -x%>


Increases or decreases magical Block Rate by x%. Note that this is an additive


alteration of the value. It's simply added onto the current value.


<Certain Block Rate: +x%> or <Certain Block Rate: -x%>


Increases or decreases certain Block Rate by x%. Note that this is an additive


alteration of the value. It's simply added onto the current value.


<Block Reduction: +x%> or <Block Reduction: -x%>


Increases or decreases the Block Damage Reduction by x%. Note that this is an


additive alteration of the value. It's simply added onto the current value.


<Block Flat: +x> or <Block Flat: -x>
 Increases or decreases the Flat Damage Reduction by x. Note that this is an
 additive alteration of the value. It's simply added onto the current value.


You can use a formula with the variables: user, v[x], s[x].


User refers to the battler in question, s[x] to switch x and


v[x] to variable x.



► ITEMS, SKILLS

Spoiler
<Ignore Blocking>


This item/skill cannot be blocked.



► Screenshot


q2zgzcwa.png


In this picture, the enemy is using an attack that deals exactly 100 Damage. Dean is blocking though, hence the damage is reduced to 70 (30% damage reduction).


Terms of Use, Download and some more words on Usage can all be found on my blog.
Is there a way to make block work for different skill types?
Like to have high chance to block physical skills and lower chance to block magical skills?


<Block Physical Rate: 56%>


<Block Magical Rate: 25%>
Not right now but I'll look into this. 🙂
Could you tell me the symbols of both block rate and block reduction, plz?
Oh ho! Now that's a plugin I wanted to see made!


I was wondering, is it possible to have a specific SE play when an attack is blocked?
Sorry I am very new to all this. Do I have to use a plugin or can I just put in the character notes <Block Rate: + or - x%> thank you for your time.
Could you tell me the symbols of both block rate and block reduction, plz?



By symbols, do you mean the functions? The functions are actor.blockRate() and actor.blockReduction().

Oh ho! Now that's a plugin I wanted to see made!


I was wondering, is it possible to have a specific SE play when an attack is blocked?



Not yet but I'm looking into it.

Sorry I am very new to all this. Do I have to use a plugin or can I just put in the character notes <Block Rate: + or - x%> thank you for your time.



Download the plugin from my website and put it into your game's js/plugins folder. In the game add it to the Plugin List. The plugin is "basically" plug & play but you may want to adjust some plugin parameters.


The notetags you mentioned are used to alter the block rate of an actor. You could use those notetags in the notebox of a shield for example.
Thanks 
Symbols are abreviations, like atk for attack and eva for evasion.
Symbols are abreviations, like atk for attack and eva for evasion.



Block Rate and Block Reduction don't have an abbreviation. If you want to access their values, use the functions I've written down above.
Could you make it compatible with this status menu plugin?


I can add the blockRate and it will display the wrong percent value there, i have to make it display raw values insted.
Plugin updated. Some "major" changes, check your notetags!


Changelog:

Spoiler
 * V1.01
 * - [Bugfix] Fixed calculations only happening once
 * - [Bugfix] Healing will no longer be blocked
 * - [Bugfix] Block Rates will now never go below 0% or above 100%
 * - [New] Added Plugin parameters for Sound Effects and block rates
 * - [New] Changed some notetags for blocking specific hit types
 * - [New] Removed the following plugin parameters: Block Physical, Block Magical,
 *         Block Certain
 * - [New] Won't overwrite the default Yanfly function from Status Menu Core
 *         anymore.



@kovak


Not sure if I can but I'll look into that.
Well, it gives Undefined error now when i check the status menu with the new tags :v


The percentage thing is not a big deal
Edit:


Whoops, you aren't using Yanfly's Plugin, I forgot that.


The reason for your error is that the blockRate() function now needs a variable called "flag".


Replace "flag" with 0 for physical block rate, 1 for magical block rate and 2 for certain block rate.


For example: actor.blockRate(0)
Oh, i'm not using it with YEP Status Menu, i'm using it  with 





I was able to display it adding (1) at the end of the parameter
Yep sorry I forgot about that. 😀 Refresh the page, I edited my post.
Now it's all good, thx again.
I had no bugs so far, haven't tested Certain Block yet.
Alistar, could you use  Object.defineProperties so it will allow DreamX to improve his plugin?
It will allow people to display block values in the equip menu if they want to.
Sweet script but didn`t have time to test it, reminds me of Mr.Bubble block script for Ace.

How about every time an attack gets blocked, a popup above the blocker pops with a short message? eg; "Blocked"
@kovak


I'm looking into it.


@Farr


Not sure if that's feasible with no other plugins. That's a territory I haven't explored so far.

Original thread: https://forums.rpgmakerweb.com/threads/ap-blocking.66052/