DoubleX RMVXA Intercept Magic


DoubleX RMVXA Intercept Magic  v1.03b
​


by DoubleX
​




Introduction


Allows users to set states that intercepts magic under some conditions(similar to FF6's Runic command)

Spoiler
 




#------------------------------------------------------------------------------|
# * Notetag <intercept tier: x> for skills and states: |
# - Allows battlers having states with this notetag to intercept skills with|
# this notetag(x must be greater than 0 in order for this notetag to work)|
# - If the intercept tier of the states is greater than or equal to that of |
# the skills, those skills will be intercepted if other conditions are met|
# - If more than 1 battler can intercept a skill, the one having any |
# intercept state for the shortest time will intercept the skill |
# - This notetag needs <ally intercept> or <enemy intercept> to be present |
# to work(they can be used together to let any battler be the interceptor)|
#------------------------------------------------------------------------------|
# * Notetag <intercept mp> for skills and states: |
# - Interceptors having states with this notetag absorb mp equal to the mp |
# cost of the skills intercepted if those skills also have this notetag |
# - Put this notetag below <intercept tier: x> to make this notetag work |
#------------------------------------------------------------------------------|
# * Notetag <intercept tp> for skills and states: |
# - Interceptors having states with this notetag absorb tp equal to the tp |
# cost of the skills intercepted if those skills also have this notetag |
# - Put this notetag below <intercept tier: x> to make this notetag work |
#------------------------------------------------------------------------------|
# * (v1.02a+)Notetag <hit intercept mp> for skills and states: |
# - Failed interceptions due to Intercept_MP_Limit will cause the skill to |
# only hit the interceptor if both the skills and states have this notetag|
#------------------------------------------------------------------------------|
# * (v1.02a+)Notetag <hit intercept tp> for skills and states: |
# - Failed interceptions due to Intercept_TP_Limit will cause the skill to |
# only hit the interceptor if both the skills and states have this notetag|
#------------------------------------------------------------------------------|
# * (v1.03a+)Notetag <ally intercept> for skills and states: |
# - Interceptors having states with this notetag can intercept skills with |
# this notetag if their users are allies and other conditions are met |
# - Putting this notetag above <enemy intercept> means allies will always |
# intercept the skills if enemies can also intercept them |
# - The ordering of <ally intercept> and <enemy intercept> in skills to be |
# intercepted will be used if intercepting states also has those notetags |
# - Put this notetag below <intercept tier: x> to make this notetag work |
#------------------------------------------------------------------------------|
# * (v1.03a+)Notetag <enemy intercept> for skills and states: |
# - Interceptors having states with this notetag can intercept skills with |
# this notetag if their users are enemies and other conditions are met |
# - Putting this notetag above <ally intercept> means enemies will always |
# intercept the skills if allies can also intercept them |
# - The ordering of <ally intercept> and <enemy intercept> in skills to be |
# intercepted will be used if intercepting states also has those notetags |
# - Put this notetag below <intercept tier: x> to make this notetag work |
#------------------------------------------------------------------------------|
# * (v1.03a+)Notetag <intercept chance: x> for skills and states: |
# - Interceptors having states with this notetag have a x% chance to |
# intercept skills that can be intercepted if other conditions are met |
# - Skills that can be intercepted with this notetag have a x% chance to be |
# intercepted by interceptors if other conditions are met |
# - The real chance of success is that of intercepting states multiplied by |
# that of skills to be intercepted |
# - If this notetag is absent, the chance of success will be 100% |
#------------------------------------------------------------------------------|

#------------------------------------------------------------------------------|
# * (v1.01a+)Intercept_Animation_Id, default = 0 |
# Animations with id Intercept_Animation_Id will be played upon interception|
# if 0 < Intercept_Animation_Id < 1000 |
#------------------------------------------------------------------------------|
Intercept_Animation_Id = 0

#------------------------------------------------------------------------------|
# * Intercept_SE, default = RPG::SE.new(File, Volume, Pitch) |
# SE file File with volume Volume and pitch Pitch will be played upon |
# successful interceptions |
#------------------------------------------------------------------------------|
# File is a SE file without specifying its extension and with or without
# specifying its path
# Volume and Pitch range from 1 to 100 and 5 to 200 respectively
# Setting Intercept_SE as nil or false will disable this feature
Intercept_SE = RPG::SE.new("Absorb1", 80, 100)

#------------------------------------------------------------------------------|
# * Intercept_Times_Limit, default = 0 |
# Intercept states will worn off after its battlers intercepted |
# Intercept_Times_Limit skills(0 here means no such limit) |
#------------------------------------------------------------------------------|
Intercept_Times_Limit = 0

#------------------------------------------------------------------------------|
# * (v1.02a+)Count_Fail_Intercept, default = true |
# Failed interceptions will also be counted for Intercept_Times_Limit |
#------------------------------------------------------------------------------|
Count_Fail_Intercept = true

#------------------------------------------------------------------------------|
# * Intercept_MP_Limit, default = true |
# If Intercept_MP_Limit is true and the interceptors' MP will be greater |
# than their MMP after intercepting a skill, that skill can't be intercepted|
#------------------------------------------------------------------------------|
Intercept_MP_Limit = true

#------------------------------------------------------------------------------|
# * Intercept_TP_Limit, default = true |
# If Intercept_TP_Limit is true and the interceptors' TP will be greater |
# than their max TP value after intercepting a skill, that skill can't be |
# intercepted |
#------------------------------------------------------------------------------|
Intercept_TP_Limit = true

#------------------------------------------------------------------------------|
# * Intercept_Learnt_Skill, default = true |
# Battlers can only intercept skills that they're learnt |
#------------------------------------------------------------------------------|
Intercept_Learnt_Skill = true

#------------------------------------------------------------------------------|
# * Intercept_Usable_Skill, default = true |
# Battlers can only intercept skills that they can use at the moment |
#------------------------------------------------------------------------------|
Intercept_Usable_Skill = true

#------------------------------------------------------------------------------|
# * Intercept_Learn_Skill, default = false |
# Successful interceptions causes interceptors to learn intercepted skills |
#------------------------------------------------------------------------------|
Intercept_Learn_Skill = false

#------------------------------------------------------------------------------|
# * Intercept_MCR, default = true |
# The MP absorbed by the interceptor will be the actual MP used by the users|
# of the skills intercepted If Intercept_MCR is true |
#------------------------------------------------------------------------------|
Intercept_MCR = true



Video










Features


Use of notetags(requires knowledge of notetag usage) to set specific states to let battlers intercept skills


How to use


Open the script editor and put this script into an open slot between Materials and Main. Save to take effect.


FAQ


None


Credit and Thanks


DoubleX(Giving me credit is completely optional)


No terms of use other than not claiming this script as created by anyone except DoubleX or his alias


Compatibility


Scripts aliasing or rewriting method:


- self.load_database under module DataManager
- add_state under class Game_Battler
- use_item under class Scene_Battle


may have compatibility issues with this script


Place this script above those aliasing any of these methods if possible


Changelog


v1.03b(GMT 1400 7-7-2015):


- Improved this script's efficiency and readability


v1.03a(GMT 1000 7-12-2014):


- Added <ally intercept>, <enemy intercept> and <intercept chance>notetags


v1.02b(GMT 1000 27-7-2014):


- Fixed crashes with Intercept_MP_Limit or Intercept_TP_Limit being true


v1.02a(GMT 0700 21-6-2014):


- Added <hit intercept mp> and <hit intercept tp> notetags


v1.01a(GMT 0200 8-4-2014):


- Allows users to set intercept animations


v1.00b(GMT 0900 7-4-2014):


- Fixed intercept magic not working on allies' skills bug


v1.00a (GMT 0700 5-4-2014):
 - 1st version of this script finished


(DoubleX)Intercept Magic v1.03b.rar
I think you may want to provide a proper description of what the script does and what "Intercepting" means. (before we go and look at the script itself)
This is a great script! It's basically FF6's Runic command, I have been hoping someone would make this!

That said, a couple of questions. I noticed that only spells cast by the enemy are intercepted (correct me if I'm wrong, I tried in a fresh project and that seemed to be the case). Would there be a way to make it so that ALL spells are intercepted, regardless of the caster? That would make using the ability a sort of double edged sword in that you'd be safe from enemy spells but also wouldn't be able to cast spells of your own while the state is active.

Also, and this might be asking for a bit much, but would it be possible to have an animation play when a spell is intercepted along with the sound?

Thank you!
Updates

v1.00b(GMT 0900 7-4-2014):

- Fixed intercept magic not working on allies' skills bug

I think you may want to provide a proper description of what the script does and what "Intercepting" means. (before we go and look at the script itself)
It means that my video isn't a sufficient demostration 🙂

It basically combines FF5's Blue Magic(Learn enemies' skills by letting them cast them on the learners) and FF6's Runic(Stop casted magic from being working and absorb its mp cost) with some other customizable details added.

This is a great script! It's basically FF6's Runic command, I have been hoping someone would make this!

That said, a couple of questions. I noticed that only spells cast by the enemy are intercepted (correct me if I'm wrong, I tried in a fresh project and that seemed to be the case). Would there be a way to make it so that ALL spells are intercepted, regardless of the caster? That would make using the ability a sort of double edged sword in that you'd be safe from enemy spells but also wouldn't be able to cast spells of your own while the state is active.

Also, and this might be asking for a bit much, but would it be possible to have an animation play when a spell is intercepted along with the sound?

Thank you!
It's intended to intercept allies' skills as well and the result is due to an extremely silly bug which I've tried to fix in v1.00b.

For the animations, I'll think about it but I want to make sure the bug is fixed first 😀
Just tried the new version, and everything seems to be working great, spells from allies are being intercepted now too.

Thanks for the quick reply and fix! 🙂
Updates

v1.01a(GMT 0200 8-4-2014):

- Allows users to set intercept animations
It works beautifully! Thanks so much! 🙂
=/

imagem.JPG
#------------------------------------------------------------------------------|# * Intercept_SE, default = RPG::SE.new(File, Volume, Pitch) |# SE file File with volume Volume and pitch Pitch will be played upon |# successful interceptions |#------------------------------------------------------------------------------| # File is a SE file without specifying its extension and with or without # specifying its path # Volume and Pitch range from 1 to 100 and 5 to 200 respectively # Setting Intercept_SE as nil or false will disable this feature Intercept_SE = RPG::SE.new(File, Volume, Pitch)You need to specify the File, Volume and Pitch yourself:

- File is a SE file without specifying its extension and with or without specifying its path

- Volume and Pitch range from 1 to 100 and 5 to 200 respectively

For instance:

Intercept_SE = RPG::SE.new("Absorb1", 80, 100)If you don't want to have any SE for intercepting skills, you can set Intercept_SE as nil or false. For instance:

Code:
Intercept_SE = nil
my god, I'm pretty dumb.
instruction was in my face.

xD
DoubleX, sorry, I think I'm doing something wrong.

1 - I want to make that a "state" (State X) provides this function.
Thus, put "<intercept x> tier:" notetag in the state. Correct?

2 - I will create one skill, this skill will cause the actor (user) get the "state X"

but what we put on the "X" <intercept tier: X>?

Sorry to make this kind of question, mainly because I've tested the script and it was working before, but now is not.

I tested with and without the Battle Symphony.
DoubleX, sorry, I think I'm doing something wrong.

1 - I want to make that a "state" (State X) provides this function.

Thus, put "<intercept x> tier:" notetag in the state. Correct?

2 - I will create one skill, this skill will cause the actor (user) get the "state X"

but what we put on the "X" <intercept tier: X>?

Sorry to make this kind of question, mainly because I've tested the script and it was working before, but now is not.

I tested with and without the Battle Symphony.
#------------------------------------------------------------------------------|# * Notetag <intercept tier: x> for skills and states: |# Allows battlers having states with this notetag to intercept skills with |# this notetag(x must be greater than 0 in order for this notetag to work) |# If the intercept tier of the states is greater than or equal to that of |# the skills, those skills will be intercepted if other conditions are met |# If both opponents and allies can intercept a skill, the skill will always |# be intercepted by opponents |# If more than 1 battler can intercept a skill, the one having any intercept|# state for the shortest time will intercept the skill |#------------------------------------------------------------------------------|Only skills with <intercept tier: x> can possibly be intercepted and only battlers with states having <intercept tier: y> where y >= x are possible to intercept those skills.

So x and y are to determine the tiers of the skills that can possibly be intercepted and that of the states that can possibly intercept those skills. The latter can't intercept the former if the former has a higher tier of the latter.

Therefore x and y are arbitrary natural numbers determined by you. What's important is the relationships(<= or >) between them but not their values. x > y means impossible to intercept and vice versa.

Bear in mind, though, <intercept tier: x> is only the most important but not the only condition determining whether a skill can be intercepted by a state that can intercept some skills. There are some other conditions as well:

Code:
#------------------------------------------------------------------------------|#  * Notetag <intercept mp> for skills and states:                             |#    Interceptors having states with this notetag absorb mp equal to the mp    |#    cost of the skills intercepted if those skills also have this notetag     |#    Put this notetag below <intercept tier: x> to make this notetag work      |#------------------------------------------------------------------------------|#  * Notetag <intercept tp> for skills and states:                             |#    Interceptors having states with this notetag absorb tp equal to the tp    |#    cost of the skills intercepted if those skills also have this notetag     |#    Put this notetag below <intercept tier: x> to make this notetag work      |#------------------------------------------------------------------------------|
Code:
#------------------------------------------------------------------------------|#  * Intercept_MP_Limit, default = true                                        |#    If Intercept_MP_Limit is true and the interceptors' MP will be greater    |#    than their MMP after intercepting a skill, that skill can't be intercepted|#------------------------------------------------------------------------------|  Intercept_MP_Limit = true#------------------------------------------------------------------------------|#  * Intercept_TP_Limit, default = true                                        |#    If Intercept_TP_Limit is true and the interceptors' TP will be greater    |#    than their max TP value after intercepting a skill, that skill can't be   |#    intercepted                                                               |#------------------------------------------------------------------------------|  Intercept_TP_Limit = true#------------------------------------------------------------------------------|#  * Intercept_Learnt_Skill, default = true                                    |#    Battlers can only intercept skills that they're learnt                    |#------------------------------------------------------------------------------|  Intercept_Learnt_Skill = true#------------------------------------------------------------------------------|#  * Intercept_Usable_Skill, default = true                                    |#    Battlers can only intercept skills that they can use at the moment        |#------------------------------------------------------------------------------|  Intercept_Usable_Skill = true
(Used by actor)
State: <intercept tier: 100>

(Used by 4 diferent enemy)
 

- Skill ID 51: <intercept tier: 50>

- Skill ID 55: <intercept tier: 100>

- Skill ID 59: <intercept tier: 150>
- Skill ID 63: None

Not work

----------------

Scripts--

Only "Doublex Intercept"

Cobaia.rar
(Used by actor)

State: <intercept tier: 100>

(Used by 4 diferent enemy)

- Skill ID 51: <intercept tier: 50>

- Skill ID 55: <intercept tier: 100>

- Skill ID 59: <intercept tier: 150>

- Skill ID 63: None

Not work

----------------

Scripts--

Only "Doublex Intercept"
#------------------------------------------------------------------------------|# * Intercept_MP_Limit, default = true |# If Intercept_MP_Limit is true and the interceptors' MP will be greater |# than their MMP after intercepting a skill, that skill can't be intercepted|#------------------------------------------------------------------------------| Intercept_MP_Limit = true
Code:
#------------------------------------------------------------------------------|#  * Intercept_Learnt_Skill, default = true                                    |#    Battlers can only intercept skills that they're learnt                    |#------------------------------------------------------------------------------|  Intercept_Learnt_Skill = true
Code:
#------------------------------------------------------------------------------|#  * Intercept_Usable_Skill, default = true                                    |#    Battlers can only intercept skills that they can use at the moment        |#------------------------------------------------------------------------------|  Intercept_Usable_Skill = true
Skill ID 59 and 93 are impossible to intercept by the state from the very beginning, as the former has a higher tier(150) than that of the intercept state(150), and the latter doesn't even have an intercept notetag.

Skill ID 51 and 55 can't be intercepted by Erik whose class is Guerreiro as he's full MP when he try to intercept those skills which costs 4 MP and he didn't learn them and wasn't able to use them.

As you set Intercept_MP_Limit, Intercept_Learnt_Skill and Intercept_Usable_Skill as true and those skills he's trying to intercept doesn't meet all these conditions(indeed none of them), he can't intercept them.
Now I understand! Thanks DoubleX.
Sorry for the inconvenience 😀
This is freaking awesome!  I can't wait to put this into my game! 
Question:  Since we're making this like the "Runic" skill, weren't there some spell that would not be absorbed and would instead simply target Celes and no one else?

Basically, it's a way to make Runic backfire on the user.

Can that be done with this script?
Question:  Since we're making this like the "Runic" skill, weren't there some spell that would not be absorbed and would instead simply target Celes and no one else?

Basically, it's a way to make Runic backfire on the user.

Can that be done with this script?
Let's think about the below example:

An actor has an intercept state and an enemy casts a healing spell. In the current idea of my script, if the actor can intercept it, that actor intercepts it, else the healing spell will hit the intended target.

If your idea is used as well, and if that healing spell has a high intercept tier but the actor has only a low intercept tier state, that healing spell won't be intercepted but will hit and heal that actor.

Is this within your expectation if I were to implement your idea?
Yes, I could deal with it if done that way.

I was envisioning MP being the reason the intercept fails.

So, if a fire spell gets intercepted by the actor that costs 20 MP and the actor has 200/300 MP, they take no damage and gain the 20 MP (220/300).

Now, if another fire spell gets intercepted but the actor has 290/300, the spell gets half intercepted; the actor gains half the mp they can (10 out of 20)

and the spell's power gets reduced by half and does that amount of damage.

If that is too much to script, just forcing the target to the actor attempting to intercept would work for me.

Thanks for looking into this.
Updates

v1.02a(GMT 0700 21-6-2014):

- Added <hit intercept mp> and <hit intercept tp> notetags

Yes, I could deal with it if done that way.

I was envisioning MP being the reason the intercept fails.

So, if a fire spell gets intercepted by the actor that costs 20 MP and the actor has 200/300 MP, they take no damage and gain the 20 MP (220/300).

Now, if another fire spell gets intercepted but the actor has 290/300, the spell gets half intercepted; the actor gains half the mp they can (10 out of 20)

and the spell's power gets reduced by half and does that amount of damage.

If that is too much to script, just forcing the target to the actor attempting to intercept would work for me.

Thanks for looking into this.
I've added the main feature but not the partial interception part(partial mp/tp gain or damage taken) as it's too hard and complicated for me to handle(at least uptil now) 🙂

Original thread: https://forums.rpgmakerweb.com/threads/doublex-rmvxa-intercept-magic.25762/