Maruno17 / pokemon-essentials

A heavily modified RPG Maker XP game project that makes the game play like a Pokémon game. Not a full project in itself; this repo is to be added into an existing RMXP game project.
Other
208 stars 398 forks source link

Fix challenge min length #180

Closed FL- closed 2 years ago

FL- commented 2 years ago

Challenge min pokémon, combined with team/pokémon rules aren't working properly.

You can reproduce adding the below code, having the demo party and calling setRule.

def pbSomeRules
  ret = PokemonChallengeRules.new 
  ret.addTeamRule(SpeciesClause.new)
  ret.addPokemonRule(HeightRestriction.new(1))
  ret.ruleset.setNumberRange(1,6)
  return ret
end

def setRule 
  pbBattleChallenge.set("someChallenge",7,pbSomeRules)
  pbBattleChallenge.start
  print pbHasEligible?
end

In this scenario you have 2 pokémon eligible, but the script returns false, since it requires the max (6) to be eligible.