Passive effect help!

So how exactly do I make a passive effect? (Like Pokémon special abilities for example) I wanted to make one that lets a character's attack strength grow the lower their health gets, is this possible?
I think we need to separate out the two elements.

The first problem is that it is not possible to change parameters on the fly without a script.  It is very easy to do a skill which increases the attack with lower health, that can be done in the damage formula.  So using the default damage formula as an example, this would give you 1% increase in damage for every 1% loss of HP.

[SIZE=10.5pt]a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/a.mhp)[/SIZE]

[SIZE=10.5pt][/SIZE]

If you want it to apply a different percentage then you need to alter the final part of the formula.  So, for example, to have 1% increase for every 2% HP loss, it would read:

[SIZE=10.5pt]a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/(a.mhp/0.5))[/SIZE]

[SIZE=10.5pt]The tricky part is making that sort of alteration a passive condition.  I only know of a script for passive states, not passive skills.  There is a long-winded way that I can think of.[/SIZE]

You could put that formula (obviously changing the damage part of the formula as appropriate)  for every skill.  And use Vlue's Set Guard/Attack script to allocate a different skill than skill #1 in the data base for that character's ordinary attack.  That way it will operate no matter what action the character is given.

If that is not what you were asking, then please be more descriptive.  You cannot assume that everyone has played the same games as you.  I, like a huge swathe of the population, have never played Pokemon, so I'm having to guess what a Pokemon special ability is.

[SIZE=10.5pt][/SIZE]
I think we need to separate out the two elements.

The first problem is that it is not possible to change parameters on the fly without a script.  It is very easy to do a skill which increases the attack with lower health, that can be done in the damage formula.  So using the default damage formula as an example, this would give you 1% increase in damage for every 1% loss of HP.

a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/a.mhp)



If you want it to apply a different percentage then you need to alter the final part of the formula.  So, for example, to have 1% increase for every 2% HP loss, it would read:

a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/(a.mhp/0.5))

The tricky part is making that sort of alteration a passive condition.  I only know of a script for passive states, not passive skills.  There is a long-winded way that I can think of.

You could put that formula (obviously changing the damage part of the formula as appropriate)  for every skill.  And use Vlue's Set Guard/Attack script to allocate a different skill than skill #1 in the data base for that character's ordinary attack.  That way it will operate no matter what action the character is given.

If that is not what you were asking, then please be more descriptive.  You cannot assume that everyone has played the same games as you.  I, like a huge swathe of the population, have never played Pokemon, so I'm having to guess what a Pokemon special ability is.

In other words, an ability that triggers under certain conditions, and an example of a Pokémon ability, let's take static for instance, that ability has a 30% chance to paralyze whoever makes physical contact, such as biting, punching, kicking, etc.

But anyway, the point is, it's an ability that triggers under certain conditions.
Actually the example you made can also be solved via formula. Assuming you want to paralyze the caster with a 30% chance upon physical contact you can just add

if rand(10)<3 a.add_state(x); end;to your damage formula. In this case x is the ID of your Paralysis state and "rand(10)<3" means that you generate a random number between 0 and 10 and if it is 0, 1 or 2 the user is paralyzed.

This way the skill inflicts Paralysis. Now you want to inflict paralysis only upon physical contact, and then you should add this only to physical skills.

Doing so allows every single physical skill to inflict paralysis to the user with a 30% chance. A way to do it only when the target has the condition you want ("Static ability") is to create a state called "Static" and check it in the formula.

r=damage_formula; b.state?(y) ? (if rand(10)<3 a.add_state(x); end; r) : rIn this case x is the ID of your Paralysis state and y is the ID of your Static state.

You can do this for every "passive" skill that works this way. If you need more characters then those allowed by the formula box you can add a scriptlet with custom all the cuscom formulae you need.
You could call a common event. Have each skill call a common event like "look for passive" or something.

So every physical attack would also call the common event as part of it's attack.

Then the common event would check to see if the pokemon has a specific skill (or state). If so, then it would check the random number to see if the attack causes the secondary attack.

This way, the pokemon could inflict paralyze with it's attack, but also people who attack the pokemon could potentially get inflicted by it's attack also.

Original thread: https://forums.rpgmakerweb.com/threads/passive-effect-help.49863/