Lunatic Mode Help: Repeat skill if target dies

Joined
Jan 4, 2020
Messages
2
Reaction score
0
First Language
Indonesian
Primarily Uses
RMMV
Hello everyone, i need help to make a skill that will repeat itself to another target if the current target dies.

For example, i use the skill to kill enemy A, if the enemy A dies, i will perform the skill again to random alive enemies.

I came up with the following code:

<Post-Damage Eval>

if(target.hp <= 0){

target._immortalState = false;

target.performCollapse();

BattleManager.queueForceAction(user, 32,

$gameTroop.aliveMembers()[Math.randomInt($gameTroop.aliveMembers().length)]);

}

</Post-Damage Eval>

But the problem is, while the skill succeed to repeat itself, the dead enemy battler wont dissappear/collapse.
I tried to change target.hp <= 0 with target.isDead(), the dead enemy dissappear but the skill wont repeat.
I cant think of another way to achieve this lol, perhaps someone who is more familiar with MV can help me.

Thank you for reading.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
155
Reaction score
94
First Language
French
Primarily Uses
RMMV
Hello! I ran a few tests with this code and it seems to do as you required:
Code:
<Post-Damage Eval>
   if (target.hp <= 0 && $gameTroop.aliveMembers().length - 1 > 0) {
     target._immortalState = false;
     target.performCollapse();
     target.refresh()
     user.forceAction(X, -1)
     BattleManager.forceAction(user);
   }
</Post-Damage Eval>
*X is to be replaced by the repeated skill Id.

I suggest you test it thoroughly to see if it does behave as you want, though...
Good luck! ;)
 
Joined
Jan 4, 2020
Messages
2
Reaction score
0
First Language
Indonesian
Primarily Uses
RMMV
Been testing it, and wow it works flawlessly so far! Thank you soooooo much! @TSR :hhappy:

I have a quick question if you dont mind, do i need to put target.refresh() after i change immortalState and do target.performCollapse()?
 
  • Wow
Reactions: TSR

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
155
Reaction score
94
First Language
French
Primarily Uses
RMMV
Hello again!
I think it's better to put the refresh() so that the Battler sprite update before proceeding to the next step. When I tested it without refreshing it, the first enemy only collapse after the repeated skill was done on second enemy (looks less cool...).
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Sorry Aerith... I will abandon your shoes... :guffaw:
Spent a whole bunch of time today reworking the area in the video because someone said it was too illusory. So I reworked it so it changes less, moved the grass up to the same level as the player.... And found enough extra resources to make the grass moves when the player touches it. Also lots more water, because it looks amazing. I'll probably put up a short updated video later today.
I never noticed how NOISY birds can be in the morning..
The worst part of writing the thesis is getting to a point where it's nearly done and you feel like an 8th-grader could've written something on that level.
So ... uh ... this weekend I have to cut my husband's hair. He searched long and hard - highest mountains, deepest valleys, across vast oceans. All hairdressers are now closed. So it's me.

Forum statistics

Threads
95,765
Messages
931,706
Members
126,168
Latest member
Daruyo
Top