(YEP, Steal & Snatch)Steal from an enemy just once

● ARCHIVED · READ-ONLY
Started by Gargoyle77 3 posts View original ↗
  1. Hello, everyone!

    I don't know if you're familiar with Yanfly's steal and snatch, but the thing I want to do is to make an enemy (and all the enemies of its type) invulnerable to being stolen after successfully stealing an item from them.

    To add more information, there are many things that decide if the steal ability is successful or not.

    in the plugin's parameters: BONUS FORMULA (the custom formula to determine stealing bonus rates).

    in the steal skill's notes: <Steal>, <Steal: +x%>, <Steal: -x%>

    in the enemy's notes: <Steal Item x: y%>, <Steal Resist: +x%>, <Steal Resist: -x%>

    in the state's notes: <Steal Rate: +x%>, <Steal Rate: -x%>


    I thought about applying a state to the target so it can't be affected by steal again (and then via events, make all enemies of the same type start the battle with said state), but I can't make the state prevent the enemy from being stolen again. I wish you could guide me in setting the numbers so what I want to do works.

    Thanks a lot for reading this mess!



    plugin link: http://yanfly.moe/2016/02/05/yep-66-steal-snatch/
  2. You mean you want to steal once from a bat, ever? Like, every bat in the entire world is now immune to stealing?

    I think you will have to use the "Lunatic Mode" tags.
    Spoiler
    Skill and Item Notetags:

    <Custom Steal Rate>
    rate += user.hp / user.mhp;
    rate += user.level * 0.01;
    </Custom Steal Rate>
    The ‘rate’ variable is already predefined with the default calculations. You can either add onto it or overwrite it. The ‘rate’ variable is then returned after this for rate calculation. This formula is applied for both steal and snatching.

    Item, Weapon, and Armor Notetags:

    <After Steal Effect>
    target.atk -= 10;
    user.addBuff(3, 5);
    </After Steal Effect>
    When this item, weapon, or piece of armor gets stolen, this piece of code will run affecting the target enemy it was stolen from. ‘item’ will refer to the item that was stolen. ‘target’ will refer to the target enemy the actor stole from. ‘user’ will refer to the actor stealing the item.

    For the After Steal Effect, you can flip a switch to say that this enemy ID has been stolen from.
    <After Steal Effect>
    $gameSwitches.setValue(target._enemyId + offset, true);
    </After Steal Effect>


    Then in the Custom Steal Rate, you can check if the switch is ON and set the steal rate to 0.
    <Custom Steal Rate>
    if ($gameSwitches.value(target._enemyId + offset)) {
    rate = 0;
    }
    </Custom Steal Rate>


    I didn't test this, but in theory it would work. You'll need to reserve a switch for each of your enemies, all together in a row. Replace "offset" with the starting number of your switches. (If you have 20 different types of enemies, and your reserved switches are #61 - #80, then your "offset" would be 60. For enemy ID #1, it would use 1+60 = Switch #61 to track if it's been stolen from.)
  3. Aloe Guvner said:
    You mean you want to steal once from a bat, ever? Like, every bat in the entire world is now immune to stealing?

    I think you will have to use the "Lunatic Mode" tags.

    For the After Steal Effect, you can flip a switch to say that this enemy ID has been stolen from.
    <After Steal Effect>
    $gameSwitches.setValue(target._enemyId + offset, true);
    </After Steal Effect>


    Then in the Custom Steal Rate, you can check if the switch is ON and set the steal rate to 0.
    <Custom Steal Rate>
    if ($gameSwitches.value(target._enemyId + offset)) {
    rate = 0;
    }
    </Custom Steal Rate>


    I didn't test this, but in theory it would work. You'll need to reserve a switch for each of your enemies, all together in a row. Replace "offset" with the starting number of your switches. (If you have 20 different types of enemies, and your reserved switches are #61 - #80, then your "offset" would be 60. For enemy ID #1, it would use 1+60 = Switch #61 to track if it's been stolen from.)

    Thanks, I'm starting to make it work.