View Single Post
  #4    
Old August 31st, 2012 (2:18 PM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
     
    Join Date: Jan 2008
    Location: England
    Posts: 5,171
    It's best not to edit earlier posts, because people aren't likely to notice. It's especially pointless if you make a new post anyway, because you can/should just put your new question in your new post instead.

    Anyway, that include? business looks wrong. Replace every instance of this:

    Code:
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561&&564&&576&&591)
      multiplier = 2
    end
    ...with this:

    Code:
    multiplier=2 if pbHasMove?(attacker,:TACKLE) &&
                    pbHasMove?(attacker,:SANDATTACK) &&
                    pbHasMove?(attacker,:TAILWHIP) &&
                    pbHasMove?(attacker,:GROWL)
    Simpler, more readable, and it works.

    I swear I've answered this question before, many months ago. The same misuse of include?, the multiple moves with the same problem, everything.
    __________________
    Go to the Pokémon Essentials Wiki

    | Downloads | Tutorials | Fangames |
    | All Animations Project |

    Follow me on Twitter: @maruno42


    Reply With Quote