mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Removed all excess whitespace and standardized line endings.
This commit is contained in:
@@ -78,7 +78,7 @@ Events.onStepTakenTransferPossible += proc { |sender,e|
|
||||
if pbInSafari? && pbSafariState.decision==0 && SAFARI_STEPS>0
|
||||
pbSafariState.steps -= 1
|
||||
if pbSafariState.steps<=0
|
||||
pbMessage(_INTL("PA: Ding-dong!\1"))
|
||||
pbMessage(_INTL("PA: Ding-dong!\1"))
|
||||
pbMessage(_INTL("PA: Your safari game is over!"))
|
||||
pbSafariState.decision = 1
|
||||
pbSafariState.pbGoToStart
|
||||
@@ -110,7 +110,7 @@ def pbSafariBattle(species,level)
|
||||
pbPrepareBattle(battle)
|
||||
# Perform the battle itself
|
||||
decision = 0
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty),0,foeParty) {
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty),0,foeParty) {
|
||||
pbSceneStandby {
|
||||
decision = battle.pbStartBattle
|
||||
}
|
||||
@@ -120,7 +120,7 @@ def pbSafariBattle(species,level)
|
||||
pbSafariState.ballcount = battle.ballCount
|
||||
if pbSafariState.ballcount<=0
|
||||
if decision!=2 # Last Safari Ball was used to catch the wild Pokémon
|
||||
pbMessage(_INTL("Announcer: You're out of Safari Balls! Game over!"))
|
||||
pbMessage(_INTL("Announcer: You're out of Safari Balls! Game over!"))
|
||||
end
|
||||
pbSafariState.decision = 1
|
||||
pbSafariState.pbGoToStart
|
||||
@@ -135,4 +135,4 @@ def pbSafariBattle(species,level)
|
||||
Events.onWildBattleEnd.trigger(nil,species,level,decision)
|
||||
# Return the outcome of the battle
|
||||
return decision
|
||||
end
|
||||
end
|
||||
|
||||
@@ -206,7 +206,7 @@ class BugContestState
|
||||
for poke in @otherparty
|
||||
$Trainer.party.push(poke)
|
||||
end
|
||||
if !interrupted
|
||||
if !interrupted
|
||||
if @lastPokemon
|
||||
pbNicknameAndStore(@lastPokemon)
|
||||
end
|
||||
@@ -374,7 +374,7 @@ def pbBugContestBattle(species,level)
|
||||
pbPrepareBattle(battle)
|
||||
# Perform the battle itself
|
||||
decision = 0
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty),0,foeParty) {
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty),0,foeParty) {
|
||||
decision = battle.pbStartBattle
|
||||
pbAfterBattle(decision,true)
|
||||
if decision==2 || decision==5 # Lost or drew
|
||||
@@ -402,4 +402,4 @@ def pbBugContestBattle(species,level)
|
||||
Events.onWildBattleEnd.trigger(nil,species,level,decision)
|
||||
# Return false if the player lost or drew the battle, and true if any other result
|
||||
return (decision!=2 && decision!=5)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ class PBPokemon
|
||||
@move2=move2 ? move2 : 0
|
||||
@move3=move3 ? move3 : 0
|
||||
@move4=move4 ? move4 : 0
|
||||
@ev=ev
|
||||
@ev=ev
|
||||
end
|
||||
|
||||
=begin
|
||||
@@ -378,7 +378,7 @@ class BattleChallengeData
|
||||
$game_map.need_refresh=true
|
||||
if save
|
||||
pbSave(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pbGoOn
|
||||
@@ -445,7 +445,7 @@ class BattleChallenge
|
||||
self.data.numPokemon,
|
||||
self.data.battletype,self.data.mode)
|
||||
end
|
||||
return @rules
|
||||
return @rules
|
||||
end
|
||||
|
||||
def modeToRules(doublebattle,numPokemon,battletype,mode)
|
||||
@@ -466,7 +466,7 @@ class BattleChallenge
|
||||
rules.setLevelAdjustment(OpenLevelAdjustment.new(60))
|
||||
else
|
||||
rules.setRuleset(StandardRules(numPokemon,50))
|
||||
rules.setLevelAdjustment(OpenLevelAdjustment.new(50))
|
||||
rules.setLevelAdjustment(OpenLevelAdjustment.new(50))
|
||||
end
|
||||
if doublebattle
|
||||
rules.addBattleRule(DoubleBattle.new)
|
||||
@@ -547,7 +547,7 @@ class BattleChallenge
|
||||
def pbBattle
|
||||
return @bc.extraData.pbBattle(self) if @bc.extraData
|
||||
opponent=pbGenerateBattleTrainer(self.nextTrainer,self.rules)
|
||||
bttrainers=pbGetBTTrainers(@id)
|
||||
bttrainers=pbGetBTTrainers(@id)
|
||||
trainerdata=bttrainers[self.nextTrainer]
|
||||
ret=pbOrganizedBattleEx(opponent,self.rules,
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechLose,trainerdata[4]),
|
||||
@@ -620,7 +620,7 @@ def pbPlayBattle(battledata)
|
||||
battleplayer = PokeBattle_BattleArenaPlayer.new(scene,lastbattle)
|
||||
end
|
||||
bgm = BattlePlayerHelper.pbGetBattleBGM(lastbattle)
|
||||
pbBattleAnimation(bgm) {
|
||||
pbBattleAnimation(bgm) {
|
||||
pbSceneStandby {
|
||||
decision = battleplayer.pbStartBattle
|
||||
}
|
||||
@@ -950,7 +950,7 @@ def pbOrganizedBattleEx(opponent,challengedata,endspeech,endspeechwin)
|
||||
pbPrepareBattle(battle)
|
||||
# Perform the battle itself
|
||||
decision = 0
|
||||
pbBattleAnimation(pbGetTrainerBattleBGM(opponent)) {
|
||||
pbBattleAnimation(pbGetTrainerBattleBGM(opponent)) {
|
||||
pbSceneStandby{
|
||||
decision = battle.pbStartBattle
|
||||
}
|
||||
@@ -982,4 +982,4 @@ end
|
||||
|
||||
def pbIsBanned?(pokemon)
|
||||
return StandardSpeciesRestriction.new.isValid?(pokemon)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -152,14 +152,14 @@ class CombinedLevelAdjustment < LevelAdjustment
|
||||
@my=my
|
||||
@their=their
|
||||
end
|
||||
|
||||
|
||||
def getMyAdjustment(myTeam,theirTeam)
|
||||
return @my ? @my.getAdjustment(myTeam,theirTeam) :
|
||||
LevelAdjustment.getNullAdjustment(myTeam,theirTeam)
|
||||
return @my ? @my.getAdjustment(myTeam,theirTeam) :
|
||||
LevelAdjustment.getNullAdjustment(myTeam,theirTeam)
|
||||
end
|
||||
|
||||
def getTheirAdjustment(theirTeam,myTeam)
|
||||
return @their ? @their.getAdjustment(theirTeam,myTeam) :
|
||||
return @their ? @their.getAdjustment(theirTeam,myTeam) :
|
||||
LevelAdjustment.getNullAdjustment(theirTeam,myTeam)
|
||||
end
|
||||
end
|
||||
@@ -290,7 +290,7 @@ class SpeciesRestriction
|
||||
for s in specieslist
|
||||
return true if isConst?(species,PBSpecies,s)
|
||||
end
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
def isValid?(pokemon)
|
||||
@@ -313,7 +313,7 @@ class BannedSpeciesRestriction
|
||||
for s in specieslist
|
||||
return true if isConst?(species,PBSpecies,s)
|
||||
end
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
def isValid?(pokemon)
|
||||
@@ -336,7 +336,7 @@ class BannedItemRestriction
|
||||
for s in specieslist
|
||||
return true if isConst?(species,PBItems,s)
|
||||
end
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
def isValid?(pokemon)
|
||||
@@ -360,7 +360,7 @@ class RestrictedSpeciesRestriction
|
||||
for s in specieslist
|
||||
return true if isConst?(species,PBSpecies,s)
|
||||
end
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
def isValid?(team)
|
||||
@@ -426,8 +426,8 @@ end
|
||||
|
||||
module LevelRestriction; end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class MinimumLevelRestriction
|
||||
attr_reader :level
|
||||
|
||||
@@ -650,7 +650,7 @@ module NicknameChecker
|
||||
def check(name,species)
|
||||
name=name.upcase
|
||||
return true if name==getName(species)
|
||||
if @@names.values.include?(name)
|
||||
if @@names.values.include?(name)
|
||||
return false
|
||||
end
|
||||
for i in @@namesMaxValue..PBSpecies.maxValue
|
||||
@@ -774,7 +774,7 @@ class PokemonRuleSet
|
||||
end
|
||||
|
||||
# This rule checks
|
||||
# - the entire team to determine whether a subset of the team meets the rule, or
|
||||
# - the entire team to determine whether a subset of the team meets the rule, or
|
||||
# - a list of Pokemon whose length is equal to the suggested number. For an
|
||||
# entire team, the condition must hold for at least one possible subset of
|
||||
# the team, but not necessarily for the entire team.
|
||||
@@ -788,7 +788,7 @@ class PokemonRuleSet
|
||||
end
|
||||
|
||||
# This rule checks either
|
||||
# - the entire team to determine whether a subset of the team meets the rule, or
|
||||
# - the entire team to determine whether a subset of the team meets the rule, or
|
||||
# - whether the entire team meets the rule. If the condition holds for the
|
||||
# entire team, the condition must also hold for any possible subset of the
|
||||
# team with the suggested number.
|
||||
@@ -897,7 +897,7 @@ class PokemonRuleSet
|
||||
error.push(_INTL("{1} Pokémon are needed.",self.minLength)) if error && self.minLength>1
|
||||
return false
|
||||
elsif team.length>self.maxLength
|
||||
error.push(_INTL("No more than {1} Pokémon may enter.",self.maxLength)) if error
|
||||
error.push(_INTL("No more than {1} Pokémon may enter.",self.maxLength)) if error
|
||||
return false
|
||||
end
|
||||
for pokemon in team
|
||||
@@ -985,33 +985,33 @@ end
|
||||
class SoulDewBattleClause < BattleRule
|
||||
def setRule(battle); battle.rules["souldewclause"] = true; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class SleepClause < BattleRule
|
||||
def setRule(battle); battle.rules["sleepclause"] = true; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class FreezeClause < BattleRule
|
||||
def setRule(battle); battle.rules["freezeclause"] = true; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class EvasionClause < BattleRule
|
||||
def setRule(battle); battle.rules["evasionclause"] = true; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class OHKOClause < BattleRule
|
||||
def setRule(battle); battle.rules["ohkoclause"] = true; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class PerishSongClause < BattleRule
|
||||
def setRule(battle); battle.rules["perishsong"] = true; end
|
||||
end
|
||||
@@ -1464,8 +1464,8 @@ PokemonChallengeRules.new
|
||||
:LAPRAS,:DITTO,:VAPOREON,:JOLTEON,:SNORLAX,
|
||||
:ARTICUNO,:ZAPDOS,:DRAGONITE,:MEWTWO,:MEW))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 2005 Tournament Rules
|
||||
PokemonChallengeRules.new
|
||||
.addPokemonRule(BannedSpeciesRestriction.new(
|
||||
@@ -1550,7 +1550,7 @@ PokemonChallengeRules.new
|
||||
|
||||
|
||||
# Battle Time (includes animations)
|
||||
If the time runs out, the team with the most Pok<6F>mon left wins. If both teams have
|
||||
If the time runs out, the team with the most Pok<6F>mon left wins. If both teams have
|
||||
the same number of Pokémon left, total HP remaining breaks the tie. If both HP
|
||||
totals are identical, the battle is a draw.
|
||||
|
||||
@@ -1558,4 +1558,4 @@ totals are identical, the battle is a draw.
|
||||
If the player is in the process of switching Pokémon when the time runs out, the
|
||||
one that can still battle that's closest to the top of the roster is chosen.
|
||||
Otherwise, the attack on top of the list is chosen.
|
||||
=end
|
||||
=end
|
||||
|
||||
@@ -113,9 +113,9 @@ def pbGetLegalMoves2(species,maxlevel)
|
||||
deleteAll.call(moves,move2[0])
|
||||
elsif md.function=="006" && move2[1].function=="005"
|
||||
deleteAll.call(moves,move2[0])
|
||||
elsif md.function==move2[1].function && md.basedamage!=0 &&
|
||||
elsif md.function==move2[1].function && md.basedamage!=0 &&
|
||||
md.type==move2[1].type &&
|
||||
(md.totalpp==15 || md.totalpp==10 || md.totalpp==move2[1].totalpp) &&
|
||||
(md.totalpp==15 || md.totalpp==10 || md.totalpp==move2[1].totalpp) &&
|
||||
(md.basedamage>move2[1].basedamage ||
|
||||
(md.basedamage==move2[1].basedamage && md.accuracy>move2[1].accuracy))
|
||||
# Surf, Flamethrower, Thunderbolt, etc.
|
||||
@@ -130,28 +130,28 @@ def baseStatTotal(move)
|
||||
if !$baseStatTotal[move]
|
||||
$baseStatTotal[move]=pbBaseStatTotal(move)
|
||||
end
|
||||
return $baseStatTotal[move]
|
||||
return $baseStatTotal[move]
|
||||
end
|
||||
|
||||
def babySpecies(move)
|
||||
if !$babySpecies[move]
|
||||
$babySpecies[move]=pbGetBabySpecies(move)
|
||||
end
|
||||
return $babySpecies[move]
|
||||
return $babySpecies[move]
|
||||
end
|
||||
|
||||
def minimumLevel(move)
|
||||
if !$minimumLevel[move]
|
||||
$minimumLevel[move]=pbGetMinimumLevel(move)
|
||||
end
|
||||
return $minimumLevel[move]
|
||||
return $minimumLevel[move]
|
||||
end
|
||||
|
||||
def evolutions(move)
|
||||
if !$evolutions[move]
|
||||
$evolutions[move]=pbGetEvolvedFormData(move,true)
|
||||
end
|
||||
return $evolutions[move]
|
||||
return $evolutions[move]
|
||||
end
|
||||
|
||||
def moveData(move)
|
||||
@@ -173,14 +173,14 @@ end
|
||||
660-755 - 400-555 (nonlegendary)
|
||||
756-799 - 580-600 [legendary] (compat1==15 or compat2==15, genderbyte=255)
|
||||
800-849 - 500-
|
||||
850-881 - 580-
|
||||
850-881 - 580-
|
||||
=end
|
||||
|
||||
|
||||
|
||||
class BaseStatRestriction
|
||||
def initialize(mn,mx)
|
||||
@mn=mn;@mx=mx
|
||||
@mn=mn;@mx=mx
|
||||
end
|
||||
|
||||
def isValid?(pkmn)
|
||||
@@ -218,7 +218,7 @@ end
|
||||
def withRestr(rule,minbs,maxbs,legendary)
|
||||
ret=PokemonChallengeRules.new.addPokemonRule(BaseStatRestriction.new(minbs,maxbs))
|
||||
if legendary==0
|
||||
ret.addPokemonRule(NonlegendaryRestriction.new)
|
||||
ret.addPokemonRule(NonlegendaryRestriction.new)
|
||||
elsif legendary==1
|
||||
ret.addPokemonRule(InverseRestriction.new(NonlegendaryRestriction.new))
|
||||
end
|
||||
@@ -280,7 +280,7 @@ def hasMorePowerfulMove(moves,thismove)
|
||||
next if move==0
|
||||
if moveData(move).type==thisdata.type &&
|
||||
moveData(move).basedamage>thisdata.basedamage
|
||||
return true
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
@@ -368,7 +368,7 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
next if !isConst?(species,PBSpecies,:DIALGA)
|
||||
when :PASSHOBERRY
|
||||
next if !isConst?(species,PBSpecies,:STEELIX)
|
||||
when :BABIRIBERRY
|
||||
when :BABIRIBERRY
|
||||
next if !isConst?(species,PBSpecies,:TYRANITAR)
|
||||
when :HABANBERRY
|
||||
next if !isConst?(species,PBSpecies,:GARCHOMP)
|
||||
@@ -385,7 +385,7 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
when :DEEPSEATOOTH
|
||||
next if !isConst?(species,PBSpecies,:CLAMPERL)
|
||||
when :THICKCLUB
|
||||
next if !isConst?(species,PBSpecies,:CUBONE) &&
|
||||
next if !isConst?(species,PBSpecies,:CUBONE) &&
|
||||
!isConst?(species,PBSpecies,:MAROWAK)
|
||||
end
|
||||
if itemsym==:LIECHIBERRY && (ev&0x02)==0
|
||||
@@ -403,11 +403,11 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
break
|
||||
end
|
||||
if level<10
|
||||
item=(getConst(PBItems,:ORANBERRY) || item) if rand(40)==0 ||
|
||||
item=(getConst(PBItems,:ORANBERRY) || item) if rand(40)==0 ||
|
||||
isConst?(item,PBItems,:SITRUSBERRY)
|
||||
end
|
||||
if level>20
|
||||
item=(getConst(PBItems,:SITRUSBERRY) || item) if rand(40)==0 ||
|
||||
item=(getConst(PBItems,:SITRUSBERRY) || item) if rand(40)==0 ||
|
||||
isConst?(item,PBItems,:ORANBERRY)
|
||||
end
|
||||
moves=$legalMoves[species]
|
||||
@@ -417,7 +417,7 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
moves[0]=pbRandomMove
|
||||
moves[1]=pbRandomMove
|
||||
moves[2]=pbRandomMove
|
||||
moves[3]=pbRandomMove
|
||||
moves[3]=pbRandomMove
|
||||
end
|
||||
next if moves.length==0
|
||||
if (moves|[]).length<4
|
||||
@@ -465,7 +465,7 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
hasSpecial=true if d.category==1
|
||||
end
|
||||
end
|
||||
if !hasPhysical && (ev&0x02)!=0
|
||||
if !hasPhysical && (ev&0x02)!=0
|
||||
# No physical attack, but emphasizes Attack
|
||||
next if rand(10)<8
|
||||
end
|
||||
@@ -495,7 +495,7 @@ def pbRandomPokemonFromRule(rule,trainer)
|
||||
end
|
||||
end
|
||||
for i in 0...4
|
||||
moves[i]=0 if !moves[i]
|
||||
moves[i]=0 if !moves[i]
|
||||
end
|
||||
if isConst?(item,PBItems,:LIGHTCLAY) &&
|
||||
!moves.include?((getConst(PBMoves,:LIGHTSCREEN) || -1)) &&
|
||||
@@ -585,7 +585,7 @@ class PlayerRatingElo
|
||||
K_VALUE = 16
|
||||
|
||||
def initialize
|
||||
@rating=1600.0
|
||||
@rating=1600.0
|
||||
@deviation=0
|
||||
@volatility=0
|
||||
@estimatedRating=nil
|
||||
@@ -884,7 +884,7 @@ def pbDecideWinnerScore(party0,party1,rating)
|
||||
end
|
||||
|
||||
def pbDecideWinner(party0,party1,rating0,rating1)
|
||||
rating0=(rating0*15.0/100).round
|
||||
rating0=(rating0*15.0/100).round
|
||||
rating1=(rating1*15.0/100).round
|
||||
score0=pbDecideWinnerScore(party0,party1,rating0)
|
||||
score1=pbDecideWinnerScore(party1,party0,rating1)
|
||||
@@ -1025,7 +1025,7 @@ def pbTrainerInfo(pokemonlist,trfile,rules)
|
||||
end
|
||||
species|=[] # remove duplicates
|
||||
count=0
|
||||
(PBTypes.maxValue+1).times { |typ|
|
||||
(PBTypes.maxValue+1).times { |typ|
|
||||
if types[typ]>=5
|
||||
types[typ]/=4
|
||||
types[typ]=10 if types[typ]>10
|
||||
@@ -1066,7 +1066,7 @@ def pbTrainerInfo(pokemonlist,trfile,rules)
|
||||
end
|
||||
end
|
||||
numbers|=[]
|
||||
if (numbers.length<6 ||
|
||||
if (numbers.length<6 ||
|
||||
!rulesetTeam.hasValidTeam?(numbersPokemon))
|
||||
for index in 0...pokemonlist.length
|
||||
pkmn=pokemonlist[index]
|
||||
@@ -1100,7 +1100,7 @@ def pbTrainerInfo(pokemonlist,trfile,rules)
|
||||
numbers.sort!
|
||||
end
|
||||
newbttrainers.push([trainerdata[0],trainerdata[1],trainerdata[2],
|
||||
trainerdata[3],trainerdata[4],numbers])
|
||||
trainerdata[3],trainerdata[4],numbers])
|
||||
end
|
||||
yield(nil) if block_given?
|
||||
pbpokemonlist=[]
|
||||
@@ -1156,7 +1156,7 @@ def isBattlePokemonDuplicate(pk,pk2)
|
||||
if pk.species==pk2.species
|
||||
moves1=[]
|
||||
moves2=[]
|
||||
4.times{
|
||||
4.times{
|
||||
moves1.push(pk.moves[0].id)
|
||||
moves2.push(pk.moves[1].id)
|
||||
}
|
||||
@@ -1178,7 +1178,7 @@ def isBattlePokemonDuplicate(pk,pk2)
|
||||
pk.ev[4]==pk2.ev[4] &&
|
||||
pk.ev[5]==pk2.ev[5]
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pbRemoveDuplicates(party)
|
||||
@@ -1356,7 +1356,7 @@ def pbWriteCup(id,rules)
|
||||
cmd=2
|
||||
elsif cmd==1
|
||||
cmd=0
|
||||
end
|
||||
end
|
||||
end
|
||||
return if cmd==0 # No
|
||||
if cmd==1 # Yes, use existing
|
||||
@@ -1393,4 +1393,4 @@ def pbWriteCup(id,rules)
|
||||
}
|
||||
pbDisposeMessageWindow(mw)
|
||||
pbMessage(_INTL("Team generation complete."))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,7 +54,7 @@ class BattleSwapScene
|
||||
@sprites["help"].text=_INTL("Select Pokémon to swap.")
|
||||
@sprites["list"].commands=commands
|
||||
@sprites["list"].index=0
|
||||
@mode=1
|
||||
@mode=1
|
||||
end
|
||||
|
||||
# End the scene here
|
||||
@@ -241,4 +241,4 @@ class BattleSwapScreen
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user