mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
Split PokeBattle_Trainer into PlayerTrainer and NPCTrainer
This commit is contained in:
@@ -106,8 +106,8 @@ class PokemonPokedexMenuScreen
|
||||
end
|
||||
end
|
||||
index = -1 if index >= $PokemonGlobal.pokedexUnlocked.length - 1
|
||||
commands2[i] = [$Trainer.pokedexSeen(index),
|
||||
$Trainer.pokedexOwned(index),
|
||||
commands2[i] = [$Trainer.seen_count(index),
|
||||
$Trainer.owned_count(index),
|
||||
pbGetRegionalDexLength(index)]
|
||||
end
|
||||
commands.push(_INTL("Exit"))
|
||||
|
||||
@@ -38,8 +38,8 @@ class Window_Pokedex < Window_DrawableCommand
|
||||
species = @commands[index][0]
|
||||
indexNumber = @commands[index][4]
|
||||
indexNumber -= 1 if @commands[index][5]
|
||||
if $Trainer.seen[species]
|
||||
if $Trainer.owned[species]
|
||||
if $Trainer.seen?(species)
|
||||
if $Trainer.owned?(species)
|
||||
pbCopyBitmap(self.contents,@pokeballOwn.bitmap,rect.x-6,rect.y+8)
|
||||
else
|
||||
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
|
||||
@@ -305,9 +305,9 @@ class PokemonPokedex_Scene
|
||||
def pbCanAddForModeList?(mode, species)
|
||||
case mode
|
||||
when MODEATOZ
|
||||
return $Trainer.seen[species]
|
||||
return $Trainer.seen?(species)
|
||||
when MODEHEAVIEST, MODELIGHTEST, MODETALLEST, MODESMALLEST
|
||||
return $Trainer.owned[species]
|
||||
return $Trainer.owned?(species)
|
||||
end
|
||||
return true # For MODENUMERICAL
|
||||
end
|
||||
@@ -342,11 +342,11 @@ class PokemonPokedex_Scene
|
||||
case $PokemonGlobal.pokedexMode
|
||||
when MODENUMERICAL
|
||||
# Hide the Dex number 0 species if unseen
|
||||
dexlist[0] = nil if dexlist[0][5] && !$Trainer.seen[dexlist[0][0]]
|
||||
dexlist[0] = nil if dexlist[0][5] && !$Trainer.seen?(dexlist[0][0])
|
||||
# Remove unseen species from the end of the list
|
||||
i = dexlist.length-1
|
||||
loop do break unless i>=0
|
||||
break if !dexlist[i] || $Trainer.seen[dexlist[i][0]]
|
||||
break if !dexlist[i] || $Trainer.seen?(dexlist[i][0])
|
||||
dexlist[i] = nil
|
||||
i -= 1
|
||||
end
|
||||
@@ -382,7 +382,7 @@ class PokemonPokedex_Scene
|
||||
base = Color.new(88,88,80)
|
||||
shadow = Color.new(168,184,184)
|
||||
iconspecies = @sprites["pokedex"].species
|
||||
iconspecies = nil if !$Trainer.seen[iconspecies]
|
||||
iconspecies = nil if !$Trainer.seen?(iconspecies)
|
||||
# Write various bits of text
|
||||
dexname = _INTL("Pokédex")
|
||||
if $PokemonGlobal.pokedexUnlocked.length>1
|
||||
@@ -400,9 +400,9 @@ class PokemonPokedex_Scene
|
||||
textpos.push([@dexlist.length.to_s,112,340,2,base,shadow])
|
||||
else
|
||||
textpos.push([_INTL("Seen:"),42,308,0,base,shadow])
|
||||
textpos.push([$Trainer.pokedexSeen(pbGetPokedexRegion).to_s,182,308,1,base,shadow])
|
||||
textpos.push([$Trainer.seen_count(pbGetPokedexRegion).to_s,182,308,1,base,shadow])
|
||||
textpos.push([_INTL("Owned:"),42,340,0,base,shadow])
|
||||
textpos.push([$Trainer.pokedexOwned(pbGetPokedexRegion).to_s,182,340,1,base,shadow])
|
||||
textpos.push([$Trainer.owned_count(pbGetPokedexRegion).to_s,182,340,1,base,shadow])
|
||||
end
|
||||
# Draw all text
|
||||
pbDrawTextPositions(overlay,textpos)
|
||||
@@ -675,10 +675,10 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
|
||||
def setIconBitmap(species)
|
||||
$Trainer.formlastseen = {} if !$Trainer.formlastseen
|
||||
$Trainer.formlastseen[species] = [] if !$Trainer.formlastseen[species]
|
||||
gender = $Trainer.formlastseen[species][0] || 0
|
||||
form = $Trainer.formlastseen[species][1] || 0
|
||||
$Trainer.last_seen_forms = {} if !$Trainer.last_seen_forms
|
||||
$Trainer.last_seen_forms[species] = [] if !$Trainer.last_seen_forms[species]
|
||||
gender = $Trainer.last_seen_forms[species][0] || 0
|
||||
form = $Trainer.last_seen_forms[species][1] || 0
|
||||
@sprites["icon"].setSpeciesBitmap(species, gender, form)
|
||||
end
|
||||
|
||||
@@ -689,7 +689,7 @@ class PokemonPokedex_Scene
|
||||
if params[1]>=0
|
||||
scanNameCommand = @nameCommands[params[1]].scan(/./)
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.seen[item[0]]
|
||||
next false if !$Trainer.seen?(item[0])
|
||||
firstChar = item[1][0,1]
|
||||
next scanNameCommand.any? { |v| v==firstChar }
|
||||
}
|
||||
@@ -699,7 +699,7 @@ class PokemonPokedex_Scene
|
||||
stype1 = (params[2]>=0) ? @typeCommands[params[2]].id : nil
|
||||
stype2 = (params[3]>=0) ? @typeCommands[params[3]].id : nil
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.owned[item[0]]
|
||||
next false if !$Trainer.owned?(item[0])
|
||||
type1 = item[6]
|
||||
type2 = item[7]
|
||||
if stype1 && stype2
|
||||
@@ -721,7 +721,7 @@ class PokemonPokedex_Scene
|
||||
minh = (params[4]<0) ? 0 : (params[4]>=@heightCommands.length) ? 999 : @heightCommands[params[4]]
|
||||
maxh = (params[5]<0) ? 999 : (params[5]>=@heightCommands.length) ? 0 : @heightCommands[params[5]]
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.owned[item[0]]
|
||||
next false if !$Trainer.owned?(item[0])
|
||||
height = item[2]
|
||||
next height>=minh && height<=maxh
|
||||
}
|
||||
@@ -731,7 +731,7 @@ class PokemonPokedex_Scene
|
||||
minw = (params[6]<0) ? 0 : (params[6]>=@weightCommands.length) ? 9999 : @weightCommands[params[6]]
|
||||
maxw = (params[7]<0) ? 9999 : (params[7]>=@weightCommands.length) ? 0 : @weightCommands[params[7]]
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.owned[item[0]]
|
||||
next false if !$Trainer.owned?(item[0])
|
||||
weight = item[3]
|
||||
next weight>=minw && weight<=maxw
|
||||
}
|
||||
@@ -745,7 +745,7 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
scolor = colorCommands[params[8]]
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.seen[item[0]]
|
||||
next false if !$Trainer.seen?(item[0])
|
||||
color = item[8]
|
||||
next color==scolor
|
||||
}
|
||||
@@ -754,13 +754,13 @@ class PokemonPokedex_Scene
|
||||
if params[9]>=0
|
||||
sshape = @shapeCommands[params[9]]+1
|
||||
dexlist = dexlist.find_all { |item|
|
||||
next false if !$Trainer.seen[item[0]]
|
||||
next false if !$Trainer.seen?(item[0])
|
||||
shape = item[9]
|
||||
next shape==sshape
|
||||
}
|
||||
end
|
||||
# Remove all unseen species from the results
|
||||
dexlist = dexlist.find_all { |item| next $Trainer.seen[item[0]] }
|
||||
dexlist = dexlist.find_all { |item| next $Trainer.seen?(item[0]) }
|
||||
case $PokemonGlobal.pokedexMode
|
||||
when MODENUMERICAL then dexlist.sort! { |a,b| a[4]<=>b[4] }
|
||||
when MODEATOZ then dexlist.sort! { |a,b| a[1]<=>b[1] }
|
||||
@@ -1166,7 +1166,7 @@ class PokemonPokedex_Scene
|
||||
break
|
||||
end
|
||||
elsif Input.trigger?(Input::C)
|
||||
if $Trainer.seen[@sprites["pokedex"].species]
|
||||
if $Trainer.seen?(@sprites["pokedex"].species)
|
||||
pbPlayDecisionSE
|
||||
pbDexEntry(@sprites["pokedex"].index)
|
||||
end
|
||||
|
||||
@@ -121,10 +121,10 @@ class PokemonPokedexInfo_Scene
|
||||
|
||||
def pbUpdateDummyPokemon
|
||||
@species = @dexlist[@index][0]
|
||||
$Trainer.formlastseen = {} if !$Trainer.formlastseen
|
||||
$Trainer.formlastseen[@species] = [] if !$Trainer.formlastseen[@species]
|
||||
@gender = $Trainer.formlastseen[@species][0] || 0
|
||||
@form = $Trainer.formlastseen[@species][1] || 0
|
||||
$Trainer.last_seen_forms = {} if !$Trainer.last_seen_forms
|
||||
$Trainer.last_seen_forms[@species] = [] if !$Trainer.last_seen_forms[@species]
|
||||
@gender = $Trainer.last_seen_forms[@species][0] || 0
|
||||
@form = $Trainer.last_seen_forms[@species][1] || 0
|
||||
species_data = GameData::Species.get_species_form(@species, @form)
|
||||
@sprites["infosprite"].setSpeciesBitmap(@species,@gender,@form)
|
||||
if @sprites["formfront"]
|
||||
@@ -149,16 +149,16 @@ class PokemonPokedexInfo_Scene
|
||||
next if sp.form != 0 && (!sp.real_form_name || sp.real_form_name.empty?)
|
||||
next if sp.pokedex_form != sp.form
|
||||
multiple_forms = true if sp.form > 0
|
||||
$Trainer.formseen[@species] = [[], []] if !$Trainer.formseen[@species]
|
||||
$Trainer.seen_forms[@species] = [[], []] if !$Trainer.seen_forms[@species]
|
||||
case sp.gender_rate
|
||||
when PBGenderRates::AlwaysMale, PBGenderRates::AlwaysFemale, PBGenderRates::Genderless
|
||||
real_gender = (sp.gender_rate == PBGenderRates::AlwaysFemale) ? 1 : 0
|
||||
next if !$Trainer.formseen[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS
|
||||
next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS
|
||||
real_gender = 2 if sp.gender_rate == PBGenderRates::Genderless
|
||||
ret.push([sp.form_name, real_gender, sp.form])
|
||||
else # Both male and female
|
||||
for real_gender in 0...2
|
||||
next if !$Trainer.formseen[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS
|
||||
next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS
|
||||
ret.push([sp.form_name, real_gender, sp.form])
|
||||
break if sp.form_name && !sp.form_name.empty? # Only show 1 entry for each non-0 form
|
||||
end
|
||||
@@ -223,7 +223,7 @@ class PokemonPokedexInfo_Scene
|
||||
[_INTL("Height"), 314, 158, 0, base, shadow],
|
||||
[_INTL("Weight"), 314, 190, 0, base, shadow]
|
||||
]
|
||||
if $Trainer.owned[@species]
|
||||
if $Trainer.owned?(@species)
|
||||
# Write the category
|
||||
textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 74, 0, base, shadow])
|
||||
# Write the height and weight
|
||||
@@ -390,7 +390,7 @@ class PokemonPokedexInfo_Scene
|
||||
newindex = @index
|
||||
while newindex>0
|
||||
newindex -= 1
|
||||
if $Trainer.seen[@dexlist[newindex][0]]
|
||||
if $Trainer.seen?(@dexlist[newindex][0])
|
||||
@index = newindex
|
||||
break
|
||||
end
|
||||
@@ -401,7 +401,7 @@ class PokemonPokedexInfo_Scene
|
||||
newindex = @index
|
||||
while newindex<@dexlist.length-1
|
||||
newindex += 1
|
||||
if $Trainer.seen[@dexlist[newindex][0]]
|
||||
if $Trainer.seen?(@dexlist[newindex][0])
|
||||
@index = newindex
|
||||
break
|
||||
end
|
||||
@@ -419,10 +419,10 @@ class PokemonPokedexInfo_Scene
|
||||
oldindex = -1
|
||||
loop do
|
||||
if oldindex!=index
|
||||
$Trainer.formlastseen = {} if !$Trainer.formlastseen
|
||||
$Trainer.formlastseen[@species] = [] if !$Trainer.formlastseen
|
||||
$Trainer.formlastseen[@species][0] = @available[index][1]
|
||||
$Trainer.formlastseen[@species][1] = @available[index][2]
|
||||
$Trainer.last_seen_forms = {} if !$Trainer.last_seen_forms
|
||||
$Trainer.last_seen_forms[@species] = [] if !$Trainer.last_seen_forms
|
||||
$Trainer.last_seen_forms[@species][0] = @available[index][1]
|
||||
$Trainer.last_seen_forms[@species][1] = @available[index][2]
|
||||
pbUpdateDummyPokemon
|
||||
drawPage(@page)
|
||||
@sprites["uparrow"].visible = (index>0)
|
||||
|
||||
@@ -475,7 +475,7 @@ class PokemonBagScreen
|
||||
commands[cmdUse = commands.length] = _INTL("Use")
|
||||
end
|
||||
end
|
||||
commands[cmdGive = commands.length] = _INTL("Give") if $Trainer.pokemonParty.length>0 && itm.can_hold?
|
||||
commands[cmdGive = commands.length] = _INTL("Give") if $Trainer.pokemon_party.length > 0 && itm.can_hold?
|
||||
commands[cmdToss = commands.length] = _INTL("Toss") if !itm.is_important? || $DEBUG
|
||||
if @bag.pbIsRegistered?(item)
|
||||
commands[cmdRegister = commands.length] = _INTL("Deselect")
|
||||
@@ -498,7 +498,7 @@ class PokemonBagScreen
|
||||
@scene.pbRefresh
|
||||
next
|
||||
elsif cmdGive>=0 && command==cmdGive # Give item to Pokémon
|
||||
if $Trainer.pokemonCount==0
|
||||
if $Trainer.pokemon_count == 0
|
||||
@scene.pbDisplay(_INTL("There is no Pokémon."))
|
||||
elsif itm.is_important?
|
||||
@scene.pbDisplay(_INTL("The {1} can't be held.",itemname))
|
||||
|
||||
@@ -138,7 +138,7 @@ class PokemonRegionMap_Scene
|
||||
@sprites["mapbottom"].mapdetails = pbGetMapDetails(@mapX,@mapY)
|
||||
if playerpos && mapindex==playerpos[0]
|
||||
@sprites["player"] = IconSprite.new(0,0,@viewport)
|
||||
@sprites["player"].setBitmap(GameData::TrainerType.player_map_icon_filename($Trainer.trainertype))
|
||||
@sprites["player"].setBitmap(GameData::TrainerType.player_map_icon_filename($Trainer.trainer_type))
|
||||
@sprites["player"].x = -SQUAREWIDTH/2+(@mapX*SQUAREWIDTH)+(Graphics.width-@sprites["map"].bitmap.width)/2
|
||||
@sprites["player"].y = -SQUAREHEIGHT/2+(@mapY*SQUAREHEIGHT)+(Graphics.height-@sprites["map"].bitmap.height)/2
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ class PokemonTrainerCard_Scene
|
||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||
@sprites["trainer"] = IconSprite.new(336,112,@viewport)
|
||||
@sprites["trainer"].setBitmap(GameData::TrainerType.player_front_sprite_filename($Trainer.trainertype))
|
||||
@sprites["trainer"].setBitmap(GameData::TrainerType.player_front_sprite_filename($Trainer.trainer_type))
|
||||
@sprites["trainer"].x -= (@sprites["trainer"].bitmap.width-128)/2
|
||||
@sprites["trainer"].y -= (@sprites["trainer"].bitmap.height-128)
|
||||
@sprites["trainer"].z = 2
|
||||
@@ -52,11 +52,11 @@ class PokemonTrainerCard_Scene
|
||||
[_INTL("Name"),34,64,0,baseColor,shadowColor],
|
||||
[$Trainer.name,302,64,1,baseColor,shadowColor],
|
||||
[_INTL("ID No."),332,64,0,baseColor,shadowColor],
|
||||
[sprintf("%05d",$Trainer.publicID($Trainer.id)),468,64,1,baseColor,shadowColor],
|
||||
[sprintf("%05d",$Trainer.public_ID),468,64,1,baseColor,shadowColor],
|
||||
[_INTL("Money"),34,112,0,baseColor,shadowColor],
|
||||
[_INTL("${1}",$Trainer.money.to_s_formatted),302,112,1,baseColor,shadowColor],
|
||||
[_INTL("Pokédex"),34,160,0,baseColor,shadowColor],
|
||||
[sprintf("%d/%d",$Trainer.pokedexOwned,$Trainer.pokedexSeen),302,160,1,baseColor,shadowColor],
|
||||
[sprintf("%d/%d",$Trainer.owned_count,$Trainer.seen_count),302,160,1,baseColor,shadowColor],
|
||||
[_INTL("Time"),34,208,0,baseColor,shadowColor],
|
||||
[time,302,208,1,baseColor,shadowColor],
|
||||
[_INTL("Started"),34,256,0,baseColor,shadowColor],
|
||||
|
||||
@@ -64,9 +64,9 @@ class PokemonLoadPanel < SpriteWrapper
|
||||
if @isContinue
|
||||
textpos.push([@title,16*2,5*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([_INTL("Badges:"),16*2,56*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([@trainer.numbadges.to_s,103*2,56*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([@trainer.badge_count.to_s,103*2,56*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([_INTL("Pokédex:"),16*2,72*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([@trainer.pokedexSeen.to_s,103*2,72*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([@trainer.seen_count.to_s,103*2,72*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
textpos.push([_INTL("Time:"),16*2,88*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
|
||||
hour = @totalsec / 60 / 60
|
||||
min = @totalsec / 60 % 60
|
||||
@@ -163,7 +163,7 @@ class PokemonLoad_Scene
|
||||
|
||||
def pbSetParty(trainer)
|
||||
return if !trainer || !trainer.party
|
||||
meta = GameData::Metadata.get_player(trainer.metaID)
|
||||
meta = GameData::Metadata.get_player(trainer.character_ID)
|
||||
if meta
|
||||
filename = pbGetPlayerCharset(meta,1,trainer,true)
|
||||
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
|
||||
@@ -227,7 +227,7 @@ class PokemonLoadScreen
|
||||
pokemonSystem = Marshal.load(f)
|
||||
mapid = Marshal.load(f)
|
||||
}
|
||||
raise "Corrupted file" if !trainer.is_a?(PokeBattle_Trainer)
|
||||
raise "Corrupted file" if !trainer.is_a?(PlayerTrainer)
|
||||
raise "Corrupted file" if !framecount.is_a?(Numeric)
|
||||
raise "Corrupted file" if !game_system.is_a?(Game_System)
|
||||
raise "Corrupted file" if !pokemonSystem.is_a?(PokemonSystem)
|
||||
@@ -318,7 +318,7 @@ class PokemonLoadScreen
|
||||
end
|
||||
commands[cmdContinue = commands.length] = _INTL("Continue") if showContinue
|
||||
commands[cmdNewGame = commands.length] = _INTL("New Game")
|
||||
commands[cmdMysteryGift = commands.length] = _INTL("Mystery Gift") if (trainer.mysterygiftaccess rescue false)
|
||||
commands[cmdMysteryGift = commands.length] = _INTL("Mystery Gift") if trainer.mystery_gift_unlocked
|
||||
else
|
||||
commands[cmdNewGame = commands.length] = _INTL("New Game")
|
||||
end
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#
|
||||
#===============================================================================
|
||||
def pbSave(safesave=false)
|
||||
$Trainer.metaID=$PokemonGlobal.playerID
|
||||
begin
|
||||
File.open(RTP.getSaveFileName("Game.rxdata"),"wb") { |f|
|
||||
Marshal.dump($Trainer,f)
|
||||
@@ -79,9 +78,9 @@ class PokemonSave_Scene
|
||||
else
|
||||
loctext+=_INTL("Time<r><c3={1}>{2}m</c3><br>",textColor,min)
|
||||
end
|
||||
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$Trainer.numbadges)
|
||||
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$Trainer.badge_count)
|
||||
if $Trainer.pokedex
|
||||
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",textColor,$Trainer.pokedexOwned,$Trainer.pokedexSeen)
|
||||
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",textColor,$Trainer.owned_count,$Trainer.seen_count)
|
||||
end
|
||||
@sprites["locwindow"]=Window_AdvancedTextPokemon.new(loctext)
|
||||
@sprites["locwindow"].viewport=@viewport
|
||||
|
||||
@@ -304,7 +304,7 @@ def pbUseKeyItem
|
||||
:WATERFALL, :WHIRLPOOL]
|
||||
real_moves = []
|
||||
moves.each do |move|
|
||||
$Trainer.pokemonParty.each_with_index do |pkmn, i|
|
||||
$Trainer.pokemon_party.each_with_index do |pkmn, i|
|
||||
next if !pkmn.hasMove?(move)
|
||||
real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false)
|
||||
end
|
||||
|
||||
@@ -199,8 +199,8 @@ def pbHatch(pokemon)
|
||||
pokemon.timeEggHatched = pbGetTimeNow
|
||||
pokemon.obtain_method = 1 # hatched from egg
|
||||
pokemon.hatched_map = $game_map.map_id
|
||||
$Trainer.seen[pokemon.species] = true
|
||||
$Trainer.owned[pokemon.species] = true
|
||||
$Trainer.set_seen(pokemon.species)
|
||||
$Trainer.set_owned(pokemon.species)
|
||||
pbSeenForm(pokemon)
|
||||
pokemon.record_first_moves
|
||||
if !pbHatchAnimation(pokemon)
|
||||
@@ -220,7 +220,7 @@ Events.onStepTaken += proc { |_sender,_e|
|
||||
for egg in $Trainer.party
|
||||
next if egg.steps_to_hatch <= 0
|
||||
egg.steps_to_hatch -= 1
|
||||
for i in $Trainer.pokemonParty
|
||||
for i in $Trainer.pokemon_party
|
||||
next if !i.hasAbility?(:FLAMEBODY) && !i.hasAbility?(:MAGMAARMOR)
|
||||
egg.steps_to_hatch -= 1
|
||||
break
|
||||
|
||||
@@ -588,8 +588,8 @@ class PokemonEvolutionScene
|
||||
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
|
||||
@pokemon.calcStats
|
||||
# See and own evolved species
|
||||
$Trainer.seen[@newspecies] = true
|
||||
$Trainer.owned[@newspecies] = true
|
||||
$Trainer.set_seen(@newspecies)
|
||||
$Trainer.set_owned(@newspecies)
|
||||
pbSeenForm(@pokemon)
|
||||
# Learn moves upon evolution for evolved species
|
||||
movelist = @pokemon.getMoveList
|
||||
@@ -619,8 +619,8 @@ class PokemonEvolutionScene
|
||||
# Add duplicate Pokémon to party
|
||||
$Trainer.party.push(new_pkmn)
|
||||
# See and own duplicate Pokémon
|
||||
$Trainer.seen[new_species] = true
|
||||
$Trainer.owned[new_species] = true
|
||||
$Trainer.set_seen(new_species)
|
||||
$Trainer.set_owned(new_species)
|
||||
pbSeenForm(new_pkmn)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -211,8 +211,8 @@ end
|
||||
#===============================================================================
|
||||
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
myPokemon = $Trainer.party[pokemonIndex]
|
||||
opponent = PokeBattle_Trainer.new(trainerName,trainerGender)
|
||||
opponent.setForeignID($Trainer)
|
||||
opponent = NPCTrainer.new(trainerName,trainerGender)
|
||||
opponent.id = $Trainer.make_foreign_ID
|
||||
yourPokemon = nil
|
||||
resetmoves = true
|
||||
if newpoke.is_a?(Pokemon)
|
||||
@@ -228,8 +228,8 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
yourPokemon.obtain_method = 2 # traded
|
||||
yourPokemon.resetMoves if resetmoves
|
||||
yourPokemon.record_first_moves
|
||||
$Trainer.seen[yourPokemon.species] = true
|
||||
$Trainer.owned[yourPokemon.species] = true
|
||||
$Trainer.set_seen(yourPokemon.species)
|
||||
$Trainer.set_owned(yourPokemon.species)
|
||||
pbSeenForm(yourPokemon)
|
||||
pbFadeOutInWithMusic {
|
||||
evo = PokemonTrade_Scene.new
|
||||
|
||||
@@ -9,22 +9,6 @@
|
||||
MYSTERY_GIFT_URL = "http://images1.wikia.nocookie.net/pokemonessentials/images/e/e7/MysteryGift.txt"
|
||||
# MYSTERY_GIFT_URL = "http://pastebin.com/raw/w6BqqUsm"
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class PokeBattle_Trainer
|
||||
attr_writer :mysterygiftaccess # Whether MG can be used from load screen
|
||||
attr_writer :mysterygift # Variable that stores downloaded MG data
|
||||
|
||||
def mysterygiftaccess
|
||||
return @mysterygiftaccess || false
|
||||
end
|
||||
|
||||
def mysterygift
|
||||
return @mysterygift || []
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Creating a new Mystery Gift for the Master file, and editing an existing one.
|
||||
#===============================================================================
|
||||
@@ -211,12 +195,12 @@ def pbManageMysteryGifts
|
||||
master[command]=newgift if newgift
|
||||
elsif cmd==2 # Receive
|
||||
replaced=false
|
||||
for i in 0...$Trainer.mysterygift.length
|
||||
if $Trainer.mysterygift[i][0]==gift[0]
|
||||
$Trainer.mysterygift[i]=gift; replaced=true
|
||||
for i in 0...$Trainer.mystery_gifts.length
|
||||
if $Trainer.mystery_gifts[i][0]==gift[0]
|
||||
$Trainer.mystery_gifts[i]=gift; replaced=true
|
||||
end
|
||||
end
|
||||
$Trainer.mysterygift.push(gift) if !replaced
|
||||
$Trainer.mystery_gifts.push(gift) if !replaced
|
||||
pbReceiveMysteryGift(gift[0])
|
||||
elsif cmd==3 # Delete
|
||||
if pbConfirmMessage(_INTL("Are you sure you want to delete this gift?"))
|
||||
@@ -267,7 +251,7 @@ def pbDownloadMysteryGift(trainer)
|
||||
pending=[]
|
||||
for gift in online
|
||||
notgot=true
|
||||
for j in trainer.mysterygift
|
||||
for j in trainer.mystery_gifts
|
||||
notgot=false if j[0]==gift[0]
|
||||
end
|
||||
pending.push(gift) if notgot
|
||||
@@ -315,7 +299,7 @@ def pbDownloadMysteryGift(trainer)
|
||||
sprites["msgwindow"].visible=true
|
||||
pbMessageDisplay(sprites["msgwindow"],_INTL("The gift has been received!")) { sprite.update }
|
||||
pbMessageDisplay(sprites["msgwindow"],_INTL("Please pick up your gift from the deliveryman in any Poké Mart.")) { sprite.update }
|
||||
trainer.mysterygift.push(gift)
|
||||
trainer.mystery_gifts.push(gift)
|
||||
pending[command]=nil; pending.compact!
|
||||
opacityDiff = 16*20/Graphics.frame_rate
|
||||
loop do
|
||||
@@ -359,7 +343,7 @@ end
|
||||
# Collecting a Mystery Gift from the deliveryman.
|
||||
#===============================================================================
|
||||
def pbNextMysteryGiftID
|
||||
for i in $Trainer.mysterygift
|
||||
for i in $Trainer.mystery_gifts
|
||||
return i[0] if i.length>1
|
||||
end
|
||||
return 0
|
||||
@@ -367,8 +351,8 @@ end
|
||||
|
||||
def pbReceiveMysteryGift(id)
|
||||
index=-1
|
||||
for i in 0...$Trainer.mysterygift.length
|
||||
if $Trainer.mysterygift[i][0]==id && $Trainer.mysterygift[i].length>1
|
||||
for i in 0...$Trainer.mystery_gifts.length
|
||||
if $Trainer.mystery_gifts[i][0]==id && $Trainer.mystery_gifts[i].length>1
|
||||
index=i
|
||||
break
|
||||
end
|
||||
@@ -377,7 +361,7 @@ def pbReceiveMysteryGift(id)
|
||||
pbMessage(_INTL("Couldn't find an unclaimed Mystery Gift with ID {1}.",id))
|
||||
return false
|
||||
end
|
||||
gift=$Trainer.mysterygift[index]
|
||||
gift=$Trainer.mystery_gifts[index]
|
||||
if gift[1]==0 # Pokémon
|
||||
gift[2].personalID = rand(2**16) | rand(2**16) << 16
|
||||
gift[2].calcStats
|
||||
@@ -394,7 +378,7 @@ def pbReceiveMysteryGift(id)
|
||||
end
|
||||
if pbAddPokemonSilent(gift[2])
|
||||
pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$Trainer.name,gift[2].name))
|
||||
$Trainer.mysterygift[index]=[id]
|
||||
$Trainer.mystery_gifts[index]=[id]
|
||||
return true
|
||||
end
|
||||
elsif gift[1]>0 # Item
|
||||
@@ -416,7 +400,7 @@ def pbReceiveMysteryGift(id)
|
||||
else
|
||||
pbMessage(_INTL("\\me[Item get]You obtained a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
|
||||
end
|
||||
$Trainer.mysterygift[index]=[id]
|
||||
$Trainer.mystery_gifts[index]=[id]
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -241,7 +241,7 @@ class HallOfFame_Scene
|
||||
|
||||
def createTrainerBattler
|
||||
@sprites["trainer"]=IconSprite.new(@viewport)
|
||||
@sprites["trainer"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainertype))
|
||||
@sprites["trainer"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainer_type))
|
||||
if !SINGLEROW
|
||||
@sprites["trainer"].x=Graphics.width-96
|
||||
@sprites["trainer"].y=160
|
||||
@@ -276,12 +276,12 @@ class HallOfFame_Scene
|
||||
totalsec = Graphics.frame_count / Graphics.frame_rate
|
||||
hour = totalsec / 60 / 60
|
||||
min = totalsec / 60 % 60
|
||||
pubid=sprintf("%05d",$Trainer.publicID($Trainer.id))
|
||||
pubid=sprintf("%05d",$Trainer.public_ID)
|
||||
lefttext= _INTL("Name<r>{1}<br>",$Trainer.name)
|
||||
lefttext+=_INTL("IDNo.<r>{1}<br>",pubid)
|
||||
lefttext+=_ISPRINTF("Time<r>{1:02d}:{2:02d}<br>",hour,min)
|
||||
lefttext+=_INTL("Pokédex<r>{1}/{2}<br>",
|
||||
$Trainer.pokedexOwned,$Trainer.pokedexSeen)
|
||||
$Trainer.owned_count,$Trainer.seen_count)
|
||||
@sprites["messagebox"]=Window_AdvancedTextPokemon.new(lefttext)
|
||||
@sprites["messagebox"].viewport=@viewport
|
||||
@sprites["messagebox"].width=192 if @sprites["messagebox"].width<192
|
||||
|
||||
Reference in New Issue
Block a user