Force action target last enemy??

Icenick

Veteran
Veteran
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
}
}
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
410
Reaction score
61
First Language
English
Primarily Uses
a.forceAction(28, BattleManager._action._targetIndex);

this seems to be the answer to my solution, this thread can be closed
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top