• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Custom Feature Question] Custom Function Codes Help

  • 13
    Posts
    5
    Years
    • Seen Dec 3, 2022
    Can someone help me with making a custom function code

    Effect 159 - Blue Moon
    Spoiler:


    Effect 160 - Alchemy
    Spoiler:
     
    For the first one, you can probably accomplish this by simply copying an existing terrain and just renumbering/renaming everything. Then look at the code for Power Trick (does the same stat change function you're talking about, but for Atk/Def), and use that as a guide for adding in this additional effect.

    For the second one, it sounds pretty easy, just tedious since you're probably going to have to manually write out every single item that this effect works with, since there isn't any classifications for "healing item", "damaging item", etc. that I know of. So you're probably going to have to write out a whole list for each item "type" as an array, and then write out a simple if/then statement for what happens if a Pokemon is holding each item type. Something like:

    if poketohealhere.hasWorkingItem?(HEALINGITEMS); poketohealhere.pbRecoverHP(amounthealed,true); end

    and then the same thing for the other effects, just with damage instead.
     
    Hey there :)
    I'll try to help you out with the Blue Moon Effect.

    In PBEffects add below "WonderRoom = 12"
    Spoiler:

    In PokeBattle_ActiveSideField add below "@effects[PBEffects::WonderRoom] = 0"
    Spoiler:
    In PokeBattle_Battle add this above "# Grassy Terrain"
    Spoiler:
    In PokeBattle_Move find "if @battle.field.effects[PBEffects::GrassyTerrain]>0 &&" and paste above it:
    Spoiler:
    Now to switch Attack and Special Attack stats (only for moves I guess?)
    Spoiler:
    Right now there is no way to summon the moon, so you'll have to add some yourself(moves, abilities, weather...).
    If you need any more help with this be sure to ask. :)
     
    Hey there :)
    I'll try to help you out with the Blue Moon Effect.

    In PBEffects add below "WonderRoom = 12"
    Spoiler:

    In PokeBattle_ActiveSideField add below "@effects[PBEffects::WonderRoom] = 0"
    Spoiler:
    In PokeBattle_Battle add this above "# Grassy Terrain"
    Spoiler:
    In PokeBattle_Move find "if @battle.field.effects[PBEffects::GrassyTerrain]>0 &&" and paste above it:
    Spoiler:
    Now to switch Attack and Special Attack stats (only for moves I guess?)
    Spoiler:
    Right now there is no way to summon the moon, so you'll have to add some yourself(moves, abilities, weather...).
    If you need any more help with this be sure to ask. :)

    Thank you it worked as far as i know, do you think you can figure out the alchemy move next?
     
    Effect 160 - Alchemy
    Spoiler:

    This move already exists somewhat. Its called Fling. So what you can do is look at how Fling works (it has different effects based on the item the user is holding, just like your move does) and try to implement it that way.
     
    Here you go!
    I must add that I was pretty lazy and hope it doesn't come back to bite me. I tried to get around the part where you said the item loses its effect for the rest of the battle by using the effect of the move "Corosive Gas".So long story short this move won't work if you don't have Generation 8 in your game(more specifically the move "Corrosive Gas"). Additionally the Pokemon's item functions again after switching out of battle.
    If you want to know how to implement Generation 8 moves check out this thread(https://www.pokecommunity.com/showthread.php?t=422817) otherwise ask again and I'll fix it for you.
    Just thought it would be easier this way. :)

    Quick reminder: You need to change the "YYY" to the function code of the move in your moves.txt file. Add any items you want to heal the Pokemon with to the first array and any you want to damage them with to the second.
    Spoiler:
     
    Back
    Top