MV HashakGik Bullet Hell - Boss HP Javascript

Hi.

I'm thinking about putting some bullet hell sub-levels in one of my games and am trying to come to grips with HashakGik's plugin.


I am not accustomed to using javascript and am trying to figure out how to make bosses. There are instructions that explain how to make a boss that cycles through different patterns and uses different attacks in each pattern.


However, I can't quite work out how to make it so that the pattern changes depending on the boss's hit points. For example, supposing I was trying to implement to following transitions:

"hp": 3000,
started > pattern 1: when the boss reaches its starting position,
pattern 1 > pattern 1: after 5 seconds,
pattern 1 > pattern 2: when the boss's hit points are less than 2000 after 5 seconds with a 50% chance,
pattern 2 > pattern 1: after 5 seconds,
pattern 2 > pattern 3: when the boss's hit points are less than 1000 after 5 seconds with a 50% chance,
pattern 3 > pattern 1: after 5 seconds,
(any) > dying: the current hit points are 0 (I also want to destroy the enemy bullets),
dying > (destroyed): after 5 seconds.

Does anyone who has any experience with this plugin know how to code something like this?

Again, sorry if I posted this on the wrong forum.
its more plugin support, but I dont know the plugin, or what it
exactly does, so I cannot help you there.

it's also depending what you try to achieve with the plugin,
did you download the demo and test it there to see how it's done?
and to see what effect it has?

that way, most people learn from a Demo rather than helpfile.
if you didn't download the demo yet, do so and see if you can
figure it out, if not, reply back and some might be able to help you
on the goal you want to achieve with this plugin.
Actually, it's largely immaterial now, as I have discovered a much bigger problem, which I will put in the plugin support section.

Thanks for the advice.
Moved to: Plugin Support

If the much bigger problem is still related to this plugin, you could have just added it here and gotten us to move the thread 😉
Got it sorted. All I had to do was make another value:

this.fulldamage = 0

and update it just before the damage counter was reset:

if (this.j % 60 == 0) {
this.fulldamage = (this.fulldamage + this.receivedDamage)
this.receivedDamage = 0;

Then, I could just set it as a condition during the phase changes. Something along these lines:

case "pattern 1":
if (this.j > 300) {
if (this.fulldamage > 1000) {
if (Math.random() > 0.5) {
this.changeState("pattern 2");
} else {
this.changeState("pattern 1");
}
} else {
this.changeState("pattern 1");
} else {
this.updateBossone();
}
break;
case "pattern 2":
if (this.j > 300) {
if (this.fulldamage > 2000) {
if (Math.random() > 0.5) {
this.changeState("pattern 3");
} else {
this.changeState("pattern 1");
}
} else {
this.changeState("pattern 1");
} else {
this.updateBosstwo();
}
break;
case "pattern 3":
if (this.j > 300) {
this.changeState("pattern 1");
} else {
this.updateBossthree();
}
break;
case "dying":
if (this.j > 300) {
this.destroy();
}
else if (this.j % 10 === 0) {
my.explosions.push(new my.BHell_Explosion(Math.floor(Math.random() * this.hitboxW) + this.x - this.hitboxW / 2, Math.floor(Math.random() * this.hitboxH) + this.y - this.hitboxH / 2, this.parent, my.explosions));
}
break;

Hope this helps someone else out there who fancies using this plugin.

Original thread: https://forums.rpgmakerweb.com/threads/hashakgik-bullet-hell-boss-hp-javascript.140928/