mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Created and implemented GameData::Type
This commit is contained in:
@@ -328,7 +328,7 @@ class PokemonPokedex_Scene
|
||||
form = $Trainer.formlastseen[nationalSpecies][1] || 0
|
||||
fspecies = pbGetFSpeciesFromForm(nationalSpecies,form)
|
||||
color = speciesData[fspecies][SpeciesData::COLOR] || 0
|
||||
type1 = speciesData[fspecies][SpeciesData::TYPE1] || 0
|
||||
type1 = speciesData[fspecies][SpeciesData::TYPE1]
|
||||
type2 = speciesData[fspecies][SpeciesData::TYPE2] || type1
|
||||
shape = speciesData[fspecies][SpeciesData::SHAPE] || 0
|
||||
height = speciesData[fspecies][SpeciesData::HEIGHT] || 1
|
||||
@@ -466,13 +466,15 @@ class PokemonPokedex_Scene
|
||||
textpos.push([(params[8]<0) ? "----" : @colorCommands[params[8]],444,118,2,base,shadow,1])
|
||||
# Draw type icons
|
||||
if params[2]>=0
|
||||
typerect = Rect.new(0,@typeCommands[params[2]]*32,96,32)
|
||||
type_number = @typeCommands[params[2]].id_number
|
||||
typerect = Rect.new(0,type_number*32,96,32)
|
||||
overlay.blt(128,168,@typebitmap.bitmap,typerect)
|
||||
else
|
||||
textpos.push(["----",176,170,2,base,shadow,1])
|
||||
end
|
||||
if params[3]>=0
|
||||
typerect = Rect.new(0,@typeCommands[params[3]]*32,96,32)
|
||||
type_number = @typeCommands[params[3]].id_number
|
||||
typerect = Rect.new(0,type_number*32,96,32)
|
||||
overlay.blt(256,168,@typebitmap.bitmap,typerect)
|
||||
else
|
||||
textpos.push(["----",304,170,2,base,shadow,1])
|
||||
@@ -562,7 +564,8 @@ class PokemonPokedex_Scene
|
||||
if !sel[i] || sel[i]<0
|
||||
textpos.push(["----",298+128*i,58,2,base,shadow,1])
|
||||
else
|
||||
typerect = Rect.new(0,@typeCommands[sel[i]]*32,96,32)
|
||||
type_number = @typeCommands[sel[i]].id_number
|
||||
typerect = Rect.new(0,type_number*32,96,32)
|
||||
overlay.blt(250+128*i,58,@typebitmap.bitmap,typerect)
|
||||
end
|
||||
end
|
||||
@@ -658,7 +661,7 @@ class PokemonPokedex_Scene
|
||||
when 2 # Type
|
||||
typerect = Rect.new(0,0,96,32)
|
||||
for i in 0...cmds.length
|
||||
typerect.y = @typeCommands[i]*32
|
||||
typerect.y = @typeCommands[i].id_number*32
|
||||
overlay.blt(xstart+14+(i%cols)*xgap,ystart+6+(i/cols).floor*ygap,@typebitmap.bitmap,typerect)
|
||||
end
|
||||
textpos.push(["----",
|
||||
@@ -694,19 +697,19 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
# Filter by type
|
||||
if params[2]>=0 || params[3]>=0
|
||||
stype1 = (params[2]>=0) ? @typeCommands[params[2]] : -1
|
||||
stype2 = (params[3]>=0) ? @typeCommands[params[3]] : -1
|
||||
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]]
|
||||
type1 = item[6]
|
||||
type2 = item[7]
|
||||
if stype1>=0 && stype2>=0
|
||||
if stype1 && stype2
|
||||
# Find species that match both types
|
||||
next (type1==stype1 && type2==stype2) || (type1==stype2 && type2==stype1)
|
||||
elsif stype1>=0
|
||||
elsif stype1
|
||||
# Find species that match first type entered
|
||||
next type1==stype1 || type2==stype1
|
||||
elsif stype2>=0
|
||||
elsif stype2
|
||||
# Find species that match second type entered
|
||||
next type1==stype2 || type2==stype2
|
||||
else
|
||||
@@ -1000,9 +1003,8 @@ class PokemonPokedex_Scene
|
||||
_INTL("U"),_INTL("V"),_INTL("W"),_INTL("X"),_INTL("Y"),
|
||||
_INTL("Z")]
|
||||
@typeCommands = []
|
||||
for i in 0..PBTypes.maxValue
|
||||
@typeCommands.push(i) if !PBTypes.isPseudoType?(i)
|
||||
end
|
||||
GameData::Type.each { |t| @typeCommands.push(t) if !t.pseudo_type }
|
||||
@typeCommands.sort! { |a, b| a.id_number <=> b.id_number }
|
||||
@heightCommands = [1,2,3,4,5,6,7,8,9,10,
|
||||
11,12,13,14,15,16,17,18,19,20,
|
||||
21,22,23,24,25,30,35,40,45,50,
|
||||
|
||||
@@ -273,10 +273,12 @@ class PokemonPokedexInfo_Scene
|
||||
# Show the owned icon
|
||||
imagepos.push(["Graphics/Pictures/Pokedex/icon_own",212,44])
|
||||
# Draw the type icon(s)
|
||||
type1 = speciesData[SpeciesData::TYPE1] || 0
|
||||
type1 = speciesData[SpeciesData::TYPE1]
|
||||
type2 = speciesData[SpeciesData::TYPE2] || type1
|
||||
type1rect = Rect.new(0,type1*32,96,32)
|
||||
type2rect = Rect.new(0,type2*32,96,32)
|
||||
type1_number = GameData::Type.get(type1).id_number
|
||||
type2_number = GameData::Type.get(type2).id_number
|
||||
type1rect = Rect.new(0,type1_number*32,96,32)
|
||||
type2rect = Rect.new(0,type2_number*32,96,32)
|
||||
overlay.blt(296,120,@typebitmap.bitmap,type1rect)
|
||||
overlay.blt(396,120,@typebitmap.bitmap,type2rect) if type1!=type2
|
||||
else
|
||||
|
||||
@@ -440,8 +440,10 @@ class PokemonSummary_Scene
|
||||
# Draw all text
|
||||
pbDrawTextPositions(overlay,textpos)
|
||||
# Draw Pokémon type(s)
|
||||
type1rect = Rect.new(0,@pokemon.type1*28,64,28)
|
||||
type2rect = Rect.new(0,@pokemon.type2*28,64,28)
|
||||
type1_number = GameData::Type.get(@pokemon.type1).id_number
|
||||
type2_number = GameData::Type.get(@pokemon.type2).id_number
|
||||
type1rect = Rect.new(0, type1_number * 28, 64, 28)
|
||||
type2rect = Rect.new(0, type2_number * 28, 64, 28)
|
||||
if @pokemon.type1==@pokemon.type2
|
||||
overlay.blt(402,146,@typebitmap.bitmap,type1rect)
|
||||
else
|
||||
@@ -686,7 +688,8 @@ class PokemonSummary_Scene
|
||||
for i in 0...Pokemon::MAX_MOVES
|
||||
move=@pokemon.moves[i]
|
||||
if move
|
||||
imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,move.type*28,64,28])
|
||||
type_number = GameData::Type.get(move.type).id_number
|
||||
imagepos.push(["Graphics/Pictures/types", 248, yPos + 2, 0, type_number * 28, 64, 28])
|
||||
textpos.push([move.name,316,yPos,0,moveBase,moveShadow])
|
||||
if move.total_pp>0
|
||||
textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
|
||||
@@ -748,7 +751,8 @@ class PokemonSummary_Scene
|
||||
yPos += 20
|
||||
end
|
||||
if move
|
||||
imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,move.type*28,64,28])
|
||||
type_number = GameData::Type.get(move.type).id_number
|
||||
imagepos.push(["Graphics/Pictures/types", 248, yPos + 2, 0, type_number * 28, 64, 28])
|
||||
textpos.push([move.name,316,yPos,0,moveBase,moveShadow])
|
||||
if move.total_pp>0
|
||||
textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
|
||||
@@ -769,8 +773,10 @@ class PokemonSummary_Scene
|
||||
pbDrawTextPositions(overlay,textpos)
|
||||
pbDrawImagePositions(overlay,imagepos)
|
||||
# Draw Pokémon's type icon(s)
|
||||
type1rect = Rect.new(0,@pokemon.type1*28,64,28)
|
||||
type2rect = Rect.new(0,@pokemon.type2*28,64,28)
|
||||
type1_number = GameData::Type.get(@pokemon.type1).id_number
|
||||
type2_number = GameData::Type.get(@pokemon.type2).id_number
|
||||
type1rect = Rect.new(0, type1_number * 28, 64, 28)
|
||||
type2rect = Rect.new(0, type2_number * 28, 64, 28)
|
||||
if @pokemon.type1==@pokemon.type2
|
||||
overlay.blt(130,78,@typebitmap.bitmap,type1rect)
|
||||
else
|
||||
|
||||
@@ -1430,8 +1430,10 @@ class PokemonStorageScene
|
||||
imagepos.push(["Graphics/Pictures/shiny",156,198])
|
||||
end
|
||||
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
|
||||
type1rect = Rect.new(0,pokemon.type1*28,64,28)
|
||||
type2rect = Rect.new(0,pokemon.type2*28,64,28)
|
||||
type1_number = GameData::Type.get(pokemon.type1).id_number
|
||||
type2_number = GameData::Type.get(pokemon.type2).id_number
|
||||
type1rect = Rect.new(0, type1_number * 28, 64, 28)
|
||||
type2rect = Rect.new(0, type2_number * 28, 64, 28)
|
||||
if pokemon.type1==pokemon.type2
|
||||
overlay.blt(52,272,typebitmap.bitmap,type1rect)
|
||||
else
|
||||
|
||||
@@ -83,8 +83,10 @@ class MoveRelearner_Scene
|
||||
def pbDrawMoveList
|
||||
overlay=@sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
type1rect=Rect.new(0,@pokemon.type1*28,64,28)
|
||||
type2rect=Rect.new(0,@pokemon.type2*28,64,28)
|
||||
type1_number = GameData::Type.get(@pokemon.type1).id_number
|
||||
type2_number = GameData::Type.get(@pokemon.type2).id_number
|
||||
type1rect=Rect.new(0, type1_number * 28, 64, 28)
|
||||
type2rect=Rect.new(0, type2_number * 28, 64, 28)
|
||||
if @pokemon.type1==@pokemon.type2
|
||||
overlay.blt(400,70,@typebitmap.bitmap,type1rect)
|
||||
else
|
||||
@@ -100,7 +102,8 @@ class MoveRelearner_Scene
|
||||
moveobject=@moves[@sprites["commands"].top_item+i]
|
||||
if moveobject
|
||||
moveData=GameData::Move.get(moveobject)
|
||||
imagepos.push(["Graphics/Pictures/types",12,yPos+2,0,moveData.type*28,64,28])
|
||||
type_number = GameData::Type.get(moveData.type).id_number
|
||||
imagepos.push(["Graphics/Pictures/types", 12, yPos + 2, 0, type_number * 28, 64, 28])
|
||||
textpos.push([moveData.name,80,yPos,0,Color.new(248,248,248),Color.new(0,0,0)])
|
||||
if moveData.total_pp>0
|
||||
textpos.push([_INTL("PP"),112,yPos+32,0,Color.new(64,64,64),Color.new(176,176,176)])
|
||||
|
||||
@@ -94,7 +94,7 @@ Boosted based on number of best circles
|
||||
|
||||
# Purify Chamber treats Normal/Normal matchup as super effective
|
||||
def self.typeAdvantage(p1,p2)
|
||||
return true if isConst?(p1,PBTypes,:NORMAL) && isConst?(p2,PBTypes,:NORMAL)
|
||||
return true if p1 == :NORMAL && p2 == :NORMAL
|
||||
return PBTypes.superEffective?(p1,p2)
|
||||
end
|
||||
|
||||
@@ -125,7 +125,7 @@ class PurifyChamber # German: der Kryptorbis
|
||||
@currentSet=value if value>=0 && value<NUMSETS
|
||||
end
|
||||
|
||||
# Number of regular Pokemon in a set
|
||||
# Number of regular Pokemon in a set
|
||||
def setCount(set)
|
||||
return @sets[set].length
|
||||
end
|
||||
@@ -954,11 +954,11 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
textpos=[]
|
||||
if pkmn
|
||||
if pkmn.type1==pkmn.type2
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}",pkmn.name,pkmn.level,PBTypes.getName(pkmn.type1)),2,0,0,
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}",pkmn.name,pkmn.level,GameData::Type.get(pkmn.type1).name),2,0,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
else
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}/{4}",pkmn.name,pkmn.level,PBTypes.getName(pkmn.type1),
|
||||
PBTypes.getName(pkmn.type2)),2,0,0,
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}/{4}",pkmn.name,pkmn.level,GameData::Type.get(pkmn.type1).name,
|
||||
GameData::Type.get(pkmn.type2).name),2,0,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
end
|
||||
textpos.push([_INTL("FLOW"),2+@info.bitmap.width/2,24,0,
|
||||
@@ -1089,17 +1089,6 @@ end
|
||||
|
||||
|
||||
|
||||
def pbPurifyChamber
|
||||
$PokemonGlobal.seenPurifyChamber = true
|
||||
pbFadeOutIn {
|
||||
scene = PurifyChamberScene.new
|
||||
screen = PurifyChamberScreen.new(scene)
|
||||
screen.pbStartPurify
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
class PurifyChamberScene
|
||||
def pbUpdate()
|
||||
pbUpdateSpriteHash(@sprites)
|
||||
@@ -1309,3 +1298,14 @@ class PurifyChamberScene
|
||||
return pos
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbPurifyChamber
|
||||
$PokemonGlobal.seenPurifyChamber = true
|
||||
pbFadeOutIn {
|
||||
scene = PurifyChamberScene.new
|
||||
screen = PurifyChamberScreen.new(scene)
|
||||
screen.pbStartPurify
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user