diff --git a/P3D/Battle/BattleAnimations/BattleAnimation3D.vb b/P3D/Battle/BattleAnimations/BattleAnimation3D.vb index 1eb6bfeb2..6613cb82d 100644 --- a/P3D/Battle/BattleAnimations/BattleAnimation3D.vb +++ b/P3D/Battle/BattleAnimations/BattleAnimation3D.vb @@ -69,7 +69,6 @@ End If End If End If - MyBase.Update() End Sub @@ -97,7 +96,11 @@ Public Overrides Sub Render() If Me.startDelay <= 0.0F Then If CanRemove = False Then - Draw(Me.Model, Me.Textures, True) + If Me.Model Is Nothing Then + Draw(Me.BaseModel, Me.Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End If End If End Sub diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index e49bd928d..4f9bc0955 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -60,8 +60,8 @@ Public OwnTrainerNPC As NPC Public OppTrainerNPC As NPC - Public OwnPokemonModel As ModelEntity - Public OppPokemonModel As ModelEntity + Public OwnPokemonModel As Entity + Public OppPokemonModel As Entity Public OwnPokemonIndex As Integer = 0 Public OppPokemonIndex As Integer = 0 @@ -227,10 +227,10 @@ If ownModel = "" Then OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 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), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, 1), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, 1), WallBlock) End If Screen.Level.Entities.Add(OwnPokemonNPC) @@ -238,10 +238,10 @@ If oppModel = "" Then OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 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)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, oppModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 13) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, "", True, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, oppModel), WallBlock) End If Screen.Level.Entities.Add(OppPokemonNPC) @@ -366,10 +366,10 @@ If ownModel = "" Then OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 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), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, OwnPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, InitiallyVisibleOwn), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, InitiallyVisibleOwn), WallBlock) End If Screen.Level.Entities.Add(OwnPokemonNPC) @@ -382,10 +382,10 @@ If oppModel = "" Then OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 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), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OppPokemon), 1, OppPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, oppModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, InitiallyVisibleOpp), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, oppModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, InitiallyVisibleOpp), WallBlock) End If Screen.Level.Entities.Add(OppPokemonNPC) @@ -580,10 +580,10 @@ If ownModel = "" Then OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, ownModel, False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, ownModel), WallBlock) End If Screen.Level.Entities.Add(OwnPokemonNPC) @@ -591,10 +591,10 @@ If oppModel = "" Then OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 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)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, oppModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, "", True, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, oppModel), WallBlock) End If Screen.Level.Entities.Add(OppPokemonNPC) @@ -692,10 +692,10 @@ If ownModel = "" Then OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 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)}, 1), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, OwnPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}), NPC) - OwnPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 0.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, 1), ModelEntity) + OwnPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(12, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 0.5F, 0), New Vector3(OwnPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, ownModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing, 1), WallBlock) End If Screen.Level.Entities.Add(OwnPokemonNPC) @@ -703,10 +703,10 @@ If oppModel = "" Then OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 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)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 0, "Models\Bulbasaur\Normal", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, "Models\Bulbasaur\Normal"), WallBlock) Else OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", False, New Vector3(1), 0, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}), NPC) - OppPokemonModel = CType(Entity.GetNewEntity("ModelEntity", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(MathHelper.Pi * 0.5F, MathHelper.Pi * 1.5F, 0), New Vector3(0.07F), BaseModel.BlockModel, 1, oppModel, True, New Vector3(1), 0, "", "", New Vector3(0), Nothing), ModelEntity) + OppPokemonModel = CType(Entity.GetNewEntity("WallBlock", New Vector3(15, -0.5F, 12.5F) + BattleMapOffset, {}, {}, False, New Vector3(0, MathHelper.Pi * 1.5F, 0), New Vector3(OppPokemon.GetModelProperties().Item1), BaseModel.BlockModel, 1, "", True, New Vector3(1), 0, "", "", New Vector3(0), Nothing,,,, oppModel), WallBlock) End If Screen.Level.Entities.Add(OppPokemonNPC) diff --git a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb index f8ae86aa8..8b04c85fa 100644 --- a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb +++ b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb @@ -9,7 +9,7 @@ Public AnimationSequence As List(Of BattleAnimation3D) Public SpawnedEntities As List(Of Entity) Public CurrentEntity As Entity - Public CurrentModel As ModelEntity + Public CurrentModel As Entity Public DrawBeforeEntities As Boolean Public Overrides ReadOnly Property IsReady As Boolean @@ -18,7 +18,7 @@ End Get End Property - Public Sub New(ByVal entity As Entity, ByVal BattleFlipped As Boolean, Optional ByVal model As ModelEntity = Nothing, Optional DrawBeforeEntities As Boolean = False) + Public Sub New(ByVal entity As Entity, ByVal BattleFlipped As Boolean, Optional ByVal model As Entity = Nothing, Optional DrawBeforeEntities As Boolean = False) MyBase.New(QueryTypes.MoveAnimation) Me.AnimationSequence = New List(Of BattleAnimation3D) Me.SpawnedEntities = New List(Of Entity) diff --git a/P3D/Battle/BattleSystemV2/QueryObjects/ToggleEntityQueryObject.vb b/P3D/Battle/BattleSystemV2/QueryObjects/ToggleEntityQueryObject.vb index 154cd966e..d22a5f5d7 100644 --- a/P3D/Battle/BattleSystemV2/QueryObjects/ToggleEntityQueryObject.vb +++ b/P3D/Battle/BattleSystemV2/QueryObjects/ToggleEntityQueryObject.vb @@ -124,9 +124,11 @@ Case 2 Select Case Me._entity Case BattleEntities.OwnPokemon - BV2Screen.OwnPokemonModel.LoadModel(_newTexture) + BV2Screen.OwnPokemonModel.ModelPath = _newTexture + BV2Screen.OwnPokemonModel.Model = ModelManager.GetModel(BV2Screen.OwnPokemonModel.ModelPath) Case BattleEntities.OppPokemon - BV2Screen.OppPokemonModel.LoadModel(_newTexture) + BV2Screen.OppPokemonModel.ModelPath = _newTexture + BV2Screen.OppPokemonModel.Model = ModelManager.GetModel(BV2Screen.OppPokemonModel.ModelPath) End Select End Select _done = True diff --git a/P3D/Content/Data/maps/battle/liberty/garden.dat b/P3D/Content/Data/maps/battle/liberty/garden.dat index 7929562c5..fd2fca6fe 100644 --- a/P3D/Content/Data/maps/battle/liberty/garden.dat +++ b/P3D/Content/Data/maps/battle/liberty/garden.dat @@ -291,7 +291,7 @@ Trees: {"EntityField"{ENT[{"EntityID"{str[WallBill]}}{"Position"{sngArr[31,2.05,8]}}{"Size"{intArr[3,3]}}{"SeasonTexture"{str[PlantColoring]}}{"Scale"{sngArr[1.1,1.3,1.1]}}{"TexturePath"{str[park]}}{"Textures"{recArr[[64,64,32,32]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[3]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"Rotation"{int[0]}}]}} Boat: -{"EntityField"{ENT[{"Size"{intArr[1,1]}}{"Scale"{sngArr[1,1,1]}}{"EntityID"{str[ModelEntity]}}{"Position"{sngArr[0,-0.5,9]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[models\boat2\boat]}}{"Rotation"{int[0]}}]}} +{"Entity"{ENT[{"ID"{int[0]}}{"Scale"{sngArr[2,2,2]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[0,-1,9.375]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"ModelPath"{str[models\boat2\boat]}}{"Rotation"{int[2]}}]}} SlantW: {"EntityField"{ENT[{"EntityID"{str[WallBlock]}}{"Position"{sngArr[9,0,7]}}{"Size"{intArr[1,4]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[160,16,16,16]]}}{"TextureIndex"{intArr[-1,-1,-1,-1,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[2]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"Rotation"{int[1]}}]}} diff --git a/P3D/Content/Data/maps/battle/underwatercave/surface.dat b/P3D/Content/Data/maps/battle/underwatercave/surface.dat index 0c117708b..0ebff907e 100644 Binary files a/P3D/Content/Data/maps/battle/underwatercave/surface.dat and b/P3D/Content/Data/maps/battle/underwatercave/surface.dat differ diff --git a/P3D/Content/Data/maps/boon/dock.dat b/P3D/Content/Data/maps/boon/dock.dat index 41ded8242..d2e946e2f 100644 Binary files a/P3D/Content/Data/maps/boon/dock.dat and b/P3D/Content/Data/maps/boon/dock.dat differ diff --git a/P3D/Content/Data/maps/chrono/dock.dat b/P3D/Content/Data/maps/chrono/dock.dat index ff03d99bf..689ae6918 100644 Binary files a/P3D/Content/Data/maps/chrono/dock.dat and b/P3D/Content/Data/maps/chrono/dock.dat differ diff --git a/P3D/Content/Data/maps/chrono/memorial.dat b/P3D/Content/Data/maps/chrono/memorial.dat index c9f71c9df..d2428ccd1 100644 Binary files a/P3D/Content/Data/maps/chrono/memorial.dat and b/P3D/Content/Data/maps/chrono/memorial.dat differ diff --git a/P3D/Content/Data/maps/faraway/exterior.dat b/P3D/Content/Data/maps/faraway/exterior.dat index 10afaf119..b3be2817e 100644 Binary files a/P3D/Content/Data/maps/faraway/exterior.dat and b/P3D/Content/Data/maps/faraway/exterior.dat differ diff --git a/P3D/Content/Data/maps/floe/dock.dat b/P3D/Content/Data/maps/floe/dock.dat index 2a1eb46e1..44019a67e 100644 Binary files a/P3D/Content/Data/maps/floe/dock.dat and b/P3D/Content/Data/maps/floe/dock.dat differ diff --git a/P3D/Content/Data/maps/fortune/dock.dat b/P3D/Content/Data/maps/fortune/dock.dat index 229b01fa9..039719f19 100644 Binary files a/P3D/Content/Data/maps/fortune/dock.dat and b/P3D/Content/Data/maps/fortune/dock.dat differ diff --git a/P3D/Content/Data/maps/kin/dock.dat b/P3D/Content/Data/maps/kin/dock.dat index d669d2c54..c4f22fd3e 100644 Binary files a/P3D/Content/Data/maps/kin/dock.dat and b/P3D/Content/Data/maps/kin/dock.dat differ diff --git a/P3D/Content/Data/maps/knot/dock.dat b/P3D/Content/Data/maps/knot/dock.dat index cd89188f1..1ace6f343 100644 Binary files a/P3D/Content/Data/maps/knot/dock.dat and b/P3D/Content/Data/maps/knot/dock.dat differ diff --git a/P3D/Content/Data/maps/knot/town.dat b/P3D/Content/Data/maps/knot/town.dat index ca67f1ba8..82b4c2f01 100644 Binary files a/P3D/Content/Data/maps/knot/town.dat and b/P3D/Content/Data/maps/knot/town.dat differ diff --git a/P3D/Content/Data/maps/kolben/basement.dat b/P3D/Content/Data/maps/kolben/basement.dat index b1f400d8e..7de07fbb7 100644 --- a/P3D/Content/Data/maps/kolben/basement.dat +++ b/P3D/Content/Data/maps/kolben/basement.dat @@ -71,9 +71,8 @@ Crates: {"EntityField"{ENT[{"Size"{intArr[1,5]}}{"Scale"{sngArr[0.45,0.45,0.45]}}{"Steps"{sngArr[1,4]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[0,0.7,7]}}{"TexturePath"{str[rocketbase]}}{"Textures"{recArr[[16,0,16,16][32,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0,0,0,1,1]}}{"Collision"{bool[1]}}{"ModelID"{int[1]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"Rotation"{int[0]}}]}} Boats: -{"EntityField"{ENT[{"Size"{intArr[1,1]}}{"Scale"{sngArr[0.00002,0.00002,0.00002]}}{"EntityID"{str[ModelEntity]}}{"Position"{sngArr[6,0.77,7.55]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[models\boat\SSAqua]}}{"Rotation"{int[2]}}]}} -{"Entity"{ENT[{"ID"{int[0]}}{"Scale"{sngArr[0.07,0.07,0.07]}}{"EntityID"{str[ModelEntity]}}{"Position"{sngArr[6,0.72,10.6]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[models\boat2\boat]}}{"Rotation"{int[0]}}]}} - +{"Entity"{ENT[{"Scale"{sngArr[0.1,0.1,0.1]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[6,0.7,7.525]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"ModelPath"{str[models\boat\SSAqua]}}{"Rotation"{int[2]}}]}} +{"Entity"{ENT[{"Scale"{sngArr[0.2,0.2,0.2]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[6,0.7,10.5]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"ModelPath"{str[models\boat2\boat]}}{"Rotation"{int[2]}}]}} Big Red Button: {"EntityField"{ENT[{"Size"{intArr[1,1]}}{"Scale"{sngArr[0.2,0.2,0.2]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[15,0.2,6.5]}}{"TexturePath"{str[kolben]}}{"Textures"{recArr[[16,32,16,16][48,32,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0,0,0,1,1]}}{"Collision"{bool[0]}}{"ModelID"{int[1]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"RotationXYZ"{sngArr[1.57,1.57,1.57]}}]}} diff --git a/P3D/Content/Data/maps/liberty/garden.dat b/P3D/Content/Data/maps/liberty/garden.dat index 230121854..9773ed72b 100644 --- a/P3D/Content/Data/maps/liberty/garden.dat +++ b/P3D/Content/Data/maps/liberty/garden.dat @@ -292,7 +292,7 @@ Trees: {"EntityField"{ENT[{"EntityID"{str[WallBill]}}{"Position"{sngArr[31,2.05,8]}}{"Size"{intArr[3,3]}}{"SeasonTexture"{str[PlantColoringAlt]}}{"Scale"{sngArr[1.1,1.3,1.1]}}{"TexturePath"{str[park]}}{"Textures"{recArr[[64,64,32,32]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[3]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"Rotation"{int[0]}}]}} Boat: -{"EntityField"{ENT[{"Size"{intArr[1,1]}}{"Scale"{sngArr[1,1,1]}}{"EntityID"{str[ModelEntity]}}{"Position"{sngArr[0.7,-0.5,9]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[models\boat2\boat]}}{"Rotation"{int[0]}}]}} +{"Entity"{ENT[{"ID"{int[0]}}{"Scale"{sngArr[2,2,2]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[0,-1,9.375]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"ModelPath"{str[models\boat2\boat]}}{"Rotation"{int[2]}}]}} SlantW: {"EntityField"{ENT[{"EntityID"{str[WallBlock]}}{"Position"{sngArr[9,0,7]}}{"Size"{intArr[1,4]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[160,16,16,16]]}}{"TextureIndex"{intArr[-1,-1,-1,-1,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[2]}}{"Action"{int[0]}}{"AdditionalValue"{str[]}}{"Rotation"{int[1]}}]}} diff --git a/P3D/Content/Data/maps/olivine/dock.dat b/P3D/Content/Data/maps/olivine/dock.dat index 0f1a172bb..7519ee4e1 100644 Binary files a/P3D/Content/Data/maps/olivine/dock.dat and b/P3D/Content/Data/maps/olivine/dock.dat differ diff --git a/P3D/Content/Data/maps/quest/dock.dat b/P3D/Content/Data/maps/quest/dock.dat index 2ba823a39..62e238eb9 100644 --- a/P3D/Content/Data/maps/quest/dock.dat +++ b/P3D/Content/Data/maps/quest/dock.dat @@ -30,4 +30,4 @@ Fences: NPCs: {"NPC"{NPC[{"Position"{sngArr[5,0,2]}}{"TextureID"{str[32]}}{"ID"{int[0]}}{"Name"{str[GymGuy]}}{"Action"{int[1]}}{"AdditionalValue"{str[quest\dockguy]}}{"Rotation"{int[0]}}{"Movement"{str[Still]}}{"MoveRectangles"{recArr[]}}]}} -{"EntityField"{ENT[{"Size"{intArr[1,1]}}{"ID"{int[0]}}{"Scale"{sngArr[1,1,1]}}{"EntityID"{str[ModelEntity]}}{"Position"{sngArr[5.4,-0.75,5.7]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[models\boat2\boat]}}{"Rotation"{int[3]}}]}} +{"Entity"{ENT[{"ID"{int[0]}}{"Scale"{sngArr[2,2,2]}}{"EntityID"{str[WallBlock]}}{"Position"{sngArr[6.625,-1,5]}}{"TexturePath"{str[Routes]}}{"Textures"{recArr[[96,0,16,16]]}}{"TextureIndex"{intArr[0,0,0,0,0,0]}}{"Collision"{bool[1]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"ModelPath"{str[models\boat2\boat]}}{"Rotation"{int[1]}}]}} diff --git a/P3D/Content/Data/maps/speedboatscene.dat b/P3D/Content/Data/maps/speedboatscene.dat index d0787b574..189fc9386 100644 Binary files a/P3D/Content/Data/maps/speedboatscene.dat and b/P3D/Content/Data/maps/speedboatscene.dat differ diff --git a/P3D/Content/Data/maps/testlevel.dat b/P3D/Content/Data/maps/testlevel.dat index 3eeffb741..e2365b3f7 100644 Binary files a/P3D/Content/Data/maps/testlevel.dat and b/P3D/Content/Data/maps/testlevel.dat differ diff --git a/P3D/Content/Data/maps/underwatercave/surface.dat b/P3D/Content/Data/maps/underwatercave/surface.dat index f07debe87..6569fc34e 100644 Binary files a/P3D/Content/Data/maps/underwatercave/surface.dat and b/P3D/Content/Data/maps/underwatercave/surface.dat differ diff --git a/P3D/Content/Data/maps/vermilion/dock.dat b/P3D/Content/Data/maps/vermilion/dock.dat index 7653ff003..5a0930764 100644 Binary files a/P3D/Content/Data/maps/vermilion/dock.dat and b/P3D/Content/Data/maps/vermilion/dock.dat differ diff --git a/P3D/Content/Data/maps/vermilion/main.dat b/P3D/Content/Data/maps/vermilion/main.dat index 0d5aa8215..1bcdb0f4d 100644 Binary files a/P3D/Content/Data/maps/vermilion/main.dat and b/P3D/Content/Data/maps/vermilion/main.dat differ diff --git a/P3D/Content/Textures/Battle/Water/WaterGun.png b/P3D/Content/Textures/Battle/Water/WaterGun.png new file mode 100644 index 000000000..3d7317a4f Binary files /dev/null and b/P3D/Content/Textures/Battle/Water/WaterGun.png differ diff --git a/P3D/Entites/Entity.vb b/P3D/Entites/Entity.vb index 0b9455be3..3ae2d0410 100644 --- a/P3D/Entites/Entity.vb +++ b/P3D/Entites/Entity.vb @@ -18,7 +18,8 @@ Public TextureIndex() As Integer Public ActionValue As Integer Public AdditionalValue As String - Public Model As BaseModel + Public ModelPath As String = "" + Public Visible As Boolean = True Public Shader As New Vector3(1.0F) Public Shaders As New List(Of Vector3) @@ -35,14 +36,17 @@ Public isDancing As Boolean = False Public Opacity As Single = 1.0F - Private _normalOpactity As Single = 1.0F + Private _normalOpacity As Single = 1.0F + + Public BaseModel As BaseModel + Public Model As Model = Nothing Public Property NormalOpacity As Single Get - Return Me._normalOpactity + Return Me._normalOpacity End Get Set(value As Single) Me.Opacity = value - Me._normalOpactity = value + Me._normalOpacity = value End Set End Property @@ -77,7 +81,7 @@ MyBase.New(EntityTypes.Entity) End Sub - Public Sub New(ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal EntityID As String, ByVal Textures() As Texture2D, ByVal TextureIndex() As Integer, ByVal Collision As Boolean, ByVal Rotation As Integer, ByVal Scale As Vector3, ByVal Model As BaseModel, ByVal ActionValue As Integer, ByVal AdditionalValue As String, ByVal Shader As Vector3) + Public Sub New(ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal EntityID As String, ByVal Textures() As Texture2D, ByVal TextureIndex() As Integer, ByVal Collision As Boolean, ByVal Rotation As Integer, ByVal Scale As Vector3, ByVal BaseModel As BaseModel, ByVal ActionValue As Integer, ByVal AdditionalValue As String, ByVal Shader As Vector3, Optional ModelPath As String = "") MyBase.New(EntityTypes.Entity) Me.Position = New Vector3(X, Y, Z) @@ -87,7 +91,8 @@ Me.Collision = Collision Me.Rotation = GetRotationFromInteger(Rotation) Me.Scale = Scale - Me.Model = Model + Me.BaseModel = BaseModel + Me.ModelPath = ModelPath Me.ActionValue = ActionValue Me.AdditionalValue = AdditionalValue Me.Shader = Shader @@ -126,7 +131,7 @@ Me.UpdateEntity() End Sub - Public Shared Function GetNewEntity(ByVal EntityID As String, ByVal Position As Vector3, ByVal Textures() As Texture2D, ByVal TextureIndex() As Integer, ByVal Collision As Boolean, ByVal Rotation As Vector3, ByVal Scale As Vector3, ByVal Model As BaseModel, ByVal ActionValue As Integer, ByVal AdditionalValue As String, ByVal Visible As Boolean, ByVal Shader As Vector3, ByVal ID As Integer, ByVal MapOrigin As String, ByVal SeasonColorTexture As String, ByVal Offset As Vector3, Optional ByVal Params() As Object = Nothing, Optional ByVal Opacity As Single = 1.0F, Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing, Optional ByVal CameraDistanceDelta As Single = 0.0F) As Entity + Public Shared Function GetNewEntity(ByVal EntityID As String, ByVal Position As Vector3, ByVal Textures() As Texture2D, ByVal TextureIndex() As Integer, ByVal Collision As Boolean, ByVal Rotation As Vector3, ByVal Scale As Vector3, ByVal BaseModel As BaseModel, ByVal ActionValue As Integer, ByVal AdditionalValue As String, ByVal Visible As Boolean, ByVal Shader As Vector3, ByVal ID As Integer, ByVal MapOrigin As String, ByVal SeasonColorTexture As String, ByVal Offset As Vector3, Optional ByVal Params() As Object = Nothing, Optional ByVal Opacity As Single = 1.0F, Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing, Optional ByVal CameraDistanceDelta As Single = 0.0F, Optional ModelPath As String = "") As Entity Dim newEnt As New Entity() Dim propertiesEnt As New Entity() @@ -137,7 +142,8 @@ propertiesEnt.Collision = Collision propertiesEnt.Rotation = Rotation propertiesEnt.Scale = Scale - propertiesEnt.Model = Model + propertiesEnt.BaseModel = BaseModel + propertiesEnt.ModelPath = ModelPath propertiesEnt.ActionValue = ActionValue propertiesEnt.AdditionalValue = AdditionalValue propertiesEnt.Visible = Visible @@ -149,7 +155,11 @@ propertiesEnt.SeasonColorTexture = SeasonColorTexture propertiesEnt.Offset = Offset propertiesEnt.CameraDistanceDelta = CameraDistanceDelta - + If ModelManager.ModelExist(ModelPath) = True Then + propertiesEnt.Scale *= ModelManager.MODELSCALE + propertiesEnt.ModelPath = ModelPath + propertiesEnt.Model = ModelManager.GetModel(ModelPath) + End If Select Case EntityID.ToLower() Case "animatedblock" newEnt = New AnimatedBlock() @@ -280,6 +290,8 @@ newEnt.Collision = PropertiesEnt.Collision newEnt.Rotation = PropertiesEnt.Rotation newEnt.Scale = PropertiesEnt.Scale + newEnt.BaseModel = PropertiesEnt.BaseModel + newEnt.ModelPath = PropertiesEnt.ModelPath newEnt.Model = PropertiesEnt.Model newEnt.ActionValue = PropertiesEnt.ActionValue newEnt.AdditionalValue = PropertiesEnt.AdditionalValue @@ -332,26 +344,35 @@ End Sub Public Overridable Sub Update() - + UpdateModel() End Sub + Public Sub UpdateModel() + If Not Me.Model Is Nothing Then + ViewBox = New BoundingBox( + Vector3.Transform(New Vector3(-1, -1, -1), Matrix.CreateScale(viewBoxScale) * Matrix.CreateTranslation(Position)), + Vector3.Transform(New Vector3(1, 1, 1), Matrix.CreateScale(viewBoxScale) * Matrix.CreateTranslation(Position))) + + ApplyEffect() + End If + End Sub Public Overridable Sub OpacityCheck() If Me.CameraDistance > 10.0F Or Screen.Level.OwnPlayer IsNot Nothing AndAlso CameraDistance > Screen.Level.OwnPlayer.CameraDistance Then - Me.Opacity = Me._normalOpactity + Me.Opacity = Me._normalOpacity Exit Sub End If Dim notNames() As String = {"Floor", "OwnPlayer", "Water", "Whirlpool", "Particle", "OverworldPokemon", "ItemObject", "NetworkPokemon", "NetworkPlayer"} If Screen.Camera.Name = "Overworld" AndAlso notNames.Contains(Me.EntityID) = False Then - Me.Opacity = Me._normalOpactity + Me.Opacity = Me._normalOpacity If CType(Screen.Camera, OverworldCamera).ThirdPerson = True Then Dim Ray As Ray = Screen.Camera.Ray Dim result As Single? = Ray.Intersects(Me.boundingBox) If result.HasValue = True Then If result.Value < 0.3F + (CType(Screen.Camera, OverworldCamera).ThirdPersonOffset.Z - 1.5F) Then - Me.Opacity = Me._normalOpactity - 0.5F + Me.Opacity = Me._normalOpacity - 0.5F If Me.Opacity < 0.3F Then Me.Opacity = 0.3F End If @@ -495,8 +516,8 @@ If CreatedWorld = False Or CreateWorldEveryFrame = True Then Dim v As Vector3 = Vector3.Zero '(Me.ViewBox.Min - Me.Position) + (Me.ViewBox.Max - Me.Position) - If Not Me.Model Is Nothing Then - Select Case Me.Model.ID + If Not Me.BaseModel Is Nothing Then + Select Case Me.BaseModel.ID Case 0, 9, 10, 11 v.Y -= 0.5F End Select @@ -507,28 +528,35 @@ Return Me.tempCenterVector End Function - Public Overridable Sub Draw(ByVal Model As BaseModel, ByVal Textures() As Texture2D, ByVal setRasterizerState As Boolean) + Public Overridable Sub Draw(ByVal BaseModel As BaseModel, ByVal Textures() As Texture2D, ByVal setRasterizerState As Boolean, Optional Model As Model = Nothing) If Visible = True Then - If Me.IsInFieldOfView() = True Then - If setRasterizerState = True Then - Core.GraphicsDevice.RasterizerState = newRasterizerState - End If - - Model.Draw(Me, Textures) - - If setRasterizerState = True Then - Core.GraphicsDevice.RasterizerState = oldRasterizerState - End If - - Me.DrawnLastFrame = True - - If Me.EntityID <> "Floor" And Me.EntityID <> "Water" Then - If drawViewBox = True Then - BoundingBoxRenderer.Render(ViewBox, GraphicsDevice, Screen.Camera.View, Screen.Camera.Projection, Microsoft.Xna.Framework.Color.LightCoral) - End If + If Not Model Is Nothing Then + Model.Draw(Me.World, Screen.Camera.View, Screen.Camera.Projection) + If drawViewBox = True Then + BoundingBoxRenderer.Render(ViewBox, Core.GraphicsDevice, Screen.Camera.View, Screen.Camera.Projection, Microsoft.Xna.Framework.Color.Red) End If Else - Me.DrawnLastFrame = False + If Me.IsInFieldOfView() = True Then + If setRasterizerState = True Then + Core.GraphicsDevice.RasterizerState = newRasterizerState + End If + + BaseModel.Draw(Me, Textures) + + If setRasterizerState = True Then + Core.GraphicsDevice.RasterizerState = oldRasterizerState + End If + + Me.DrawnLastFrame = True + + If Me.EntityID <> "Floor" And Me.EntityID <> "Water" Then + If drawViewBox = True Then + BoundingBoxRenderer.Render(ViewBox, GraphicsDevice, Screen.Camera.View, Screen.Camera.Projection, Microsoft.Xna.Framework.Color.LightCoral) + End If + End If + Else + Me.DrawnLastFrame = False + End If End If Else Me.DrawnLastFrame = False @@ -581,8 +609,8 @@ Public ReadOnly Property VertexCount() As Integer Get If Me._cachedVertexCount = -1 Then - If Not Me.Model Is Nothing Then - Dim c As Integer = CInt(Me.Model.vertexBuffer.VertexCount / 3) + If Not Me.BaseModel Is Nothing Then + Dim c As Integer = CInt(Me.BaseModel.vertexBuffer.VertexCount / 3) Dim min As Integer = 0 For i = 0 To Me.TextureIndex.Length - 1 @@ -617,4 +645,31 @@ Return Nothing End Function + Public Sub ApplyEffect() + If Not Me.Model Is Nothing Then + For Each mesh As ModelMesh In Me.Model.Meshes + For Each part As ModelMeshPart In mesh.MeshParts + If part.Effect.GetType().Name.ToLower() = Screen.Effect.GetType().Name.ToLower() Then + With CType(part.Effect, BasicEffect) + Lighting.UpdateLighting(CType(part.Effect, BasicEffect), True) + + .DiffuseColor = Screen.Effect.DiffuseColor + + If Not Screen.Level.World Is Nothing Then + If Screen.Level.World.EnvironmentType = P3D.World.EnvironmentTypes.Outside Then + .DiffuseColor *= SkyDome.GetDaytimeColor(True).ToVector3() + End If + End If + + .FogEnabled = True + .FogColor = Screen.Effect.FogColor + .FogEnd = Screen.Effect.FogEnd + .FogStart = Screen.Effect.FogStart + End With + End If + Next + Next + End If + End Sub + End Class diff --git a/P3D/Entites/Enviroment/AllSidesObject.vb b/P3D/Entites/Enviroment/AllSidesObject.vb index 2cdb8981e..aff93ad2d 100644 --- a/P3D/Entites/Enviroment/AllSidesObject.vb +++ b/P3D/Entites/Enviroment/AllSidesObject.vb @@ -3,7 +3,11 @@ Inherits Entity Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, True) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/AnimatedBlock.vb b/P3D/Entites/Enviroment/AnimatedBlock.vb index e7067517c..d37af40dc 100644 --- a/P3D/Entites/Enviroment/AnimatedBlock.vb +++ b/P3D/Entites/Enviroment/AnimatedBlock.vb @@ -220,9 +220,12 @@ End Sub Public Overrides Sub Render() - Dim setRasterizerState As Boolean = Me.Model.ID <> 0 - - Me.Draw(Me.Model, Textures, setRasterizerState) + Dim setRasterizerState As Boolean = Me.BaseModel.ID <> 0 + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, setRasterizerState) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/ApricornPlant.vb b/P3D/Entites/Enviroment/ApricornPlant.vb index 596b2603e..d2adb08bc 100644 --- a/P3D/Entites/Enviroment/ApricornPlant.vb +++ b/P3D/Entites/Enviroment/ApricornPlant.vb @@ -38,6 +38,11 @@ End While r = New Rectangle(x * 16, y * 16, 16, 16) + If ModelManager.ModelExist(Me.ModelPath & "_" & (y + x)) = True Then + Me.Model = ModelManager.GetModel(Me.ModelPath & "_" & (y + x)) + Me.NeedsUpdate = True + ApplyEffect() + End If End If Textures(0) = TextureManager.GetTexture("Apricorn", r) @@ -116,7 +121,11 @@ End Sub Public Overrides Sub Render() - Draw(Model, Textures, False) + If Me.Model Is Nothing Then + Draw(BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public Overrides Sub ClickFunction() diff --git a/P3D/Entites/Enviroment/BerryPlant.vb b/P3D/Entites/Enviroment/BerryPlant.vb index c76484758..3b9d5a326 100644 --- a/P3D/Entites/Enviroment/BerryPlant.vb +++ b/P3D/Entites/Enviroment/BerryPlant.vb @@ -87,7 +87,6 @@ NewTexture() End If End If - Me.LastUpdateDate = Date.Now End Sub @@ -205,7 +204,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Private Sub RemoveBerry() diff --git a/P3D/Entites/Enviroment/CutDownTree.vb b/P3D/Entites/Enviroment/CutDownTree.vb index 1961b8722..cdeb92f0e 100644 --- a/P3D/Entites/Enviroment/CutDownTree.vb +++ b/P3D/Entites/Enviroment/CutDownTree.vb @@ -73,7 +73,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/DiveTile.vb b/P3D/Entites/Enviroment/DiveTile.vb index 65069326c..08950d8a8 100644 --- a/P3D/Entites/Enviroment/DiveTile.vb +++ b/P3D/Entites/Enviroment/DiveTile.vb @@ -110,7 +110,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/Floor.vb b/P3D/Entites/Enviroment/Floor.vb index 4ed8b5282..227433252 100644 --- a/P3D/Entites/Enviroment/Floor.vb +++ b/P3D/Entites/Enviroment/Floor.vb @@ -54,8 +54,11 @@ ChangeSand() End If End If - - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Private Shared FloorDictionary As New Dictionary(Of String, Entity) @@ -96,7 +99,7 @@ If hasEntityOnAllSides = False Then Me.Textures = {P3D.TextureManager.GetTexture("Routes", New Rectangle(208, 16, 16, 2)), P3D.TextureManager.GetTexture("Routes", New Rectangle(208, 16, 16, 16))} - Me.Model = BaseModel.BlockModel + Me.BaseModel = BaseModel.BlockModel Me.TextureIndex = {sides(0), sides(0), sides(1), sides(1), sides(2), sides(2), sides(3), sides(3), 1, 1} Me.Scale = New Vector3(1, 0.1F, 1) Me.Position.Y -= 0.45F @@ -153,7 +156,7 @@ If hasEntityOnAllSides = False Then Me.Textures = {P3D.TextureManager.GetTexture("Routes", New Rectangle(240, 80, 16, 2)), P3D.TextureManager.GetTexture("Routes", New Rectangle(240, 80, 16, 16))} - Me.Model = BaseModel.BlockModel + Me.BaseModel = BaseModel.BlockModel Me.TextureIndex = {sides(0), sides(0), sides(1), sides(1), sides(2), sides(2), sides(3), sides(3), 1, 1} Me.Scale = New Vector3(1, 0.1F, 1) Me.Position.Y -= 0.45F diff --git a/P3D/Entites/Enviroment/Grass.vb b/P3D/Entites/Enviroment/Grass.vb index 72edf41c3..2043417f3 100644 --- a/P3D/Entites/Enviroment/Grass.vb +++ b/P3D/Entites/Enviroment/Grass.vb @@ -22,7 +22,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public Shared Function GetGrassTilesAroundPlayer(ByVal radius As Single) As List(Of Entity) diff --git a/P3D/Entites/Enviroment/HeadbuttTree.vb b/P3D/Entites/Enviroment/HeadbuttTree.vb index 10ac3653f..d09f97f31 100644 --- a/P3D/Entites/Enviroment/HeadbuttTree.vb +++ b/P3D/Entites/Enviroment/HeadbuttTree.vb @@ -78,7 +78,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/ItemObject.vb b/P3D/Entites/Enviroment/ItemObject.vb index 80b9bb211..7ec86a292 100644 --- a/P3D/Entites/Enviroment/ItemObject.vb +++ b/P3D/Entites/Enviroment/ItemObject.vb @@ -155,7 +155,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public Shared Function ItemExists(ByVal ItemObject As ItemObject) As Boolean diff --git a/P3D/Entites/Enviroment/LoamySoil.vb b/P3D/Entites/Enviroment/LoamySoil.vb index 17cbaac58..ab62997bc 100644 --- a/P3D/Entites/Enviroment/LoamySoil.vb +++ b/P3D/Entites/Enviroment/LoamySoil.vb @@ -4,8 +4,11 @@ Public Overrides Sub Initialize() MyBase.Initialize() - - Me.Visible = False + If Me.Model Is Nothing Then + Me.Visible = False + Else + Me.Visible = True + End If End Sub Public Overrides Sub ClickFunction() @@ -50,7 +53,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/ModelEntity.vb b/P3D/Entites/Enviroment/ModelEntity.vb index 37583d1b5..6accd4f72 100644 --- a/P3D/Entites/Enviroment/ModelEntity.vb +++ b/P3D/Entites/Enviroment/ModelEntity.vb @@ -24,32 +24,6 @@ ApplyEffect() End Sub - Private Sub ApplyEffect() - If Not _model Is Nothing Then - For Each mesh As ModelMesh In Me._model.Meshes - For Each part As ModelMeshPart In mesh.MeshParts - If part.Effect.GetType().Name.ToLower() = Screen.Effect.GetType().Name.ToLower() Then - With CType(part.Effect, BasicEffect) - Lighting.UpdateLighting(CType(part.Effect, BasicEffect), True) - - .DiffuseColor = Screen.Effect.DiffuseColor - - If Not Screen.Level.World Is Nothing Then - If Screen.Level.World.EnvironmentType = P3D.World.EnvironmentTypes.Outside Then - .DiffuseColor *= SkyDome.GetDaytimeColor(True).ToVector3() - End If - End If - - .FogEnabled = True - .FogColor = Screen.Effect.FogColor - .FogEnd = Screen.Effect.FogEnd - .FogStart = Screen.Effect.FogStart - End With - End If - Next - Next - End If - End Sub Public Overrides Sub Update() ViewBox = New BoundingBox( diff --git a/P3D/Entites/Enviroment/RockClimbEntity.vb b/P3D/Entites/Enviroment/RockClimbEntity.vb index 76ccb456b..a60a760fa 100644 --- a/P3D/Entites/Enviroment/RockClimbEntity.vb +++ b/P3D/Entites/Enviroment/RockClimbEntity.vb @@ -228,7 +228,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/RotationTile.vb b/P3D/Entites/Enviroment/RotationTile.vb index 94e0562a5..257a32e53 100644 --- a/P3D/Entites/Enviroment/RotationTile.vb +++ b/P3D/Entites/Enviroment/RotationTile.vb @@ -42,6 +42,7 @@ End If End If End If + UpdateModel() End Sub Private Function GetSteps() As Integer @@ -85,7 +86,11 @@ theend: End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public Overrides Function LetPlayerMove() As Boolean diff --git a/P3D/Entites/Enviroment/ScriptBlock.vb b/P3D/Entites/Enviroment/ScriptBlock.vb index 2effa0afa..ccada86b9 100644 --- a/P3D/Entites/Enviroment/ScriptBlock.vb +++ b/P3D/Entites/Enviroment/ScriptBlock.vb @@ -119,7 +119,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, True) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public ReadOnly Property ScriptID() As String diff --git a/P3D/Entites/Enviroment/SignBlock.vb b/P3D/Entites/Enviroment/SignBlock.vb index 1a93a3122..ff34fdf78 100644 --- a/P3D/Entites/Enviroment/SignBlock.vb +++ b/P3D/Entites/Enviroment/SignBlock.vb @@ -52,7 +52,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, True) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/SlideBlock.vb b/P3D/Entites/Enviroment/SlideBlock.vb index 958427fe1..833cb89e1 100644 --- a/P3D/Entites/Enviroment/SlideBlock.vb +++ b/P3D/Entites/Enviroment/SlideBlock.vb @@ -164,7 +164,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/SmashRock.vb b/P3D/Entites/Enviroment/SmashRock.vb index 2214559bb..196c081bc 100644 --- a/P3D/Entites/Enviroment/SmashRock.vb +++ b/P3D/Entites/Enviroment/SmashRock.vb @@ -156,7 +156,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Me.Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Me.Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/StepBlock.vb b/P3D/Entites/Enviroment/StepBlock.vb index 7196b96af..5a55a0f5b 100644 --- a/P3D/Entites/Enviroment/StepBlock.vb +++ b/P3D/Entites/Enviroment/StepBlock.vb @@ -27,7 +27,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/StrengthRock.vb b/P3D/Entites/Enviroment/StrengthRock.vb index 130d726b3..bb98a31cf 100644 --- a/P3D/Entites/Enviroment/StrengthRock.vb +++ b/P3D/Entites/Enviroment/StrengthRock.vb @@ -126,7 +126,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/StrengthTrigger.vb b/P3D/Entites/Enviroment/StrengthTrigger.vb index 197f7c900..3a718757f 100644 --- a/P3D/Entites/Enviroment/StrengthTrigger.vb +++ b/P3D/Entites/Enviroment/StrengthTrigger.vb @@ -69,7 +69,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, True) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/TurningSign.vb b/P3D/Entites/Enviroment/TurningSign.vb index e3e395896..1cb4bbd92 100644 --- a/P3D/Entites/Enviroment/TurningSign.vb +++ b/P3D/Entites/Enviroment/TurningSign.vb @@ -37,7 +37,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, True) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, True) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/WallBill.vb b/P3D/Entites/Enviroment/WallBill.vb index 8b3bdd1a9..c256cd787 100644 --- a/P3D/Entites/Enviroment/WallBill.vb +++ b/P3D/Entites/Enviroment/WallBill.vb @@ -16,7 +16,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/WallBlock.vb b/P3D/Entites/Enviroment/WallBlock.vb index 2cd0db2b4..75b0824e0 100644 --- a/P3D/Entites/Enviroment/WallBlock.vb +++ b/P3D/Entites/Enviroment/WallBlock.vb @@ -7,7 +7,11 @@ End Function Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/WarpBlock.vb b/P3D/Entites/Enviroment/WarpBlock.vb index 783637500..21a5b67bb 100644 --- a/P3D/Entites/Enviroment/WarpBlock.vb +++ b/P3D/Entites/Enviroment/WarpBlock.vb @@ -3,7 +3,11 @@ Inherits Entity Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Public Overrides Function WalkAgainstFunction() As Boolean diff --git a/P3D/Entites/Enviroment/Water.vb b/P3D/Entites/Enviroment/Water.vb index c40160eb9..5e8388bd3 100644 --- a/P3D/Entites/Enviroment/Water.vb +++ b/P3D/Entites/Enviroment/Water.vb @@ -252,9 +252,12 @@ End Sub Public Overrides Sub Render() - Dim setRasterizerState As Boolean = Me.Model.ID <> 0 - - Me.Draw(Me.Model, Textures, setRasterizerState) + Dim setRasterizerState As Boolean = Me.BaseModel.ID <> 0 + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, setRasterizerState) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Enviroment/Waterfall.vb b/P3D/Entites/Enviroment/Waterfall.vb index 83300afc6..7904ba83b 100644 --- a/P3D/Entites/Enviroment/Waterfall.vb +++ b/P3D/Entites/Enviroment/Waterfall.vb @@ -153,7 +153,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Private Function ReturnWaterFallPokemonName() As Pokemon diff --git a/P3D/Entites/Enviroment/Whirlpool.vb b/P3D/Entites/Enviroment/Whirlpool.vb index b03ae79c7..fd8dee75d 100644 --- a/P3D/Entites/Enviroment/Whirlpool.vb +++ b/P3D/Entites/Enviroment/Whirlpool.vb @@ -31,15 +31,18 @@ End Sub Public Overrides Sub UpdateEntity() - If Not WaterAnimation Is Nothing Then - WaterAnimation.Update(0.01) - If currentRectangle <> WaterAnimation.TextureRectangle Then - ChangeTexture() + If Me.Model Is Nothing Then + If Not WaterAnimation Is Nothing Then + WaterAnimation.Update(0.01) + If currentRectangle <> WaterAnimation.TextureRectangle Then + ChangeTexture() - currentRectangle = WaterAnimation.TextureRectangle + currentRectangle = WaterAnimation.TextureRectangle + End If End If + Else + Me.Rotation.Y += 0.01F End If - MyBase.UpdateEntity() End Sub @@ -62,7 +65,11 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Textures, False) + If Me.Model Is Nothing Then + Me.Draw(Me.BaseModel, Textures, False) + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub Private Function ReturnWhirlPoolPokemonName() As String diff --git a/P3D/Entites/Other/MessageBulb.vb b/P3D/Entites/Other/MessageBulb.vb index 9213c791b..09099c3ef 100644 --- a/P3D/Entites/Other/MessageBulb.vb +++ b/P3D/Entites/Other/MessageBulb.vb @@ -100,7 +100,7 @@ End Sub Public Overrides Sub Render() - Me.Draw(Me.Model, Me.Textures, True) + Me.Draw(Me.BaseModel, Me.Textures, True) End Sub End Class \ No newline at end of file diff --git a/P3D/Entites/Other/NPC.vb b/P3D/Entites/Other/NPC.vb index a26840f1e..3c3333439 100644 --- a/P3D/Entites/Other/NPC.vb +++ b/P3D/Entites/Other/NPC.vb @@ -472,18 +472,28 @@ End Function Public Overrides Sub UpdateEntity() - If Me.Rotation.Y <> Screen.Camera.Yaw Then - Me.Rotation.Y = Screen.Camera.Yaw + If Me.Model Is Nothing Then + If Me.Rotation.Y <> Screen.Camera.Yaw Then + Me.Rotation.Y = Screen.Camera.Yaw + End If + Else + If Me.Rotation.Y <> faceRotation Then + Me.Rotation.Y = GetRotationFromInteger(faceRotation).Y + End If End If MyBase.UpdateEntity() End Sub Public Overrides Sub Render() - Dim state = GraphicsDevice.DepthStencilState - GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead - Draw(Me.Model, Me.Textures, True) - GraphicsDevice.DepthStencilState = state + If Me.Model Is Nothing Then + Dim state = GraphicsDevice.DepthStencilState + GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead + Draw(Me.BaseModel, Me.Textures, True) + GraphicsDevice.DepthStencilState = state + Else + Draw(Me.BaseModel, Me.Textures, True, Me.Model) + End If End Sub #Region "Movement and Camera" diff --git a/P3D/Entites/Other/NetworkPlayer.vb b/P3D/Entites/Other/NetworkPlayer.vb index 135f1988d..60dc25a43 100644 --- a/P3D/Entites/Other/NetworkPlayer.vb +++ b/P3D/Entites/Other/NetworkPlayer.vb @@ -250,7 +250,7 @@ Public Overrides Sub Render() If ConnectScreen.Connected = True Then If IsCorrectScreen() = True Then - Me.Draw(Me.Model, Textures, False) + Me.Draw(Me.BaseModel, Textures, False) If Core.GameOptions.ShowGUI = True Then If Me.NameTexture IsNot Nothing Then Dim state = GraphicsDevice.DepthStencilState diff --git a/P3D/Entites/Other/NetworkPokemon.vb b/P3D/Entites/Other/NetworkPokemon.vb index 9682b7ec9..78edf170f 100644 --- a/P3D/Entites/Other/NetworkPokemon.vb +++ b/P3D/Entites/Other/NetworkPokemon.vb @@ -87,7 +87,7 @@ If Me.Textures IsNot Nothing Then Dim state = GraphicsDevice.DepthStencilState GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead - Draw(Me.Model, {Me.Textures(0)}, False) + Draw(Me.BaseModel, {Me.Textures(0)}, False) GraphicsDevice.DepthStencilState = state End If End If diff --git a/P3D/Entites/Other/OverworldPokemon.vb b/P3D/Entites/Other/OverworldPokemon.vb index 6cd0fe9e1..9454a21f3 100644 --- a/P3D/Entites/Other/OverworldPokemon.vb +++ b/P3D/Entites/Other/OverworldPokemon.vb @@ -125,7 +125,7 @@ Public Class OverworldPokemon If Me.IsVisible() = True Then Dim state = GraphicsDevice.DepthStencilState GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead - Draw(Me.Model, {Me.Textures(0)}, False) + Draw(Me.BaseModel, {Me.Textures(0)}, False) GraphicsDevice.DepthStencilState = state End If End Sub diff --git a/P3D/Entites/Other/OwnPlayer.vb b/P3D/Entites/Other/OwnPlayer.vb index 94c74c9e3..d56e672a9 100644 --- a/P3D/Entites/Other/OwnPlayer.vb +++ b/P3D/Entites/Other/OwnPlayer.vb @@ -193,7 +193,7 @@ If InCameraFocus() = True Then Dim state = GraphicsDevice.DepthStencilState GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead - Draw(Me.Model, Me.Textures, True) + Draw(Me.BaseModel, Me.Textures, True) GraphicsDevice.DepthStencilState = state End If End Sub diff --git a/P3D/Entites/Other/Particle.vb b/P3D/Entites/Other/Particle.vb index b9c0ce0fd..6c4f04393 100644 --- a/P3D/Entites/Other/Particle.vb +++ b/P3D/Entites/Other/Particle.vb @@ -103,7 +103,7 @@ End Sub Public Overrides Sub Render() - MyBase.Draw(Me.Model, Me.Textures, False) + MyBase.Draw(Me.BaseModel, Me.Textures, False) End Sub End Class \ No newline at end of file diff --git a/P3D/Overworld/Minimap.vb b/P3D/Overworld/Minimap.vb index b2ff58c80..e4cd97f9c 100644 --- a/P3D/Overworld/Minimap.vb +++ b/P3D/Overworld/Minimap.vb @@ -97,7 +97,7 @@ Dim i As Integer = 0 - Select Case e.Model.ID + Select Case e.BaseModel.ID Case 0 i = 0 Case 1 diff --git a/P3D/Pokemon/Attacks/Attack.vb b/P3D/Pokemon/Attacks/Attack.vb index 526230bf9..daf456644 100644 --- a/P3D/Pokemon/Attacks/Attack.vb +++ b/P3D/Pokemon/Attacks/Attack.vb @@ -2168,7 +2168,7 @@ Dim BattleFlip As Boolean = False Dim CurrentPokemon As Pokemon = BattleScreen.OwnPokemon Dim CurrentEntity As NPC = BattleScreen.OwnPokemonNPC - Dim CurrentModel As ModelEntity = BattleScreen.OwnPokemonModel + Dim CurrentModel As Entity = BattleScreen.OwnPokemonModel If own = False Then BattleFlip = True CurrentPokemon = BattleScreen.OppPokemon @@ -2179,7 +2179,7 @@ End If End Sub - Public Overridable Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overridable Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) 'Override this method in the attack class to insert the move animation query objects into the queue. End Sub @@ -2188,7 +2188,7 @@ Dim BattleFlip As Boolean = False Dim CurrentPokemon As Pokemon = BattleScreen.OppPokemon Dim CurrentEntity As NPC = BattleScreen.OppPokemonNPC - Dim CurrentModel As ModelEntity = BattleScreen.OppPokemonModel + Dim CurrentModel As Entity = BattleScreen.OppPokemonModel If own = False Then BattleFlip = True CurrentPokemon = BattleScreen.OwnPokemon @@ -2199,7 +2199,7 @@ End If End Sub - Public Overridable Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overridable Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) 'Override this method in the attack class to insert the move animation query objects into the queue. End Sub diff --git a/P3D/Pokemon/Attacks/Fire/Ember.vb b/P3D/Pokemon/Attacks/Fire/Ember.vb index 720eee0e3..3cd1badab 100644 --- a/P3D/Pokemon/Attacks/Fire/Ember.vb +++ b/P3D/Pokemon/Attacks/Fire/Ember.vb @@ -63,7 +63,7 @@ End If End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim TextureYOffset As Integer = 0 If BattleFlip = True Then @@ -80,7 +80,7 @@ BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim TextureYOffset As Integer = 0 If BattleFlip = True Then diff --git a/P3D/Pokemon/Attacks/Grass/Absorb.vb b/P3D/Pokemon/Attacks/Grass/Absorb.vb index efd2552a5..2d5ee4ab3 100644 --- a/P3D/Pokemon/Attacks/Grass/Absorb.vb +++ b/P3D/Pokemon/Attacks/Grass/Absorb.vb @@ -92,7 +92,7 @@ End If End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim maxAmount As Integer = 12 Dim currentAmount As Integer = 0 diff --git a/P3D/Pokemon/Attacks/Grass/VineWhip.vb b/P3D/Pokemon/Attacks/Grass/VineWhip.vb index 74cdd7d97..e81217411 100644 --- a/P3D/Pokemon/Attacks/Grass/VineWhip.vb +++ b/P3D/Pokemon/Attacks/Grass/VineWhip.vb @@ -51,7 +51,7 @@ Me.IsWonderGuardAffected = True '#End End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip, CurrentModel) MoveAnimation.AnimationPlaySound("Battle\Attacks\Grass\VineWhip_Start", 0.5, 2.5) MoveAnimation.AnimationMove(Nothing, False, 0, 0, -0.1, 0.025, False, False, 0, 0.5) @@ -59,7 +59,7 @@ BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Grass\VineWhip_Hit", 0, 2.5) Dim TextureXOffset As Integer = 0 diff --git a/P3D/Pokemon/Attacks/Normal/Attract.vb b/P3D/Pokemon/Attacks/Normal/Attract.vb index 496f977b2..fe8933fa2 100644 --- a/P3D/Pokemon/Attacks/Normal/Attract.vb +++ b/P3D/Pokemon/Attacks/Normal/Attract.vb @@ -76,7 +76,7 @@ End If End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation = New AnimationQueryObject(CurrentEntity, BattleFlip) For i = 0 To 6 Dim HeartEntity = MoveAnimation.SpawnEntity(Nothing, TextureManager.GetTexture("Textures\Battle\Normal\Attract"), New Vector3(0.25F), 1.0F, CSng(i * 0.2)) @@ -89,7 +89,7 @@ BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation = New AnimationQueryObject(CurrentEntity, BattleFlip) For i = 0 To 6 diff --git a/P3D/Pokemon/Attacks/Normal/Bind.vb b/P3D/Pokemon/Attacks/Normal/Bind.vb index e50542ea6..f890313ed 100644 --- a/P3D/Pokemon/Attacks/Normal/Bind.vb +++ b/P3D/Pokemon/Attacks/Normal/Bind.vb @@ -87,7 +87,7 @@ Namespace BattleSystem.Moves.Normal End If End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Bind", 5.0F, 0) Dim BindEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.2, 0), TextureManager.GetTexture("Textures\Battle\Normal\Bind", New Rectangle(0, 0, 80, 40), ""), New Vector3(1.0F, 0.5F, 1.0F), 1, 0, 0.75) diff --git a/P3D/Pokemon/Attacks/Normal/Growl.vb b/P3D/Pokemon/Attacks/Normal/Growl.vb index 1494b77ad..2e943f380 100644 --- a/P3D/Pokemon/Attacks/Normal/Growl.vb +++ b/P3D/Pokemon/Attacks/Normal/Growl.vb @@ -62,7 +62,7 @@ End If End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound(CStr(CurrentPokemon.Number), 0, 0,, True) diff --git a/P3D/Pokemon/Attacks/Normal/Leer.vb b/P3D/Pokemon/Attacks/Normal/Leer.vb index 8278ace81..b26faddb2 100644 --- a/P3D/Pokemon/Attacks/Normal/Leer.vb +++ b/P3D/Pokemon/Attacks/Normal/Leer.vb @@ -63,7 +63,7 @@ End If End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Leer", 0, 0) Dim SpawnEntity = MoveAnimation.SpawnEntity(New Vector3(0, 0.1, 0.1), TextureManager.GetTexture("Textures\Battle\Normal\Leer"), New Vector3(0.5F), 1.0F, 0, 2) @@ -74,7 +74,7 @@ MoveAnimation.AnimationFade(SpawnEntity, True, 1.0F, False, 0.0F, 2, 0) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip, CurrentModel) MoveAnimation.AnimationMove(Nothing, False, 0, 0, -0.1, 0.025, False, False, 0, 0.5) MoveAnimation.AnimationMove(Nothing, False, 0, 0, 0.1, 0.025, False, False, 0.75, 0.5) diff --git a/P3D/Pokemon/Attacks/Normal/Pound.vb b/P3D/Pokemon/Attacks/Normal/Pound.vb index 5acd68c02..57048ceba 100644 --- a/P3D/Pokemon/Attacks/Normal/Pound.vb +++ b/P3D/Pokemon/Attacks/Normal/Pound.vb @@ -55,7 +55,7 @@ Me.AIField2 = AIField.Nothing End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Pound", 0.5, 2.5) Dim PoundEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.2, 0), TextureManager.GetTexture("Textures\Battle\Normal\Pound"), New Vector3(0.5F), 1, 0, 3) diff --git a/P3D/Pokemon/Attacks/Normal/Scratch.vb b/P3D/Pokemon/Attacks/Normal/Scratch.vb index 4cc5328ea..7f702314c 100644 --- a/P3D/Pokemon/Attacks/Normal/Scratch.vb +++ b/P3D/Pokemon/Attacks/Normal/Scratch.vb @@ -52,7 +52,7 @@ '#End End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Scratch", 0.5, 2.5) Dim TextureXOffset As Integer = 0 diff --git a/P3D/Pokemon/Attacks/Normal/Tackle.vb b/P3D/Pokemon/Attacks/Normal/Tackle.vb index 9db1f6f88..37993b5d5 100644 --- a/P3D/Pokemon/Attacks/Normal/Tackle.vb +++ b/P3D/Pokemon/Attacks/Normal/Tackle.vb @@ -52,14 +52,14 @@ '#End End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip, CurrentModel) MoveAnimation.AnimationMove(Nothing, False, -0.5F, 0, 0, 0.3F, False, False, 0, 0,,, 2) MoveAnimation.AnimationMove(Nothing, False, 0, 0, 0, 0.3F, False, False, 1, 0,,, 2) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Tackle", 0, 0) Dim SpawnEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.2, 0), TextureManager.GetTexture("Textures\Battle\Normal\Tackle"), New Vector3(0.5F), 1.0F, 0, 2) diff --git a/P3D/Pokemon/Attacks/Normal/Wrap.vb b/P3D/Pokemon/Attacks/Normal/Wrap.vb index 534165c7e..1a5e0f99f 100644 --- a/P3D/Pokemon/Attacks/Normal/Wrap.vb +++ b/P3D/Pokemon/Attacks/Normal/Wrap.vb @@ -87,7 +87,7 @@ End If End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Wrap", 5.0F, 0) Dim WrapEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.2, 0), TextureManager.GetTexture("Textures\Battle\Normal\Wrap", New Rectangle(0, 0, 80, 40), ""), New Vector3(1.0F, 0.5F, 1.0F), 1, 0, 0.75) diff --git a/P3D/Pokemon/Attacks/Poison/PoisonSting.vb b/P3D/Pokemon/Attacks/Poison/PoisonSting.vb index bc2c39043..745fa6993 100644 --- a/P3D/Pokemon/Attacks/Poison/PoisonSting.vb +++ b/P3D/Pokemon/Attacks/Poison/PoisonSting.vb @@ -65,7 +65,7 @@ End If End Sub - Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim TextureYOffset As Integer = 0 @@ -80,7 +80,7 @@ BattleScreen.BattleQuery.Add(MoveAnimation) End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim TextureYOffset As Integer = 0 diff --git a/P3D/Pokemon/Attacks/Water/Clamp.vb b/P3D/Pokemon/Attacks/Water/Clamp.vb index 25066b13d..8ee63149a 100644 --- a/P3D/Pokemon/Attacks/Water/Clamp.vb +++ b/P3D/Pokemon/Attacks/Water/Clamp.vb @@ -87,7 +87,7 @@ Namespace BattleSystem.Moves.Water End If End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim offsetLeft As Single = -0.35 Dim offsetRight As Single = 0.35 diff --git a/P3D/Pokemon/Attacks/Water/Whirlpool.vb b/P3D/Pokemon/Attacks/Water/Whirlpool.vb index 88fed6eee..54e6a4caf 100644 --- a/P3D/Pokemon/Attacks/Water/Whirlpool.vb +++ b/P3D/Pokemon/Attacks/Water/Whirlpool.vb @@ -99,7 +99,7 @@ Namespace BattleSystem.Moves.Water End If End If End Sub - Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) + Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As Entity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip,, True) MoveAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0) Dim WhirlpoolEntity As Entity = MoveAnimation.SpawnEntity(New Vector3(0, -0.3F, 0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F) diff --git a/P3D/Pokemon/Monster/Pokemon.vb b/P3D/Pokemon/Monster/Pokemon.vb index 3be87730a..59e21eca5 100644 --- a/P3D/Pokemon/Monster/Pokemon.vb +++ b/P3D/Pokemon/Monster/Pokemon.vb @@ -2684,7 +2684,6 @@ Public Class Pokemon z = -8 Case 143 scale = 0.5 - roll = 1.2F Case 144 z = -9 scale = 0.35 diff --git a/P3D/Resources/ModelManager.vb b/P3D/Resources/ModelManager.vb index f31383b52..2cb6abe57 100644 --- a/P3D/Resources/ModelManager.vb +++ b/P3D/Resources/ModelManager.vb @@ -1,7 +1,7 @@ Public Class ModelManager Shared ModelList As New Dictionary(Of String, Model) - + Public Const MODELSCALE As Single = 0.00625F Public Shared Function GetModel(ByVal Path As String) As Model Dim cContent As ContentManager = ContentPackManager.GetContentManager(Path, ".xnb") @@ -48,7 +48,7 @@ Public Class ModelManager End Sub Public Shared Function DrawModelToTexture(ByVal modelName As String, ByVal renderTarget As RenderTarget2D, ByVal modelPosition As Vector3, ByVal cameraPosition As Vector3, ByVal cameraRotation As Vector3, ByVal Scale As Single, ByVal enableLight As Boolean) As Texture2D - + Dim _scale As Single = Scale * MODELSCALE Core.GraphicsDevice.SetRenderTarget(renderTarget) Core.GraphicsDevice.Clear(Color.Transparent) @@ -77,7 +77,7 @@ Public Class ModelManager Next End If - m.Draw(Matrix.CreateFromYawPitchRoll(cameraRotation.X, cameraRotation.Y, cameraRotation.Z) * Matrix.CreateScale(New Vector3(Scale)) * Matrix.CreateTranslation(modelPosition), Matrix.CreateLookAt(cameraPosition, modelPosition, Vector3.Up), Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0F), Core.GraphicsDevice.Viewport.AspectRatio, 0.1F, 10000.0F)) + m.Draw(Matrix.CreateFromYawPitchRoll(cameraRotation.X, cameraRotation.Y, cameraRotation.Z) * Matrix.CreateScale(New Vector3(_scale)) * Matrix.CreateTranslation(modelPosition), Matrix.CreateLookAt(cameraPosition, modelPosition, Vector3.Up), Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0F), Core.GraphicsDevice.Viewport.AspectRatio, 0.1F, 10000.0F)) Core.GraphicsDevice.SetRenderTarget(Nothing) diff --git a/P3D/Screens/PC/StorageSystemScreen.vb b/P3D/Screens/PC/StorageSystemScreen.vb index 21cd16ae8..f59b7f377 100644 --- a/P3D/Screens/PC/StorageSystemScreen.vb +++ b/P3D/Screens/PC/StorageSystemScreen.vb @@ -1326,8 +1326,8 @@ Public Class StorageSystemScreen If p.IsShiny = True Then shinyString = "Shiny" End If - If Core.Player.ShowModelsInBattle = True AndAlso ModelManager.ModelExist("Models\" & modelName & "\" & shinyString) = True And p.IsEgg() = False Then - Draw3DModel(p, "Models\" & modelName & "\" & shinyString) + If Core.Player.ShowModelsInBattle = True AndAlso ModelManager.ModelExist("Models\Pokemon\" & modelName & "\" & shinyString) = True And p.IsEgg() = False Then + Draw3DModel(p, "Models\Pokemon\" & modelName & "\" & shinyString) Else GetYOffset(p) Core.SpriteBatch.Draw(p.GetTexture(True), New Rectangle(634, 180 - yOffset, 256, 256), Color.White) diff --git a/P3D/World/LevelLoader.vb b/P3D/World/LevelLoader.vb index a3d901feb..76fafad56 100644 --- a/P3D/World/LevelLoader.vb +++ b/P3D/World/LevelLoader.vb @@ -644,7 +644,10 @@ Dim AdditionalValue As String = CStr(GetTag(Tags, "AdditionalValue")) Dim Name As String = CStr(GetTag(Tags, "Name")) Dim ID As Integer = CInt(GetTag(Tags, "ID")) - + Dim ModelPath As String = "" + If TagExists(Tags, "ModelPath") = True Then + ModelPath = CStr(GetTag(Tags, "ModelPath")) + End If Dim Movement As String = CStr(GetTag(Tags, "Movement")) Dim MoveRectangles As List(Of Rectangle) = CType(GetTag(Tags, "MoveRectangles"), List(Of Rectangle)) @@ -659,7 +662,7 @@ AnimateIdle = CBool(GetTag(Tags, "AnimateIdle")) End If - Dim NPC As NPC = CType(Entity.GetNewEntity("NPC", Position, {Nothing}, {0, 0}, True, New Vector3(0), Scale, BaseModel.BillModel, ActionValue, AdditionalValue, True, Shader, -1, MapOrigin, "", Offset, {TextureID, Rotation, Name, ID, AnimateIdle, Movement, MoveRectangles}), NPC) + Dim NPC As NPC = CType(Entity.GetNewEntity("NPC", Position, {Nothing}, {0, 0}, True, New Vector3(0), Scale, BaseModel.BillModel, ActionValue, AdditionalValue, True, Shader, -1, MapOrigin, "", Offset, {TextureID, Rotation, Name, ID, AnimateIdle, Movement, MoveRectangles},,,,ModelPath), NPC) If loadOffsetMap = False Then Screen.Level.Entities.Add(NPC) @@ -817,6 +820,11 @@ Dim ModelID As Integer = CInt(GetTag(Tags, "ModelID")) + Dim ModelPath As String = "" + If TagExists(Tags, "ModelPath") = True Then + ModelPath = CStr(GetTag(Tags, "ModelPath")) + End If + Dim ActionValue As Integer = CInt(GetTag(Tags, "Action")) Dim AdditionalValue As String = "" @@ -921,7 +929,8 @@ {}, Opacity, AnimationData, - CameraDistanceDelta) + CameraDistanceDelta, + ModelPath) newEnt.IsOffsetMapContent = loadOffsetMap If Not newEnt Is Nothing Then diff --git a/lib/P3D.ContentPipeline/Content/Content.mgcb b/lib/P3D.ContentPipeline/Content/Content.mgcb index f9c785e95..b5883938f 100644 --- a/lib/P3D.ContentPipeline/Content/Content.mgcb +++ b/lib/P3D.ContentPipeline/Content/Content.mgcb @@ -221,6 +221,44 @@ /processorParam:TextureFormat=Compressed /build:Models/Environment/Test_floor/Test_floor.obj +#begin Models/Pokemon/Snorlax/Normal.fbx +/importer:FbxImporter +/processor:ModelProcessor +/processorParam:ColorKeyColor=0,0,0,0 +/processorParam:ColorKeyEnabled=True +/processorParam:DefaultEffect=BasicEffect +/processorParam:GenerateMipmaps=False +/processorParam:GenerateTangentFrames=False +/processorParam:PremultiplyTextureAlpha=True +/processorParam:PremultiplyVertexColors=True +/processorParam:ResizeTexturesToPowerOfTwo=False +/processorParam:RotationX=0 +/processorParam:RotationY=0 +/processorParam:RotationZ=0 +/processorParam:Scale=1 +/processorParam:SwapWindingOrder=False +/processorParam:TextureFormat=Color +/build:Models/Pokemon/Snorlax/Normal.fbx + +#begin Models/Pokemon/Snorlax/Shiny.fbx +/importer:FbxImporter +/processor:ModelProcessor +/processorParam:ColorKeyColor=0,0,0,0 +/processorParam:ColorKeyEnabled=True +/processorParam:DefaultEffect=BasicEffect +/processorParam:GenerateMipmaps=False +/processorParam:GenerateTangentFrames=False +/processorParam:PremultiplyTextureAlpha=True +/processorParam:PremultiplyVertexColors=True +/processorParam:ResizeTexturesToPowerOfTwo=False +/processorParam:RotationX=0 +/processorParam:RotationY=0 +/processorParam:RotationZ=0 +/processorParam:Scale=1 +/processorParam:SwapWindingOrder=False +/processorParam:TextureFormat=Color +/build:Models/Pokemon/Snorlax/Shiny.fbx + #begin Models/Snorlax/Normal.fbx /importer:FbxImporter /processor:ModelProcessor diff --git a/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Normal.fbx b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Normal.fbx new file mode 100644 index 000000000..ed2496d5c Binary files /dev/null and b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Normal.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Shiny.fbx b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Shiny.fbx new file mode 100644 index 000000000..ca94d9c24 Binary files /dev/null and b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Shiny.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Normal.png b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Normal.png new file mode 100644 index 000000000..9d6be2904 Binary files /dev/null and b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Normal.png differ diff --git a/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Shiny.png b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Shiny.png new file mode 100644 index 000000000..be53a8f3e Binary files /dev/null and b/lib/P3D.ContentPipeline/Content/Models/Pokemon/Snorlax/Snorlax_Shiny.png differ diff --git a/lib/P3D.ContentPipeline/Content/Models/Snorlax/Normal.fbx b/lib/P3D.ContentPipeline/Content/Models/Snorlax/Normal.fbx index f61d4550a..7304fc428 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/Snorlax/Normal.fbx and b/lib/P3D.ContentPipeline/Content/Models/Snorlax/Normal.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/Snorlax/Shiny.fbx b/lib/P3D.ContentPipeline/Content/Models/Snorlax/Shiny.fbx index 9e1d89fac..7d8fb1a21 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/Snorlax/Shiny.fbx and b/lib/P3D.ContentPipeline/Content/Models/Snorlax/Shiny.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/boat/SSAqua.fbx b/lib/P3D.ContentPipeline/Content/Models/boat/SSAqua.fbx index fc7c1aeaa..f28130eb0 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/boat/SSAqua.fbx and b/lib/P3D.ContentPipeline/Content/Models/boat/SSAqua.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/boat2/Boat.fbx b/lib/P3D.ContentPipeline/Content/Models/boat2/Boat.fbx index 27deee136..fd82ac546 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/boat2/Boat.fbx and b/lib/P3D.ContentPipeline/Content/Models/boat2/Boat.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/building/KolbenTower.fbx b/lib/P3D.ContentPipeline/Content/Models/building/KolbenTower.fbx index b5c499fdd..5cade0f01 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/building/KolbenTower.fbx and b/lib/P3D.ContentPipeline/Content/Models/building/KolbenTower.fbx differ diff --git a/lib/P3D.ContentPipeline/Content/Models/truck2/Truck.fbx b/lib/P3D.ContentPipeline/Content/Models/truck2/Truck.fbx index 58185a130..3c6bff135 100644 Binary files a/lib/P3D.ContentPipeline/Content/Models/truck2/Truck.fbx and b/lib/P3D.ContentPipeline/Content/Models/truck2/Truck.fbx differ diff --git a/lib/P3D.ContentPipeline/P3D.ContentPipeline.csproj b/lib/P3D.ContentPipeline/P3D.ContentPipeline.csproj index 74b143684..e14bfed85 100644 --- a/lib/P3D.ContentPipeline/P3D.ContentPipeline.csproj +++ b/lib/P3D.ContentPipeline/P3D.ContentPipeline.csproj @@ -61,6 +61,8 @@ + + @@ -86,6 +88,8 @@ + +