Hello!
So I've been working on my damage formula and have come across a problem...
This is a bit complicated so I'll do my best to describe the situation.
I have made a custom formula for Attack.
Using the formula,
My character attacks the enemy and deals 100 damage for example.
But in my game there is a skill called "Shield" that halves the damage taken.
Since I can't make the skill do this exactly (I just want to halve the damage not increase DEF),
I put a conditional on the formula that checks if the target of ''Attack'' has the "Shield" state.
if yes, it halves the result. If no,then deals normal damage.
So now instead for 100,if the enemy has "Shield" my character deals 50 damage for example.
Everything works fine,except these are not the only states in the game!
For example there is a skill called "Rage" that works like Berserk from Final Fantasy,making the character able only
to Attack and increasing attack. It reality, it multiplies the normal damage output * 1.5 .
Okay,So I made another conditional under the previous one that checks if the attacker has "Rage".
In our example, the character that dealt 100 damage,in "Rage" would deal 100* 1.5 = 150
It worked fine until I realized this:
What if the attacker has "Rage" AND the target has "Shield"??
Then it would have to be 150 / 2 = 75 damage
The question is, how do I do that?
How can I create conditionals that say for example:
if x=5 AND y=5 then do this
Is this possible or am I doing this the wrong way?
It would be a lot better if it was like this(since there are more states than these two that affect the formula):
When a. has no state and b. has no state => normal damage
When a. has no state and b. has "Shield" => normal damage / 2
When a. has "Rage" and b. has no state => normal damage * 1.5
When a.has "Rage and b. has "Shield" => (normal damage * 1.5) / 2
Is this possible? And if yes how do I do it?
This is what I've done so far:
On the Database's formula space: eval (Normal)
On an empty script page:
So I've been working on my damage formula and have come across a problem...
This is a bit complicated so I'll do my best to describe the situation.
I have made a custom formula for Attack.
Using the formula,
My character attacks the enemy and deals 100 damage for example.
But in my game there is a skill called "Shield" that halves the damage taken.
Since I can't make the skill do this exactly (I just want to halve the damage not increase DEF),
I put a conditional on the formula that checks if the target of ''Attack'' has the "Shield" state.
if yes, it halves the result. If no,then deals normal damage.
So now instead for 100,if the enemy has "Shield" my character deals 50 damage for example.
Everything works fine,except these are not the only states in the game!
For example there is a skill called "Rage" that works like Berserk from Final Fantasy,making the character able only
to Attack and increasing attack. It reality, it multiplies the normal damage output * 1.5 .
Okay,So I made another conditional under the previous one that checks if the attacker has "Rage".
In our example, the character that dealt 100 damage,in "Rage" would deal 100* 1.5 = 150
It worked fine until I realized this:
What if the attacker has "Rage" AND the target has "Shield"??
Then it would have to be 150 / 2 = 75 damage
The question is, how do I do that?
How can I create conditionals that say for example:
if x=5 AND y=5 then do this
Is this possible or am I doing this the wrong way?
It would be a lot better if it was like this(since there are more states than these two that affect the formula):
When a. has no state and b. has no state => normal damage
When a. has no state and b. has "Shield" => normal damage / 2
When a. has "Rage" and b. has no state => normal damage * 1.5
When a.has "Rage and b. has "Shield" => (normal damage * 1.5) / 2
Is this possible? And if yes how do I do it?
This is what I've done so far:
On the Database's formula space: eval (Normal)
On an empty script page:
Code:
#checks if target has "Shield"Normal = "b.state?(75) ? r = ((a.xstat.str - b.def) * (a.atk + rand(((a.level + a.atk) / 8) + 1))) / 2 : r = (a.xstat.str - b.def) * (a.atk + rand(((a.level + a.atk) / 8) + 1)) ; r"#checks if the attacker has "Rage"Normal = "a.state?(74) ? r = ((a.xstat.str - b.def) * (a.atk + rand(((a.level + a.atk) / 8) + 1))) * 1.5 : r = (a.xstat.str - b.def) * (a.atk + rand(((a.level + a.atk) / 8) + 1)) ; r"