mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Removed dual functionalities of Ability and Ball properties in trainers.txt, abolished $BallTypes, removed support for tm.txt
This commit is contained in:
@@ -19,7 +19,7 @@ module GameData
|
|||||||
"Form" => [:form, "u"],
|
"Form" => [:form, "u"],
|
||||||
"Name" => [:name, "s"],
|
"Name" => [:name, "s"],
|
||||||
"Moves" => [:moves, "*e", :Move],
|
"Moves" => [:moves, "*e", :Move],
|
||||||
"Ability" => [:ability, "s"],
|
"Ability" => [:ability, "e", :Ability],
|
||||||
"AbilityIndex" => [:ability_index, "u"],
|
"AbilityIndex" => [:ability_index, "u"],
|
||||||
"Item" => [:item, "e", :Item],
|
"Item" => [:item, "e", :Item],
|
||||||
"Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0,
|
"Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0,
|
||||||
@@ -30,7 +30,7 @@ module GameData
|
|||||||
"Happiness" => [:happiness, "u"],
|
"Happiness" => [:happiness, "u"],
|
||||||
"Shiny" => [:shininess, "b"],
|
"Shiny" => [:shininess, "b"],
|
||||||
"Shadow" => [:shadowness, "b"],
|
"Shadow" => [:shadowness, "b"],
|
||||||
"Ball" => [:poke_ball, "s"],
|
"Ball" => [:poke_ball, "e", :Item],
|
||||||
}
|
}
|
||||||
|
|
||||||
extend ClassMethods
|
extend ClassMethods
|
||||||
|
|||||||
@@ -1,50 +1,3 @@
|
|||||||
$BallTypes = {
|
|
||||||
0 => :POKEBALL,
|
|
||||||
1 => :GREATBALL,
|
|
||||||
2 => :SAFARIBALL,
|
|
||||||
3 => :ULTRABALL,
|
|
||||||
4 => :MASTERBALL,
|
|
||||||
5 => :NETBALL,
|
|
||||||
6 => :DIVEBALL,
|
|
||||||
7 => :NESTBALL,
|
|
||||||
8 => :REPEATBALL,
|
|
||||||
9 => :TIMERBALL,
|
|
||||||
10 => :LUXURYBALL,
|
|
||||||
11 => :PREMIERBALL,
|
|
||||||
12 => :DUSKBALL,
|
|
||||||
13 => :HEALBALL,
|
|
||||||
14 => :QUICKBALL,
|
|
||||||
15 => :CHERISHBALL,
|
|
||||||
16 => :FASTBALL,
|
|
||||||
17 => :LEVELBALL,
|
|
||||||
18 => :LUREBALL,
|
|
||||||
19 => :HEAVYBALL,
|
|
||||||
20 => :LOVEBALL,
|
|
||||||
21 => :FRIENDBALL,
|
|
||||||
22 => :MOONBALL,
|
|
||||||
23 => :SPORTBALL,
|
|
||||||
24 => :DREAMBALL,
|
|
||||||
25 => :BEASTBALL
|
|
||||||
}
|
|
||||||
|
|
||||||
def pbBallTypeToItem(ball_type)
|
|
||||||
ret = GameData::Item.try_get($BallTypes[ball_type])
|
|
||||||
return ret if ret
|
|
||||||
ret = GameData::Item.try_get($BallTypes[0])
|
|
||||||
return ret if ret
|
|
||||||
return GameData::Item.get(:POKEBALL)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbGetBallType(ball)
|
|
||||||
ball = GameData::Item.try_get(ball)
|
|
||||||
$BallTypes.keys.each do |key|
|
|
||||||
return key if ball == $BallTypes[key]
|
|
||||||
end
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -86,9 +86,6 @@ module PokeBattle_BallAnimationMixin
|
|||||||
|
|
||||||
def addBallSprite(ballX, ballY, poke_ball)
|
def addBallSprite(ballX, ballY, poke_ball)
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
||||||
if !pbResolveBitmap(file_path)
|
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(poke_ball).id_number)
|
|
||||||
end
|
|
||||||
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::Center)
|
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::Center)
|
||||||
@ballSprite = @pictureSprites.last
|
@ballSprite = @pictureSprites.last
|
||||||
if @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
if @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
@@ -206,9 +203,6 @@ module PokeBattle_BallAnimationMixin
|
|||||||
|
|
||||||
def ballSetOpen(ball, delay, poke_ball)
|
def ballSetOpen(ball, delay, poke_ball)
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%s_open", poke_ball)
|
file_path = sprintf("Graphics/Battle animations/ball_%s_open", poke_ball)
|
||||||
if !pbResolveBitmap(file_path)
|
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(poke_ball).id_number)
|
|
||||||
end
|
|
||||||
ball.setName(delay, file_path)
|
ball.setName(delay, file_path)
|
||||||
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
||||||
@@ -217,9 +211,6 @@ module PokeBattle_BallAnimationMixin
|
|||||||
|
|
||||||
def ballSetClosed(ball, delay, poke_ball)
|
def ballSetClosed(ball, delay, poke_ball)
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
||||||
if !pbResolveBitmap(file_path)
|
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(poke_ball).id_number)
|
|
||||||
end
|
|
||||||
ball.setName(delay, file_path)
|
ball.setName(delay, file_path)
|
||||||
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class PokeBattle_Pokemon
|
|||||||
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
||||||
ret.name = pkmn.name if pkmn.name != ret.speciesName
|
ret.name = pkmn.name if pkmn.name != ret.speciesName
|
||||||
ret.happiness = pkmn.happiness
|
ret.happiness = pkmn.happiness
|
||||||
ret.poke_ball = pbBallTypeToItem(pkmn.ballused).id
|
ret.poke_ball = :POKEBALL # pbBallTypeToItem(pkmn.ballused).id
|
||||||
ret.markings = pkmn.markings if pkmn.markings
|
ret.markings = pkmn.markings if pkmn.markings
|
||||||
GameData::Stat.each_main do |s|
|
GameData::Stat.each_main do |s|
|
||||||
ret.iv[s.id] = pkmn.iv[s.id_number]
|
ret.iv[s.id] = pkmn.iv[s.id_number]
|
||||||
|
|||||||
@@ -62,13 +62,7 @@ class PokemonTrade_Scene
|
|||||||
pictureBall = PictureEx.new(0)
|
pictureBall = PictureEx.new(0)
|
||||||
picturePoke = PictureEx.new(0)
|
picturePoke = PictureEx.new(0)
|
||||||
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon.poke_ball)
|
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballimage = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
|
||||||
end
|
|
||||||
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon.poke_ball)
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballopenimage = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(@pokemon.poke_ball))
|
|
||||||
end
|
|
||||||
# Starting position of ball
|
# Starting position of ball
|
||||||
pictureBall.setXY(0,Graphics.width/2,48)
|
pictureBall.setXY(0,Graphics.width/2,48)
|
||||||
pictureBall.setName(0,ballimage)
|
pictureBall.setName(0,ballimage)
|
||||||
@@ -110,13 +104,7 @@ class PokemonTrade_Scene
|
|||||||
pictureBall = PictureEx.new(0)
|
pictureBall = PictureEx.new(0)
|
||||||
picturePoke = PictureEx.new(0)
|
picturePoke = PictureEx.new(0)
|
||||||
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon2.poke_ball)
|
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon2.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballimage = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(@pokemon2.poke_ball))
|
|
||||||
end
|
|
||||||
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon2.poke_ball)
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon2.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballopenimage = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(@pokemon2.poke_ball))
|
|
||||||
end
|
|
||||||
# Starting position of ball
|
# Starting position of ball
|
||||||
pictureBall.setXY(0,Graphics.width/2,-32)
|
pictureBall.setXY(0,Graphics.width/2,-32)
|
||||||
pictureBall.setName(0,ballimage)
|
pictureBall.setName(0,ballimage)
|
||||||
|
|||||||
@@ -304,9 +304,6 @@ class PokemonSummary_Scene
|
|||||||
imagepos=[]
|
imagepos=[]
|
||||||
# Show the Poké Ball containing the Pokémon
|
# Show the Poké Ball containing the Pokémon
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
|
||||||
end
|
|
||||||
imagepos.push([ballimage,14,60])
|
imagepos.push([ballimage,14,60])
|
||||||
# Show status/fainted/Pokérus infected icon
|
# Show status/fainted/Pokérus infected icon
|
||||||
status = 0
|
status = 0
|
||||||
@@ -485,9 +482,6 @@ class PokemonSummary_Scene
|
|||||||
imagepos = []
|
imagepos = []
|
||||||
# Show the Poké Ball containing the Pokémon
|
# Show the Poké Ball containing the Pokémon
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
||||||
if !pbResolveBitmap(ballimage)
|
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
|
||||||
end
|
|
||||||
imagepos.push([ballimage,14,60])
|
imagepos.push([ballimage,14,60])
|
||||||
# Draw all images
|
# Draw all images
|
||||||
pbDrawImagePositions(overlay,imagepos)
|
pbDrawImagePositions(overlay,imagepos)
|
||||||
|
|||||||
@@ -210,9 +210,8 @@ def pbChooseBallList(defaultMoveID = nil)
|
|||||||
cmdwin = pbListWindow([], 200)
|
cmdwin = pbListWindow([], 200)
|
||||||
commands = []
|
commands = []
|
||||||
moveDefault = 0
|
moveDefault = 0
|
||||||
for key in $BallTypes.keys
|
GameData::Item.each do |item_data|
|
||||||
item = GameData::Item.try_get($BallTypes[key])
|
commands.push([item_data.id, item_data.name]) if item_data.is_poke_ball?
|
||||||
commands.push([$BallTypes[key], item.name]) if item
|
|
||||||
end
|
end
|
||||||
commands.sort! { |a, b| a[1] <=> b[1] }
|
commands.sort! { |a, b| a[1] <=> b[1] }
|
||||||
if defaultMoveID
|
if defaultMoveID
|
||||||
|
|||||||
@@ -890,9 +890,8 @@ PokemonDebugMenuCommands.register("setpokeball", {
|
|||||||
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||||
commands = []
|
commands = []
|
||||||
balls = []
|
balls = []
|
||||||
for key in $BallTypes.keys
|
GameData::Item.each do |item_data|
|
||||||
item = GameData::Item.try_get($BallTypes[key])
|
balls.push([item_data.id, item_data.name]) if item_data.is_poke_ball?
|
||||||
balls.push([item.id, item.name]) if item
|
|
||||||
end
|
end
|
||||||
balls.sort! { |a, b| a[1] <=> b[1] }
|
balls.sort! { |a, b| a[1] <=> b[1] }
|
||||||
cmd = 0
|
cmd = 0
|
||||||
|
|||||||
@@ -700,8 +700,6 @@ module Compiler
|
|||||||
compile_pokemon # Depends on Move, Item, Type, Ability
|
compile_pokemon # Depends on Move, Item, Type, Ability
|
||||||
yield(_INTL("Compiling Pokémon forms data"))
|
yield(_INTL("Compiling Pokémon forms data"))
|
||||||
compile_pokemon_forms # Depends on Species, Move, Item, Type, Ability
|
compile_pokemon_forms # Depends on Species, Move, Item, Type, Ability
|
||||||
yield(_INTL("Compiling machine data"))
|
|
||||||
compile_move_compatibilities # Depends on Species, Move
|
|
||||||
yield(_INTL("Compiling shadow moveset data"))
|
yield(_INTL("Compiling shadow moveset data"))
|
||||||
compile_shadow_movesets # Depends on Species, Move
|
compile_shadow_movesets # Depends on Species, Move
|
||||||
yield(_INTL("Compiling Regional Dexes"))
|
yield(_INTL("Compiling Regional Dexes"))
|
||||||
|
|||||||
@@ -733,43 +733,6 @@ module Compiler
|
|||||||
Graphics.update
|
Graphics.update
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Compile TM/TM/Move Tutor compatibilities
|
|
||||||
#=============================================================================
|
|
||||||
def compile_move_compatibilities(path = "PBS/tm.txt")
|
|
||||||
return if !safeExists?(path)
|
|
||||||
species_hash = {}
|
|
||||||
move = nil
|
|
||||||
pbCompilerEachCommentedLine(path) { |line, line_no|
|
|
||||||
Graphics.update if line_no % 50 == 0
|
|
||||||
if line[/^\s*\[\s*(\S+)\s*\]\s*$/]
|
|
||||||
move = parseMove($~[1])
|
|
||||||
pbSetWindowText(_INTL("Processing {1} section [{2}]", FileLineData.file, move))
|
|
||||||
else
|
|
||||||
raise _INTL("Expected a section at the beginning of the file.\r\n{1}", FileLineData.linereport) if !move
|
|
||||||
species_list = line.split(",")
|
|
||||||
for species in species_list
|
|
||||||
next if !species || species.empty?
|
|
||||||
s = parseSpecies(species)
|
|
||||||
species_hash[s] = [] if !species_hash[s]
|
|
||||||
species_hash[s].push(move)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
GameData::Species.each do |species_data|
|
|
||||||
next if !species_hash[species_data.id]
|
|
||||||
species_hash[species_data.id].sort! { |a, b| a.to_s <=> b.to_s }
|
|
||||||
species_hash[species_data.id].each { |move| species_data.tutor_moves.push(move) }
|
|
||||||
end
|
|
||||||
GameData::Species.save
|
|
||||||
Compiler.write_pokemon
|
|
||||||
Compiler.write_pokemon_forms
|
|
||||||
begin
|
|
||||||
File.delete(path) if path == "PBS/tm.txt"
|
|
||||||
rescue SystemCallError
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Compile Shadow movesets
|
# Compile Shadow movesets
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -1200,6 +1163,10 @@ module Compiler
|
|||||||
if property_value > 255
|
if property_value > 255
|
||||||
raise _INTL("Bad happiness: {1} (must be 0-255).\r\n{2}", property_value, FileLineData.linereport)
|
raise _INTL("Bad happiness: {1} (must be 0-255).\r\n{2}", property_value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
|
when "Ball"
|
||||||
|
if !GameData::Item.get(property_value).is_poke_ball?
|
||||||
|
raise _INTL("Value {1} isn't a defined Poké Ball.\r\n{2}", property_value, FileLineData.linereport)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# Record XXX=YYY setting
|
# Record XXX=YYY setting
|
||||||
case property_name
|
case property_name
|
||||||
@@ -1217,14 +1184,6 @@ module Compiler
|
|||||||
raise _INTL("Pokémon hasn't been defined yet!\r\n{1}", FileLineData.linereport)
|
raise _INTL("Pokémon hasn't been defined yet!\r\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
case property_name
|
case property_name
|
||||||
when "Ability"
|
|
||||||
if property_value[/^\d+$/]
|
|
||||||
current_pkmn[:ability_index] = property_value.to_i
|
|
||||||
elsif !GameData::Ability.exists?(property_value.to_sym)
|
|
||||||
raise _INTL("Value {1} isn't a defined Ability.\r\n{2}", property_value, FileLineData.linereport)
|
|
||||||
else
|
|
||||||
current_pkmn[line_schema[0]] = property_value.to_sym
|
|
||||||
end
|
|
||||||
when "IV", "EV"
|
when "IV", "EV"
|
||||||
value_hash = {}
|
value_hash = {}
|
||||||
GameData::Stat.each_main do |s|
|
GameData::Stat.each_main do |s|
|
||||||
@@ -1232,15 +1191,6 @@ module Compiler
|
|||||||
value_hash[s.id] = property_value[s.pbs_order] || property_value[0]
|
value_hash[s.id] = property_value[s.pbs_order] || property_value[0]
|
||||||
end
|
end
|
||||||
current_pkmn[line_schema[0]] = value_hash
|
current_pkmn[line_schema[0]] = value_hash
|
||||||
when "Ball"
|
|
||||||
if property_value[/^\d+$/]
|
|
||||||
current_pkmn[line_schema[0]] = pbBallTypeToItem(property_value.to_i).id
|
|
||||||
elsif !GameData::Item.exists?(property_value.to_sym) ||
|
|
||||||
!GameData::Item.get(property_value.to_sym).is_poke_ball?
|
|
||||||
raise _INTL("Value {1} isn't a defined Poké Ball.\r\n{2}", property_value, FileLineData.linereport)
|
|
||||||
else
|
|
||||||
current_pkmn[line_schema[0]] = property_value.to_sym
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
current_pkmn[line_schema[0]] = property_value
|
current_pkmn[line_schema[0]] = property_value
|
||||||
end
|
end
|
||||||
@@ -1377,8 +1327,8 @@ module Compiler
|
|||||||
f.write(0xBB.chr)
|
f.write(0xBB.chr)
|
||||||
f.write(0xBF.chr)
|
f.write(0xBF.chr)
|
||||||
f.write("[DefaultTrainerList]\r\n")
|
f.write("[DefaultTrainerList]\r\n")
|
||||||
f.write("Trainers = bttrainers.txt\r\n")
|
f.write("Trainers = battle_tower_trainers.txt\r\n")
|
||||||
f.write("Pokemon = btpokemon.txt\r\n")
|
f.write("Pokemon = battle_tower_pokemon.txt\r\n")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
sections = []
|
sections = []
|
||||||
|
|||||||
Reference in New Issue
Block a user