- Joined
- Mar 28, 2012
- Messages
- 410
- Reaction score
- 61
- First Language
- English
- Primarily Uses
I have been struggling with getting a skill working:
What happens is this skill has stacking states first checks if state 22 is applied if not applies it, and so on until state 24. This is all fine and works.
However if the enemy has state 26 it removes it and does a bonus attack, so I put a.forceAction (skillID,-2) I want the bonus attack to happen on the the enemy with state 26, but what happens is it randomly cast on an enemy or usually the same one which wasn't the one initially attacked.
Game_Battler.prototype.fire = function(a, b) {
if (a.isActor()) {
damage = 100
if (b.isStateAffected(26)) {
b.removeState(26)
SceneManager._scene._logWindow.addText("")
a.forceAction(28,-2);
BattleManager.forceAction(a);
}
else if (b.isStateAffected(23)) {
damage *= 2
b.addState(24)
b.removeState(23)
}
else if (b.isStateAffected(22)) {
damage *= 1.5
b.addState(23)
b.removeState(22)
}
else {
damage *= 1
b.addState(22)
}
damage = parseInt(damage)
return damage
}
else {
damage = 100
damage = parseInt(damage)
return damage
}
}
What happens is this skill has stacking states first checks if state 22 is applied if not applies it, and so on until state 24. This is all fine and works.
However if the enemy has state 26 it removes it and does a bonus attack, so I put a.forceAction (skillID,-2) I want the bonus attack to happen on the the enemy with state 26, but what happens is it randomly cast on an enemy or usually the same one which wasn't the one initially attacked.
Game_Battler.prototype.fire = function(a, b) {
if (a.isActor()) {
damage = 100
if (b.isStateAffected(26)) {
b.removeState(26)
SceneManager._scene._logWindow.addText("")
a.forceAction(28,-2);
BattleManager.forceAction(a);
}
else if (b.isStateAffected(23)) {
damage *= 2
b.addState(24)
b.removeState(23)
}
else if (b.isStateAffected(22)) {
damage *= 1.5
b.addState(23)
b.removeState(22)
}
else {
damage *= 1
b.addState(22)
}
damage = parseInt(damage)
return damage
}
else {
damage = 100
damage = parseInt(damage)
return damage
}
}
