• 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.

Skydrop?

296
Posts
9
Years
Do you need to set the SkyDrop effect on the attacker if there will now be a SkyDropAttacker effect?

Also, I think you should go link your post over in the bugs thread now, for completeness sake. (Not sure how Murano does his bug tracking, but if it's that thread, it should be there).

We need to set SkyDropAttacker effect to the attacker to differentiate those who suffer the hit by those who inflicts. Anyways, I think that Maruno will read this thread and will move it in the correct section, if it's needed.
 
Last edited:
87
Posts
8
Years
  • Age 27
  • Seen Jul 24, 2016
We need to set SkyDropAttacker effect to the attacker to differentiate those who suffer the blow by those who inflicts. Anyways, I think that Maruno will read this thread and will move it in the correct section, if it's needed.

Ty for the solution I will try to make it work :D

I think that i found a valid solution.

The problem is that, when a Pokémon uses SkyDrop, it sets the opponent SkyDrop effect to true, and its TwoTurneffect to the move's index (163). When the second part of the attack starts, the game check if the move can fail. Unfortunately this happens because of the line ret=true if opponent.effects[PBEffects::SkyDrop]; in fact the opponent.effects[PBEffects::SkyDrop] is equal to true. To correct this we need to create another effect, into PBEffects script section, that traces the actual state of the attacker (it's using SkyDrop, but we can't use the same effect of the opponent, that suffers that move).

Into PBEffects script section, after Yawn = 106, we need to add:
SkyDropAttacker = 107

Now, into the 0xCE PokeBattle_MoveEffect script section, we need to edit some lines:
First thing first, we need to correct the line
ret=true if opponent.effects[PBEffects::SkyDrop] to:

ret=true if opponent.effects[PBEffects::SkyDrop] && attacker.effects[PBEffects::SkyDropAttacker]==false

After this, we need to add
attacker.effects[PBEffects::SkyDropAttacker]=true after opponent.effects[PBEffects::SkyDrop]=true

And then
attacker.effects[PBEffects::SkyDropAttacker]=false after opponent.effects[PBEffects::SkyDrop]=false

Now, the game checks if the opponent is in the air with the attacker before to determine if the move will fails; however, this isn't enough, because the opponent will avoid always this move. Therefore, after the following line:
override=true if USENEWBATTLEMECHANICS && thismove.function==0x06 && thismove.basedamage==0 && user.pbHasType?(:POISON)

We need to add this:
override=true if target.effects[PBEffects::SkyDrop] && user.effects[PBEffects::SkyDropIndex] && thismove.function==0xCE

I hope that this is enough and, above all, correct! :)
If I used SkydropIndex it would give me an error...instead I used SkydropAttacker and it works...even though the attack all happens in one round all rest is ok....Temporary fix for me man..ty Btw i dont know a thing about coding, ty so much
 
Last edited by a moderator:
296
Posts
9
Years
If I used SkydropIndex it would give me an error...instead I used SkydropAttacker and it works...even though the attack all happens in one round all rest is ok....Temporary fix for me man..ty Btw i dont know a thing about coding, ty so much
We're welcome. SkyDropIndex was a little personal mistake, when i was trying to code the solution: I'll update the previous post with this correction.
 
129
Posts
8
Years
  • Age 35
  • Seen Mar 23, 2023
We need to set SkyDropAttacker effect to the attacker to differentiate those who suffer the blow by those who inflicts. Anyways, I think that Maruno will read this thread and will move it in the correct section, if it's needed.

Yes, of course, I understand this. I'm asking if we need the SkyDrop effect on the attacker, not the SkyDropAttacker effect. Basically, I'm asking if it would be okay if it was just (SkyDrop on target) and (SkyDropAttacker on user), instead of (SkyDrop on target AND user), and (SkyDropAttacker on only user).
 
296
Posts
9
Years
Yes, of course, I understand this. I'm asking if we need the SkyDrop effect on the attacker, not the SkyDropAttacker effect. Basically, I'm asking if it would be okay if it was just (SkyDrop on target) and (SkyDropAttacker on user), instead of (SkyDrop on target AND user), and (SkyDropAttacker on only user).
I don't think it can work, because of this section:
Code:
    if @effects[PBEffects::SkyDrop] # Intentionally no message here
      PBDebug.log("[Move failed] #{pbThis} can't use #{thismove.name} because of being Sky Dropped")
      return false
    end
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
For the record, my solution is different. It's also simpler.

In script section PokeBattle_Battler, find the following chunk of code in def pbSuccessCheck and add the red line:

Code:
      if target.effects[PBEffects::SkyDrop]
        miss=true unless thismove.function==0x08 ||  # Thunder
                         thismove.function==0x15 ||  # Hurricane
                         thismove.function==0x77 ||  # Gust
                         thismove.function==0x78 ||  # Twister
                         [COLOR=Red]thismove.function==0xCE ||  # Sky Drop[/COLOR]
                         thismove.function==0x11B || # Sky Uppercut
                         thismove.function==0x11C    # Smack Down
      end
Then in script section PokeBattle_MoveEffects, go to class PokeBattle_Move_0CE and add the red bit of code in as shown:

Code:
  def pbMoveFailed(attacker,opponent)
    ret=false
    ret=true if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
    ret=true if opponent.effects[PBEffects::TwoTurnAttack]>0
    ret=true if opponent.effects[PBEffects::SkyDrop] [COLOR=Red]&& attacker.effects[PBEffects::TwoTurnAttack]>0[/COLOR]
    ret=true if !opponent.pbIsOpposing?(attacker.index)
    ret=true if USENEWBATTLEMECHANICS && opponent.weight(attacker)>=2000
    return ret
  end
Done.
 
296
Posts
9
Years
For the record, my solution is different. It's also simpler.

In script section PokeBattle_Battler, find the following chunk of code in def pbSuccessCheck and add the red line:

Code:
      if target.effects[PBEffects::SkyDrop]
        miss=true unless thismove.function==0x08 ||  # Thunder
                         thismove.function==0x15 ||  # Hurricane
                         thismove.function==0x77 ||  # Gust
                         thismove.function==0x78 ||  # Twister
                         [COLOR=Red]thismove.function==0xCE ||  # Sky Drop[/COLOR]
                         thismove.function==0x11B || # Sky Uppercut
                         thismove.function==0x11C    # Smack Down
      end
Then in script section PokeBattle_MoveEffects, go to class PokeBattle_Move_0CE and add the red bit of code in as shown:

Code:
  def pbMoveFailed(attacker,opponent)
    ret=false
    ret=true if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
    ret=true if opponent.effects[PBEffects::TwoTurnAttack]>0
    ret=true if opponent.effects[PBEffects::SkyDrop] [COLOR=Red]&& attacker.effects[PBEffects::TwoTurnAttack]>0[/COLOR]
    ret=true if !opponent.pbIsOpposing?(attacker.index)
    ret=true if USENEWBATTLEMECHANICS && opponent.weight(attacker)>=2000
    return ret
  end
Done.
Oh... Thank you so much, Maruno. I hope, however, that you have appreciated my solution (or, at least, my trying). :)
 
Back
Top