Fix various Pokémon Type check errors

This commit is contained in:
JappaWakka 2024-04-23 17:29:41 +02:00
parent c0b3fe06d0
commit 9d912e939b
3 changed files with 4 additions and 4 deletions
P3D
Battle/BattleSystemV2
Screens/Pokedex

@ -8173,7 +8173,7 @@
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
If .FieldEffects.OwnToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And (p.Type2 IsNot Nothing AndAlso 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")

@ -387,7 +387,7 @@
End If
Else
p = BattleScreen.OppPokemon
If p.Type1.Type = Element.Types.Flying Or p.Type2.Type = Element.Types.Flying Or p.Ability.Name.ToLower() = "levitate" And BattleScreen.FieldEffects.CanUseAbility(False, BattleScreen) = True Then
If p.Type1.Type = Element.Types.Flying Or (p.Type2 IsNot Nothing AndAlso p.Type2.Type = Element.Types.Flying) Or p.Ability.Name.ToLower() = "levitate" And BattleScreen.FieldEffects.CanUseAbility(False, BattleScreen) = True Then
grounded = False
End If
If BattleScreen.FieldEffects.Gravity > 0 Or BattleScreen.FieldEffects.OppSmacked > 0 Or BattleScreen.FieldEffects.OppIngrain > 0 Then

@ -745,7 +745,7 @@ Public Class PokedexScreen
Core.SpriteBatch.DrawString(FontManager.MainFont, p.PokedexEntry.Weight & " kg", New Vector2(850, 430), Color.Black)
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(850, 356, 48, 16), p.Type1.GetElementImage(), Color.White)
If p.Type2.Type <> Element.Types.Blank Then
If p.Type2 IsNot Nothing AndAlso p.Type2.Type <> Element.Types.Blank Then
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(900, 356, 48, 16), p.Type2.GetElementImage(), Color.White)
End If
@ -1747,7 +1747,7 @@ Public Class PokedexViewScreen
Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Height & " m", New Vector2(CInt(mV.X + 250), CInt(mV.Y - 152)), Color.Black)
Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Weight & " kg", New Vector2(CInt(mV.X + 250), CInt(mV.Y + 128)), Color.Black)
Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Species, New Vector2(CInt(mV.X - 248 - FontManager.MainFont.MeasureString(Pokemon.PokedexEntry.Species).X), CInt(mV.Y - 152)), Color.Black)
If Pokemon.Type2.Type <> Element.Types.Blank Then
If Pokemon.Type2 IsNot Nothing AndAlso Pokemon.Type2.Type <> Element.Types.Blank Then
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 450), CInt(mV.Y + 123), 96, 32), Pokemon.Type1.GetElementImage(), Color.White)
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 350), CInt(mV.Y + 123), 96, 32), Pokemon.Type2.GetElementImage(), Color.White)
Else