Hello everyone,
I'm trying to create a certain type of plant boss that has a weird trick.
There's three of the same plant enemy that starts off the battle, but once one of the plants die, it revives with full health after 3 turns.
This means the player will have to kill all three of them before they can revive.
How would I accomplish this exactly?
I'm not sure if it's possible without scripts, so if anyone knows one I could use, could you direct me to it?
Thanks.
Tricky but doable without scripts. Will require 3 variables. Here's how I'd do it, all in troop events.
Page 1: On turn 0 (start of battle) add the state immortal to all the enemies. If you don't have that state, create one, and in it make it such that whomever has the state has state resist: KO. Set no conditions for when it removes, as we will only remove this state manually.
Page 2: Run if enemy 1 is <= 0% HP. If so, remove the state immortal, store the number 3 in a variable (note which variable, call it plant 1 revive timer or something), and add the state KO to the first enemy.
Page 3: Same thing as page 2, but for plant 2. Use a different variable than in page 2.
Page 4: Same thing as page 2, but for plant 3. Use a different variable than in page 2 and 3 (so you should have 3 variables total, one for each plant).
Page 5: Set this one to run at the start of every turn (turn 1 + 1 * X will do it). Have it subtract one from each of the variables you used in pages 2 - 4, then run a condition check in the page. If plant 1 revive == 0, revive the plant, and add the state immortal back to the plant. Then, below that run a conditional branch to check if plant 2 revive == 0, then another one for plant 3 revive.
Should work as stated here. The important step is adding the state immortal to the enemies, because without it, the condition check if enemy 1 HP is <= 0% will never return true, as enemy 1 will cease to exist before the troop event gets a chance to run.
Definitely possible using Troop eventing. Not easy, but not terribly difficult. No plugins needed. Create a separate variable for each enemy and call it something like "Turns after KO: First Plant". For each enemy, have a troop event page (with scope 'Turn') that runs at the end of each turn if that enemy's HP is 0% (or less). In the event body, increase the "Turns after KO" variable for that plant by 1, and then have a Conditional Branch check its value to see whether it's greater than or equal to 4 (not 3 because we are incrementing the variable even on the turn that the Plant gets KO'ed). If it is >= 4, then set the variable back to 0 and do a Recover All on that plant. Make similar troop event pages for all 3 plants, keeping in mind that they all need to use separate variables.
(Once you do the Recover All, the troop page condition is no longer met, so further event processing on that page might not run until the plant is KO'ed again - not sure about how this works. Anyhow, that's why I did the Recover All as the last thing on the page. If you want to show animations, messages, etc. when the plant respawns, you might need to make that a separate page with a "Switch" condition triggered by a Switch that is set before the Recover All.)
By the way, this is actually a really cool gimmick. I'd have fun with it, so long as I had a reasonable way to figure out when each enemy is close to be being KO'ed.
I tried bgillisp's approach first because it looked legitimate, but it didn't seem to work, even after following his instructions perfectly (I think?)
Wavelength's instructions worked out well though, and the plants are reviving themselves.
Thanks for the answers!
I'd have to check what you did, because there is no reason it shouldn't have ran, unless you don't have an immortal state. But glad one of them worked out!