From ea12c8f5f4d1aa966154e22a8012d6f2e589bc3b Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 14 Oct 2021 17:50:44 +0200 Subject: [PATCH] I was not halfway done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've updated Poison Sting, through which I realized I hadn't taken some usage cases into consideration, so the system should be more robust and useful now I've also updated the animation for Switching In your own Pokémon and I've added an animation for when the Pokémon breaks out of the ball when you're trying to catch it --- P3D/Battle/BattleSystemV2/Battle.vb | 1086 ++++++++++----------- P3D/Pokemon/Attacks/Fire/Ember.vb | 4 +- P3D/Pokemon/Attacks/Grass/Absorb.vb | 2 +- P3D/Pokemon/Attacks/Normal/Growl.vb | 2 +- P3D/Pokemon/Attacks/Normal/Pound.vb | 2 +- P3D/Pokemon/Attacks/Normal/Tackle.vb | 9 +- P3D/Pokemon/Attacks/Poison/PoisonSting.vb | 34 +- 7 files changed, 571 insertions(+), 568 deletions(-) diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 823bea6f1..a93c5e4bc 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -2706,19 +2706,14 @@ ChangeCameraAngle(1, own, BattleScreen) 'Burn animation Dim BurnAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, own) - BurnAnimation.AnimationPlaySound("Battle\Effects\Burned", 0, 0) + BurnAnimation.PlaySound("Battle\Effects\Burned", 0, 0) Dim FlameEntity As Entity = BurnAnimation.SpawnEntity(New Vector3(CSng(pNPC.Position.X - 0.25), CSng(pNPC.Position.Y - 0.25), CSng(pNPC.Position.Z - 0.25)), TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 0, 32, 32)), New Vector3(0.5, 0.5, 0.5), 1.0F) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 1) - BurnAnimation.AnimationFadeEntity(FlameEntity, 1, False, 0.0F, 6, 1, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, True, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 2) BattleScreen.BattleQuery.Add(BurnAnimation) - If FlameEntity.Opacity = 0.0F Then - BurnAnimation.RemoveEntity(FlameEntity) - End If - Select Case message Case "" 'Print default message only BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " got burned!")) @@ -2729,30 +2724,30 @@ BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " got burned!")) End Select If p.Ability.Name.ToLower() = "synchronize" AndAlso from <> own Then - Me.InflictBurn(Not own, Not own, BattleScreen, "Synchronize passed over the burn.", "synchronize") - End If - - If Not p.Item Is Nothing Then - If p.Item.Name.ToLower() = "rawst" AndAlso BattleScreen.FieldEffects.CanUseItem(own) = True AndAlso BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then - If RemoveHeldItem(own, own, BattleScreen, "", "berry:rawst") = True Then - BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Use_Item", False)) - CureStatusProblem(own, own, BattleScreen, "The Rawst Berry cured the burn of " & p.GetDisplayName() & "!", "berry:rawst") - End If - End If - End If - - If Not p.Item Is Nothing Then - If p.Item.Name.ToLower() = "lum" AndAlso BattleScreen.FieldEffects.CanUseItem(own) = True AndAlso BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then - If RemoveHeldItem(own, own, BattleScreen, "", "berry:lum") = True Then - BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Use_Item", False)) - CureStatusProblem(own, own, BattleScreen, "The Lum Berry cured the burn of " & p.GetDisplayName() & "!", "berry:lum") - End If - End If - End If - - Return True + Me.InflictBurn(Not own, Not own, BattleScreen, "Synchronize passed over the burn.", "synchronize") End If + + If Not p.Item Is Nothing Then + If p.Item.Name.ToLower() = "rawst" AndAlso BattleScreen.FieldEffects.CanUseItem(own) = True AndAlso BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then + If RemoveHeldItem(own, own, BattleScreen, "", "berry:rawst") = True Then + BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Use_Item", False)) + CureStatusProblem(own, own, BattleScreen, "The Rawst Berry cured the burn of " & p.GetDisplayName() & "!", "berry:rawst") + End If + End If + End If + + If Not p.Item Is Nothing Then + If p.Item.Name.ToLower() = "lum" AndAlso BattleScreen.FieldEffects.CanUseItem(own) = True AndAlso BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then + If RemoveHeldItem(own, own, BattleScreen, "", "berry:lum") = True Then + BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Use_Item", False)) + CureStatusProblem(own, own, BattleScreen, "The Lum Berry cured the burn of " & p.GetDisplayName() & "!", "berry:lum") + End If + End If + End If + + Return True End If + End If End If End If End If @@ -3421,19 +3416,18 @@ Dim maxAmount As Integer = 20 * val Dim currentAmount As Integer = 0 While currentAmount <= maxAmount - Dim Texture As String = "Textures\Battle\StatChange\statDown" - Dim Position As Vector3 = New Vector3(0, -0.4, 0) - Dim Destination As Vector3 = New Vector3(0, 0.8, 0) - Dim Scale As Vector3 = New Vector3(0.2F) + Dim Texture As Texture2D = TextureManager.GetTexture("Textures\Battle\StatChange\statUp") Dim xPos = CSng((Random.NextDouble() - 0.5) * 1.2) Dim zPos = CSng((Random.NextDouble() - 0.5) * 1.2) - Position.X = xPos - Position.Z = zPos - Destination.X = xPos - Destination.Z = zPos + Dim Position As New Vector3(xPos + pNPC.Position.X, CSng(pNPC.Position.Y - 0.4), pNPC.Position.Z + zPos) + Dim Destination As New Vector3(xPos + pNPC.Position.X, CSng(pNPC.Position.Y + 0.8), zPos + pNPC.Position.Z) + Dim Scale As New Vector3(0.2F) + + Dim StatEntity As Entity = StatAnimation.SpawnEntity(Position, Texture, Scale, 1.0F) Dim startDelay As Double = 5.0 * Random.NextDouble() - StatAnimation.AnimationSpawnMovingEntity(Position.X, Position.Y, Position.Z, Texture, Scale.X, Scale.Y, Scale.Z, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) + + StatAnimation.MoveEntity(Nothing, True, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) Threading.Interlocked.Increment(currentAmount) End While BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Stat_Raise", False)) @@ -3699,27 +3693,26 @@ End If End If '***STAT DECREASE ANIMATION*** - Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, Not own) + Dim StatAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, Not own) Dim maxAmount As Integer = 20 * val Dim currentAmount As Integer = 0 While currentAmount <= maxAmount - Dim Texture As String = "Textures\Battle\StatChange\statDown" - Dim Position As Vector3 = New Vector3(0, 0.8, 0) - Dim Destination As Vector3 = New Vector3(0, -0.4, 0) - Dim Scale As Vector3 = New Vector3(0.2F) + Dim Texture As Texture2D = TextureManager.GetTexture("Textures\Battle\StatChange\statDown") Dim xPos = CSng((Random.NextDouble() - 0.5) * 1.2) Dim zPos = CSng((Random.NextDouble() - 0.5) * 1.2) - Position.X = xPos - Position.Z = zPos - Destination.X = xPos - Destination.Z = zPos + Dim Position As New Vector3(xPos + pNPC.Position.X, CSng(pNPC.Position.Y + 0.8), pNPC.Position.Z + zPos) + Dim Destination As New Vector3(xPos + pNPC.Position.X, CSng(pNPC.Position.Y - 0.4), zPos + pNPC.Position.Z) + Dim Scale As New Vector3(0.2F) + + Dim StatEntity As Entity = StatAnimation.SpawnEntity(Position, Texture, Scale, 1.0F) Dim startDelay As Double = 5.0 * Random.NextDouble() - MoveAnimation.AnimationSpawnMovingEntity(Position.X, Position.Y, Position.Z, Texture, Scale.X, Scale.Y, Scale.Z, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) + + StatAnimation.MoveEntity(Nothing, True, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) Threading.Interlocked.Increment(currentAmount) End While - MoveAnimation.AnimationPlaySound("Battle\Effects\Stat_Lower", 0.0F, 10.0F) - BattleScreen.BattleQuery.Add(MoveAnimation) + StatAnimation.PlaySound("Battle\Effects\Stat_Lower", 0.0F, 10.0F) + BattleScreen.BattleQuery.Add(StatAnimation) Dim printMessage As String = p.GetDisplayName() & "'s " & statString Select Case val @@ -4005,10 +3998,10 @@ End If Dim HitAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, own) - HitAnimation.AnimationFadeEntity(Nothing, 1, False, 0, 0, 0) - HitAnimation.AnimationFadeEntity(Nothing, 1, True, 1, 1, 0) - HitAnimation.AnimationFadeEntity(Nothing, 1, False, 0, 2, 0) - HitAnimation.AnimationFadeEntity(Nothing, 1, True, 1, 3, 0) + HitAnimation.FadeEntity(Nothing, False, 1, False, 0, 0, 0) + HitAnimation.FadeEntity(Nothing, False, 1, True, 1, 1, 0) + HitAnimation.FadeEntity(Nothing, False, 1, False, 0, 2, 0) + HitAnimation.FadeEntity(Nothing, False, 1, True, 1, 3, 0) BattleScreen.BattleQuery.Add(HitAnimation) If own = True Then @@ -4763,14 +4756,14 @@ #End Region - ''' - ''' Switches camera to angle - ''' - ''' 0=main battle/1=own pokemon/2=opp pokemon - ''' If the code comes from the own player or not. - ''' Battlescreen reference - ''' If the call should get added the PVP list or the own queue. - Public Sub ChangeCameraAngle(ByVal direction As Integer, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Optional ByVal AddPVP As Boolean = False) + ''' + ''' Switches camera to angle + ''' + ''' 0=main battle/1=own pokemon/2=opp pokemon + ''' If the code comes from the own player or not. + ''' Battlescreen reference + ''' If the call should get added the PVP list or the own queue. + Public Sub ChangeCameraAngle(ByVal direction As Integer, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Optional ByVal AddPVP As Boolean = False) Dim q As CameraQueryObject = Nothing Select Case direction @@ -5364,7 +5357,7 @@ If .OwnPokemon.Status = Pokemon.StatusProblems.Poison Then 'Own Poison 'Poison animation Dim PoisonAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OwnPokemonNPC, True) - PoisonAnimation.AnimationPlaySound("Battle\Effects\Poisoned", 0, 0) + PoisonAnimation.PlaySound("Battle\Effects\Poisoned", 0, 0) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) @@ -5388,7 +5381,7 @@ Dim multiplier As Double = (.FieldEffects.OwnPoisonCounter / 16) 'Poison animation Dim PoisonAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OwnPokemonNPC, True) - PoisonAnimation.AnimationPlaySound("Battle\Effects\Poisoned", 0, 0) + PoisonAnimation.PlaySound("Battle\Effects\Poisoned", 0, 0) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) @@ -5420,20 +5413,15 @@ 'Burn animation Dim BurnAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OwnPokemonNPC, False) - BurnAnimation.AnimationPlaySound("Battle\Effects\Burned", 0, 0) + BurnAnimation.PlaySound("Battle\Effects\Burned", 0, 0) Dim FlameEntity As Entity = BurnAnimation.SpawnEntity(New Vector3(CSng(BattleScreen.OwnPokemonNPC.Position.X + 0.25), CSng(BattleScreen.OwnPokemonNPC.Position.Y - 0.25), CSng(BattleScreen.OwnPokemonNPC.Position.Z + 0.25)), TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 0, 32, 32)), New Vector3(0.5, 0.5, 0.5), 1.0F) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 1) - BurnAnimation.AnimationFadeEntity(FlameEntity, 1, False, 0.0F, 6, 1, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, True, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 2) BattleScreen.BattleQuery.Add(BurnAnimation) - If FlameEntity.Opacity = 0.0F Then - BurnAnimation.RemoveEntity(FlameEntity) - End If - 'Actual damage ReduceHP(reduceAmount, True, True, BattleScreen, .OwnPokemon.GetDisplayName() & " is hurt by the burn.", "burn") End If @@ -6163,7 +6151,7 @@ If .OppPokemon.Status = Pokemon.StatusProblems.Poison Then 'Opp Poison 'Poison animation Dim PoisonAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, False) - PoisonAnimation.AnimationPlaySound("Battle\Effects\Poisoned", 0, 0) + PoisonAnimation.PlaySound("Battle\Effects\Poisoned", 0, 0) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) @@ -6187,7 +6175,7 @@ Dim multiplier As Double = (.FieldEffects.OppPoisonCounter / 16) 'Poison animation Dim PoisonAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, False) - PoisonAnimation.AnimationPlaySound("Battle\Effects\Poisoned", 0, 0) + PoisonAnimation.PlaySound("Battle\Effects\Poisoned", 0, 0) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1) PoisonAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) @@ -6218,20 +6206,15 @@ End If 'Burn animation Dim BurnAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, False) - BurnAnimation.AnimationPlaySound("Battle\Effects\Burned", 0, 0) + BurnAnimation.PlaySound("Battle\Effects\Burned", 0, 0) Dim FlameEntity As Entity = BurnAnimation.SpawnEntity(New Vector3(CSng(BattleScreen.OppPokemonNPC.Position.X - 0.25), CSng(BattleScreen.OwnPokemonNPC.Position.Y - 0.25), CSng(BattleScreen.OwnPokemonNPC.Position.Z - 0.25)), TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 0, 32, 32)), New Vector3(0.5, 0.5, 0.5), 1.0F) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) - BurnAnimation.AnimationChangeTexture(FlameEntity, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 1) - BurnAnimation.AnimationFadeEntity(FlameEntity, 1, False, 0.0F, 6, 1, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 32, 32, 32)), 2, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 64, 32, 32)), 3, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, False, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 96, 32, 32)), 4, 1) + BurnAnimation.ChangeEntityTexture(FlameEntity, True, TextureManager.GetTexture("Textures\Battle\Fire\Ember", New Rectangle(0, 128, 32, 32)), 5, 2) BattleScreen.BattleQuery.Add(BurnAnimation) - If FlameEntity.Opacity = 0.0F Then - BurnAnimation.RemoveEntity(FlameEntity) - End If - 'Actual damage ReduceHP(reduceAmount, False, False, BattleScreen, .OppPokemon.GetDisplayName() & " is hurt by the burn.", "burn") End If @@ -6756,38 +6739,38 @@ End If Else If BattleScreen.IsTrainerBattle = True Then - EndBattle(EndBattleReasons.LoseTrainer, BattleScreen, False) - If BattleScreen.IsRemoteBattle = True Then - EndBattle(EndBattleReasons.LoseTrainer, BattleScreen, True) - End If - Else - EndBattle(EndBattleReasons.LoseWild, BattleScreen, False) - End If - End If - End With - End Sub + EndBattle(EndBattleReasons.LoseTrainer, BattleScreen, False) + If BattleScreen.IsRemoteBattle = True Then + EndBattle(EndBattleReasons.LoseTrainer, BattleScreen, True) + End If + Else + EndBattle(EndBattleReasons.LoseWild, BattleScreen, False) + End If + End If + End With + End Sub - Public Sub ApplyOwnBatonPass(ByVal BattleScreen As BattleScreen) - If BattleScreen.FieldEffects.OwnUsedBatonPass = True Then - BattleScreen.FieldEffects.OwnUsedBatonPass = False + Public Sub ApplyOwnBatonPass(ByVal BattleScreen As BattleScreen) + If BattleScreen.FieldEffects.OwnUsedBatonPass = True Then + BattleScreen.FieldEffects.OwnUsedBatonPass = False - BattleScreen.OwnPokemon.StatAttack = BattleScreen.FieldEffects.OwnBatonPassStats(0) - BattleScreen.OwnPokemon.StatDefense = BattleScreen.FieldEffects.OwnBatonPassStats(1) - BattleScreen.OwnPokemon.StatSpAttack = BattleScreen.FieldEffects.OwnBatonPassStats(2) - BattleScreen.OwnPokemon.StatSpDefense = BattleScreen.FieldEffects.OwnBatonPassStats(3) - BattleScreen.OwnPokemon.StatSpeed = BattleScreen.FieldEffects.OwnBatonPassStats(4) - BattleScreen.OwnPokemon.Evasion = BattleScreen.FieldEffects.OwnBatonPassStats(5) - BattleScreen.OwnPokemon.Accuracy = BattleScreen.FieldEffects.OwnBatonPassStats(6) + BattleScreen.OwnPokemon.StatAttack = BattleScreen.FieldEffects.OwnBatonPassStats(0) + BattleScreen.OwnPokemon.StatDefense = BattleScreen.FieldEffects.OwnBatonPassStats(1) + BattleScreen.OwnPokemon.StatSpAttack = BattleScreen.FieldEffects.OwnBatonPassStats(2) + BattleScreen.OwnPokemon.StatSpDefense = BattleScreen.FieldEffects.OwnBatonPassStats(3) + BattleScreen.OwnPokemon.StatSpeed = BattleScreen.FieldEffects.OwnBatonPassStats(4) + BattleScreen.OwnPokemon.Evasion = BattleScreen.FieldEffects.OwnBatonPassStats(5) + BattleScreen.OwnPokemon.Accuracy = BattleScreen.FieldEffects.OwnBatonPassStats(6) - If BattleScreen.FieldEffects.OwnBatonPassConfusion = True Then - BattleScreen.FieldEffects.OwnBatonPassConfusion = False - BattleScreen.OwnPokemon.AddVolatileStatus(Pokemon.VolatileStatus.Confusion) - End If - End If - End Sub + If BattleScreen.FieldEffects.OwnBatonPassConfusion = True Then + BattleScreen.FieldEffects.OwnBatonPassConfusion = False + BattleScreen.OwnPokemon.AddVolatileStatus(Pokemon.VolatileStatus.Confusion) + End If + End If + End Sub - Public Sub SwitchInOwn(ByVal BattleScreen As BattleScreen, ByVal NewPokemonIndex As Integer, ByVal FirstTime As Boolean, ByVal InsertIndex As Integer, Optional ByVal message As String = "") - HasSwitchedInOwn = True + Public Sub SwitchInOwn(ByVal BattleScreen As BattleScreen, ByVal NewPokemonIndex As Integer, ByVal FirstTime As Boolean, ByVal InsertIndex As Integer, Optional ByVal message As String = "") + HasSwitchedInOwn = True If FirstTime = False Then Dim insertMessage As String = message @@ -6800,28 +6783,32 @@ Dim BallReturn As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OwnPokemonNPC, False, BattleScreen.OwnPokemonModel) ' Ball Closes - BallReturn.AnimationPlaySound("Battle\Pokeball\Open", 0, 0) + BallReturn.PlaySound("Battle\Pokeball\Open", 0, 0) Dim SmokeReturned As Integer = 0 Do Dim SmokePosition = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10)) - Dim SmokeDestination = New Vector3(0, 0, 0) + Dim SmokeDestination As Vector3 = New Vector3(0, 0, 0) - Dim SmokeTexture As String = "Textures\Battle\Cloud" + Dim SmokeTexture As Texture2D = TextureManager.GetTexture("Textures\Battle\Smoke") Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10)) Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F) - BallReturn.AnimationSpawnMovingEntity(SmokePosition.X, SmokePosition.Y, SmokePosition.Z, SmokeTexture, SmokeScale.X, SmokeScale.Y, SmokeScale.Z, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 0.0F, 0.0F) + Dim SmokeEntity As Entity = BallReturn.SpawnEntity(SmokePosition, SmokeTexture, SmokeScale, 1.0F) + + BallReturn.MoveEntity(SmokeEntity, True, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 0.0F, 0.0F) + Threading.Interlocked.Increment(SmokeReturned) Loop While SmokeReturned <= 38 ' Pokemon disappears - BallReturn.AnimationFadeEntity(Nothing, 1, False, 0, 1, 0) - BallReturn.AnimationMoveEntity(Nothing, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 3) + BallReturn.FadeEntity(Nothing, False, 1, False, 0, 1, 0) + BallReturn.MoveEntity(Nothing, False, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 3) ' Ball returns - BallReturn.AnimationPlaySound("Battle\Pokeball\Throw", 1, 0) - BallReturn.AnimationSpawnMovingEntity(0, 0, 0, BattleScreen.OwnPokemon.CatchBall.TextureSource, 0.3F, 0.3F, 0.3F, -2, 0, 0, 0.1, False, True, 1, 0,, 0.3) + BallReturn.PlaySound("Battle\Pokeball\Throw", 1, 0) + Dim BallReturnEntity As Entity = BallReturn.SpawnEntity(BattleScreen.OwnPokemonNPC.Position, TextureManager.GetTexture(BattleScreen.OwnPokemon.CatchBall.TextureSource), New Vector3(0.3F), 1.0F) + BallReturn.MoveEntity(BallReturnEntity, True, BattleScreen.OwnPokemonNPC.Position.X - 2, BattleScreen.OwnPokemonNPC.Position.Y, BattleScreen.OwnPokemonNPC.Position.Z, 0.1, False, True, 1, 0,, 0.3) BattleScreen.AddToQuery(InsertIndex, BallReturn) @@ -6859,315 +6846,322 @@ ' Ball is thrown Dim BallThrow As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OwnPokemonNPC, False, BattleScreen.OwnPokemonModel) - BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) - BallThrow.AnimationSpawnMovingEntity(-2, -0.15, 0, BattleScreen.OwnPokemon.CatchBall.TextureSource, 0.3F, 0.3F, 0.3F, 0, 0.35, 0, 0.1, False, True, 0F, 0F,, 0.3) + + BallThrow.PlaySound("Battle\Pokeball\Throw", 0, 0) + + Dim BallThrowEntity As Entity = BallReturn.SpawnEntity(BattleScreen.OwnPokemonNPC.Position + New Vector3(-2, -0.15, 0), TextureManager.GetTexture(BattleScreen.OwnPokemon.CatchBall.TextureSource), New Vector3(0.3F), 1.0F) + BallThrow.MoveEntity(BallThrowEntity, True, BattleScreen.OwnPokemonNPC.Position.X, CSng(BattleScreen.OwnPokemonNPC.Position.Y + 0.35), BattleScreen.OwnPokemonNPC.Position.Z, 0.1, False, True, 0F, 0F,, 0.3) ' Ball Opens - BallThrow.AnimationPlaySound("Battle\Pokeball\Open", 3, 0) + BallThrow.PlaySound("Battle\Pokeball\Open", 3, 0) + Dim SmokeSpawned As Integer = 0 Do Dim SmokePosition = New Vector3(0, 0.35, 0) Dim SmokeDestination = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10)) - Dim SmokeTexture As String = "Textures\Battle\Cloud" + Dim SmokeTexture As Texture2D = TextureManager.GetTexture("Textures\Battle\Smoke") Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10)) Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F) - BallThrow.AnimationSpawnMovingEntity(SmokePosition.X, SmokePosition.Y, SmokePosition.Z, SmokeTexture, SmokeScale.X, SmokeScale.Y, SmokeScale.Z, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 3.0F, 0.0F) + Dim SmokeEntity As Entity = BallThrow.SpawnEntity(SmokePosition, SmokeTexture, SmokeScale, 1.0F) + + BallThrow.MoveEntity(SmokeEntity, True, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 3.0F, 0.0F) + Threading.Interlocked.Increment(SmokeSpawned) Loop While SmokeSpawned <= 38 ' Pokemon appears - BallThrow.AnimationFadeEntity(Nothing, 1, True, 1, 4, 0) - BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True) + BallThrow.FadeEntity(Nothing, False, 1, True, 1, 4, 0) + BallThrow.PlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True) ' Pokémon falls down - BallThrow.AnimationMoveEntity(Nothing, 0, 0, 0, 0.05F, False, False, 4, 0,,, 3) + BallThrow.MoveEntity(Nothing, False, 0, 0, 0, 0.05F, False, False, 4, 0,,, 3) BattleScreen.AddToQuery(InsertIndex, BallThrow) End If With BattleScreen - If .FieldEffects.UsedPokemon.Contains(NewPokemonIndex) = False Then - .FieldEffects.UsedPokemon.Add(NewPokemonIndex) - End If + If .FieldEffects.UsedPokemon.Contains(NewPokemonIndex) = False Then + .FieldEffects.UsedPokemon.Add(NewPokemonIndex) + End If - If Not .OwnPokemon.Item Is Nothing Then - If .OwnPokemon.Item.Name.ToLower() = "amulet coin" Or .OwnPokemon.Item.Name.ToLower() = "luck incense" Then - If .FieldEffects.CanUseItem(True) = True And .FieldEffects.CanUseOwnItem(True, BattleScreen) = True Then - BattleScreen.FieldEffects.AmuletCoin += 1 - End If - End If - End If + If Not .OwnPokemon.Item Is Nothing Then + If .OwnPokemon.Item.Name.ToLower() = "amulet coin" Or .OwnPokemon.Item.Name.ToLower() = "luck incense" Then + If .FieldEffects.CanUseItem(True) = True And .FieldEffects.CanUseOwnItem(True, BattleScreen) = True Then + BattleScreen.FieldEffects.AmuletCoin += 1 + End If + End If + End If - Dim p As Pokemon = .OwnPokemon - Dim op As Pokemon = .OppPokemon + Dim p As Pokemon = .OwnPokemon + Dim op As Pokemon = .OppPokemon - Dim spikeAffected As Boolean = True - Dim rockAffected As Boolean = True + Dim spikeAffected As Boolean = True + Dim rockAffected As Boolean = True - spikeAffected = BattleScreen.FieldEffects.IsGrounded(True, BattleScreen) + spikeAffected = BattleScreen.FieldEffects.IsGrounded(True, BattleScreen) - 'Spikes - If spikeAffected = True Then - If .FieldEffects.OppSpikes > 0 And (p.Ability.Name.ToLower() <> "magic guard" Or BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen, 1) = False) Then - Dim spikeDamage As Double = 1D - Select Case .FieldEffects.OppSpikes - Case 1 - spikeDamage = (p.MaxHP / 100) * 12.5D - Case 2 - spikeDamage = (p.MaxHP / 100) * 16.7D - Case 3 - spikeDamage = (p.MaxHP / 100) * 25D - End Select - ReduceHP(CInt(spikeDamage), True, False, BattleScreen, "The Spikes hurt " & p.GetDisplayName() & "!", "spikes") - End If - End If + 'Spikes + If spikeAffected = True Then + If .FieldEffects.OppSpikes > 0 And (p.Ability.Name.ToLower() <> "magic guard" Or BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen, 1) = False) Then + Dim spikeDamage As Double = 1D + Select Case .FieldEffects.OppSpikes + Case 1 + spikeDamage = (p.MaxHP / 100) * 12.5D + Case 2 + spikeDamage = (p.MaxHP / 100) * 16.7D + Case 3 + spikeDamage = (p.MaxHP / 100) * 25D + End Select + ReduceHP(CInt(spikeDamage), True, False, BattleScreen, "The Spikes hurt " & p.GetDisplayName() & "!", "spikes") + End If + End If - 'Sticky Web - If spikeAffected = True Then - If .FieldEffects.OppStickyWeb > 0 Then + 'Sticky Web + If spikeAffected = True Then + If .FieldEffects.OppStickyWeb > 0 Then - LowerStat(True, True, BattleScreen, "Speed", 1, "Your pokemon was caught in a Sticky Web!", "stickyweb") + LowerStat(True, True, BattleScreen, "Speed", 1, "Your pokemon was caught in a Sticky Web!", "stickyweb") - End If - End If + End If + End If - 'Toxic Spikes - If spikeAffected = True Then - If .FieldEffects.OppToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And p.Type2.Type <> Element.Types.Poison Then - Select Case .FieldEffects.OppToxicSpikes - Case 1 - InflictPoison(True, False, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") - Case 2 - InflictPoison(True, False, BattleScreen, True, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") - End Select - End If - If .FieldEffects.OppToxicSpikes > 0 Then - If p.Type1.Type = Element.Types.Poison Or p.Type2.Type = Element.Types.Poison Then - .AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " removed the Toxic Spikes!")) - .FieldEffects.OppToxicSpikes = 0 - End If - End If - End If + 'Toxic Spikes + If spikeAffected = True Then + If .FieldEffects.OppToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And p.Type2.Type <> Element.Types.Poison Then + Select Case .FieldEffects.OppToxicSpikes + Case 1 + InflictPoison(True, False, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") + Case 2 + InflictPoison(True, False, BattleScreen, True, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") + End Select + End If + If .FieldEffects.OppToxicSpikes > 0 Then + If p.Type1.Type = Element.Types.Poison Or p.Type2.Type = Element.Types.Poison Then + .AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " removed the Toxic Spikes!")) + .FieldEffects.OppToxicSpikes = 0 + End If + End If + End If - 'Stealth Rock - If rockAffected = True Then - If .FieldEffects.OppStealthRock > 0 And (p.Ability.Name.ToLower() <> "magic guard" Or BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen, 1) = False) Then - Dim rocksDamage As Double = 1D + 'Stealth Rock + If rockAffected = True Then + If .FieldEffects.OppStealthRock > 0 And (p.Ability.Name.ToLower() <> "magic guard" Or BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen, 1) = False) Then + Dim rocksDamage As Double = 1D - Dim effectiveness As Single = BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type1)) * BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type2)) - Select Case effectiveness - Case 0.25F - rocksDamage = (p.MaxHP / 100) * 3.125D - Case 0.5F - rocksDamage = (p.MaxHP / 100) * 6.25D - Case 1.0F - rocksDamage = (p.MaxHP / 100) * 12.5D - Case 2.0F - rocksDamage = (p.MaxHP / 100) * 25D - Case 4.0F - rocksDamage = (p.MaxHP / 100) * 50D - End Select + Dim effectiveness As Single = BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type1)) * BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type2)) + Select Case effectiveness + Case 0.25F + rocksDamage = (p.MaxHP / 100) * 3.125D + Case 0.5F + rocksDamage = (p.MaxHP / 100) * 6.25D + Case 1.0F + rocksDamage = (p.MaxHP / 100) * 12.5D + Case 2.0F + rocksDamage = (p.MaxHP / 100) * 25D + Case 4.0F + rocksDamage = (p.MaxHP / 100) * 50D + End Select - ReduceHP(CInt(rocksDamage), True, False, BattleScreen, "The Stealth Rocks hurt " & p.GetDisplayName() & "!", "stealthrocks") - End If - End If + ReduceHP(CInt(rocksDamage), True, False, BattleScreen, "The Stealth Rocks hurt " & p.GetDisplayName() & "!", "stealthrocks") + End If + End If - TriggerAbilityEffect(BattleScreen, True) - TriggerItemEffect(BattleScreen, True) + TriggerAbilityEffect(BattleScreen, True) + TriggerItemEffect(BattleScreen, True) - If .OwnPokemon.Status = Pokemon.StatusProblems.Sleep Then - .FieldEffects.OwnSleepTurns = Core.Random.Next(1, 4) - End If + If .OwnPokemon.Status = Pokemon.StatusProblems.Sleep Then + .FieldEffects.OwnSleepTurns = Core.Random.Next(1, 4) + End If - If BattleScreen.FieldEffects.OwnHealingWish = True Then - BattleScreen.FieldEffects.OwnHealingWish = False + If BattleScreen.FieldEffects.OwnHealingWish = True Then + BattleScreen.FieldEffects.OwnHealingWish = False - If .OwnPokemon.HP < .OwnPokemon.MaxHP Or .OwnPokemon.Status <> Pokemon.StatusProblems.None Then - GainHP(.OwnPokemon.MaxHP - .OwnPokemon.HP, True, True, BattleScreen, "The Healing Wish came true for " & .OwnPokemon.GetDisplayName() & "!", "move:healingwish") - CureStatusProblem(True, True, BattleScreen, "", "move:healingwish") - End If - End If - End With - End Sub + If .OwnPokemon.HP < .OwnPokemon.MaxHP Or .OwnPokemon.Status <> Pokemon.StatusProblems.None Then + GainHP(.OwnPokemon.MaxHP - .OwnPokemon.HP, True, True, BattleScreen, "The Healing Wish came true for " & .OwnPokemon.GetDisplayName() & "!", "move:healingwish") + CureStatusProblem(True, True, BattleScreen, "", "move:healingwish") + End If + End If + End With + End Sub - Public Sub SwitchOutOpp(ByVal BattleScreen As BattleScreen, ByVal index As Integer, Optional ByVal message As String = "") - With BattleScreen - 'Natural cure cures status problems - If .OppPokemon.Ability.Name.ToLower() = "natural cure" Then - If .OppPokemon.Status <> Pokemon.StatusProblems.Fainted And .OppPokemon.Status <> Pokemon.StatusProblems.None Then - .OppPokemon.Status = Pokemon.StatusProblems.None - .BattleQuery.Add(New TextQueryObject(.OppPokemon.GetDisplayName() & "'s status problem got healed by Natural Cure")) - End If - End If - 'Regenerator ability heals 1/3 of it's max HP - If .OppPokemon.Ability.Name.ToLower() = "regenerator" Then - If Not (.OppPokemon.Status = Pokemon.StatusProblems.Fainted Or .OppPokemon.HP = 0) Then - Dim restoreHP = CInt(.OppPokemon.MaxHP / 3) - If restoreHP > 0 And .OppPokemon.HP < .OppPokemon.MaxHP And .OppPokemon.HP > 0 Then - BattleScreen.Battle.GainHP(restoreHP, False, True, BattleScreen, .OppPokemon.GetDisplayName() & "'s HP was restored!", "ability:regenerator") - End If - End If - End If - 'save baton pass stuff: - If .FieldEffects.OppUsedBatonPass = True Then - .FieldEffects.OppBatonPassStats = New List(Of Integer) - With .OppPokemon - BattleScreen.FieldEffects.OppBatonPassStats.AddRange({ .StatAttack, .StatDefense, .StatSpAttack, .StatSpDefense, .StatSpeed, .Evasion, .Accuracy}) - End With - .FieldEffects.OppBatonPassConfusion = .OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True - End If + Public Sub SwitchOutOpp(ByVal BattleScreen As BattleScreen, ByVal index As Integer, Optional ByVal message As String = "") + With BattleScreen + 'Natural cure cures status problems + If .OppPokemon.Ability.Name.ToLower() = "natural cure" Then + If .OppPokemon.Status <> Pokemon.StatusProblems.Fainted And .OppPokemon.Status <> Pokemon.StatusProblems.None Then + .OppPokemon.Status = Pokemon.StatusProblems.None + .BattleQuery.Add(New TextQueryObject(.OppPokemon.GetDisplayName() & "'s status problem got healed by Natural Cure")) + End If + End If + 'Regenerator ability heals 1/3 of it's max HP + If .OppPokemon.Ability.Name.ToLower() = "regenerator" Then + If Not (.OppPokemon.Status = Pokemon.StatusProblems.Fainted Or .OppPokemon.HP = 0) Then + Dim restoreHP = CInt(.OppPokemon.MaxHP / 3) + If restoreHP > 0 And .OppPokemon.HP < .OppPokemon.MaxHP And .OppPokemon.HP > 0 Then + BattleScreen.Battle.GainHP(restoreHP, False, True, BattleScreen, .OppPokemon.GetDisplayName() & "'s HP was restored!", "ability:regenerator") + End If + End If + End If + 'save baton pass stuff: + If .FieldEffects.OppUsedBatonPass = True Then + .FieldEffects.OppBatonPassStats = New List(Of Integer) + With .OppPokemon + BattleScreen.FieldEffects.OppBatonPassStats.AddRange({ .StatAttack, .StatDefense, .StatSpAttack, .StatSpDefense, .StatSpeed, .Evasion, .Accuracy}) + End With + .FieldEffects.OppBatonPassConfusion = .OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True + End If - 'Set the original objects of Pokemon - .OppPokemon.ResetTemp() + 'Set the original objects of Pokemon + .OppPokemon.ResetTemp() - 'Remove volatiles - .OppPokemon.ClearAllVolatiles() + 'Remove volatiles + .OppPokemon.ClearAllVolatiles() - 'Resetting FieldEffects - With .FieldEffects - .OppSleepTurns = 0 - .OppTruantRound = 0 - .OppTaunt = 0 - .OppSmacked = 0 - .OppRageCounter = 0 - .OppUproar = 0 - If .OppUsedBatonPass = False Then .OppFocusEnergy = 0 - .OppEndure = 0 - .OppProtectCounter = 0 - .OppDetectCounter = 0 - .OppKingsShieldCounter = 0 - .OppProtectMovesCount = 0 - If .OppUsedBatonPass = False Then .OppIngrain = 0 - If .OppUsedBatonPass = False Then .OppSubstitute = 0 - If .OppUsedBatonPass = False Then .OppMagnetRise = 0 - If .OppUsedBatonPass = False Then .OppAquaRing = 0 - .OppPoisonCounter = 0 - .OppNightmare = 0 - If .OppUsedBatonPass = False Then .OppCurse = 0 - .OppOutrage = 0 - .OppThrash = 0 - .OppPetalDance = 0 - .OppEncore = 0 - .OppEncoreMove = Nothing - If .OppUsedBatonPass = False Then .OppEmbargo = 0 - .OppYawn = 0 - If .OppUsedBatonPass = False Then .OppPerishSongCount = 0 - .OppConfusionTurns = 0 - .OppTorment = 0 - .OppTormentMove = Nothing - .OppChoiceMove = Nothing - .OppRecharge = 0 - .OppRolloutCounter = 0 - .OppIceBallCounter = 0 - .OppDefenseCurl = 0 - .OppCharge = 0 - .OppSolarBeam = 0 - .OppSolarBlade = 0 - If .OppUsedBatonPass = False Then .OppLeechSeed = 0 - If .OppUsedBatonPass = False Then .OppLockOn = 0 - .OppLansatBerry = 0 - .OppCustapBerry = 0 - .OppTrappedCounter = 0 - .OppFuryCutter = 0 - .OppEchoedVoice = 0 - .OppPokemonTurns = 0 - .OppStockpileCount = 0 - .OppDestinyBond = False - .OppGastroAcid = False + 'Resetting FieldEffects + With .FieldEffects + .OppSleepTurns = 0 + .OppTruantRound = 0 + .OppTaunt = 0 + .OppSmacked = 0 + .OppRageCounter = 0 + .OppUproar = 0 + If .OppUsedBatonPass = False Then .OppFocusEnergy = 0 + .OppEndure = 0 + .OppProtectCounter = 0 + .OppDetectCounter = 0 + .OppKingsShieldCounter = 0 + .OppProtectMovesCount = 0 + If .OppUsedBatonPass = False Then .OppIngrain = 0 + If .OppUsedBatonPass = False Then .OppSubstitute = 0 + If .OppUsedBatonPass = False Then .OppMagnetRise = 0 + If .OppUsedBatonPass = False Then .OppAquaRing = 0 + .OppPoisonCounter = 0 + .OppNightmare = 0 + If .OppUsedBatonPass = False Then .OppCurse = 0 + .OppOutrage = 0 + .OppThrash = 0 + .OppPetalDance = 0 + .OppEncore = 0 + .OppEncoreMove = Nothing + If .OppUsedBatonPass = False Then .OppEmbargo = 0 + .OppYawn = 0 + If .OppUsedBatonPass = False Then .OppPerishSongCount = 0 + .OppConfusionTurns = 0 + .OppTorment = 0 + .OppTormentMove = Nothing + .OppChoiceMove = Nothing + .OppRecharge = 0 + .OppRolloutCounter = 0 + .OppIceBallCounter = 0 + .OppDefenseCurl = 0 + .OppCharge = 0 + .OppSolarBeam = 0 + .OppSolarBlade = 0 + If .OppUsedBatonPass = False Then .OppLeechSeed = 0 + If .OppUsedBatonPass = False Then .OppLockOn = 0 + .OppLansatBerry = 0 + .OppCustapBerry = 0 + .OppTrappedCounter = 0 + .OppFuryCutter = 0 + .OppEchoedVoice = 0 + .OppPokemonTurns = 0 + .OppStockpileCount = 0 + .OppDestinyBond = False + .OppGastroAcid = False - .OppFlyCounter = 0 - .OppDigCounter = 0 - .OppBounceCounter = 0 - .OppDiveCounter = 0 - .OppShadowForceCounter = 0 - .OppPhantomForceCounter = 0 - .OppSkyDropCounter = 0 - .OppGeomancyCounter = 0 - .OppSkyAttackCounter = 0 - .OppRazorWindCounter = 0 - .OppSkullBashCounter = 0 + .OppFlyCounter = 0 + .OppDigCounter = 0 + .OppBounceCounter = 0 + .OppDiveCounter = 0 + .OppShadowForceCounter = 0 + .OppPhantomForceCounter = 0 + .OppSkyDropCounter = 0 + .OppGeomancyCounter = 0 + .OppSkyAttackCounter = 0 + .OppRazorWindCounter = 0 + .OppSkullBashCounter = 0 - .OppForesight = 0 - .OppOdorSleuth = 0 - .OppMiracleEye = 0 + .OppForesight = 0 + .OppOdorSleuth = 0 + .OppMiracleEye = 0 - .OppWrap = 0 - .OppWhirlpool = 0 - .OppBind = 0 - .OppClamp = 0 - .OppFireSpin = 0 - .OppMagmaStorm = 0 - .OppSandTomb = 0 - .OppInfestation = 0 + .OppWrap = 0 + .OppWhirlpool = 0 + .OppBind = 0 + .OppClamp = 0 + .OppFireSpin = 0 + .OppMagmaStorm = 0 + .OppSandTomb = 0 + .OppInfestation = 0 - .OppBideCounter = 0 - .OppBideDamage = 0 + .OppBideCounter = 0 + .OppBideDamage = 0 - .OppRoostUsed = False + .OppRoostUsed = False - 'Own stuff that depends on opp pokemon presence - .OwnTrappedCounter = 0 - .OwnWrap = 0 - .OwnWhirlpool = 0 - .OwnBind = 0 - .OwnClamp = 0 - .OwnFireSpin = 0 - .OwnMagmaStorm = 0 - .OwnSandTomb = 0 - .OwnInfestation = 0 + 'Own stuff that depends on opp pokemon presence + .OwnTrappedCounter = 0 + .OwnWrap = 0 + .OwnWhirlpool = 0 + .OwnBind = 0 + .OwnClamp = 0 + .OwnFireSpin = 0 + .OwnMagmaStorm = 0 + .OwnSandTomb = 0 + .OwnInfestation = 0 - If BattleScreen.OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Infatuation) Then - BattleScreen.OwnPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Infatuation) - End If - End With - End With + If BattleScreen.OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Infatuation) Then + BattleScreen.OwnPokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Infatuation) + End If + End With + End With - BattleScreen.OppPokemon.Ability.SwitchOut(BattleScreen.OppPokemon) + BattleScreen.OppPokemon.Ability.SwitchOut(BattleScreen.OppPokemon) - If BattleScreen.IsTrainerBattle = False Then + If BattleScreen.IsTrainerBattle = False Then ChangeCameraAngle(1, False, BattleScreen) Dim Faint As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True, BattleScreen.OppPokemonModel) - Faint.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 0, 2, False, True) - Faint.AnimationMoveEntity(Nothing, 0, -1, 0, 0.1, False, False, 2, 0,,, 3) + Faint.PlaySound(CStr(BattleScreen.OppPokemon.Number), 0, 2, False, True) + Faint.MoveEntity(Nothing, False, 0, -1, 0, 0.1, False, False, 2, 0,,, 3) BattleScreen.BattleQuery.Add(Faint) BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, 2, -1, -1, -1, -1)) - EndBattle(EndBattleReasons.WinWild, BattleScreen, False) - Else - If BattleScreen.TrainerHasFightablePokemon() = True Then - If BattleScreen.OppPokemon.HP <= 0 Or BattleScreen.OppPokemon.Status = Pokemon.StatusProblems.Fainted Then - GainEXP(BattleScreen) - End If + EndBattle(EndBattleReasons.WinWild, BattleScreen, False) + Else + If BattleScreen.TrainerHasFightablePokemon() = True Then + If BattleScreen.OppPokemon.HP <= 0 Or BattleScreen.OppPokemon.Status = Pokemon.StatusProblems.Fainted Then + GainEXP(BattleScreen) + End If If BattleScreen.IsRemoteBattle And BattleScreen.OppFaint Then - 'Next pokemon is selected by the opponent. - Else - SwitchInOpp(BattleScreen, False, index) - End If - Else - GainEXP(BattleScreen) + 'Next pokemon is selected by the opponent. + Else + SwitchInOpp(BattleScreen, False, index) + End If + Else + GainEXP(BattleScreen) If message = "" Then - message = BattleScreen.Trainer.Name & ": ""Come back, " & BattleScreen.OppPokemon.GetDisplayName() & "!""" - End If + message = BattleScreen.Trainer.Name & ": ""Come back, " & BattleScreen.OppPokemon.GetDisplayName() & "!""" + End If - BattleScreen.BattleQuery.Add(New TextQueryObject(message)) + BattleScreen.BattleQuery.Add(New TextQueryObject(message)) Dim BallReturn As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True, BattleScreen.OppPokemonModel) ' Ball Closes - BallReturn.AnimationPlaySound("Battle\Pokeball\Open", 0, 0) + BallReturn.PlaySound("Battle\Pokeball\Open", 0, 0) Dim SmokeReturned As Integer = 0 Do Dim SmokePosition = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10)) Dim SmokeDestination = New Vector3(0, 0, 0) - Dim SmokeTexture As String = "Textures\Battle\Cloud" + Dim SmokeTexture As String = "Textures\Battle\Smoke" Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10)) Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F) @@ -7178,57 +7172,57 @@ ' Pokemon disappears BallReturn.AnimationFadeEntity(Nothing, 1, False, 0, 1, 0) - BallReturn.AnimationMoveEntity(Nothing, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 4) + BallReturn.MoveEntity(Nothing, False, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 4) ' Ball returns - BallReturn.AnimationPlaySound("Battle\Pokeball\Throw", 1, 0) + BallReturn.PlaySound("Battle\Pokeball\Throw", 1, 0) BallReturn.AnimationSpawnMovingEntity(0, 0, 0, BattleScreen.OppPokemon.CatchBall.TextureSource, 0.3F, 0.3F, 0.3F, -2, 0, 0, 0.1, False, True, 1, 0,, 0.3) BattleScreen.BattleQuery.Add(BallReturn) EndBattle(EndBattleReasons.WinTrainer, BattleScreen, False) - If BattleScreen.IsRemoteBattle = True Then - EndBattle(EndBattleReasons.WinTrainer, BattleScreen, True) - End If - End If - End If - End Sub + If BattleScreen.IsRemoteBattle = True Then + EndBattle(EndBattleReasons.WinTrainer, BattleScreen, True) + End If + End If + End If + End Sub - Public Sub ApplyOppBatonPass(ByVal BattleScreen As BattleScreen) - If BattleScreen.FieldEffects.OppUsedBatonPass = True Then - BattleScreen.FieldEffects.OppUsedBatonPass = False + Public Sub ApplyOppBatonPass(ByVal BattleScreen As BattleScreen) + If BattleScreen.FieldEffects.OppUsedBatonPass = True Then + BattleScreen.FieldEffects.OppUsedBatonPass = False - BattleScreen.OppPokemon.StatAttack = BattleScreen.FieldEffects.OppBatonPassStats(0) - BattleScreen.OppPokemon.StatDefense = BattleScreen.FieldEffects.OppBatonPassStats(1) - BattleScreen.OppPokemon.StatSpAttack = BattleScreen.FieldEffects.OppBatonPassStats(2) - BattleScreen.OppPokemon.StatSpDefense = BattleScreen.FieldEffects.OppBatonPassStats(3) - BattleScreen.OppPokemon.StatSpeed = BattleScreen.FieldEffects.OppBatonPassStats(4) - BattleScreen.OppPokemon.Evasion = BattleScreen.FieldEffects.OppBatonPassStats(5) - BattleScreen.OppPokemon.Accuracy = BattleScreen.FieldEffects.OppBatonPassStats(6) + BattleScreen.OppPokemon.StatAttack = BattleScreen.FieldEffects.OppBatonPassStats(0) + BattleScreen.OppPokemon.StatDefense = BattleScreen.FieldEffects.OppBatonPassStats(1) + BattleScreen.OppPokemon.StatSpAttack = BattleScreen.FieldEffects.OppBatonPassStats(2) + BattleScreen.OppPokemon.StatSpDefense = BattleScreen.FieldEffects.OppBatonPassStats(3) + BattleScreen.OppPokemon.StatSpeed = BattleScreen.FieldEffects.OppBatonPassStats(4) + BattleScreen.OppPokemon.Evasion = BattleScreen.FieldEffects.OppBatonPassStats(5) + BattleScreen.OppPokemon.Accuracy = BattleScreen.FieldEffects.OppBatonPassStats(6) - If BattleScreen.FieldEffects.OppBatonPassConfusion = True Then - BattleScreen.FieldEffects.OppBatonPassConfusion = False - BattleScreen.OppPokemon.AddVolatileStatus(Pokemon.VolatileStatus.Confusion) - End If - End If - End Sub + If BattleScreen.FieldEffects.OppBatonPassConfusion = True Then + BattleScreen.FieldEffects.OppBatonPassConfusion = False + BattleScreen.OppPokemon.AddVolatileStatus(Pokemon.VolatileStatus.Confusion) + End If + End If + End Sub - Public Sub SwitchInOpp(ByVal BattleScreen As BattleScreen, ByVal FirstTime As Boolean, ByVal index As Integer) + Public Sub SwitchInOpp(ByVal BattleScreen As BattleScreen, ByVal FirstTime As Boolean, ByVal index As Integer) - If FirstTime = False Then - HasSwitchedInOpp = True + If FirstTime = False Then + HasSwitchedInOpp = True BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.Name & ": ""Come back, " & BattleScreen.OppPokemon.GetDisplayName() & "!""")) Dim BallReturn As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True, BattleScreen.OppPokemonModel) ' Ball Closes - BallReturn.AnimationPlaySound("Battle\Pokeball\Open", 0, 0) + BallReturn.PlaySound("Battle\Pokeball\Open", 0, 0) Dim SmokeReturned As Integer = 0 Do Dim SmokePosition = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10)) Dim SmokeDestination = New Vector3(0, 0, 0) - Dim SmokeTexture As String = "Textures\Battle\Cloud" + Dim SmokeTexture As String = "Textures\Battle\Smoke" Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10)) Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F) @@ -7239,51 +7233,51 @@ ' Pokemon disappears BallReturn.AnimationFadeEntity(Nothing, 1, False, 0, 1, 0) - BallReturn.AnimationMoveEntity(Nothing, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 4) + BallReturn.MoveEntity(Nothing, False, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 4) ' Ball returns - BallReturn.AnimationPlaySound("Battle\Pokeball\Throw", 1, 0) + BallReturn.PlaySound("Battle\Pokeball\Throw", 1, 0) BallReturn.AnimationSpawnMovingEntity(0, 0, 0, BattleScreen.OppPokemon.CatchBall.TextureSource, 0.3F, 0.3F, 0.3F, -2, 0, 0, 0.1, False, True, 1, 0,, 0.3) BattleScreen.BattleQuery.Add(BallReturn) BattleScreen.SendInNewTrainerPokemon(index) - Me.ApplyOppBatonPass(BattleScreen) + Me.ApplyOppBatonPass(BattleScreen) - If BattleScreen.ParticipatedPokemon.Contains(BattleScreen.OwnPokemonIndex) = False Then - BattleScreen.ParticipatedPokemon.Add(BattleScreen.OwnPokemonIndex) - End If + If BattleScreen.ParticipatedPokemon.Contains(BattleScreen.OwnPokemonIndex) = False Then + BattleScreen.ParticipatedPokemon.Add(BattleScreen.OwnPokemonIndex) + End If - Dim oppShiny As String = "N" - If BattleScreen.OppPokemon.IsShiny = True Then - oppShiny = "S" - End If + Dim oppShiny As String = "N" + If BattleScreen.OppPokemon.IsShiny = True Then + oppShiny = "S" + End If - Dim oppModel As String = BattleScreen.GetModelName(False) + 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)) - Else - BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, oppModel, -1, -1, 1, 0)) - End If + If oppModel = "" Then + BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), -1, -1, 0, 1)) + Else + BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(False, oppModel, -1, -1, 1, 0)) + End If - BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, 1, -1, -1, -1, -1)) + BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, 1, -1, -1, -1, -1)) BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.Name & ": ""Go, " & BattleScreen.OppPokemon.GetDisplayName() & "!""")) ' Ball is thrown Dim BallThrow As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True, BattleScreen.OppPokemonModel) - BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) + BallThrow.PlaySound("Battle\Pokeball\Throw", 0, 0) BallThrow.AnimationSpawnMovingEntity(-2, -0.15, 0, BattleScreen.OwnPokemon.CatchBall.TextureSource, 0.3F, 0.3F, 0.3F, 0, 0.35, 0, 0.1, False, True, 0F, 0F,, 0.3) ' Ball Opens - BallThrow.AnimationPlaySound("Battle\Pokeball\Open", 3, 0) + BallThrow.PlaySound("Battle\Pokeball\Open", 3, 0) Dim SmokeSpawned As Integer = 0 Do Dim SmokePosition = New Vector3(0, 0.35, 0) Dim SmokeDestination = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10)) - Dim SmokeTexture As String = "Textures\Battle\Cloud" + Dim SmokeTexture As String = "Textures\Battle\Smoke" Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10)) Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F) @@ -7294,180 +7288,180 @@ ' Pokemon appears BallThrow.AnimationFadeEntity(Nothing, 1, True, 1, 4, 0) - BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True) + BallThrow.PlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True) ' Pokémon falls down - BallThrow.AnimationMoveEntity(Nothing, 0, 0, 0, 0.05F, False, False, 4, 0,,, 4) + BallThrow.MoveEntity(Nothing, False, 0, 0, 0, 0.05F, False, False, 4, 0,,, 4) BattleScreen.BattleQuery.Add(BallThrow) End If - With BattleScreen - Dim p As Pokemon = .OppPokemon - Dim op As Pokemon = .OwnPokemon + With BattleScreen + Dim p As Pokemon = .OppPokemon + Dim op As Pokemon = .OwnPokemon - Dim spikeAffected As Boolean = True - Dim rockAffected As Boolean = True + Dim spikeAffected As Boolean = True + Dim rockAffected As Boolean = True - spikeAffected = BattleScreen.FieldEffects.IsGrounded(False, BattleScreen) + spikeAffected = BattleScreen.FieldEffects.IsGrounded(False, BattleScreen) - If spikeAffected = True Then - If .FieldEffects.OwnSpikes > 0 And p.Ability.Name.ToLower() <> "magic guard" Then - Dim spikeDamage As Double = 1D - Select Case .FieldEffects.OwnSpikes - Case 1 - spikeDamage = (p.MaxHP / 100) * 12.5D - Case 2 - spikeDamage = (p.MaxHP / 100) * 16.7D - Case 3 - spikeDamage = (p.MaxHP / 100) * 25D - End Select - ReduceHP(CInt(spikeDamage), False, True, BattleScreen, "The Spikes hurt " & p.GetDisplayName() & "!", "spikes") - End If - End If - 'Sticky Web - If spikeAffected = True Then - If .FieldEffects.OwnStickyWeb > 0 Then + If spikeAffected = True Then + If .FieldEffects.OwnSpikes > 0 And p.Ability.Name.ToLower() <> "magic guard" Then + Dim spikeDamage As Double = 1D + Select Case .FieldEffects.OwnSpikes + Case 1 + spikeDamage = (p.MaxHP / 100) * 12.5D + Case 2 + spikeDamage = (p.MaxHP / 100) * 16.7D + Case 3 + spikeDamage = (p.MaxHP / 100) * 25D + End Select + ReduceHP(CInt(spikeDamage), False, True, BattleScreen, "The Spikes hurt " & p.GetDisplayName() & "!", "spikes") + End If + End If + 'Sticky Web + If spikeAffected = True Then + If .FieldEffects.OwnStickyWeb > 0 Then - LowerStat(False, False, BattleScreen, "Speed", 1, "The opposing pokemon was caught in a Sticky Web!", "stickyweb") + LowerStat(False, False, BattleScreen, "Speed", 1, "The opposing pokemon was caught in a Sticky Web!", "stickyweb") - End If - End If - If spikeAffected = True Then - If .FieldEffects.OwnToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And p.Type2.Type <> Element.Types.Poison Then - Select Case .FieldEffects.OwnToxicSpikes - Case 1 - InflictPoison(False, True, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") - Case 2 - InflictPoison(False, True, BattleScreen, True, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") - End Select - End If - If .FieldEffects.OwnToxicSpikes > 0 Then - If p.Type1.Type = Element.Types.Poison Or p.Type2.Type = Element.Types.Poison Then - .BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " removed the Toxic Spikes!")) - .FieldEffects.OwnToxicSpikes = 0 - End If - End If - End If + End If + End If + If spikeAffected = True Then + If .FieldEffects.OwnToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And p.Type2.Type <> Element.Types.Poison Then + Select Case .FieldEffects.OwnToxicSpikes + Case 1 + InflictPoison(False, True, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") + Case 2 + InflictPoison(False, True, BattleScreen, True, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") + End Select + End If + If .FieldEffects.OwnToxicSpikes > 0 Then + If p.Type1.Type = Element.Types.Poison Or p.Type2.Type = Element.Types.Poison Then + .BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " removed the Toxic Spikes!")) + .FieldEffects.OwnToxicSpikes = 0 + End If + End If + End If - If rockAffected = True Then - If .FieldEffects.OwnStealthRock > 0 And p.Ability.Name.ToLower() <> "magic guard" Then - Dim rocksDamage As Double = 1D + If rockAffected = True Then + If .FieldEffects.OwnStealthRock > 0 And p.Ability.Name.ToLower() <> "magic guard" Then + Dim rocksDamage As Double = 1D - Dim effectiveness As Single = BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type1)) * BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type2)) - Select Case effectiveness - Case 0.25F - rocksDamage = (p.MaxHP / 100) * 3.125D - Case 0.5F - rocksDamage = (p.MaxHP / 100) * 6.25D - Case 1.0F - rocksDamage = (p.MaxHP / 100) * 12.5D - Case 2.0F - rocksDamage = (p.MaxHP / 100) * 25D - Case 4.0F - rocksDamage = (p.MaxHP / 100) * 50D - End Select + Dim effectiveness As Single = BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type1)) * BattleCalculation.ReverseTypeEffectiveness(Element.GetElementMultiplier(New Element(Element.Types.Rock), p.Type2)) + Select Case effectiveness + Case 0.25F + rocksDamage = (p.MaxHP / 100) * 3.125D + Case 0.5F + rocksDamage = (p.MaxHP / 100) * 6.25D + Case 1.0F + rocksDamage = (p.MaxHP / 100) * 12.5D + Case 2.0F + rocksDamage = (p.MaxHP / 100) * 25D + Case 4.0F + rocksDamage = (p.MaxHP / 100) * 50D + End Select - ReduceHP(CInt(rocksDamage), False, True, BattleScreen, "The Stealth Rocks hurt " & p.GetDisplayName() & "!", "stealthrocks") - End If - End If + ReduceHP(CInt(rocksDamage), False, True, BattleScreen, "The Stealth Rocks hurt " & p.GetDisplayName() & "!", "stealthrocks") + End If + End If - TriggerAbilityEffect(BattleScreen, False) - TriggerItemEffect(BattleScreen, False) + TriggerAbilityEffect(BattleScreen, False) + TriggerItemEffect(BattleScreen, False) - If .OppPokemon.Status = Pokemon.StatusProblems.Sleep Then - .FieldEffects.OppSleepTurns = Core.Random.Next(1, 4) - End If + If .OppPokemon.Status = Pokemon.StatusProblems.Sleep Then + .FieldEffects.OppSleepTurns = Core.Random.Next(1, 4) + End If - If BattleScreen.FieldEffects.OppHealingWish = True Then - BattleScreen.FieldEffects.OppHealingWish = False + If BattleScreen.FieldEffects.OppHealingWish = True Then + BattleScreen.FieldEffects.OppHealingWish = False - If .OppPokemon.HP < .OppPokemon.MaxHP Or .OppPokemon.Status <> Pokemon.StatusProblems.None Then - GainHP(.OppPokemon.MaxHP - .OppPokemon.HP, False, False, BattleScreen, "The Healing Wish came true for " & .OppPokemon.GetDisplayName() & "!", "move:healingwish") - CureStatusProblem(False, False, BattleScreen, "", "move:healingwish") - End If - End If - End With - End Sub + If .OppPokemon.HP < .OppPokemon.MaxHP Or .OppPokemon.Status <> Pokemon.StatusProblems.None Then + GainHP(.OppPokemon.MaxHP - .OppPokemon.HP, False, False, BattleScreen, "The Healing Wish came true for " & .OppPokemon.GetDisplayName() & "!", "move:healingwish") + CureStatusProblem(False, False, BattleScreen, "", "move:healingwish") + End If + End If + End With + End Sub #End Region #Region "EndBattle" - Enum EndBattleReasons - WinWild - LoseWild - WinTrainer - LoseTrainer - WinPvP - LosePvP - End Enum + Enum EndBattleReasons + WinWild + LoseWild + WinTrainer + LoseTrainer + WinPvP + LosePvP + End Enum - Public Sub EndBattle(ByVal reason As EndBattleReasons, ByVal BattleScreen As BattleScreen, ByVal AddPVP As Boolean) - BattleScreen.OwnFaint = False - BattleScreen.OppFaint = False - IsAfterFaint = False - If AddPVP = True Then - Select Case reason - Case EndBattleReasons.WinTrainer 'Lost - Dim q As New CameraQueryObject(New Vector3(12, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, (MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.02F, 0.02F) - q.ApplyCurrentCamera = True - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 5, q) + Public Sub EndBattle(ByVal reason As EndBattleReasons, ByVal BattleScreen As BattleScreen, ByVal AddPVP As Boolean) + BattleScreen.OwnFaint = False + BattleScreen.OppFaint = False + IsAfterFaint = False + If AddPVP = True Then + Select Case reason + Case EndBattleReasons.WinTrainer 'Lost + Dim q As New CameraQueryObject(New Vector3(12, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, (MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.02F, 0.02F) + q.ApplyCurrentCamera = True + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 5, q) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 4, New TextQueryObject("You lost the battle!")) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 3, New TextQueryObject("")) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 2, New TextQueryObject("")) + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 4, New TextQueryObject("You lost the battle!")) + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 3, New TextQueryObject("")) + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 2, New TextQueryObject("")) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 1, New EndBattleQueryObject(True)) - Case EndBattleReasons.LoseTrainer 'Won - Dim q As New CameraQueryObject(New Vector3(15, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, -(MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.02F, 0.02F) - q.ApplyCurrentCamera = True - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 3, q) + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 1, New EndBattleQueryObject(True)) + Case EndBattleReasons.LoseTrainer 'Won + Dim q As New CameraQueryObject(New Vector3(15, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, -(MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.02F, 0.02F) + q.ApplyCurrentCamera = True + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 3, q) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 2, New TextQueryObject("Pokémon Trainer " & Core.Player.Name & " was defeated!")) + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 2, New TextQueryObject("Pokémon Trainer " & Core.Player.Name & " was defeated!")) - BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 1, New EndBattleQueryObject(True)) - End Select - Else - Select Case reason - Case EndBattleReasons.WinWild - Won = True - Core.Player.AddPoints(1, "Won against wild Pokémon.") + BattleScreen.TempPVPBattleQuery.Add(BattleScreen.BattleQuery.Count - 1, New EndBattleQueryObject(True)) + End Select + Else + Select Case reason + Case EndBattleReasons.WinWild + Won = True + Core.Player.AddPoints(1, "Won against wild Pokémon.") - BattleScreen.BattleQuery.Add(New PlayMusicQueryObject("wild_defeat")) - ChangeCameraAngle(1, True, BattleScreen) + BattleScreen.BattleQuery.Add(New PlayMusicQueryObject("wild_defeat")) + ChangeCameraAngle(1, True, BattleScreen) - GainEXP(BattleScreen) + GainEXP(BattleScreen) - If BattleScreen.FieldEffects.OwnPayDayCounter > 0 Then - Core.Player.Money += BattleScreen.FieldEffects.OwnPayDayCounter - BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Name & " picked up $" & BattleScreen.FieldEffects.OwnPayDayCounter & "!")) - End If + If BattleScreen.FieldEffects.OwnPayDayCounter > 0 Then + Core.Player.Money += BattleScreen.FieldEffects.OwnPayDayCounter + BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Name & " picked up $" & BattleScreen.FieldEffects.OwnPayDayCounter & "!")) + End If - BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False)) - Case EndBattleReasons.WinTrainer - Won = True - Core.Player.AddPoints(3, "Won against trainer.") + BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False)) + Case EndBattleReasons.WinTrainer + Won = True + Core.Player.AddPoints(3, "Won against trainer.") - Core.Player.Money += BattleScreen.GetTrainerMoney() + Core.Player.Money += BattleScreen.GetTrainerMoney() - BattleScreen.BattleQuery.Add(New PlayMusicQueryObject(BattleScreen.Trainer.GetDefeatMusic())) + BattleScreen.BattleQuery.Add(New PlayMusicQueryObject(BattleScreen.Trainer.GetDefeatMusic())) - Dim q As New CameraQueryObject(New Vector3(15, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, -(MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.04F, 0.02F) - q.ApplyCurrentCamera = True - BattleScreen.BattleQuery.Add(q) + Dim q As New CameraQueryObject(New Vector3(15, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, -(MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.04F, 0.02F) + q.ApplyCurrentCamera = True + BattleScreen.BattleQuery.Add(q) - BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.TrainerType & " " & BattleScreen.Trainer.Name & " was defeated!")) - BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.OutroMessage)) + BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.TrainerType & " " & BattleScreen.Trainer.Name & " was defeated!")) + BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.OutroMessage)) - If BattleScreen.GetTrainerMoney() > 0 Then - BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Name & " got $" & BattleScreen.GetTrainerMoney() & "!")) - End If + If BattleScreen.GetTrainerMoney() > 0 Then + BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Name & " got $" & BattleScreen.GetTrainerMoney() & "!")) + End If - BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False)) - Case EndBattleReasons.LoseTrainer, EndBattleReasons.LoseWild - Won = False + BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False)) + Case EndBattleReasons.LoseTrainer, EndBattleReasons.LoseWild + Won = False Dim q As New CameraQueryObject(New Vector3(12, 0, 13), Screen.Camera.Position, 0.03F, 0.03F, (MathHelper.Pi * 0.5F), Screen.Camera.Yaw, 0.0F, Screen.Camera.Pitch, 0.02F, 0.02F) q.ApplyCurrentCamera = True BattleScreen.BattleQuery.Add(q) diff --git a/P3D/Pokemon/Attacks/Fire/Ember.vb b/P3D/Pokemon/Attacks/Fire/Ember.vb index 6719f780d..03a9cfffc 100644 --- a/P3D/Pokemon/Attacks/Fire/Ember.vb +++ b/P3D/Pokemon/Attacks/Fire/Ember.vb @@ -66,7 +66,7 @@ Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) MoveAnimation.AnimationSpawnMovingEntity(0.0, 0, 0.0, "Textures\Battle\Fire\FireBall", 0.5, 0.5, 0.5, 2.0, 0.0, 0.0, 0.05, False, True, 0.0, 0.0,, -0.5, 0) - MoveAnimation.AnimationPlaySound("Battle\Attacks\Fire\Ember_Start", 0, 0) + MoveAnimation.PlaySound("Battle\Attacks\Fire\Ember_Start", 0, 0) For i = 0 To 12 MoveAnimation.AnimationSpawnFadingEntity(CSng(i * 0.2), 0.0, 0.0, "Textures\Battle\Fire\Smoke", 0.2, 0.2, 0.2, 0.02, False, 0.0, CSng(i * 0.2), 0.0) i += 1 @@ -82,7 +82,7 @@ MoveAnimation.AnimationSpawnFadingEntity(CSng(3.0 - i * 0.2), 0.0, 0.0, "Textures\Battle\Fire\Smoke", 0.2, 0.2, 0.2, 0.02, False, 0.0, CSng(i * 0.2), 0.0) i += 1 Next - MoveAnimation.AnimationPlaySound("Battle\Attacks\Fire\Ember_Hit", 2, 0) + MoveAnimation.PlaySound("Battle\Attacks\Fire\Ember_Hit", 2, 0) MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) diff --git a/P3D/Pokemon/Attacks/Grass/Absorb.vb b/P3D/Pokemon/Attacks/Grass/Absorb.vb index 9590c3d18..318503d28 100644 --- a/P3D/Pokemon/Attacks/Grass/Absorb.vb +++ b/P3D/Pokemon/Attacks/Grass/Absorb.vb @@ -96,7 +96,7 @@ Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) Dim maxAmount As Integer = 8 Dim currentAmount As Integer = 0 - MoveAnimation.AnimationPlaySound("Battle\Attacks\Grass\Absorb", 0, 0) + MoveAnimation.PlaySound("Battle\Attacks\Grass\Absorb", 0, 0) While currentAmount <= maxAmount Dim yPos As Single = CSng(Random.NextDouble() * 0.5) Dim zPos As Single = CSng(Random.Next(-5, 5) * 0.15) diff --git a/P3D/Pokemon/Attacks/Normal/Growl.vb b/P3D/Pokemon/Attacks/Normal/Growl.vb index 5c35961e3..e01dafc73 100644 --- a/P3D/Pokemon/Attacks/Normal/Growl.vb +++ b/P3D/Pokemon/Attacks/Normal/Growl.vb @@ -64,7 +64,7 @@ Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) - MoveAnimation.AnimationPlaySound(CStr(CurrentPokemon.Number), 0, 0,, True) + MoveAnimation.PlaySound(CStr(CurrentPokemon.Number), 0, 0,, True) MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1) MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1) diff --git a/P3D/Pokemon/Attacks/Normal/Pound.vb b/P3D/Pokemon/Attacks/Normal/Pound.vb index 25785556e..5cf85b3e2 100644 --- a/P3D/Pokemon/Attacks/Normal/Pound.vb +++ b/P3D/Pokemon/Attacks/Normal/Pound.vb @@ -57,7 +57,7 @@ Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) - MoveAnimation.AnimationPlaySound("Battle\Attacks\Pound", 0.5, 2.5) + MoveAnimation.PlaySound("Battle\Attacks\Pound", 0.5, 2.5) MoveAnimation.AnimationSpawnFadingEntity(0, -0.25, 0, "Textures\Battle\Normal\Pound", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 3) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub diff --git a/P3D/Pokemon/Attacks/Normal/Tackle.vb b/P3D/Pokemon/Attacks/Normal/Tackle.vb index 4d53f749d..99e61e709 100644 --- a/P3D/Pokemon/Attacks/Normal/Tackle.vb +++ b/P3D/Pokemon/Attacks/Normal/Tackle.vb @@ -54,15 +54,16 @@ Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own, CurrentModel) - MoveAnimation.AnimationMoveEntity(Nothing, 0.5, 0, 0, 0.3, False, False, 0, 0,,, 2) - MoveAnimation.AnimationMoveEntity(Nothing, 0, 0, 0, 0.3, False, False, 1, 0,,, 2) + MoveAnimation.MoveEntity(Nothing, False, 0.5, 0, 0, 0.3, False, False, 0, 0,,, 2) + MoveAnimation.MoveEntity(Nothing, False, 0, 0, 0, 0.3, False, False, 1, 0,,, 2) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) - MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Tackle", 0, 2) - MoveAnimation.AnimationSpawnFadingEntity(0, -0.25, 0, "Textures\Battle\Normal\Tackle", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 2) + MoveAnimation.PlaySound("Battle\Attacks\Normal\Tackle", 0, 2) + Dim SpawnEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.25, 0), TextureManager.GetTexture("Textures\Battle\Normal\Tackle"), New Vector3(1.0F), 1.0F) + MoveAnimation.FadeEntity(SpawnEntity, True, 0.02, False, 1.0F, 0, 2) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub End Class diff --git a/P3D/Pokemon/Attacks/Poison/PoisonSting.vb b/P3D/Pokemon/Attacks/Poison/PoisonSting.vb index 9684f8379..3cc76f0a4 100644 --- a/P3D/Pokemon/Attacks/Poison/PoisonSting.vb +++ b/P3D/Pokemon/Attacks/Poison/PoisonSting.vb @@ -67,30 +67,38 @@ Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) - MoveAnimation.AnimationSpawnMovingEntity(0.0, 0, 0.0, "Textures\Battle\Poison\Stinger", 0.5, 0.5, 0.5, 2.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0) - MoveAnimation.AnimationPlaySound("Battle\Attacks\Poison\PoisonSting_Start", 0, 0) + Dim StingerEntity As Entity = MoveAnimation.SpawnEntity(CurrentEntity.Position, TextureManager.GetTexture("Textures\Battle\Poison\Stinger"), New Vector3(0.5F), 1.0F) + + MoveAnimation.PlaySound("Battle\Attacks\Poison\PoisonSting_Start", 0, 0) + MoveAnimation.MoveEntity(StingerEntity, True, 2.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0) + BattleScreen.BattleQuery.Add(MoveAnimation) End Sub Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own) - MoveAnimation.AnimationSpawnMovingEntity(2.0, 0, 0.0, "Textures\Battle\Poison\Stinger", 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0) + Dim StingerEntity As Entity = MoveAnimation.SpawnEntity(New Vector3(2.0, 0, 0.0), TextureManager.GetTexture("Textures\Battle\Poison\Stinger"), New Vector3(0.5F), 1) - MoveAnimation.AnimationPlaySound("Battle\Attacks\Poison\PoisonSting_Hit", 1, 0) - MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1) + MoveAnimation.MoveEntity(StingerEntity, True, 0.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0) - MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1) + MoveAnimation.PlaySound("Battle\Attacks\Poison\PoisonSting_Hit", 1, 0) - MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1) + Dim BubbleEntity1 As Entity = MoveAnimation.SpawnEntity(New Vector3(-0.25, -0.25, -0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 1, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 4, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 4, 1) + MoveAnimation.ChangeEntityTexture(BubbleEntity1, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 2, 1) - MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 5, 2) + Dim BubbleEntity2 As Entity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, 0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 2, 1) + + MoveAnimation.ChangeEntityTexture(BubbleEntity1, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 3, 1) + MoveAnimation.ChangeEntityTexture(BubbleEntity2, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 3, 1) + + Dim BubbleEntity3 As Entity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, -0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 3, 1) + + MoveAnimation.ChangeEntityTexture(BubbleEntity2, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 4, 1) + MoveAnimation.ChangeEntityTexture(BubbleEntity3, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 4, 1) + + MoveAnimation.ChangeEntityTexture(BubbleEntity3, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 5, 1) BattleScreen.BattleQuery.Add(MoveAnimation) End Sub