mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-24 22:35:47 +02:00
Mega Evolutions implementation
This commit is contained in:
parent
7a2c21ab1a
commit
d9d690e935
@ -1711,6 +1711,7 @@
|
||||
<None Include="Content\**\*.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Pokemon\Data\181_mega.dat" />
|
||||
<None Include="maps\**\*.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -402,6 +402,49 @@
|
||||
Public SelectedMoveOwn As Boolean = True
|
||||
Public SelectedMoveOpp As Boolean = True
|
||||
|
||||
'Does the MegaEvolution
|
||||
Sub DoMegaEvolution(ByVal BattleScreen As BattleScreen, ByVal own As Boolean)
|
||||
|
||||
Dim p As Pokemon = BattleScreen.OwnPokemon
|
||||
If own = False Then
|
||||
p = BattleScreen.OppPokemon
|
||||
End If
|
||||
'Transform a Pokemon into it's Mega Evolution
|
||||
If p.AdditionalData = "" Then
|
||||
p.AdditionalData = "mega"
|
||||
p.ReloadDefinitions()
|
||||
p.CalculateStatsBarSpeed()
|
||||
p.LoadMegaAbility()
|
||||
Me.ChangeCameraAngel(1, own, BattleScreen)
|
||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " has Mega Evolved!"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Checks if any pokemon is mega evolving, order based on speed
|
||||
Sub MegaEvolCheck(ByVal BattleScreen As BattleScreen)
|
||||
If BattleCalculation.MovesFirst(BattleScreen) = True Then
|
||||
If BattleScreen.IsMegaEvolvingOwn = True Then
|
||||
DoMegaEvolution(BattleScreen, True)
|
||||
End If
|
||||
If BattleScreen.IsMegaEvolvingOpp = True Then
|
||||
DoMegaEvolution(BattleScreen, False)
|
||||
End If
|
||||
Else
|
||||
If BattleScreen.IsMegaEvolvingOpp = True Then
|
||||
DoMegaEvolution(BattleScreen, False)
|
||||
End If
|
||||
If BattleScreen.IsMegaEvolvingOwn = True Then
|
||||
DoMegaEvolution(BattleScreen, True)
|
||||
End If
|
||||
|
||||
End If
|
||||
BattleScreen.IsMegaEvolvingOwn = False
|
||||
BattleScreen.IsMegaEvolvingOpp = False
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Sub InitializeRound(ByVal BattleScreen As BattleScreen, ByVal OwnStep As RoundConst)
|
||||
If BattleHasEnded(BattleScreen) = True Then
|
||||
Exit Sub
|
||||
@ -410,9 +453,13 @@
|
||||
Dim OppStep As RoundConst = GetOppStep(BattleScreen, OwnStep)
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Move Then
|
||||
OwnStep = GetAttack(BattleScreen, True, CType(OwnStep.Argument, Attack))
|
||||
Else
|
||||
BattleScreen.IsMegaEvolvingOwn = False
|
||||
End If
|
||||
If OppStep.StepType = RoundConst.StepTypes.Move Then
|
||||
OppStep = GetAttack(BattleScreen, False, CType(OppStep.Argument, Attack))
|
||||
Else
|
||||
BattleScreen.IsMegaEvolvingOpp = False
|
||||
End If
|
||||
|
||||
'Move,Move
|
||||
@ -426,7 +473,10 @@
|
||||
If SelectedMoveOwn = True Then ownMove.MoveSelected(True, BattleScreen)
|
||||
If SelectedMoveOpp = True Then oppMove.MoveSelected(False, BattleScreen)
|
||||
|
||||
MegaEvolCheck(BattleScreen)
|
||||
Dim first As Boolean = BattleCalculation.AttackFirst(ownMove, oppMove, BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
If first = True Then
|
||||
DoAttackRound(BattleScreen, first, ownMove)
|
||||
@ -443,6 +493,10 @@
|
||||
|
||||
'Move,Text
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Move And OppStep.StepType = RoundConst.StepTypes.Text Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
ChangeCameraAngel(0, True, BattleScreen)
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(CStr(OppStep.Argument)))
|
||||
EndRound(BattleScreen, 2)
|
||||
@ -458,6 +512,10 @@
|
||||
|
||||
'Move,Item
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Move And OppStep.StepType = RoundConst.StepTypes.Item Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
OpponentUseItem(BattleScreen, CInt(CStr(OppStep.Argument).Split(CChar(","))(0)), CInt(CStr(OppStep.Argument).Split(CChar(","))(1)))
|
||||
EndRound(BattleScreen, 2)
|
||||
|
||||
@ -470,6 +528,10 @@
|
||||
|
||||
'Move,Switch
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Move And OppStep.StepType = RoundConst.StepTypes.Switch Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
If CType(OwnStep.Argument, Attack).ID = 228 Then 'Pursuit is used by own pokemon and opponent tries to switch.
|
||||
BattleScreen.FieldEffects.OwnPursuit = True
|
||||
BattleScreen.FieldEffects.OwnUsedMoves.Add(CType(OwnStep.Argument, Attack).ID)
|
||||
@ -494,6 +556,10 @@
|
||||
|
||||
'Move,Flee
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Move And OppStep.StepType = RoundConst.StepTypes.Flee Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
BattleScreen.FieldEffects.OwnUsedMoves.Add(CType(OwnStep.Argument, Attack).ID)
|
||||
Dim ownMove As Attack = CType(OwnStep.Argument, Attack)
|
||||
|
||||
@ -521,6 +587,10 @@
|
||||
|
||||
'Text,Move
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Text And OppStep.StepType = RoundConst.StepTypes.Move Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
ChangeCameraAngel(0, True, BattleScreen)
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(CStr(OwnStep.Argument)))
|
||||
EndRound(BattleScreen, 1)
|
||||
@ -587,6 +657,10 @@
|
||||
|
||||
'Switch,Move
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Switch And OppStep.StepType = RoundConst.StepTypes.Move Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
If BattleCalculation.CanSwitch(BattleScreen, True) = True Then
|
||||
If CType(OppStep.Argument, Attack).ID = 228 Then 'Opp uses pursuit while own tries to switch.
|
||||
BattleScreen.FieldEffects.OppPursuit = True
|
||||
@ -711,6 +785,10 @@
|
||||
|
||||
'Item,Move
|
||||
If OwnStep.StepType = RoundConst.StepTypes.Item And OppStep.StepType = RoundConst.StepTypes.Move Then
|
||||
MegaEvolCheck(BattleScreen)
|
||||
BattleScreen.OppPokemon.CalculateStats()
|
||||
BattleScreen.OwnPokemon.CalculateStats()
|
||||
|
||||
EndRound(BattleScreen, 1)
|
||||
|
||||
Dim oppMove As Attack = CType(OppStep.Argument, Attack)
|
||||
@ -3755,6 +3833,7 @@ endthisround:
|
||||
With BattleScreen
|
||||
Select Case type
|
||||
Case 0 'Complete round
|
||||
.BattleMenu._mainMenuItemList.Clear()
|
||||
'The fastest pokemon ends its round first
|
||||
If BattleCalculation.MovesFirst(BattleScreen) = True Then
|
||||
EndRoundOwn(BattleScreen)
|
||||
@ -6227,6 +6306,21 @@ endthisround:
|
||||
End Enum
|
||||
|
||||
Public Sub EndBattle(ByVal reason As EndBattleReasons, ByVal BattleScreen As BattleScreen, ByVal AddPVP As Boolean)
|
||||
|
||||
'Reverts battle only Pokemon formes.
|
||||
Dim str As String = ""
|
||||
Dim p As Pokemon = Core.Player.Pokemons(0)
|
||||
For i = 0 To Core.Player.Pokemons.Count - 1
|
||||
p = Core.Player.Pokemons(i)
|
||||
str = p.AdditionalData.ToLower()
|
||||
If str = "mega" OrElse str = "blade" Then
|
||||
p.AdditionalData = PokemonForms.GetInitialAdditionalData(p)
|
||||
p.ReloadDefinitions()
|
||||
p.CalculateStats()
|
||||
p.RestoreAbility()
|
||||
End If
|
||||
Next
|
||||
|
||||
If AddPVP = True Then
|
||||
Select Case reason
|
||||
Case EndBattleReasons.WinTrainer 'Lost
|
||||
|
@ -297,7 +297,7 @@
|
||||
|
||||
Private _mainMenuIndex As Integer = 0
|
||||
Private _mainMenuNextIndex As Integer = 0
|
||||
Private _mainMenuItemList As New List(Of MainMenuItem)
|
||||
Public _mainMenuItemList As New List(Of MainMenuItem)
|
||||
Private _mainMenuTeamPreviewAlpha As Integer = 0
|
||||
Private _mainMenuTeamPreviewLastIndex As Integer = -1
|
||||
|
||||
@ -612,13 +612,14 @@
|
||||
End Sub
|
||||
|
||||
Private Sub MainMenuAddMegaEvolution(ByVal BattleScreen As BattleScreen, ByVal Index As Integer)
|
||||
Dim PokeIndex As Integer = BattleScreen.OwnPokemonIndex
|
||||
If BattleScreen.FieldEffects.OwnMegaEvolved = False Then
|
||||
If Not Core.Player.Pokemons(0).Item Is Nothing Then
|
||||
If Core.Player.Pokemons(0).Item.IsMegaStone = True Then
|
||||
Dim megaStone = CType(Core.Player.Pokemons(0).Item, Items.MegaStone)
|
||||
If Not Core.Player.Pokemons(PokeIndex).Item Is Nothing Then
|
||||
If Core.Player.Pokemons(PokeIndex).Item.IsMegaStone = True Then
|
||||
Dim megaStone = CType(Core.Player.Pokemons(PokeIndex).Item, Items.MegaStone)
|
||||
|
||||
If megaStone.MegaPokemonNumber = Core.Player.Pokemons(0).Number Then
|
||||
'm_MainMenuItemList.Add(New MainMenuItem(0, "Mega Evolve!", Index, Nothing))
|
||||
If megaStone.MegaPokemonNumber = Core.Player.Pokemons(PokeIndex).Number Then
|
||||
_mainMenuItemList.Add(New MainMenuItem(0, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@ -722,6 +723,14 @@
|
||||
BattleScreen.Battle.InitializeRound(BattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Text, .Argument = "Threw a Bait at " & BattleScreen.OppPokemon.GetDisplayName() & "!"})
|
||||
End Sub
|
||||
|
||||
Private Sub MainMenuMegaEvolve(ByVal BattleScreen As BattleScreen)
|
||||
BattleScreen.IsMegaEvolvingOwn = True
|
||||
For i = 0 To Core.Player.Pokemons.Count - 1
|
||||
If Core.Player.Pokemons(i).AdditionalData = "mega" Then
|
||||
BattleScreen.IsMegaEvolvingOwn = False
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "MoveMenu"
|
||||
|
@ -37,6 +37,9 @@
|
||||
Public OwnPokemon As Pokemon
|
||||
Public OppPokemon As Pokemon
|
||||
|
||||
Public IsMegaEvolvingOwn As Boolean = False
|
||||
Public IsMegaEvolvingOpp As Boolean = False
|
||||
|
||||
Public OppPokemonNPC As NPC
|
||||
Public OwnPokemonNPC As NPC
|
||||
Public OwnTrainerNPC As NPC
|
||||
|
62
2.5DHero/2.5DHero/Content/Pokemon/Data/181_mega.dat
Normal file
62
2.5DHero/2.5DHero/Content/Pokemon/Data/181_mega.dat
Normal file
@ -0,0 +1,62 @@
|
||||
Name|Mega Ampharos
|
||||
Number|181
|
||||
ExperienceType|2
|
||||
BaseExperience|225
|
||||
Type1|Electric
|
||||
Type2|Dragon
|
||||
CatchRate|45
|
||||
BaseFriendship|70
|
||||
EggGroup1|Monster
|
||||
EggGroup2|Field
|
||||
BaseEggSteps|5355
|
||||
EggPokemon|179
|
||||
IsGenderLess|0
|
||||
CanBreed|1
|
||||
Devolution|180
|
||||
IsMale|50
|
||||
Ability1|104
|
||||
Ability2|Nothing
|
||||
HiddenAbility|104
|
||||
EggMoves|495,97,34,268,598,604,260,231,316,28,103,36,115,219,85
|
||||
Machines|223,29,174,92,192,249,237,173,63,182,240,203,218,231,87,216,104,207,214,129,111,9,197,156,213,7,5,25,34,36,6,66,68,69,99,85,102,117,130,86,149,164,264,113,219,280,351,263,290,411,374,451,416,445,363,496,497,521,523,528,612,590,70,148,431
|
||||
BaseHP|90
|
||||
BaseAttack|95
|
||||
BaseDefense|105
|
||||
BaseSpAttack|165
|
||||
BaseSpDefense|110
|
||||
BaseSpeed|45
|
||||
FPHP|0
|
||||
FPAttack|0
|
||||
FPDefense|0
|
||||
FPSpAttack|3
|
||||
FPSpDefense|0
|
||||
FPSpeed|0
|
||||
CanFly|0
|
||||
CanSwim|0
|
||||
Pokedex|The tail's tip shines brightly and can be seen from far away. It acts as a beacon for lost people.\Light Pokémon\61.5\1.4\0,148,0
|
||||
Scale|1.16
|
||||
Move|1,192
|
||||
Move|1,602
|
||||
Move|1,569
|
||||
Move|1,406
|
||||
Move|1,7
|
||||
Move|1,33
|
||||
Move|1,45
|
||||
Move|1,86
|
||||
Move|1,84
|
||||
Move|4,86
|
||||
Move|8,84
|
||||
Move|11,178
|
||||
Move|16,268
|
||||
Move|20,36
|
||||
Move|25,486
|
||||
Move|29,109
|
||||
Move|30,9
|
||||
Move|35,408
|
||||
Move|40,435
|
||||
Move|46,538
|
||||
Move|51,324
|
||||
Move|57,113
|
||||
Move|62,87
|
||||
Move|65,406
|
||||
TradeValue|35
|
@ -75,7 +75,7 @@
|
||||
Return i
|
||||
Else
|
||||
Dim i As Integer = 0
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex Or BattleScreen.Trainer.Pokemons(i).IsEgg() = True
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OppPokemonIndex Or BattleScreen.Trainer.Pokemons(i).IsEgg() = True
|
||||
i += 1
|
||||
End While
|
||||
Return i
|
||||
|
@ -86,7 +86,9 @@
|
||||
If own = False Then
|
||||
p = BattleScreen.OppPokemon
|
||||
End If
|
||||
|
||||
If p.Item.IsMegaStone = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
If Not p.Item Is Nothing Then
|
||||
'Clear prior effect chances to add the chance depending on the item.
|
||||
Me.EffectChances.Clear()
|
||||
|
@ -67,7 +67,9 @@
|
||||
p = BattleScreen.OppPokemon
|
||||
op = BattleScreen.OwnPokemon
|
||||
End If
|
||||
|
||||
If op.Item.IsMegaStone = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "", "", True) = True Then
|
||||
op.OriginalItem = Item.GetItemByID(op.Item.ID)
|
||||
op.OriginalItem.AdditionalData = op.Item.AdditionalData
|
||||
|
@ -83,13 +83,15 @@ Namespace BattleSystem.Moves.Dark
|
||||
Else
|
||||
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||
Else
|
||||
Dim i1 As Item = p.Item
|
||||
Dim i2 As Item = op.Item
|
||||
|
||||
p.Item = i2
|
||||
op.Item = i1
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
|
||||
If p.Item.IsMegaStone OrElse op.Item.IsMegaStone Then
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||
Else
|
||||
Dim i1 As Item = p.Item
|
||||
Dim i2 As Item = op.Item
|
||||
p.Item = i2
|
||||
op.Item = i1
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
@ -59,7 +59,9 @@
|
||||
p = BattleScreen.OppPokemon
|
||||
op = BattleScreen.OwnPokemon
|
||||
End If
|
||||
|
||||
If op.Item.IsMegaStone = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim canSteal As Boolean = True
|
||||
If op.Ability.Name.ToLower() = "multitype" Then
|
||||
canSteal = False
|
||||
|
@ -89,7 +89,7 @@
|
||||
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "")
|
||||
Else
|
||||
@ -99,7 +99,7 @@
|
||||
If Core.Player.CountFightablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
While Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OwnPokemonIndex = i OrElse Core.Player.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOwn(BattleScreen, i, -1)
|
||||
Else
|
||||
|
@ -75,7 +75,7 @@ Namespace BattleSystem.Moves.Electric
|
||||
Return i
|
||||
Else
|
||||
Dim i As Integer = 0
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex Or BattleScreen.Trainer.Pokemons(i).IsEgg() = True
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OppPokemonIndex Or BattleScreen.Trainer.Pokemons(i).IsEgg() = True
|
||||
i += 1
|
||||
End While
|
||||
Return i
|
||||
|
@ -89,7 +89,7 @@ Namespace BattleSystem.Moves.Fighting
|
||||
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "")
|
||||
Else
|
||||
@ -99,7 +99,7 @@ Namespace BattleSystem.Moves.Fighting
|
||||
If Core.Player.CountFightablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
While Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OwnPokemonIndex = i OrElse Core.Player.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOwn(BattleScreen, i, -1)
|
||||
Else
|
||||
|
@ -82,13 +82,13 @@
|
||||
Private Function GetPokemonIndex(ByVal BattleScreen As BattleScreen, ByVal own As Boolean) As Integer
|
||||
If own = True Then
|
||||
Dim i As Integer = 0
|
||||
While Core.Player.Pokemons(i).HP <= 0 Or Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex
|
||||
While Core.Player.Pokemons(i).HP <= 0 Or Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex Or Core.Player.Pokemons(i).IsEgg()
|
||||
i += 1
|
||||
End While
|
||||
Return i
|
||||
Else
|
||||
Dim i As Integer = 0
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex
|
||||
While BattleScreen.Trainer.Pokemons(i).HP <= 0 Or BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted Or i = BattleScreen.OwnPokemonIndex Or BattleScreen.Trainer.Pokemons(i).IsEgg()
|
||||
i += 1
|
||||
End While
|
||||
Return i
|
||||
|
@ -62,7 +62,9 @@ Namespace BattleSystem.Moves.Normal
|
||||
p = BattleScreen.OppPokemon
|
||||
op = BattleScreen.OwnPokemon
|
||||
End If
|
||||
|
||||
If op.Item.IsMegaStone = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim canSteal As Boolean = True
|
||||
If op.Ability.Name.ToLower() = "multitype" Then
|
||||
canSteal = False
|
||||
|
@ -74,7 +74,7 @@
|
||||
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "")
|
||||
Else
|
||||
@ -84,7 +84,7 @@
|
||||
If Core.Player.CountFightablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
While Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OwnPokemonIndex = i OrElse Core.Player.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOwn(BattleScreen, i, -1)
|
||||
Else
|
||||
|
@ -75,7 +75,7 @@
|
||||
If BattleScreen.Trainer.CountUseablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
|
||||
i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "")
|
||||
Else
|
||||
@ -85,7 +85,7 @@
|
||||
If Core.Player.CountFightablePokemon > 1 Then
|
||||
Dim i As Integer = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
While Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OwnPokemonIndex = i OrElse Core.Player.Pokemons(i).HP <= 0
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count)
|
||||
i = Core.Random.Next(0, Core.Player.Pokemons.Count - 1)
|
||||
End While
|
||||
BattleScreen.Battle.SwitchOutOwn(BattleScreen, i, -1)
|
||||
Else
|
||||
|
@ -84,12 +84,15 @@ Namespace BattleSystem.Moves.Psychic
|
||||
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||
Else
|
||||
Dim i1 As Item = p.Item
|
||||
Dim i2 As Item = op.Item
|
||||
|
||||
p.Item = i2
|
||||
op.Item = i1
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
|
||||
If p.Item.IsMegaStone OrElse op.Item.IsMegaStone Then
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
|
||||
Else
|
||||
Dim i1 As Item = p.Item
|
||||
Dim i2 As Item = op.Item
|
||||
p.Item = i2
|
||||
op.Item = i1
|
||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
@ -15,11 +15,11 @@ Namespace Items
|
||||
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
|
||||
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
|
||||
|
||||
Public Sub New(ByVal MegaPokemonName As String, ByVal MegaPokemonNumber As Integer)
|
||||
Public Sub New(ByVal MegaPokemonName As String, ByVal _megaPokemonNumber As Integer)
|
||||
Description = "One variety of the mysterious Mega Stones. Have " & MegaPokemonName & " hold it, and this stone will enable it to Mega Evolve during battle."
|
||||
_textureSource = "Items\MegaStones"
|
||||
|
||||
MegaPokemonNumber = MegaPokemonNumber
|
||||
MegaPokemonNumber = _megaPokemonNumber
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
@ -136,6 +136,8 @@ Public Class Pokemon
|
||||
''' <summary>
|
||||
''' Returns the name to reference to the animation/model of this Pokémon.
|
||||
''' </summary>
|
||||
Public AbilityTag As New List(Of Integer)
|
||||
|
||||
Public ReadOnly Property AnimationName() As String
|
||||
Get
|
||||
Return PokemonForms.GetAnimationName(Me)
|
||||
@ -1026,6 +1028,16 @@ Public Class Pokemon
|
||||
Me.CalculateStats()
|
||||
End Sub
|
||||
|
||||
'Just use these subs when doing/reverting mega evolutions.
|
||||
Public NormalAbility As Ability = New Abilities.Stench
|
||||
Public Sub LoadMegaAbility()
|
||||
NormalAbility = Ability
|
||||
Me.Ability = NewAbilities(0)
|
||||
End Sub
|
||||
Public Sub RestoreAbility()
|
||||
Me.Ability = NormalAbility
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "OriginalStats"
|
||||
@ -1268,6 +1280,7 @@ Public Class Pokemon
|
||||
Public Sub LoadDefinitions(ByVal Number As Integer, ByVal AdditionalData As String)
|
||||
Dim path As String = PokemonForms.GetPokemonDataFile(Number, AdditionalData)
|
||||
Security.FileValidation.CheckFileValid(path, False, "Pokemon.vb")
|
||||
NewAbilities.Clear()
|
||||
|
||||
Dim Data() As String = System.IO.File.ReadAllLines(path)
|
||||
|
||||
@ -1316,7 +1329,11 @@ Public Class Pokemon
|
||||
Me.IsGenderless = CBool(Value)
|
||||
Case "devolution"
|
||||
Me.Devolution = CInt(Value)
|
||||
Case "ability1", "ability2", "ability"
|
||||
Case "ability1", "ability"
|
||||
If Value <> "Nothing" Then
|
||||
Me.NewAbilities.Add(Ability.GetAbilityByID(CInt(Value)))
|
||||
End If
|
||||
Case "ability2"
|
||||
If Value <> "Nothing" Then
|
||||
Me.NewAbilities.Add(Ability.GetAbilityByID(CInt(Value)))
|
||||
End If
|
||||
@ -1538,6 +1555,7 @@ Public Class Pokemon
|
||||
Me.OT = tagValue
|
||||
Case "ability"
|
||||
Me.Ability = net.Pokemon3D.Game.Ability.GetAbilityByID(CInt(tagValue))
|
||||
Me.NormalAbility = Ability
|
||||
Case "status"
|
||||
Select Case tagValue
|
||||
Case "BRN"
|
||||
@ -2112,12 +2130,17 @@ Public Class Pokemon
|
||||
''' <summary>
|
||||
''' Recalculates all stats for this Pokémon using its current EVs, IVs and level.
|
||||
''' </summary>
|
||||
Public Sub CalculateStats()
|
||||
'''
|
||||
Public Sub CalculateStatsBarSpeed()
|
||||
Me.MaxHP = CalcStatus(Me.Level, True, Me.BaseHP, Me.EVHP, Me.IVHP, "HP")
|
||||
Me.Attack = CalcStatus(Me.Level, False, Me.BaseAttack, Me.EVAttack, Me.IVAttack, "Attack")
|
||||
Me.Defense = CalcStatus(Me.Level, False, Me.BaseDefense, Me.EVDefense, Me.IVDefense, "Defense")
|
||||
Me.SpAttack = CalcStatus(Me.Level, False, Me.BaseSpAttack, Me.EVSpAttack, Me.IVSpAttack, "SpAttack")
|
||||
Me.SpDefense = CalcStatus(Me.Level, False, Me.BaseSpDefense, Me.EVSpDefense, Me.IVSpDefense, "SpDefense")
|
||||
End Sub
|
||||
|
||||
Public Sub CalculateStats()
|
||||
CalculateStatsBarSpeed()
|
||||
Me.Speed = CalcStatus(Me.Level, False, Me.BaseSpeed, Me.EVSpeed, Me.IVSpeed, "Speed")
|
||||
End Sub
|
||||
|
||||
@ -2743,5 +2766,4 @@ Public Class Pokemon
|
||||
Public Overrides Function ToString() As String
|
||||
Return GetSaveData()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
@ -9,7 +9,9 @@ Public Class PokemonForms
|
||||
New Deoxys(),
|
||||
New Burmy(), New Shellos(), New Gastrodon(), New Rotom(), New Dialga(), New Arceus(),
|
||||
New Basculin(), New Deerling(), New Sawsbuck(), New Frillish(), New Jellicent(), New Tornadus(), New Thundurus(), New Landorus(), New Kyurem(),
|
||||
New Aegislash()})
|
||||
New Aegislash(),
|
||||
New Ampharos()})
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@ -237,6 +239,30 @@ Public Class PokemonForms
|
||||
|
||||
End Class
|
||||
|
||||
'Placeholder for Mega Ampharos
|
||||
Private Class Ampharos
|
||||
Inherits PokemonForm
|
||||
Public Sub New()
|
||||
MyBase.New(181)
|
||||
End Sub
|
||||
Public Overrides Function GetMenuImagePosition(ByVal P As Pokemon) As Vector2
|
||||
Select Case P.AdditionalData
|
||||
Case "mega"
|
||||
Return New Vector2(9, 29)
|
||||
Case Else
|
||||
Return New Vector2(20, 5)
|
||||
End Select
|
||||
End Function
|
||||
Public Overrides Function GetDataFileAddition(ByVal AdditionalData As String) As String
|
||||
Select Case AdditionalData.ToLower()
|
||||
Case "mega"
|
||||
Return "_mega"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Private Class Unown
|
||||
|
||||
Inherits PokemonForm
|
||||
@ -281,15 +307,30 @@ Public Class PokemonForms
|
||||
Public Sub New()
|
||||
MyBase.New(208)
|
||||
End Sub
|
||||
|
||||
Public Overrides Function GetMenuImagePosition(ByVal P As Pokemon) As Vector2
|
||||
Return New Vector2(11, 26)
|
||||
Select Case P.AdditionalData
|
||||
Case "mega"
|
||||
Return New Vector2(29, 28)
|
||||
Case Else
|
||||
Return New Vector2(11, 26)
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Overrides Function GetMenuImageSize(ByVal P As Pokemon) As Size
|
||||
Return New Size(35, 32)
|
||||
Select Case P.AdditionalData
|
||||
Case "mega"
|
||||
Return New Size(39, 32)
|
||||
Case Else
|
||||
Return New Size(35, 32)
|
||||
End Select
|
||||
End Function
|
||||
Public Overrides Function GetDataFileAddition(ByVal AdditionalData As String) As String
|
||||
Select Case AdditionalData.ToLower()
|
||||
Case "mega"
|
||||
Return "_mega"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Private Class Deoxys
|
||||
|
Loading…
x
Reference in New Issue
Block a user