Make ignore enemy buff state [class and weapon]

Hi!

My game has a passive state called ‘Flight’.
This effect has a 7000% chance of avoiding enemy physical attacks. (Cannot avoid magic)
However, since the CLASS called 'Gunner', which uses weapons such as 'bow' or 'gun', is a long-range attack, I would like to ignore the 'flying' status.

Additionally, in addition to 'Gunner', some characters with the occupation 'Civilian' can also use the 'bow'.
In other words, I want to give an ignore effect to certain items as well.

Since there are enemies with different evasion abilities, it cannot simply increase the accuracy of these classes.

Could you please help?


Summary: I want to ignore certain states on the enemy.
Just give your ranged attacks a different element than "physical" I'd say.
Just give your ranged attacks a different element than "physical" I'd say.
I don't know what you mean.

Aren't there only physical, magical, and certain attributes used for evasion in the game?
The attack must be physical and not magical or certain.


1710642086609.png



Also, if the 'elemental' you mentioned is simply the part shown in the image above that can be set in the DB, it does not seem to be related to 'elemental' at the time of raising the 'evade' ability.

ex) Even if an actor uses the fire elemental to attack an enemy, he or she will not receive damage due to the enemy's 'evasion rate' as long as it is 'physical damage'.

And I forgot to write it down again.
‘Elemental’ should not be used differently.

There are unique elementals in the game, and each enemy has different resistance to that element. Additionally, actors can change their attributes by equipping them with accessories.

If the 'Gunner' class attacks with a fire elemental while the enemy has an ability that negates a fire elemental, it must be nullified.
However, if the actor has another 'elemental', it will obviously ignore this fire elemental and take damage.
This effect has a 7000% chance of avoiding enemy physical attacks.
What is the purpose of this number? Are there things the player can do to decrease it?

If your intent is that non-ranged attacks can't ever hit flying enemies, a better way to do this is to use Yanfly's Target and Selection Core plugins so that the player simply can't target flying enemies with melee attacks.

If you don't want that, or you can't afford the pack, you could use notetags from Yanfly's Skill Core to remove the enemy's state before resolving the attack with a ranged weapon, then put it back on after.
You could simply make an element called "Physical" and have the state give full dmg immunity to any skill with that element instead of the hit type "physical". Evasion rate doesn't matter in this case.

But turan's solution is another elegant way of solving it.
What is the purpose of this number? Are there things the player can do to decrease it?

If your intent is that non-ranged attacks can't ever hit flying enemies, a better way to do this is to use Yanfly's Target and Selection Core plugins so that the player simply can't target flying enemies with melee attacks.

If you don't want that, or you can't afford the pack, you could use notetags from Yanfly's Skill Core to remove the enemy's state before resolving the attack with a ranged weapon, then put it back on after.

The reason the number is high is because there are many items or skills that increase evasion and accuracy during the game.
My game has over 150 actors and currently has over 800 skills.
During a battle, up to 8 people can fight, and if their skills are used in combination, the actor's hit rate can be increased up to 1000%.
So, I gave those numbers because 'unconditional evasion' was necessary regardless of the hit rate.


The reason targeting is necessary is because it must be able to at least attempt an attack.
If an actor cannot target an enemy, some targeting skills that have the effect of removing the enemy's flight status will not be able to be used on the enemy.

