- Joined
- Apr 12, 2017
- Messages
- 29
- Reaction score
- 5
- First Language
- English
- Primarily Uses
- RMMV
Hey, I think it's the proper place to post (not sure since I'm new here) but I'd need help for a lunatic mode of the said plugin.
Basically, I want to make a skill that give a poison to an enemy. If the enemy bear the poison as they die, a random foe will be chosen and given the state as well. (Think of something like infections)
So here's what I got:
<Reapply Ignore Turns>
<Custom Respond Effect>
//Check if the enemy is dead
if (user.hp <= 0) {
// Get a random enemy
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)]
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Respond Effect>
<Custom Action End Effect>
//Apply poison effect
var dmg = (115 + a.def * 90) + (a.atk * (0.50 + a.def * 0.005) + a.mat * (0.50 + a.def * 0.005)) * a.def;
user.gainHp(-Math.ceil(dmg * user.elementRate(8)));
user.startAnimation(146);
user.startDamagePopup();
//Check if the enemy is dead
if (user.hp <= 0) {
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Action End Effect>
This SHOULD be working, but I encounter two problems:
First, if I kill the foe without if falling for poison, like using a spell on it (first part), strictly nothing will happen. I'm trying to figure
out why, but can't seem to get it! I mean, it's literally the same as the second part without the poison.
Secondly, the most gruesome: in the second part, it only partly works. If an enemy dies from the poison, they will collapse and pass over the state to another enemy, sometimes even creating a chain. Sadly, there is ONE problem that pisses me off badly.
If there is only one other enemy when the infected enemy dies, this part never applies and I have no idea why.
if (member) {
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
The one before applies, I tried putting some random stuff in it and it does apply. So basically if there's only two enemies when the infected one dies, he just stay in place, never collapse nor pass over the state.
I think it's weird because I have a similar spell that hits one enemy then another random one. If the first hit killed the first enemy,
the randomly chosen enemy will take similar damages. I'm using a lunatic code very similar to it and never ever faced this problem, as it works perfectly if there are two enemies. Have a look:
<Post-Damage Eval>
var elementId = 3;
var damage = value;
if (target.hp <= 0){
var damage = damage * 2;}
var members = this.opponentsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
member.startAnimation(141);
member.gainHp(-Math.ceil(damage * member.elementRate(elementId)));
member.startDamagePopup();
member.clearResult();
if (member.isDead()) {
member.performCollapse();}}
</Post-Damage Eval>
Could anyone look up to it? I'd really love to get some help on that.
Basically, I want to make a skill that give a poison to an enemy. If the enemy bear the poison as they die, a random foe will be chosen and given the state as well. (Think of something like infections)
So here's what I got:
<Reapply Ignore Turns>
<Custom Respond Effect>
//Check if the enemy is dead
if (user.hp <= 0) {
// Get a random enemy
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)]
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Respond Effect>
<Custom Action End Effect>
//Apply poison effect
var dmg = (115 + a.def * 90) + (a.atk * (0.50 + a.def * 0.005) + a.mat * (0.50 + a.def * 0.005)) * a.def;
user.gainHp(-Math.ceil(dmg * user.elementRate(8)));
user.startAnimation(146);
user.startDamagePopup();
//Check if the enemy is dead
if (user.hp <= 0) {
var members = this.friendsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
//Play an animation and pass over the infections
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
</Custom Action End Effect>
This SHOULD be working, but I encounter two problems:
First, if I kill the foe without if falling for poison, like using a spell on it (first part), strictly nothing will happen. I'm trying to figure
out why, but can't seem to get it! I mean, it's literally the same as the second part without the poison.
Secondly, the most gruesome: in the second part, it only partly works. If an enemy dies from the poison, they will collapse and pass over the state to another enemy, sometimes even creating a chain. Sadly, there is ONE problem that pisses me off badly.
If there is only one other enemy when the infected enemy dies, this part never applies and I have no idea why.
if (member) {
member.startAnimation(60);
member.addState(22);
member.setAtk(user.atk);
member.setDef(user.def);
member.setMat(user.mat);
user.performCollapse();}}
The one before applies, I tried putting some random stuff in it and it does apply. So basically if there's only two enemies when the infected one dies, he just stay in place, never collapse nor pass over the state.
I think it's weird because I have a similar spell that hits one enemy then another random one. If the first hit killed the first enemy,
the randomly chosen enemy will take similar damages. I'm using a lunatic code very similar to it and never ever faced this problem, as it works perfectly if there are two enemies. Have a look:
<Post-Damage Eval>
var elementId = 3;
var damage = value;
if (target.hp <= 0){
var damage = damage * 2;}
var members = this.opponentsUnit().aliveMembers();
members.splice(members.indexOf(target), 1);
var member = members[Math.floor(Math.random() * members.length)];
if (member) {
member.startAnimation(141);
member.gainHp(-Math.ceil(damage * member.elementRate(elementId)));
member.startDamagePopup();
member.clearResult();
if (member.isDead()) {
member.performCollapse();}}
</Post-Damage Eval>
Could anyone look up to it? I'd really love to get some help on that.


