Okay, I'm making a game called 'In the End', and one of the features of it are 'Summon Gems'. These are battle-exclusive items that summon a temporary party member. However, I've run into a snag. If a summoned ally appears and kills the last, or only, enemy, then they stick around, regardless of the situation. I'd have no real problem with this when it comes to bosses, because those are programmable, but random encounters make things unpleasant. (And due to Lite's limitations on the amount of events, I cannot go for a system where the enemies are in the overworld and you can see them and they have to touch you to battle you. Not without changing several key factors in several levels, and rendering them more of a boring dodge-and-grab scenario.)
Here's a screenshot of the summon.

Thank you for taking the time to look this over.
Here's a screenshot of the summon.

Thank you for taking the time to look this over.

