• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

How to adjust Pokemon Priority without a Pokemon Possessing an Item or Ability?

Dylanrockin

That guy
276
Posts
13
Years
    • Seen Jun 9, 2016
    So, this also is a question that I needed to raise, since this also applies to critical hits. But, I was trying to apply an increase in priority, based on your side of the field, if you had a switch activated. Now, normally this is easy to do, assuming your Pokemon possesses something the other doesn't/does. But, I wanted it to increase the priority for only my Pokemon, regardless of what it's ability or item is. I was going to use this as a way to test certain moves in varying other features related to field effects.

    That's essentially what I would like for it to do, however, this along with critical hits can only be applied, assuming your Pokemon HAS something. But, I want this to work, regardless of what you have or don't have. This has been something that I've been trying to work around for weeks, but I just can't seem to wrap my head around applying Critical Hit modifiers and priority modifiers.

    So, I was wondering how I can essentially do this, without having my Pokemon hold anything or have any sort of ability.
     
    Last edited:

    Telemetius

    Tele*
    267
    Posts
    9
    Years
  • I took a look at how Gale Wings works so I found this piece of code:

    Code:
    p=thismove.priority
        if USENEWBATTLEMECHANICS
          p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
          p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
        end

    This is just guessing but you could try adding:

    Code:
    p=thismove.priority
        if USENEWBATTLEMECHANICS
          p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
          p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
          [COLOR="Red"]p+=1 if $game_switches[XX]==true [/COLOR]
        end

    The problem is that if this works it will probably boost every single pokémon's priority unless you add something to filter the targets of the buff using "&& user.hasWorkingAbility(:BLABLABLA)" or "&& user.hasWorkingItem(:XXXXXYYYY)" or you find a smarter way.

    EDIT: Maybe you could try using "&& pbIsOpposing?(1)"
     
    Last edited:

    Dylanrockin

    That guy
    276
    Posts
    13
    Years
    • Seen Jun 9, 2016
    I took a look at how Gale Wings works so I found this piece of code:

    Code:
    p=thismove.priority
        if USENEWBATTLEMECHANICS
          p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
          p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
        end

    This is just guessing but you could try adding:

    Code:
    p=thismove.priority
        if USENEWBATTLEMECHANICS
          p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
          p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
          [COLOR="Red"]p+=1 if $game_switches[XX]==true [/COLOR]
        end

    The problem is that if this works it will probably boost every single pokémon's priority unless you add something to filter the targets of the buff using "&& user.hasWorkingAbility(:BLABLABLA)" or "&& user.hasWorkingItem(:XXXXXYYYY)" or you find a smarter way.


    That's the thing though. I've tried exactly what you did, and trying to think of a way to filter it only to my side of the field. Using a switch for this and critical hits works differently than with other stat modifiers. Because, this will only give increased priority to everything in battle, as opposed to just your side.

    I don't know if @battlers[0].pbOwnedByPlayer(@index) will work, because it comes up with an error each time I try something related to that. I'm just not sure what, though... I've been attempting to figure this out for weeks now, and I feel like there is something that I'm missing. I'd rather not have this tied to an ability or an item, because this is mainly just for testing purposes.

    I also tried:

    p+=1 if @battle.sides[0] but that also does nothing, and it still increases everyone's priority, and not just my side. I tried the pbisOpposing one and it didn't do anything either... How weird, because that technically does make sense. But, it doesn't apply it me, it only applies it to something that possesses something.

    The only sure-fire way for this to work is if I can use the @battle with a method. But the thing is, I can't use any methods with @battle in priority or in critical hits for some reason.
     
    Last edited:

    Dylanrockin

    That guy
    276
    Posts
    13
    Years
    • Seen Jun 9, 2016
    The main problem that I'm currently having, at the moment, is that I cannot use any @battle commands, that are paired with methods, which makes this a real pain in the neck. If only there was a way for me to specify what I have that the opponent doesn't have, and if it's only on my side of the field.


    Edit: I found the solution to it, and it was as much of a pain as I thought it would be.
     
    Last edited:

    Telemetius

    Tele*
    267
    Posts
    9
    Years
  • The main problem that I'm currently having, at the moment, is that I cannot use any @battle commands, that are paired with methods, which makes this a real pain in the neck. If only there was a way for me to specify what I have that the opponent doesn't have, and if it's only on my side of the field.


    Edit: I found the solution to it, and it was as much of a pain as I thought it would be.

    Glad you found it :)
    If you want to share what method you used with the forum then you could help whoever might need to do it in the future.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Code:
    p=thismove.priority
        if USENEWBATTLEMECHANICS
          p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
          p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
          [COLOR=Red]p+=1 if $game_switches[XX]==true [/COLOR]
        end
    Note that this particular code is in def pbSuccessCheck in PokeBattle_Battler. This is NOT the method which determines the turn order for each round. You want to be looking in def pbPriority in PokeBattle_Battle.

    Try this code:

    Code:
        [COLOR=Green]# Calculate each Pokémon's priority bracket, and get the min/max priorities[/COLOR]
        for i in 0...4
          [COLOR=Green]# Assume that doing something other than using a move is priority 0[/COLOR]
          pri=0
          if @choices[i][0]==1 [COLOR=Green]# Chose to use a move[/COLOR]
            pri=@choices[i][2].priority
            pri+=1 if @battlers[i].hasWorkingAbility(:PRANKSTER) &&
                      @choices[i][2].pbIsStatus?
            pri+=1 if @battlers[i].hasWorkingAbility(:GALEWINGS) &&
                      isConst?(@choices[i][2].type,PBTypes,:FLYING)
            [COLOR=Red]pri+=1 if !pbIsOpposing?(i) && $game_switches[42][/COLOR]
          end
          priorities[i]=pri
    As for critical hits, you can either increase their probability or make them certain to happen (if your cheat switch is on). Either way, look in def pbIsCritical? in PokeBattle_Move. To make critical hits certain to happen, you can actually just stick a line of code into def pbCritialOverride (make it return true if the below code). To make critical hits just more likely to happen, add an amount to c if the below code.

    The if code you want here is this:

    Code:
    if [email protected]?(attacker.index) && $game_switches[42]
    I'm using Switch 42 as an example in both of these cases (because 'tis a good number). Use your own number.
     
    Back
    Top