Hello,
I have a little problem which I think the solution is very simple, but I can't solve it alone. I apologize in advance for opening a topic for this.
I use a state that causes the target affected by this state to always suffer a critical hit (we'll call it state A for the example).
Here is the script for this state:
My problem is that in my game there is also a state that prevents the player from inflicting a critical hit (state B ).
For this one, I just changed the critical hit rate to -1000%.
As you will have understood, these two states come into conflict.
I would like to prioritize state B, but state A currently wins.
I think there is only one line to add, like "if the attacker is not affected by state B" but I really don't know javascript. I tried to get by with similar effects found on the internet, but it doesn't work.
Can somebody help me please ?
I have a little problem which I think the solution is very simple, but I can't solve it alone. I apologize in advance for opening a topic for this.
I use a state that causes the target affected by this state to always suffer a critical hit (we'll call it state A for the example).
Here is the script for this state:
Code:
<Custom Select Effect>
// Get the current skill
var skill = this.item();
// Check if the skill exists and can deal critical damage
if (skill && skill.damage.critical) {
// Get the previous Critical Hit settings
this._prevForcedCriticalHit = $gameSystem._forceCritical;
this._prevForcedNoCriticalHit = $gameSystem._forceNoCritical;
// Force the hit to be a critical hit
BattleManager.actionForceCritical();
}
</Custom Select Effect>
<Custom Deselect Effect>
// Check if the previous settings exist
if (this._prevForcedCriticalHit !== undefined) {
// Revert the Critical Hit settings to what they were before
$gameSystem._forceCritical = this._prevForcedCriticalHit;
$gameSystem._forceNoCritical = this._prevForcedNoCriticalHit;
}
</Custom Deselect Effect>
My problem is that in my game there is also a state that prevents the player from inflicting a critical hit (state B ).
For this one, I just changed the critical hit rate to -1000%.
As you will have understood, these two states come into conflict.
I would like to prioritize state B, but state A currently wins.
I think there is only one line to add, like "if the attacker is not affected by state B" but I really don't know javascript. I tried to get by with similar effects found on the internet, but it doesn't work.
Can somebody help me please ?