SO I've got a really nice combo system pretty well implemented in my RPG, and as the project moves further along Ive added more powerful attacks that are meant as stuns and/or finishers and really have a lot of weight to them. So what I'd really like is a way to make a Passive State to replicate the effect from Kingdom Hearts 2 onwards bosses have that makes them unable to be killed EXCEPT with Finishers, preferably by tying in skills to a "Finisher" element. How would I go about setting this up???
Basically, what I was hoping to do was create a Finisher element that I can plug into certain moves, so I can make sure certain bosses are weaker or more resistant to the damage of those specific moves themselves and incentivize racking up higher combos first, but having them still only be outright killed when hit with the Finisher element itself and hanging on with 1 HP otherwise. I'm using the default MV battle system with a majority of Yanfly's plugins currently plugged-in, along with the Active Chain Skills by VisuStella powering the combo system itself. If theres a solution NOT involving Element damage (maybe something Switch or Variable related or another way to build a State to respond right?) thats great, but again, I definitely would love to have this effect tied to taking damage from a specific Element for the purposes of tying well into the rest of the balancing of the game in general. But at this point, as long as I get the mechanic working right, I don't mind if its not tied to Element damage, I just thought that might be the easiest way to go, all things considered.
If anyone could help me out with this I'd really appreciate it!!! For the most part my project is really coming along at a steady pace, but theres always a few things that slow me down as I'm learning Javascript along the way, and there always seems to be something I just BARELY miss a lot of the time LOL.
P.S. before anyone links the page, I'm quite aware there is a Yanfly code called "Greater Undead" , that supposedly works this way using the Buffs & States Core and Auto Passive Effects plugins, but it's never worked right for me on it's own as-is OR after trying to tweak it further for my own project. That's part of WHY I'm making this post, to try and remedy that. Maybe I'm doing something wrong, but also it's not the first time something from Yanfly's "MV Tips & Tricks" page has had to be more heavily modified to work as intended with my projects. Admittedly I pretty much just went the lazy route this time (literally just took out the part of the code that made them take damage on healing effects like an Undead and replaced instances of the word "undead" with "finisher" tbh) but anyways heres what I had so far. If anyone can give it a once over I'd love the assist!!!
Basically, what I was hoping to do was create a Finisher element that I can plug into certain moves, so I can make sure certain bosses are weaker or more resistant to the damage of those specific moves themselves and incentivize racking up higher combos first, but having them still only be outright killed when hit with the Finisher element itself and hanging on with 1 HP otherwise. I'm using the default MV battle system with a majority of Yanfly's plugins currently plugged-in, along with the Active Chain Skills by VisuStella powering the combo system itself. If theres a solution NOT involving Element damage (maybe something Switch or Variable related or another way to build a State to respond right?) thats great, but again, I definitely would love to have this effect tied to taking damage from a specific Element for the purposes of tying well into the rest of the balancing of the game in general. But at this point, as long as I get the mechanic working right, I don't mind if its not tied to Element damage, I just thought that might be the easiest way to go, all things considered.
If anyone could help me out with this I'd really appreciate it!!! For the most part my project is really coming along at a steady pace, but theres always a few things that slow me down as I'm learning Javascript along the way, and there always seems to be something I just BARELY miss a lot of the time LOL.
P.S. before anyone links the page, I'm quite aware there is a Yanfly code called "Greater Undead" , that supposedly works this way using the Buffs & States Core and Auto Passive Effects plugins, but it's never worked right for me on it's own as-is OR after trying to tweak it further for my own project. That's part of WHY I'm making this post, to try and remedy that. Maybe I'm doing something wrong, but also it's not the first time something from Yanfly's "MV Tips & Tricks" page has had to be more heavily modified to work as intended with my projects. Admittedly I pretty much just went the lazy route this time (literally just took out the part of the code that made them take damage on healing effects like an Undead and replaced instances of the word "undead" with "finisher" tbh) but anyways heres what I had so far. If anyone can give it a once over I'd love the assist!!!
Code:
<Custom Passive Condition>
// Check if the finisher death flag has not been triggered
condition = !user._finisherDeath;
</Custom Passive Condition>
<Custom Respond Effect>
// Check if the target's HP is 0 or less
if (target.hp <= 0) {
// Get this action's elements
var elements = this.getItemElements();
// Create a list of the elements that can kill this boss
var killingElements = [19, 20];
// Set the initial kill flag to false
var killed = false;
// Loop through the killing elements
while (killingElements.length > 0) {
// Get the currently looped killing element
var elementId = killingElements.shift();
// Check if the action's elements have a killing element
if (elements.contains(elementId)) {
// If it does, set the kill flag to true
killed = true;
}
}
// Check if the kill flag has activated
if (killed) {
// Set the finisher death flag to true
target._finisherDeath = true;
// Refresh the target
target.refresh();
} else {
// Otherwise, set the target's HP to 1
target.setHp(1);
}
}
</Custom Respond Effect>