mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-09-23 18:08:30 +02:00
Make it possible to have different battle sprites
This commit is contained in:
parent
9a3d451b1f
commit
e12b5261e1
@ -681,7 +681,7 @@
|
||||
Else
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\MegaEvolution", False))
|
||||
End If
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(_base & " has Mega Evolved into " & p.GetName(True) & "!"))
|
||||
TriggerAbilityEffect(BattleScreen, own)
|
||||
End If
|
||||
@ -1336,7 +1336,7 @@
|
||||
p.ReloadDefinitions()
|
||||
p.CalculateStats()
|
||||
Me.ChangeCameraAngle(1, own, BattleScreen)
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " transformed into Blade Forme!"))
|
||||
End If
|
||||
Else
|
||||
@ -1345,7 +1345,7 @@
|
||||
p.ReloadDefinitions()
|
||||
p.CalculateStats()
|
||||
Me.ChangeCameraAngle(1, own, BattleScreen)
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " transformed into Shield Forme!"))
|
||||
End If
|
||||
End If
|
||||
@ -2405,7 +2405,7 @@
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OppPokemon.GetDisplayName() & "'s substitute took the damage!"))
|
||||
If BattleScreen.FieldEffects.OppSubstitute <= 0 Then
|
||||
BattleScreen.FieldEffects.OppSubstitute = 0
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OppPokemon.GetDisplayName() & " substitute broke!"))
|
||||
Exit For
|
||||
End If
|
||||
@ -2414,7 +2414,7 @@
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OwnPokemon.GetDisplayName() & "'s substitute took the damage!"))
|
||||
If BattleScreen.FieldEffects.OwnSubstitute <= 0 Then
|
||||
BattleScreen.FieldEffects.OwnSubstitute = 0
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OwnPokemon), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OwnPokemon, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OwnPokemon.GetDisplayName() & " substitute broke!"))
|
||||
Exit For
|
||||
End If
|
||||
@ -5333,7 +5333,7 @@
|
||||
p.IsTransformed = True
|
||||
|
||||
'Apply new image to sprite:
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " transformed into " & op.GetName & "!"))
|
||||
Else
|
||||
'Fails
|
||||
@ -7782,7 +7782,7 @@
|
||||
Dim FallOffset = 0.0F
|
||||
Dim ownModel As String = BattleScreen.GetModelName(True)
|
||||
If ownModel = "" Then
|
||||
BattleScreen.AddToQuery(InsertIndex, New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OwnPokemon), 0, 1, -1, -1))
|
||||
BattleScreen.AddToQuery(InsertIndex, New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OwnPokemon, True), 0, 1, -1, -1))
|
||||
Else
|
||||
BattleScreen.AddToQuery(InsertIndex, New ToggleEntityQueryObject(True, ownModel, 1, 0, -1, -1))
|
||||
End If
|
||||
@ -8228,7 +8228,7 @@
|
||||
End If
|
||||
End If
|
||||
If oppModel = "" Then
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), -1, -1, 0, 1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon, True), -1, -1, 0, 1))
|
||||
Else
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, oppModel, -1, -1, 1, 0))
|
||||
End If
|
||||
|
@ -258,8 +258,8 @@
|
||||
OppEntityOffsetY = -0.5F
|
||||
End If
|
||||
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon, True), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon, True), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
If ownModel <> "" Then
|
||||
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
|
||||
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
|
||||
@ -417,8 +417,8 @@
|
||||
OppEntityOffsetY = -0.5F
|
||||
End If
|
||||
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, OwnPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOwn,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OppPokemon), 1, OppPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOpp,,, oppModel), NPC)
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon, True), 3, OwnPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOwn,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OppPokemon, True), 1, OppPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOpp,,, oppModel), NPC)
|
||||
|
||||
If ownModel <> "" Then
|
||||
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
|
||||
@ -667,8 +667,8 @@
|
||||
OppEntityOffsetY = -0.5F
|
||||
End If
|
||||
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0 + OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0 + OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon, True), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon, True), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
|
||||
If ownModel <> "" Then
|
||||
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
|
||||
@ -792,8 +792,8 @@
|
||||
OppEntityOffsetY = -0.5F
|
||||
End If
|
||||
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0 + OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0 + OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon, True), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
|
||||
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon, True), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
|
||||
|
||||
If ownModel <> "" Then
|
||||
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
|
||||
|
@ -257,7 +257,7 @@
|
||||
BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen)
|
||||
Dim oppModel As String = BattleScreen.GetModelName(False)
|
||||
If oppModel = "" Then
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), -1, -1, 0, 1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon, True), -1, -1, 0, 1))
|
||||
Else
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, oppModel, -1, -1, 1, 0))
|
||||
End If
|
||||
|
@ -113,7 +113,7 @@
|
||||
|
||||
Dim PokemonAddition As String = ""
|
||||
|
||||
If UseTextureID.StartsWith("Pokemon\Overworld\") = True Then
|
||||
If UseTextureID.StartsWith("Pokemon\Overworld\") = True OrElse UseTextureID.StartsWith("Pokemon\Battle\") = True Then
|
||||
texturePath = ""
|
||||
If StringHelper.IsNumeric(TextureID) = True Then
|
||||
PokemonAddition = PokemonForms.GetDefaultOverworldSpriteAddition(CInt(TextureID))
|
||||
|
@ -112,7 +112,7 @@
|
||||
p.IsTransformed = True
|
||||
|
||||
'Apply new image to sprite:
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p, True), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " transformed into " & op.GetName & "!"))
|
||||
Else
|
||||
'Fails
|
||||
|
@ -392,10 +392,36 @@ Public Class PokemonForms
|
||||
''' <summary>
|
||||
''' Returns the path to the Pokémon's overworld sprite.
|
||||
''' </summary>
|
||||
Public Shared Function GetOverworldSpriteName(ByVal P As Pokemon) As String
|
||||
Dim path As String = "Pokemon\Overworld\Normal\"
|
||||
If P.IsShiny = True Then
|
||||
path = "Pokemon\Overworld\Shiny\"
|
||||
Public Shared Function GetOverworldSpriteName(ByVal P As Pokemon, Optional ByVal UseBattle As Boolean = False) As String
|
||||
Dim path As String = ""
|
||||
Dim UseOverworld As Boolean = True
|
||||
If UseBattle = True Then
|
||||
path = "Pokemon\Battle\Normal\"
|
||||
If P.IsShiny = True Then
|
||||
path = "Pokemon\Battle\Shiny\"
|
||||
End If
|
||||
If GameModeManager.ContentFileExists(path & P.Number.ToString() & GetOverworldAddition(P) & ".png") = True Then
|
||||
UseOverworld = False
|
||||
ElseIf Core.GameOptions.ContentPackNames.Count() > 0 Then
|
||||
For Each c As String In Core.GameOptions.ContentPackNames
|
||||
Dim contentPath As String = "ContentPacks\" & c & "\Pokemon\Battle\Normal\"
|
||||
If P.IsShiny = True Then
|
||||
contentPath = "ContentPacks\" & c & "\Pokemon\Battle\Shiny\"
|
||||
End If
|
||||
|
||||
If File.Exists(GameController.GamePath & "\" & contentPath & P.Number.ToString() & GetOverworldAddition(P) & ".png") = True Then
|
||||
UseOverworld = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If UseOverworld = True Then
|
||||
path = "Pokemon\Overworld\Normal\"
|
||||
If P.IsShiny = True Then
|
||||
path = "Pokemon\Overworld\Shiny\"
|
||||
End If
|
||||
End If
|
||||
path &= P.Number.ToString() & GetOverworldAddition(P)
|
||||
Return path
|
||||
|
Loading…
x
Reference in New Issue
Block a user