[remove the enemy's state before resolving the attack with a ranged weapon, then put it back on after.]

This agenda is interesting, but still difficult to use.
There are already a few skills with similar effects, such as receiving a specific buff before attempting an attack and releasing the buff after completing the attack.
In the case of some bosses, when this 'flight' state is released, there is an event that turns on the switch and triggers, so such a method could not be adopted.
(Only the attack must be successful and the state must not be released.)
You could simply make an element called "Physical" and have the state give full dmg immunity to any skill with that element instead of the hit type "physical". Evasion rate doesn't matter in this case.

But turan's solution is another elegant way of solving it.

No, I am not hoping for ‘immunity’, I need ‘evade’. That's why it doesn't grant immunity to specific elementals.
The important thing is not 'not taking damage'.

Some skills also have effects that activate when the enemy is not hit by an attack.

Also, I can't add more elementals.
In this case, because there are enemies that grant the 'flying' status during battle, other enemies (especially bosses) may take damage even though they have complete immunity to some attributes.
(Because it does not have immunity to the added elemental attacks of 'Gunner')
During a battle, up to 8 people can fight, and if their skills are used in combination, the actor's hit rate can be increased up to 1000%.
So, I gave those numbers because 'unconditional evasion' was necessary regardless of the hit rate.
Unless you're using plugins that change it, that's not how hitting works.

The game generates a random number between 0 and 0.9 barred and compares that to the actor's hit. Unless there are also negative states that can penalize those huge numbers, having a hit over 100% does nothing.

If that hits, it generates the number again and compares that to the target's eva. Same thing is true there.

hit and eva are never compared against each other, they are two independent parameters.
Unless you're using plugins that change it, that's not how hitting works.

The game generates a random number between 0 and 0.9 barred and compares that to the actor's hit. Unless there are also negative states that can penalize those huge numbers, having a hit over 100% does nothing.

If that hits, it generates the number again and compares that to the target's eva. Same thing is true there.

hit and eva are never compared against each other, they are two independent parameters.


Yes, I didn't know at first, but later I actually found out.
So, I changed it to calculate evasion rate and hit rate directly using a plugin.
In my game, the hit rate and evasion rate are calculated as a sum.
heres another approach that could work:
with yanfly's buffs and states plugin you can attach a react effect to your flight state to set the target's action result to log a miss if the oncoming attack was physical, but wasnt made by an actor with a bow or a gun equipped (or some other criteria)
heres another approach that could work:
with yanfly's buffs and states plugin you can attach a react effect to your flight state to set the target's action result to log a miss if the oncoming attack was physical, but wasnt made by an actor with a bow or a gun equipped (or some other criteria)

Hmm... It seems like a good method.
But how do i check it?

Can you help me with a script to write down in Note?
something like this. replace the x and y for your gun and bow wtype ids
Code:
<Custom React Effect>
if (this.isPhysical() && !(user.isWtypeEquipped(x) || user.isWtypeEquipped(y)))
  target.result().missed = true;
</Custom React Effect>
something like this. replace the x and y for your gun and bow wtype ids
Code:
<Custom React Effect>
if (this.isPhysical() && !(user.isWtypeEquipped(x) || user.isWtypeEquipped(y)))
  target.result().missed = true;
</Custom React Effect>


Oh, can I write the ‘flight’ state in the notebook?
Let's give it a try.
Is it possible to check not only the weapon type but also the class called 'Gunner'?
This is because the 'Gunner' does not hold a bow as a weapon, but can use a bow as a 'skill'.
This is because the 'Gunner' does not hold a bow as a weapon, but can use a bow as a 'skill'.
i did say to replace the x and y with the IDs for the bows and guns since assumedly the gunners used guns, but to add in a check for class, youd turn the if line to this
Code:
if (this.isPhysical() && !(user.isWtypeEquipped(x) || user.isWtypeEquipped(y) || user.currentClass().id == z))
and replace the z for gunner's class id. However...

I hadnt had a chance to test the idea until now. it does produce a miss popup, but the damage is still processed. I know select effects take place before results are generated and the others are after damage is dealt, so that approach the way it is through the plugin isnt valid.

Next thought is that youd have to edit the Game_Action.apply or Game_Action.itemHit functions. you mentioned having a plugin to alter the accuracy formula. if it happens to be yanfly's hit accuracy plugin, you can adjust and work that logic into your accuracy formula through the plugin parameter
i did say to replace the x and y with the IDs for the bows and guns since assumedly the gunners used guns, but to add in a check for class, youd turn the if line to this
Code:
if (this.isPhysical() && !(user.isWtypeEquipped(x) || user.isWtypeEquipped(y) || user.currentClass().id == z))
and replace the z for gunner's class id. However...

I hadnt had a chance to test the idea until now. it does produce a miss popup, but the damage is still processed. I know select effects take place before results are generated and the others are after damage is dealt, so that approach the way it is through the plugin isnt valid.

Next thought is that youd have to edit the Game_Action.apply or Game_Action.itemHit functions. you mentioned having a plugin to alter the accuracy formula. if it happens to be yanfly's hit accuracy plugin, you can adjust and work that logic into your accuracy formula through the plugin parameter

I also tested it, and as you said, the word MISS is displayed, but the damage is applied normally, and the bad state that is activated when attacking is also given normally...

It seems difficult to directly change the accuracy of 'Bow', 'Gun', and 'Gunner class' because only the 'Flight' state must be ignored.

It's so difficult...

as you said
<Custom React Effect>
Use to activate if the attacker is not equipped with a 'bow' or 'gun' or is not a 'gunner'...
I think there might be a solution here, but it's a shame.
i did say to replace the x and y with the IDs for the bows and guns since assumedly the gunners used guns, but to add in a check for class, youd turn the if line to this
Code:
if (this.isPhysical() && !(user.isWtypeEquipped(x) || user.isWtypeEquipped(y) || user.currentClass().id == z))
and replace the z for gunner's class id. However...

I hadnt had a chance to test the idea until now. it does produce a miss popup, but the damage is still processed. I know select effects take place before results are generated and the others are after damage is dealt, so that approach the way it is through the plugin isnt valid.

Next thought is that youd have to edit the Game_Action.apply or Game_Action.itemHit functions. you mentioned having a plugin to alter the accuracy formula. if it happens to be yanfly's hit accuracy plugin, you can adjust and work that logic into your accuracy formula through the plugin parameter


How about something like this?

The 'Gunner' class is given an invisible passive that increases accuracy by 7000% when attacking 'flying' enemies.
(+Can be added to bows and guns)

1. Gunner attacks
2. 『Use the if phrase』 The enemy has flight.
3. Increases accuracy by 7000%.

How about giving this state to 'bow', 'gun', and 'gunner class'?

What script can I use in this case?


edit)
Sorry for confusing the words use [flying] and [flight]
i'm using a translator


edit+)

<Custom React Effect>
var attacker = BattleManager._subject;
if (attacker.isStateAffected(AAA) && target.isStateAffected(BB😎){
attacker.addState(CCC);
} else {
}
</Custom React Effect>

Will this possibly work?

When the attacker has state AAA assigned to a bow, gun, gunner, etc. and the target enemy has state BBB, CCC state (accuracy rate +7000%) is granted to the attacker.
I think the CCC state will be resolved if it lasts for 1 turn.

Original thread: https://forums.rpgmakerweb.com/threads/make-ignore-enemy-buff-state-class-and-weapon.166887/