"Auto-Life" that deals damage

Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
So, I'm trying to adapt http://yanfly.moe/2016/05/28/tips-tricks-auto-life-rpg-maker-mv/ to deal damage to all enemies instead of reviving the character, however I'm not proficient at Java at all, so, I hope I can get some help.
Here's the code/notetag:
Code:
<Category: Bypass Death Removal>

<Custom Deselect Effect>
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
  // Play the auto-life animation on target.
  target.startAnimation(49);
  // Set the amount of HP recovered to 10%.
  var rate = 0.10;
  // Calculate the HP healed.
  var heal = Math.floor(target.mhp * rate);
  // Remove the Auto-Life state.
  target.removeState(stateId);
  // Heal the target.
  target.gainHp(heal);
  // Make the damage popup show for the heal.
  target.startDamagePopup();
  // Clear the target's results.
  target.clearResult();
}
</Custom Deselect Effect>
 

artoni

Writer, Editor
Veteran
Joined
Jan 18, 2014
Messages
115
Reaction score
162
First Language
English
Primarily Uses
RMMV
Just to understand; you want an effect to trigger, on character death, that damages all enemies?
 
Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
Just to understand; you want an effect to trigger, on character death, that damages all enemies?
Yes, I guess I should have said so more clearly right away. :LZSjoy:
 

artoni

Writer, Editor
Veteran
Joined
Jan 18, 2014
Messages
115
Reaction score
162
First Language
English
Primarily Uses
RMMV
Offhand, something like... (using the Yanfly Jump skill as reference)

// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Play the animation on target.
target.startAnimation(##);
//Select all enemies
var target = I don't know the code for selecting all enemies. If someone can please advise? (Try 1, and just make sure the skill itself targets all enemies?)
//Select skill
var skill = ###;
//Activate the action
BattleManager.queueForceAction(user, skill, target);​

Definitely have someone more versed in JS look through that, though!
 
Last edited:
Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
Offhand, something like... (using the Yanfly Jump skill as reference)

// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Play the animation on target.
target.startAnimation(##);
//Select all enemies
var target = I don't know the code for selecting all enemies. If someone can please advise? (Try 1, and just make sure the skill itself targets all enemies?)
//Select skill
var skill = ###;
//Activate the action
BattleManager.queueForceAction(user, skill, target);​

Definitely have someone more versed in JS look through that, though!
Thanks!
Let's hope someone more versed happens to look up this thread!
 
Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
I'll bump this thread, I've been sick for the last few days, but hope to get back to cracking soon!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top