So...one of the characters in my game is a summoner, of sorts. She doesn't work by summoning new actors to fight for the party, but her modus operandi is to summon little robot companions who do her bidding, help out the party, and are generally awesome and adorable. I wanted to reflect this in the gameplay itself (because character and setting should ALWAYS come through in gameplay), but doing so is pretty far beyond my meager programming capabilities, so I thought I'd ask for help. Here's how I imagine it working (both from a lore and a programming standpoint):
Basically, she uses a skill that costs 'X' mana (let's say 35) to summon a little robot friend and have it attach to an ally (allies only, by the way. That's my one rule with these things). She only has 5 of them, but they last 15 turns (the longest-lasting states in the game), and apply some pretty powerful effects. Things like zapping enemies who attack their host, applying a lot of HP and MP regen, or boosting the damage an ally does. However, she only has one of each type of robot, so when she re-casts the skill on a different target, she doesn't summon a new robot. Instead, the robot of that type will jump from its current host to the new one. This doesn't consume any of her mana, but it also doesn't reset the timer that dictates how long the robot can continue to function. Once the timer runs out, the robot "returns to its master" to recharge, and you need to spend the MP cost to send it back out.
From a programming standpoint, the easiest way to pull off this effect is probably just to have a state representing the robot (which contains the intended effect), and each time you use the corresponding skill, the following procedure occurs:
-- Is the state currently applied to any ally?
if yes:
1. Reduce the MP cost to zero.
2. Save the turn counter on the state in a temporary variable.
3. Remove the state from whichever ally currently has it (probably with a little animation, because animations woo!).
4. Apply the state to the target (also, probably, with an animation).
5. Change the state counter on the target to the saved value.
if no, the skill operates normally.
This definitely seems like something that's possible with the Lunatic Mode functions of Yanfly's Skill Core and Buffs & States Core, both of which I'm using. However, I'm not sure about the specifics of how to program this, as it's all pretty far beyond my meager programming knowledge. So if anyone who knows their stuff is willing to help me out on this, I'd seriously appreciate it!
Thanks a bunch! ^^
Basically, she uses a skill that costs 'X' mana (let's say 35) to summon a little robot friend and have it attach to an ally (allies only, by the way. That's my one rule with these things). She only has 5 of them, but they last 15 turns (the longest-lasting states in the game), and apply some pretty powerful effects. Things like zapping enemies who attack their host, applying a lot of HP and MP regen, or boosting the damage an ally does. However, she only has one of each type of robot, so when she re-casts the skill on a different target, she doesn't summon a new robot. Instead, the robot of that type will jump from its current host to the new one. This doesn't consume any of her mana, but it also doesn't reset the timer that dictates how long the robot can continue to function. Once the timer runs out, the robot "returns to its master" to recharge, and you need to spend the MP cost to send it back out.
From a programming standpoint, the easiest way to pull off this effect is probably just to have a state representing the robot (which contains the intended effect), and each time you use the corresponding skill, the following procedure occurs:
-- Is the state currently applied to any ally?
if yes:
1. Reduce the MP cost to zero.
2. Save the turn counter on the state in a temporary variable.
3. Remove the state from whichever ally currently has it (probably with a little animation, because animations woo!).
4. Apply the state to the target (also, probably, with an animation).
5. Change the state counter on the target to the saved value.
if no, the skill operates normally.
This definitely seems like something that's possible with the Lunatic Mode functions of Yanfly's Skill Core and Buffs & States Core, both of which I'm using. However, I'm not sure about the specifics of how to program this, as it's all pretty far beyond my meager programming knowledge. So if anyone who knows their stuff is willing to help me out on this, I'd seriously appreciate it!
Thanks a bunch! ^^