Fix Pokémon Learn Move Bugs
This commit is contained in:
parent
ac07ee10ea
commit
0a218527b3
|
@ -8302,12 +8302,13 @@
|
|||
|
||||
For i = 0 To expPokemon.Count - 1
|
||||
Dim PokeIndex As Integer = expPokemon(i)
|
||||
|
||||
Dim AttackLearnList As New List(Of BattleSystem.Attack)
|
||||
Dim LevelUpAmount As Integer = 0
|
||||
Dim originalLevel As Integer = Core.Player.Pokemons(PokeIndex).Level
|
||||
If Core.Player.Pokemons(PokeIndex).Level < CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
||||
Dim EXP As Integer = BattleCalculation.GainExp(Core.Player.Pokemons(PokeIndex), BattleScreen, expPokemon)
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Pokemons(PokeIndex).GetDisplayName() & " gained " & EXP & " experience points."))
|
||||
|
||||
Dim originalLevel As Integer = Core.Player.Pokemons(PokeIndex).Level
|
||||
Dim moveLevel As Integer = originalLevel
|
||||
|
||||
For e = 1 To EXP
|
||||
|
@ -8327,11 +8328,30 @@
|
|||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\exp_max", False))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Core.Player.Pokemons(PokeIndex).GetDisplayName() & " reached level " & moveLevel & "!"))
|
||||
BattleScreen.BattleQuery.Add(New DisplayLevelUpQueryObject(Core.Player.Pokemons(PokeIndex), oldStats))
|
||||
If Core.Player.Pokemons(PokeIndex).AttackLearns.ContainsKey(moveLevel) = True AndAlso Core.Player.Pokemons(PokeIndex).KnowsMove(Core.Player.Pokemons(PokeIndex).AttackLearns(Core.Player.Pokemons(PokeIndex).Level)) = False Then
|
||||
BattleScreen.BattleQuery.Add(New LearnMovesQueryObject(Core.Player.Pokemons(PokeIndex), Core.Player.Pokemons(PokeIndex).AttackLearns(moveLevel), BattleScreen))
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
LevelUpAmount = moveLevel - originalLevel
|
||||
End If
|
||||
If LevelUpAmount > 0 Then
|
||||
For l = 1 To LevelUpAmount
|
||||
If Core.Player.Pokemons(PokeIndex).AttackLearns.ContainsKey(originalLevel + l) Then
|
||||
|
||||
Dim aList As List(Of BattleSystem.Attack) = Core.Player.Pokemons(PokeIndex).AttackLearns(originalLevel + l)
|
||||
For a = 0 To aList.Count - 1
|
||||
If AttackLearnList.Contains(aList(a)) = False AndAlso Core.Player.Pokemons(PokeIndex).KnowsMove(aList(a)) = False Then
|
||||
AttackLearnList.Add(aList(a))
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
If AttackLearnList.Count > 0 Then
|
||||
For a = 0 To AttackLearnList.Count - 1
|
||||
BattleScreen.BattleQuery.Add(New LearnMovesQueryObject(Core.Player.Pokemons(PokeIndex), AttackLearnList(a), BattleScreen))
|
||||
Next
|
||||
End If
|
||||
|
||||
Core.Player.Pokemons(PokeIndex).GainEffort(BattleScreen.OppPokemon)
|
||||
|
|
|
@ -547,10 +547,12 @@ Public Class GameModeItem
|
|||
Return ""
|
||||
End If
|
||||
|
||||
For Each learnAttack As BattleSystem.Attack In p.AttackLearns.Values
|
||||
If learnAttack.ID = gmTeachMove.ID Then
|
||||
Return ""
|
||||
End If
|
||||
For Each aList As List(Of BattleSystem.Attack) In p.AttackLearns.Values
|
||||
For Each learnAttack As BattleSystem.Attack In aList
|
||||
If learnAttack.ID = gmTeachMove.ID Then
|
||||
Return ""
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If gmCanTeachAlways = True Then
|
||||
|
|
|
@ -42,24 +42,28 @@ Namespace Items.Medicine
|
|||
Dim removedItem As Boolean = False
|
||||
|
||||
If Pokemon.AttackLearns.ContainsKey(Pokemon.Level) = True Then
|
||||
If Pokemon.KnowsMove(Pokemon.AttackLearns(Pokemon.Level)) = False Then
|
||||
If Pokemon.Attacks.Count = 4 Then
|
||||
s &= "@pokemon.learnattack(" & PokeIndex & "," & Pokemon.AttackLearns(Pokemon.Level).ID & ")" & Environment.NewLine
|
||||
Dim aList As List(Of BattleSystem.Attack) = Pokemon.AttackLearns(Pokemon.Level)
|
||||
For a = 0 To aList.Count - 1
|
||||
If Pokemon.KnowsMove(aList(a)) = False Then
|
||||
If Pokemon.Attacks.Count = 4 Then
|
||||
s &= "@pokemon.learnattack(" & PokeIndex & "," & aList(a).ID & ")" & Environment.NewLine
|
||||
|
||||
Dim t As String = Me.RemoveItem()
|
||||
If t <> "" Then
|
||||
s &= "@text.show(" & t & ")" & Environment.NewLine
|
||||
Dim t As String = Me.RemoveItem()
|
||||
If t <> "" Then
|
||||
s &= "@text.show(" & t & ")" & Environment.NewLine
|
||||
End If
|
||||
removedItem = True
|
||||
Else
|
||||
Pokemon.Attacks.Add(aList(a))
|
||||
|
||||
s &= "@sound.play(success_small,1)" & Environment.NewLine &
|
||||
"@text.show(" & Pokemon.GetDisplayName() & " learned~" & aList(a).Name & "!" & Me.RemoveItem() & ")" & Environment.NewLine
|
||||
removedItem = True
|
||||
PlayerStatistics.Track("Moves learned", 1)
|
||||
End If
|
||||
removedItem = True
|
||||
Else
|
||||
Pokemon.Attacks.Add(Pokemon.AttackLearns(Pokemon.Level))
|
||||
|
||||
s &= "@sound.play(success_small,1)" & Environment.NewLine &
|
||||
"@text.show(" & Pokemon.GetDisplayName() & " learned~" & Pokemon.AttackLearns(Pokemon.Level).Name & "!" & Me.RemoveItem() & ")" & Environment.NewLine
|
||||
removedItem = True
|
||||
PlayerStatistics.Track("Moves learned", 1)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If Pokemon.CanEvolve(EvolutionCondition.EvolutionTrigger.LevelUp, "") = True Then
|
||||
|
|
|
@ -143,10 +143,12 @@
|
|||
Return ""
|
||||
End If
|
||||
|
||||
For Each learnAttack As BattleSystem.Attack In p.AttackLearns.Values
|
||||
If learnAttack.ID = Attack.ID Then
|
||||
Return ""
|
||||
End If
|
||||
For Each aList As List(Of BattleSystem.Attack) In p.AttackLearns.Values
|
||||
For Each learnAttack As BattleSystem.Attack In aList
|
||||
If learnAttack.ID = Attack.ID Then
|
||||
Return ""
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If CanTeachAlways = True Then
|
||||
|
|
|
@ -633,7 +633,7 @@ Public Class Pokemon
|
|||
Private _type1 As Element
|
||||
Private _type2 As Element
|
||||
Public StartItems As New Dictionary(Of Item, Integer)
|
||||
Public AttackLearns As New Dictionary(Of Integer, BattleSystem.Attack)
|
||||
Public AttackLearns As New Dictionary(Of Integer, List(Of BattleSystem.Attack))
|
||||
Public EggMoves As New List(Of Integer)
|
||||
Public TutorAttacks As New List(Of BattleSystem.Attack)
|
||||
Public EvolutionConditions As New List(Of EvolutionCondition)
|
||||
|
@ -1385,6 +1385,7 @@ Public Class Pokemon
|
|||
''' Loads definition data from the data files and empties the temp textures.
|
||||
''' </summary>
|
||||
Public Sub ReloadDefinitions()
|
||||
Me.AttackLearns.Clear()
|
||||
Me.LoadDefinitions(Me.Number, Me.AdditionalData)
|
||||
Me.ClearTextures()
|
||||
End Sub
|
||||
|
@ -1562,12 +1563,11 @@ Public Class Pokemon
|
|||
Dim MoveID As Integer = CInt(Value.GetSplit(1))
|
||||
|
||||
If AttackLearns.ContainsKey(Level) = True Then
|
||||
While AttackLearns.ContainsKey(Level)
|
||||
Level += 1
|
||||
End While
|
||||
AttackLearns(Level).Add(BattleSystem.Attack.GetAttackByID(MoveID))
|
||||
Else
|
||||
AttackLearns.Add(Level, New List(Of BattleSystem.Attack))
|
||||
AttackLearns(Level).Add(BattleSystem.Attack.GetAttackByID(MoveID))
|
||||
End If
|
||||
|
||||
Me.AttackLearns.Add(Level, BattleSystem.Attack.GetAttackByID(MoveID))
|
||||
Case "evolutioncondition"
|
||||
'Evolution,Type,Argument,Trigger
|
||||
|
||||
|
@ -1612,7 +1612,7 @@ Public Class Pokemon
|
|||
Me.EggPokemon = Me.Number.ToString
|
||||
End If
|
||||
|
||||
Dim pAttacks As New SortedDictionary(Of Integer, BattleSystem.Attack)
|
||||
Dim pAttacks As New SortedDictionary(Of Integer, List(Of BattleSystem.Attack))
|
||||
For i = 0 To AttackLearns.Count - 1
|
||||
pAttacks.Add(AttackLearns.Keys(i), AttackLearns.Values(i))
|
||||
Next
|
||||
|
@ -2138,26 +2138,29 @@ Public Class Pokemon
|
|||
Dim canLearnMoves As New List(Of BattleSystem.Attack)
|
||||
For i = 0 To Me.AttackLearns.Count - 1
|
||||
If Me.AttackLearns.Keys(i) <= Me.Level Then
|
||||
For Each levelAttack As BattleSystem.Attack In Me.AttackLearns(Me.AttackLearns.Keys(i))
|
||||
Dim hasMove As Boolean = False
|
||||
|
||||
Dim hasMove As Boolean = False
|
||||
For Each m As BattleSystem.Attack In Me.Attacks
|
||||
If m.ID = Me.AttackLearns.Values(i).ID Then
|
||||
hasMove = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If hasMove = False Then
|
||||
For Each m As BattleSystem.Attack In canLearnMoves
|
||||
If m.ID = Me.AttackLearns.Values(i).ID Then
|
||||
For Each m As BattleSystem.Attack In Me.Attacks
|
||||
If m.ID = levelAttack.ID Then
|
||||
hasMove = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If hasMove = False Then
|
||||
For Each m As BattleSystem.Attack In canLearnMoves
|
||||
If m.ID = levelAttack.ID Then
|
||||
hasMove = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If hasMove = False Then
|
||||
canLearnMoves.Add(Me.AttackLearns.Values(i))
|
||||
End If
|
||||
If hasMove = False Then
|
||||
canLearnMoves.Add(levelAttack)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
|
@ -2452,7 +2455,13 @@ Public Class Pokemon
|
|||
''' <param name="learnLevel">The level the Pokémon learns the desired move on.</param>
|
||||
Public Sub LearnAttack(ByVal learnLevel As Integer)
|
||||
If AttackLearns.ContainsKey(learnLevel) = True Then
|
||||
Dim a As BattleSystem.Attack = AttackLearns(learnLevel)
|
||||
Dim a As BattleSystem.Attack
|
||||
Dim aList As List(Of BattleSystem.Attack) = AttackLearns(learnLevel)
|
||||
If aList.Count > 1 Then
|
||||
a = aList(Random.Next(0, aList.Count - 1))
|
||||
Else
|
||||
a = aList(0)
|
||||
End If
|
||||
|
||||
For Each la As BattleSystem.Attack In Attacks
|
||||
If la.ID = a.ID Then
|
||||
|
|
|
@ -111,14 +111,18 @@
|
|||
Case 1
|
||||
cParent = parent2
|
||||
End Select
|
||||
For Each THMMove As BattleSystem.Attack In p.AttackLearns.Values
|
||||
For Each m1 As BattleSystem.Attack In cParent.Attacks
|
||||
If m1.ID = THMMove.ID Then
|
||||
Dim newAttack As BattleSystem.Attack = BattleSystem.Attack.GetAttackByID(m1.ID)
|
||||
EggMoves.Add(newAttack)
|
||||
End If
|
||||
For Each aList As List(Of BattleSystem.Attack) In p.AttackLearns.Values
|
||||
For Each THMMove As BattleSystem.Attack In aList
|
||||
For Each m1 As BattleSystem.Attack In cParent.Attacks
|
||||
If m1.ID = THMMove.ID Then
|
||||
Dim newAttack As BattleSystem.Attack = BattleSystem.Attack.GetAttackByID(m1.ID)
|
||||
EggMoves.Add(newAttack)
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
' Egg Moves:
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
Dim evolutionStarted As Boolean = False
|
||||
Dim evolved As Boolean = False
|
||||
Dim brokeEvolution As Boolean = False
|
||||
Dim learnAttack As Boolean = False
|
||||
Dim AttackLearnList As New List(Of BattleSystem.Attack)
|
||||
|
||||
Dim EvolutionArg As String = ""
|
||||
Dim EvolutionTrigger As EvolutionCondition.EvolutionTrigger
|
||||
|
@ -198,6 +198,7 @@
|
|||
Sparks.Add(New Spark())
|
||||
Next
|
||||
Else
|
||||
|
||||
If evolutionReady = False And TextBox.Showing = False Then
|
||||
MusicManager.Play("evolution", True)
|
||||
|
||||
|
@ -260,16 +261,19 @@
|
|||
evolutionReady = True
|
||||
Dim t As String = "Congratulations!*Your " & currentPokemon.GetDisplayName() & "~evolved into " & evolvedPokemon.GetName() & "!"
|
||||
If evolvedPokemon.AttackLearns.ContainsKey(evolvedPokemon.Level) = True Then
|
||||
If evolvedPokemon.KnowsMove(evolvedPokemon.AttackLearns(evolvedPokemon.Level)) = False Then
|
||||
If evolvedPokemon.Attacks.Count = 4 Then
|
||||
Me.learnAttack = True
|
||||
Else
|
||||
evolvedPokemon.Attacks.Add(evolvedPokemon.AttackLearns(evolvedPokemon.Level))
|
||||
Dim aList As List(Of BattleSystem.Attack) = evolvedPokemon.AttackLearns(evolvedPokemon.Level)
|
||||
For a = 0 To aList.Count - 1
|
||||
If evolvedPokemon.KnowsMove(aList(a)) = False Then
|
||||
If evolvedPokemon.Attacks.Count = 4 Then
|
||||
Me.AttackLearnList.Add(aList(a))
|
||||
Else
|
||||
evolvedPokemon.Attacks.Add(aList(a))
|
||||
|
||||
t &= "*" & evolvedPokemon.GetDisplayName() & " learned~" & evolvedPokemon.AttackLearns(evolvedPokemon.Level).Name & "!"
|
||||
PlayerStatistics.Track("Moves learned", 1)
|
||||
t &= "*" & evolvedPokemon.GetDisplayName() & " learned~" & aList(a).Name & "!"
|
||||
PlayerStatistics.Track("Moves learned", 1)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Me.EvolutionTrigger = EvolutionCondition.EvolutionTrigger.Trading Then
|
||||
|
@ -298,9 +302,9 @@
|
|||
End If
|
||||
Else
|
||||
If TextBox.Showing = False Then
|
||||
If learnAttack = True Then
|
||||
learnAttack = False
|
||||
Core.SetScreen(New LearnAttackScreen(Core.CurrentScreen, evolvedPokemon, evolvedPokemon.AttackLearns(evolvedPokemon.Level)))
|
||||
If AttackLearnList.Count > 0 Then
|
||||
Core.SetScreen(New LearnAttackScreen(Core.CurrentScreen, evolvedPokemon, AttackLearnList))
|
||||
AttackLearnList.Clear()
|
||||
Else
|
||||
Endscene()
|
||||
End If
|
||||
|
@ -346,10 +350,15 @@
|
|||
Dim HPpercentage As Integer = CInt((currentPokemon.HP / currentPokemon.MaxHP) * 100)
|
||||
Dim ID As String = currentPokemon.GetEvolutionID(Me.EvolutionTrigger, Me.EvolutionArg)
|
||||
If ID.Contains(CChar("_")) Then
|
||||
evolvedPokemon = Pokemon.GetPokemonByID(CInt(ID.Split(CChar("_"))(0)), ID.Split(CChar("_"))(1))
|
||||
evolvedPokemon = Pokemon.GetPokemonByID(CInt(ID.Split(CChar("_"))(0)), ID.Split(CChar("_"))(1), True)
|
||||
Else
|
||||
evolvedPokemon = Pokemon.GetPokemonByID(CInt(ID))
|
||||
evolvedPokemon = Pokemon.GetPokemonByID(CInt(ID), "", True)
|
||||
End If
|
||||
|
||||
If evolvedPokemon.AdditionalData = "" AndAlso currentPokemon.AdditionalData <> "" Then
|
||||
evolvedPokemon.AdditionalData = currentPokemon.AdditionalData
|
||||
End If
|
||||
|
||||
evolvedPokemon.Status = currentPokemon.Status
|
||||
|
||||
evolvedPokemon.EVHP = currentPokemon.EVHP
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Inherits Screen
|
||||
|
||||
Dim Pokemon As Pokemon
|
||||
Dim newAttack As BattleSystem.Attack
|
||||
Dim newAttacks As List(Of BattleSystem.Attack)
|
||||
Dim mainTexture As Texture2D
|
||||
|
||||
Dim chosen As Boolean = False
|
||||
|
@ -17,16 +17,22 @@
|
|||
|
||||
Dim currentCharIndex As Integer = 0
|
||||
|
||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttacks As List(Of BattleSystem.Attack))
|
||||
Me.New(currentScreen, Pokemon, newAttacks, "-1")
|
||||
End Sub
|
||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack)
|
||||
Me.New(currentScreen, Pokemon, newAttack, "-1")
|
||||
Me.New(currentScreen, Pokemon, New List(Of BattleSystem.Attack) From {newAttack}, "-1")
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack, ByVal MachineItemID As String)
|
||||
Me.New(currentScreen, Pokemon, New List(Of BattleSystem.Attack) From {newAttack}, MachineItemID)
|
||||
End Sub
|
||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttacks As List(Of BattleSystem.Attack), ByVal MachineItemID As String)
|
||||
Me.Identification = Identifications.LearnAttackScreen
|
||||
|
||||
Me.PreScreen = currentScreen
|
||||
Me.Pokemon = Pokemon
|
||||
Me.newAttack = newAttack
|
||||
Me.newAttacks = newAttacks
|
||||
Me.MachineItemID = MachineItemID
|
||||
|
||||
mainTexture = TextureManager.GetTexture("GUI\Menus\Menu")
|
||||
|
@ -118,7 +124,7 @@
|
|||
|
||||
Dim A As BattleSystem.Attack
|
||||
If AttackIndex = 4 Then
|
||||
A = newAttack
|
||||
A = newAttacks(0)
|
||||
Else
|
||||
A = Pokemon.Attacks(AttackIndex)
|
||||
End If
|
||||
|
@ -146,7 +152,7 @@
|
|||
For i = 0 To Me.Pokemon.Attacks.Count - 1
|
||||
DrawAttack(i, Me.Pokemon.Attacks(i))
|
||||
Next
|
||||
DrawAttack(4, newAttack)
|
||||
DrawAttack(4, newAttacks(0))
|
||||
End If
|
||||
|
||||
If chosen = True Then
|
||||
|
@ -156,9 +162,9 @@
|
|||
|
||||
Dim drawText As String = ""
|
||||
If AttackIndex = 4 Then
|
||||
drawText = "Give up on learning """ & newAttack.Name & """?"
|
||||
drawText = "Give up on learning """ & newAttacks(0).Name & """?"
|
||||
Else
|
||||
drawText = "Forget """ & Pokemon.Attacks(AttackIndex).Name & """ to learn """ & newAttack.Name & """?"
|
||||
drawText = "Forget """ & Pokemon.Attacks(AttackIndex).Name & """ to learn """ & newAttacks(0).Name & """?"
|
||||
If canForget = False Then
|
||||
drawText = "Cannot forget the move " & Pokemon.Attacks(AttackIndex).Name & " because" & Environment.NewLine & "it's a Hidden Machine move."
|
||||
End If
|
||||
|
@ -208,15 +214,15 @@
|
|||
End If
|
||||
If currentCharIndex > (Pokemon.GetDisplayName() & " ").Length + 1 Then
|
||||
If currentCharIndex < GetText().Length Then
|
||||
Core.SpriteBatch.DrawString(FontManager.MainFont, ("wants to learn """ & newAttack.Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttack.Name & """?").Remove(currentCharIndex - (Pokemon.GetDisplayName() & " ").Length), New Vector2(FontManager.MainFont.MeasureString(Pokemon.GetDisplayName()).X + 152, 20), Color.White)
|
||||
Core.SpriteBatch.DrawString(FontManager.MainFont, ("wants to learn """ & newAttacks(0).Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttacks(0).Name & """?").Remove(currentCharIndex - (Pokemon.GetDisplayName() & " ").Length), New Vector2(FontManager.MainFont.MeasureString(Pokemon.GetDisplayName()).X + 152, 20), Color.White)
|
||||
Else
|
||||
Core.SpriteBatch.DrawString(FontManager.MainFont, "wants to learn """ & newAttack.Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttack.Name & """?", New Vector2(FontManager.MainFont.MeasureString(Pokemon.GetDisplayName()).X + 152, 20), Color.White)
|
||||
Core.SpriteBatch.DrawString(FontManager.MainFont, "wants to learn """ & newAttacks(0).Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttacks(0).Name & """?", New Vector2(FontManager.MainFont.MeasureString(Pokemon.GetDisplayName()).X + 152, 20), Color.White)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function GetText() As String
|
||||
Return Pokemon.GetDisplayName() & " wants to learn """ & newAttack.Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttack.Name & """?"
|
||||
Return Pokemon.GetDisplayName() & " wants to learn """ & newAttacks(0).Name & """. But " & Pokemon.GetDisplayName() & " can only learn 4 attacks." & Environment.NewLine & "Do you want " & Pokemon.GetDisplayName() & " to forget an attack to learn """ & newAttacks(0).Name & """?"
|
||||
End Function
|
||||
|
||||
Private Sub DrawAttack(ByVal i As Integer, ByVal A As BattleSystem.Attack)
|
||||
|
@ -253,13 +259,13 @@
|
|||
|
||||
Private Sub ClickYes()
|
||||
If canForget = True Then
|
||||
Dim Text As String = Pokemon.GetDisplayName() & " didn't~learn " & newAttack.Name & "!"
|
||||
Dim Text As String = Pokemon.GetDisplayName() & " didn't~learn " & newAttacks(0).Name & "!"
|
||||
|
||||
If AttackIndex <> 4 Then
|
||||
TeachMovesScreen.LearnedMove = True
|
||||
Text = "1... 2... 3... and...*Ta-da!*" & Pokemon.GetDisplayName() & " forgot~" & Pokemon.Attacks(AttackIndex).Name & " and..."
|
||||
Pokemon.Attacks.RemoveAt(AttackIndex)
|
||||
Pokemon.Attacks.Insert(AttackIndex, newAttack)
|
||||
Pokemon.Attacks.Insert(AttackIndex, newAttacks(0))
|
||||
|
||||
If Me.MachineItemID <> "-1" Then
|
||||
PlayerStatistics.Track("TMs/HMs used", 1)
|
||||
|
@ -285,7 +291,12 @@
|
|||
|
||||
TextBox.Show(Text, {}, False, False)
|
||||
Core.GameInstance.IsMouseVisible = False
|
||||
Core.SetScreen(Me.PreScreen)
|
||||
If Me.newAttacks.Count > 1 Then
|
||||
Me.newAttacks.RemoveAt(0)
|
||||
Core.SetScreen(New LearnAttackScreen(Me.PreScreen, Me.Pokemon, Me.newAttacks))
|
||||
Else
|
||||
Core.SetScreen(Me.PreScreen)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
@ -295,7 +306,7 @@
|
|||
End Sub
|
||||
|
||||
Private Sub FollowUpText()
|
||||
TextBox.Show("... " & Pokemon.GetDisplayName() & " learned~" & newAttack.Name & "!")
|
||||
TextBox.Show("... " & Pokemon.GetDisplayName() & " learned~" & newAttacks(0).Name & "!")
|
||||
SoundManager.PlaySound("success_small", True)
|
||||
End Sub
|
||||
|
||||
|
|
|
@ -17,28 +17,31 @@
|
|||
Me.Identification = Identifications.TeachMovesScreen
|
||||
|
||||
For i = 0 To Pokemon.AttackLearns.Count - 1
|
||||
Dim tutorMove As BattleSystem.Attack = Pokemon.AttackLearns.Values(i)
|
||||
Dim learnLevel As Integer = Pokemon.AttackLearns.Keys(i)
|
||||
Dim aList As List(Of BattleSystem.Attack) = Pokemon.AttackLearns.Values(i)
|
||||
For a = 0 To aList.Count - 1
|
||||
Dim tutorMove As BattleSystem.Attack = aList(a)
|
||||
Dim learnLevel As Integer = Pokemon.AttackLearns.Keys(i)
|
||||
|
||||
If learnLevel <= Pokemon.Level Then
|
||||
Dim canLearnMove As Boolean = True
|
||||
If learnLevel <= Pokemon.Level Then
|
||||
Dim canLearnMove As Boolean = True
|
||||
|
||||
For Each learnedAttack As BattleSystem.Attack In Pokemon.Attacks
|
||||
If learnedAttack.ID = tutorMove.ID Then
|
||||
canLearnMove = False
|
||||
For Each learnedAttack As BattleSystem.Attack In Pokemon.Attacks
|
||||
If learnedAttack.ID = tutorMove.ID Then
|
||||
canLearnMove = False
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each move As BattleSystem.Attack In MovesList
|
||||
If move.ID = tutorMove.ID Then
|
||||
canLearnMove = False
|
||||
End If
|
||||
Next
|
||||
|
||||
If canLearnMove = True Then
|
||||
MovesList.Add(tutorMove)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each move As BattleSystem.Attack In MovesList
|
||||
If move.ID = tutorMove.ID Then
|
||||
canLearnMove = False
|
||||
End If
|
||||
Next
|
||||
|
||||
If canLearnMove = True Then
|
||||
MovesList.Add(tutorMove)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Me.MouseVisible = False
|
||||
|
@ -64,10 +67,14 @@
|
|||
End If
|
||||
Next
|
||||
For i = 0 To Pokemon.AttackLearns.Count - 1
|
||||
Dim learnAttack As BattleSystem.Attack = Pokemon.AttackLearns.Values(i)
|
||||
If learnAttack.ID = a.ID Then
|
||||
canLearnMove = True
|
||||
End If
|
||||
Dim aList As List(Of BattleSystem.Attack) = Pokemon.AttackLearns.Values(i)
|
||||
For lA = 0 To aList.Count - 1
|
||||
Dim learnAttack As BattleSystem.Attack = aList(lA)
|
||||
If learnAttack.ID = a.ID Then
|
||||
canLearnMove = True
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
For Each eggMoveID As Integer In Pokemon.EggMoves
|
||||
If eggMoveID = a.ID Then
|
||||
|
|
|
@ -742,11 +742,18 @@
|
|||
End If
|
||||
|
||||
p.Level += amount
|
||||
For i = 0 To amount - 1
|
||||
If p.AttackLearns.ContainsKey(originalLevel + i) = True AndAlso p.KnowsMove(p.AttackLearns(originalLevel + i)) = False Then
|
||||
AttackLearnList.Add(p.AttackLearns(originalLevel + i))
|
||||
End If
|
||||
Next
|
||||
If amount > 0 Then
|
||||
For i = 1 To amount
|
||||
If p.AttackLearns.ContainsKey(originalLevel + i) = True Then
|
||||
Dim aList As List(Of BattleSystem.Attack) = p.AttackLearns(originalLevel + i)
|
||||
For a = 0 To aList.Count - 1
|
||||
If AttackLearnList.Contains(aList(a)) = False AndAlso p.KnowsMove(aList(a)) = False Then
|
||||
AttackLearnList.Add(aList(a))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Dim s As String = "version=2" & Environment.NewLine
|
||||
|
||||
If amount > 0 Then
|
||||
|
|
Loading…
Reference in New Issue