mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
More aligning of code
This commit is contained in:
@@ -20,8 +20,8 @@ class BattleChallenge
|
||||
@numRounds = numrounds
|
||||
@rules = rules
|
||||
register(id, id[/double/], 3,
|
||||
id[/^factory/] ? BattleFactoryID : BattleTowerID,
|
||||
id[/open$/] ? 1 : 0)
|
||||
id[/^factory/] ? BattleFactoryID : BattleTowerID,
|
||||
id[/open$/] ? 1 : 0)
|
||||
pbWriteCup(id, rules)
|
||||
end
|
||||
|
||||
@@ -99,8 +99,8 @@ class BattleChallenge
|
||||
bttrainers = pbGetBTTrainers(@id)
|
||||
trainerdata = bttrainers[self.nextTrainer]
|
||||
ret = pbOrganizedBattleEx(opponent, self.rules,
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
|
||||
return ret
|
||||
end
|
||||
|
||||
@@ -372,8 +372,9 @@ class BattleFactoryData
|
||||
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
|
||||
trainerdata = bttrainers[@trainerid]
|
||||
@opponent = NPCTrainer.new(
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0])
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0]
|
||||
)
|
||||
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals)
|
||||
@opponent.party = opponentPkmn.sample(3)
|
||||
end
|
||||
@@ -394,10 +395,11 @@ class BattleFactoryData
|
||||
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
|
||||
trainerdata = bttrainers[trainerid]
|
||||
@opponent = NPCTrainer.new(
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0])
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0]
|
||||
)
|
||||
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps,
|
||||
[].concat(@rentals).concat(@oldopponent))
|
||||
[].concat(@rentals).concat(@oldopponent))
|
||||
@opponent.party = opponentPkmn.sample(3)
|
||||
end
|
||||
|
||||
@@ -417,7 +419,7 @@ class BattleFactoryData
|
||||
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
|
||||
trainerdata = bttrainers[@trainerid]
|
||||
return pbOrganizedBattleEx(@opponent, challenge.rules,
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
|
||||
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -148,7 +148,7 @@ class PBPokemon
|
||||
ev_array.push(s.id) if pkmn.ev[s.id] > 60
|
||||
end
|
||||
return self.new(pkmn.species, pkmn.item_id, pkmn.nature,
|
||||
mov1, mov2, mov3, mov4, ev_array)
|
||||
mov1, mov2, mov3, mov4, ev_array)
|
||||
end
|
||||
|
||||
def initialize(species, item, nature, move1, move2, move3, move4, ev)
|
||||
|
||||
@@ -43,8 +43,9 @@ def pbGenerateBattleTrainer(idxTrainer, rules)
|
||||
# Create the trainer
|
||||
trainerdata = bttrainers[idxTrainer]
|
||||
opponent = NPCTrainer.new(
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0])
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0]
|
||||
)
|
||||
# Determine how many IVs the trainer's Pokémon will have
|
||||
indvalues = 31
|
||||
indvalues = 21 if idxTrainer < 220
|
||||
|
||||
@@ -7,13 +7,17 @@ class BattleSwapScene
|
||||
@sprites = {}
|
||||
addBackgroundPlane(@sprites, "bg", "rentbg", @viewport)
|
||||
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
_INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport)
|
||||
_INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport
|
||||
)
|
||||
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
|
||||
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport)
|
||||
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize("",
|
||||
0, Graphics.height - 64, Graphics.width, 64, @viewport)
|
||||
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize("",
|
||||
0, Graphics.height - 64, Graphics.height, 64, @viewport)
|
||||
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport
|
||||
)
|
||||
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
|
||||
)
|
||||
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
|
||||
"", 0, Graphics.height - 64, Graphics.height, 64, @viewport
|
||||
)
|
||||
@sprites["msgwindow"].visible = false
|
||||
pbUpdateChoices([])
|
||||
pbDeactivateWindows(@sprites)
|
||||
@@ -29,13 +33,17 @@ class BattleSwapScene
|
||||
@sprites = {}
|
||||
addBackgroundPlane(@sprites, "bg", "swapbg", @viewport)
|
||||
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
_INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport)
|
||||
_INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport
|
||||
)
|
||||
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
|
||||
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport)
|
||||
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport
|
||||
)
|
||||
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport)
|
||||
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
|
||||
)
|
||||
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
|
||||
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport)
|
||||
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
|
||||
)
|
||||
@sprites["msgwindow"].visible = false
|
||||
pbInitSwapScreen
|
||||
pbDeactivateWindows(@sprites)
|
||||
|
||||
@@ -293,9 +293,10 @@ Events.onMapChange += proc { |_sender, _e|
|
||||
Events.onMapSceneChange += proc { |_sender, e|
|
||||
scene = e[0]
|
||||
if pbInBugContest? && pbBugContestState.decision == 0 && BugContestState::TIME_ALLOWED > 0
|
||||
scene.spriteset.addUserSprite(TimerDisplay.new(
|
||||
pbBugContestState.timer,
|
||||
BugContestState::TIME_ALLOWED * Graphics.frame_rate))
|
||||
scene.spriteset.addUserSprite(
|
||||
TimerDisplay.new(pbBugContestState.timer,
|
||||
BugContestState::TIME_ALLOWED * Graphics.frame_rate)
|
||||
)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -295,10 +295,10 @@ def pbWriteCup(id, rules)
|
||||
cmd = 0
|
||||
if trlists.length != 0
|
||||
cmd = pbMessage(_INTL("Generate Pokémon teams for this challenge?"),
|
||||
[_INTL("NO"), _INTL("YES, USE EXISTING"), _INTL("YES, USE NEW")], 1)
|
||||
[_INTL("NO"), _INTL("YES, USE EXISTING"), _INTL("YES, USE NEW")], 1)
|
||||
else
|
||||
cmd = pbMessage(_INTL("Generate Pokémon teams for this challenge?"),
|
||||
[_INTL("YES"), _INTL("NO")], 2)
|
||||
[_INTL("YES"), _INTL("NO")], 2)
|
||||
case cmd
|
||||
when 0
|
||||
cmd = 2
|
||||
|
||||
@@ -342,8 +342,9 @@ def pbDecideWinnerScore(party0, party1, rating)
|
||||
for move in party0[i].moves
|
||||
next if !move
|
||||
for j in 0...party1.length
|
||||
score += pbDecideWinnerEffectiveness(move.id,
|
||||
types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20])
|
||||
score += pbDecideWinnerEffectiveness(
|
||||
move.id, types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20]
|
||||
)
|
||||
end
|
||||
end
|
||||
basestatsum = baseStatTotal(party0[i].species)
|
||||
|
||||
Reference in New Issue
Block a user