Compare commits

..

No commits in common. "master" and "0.60" have entirely different histories.
master ... 0.60

1201 changed files with 4639 additions and 21882 deletions

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="monogame-dev" value="http://teamcity.monogame.net/guestAuth/app/nuget/v1/FeedService.svc/" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
</configuration>

View File

@ -2,20 +2,23 @@
Inherits BattleAnimation3D
Dim FadeInSpeed As Single = 0.01F
Dim FadeOutSpeed As Single = 0.01F
Dim BackgroundOpacity As Single = 0.0F
Dim Texture As Texture2D
Dim DoTile As Boolean = False
Dim AnimationWidth As Integer = -1
Dim AfterFadeInOpacity As Single = 1.0F
Dim FadeProgress As FadeSteps = FadeSteps.FadeIn
Dim DurationDate As Date
Dim DurationWhole As Single
Dim DurationFraction As Single
Dim BackgroundAnimation As Animation
Dim CurrentRectangle As New Rectangle(0, 0, 0, 0)
Dim TextureScale As Integer = 4
Public Duration As Single = 2.0F
Public FadeInSpeed As Single = 0.01F
Public FadeOutSpeed As Single = 0.01F
Public BackgroundOpacity As Single = 0.0F
Public Texture As Texture2D
Public DoTile As Boolean = False
Public AnimationWidth As Integer = -1
Public AnimationLength As Integer = 1
Public AnimationSpeed As Integer = 16
Public AfterFadeInOpacity As Single = 1.0F
Public FadeProgress As FadeSteps = FadeSteps.FadeIn
Private DurationDate As Date
Private DurationWhole As Single
Private DurationFraction As Single
Private BackgroundAnimation As Animation
Private CurrentRectangle As New Rectangle(0, 0, 0, 0)
Private TextureScale As Integer = 4
Public Enum FadeSteps As Integer
FadeIn
@ -26,11 +29,13 @@
Public Sub New(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 2, Optional TextureScale As Integer = 4)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.Texture = Texture
Me.Duration = Duration
Me.AfterFadeInOpacity = AfterFadeInOpacity
Me.FadeInSpeed = FadeInSpeed
Me.FadeOutSpeed = FadeOutSpeed
Me.DoTile = DoTile
Me.AnimationWidth = CInt(Texture.Width / AnimationLength)
Me.AnimationLength = AnimationLength
DurationWhole = CSng(Math.Truncate(CDbl(Duration / 6.0F)))
DurationFraction = CSng((Duration / 6.0F - DurationWhole) * 1000)
Me.TextureScale = TextureScale

View File

@ -4,8 +4,8 @@ Public Class BACameraChangeAngle
Inherits BattleAnimation3D
Dim CameraAngleID As Integer
Dim BV2Screen As BattleSystem.BattleScreen
Public CameraAngleID As Integer
Public BV2Screen As BattleSystem.BattleScreen
Public Sub New(ByRef Battlescreen As BattleSystem.BattleScreen, ByVal CameraAngleID As Integer, ByVal startDelay As Single, ByVal endDelay As Single)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)

View File

@ -2,19 +2,20 @@
Inherits BattleAnimation3D
Dim StartPosition As Vector3
Dim ReturnToStart As Vector3
Dim HalfDistance As New Vector3(0.0F)
Dim DestinationDistance As New Vector3(0.0F)
Dim CurrentDistance As New Vector3(0.0F)
Dim MoveSpeed As Single
Dim MoveBothWays As Boolean = True
Dim MovementCurve As Integer = 0
Dim Duration As TimeSpan
Dim ReadyTime As Date
Dim ReadyAxis As New Vector3(0)
Dim InterpolationSpeed As Vector3
Dim InterpolationDirection As Boolean = True
Public StartPosition As Vector3
Public ReturnToStart As Vector3
Public HalfDistance As New Vector3(0.0F)
Public DestinationDistance As New Vector3(0.0F)
Public CurrentDistance As New Vector3(0.0F)
Public MoveSpeed As Single
Public MoveBothWays As Boolean = True
Public MovementCurve As Integer = 0
Public RemoveEntityAfter As Boolean
Public Duration As TimeSpan
Public ReadyTime As Date
Public ReadyAxis As New Vector3(0)
Public InterpolationSpeed As Vector3
Public InterpolationDirection As Boolean = True
Public Enum Curves As Integer
Linear
Smooth

View File

@ -2,17 +2,18 @@
Inherits BattleAnimation3D
Dim TargetEntity As Entity
Dim TransitionSpeed As Single = 0.01F
Dim TransitionSpeedOut As Single = 0.01F
Dim ReturnToFromWhenDone As Boolean = False
Dim RemoveEntityAfter As Boolean = False
Dim InitialColorSet As Boolean = False
Dim IsReturning As Boolean = False
Dim ColorTo As Vector3 = New Vector3(1.0F, 1.0F, 1.0F)
Dim ColorFrom As Vector3 = New Vector3(1.0F, 1.0F, 1.0F)
Public TargetEntity As Entity
Public TransitionSpeed As Single = 0.01F
Public TransitionSpeedOut As Single = 0.01F
Public FadeIn As Boolean = False
Public ReturnToFromWhenDone As Boolean = False
Public RemoveEntityAfter As Boolean = False
Public InitialColorSet As Boolean = False
Public IsReturning As Boolean = False
Public ColorTo As Vector3 = New Vector3(1.0F, 1.0F, 1.0F)
Public ColorFrom As Vector3 = New Vector3(1.0F, 1.0F, 1.0F)
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeedIn As Single, ByVal ReturnToFromWhenDone As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, ByVal ColorTo As Vector3, Optional ByVal ColorFrom As Vector3 = Nothing, Optional TransitionSpeedOut As Single = -1)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeedIn As Single, ByVal ReturnToFromWhenDone As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, ByVal ColorTo As Vector3, Optional ByVal ColorFrom As Vector3 = Nothing, Optional TransitionSpeedOut As Single = -1)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.RemoveEntityAfter = RemoveEntityAfter
If TransitionSpeedOut = -1 Then

View File

@ -9,7 +9,7 @@
Dim TurnTime As Single = 0.0F
Dim TurnDelay As Single = 0.0F
Public Sub New(ByRef TargetEntity As NPC, ByVal TurnSteps As Integer, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal EndFaceRotation As Integer = -1, Optional ByVal TurnSpeed As Integer = 1, Optional ByVal TurnDelay As Single = 0.25F)
Public Sub New(ByVal TargetEntity As NPC, ByVal TurnSteps As Integer, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal EndFaceRotation As Integer = -1, Optional ByVal TurnSpeed As Integer = 1, Optional ByVal TurnDelay As Single = 0.25F)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
If EndFaceRotation = -1 Then
Me.EndFaceRotation = TargetEntity.faceRotation

View File

@ -2,21 +2,21 @@
Inherits BattleAnimation3D
Dim StartPosition As Vector3
Dim TargetEntity As Entity
Dim Destination As Vector3
Dim MoveDistance As New Vector3(0.0F)
Dim MoveSpeed As Single
Dim MoveYSpeed As Single
Dim InterpolationSpeed As Single
Dim InterpolationYSpeed As Single
Dim SpinX As Boolean = False
Dim SpinZ As Boolean = False
Dim SpinSpeedX As Single = 0.1F
Dim SpinSpeedZ As Single = 0.1F
Dim MovementCurve As Integer = 3
Dim EasedIn As Boolean = False
Dim EasedOut As Boolean = False
Public StartPosition As Vector3
Public TargetEntity As Entity
Public Destination As Vector3
Public MoveDistance As New Vector3(0.0F)
Public MoveSpeed As Single
Public MoveYSpeed As Single
Public InterpolationSpeed As Single
Public InterpolationYSpeed As Single
Public SpinX As Boolean = False
Public SpinZ As Boolean = False
Public SpinSpeedX As Single = 0.1F
Public SpinSpeedZ As Single = 0.1F
Public MovementCurve As Integer = 3
Private EasedIn As Boolean = False
Private EasedOut As Boolean = False
Public RemoveEntityAfter As Boolean
Dim ReadyAxis As Vector3 = New Vector3(0.0F)
Public Enum Curves As Integer
@ -93,6 +93,11 @@
Private Sub Move()
Dim DestinationOffset As Vector3 = New Vector3(0)
If TargetEntity.Model IsNot Nothing Then
DestinationOffset = New Vector3(0, -0.5, 0)
End If
Select Case MovementCurve
Case Curves.EaseIn
If EasedIn = False Then
@ -190,17 +195,17 @@
End If
If MoveDistance.Y > 0.05F Then
If StartPosition.Y < Me.Destination.Y Then
If StartPosition.Y < Me.Destination.Y + DestinationOffset.Y Then
TargetEntity.Position.Y += Me.MoveYSpeed
If TargetEntity.Position.Y >= Me.Destination.Y - 0.05 Then
TargetEntity.Position.Y = Me.Destination.Y
If TargetEntity.Position.Y >= Me.Destination.Y + DestinationOffset.Y - 0.05 Then
TargetEntity.Position.Y = Me.Destination.Y + DestinationOffset.Y
End If
ElseIf StartPosition.Y > Me.Destination.Y Then
ElseIf StartPosition.Y > Me.Destination.Y + DestinationOffset.Y Then
TargetEntity.Position.Y -= Me.MoveYSpeed
If TargetEntity.Position.Y <= Me.Destination.Y + 0.05 Then
TargetEntity.Position.Y = Me.Destination.Y
If TargetEntity.Position.Y <= Me.Destination.Y + DestinationOffset.Y + 0.05 Then
TargetEntity.Position.Y = Me.Destination.Y + DestinationOffset.Y
End If
End If
MoveDistance.Y -= Me.MoveYSpeed

View File

@ -2,13 +2,13 @@
Inherits BattleAnimation3D
Dim TargetEntity As Entity
Dim TransitionSpeed As Single = 0.01F
Dim FadeIn As Boolean = False
Dim EndState As Single = 0.0F
Dim RemoveEntityAfter As Boolean
Public TargetEntity As Entity
Public TransitionSpeed As Single = 0.01F
Public FadeIn As Boolean = False
Public EndState As Single = 0.0F
Public RemoveEntityAfter As Boolean
Public Sub New(ByRef entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal StartState As Single = 1.0F)
Public Sub New(ByVal entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal StartState As Single = 1.0F)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.RemoveEntityAfter = RemoveEntityAfter
Me.EndState = EndState

View File

@ -2,21 +2,21 @@
Inherits BattleAnimation3D
Dim StartPosition As Vector3
Dim ReturnToStart As Vector3
Dim TargetEntity As Entity
Dim HalfDistance As New Vector3(0.0F)
Dim DestinationDistance As New Vector3(0.0F)
Dim CurrentDistance As New Vector3(0.0F)
Dim MoveSpeed As Single
Dim MoveBothWays As Boolean = True
Dim MovementCurve As Integer = 0
Dim RemoveEntityAfter As Boolean
Dim Duration As TimeSpan
Dim ReadyTime As Date
Dim ReadyAxis As New Vector3(0)
Dim InterpolationSpeed As Vector3
Dim InterpolationDirection As Boolean = True
Public StartPosition As Vector3
Public ReturnToStart As Vector3
Public TargetEntity As Entity
Public HalfDistance As New Vector3(0.0F)
Public DestinationDistance As New Vector3(0.0F)
Public CurrentDistance As New Vector3(0.0F)
Public MoveSpeed As Single
Public MoveBothWays As Boolean = True
Public MovementCurve As Integer = 0
Public RemoveEntityAfter As Boolean
Public Duration As TimeSpan
Public ReadyTime As Date
Public ReadyAxis As New Vector3(0)
Public InterpolationSpeed As Vector3
Public InterpolationDirection As Boolean = True
Public Enum Curves As Integer
Linear
Smooth

View File

@ -11,9 +11,9 @@
Dim DoRotation As Vector3 = New Vector3(1.0F)
Dim AmountRotated As Vector3 = New Vector3(0.0F)
Dim ReadyAxis As Vector3 = New Vector3(0.0F)
Dim RemoveEntityAfter As Boolean = False
Public RemoveEntityAfter As Boolean = False
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.RemoveEntityAfter = RemoveEntityAfter
Me.RotationSpeedVector = RotationSpeedVector
@ -24,7 +24,7 @@
Me.AnimationType = AnimationTypes.Rotation
End Sub
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean)
Me.New(Entity, RemoveEntityAfter, RotationSpeedVector, EndRotation, startDelay, endDelay)
If DoXRotation = False Then
@ -41,7 +41,7 @@
End If
End Sub
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean, ByVal DoReturn As Boolean)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean, ByVal DoReturn As Boolean)
Me.New(Entity, RemoveEntityAfter, RotationSpeedVector, EndRotation, startDelay, endDelay, DoXRotation, DoYRotation, DoZRotation)
Me.DoReturn = DoReturn

View File

@ -2,16 +2,16 @@
Inherits BattleAnimation3D
Dim Grow As Boolean = False
Dim EndSize As Vector3
Dim SizeSpeed As Single = 0.01F
Dim TargetEntity As Entity
Dim Anchors As String '1 = Bottom, 2 = Top, 3 = Left, 4 = Right. Combinations are possible.
Public Grow As Boolean = False
Public EndSize As Vector3
Public SizeSpeed As Single = 0.01F
Public TargetEntity As Entity
Public Anchors As String '1 = Bottom, 2 = Top, 3 = Left, 4 = Right. Combinations are possible.
Dim SpeedMultiplier As Vector3
Dim RemoveEntityAfter As Boolean
Public Change As New Vector3(1)
Public RemoveEntityAfter As Boolean
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Scale As Vector3, ByVal Grow As Boolean, ByVal EndSize As Vector3, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Anchors As String, Optional SpeedMultiplier As Vector3 = Nothing)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Scale As Vector3, ByVal Grow As Boolean, ByVal EndSize As Vector3, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Anchors As String)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, Scale, startDelay, endDelay)
Me.RemoveEntityAfter = RemoveEntityAfter
Me.Anchors = Anchors
@ -19,11 +19,6 @@
Me.EndSize = EndSize
Me.SizeSpeed = SizeSpeed
Me.TargetEntity = Entity
If SpeedMultiplier <> Nothing Then
Me.SpeedMultiplier = SpeedMultiplier
Else
Me.SpeedMultiplier = New Vector3(1)
End If
Me.AnimationType = AnimationTypes.Size
End Sub
@ -31,9 +26,9 @@
Public Overrides Sub DoActionActive()
Dim saveScale As Vector3 = TargetEntity.Scale
Dim changeX As Single = SizeSpeed * SpeedMultiplier.X
Dim changeY As Single = SizeSpeed * SpeedMultiplier.Y
Dim changeZ As Single = SizeSpeed * SpeedMultiplier.Z
Dim changeX As Single = SizeSpeed * Change.X
Dim changeY As Single = SizeSpeed * Change.Y
Dim changeZ As Single = SizeSpeed * Change.Z
If Grow = True Then
If TargetEntity.Scale.X < Me.EndSize.X Then
@ -107,6 +102,9 @@
End If
End Sub
Public Sub SetChange(ByVal changeX As Single, ByVal changeY As Single, ByVal changeZ As Single)
Me.Change = New Vector3(changeX, changeY, changeZ)
End Sub
Public Overrides Sub DoRemoveEntity()
If Me.RemoveEntityAfter = True Then
TargetEntity.CanBeRemoved = True

View File

@ -2,9 +2,9 @@
Inherits BattleAnimation3D
Dim TargetEntity As Entity
Dim SetPosition As Vector3
Dim RemoveEntityAfter As Boolean
Public TargetEntity As Entity
Public SetPosition As Vector3
Public RemoveEntityAfter As Boolean
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal SetPosition As Vector3, ByVal startDelay As Single, ByVal endDelay As Single)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)

View File

@ -2,11 +2,11 @@
Inherits BattleAnimation3D
Dim Texture As Texture2D
Dim TargetEntity As Entity
Dim RemoveEntityAfter As Boolean
Public Texture As Texture2D
Public TargetEntity As Entity
Public RemoveEntityAfter As Boolean
Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single)
Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.RemoveEntityAfter = RemoveEntityAfter
Me.TargetEntity = Entity

View File

@ -2,10 +2,10 @@
Inherits BattleAnimation3D
Dim soundfile As String
Dim stopMusic As Boolean
Dim IsPokemon As Boolean
Dim CrySuffix As String = ""
Private soundfile As String
Private stopMusic As Boolean
Private IsPokemon As Boolean
Private CrySuffix As String = ""
Public Sub New(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False, Optional ByVal CrySuffix As String = "")

View File

@ -24,14 +24,14 @@
Public Ready As Boolean = False
Public startDelay As Date
Public endDelay As Date
Dim SpawnedEntity As Boolean = False
Dim Started As Boolean = False
Dim DelayDivide As Single = 6.0F
Dim StartDelayWhole As Single
Dim StartDelayFraction As Single
Dim EndDelayWhole As Single
Dim EndDelayFraction As Single
Dim hasStartedEndDelay As Boolean = False
Public SpawnedEntity As Boolean = False
Public Started As Boolean = False
Private DelayDivide As Single = 6.0F
Private StartDelayWhole As Single
Private StartDelayFraction As Single
Private EndDelayWhole As Single
Private EndDelayFraction As Single
Private hasStartedEndDelay As Boolean = False
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, Optional SpawnedEntity As Boolean = False)
MyBase.New(Position.X, Position.Y, Position.Z, "BattleAnimation", {Texture}, {0, 0}, False, 0, Scale, BaseModel.BillModel, 0, "", New Vector3(1.0F))

View File

@ -20,7 +20,7 @@
Return Nothing
End Select
Return TextureManager.GetTexture(Element.GetElementTexturePath(), r, "")
Return TextureManager.GetTexture("GUI\Menus\Types", r, "")
End Function
Public Shared Function GetStatColor(ByVal Status As Pokemon.StatusProblems) As Color

View File

@ -24,63 +24,13 @@
Dim Argument As Object
End Structure
Public Shared OwnStep As RoundConst
Public Shared OppStep As RoundConst
Public OwnStep As RoundConst
Public OppStep As RoundConst
''' <summary>
''' Returns the move of a Pokémon with a specified ID.
''' </summary>
Private Function GetPokemonMoveFromID(ByVal Pokemon As Pokemon, ByVal MoveID As Integer, BattleScreen As BattleScreen, own As Boolean) As Attack
If own = True Then
If BattleScreen.FieldEffects.OwnUsedRandomMove = True Then
For Each a As Attack In Pokemon.Attacks
If a.Name.ToLower = "metronome" OrElse a.IsGameModeMove AndAlso a.gmUseRandomMove = True Then
If a.CurrentPP > 0 Then
a.CurrentPP -= 1
Exit For
End If
End If
Next
End If
If BattleScreen.FieldEffects.OwnUsedMirrorMove = True Then
For Each a As Attack In Pokemon.Attacks
If a.Name.ToLower = "mirror move" Then
If a.CurrentPP > 0 Then
a.CurrentPP -= 1
Exit For
End If
End If
Next
End If
If BattleScreen.FieldEffects.OwnUsedRandomMove = True Or BattleScreen.FieldEffects.OwnUsedMirrorMove = True Then
Return Attack.GetAttackByID(MoveID)
End If
Else
If BattleScreen.FieldEffects.OppUsedRandomMove = True Then
For Each a As Attack In Pokemon.Attacks
If a.Name.ToLower = "metronome" OrElse a.IsGameModeMove AndAlso a.gmUseRandomMove = True Then
If a.CurrentPP > 0 Then
a.CurrentPP -= 1
Exit For
End If
End If
Next
End If
If BattleScreen.FieldEffects.OppUsedMirrorMove = True Then
For Each a As Attack In Pokemon.Attacks
If a.Name.ToLower = "mirror move" Then
If a.CurrentPP > 0 Then
a.CurrentPP -= 1
Exit For
End If
End If
Next
End If
If BattleScreen.FieldEffects.OppUsedRandomMove = True Or BattleScreen.FieldEffects.OppUsedMirrorMove = True Then
Return Attack.GetAttackByID(MoveID)
End If
End If
Private Function GetPokemonMoveFromID(ByVal Pokemon As Pokemon, ByVal MoveID As Integer) As Attack
For Each a As Attack In Pokemon.Attacks
If a.ID = MoveID Then
Return a
@ -106,7 +56,7 @@
If BattleScreen.FieldEffects.OwnRolloutCounter > 0 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 205, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 205)})
Exit Sub
End If
@ -114,7 +64,7 @@
If BattleScreen.FieldEffects.OwnIceBallCounter > 0 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 301, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 301)})
Exit Sub
End If
@ -122,7 +72,7 @@
If BattleScreen.FieldEffects.OwnFlyCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 19, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 19)})
Exit Sub
End If
@ -130,7 +80,7 @@
If BattleScreen.FieldEffects.OwnDigCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 91, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 91)})
Exit Sub
End If
@ -138,7 +88,7 @@
If BattleScreen.FieldEffects.OwnOutrage >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 200, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 200)})
Exit Sub
End If
@ -146,7 +96,7 @@
If BattleScreen.FieldEffects.OwnThrash >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 37, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 37)})
Exit Sub
End If
@ -154,7 +104,7 @@
If BattleScreen.FieldEffects.OwnPetalDance >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 80, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 80)})
Exit Sub
End If
@ -162,7 +112,7 @@
If BattleScreen.FieldEffects.OwnBounceCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 340, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 340)})
Exit Sub
End If
@ -170,7 +120,7 @@
If BattleScreen.FieldEffects.OwnDiveCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 291, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 291)})
Exit Sub
End If
@ -178,7 +128,7 @@
If BattleScreen.FieldEffects.OwnShadowForceCounter = 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 467, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 467)})
Exit Sub
End If
@ -186,13 +136,13 @@
If BattleScreen.FieldEffects.OwnPhantomForceCounter = 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 566, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 566)})
Exit Sub
End If
'If Sky Drop gets programmed, put this in.
'If BattleScreen.FieldEffects.OwnSkyDropCounter = 1 Then
' InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, xxx, BattleScreen, True)})
' InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, xxx)})
' Exit Sub
'End If
@ -200,7 +150,7 @@
If BattleScreen.FieldEffects.OwnGeomancyCounter = 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 601, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 601)})
Exit Sub
End If
@ -208,7 +158,7 @@
If BattleScreen.FieldEffects.OwnSolarBeam >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 76, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 76)})
Exit Sub
End If
@ -216,7 +166,7 @@
If BattleScreen.FieldEffects.OwnSolarBlade >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 669, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 669)})
Exit Sub
End If
@ -224,7 +174,7 @@
If BattleScreen.FieldEffects.OwnSkyAttackCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 143, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 143)})
Exit Sub
End If
@ -232,7 +182,7 @@
If BattleScreen.FieldEffects.OwnSkullBashCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 130, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 130)})
Exit Sub
End If
@ -240,7 +190,7 @@
If BattleScreen.FieldEffects.OwnRazorWindCounter >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 13, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 13)})
Exit Sub
End If
@ -248,7 +198,7 @@
If BattleScreen.FieldEffects.OwnUproar >= 1 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 253, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 253)})
Exit Sub
End If
@ -256,7 +206,7 @@
If BattleScreen.FieldEffects.OwnBideCounter > 0 Then
SelectedMoveOwn = False
DeleteHostQuery(BattleScreen)
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 117, BattleScreen, True)})
InitializeRound(BattleScreen, New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OwnPokemon, 117)})
Exit Sub
End If
@ -329,120 +279,120 @@
'Rollout
If BattleScreen.FieldEffects.OppRolloutCounter > 0 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 205, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 205)}
End If
'IceBall
If BattleScreen.FieldEffects.OppIceBallCounter > 0 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 301, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 301)}
End If
'Fly:
If BattleScreen.FieldEffects.OppFlyCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 19, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 19)}
End If
'Dig:
If BattleScreen.FieldEffects.OppDigCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 91, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 91)}
End If
'Outrage:
If BattleScreen.FieldEffects.OppOutrage >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 200, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 200)}
End If
'Thrash:
If BattleScreen.FieldEffects.OppThrash >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 37, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 37)}
End If
'Petal Dance:
If BattleScreen.FieldEffects.OppPetalDance >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 80, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 80)}
End If
'Bounce:
If BattleScreen.FieldEffects.OppBounceCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 340, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 340)}
End If
'Dive:
If BattleScreen.FieldEffects.OppDiveCounter = 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 291, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 291)}
End If
'Shadow Force:
If BattleScreen.FieldEffects.OppShadowForceCounter = 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 467, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 467)}
End If
'Phantom Force:
If BattleScreen.FieldEffects.OppPhantomForceCounter = 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 566, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 566)}
End If
''Sky Drop:
'If BattleScreen.FieldEffects.OppSkyDropCounter = 1 Then
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString(), BattleScreen, False}
' Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = (19).ToString()}
'End If
'Geomancy:
If BattleScreen.FieldEffects.OppGeomancyCounter = 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 601, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 601)}
End If
'Solar Beam:
If BattleScreen.FieldEffects.OppSolarBeam >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 76, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 76)}
End If
'Solar Blade:
If BattleScreen.FieldEffects.OppSolarBlade >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 669, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 669)}
End If
'Sky Attack:
If BattleScreen.FieldEffects.OppSkyAttackCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 143, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 143)}
End If
'Skull Bash:
If BattleScreen.FieldEffects.OppSkullBashCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 130, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 130)}
End If
'RazorWind:
If BattleScreen.FieldEffects.OppRazorWindCounter >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 13, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 13)}
End If
'Uproar:
If BattleScreen.FieldEffects.OppUproar >= 1 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 253, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 253)}
End If
'Bide:
If BattleScreen.FieldEffects.OppBideCounter > 0 Then
SelectedMoveOpp = False
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 117, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, 117)}
End If
End If
@ -467,7 +417,7 @@
moveID = CInt(inputString)
End If
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID, BattleScreen, False)}
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = GetPokemonMoveFromID(BattleScreen.OppPokemon, moveID)}
ElseIf BattleScreen.ReceivedInput.StartsWith("SWITCH|") Then
BattleScreen.OppStatistics.Switches += 1
Dim switchID As Integer = CInt(BattleScreen.ReceivedInput.Remove(0, 7))
@ -523,76 +473,39 @@
Private Function GetAttack(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal move As Attack) As RoundConst
'TODO: Reset rage counters
If own = True Then
If BattleScreen.FieldEffects.OwnUsedRandomMove = True AndAlso (move.Name.ToLower() <> "metronome" OrElse move.IsGameModeMove = True AndAlso move.gmUseRandomMove = False) Then
BattleScreen.FieldEffects.OwnUsedRandomMove = False
End If
If BattleScreen.FieldEffects.OwnUsedMirrorMove = True AndAlso (move.Name.ToLower() <> "mirror move") Then
BattleScreen.FieldEffects.OwnUsedMirrorMove = False
End If
Else
If BattleScreen.FieldEffects.OppUsedRandomMove = True AndAlso (move.Name.ToLower() <> "metronome" OrElse move.IsGameModeMove = True AndAlso move.gmUseRandomMove = False) Then
BattleScreen.FieldEffects.OppUsedRandomMove = False
End If
If BattleScreen.FieldEffects.OppUsedMirrorMove = True AndAlso (move.Name.ToLower() <> "mirror move") Then
BattleScreen.FieldEffects.OppUsedMirrorMove = False
End If
End If
Select Case move.Name.ToLower()
Case "metronome"
If move.CurrentPP > 0 Then
move.CurrentPP -= 1
End If
If move.IsGameModeMove = True AndAlso move.gmUseRandomMove = True Then
If move.CurrentPP > 0 Then
move.CurrentPP -= 1
End If
If own = True Then
BattleScreen.FieldEffects.OwnUsedRandomMove = True
Else
BattleScreen.FieldEffects.OppUsedRandomMove = True
End If
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = move.GetRandomAttack()}
Else
Select Case move.Name.ToLower()
Case "metronome"
If move.CurrentPP > 0 Then
move.CurrentPP -= 1
End If
If own = True Then
BattleScreen.FieldEffects.OwnUsedRandomMove = True
Else
BattleScreen.FieldEffects.OppUsedRandomMove = True
End If
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = Moves.Normal.Metronome.GetMetronomeMove()}
Case "mirror move"
If move.CurrentPP > 0 Then
move.CurrentPP -= 1
End If
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = Moves.Normal.Metronome.GetMetronomeMove()}
Case "mirror move"
If move.CurrentPP > 0 Then
move.CurrentPP -= 1
End If
Dim id As Integer = -1
If own = True Then
If Not BattleScreen.FieldEffects.OppLastMove Is Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.MirrorMoveAffected = True Then
id = BattleScreen.FieldEffects.OppLastMove.ID
End If
Else
If Not BattleScreen.FieldEffects.OwnLastMove Is Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.MirrorMoveAffected = True Then
id = BattleScreen.FieldEffects.OwnLastMove.ID
End If
Dim id As Integer = -1
If own = True Then
If Not BattleScreen.FieldEffects.OppLastMove Is Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.MirrorMoveAffected = True Then
id = BattleScreen.FieldEffects.OppLastMove.ID
End If
Else
If Not BattleScreen.FieldEffects.OwnLastMove Is Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.MirrorMoveAffected = True Then
id = BattleScreen.FieldEffects.OwnLastMove.ID
End If
End If
If id <> -1 Then
If own = True Then
BattleScreen.FieldEffects.OwnUsedMirrorMove = True
Else
BattleScreen.FieldEffects.OppUsedMirrorMove = True
End If
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = Attack.GetAttackByID(id)}
Else
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = "Mirror Move failed!"}
End If
Case "struggle"
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = move}
Case Else
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = move}
End Select
End If
If id <> -1 Then
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = Attack.GetAttackByID(id)}
Else
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Text, .Argument = "Mirror Move failed!"}
End If
Case "struggle"
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = move}
Case Else
Return New RoundConst() With {.StepType = RoundConst.StepTypes.Move, .Argument = move}
End Select
End Function
Public SelectedMoveOwn As Boolean = True
@ -718,8 +631,8 @@
Exit Sub
End If
Dim OppStep = GetOppStep(BattleScreen, OwnStep)
Battle.OwnStep = OwnStep
Battle.OppStep = OppStep
Me.OwnStep = OwnStep
Me.OppStep = OppStep
BattleScreen.OwnFaint = False '''
BattleScreen.OppFaint = False '''
If OwnStep.StepType = RoundConst.StepTypes.Move Then
@ -943,8 +856,8 @@
ChangeCameraAngle(0, True, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OwnPokemon.GetDisplayName() & " is trapped!"))
Dim oppMove As Attack = CType(OppStep.Argument, Attack)
BattleScreen.FieldEffects.OppUsedMoves.Add(oppMove.ID)
BattleScreen.FieldEffects.OppUsedMoves.Add(CInt(OppStep.Argument))
Dim oppMove As Attack = Attack.GetAttackByID(CInt(OppStep.Argument))
If SelectedMoveOpp = True Then oppMove.MoveSelected(False, BattleScreen)
DoAttackRound(BattleScreen, False, oppMove)
EndRound(BattleScreen, 2)
@ -1141,7 +1054,6 @@
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion)
Case 38 'Full Heal
Me.CureStatusProblem(False, False, BattleScreen, BattleScreen.Trainer.Name & " used a Full Heal on " & p.GetDisplayName() & "!", "item:fullheal")
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion)
Case 9 'Antidote
Me.CureStatusProblem(False, False, BattleScreen, BattleScreen.Trainer.Name & " used an Antidote on " & p.GetDisplayName() & "!", "item:antidote")
Case 10 'Burn Heal
@ -1300,19 +1212,15 @@
op = BattleScreen.OppPokemon
pNPC = BattleScreen.OwnPokemonNPC
opNPC = BattleScreen.OppPokemonNPC
If Not (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) Then
BattleScreen.FieldEffects.OwnLastMove = moveUsed
End If
BattleScreen.FieldEffects.OwnLastMove = moveUsed
Else
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
pNPC = BattleScreen.OppPokemonNPC
opNPC = BattleScreen.OwnPokemonNPC
If Not (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then
BattleScreen.FieldEffects.OppLastMove = moveUsed
End If
BattleScreen.FieldEffects.OppLastMove = moveUsed
End If
If WildHasEscaped Then
If WildHasEscaped Then
WildHasEscaped = False
Exit Sub
End If
@ -1443,7 +1351,6 @@
Exit Sub
End If
Else
' If the last move was Sleep Talk, don't do sleep animation
If (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) OrElse (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then
If own Then
BattleScreen.FieldEffects.OwnLastMove = moveUsed
@ -1451,34 +1358,30 @@
BattleScreen.FieldEffects.OppLastMove = moveUsed
End If
Else
' If the used move is not Snore, do sleep animation or wake up
If Not (sleepTurns > 0 AndAlso moveUsed.ID = 173) Then
If sleepTurns > 0 Then
ChangeCameraAngle(1, own, BattleScreen)
'Sleep Animation
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
Dim SleepAnimation As New AnimationQueryObject(pNPC, Not own)
If sleepTurns > 0 Then
ChangeCameraAngle(1, own, BattleScreen)
'Sleep Animation
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
Dim SleepAnimation As New AnimationQueryObject(pNPC, Not own)
SleepAnimation.AnimationPlaySound("Battle\Effects\Asleep", 0, 0)
Dim SleepEntity1 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1)
SleepAnimation.AnimationChangeTexture(SleepEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 1, 1)
SleepAnimation.AnimationMove(SleepEntity1, True, 0, 0.5, 0.25, 0.01, False, False, 0, 0)
SleepAnimation.AnimationPlaySound("Battle\Effects\Asleep", 0, 0)
Dim SleepEntity1 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1)
SleepAnimation.AnimationChangeTexture(SleepEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 1, 1)
SleepAnimation.AnimationMove(SleepEntity1, True, 0, 0.5, 0.25, 0.01, False, False, 0, 0)
Dim SleepEntity2 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 1.5, 1)
Dim SleepEntity2 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 1.5, 1)
SleepAnimation.AnimationChangeTexture(SleepEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 2.5, 1)
SleepAnimation.AnimationMove(SleepEntity2, True, 0, 0.5, 0.25, 0.01, False, False, 2, 0)
SleepAnimation.AnimationChangeTexture(SleepEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 2.5, 1)
SleepAnimation.AnimationMove(SleepEntity2, True, 0, 0.5, 0.25, 0.01, False, False, 2, 0)
BattleScreen.BattleQuery.Add(SleepAnimation)
Else
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Asleep", False))
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is fast asleep."))
Exit Sub
BattleScreen.BattleQuery.Add(SleepAnimation)
Else
CureStatusProblem(own, own, BattleScreen, p.GetDisplayName() & " woke up!", "sleepturns")
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Asleep", False))
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is fast asleep."))
Exit Sub
Else
CureStatusProblem(own, own, BattleScreen, p.GetDisplayName() & " woke up!", "sleepturns")
End If
End If
End If
@ -1647,6 +1550,8 @@
End If
End If
moveUsed.PreAttack(own, BattleScreen)
If p.HasVolatileStatus(Pokemon.VolatileStatus.Flinch) = True Then
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Flinch)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " flinched and couldn't move!"))
@ -1671,15 +1576,6 @@
Dim gravity As Integer = BattleScreen.FieldEffects.Gravity
If gravity > 0 Then
If moveUsed.DisabledWhileGravity = True Then
Dim fly As Integer = BattleScreen.FieldEffects.OwnFlyCounter
If own = False Then
fly = BattleScreen.FieldEffects.OppFlyCounter
End If
If fly > 0 Then
moveUsed.MoveMisses(own, BattleScreen)
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s move was prevented due to Gravity!"))
Exit Sub
End If
@ -1702,7 +1598,6 @@
BattleScreen.BattleQuery.Add(HeartAnimation)
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is in love with " & op.GetDisplayName() & "!"))
moveUsed.IsAttracted(own, BattleScreen)
Exit Sub
End If
End If
@ -1742,7 +1637,6 @@
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Paralyzed", False))
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is fully paralyzed!" & Environment.NewLine & "It cannot move!"))
moveUsed.IsParalyzed(own, BattleScreen)
Exit Sub
End If
End If
@ -1804,8 +1698,6 @@
End If
End If
moveUsed.PreAttack(own, BattleScreen)
Dim substitute As Integer = BattleScreen.FieldEffects.OppSubstitute
If own = False Then
substitute = BattleScreen.FieldEffects.OwnSubstitute
@ -1819,15 +1711,9 @@
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " used " & moveUsed.Name & "!"))
If moveUsed.DeductPP(own, BattleScreen) = True Then
If moveUsed.CurrentPP > 0 Then
moveUsed.CurrentPP -= 1
If op.Ability.Name.ToLower() = "pressure" And moveUsed.CurrentPP > 0 Then
moveUsed.CurrentPP -= 1
If op.Ability.Name.ToLower() = "pressure" And moveUsed.CurrentPP > 0 Then
moveUsed.CurrentPP -= 1
End If
Else
BattleScreen.BattleQuery.Add(New TextQueryObject("But it failed..."))
moveUsed.MoveMisses(own, BattleScreen)
Exit Sub
End If
End If
@ -2150,7 +2036,6 @@
If protectWorks = True Then
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " protected itself!"))
moveUsed.MoveProtectedDetected(own, BattleScreen)
Exit Sub
End If
End If
@ -2169,7 +2054,6 @@
If detectWorks = True Then
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " protected itself!"))
moveUsed.MoveProtectedDetected(own, BattleScreen)
Exit Sub
End If
End If
@ -2192,7 +2076,7 @@
If moveUsed.MakesContact = True Then
Me.LowerStat(own, Not own, BattleScreen, "Attack", 1, "", "move:kingsshield")
End If
moveUsed.MoveProtectedDetected(own, BattleScreen)
Exit Sub
End If
End If
@ -2218,14 +2102,6 @@
'Opp Pokémon move animation! This displays the move effects that target the other Pokémon and appear after the camera switched around.
moveUsed.OpponentPokemonMoveAnimation(BattleScreen, own)
'Reset Fly if needed after the animation definition
If own = True And BattleScreen.FieldEffects.OwnFlyCounter = 2 Then
BattleScreen.FieldEffects.OwnFlyCounter = 0
End If
If own = False And BattleScreen.FieldEffects.OppFlyCounter = 2 Then
BattleScreen.FieldEffects.OwnFlyCounter = 0
End If
If moveUsed.IsDamagingMove = True Then
ChangeCameraAngle(2, own, BattleScreen)
If op.Ability.Name.ToLower() = "wonder guard" And effectiveness <= 1.0F And BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True And moveUsed.IsWonderGuardAffected = True Then
@ -2532,7 +2408,7 @@
op.Type1 = moveUsed.GetAttackType(own, BattleScreen)
op.Type2.Type = Element.Types.Blank
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " changed its color!"))
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " changed it's color!"))
End If
End If
Case "rough skin"
@ -2939,20 +2815,6 @@
End If
moveUsed.MoveMisses(own, BattleScreen)
End If
''Own Pokémon Encore
Dim attackIndex As Integer = -1
If own = True AndAlso BattleScreen.FieldEffects.OwnEncore > 0 Then
For a = 0 To BattleScreen.OwnPokemon.Attacks.Count - 1
If BattleScreen.OwnPokemon.Attacks(a).ID = BattleScreen.FieldEffects.OwnEncoreMove.ID Then
attackIndex = a
End If
Next
If attackIndex <> -1 AndAlso BattleScreen.OwnPokemon.Attacks(attackIndex).CurrentPP = 0 Then
BattleScreen.FieldEffects.OwnEncoreMove = Nothing
BattleScreen.FieldEffects.OwnEncore = 0
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OwnPokemon.GetDisplayName() & "'s encore stopped."))
End If
End If
End Sub
''' <summary>
@ -3014,13 +2876,6 @@
BattleScreen.BattleQuery.Add(New TextQueryObject(message))
End If
If own = True AndAlso BattleScreen.FieldEffects.OwnPoisonCounter > 0 Then
BattleScreen.FieldEffects.OwnPoisonCounter = 0
End If
If own = False AndAlso BattleScreen.FieldEffects.OppPoisonCounter > 0 Then
BattleScreen.FieldEffects.OppPoisonCounter = 0
End If
p.Status = Pokemon.StatusProblems.None
Return True
End Function
@ -4673,21 +4528,13 @@
End If
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject(sound, False, 0.0F))
End If
Dim fly As Integer = BattleScreen.FieldEffects.OwnFlyCounter
If own = False Then
fly = BattleScreen.FieldEffects.OppFlyCounter
End If
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
If fly = 0 Then
Dim HitAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, own)
HitAnimation.AnimationFade(Nothing, False, 1, False, 0, 0, 0)
HitAnimation.AnimationFade(Nothing, False, 1, True, 1, 1, 0)
HitAnimation.AnimationFade(Nothing, False, 1, False, 0, 2, 0)
HitAnimation.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BattleScreen.BattleQuery.Add(HitAnimation)
End If
Dim HitAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, own)
HitAnimation.AnimationFade(Nothing, False, 1, False, 0, 0, 0)
HitAnimation.AnimationFade(Nothing, False, 1, True, 1, 1, 0)
HitAnimation.AnimationFade(Nothing, False, 1, False, 0, 2, 0)
HitAnimation.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BattleScreen.BattleQuery.Add(HitAnimation)
End If
If own = True Then
@ -5167,7 +5014,7 @@
RaiseStat(own, own, BattleScreen, "Special Attack", 1, "Download analyzed the foe!", "download")
End If
Case "mold breaker"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " breaks the mold!"))
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " breakes the mold!"))
Case "turbo blaze"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is radiating a blazing aura!"))
Case "teravolt"
@ -8285,7 +8132,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 IsNot Nothing AndAlso 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.Type <> Element.Types.Poison Then
Select Case .FieldEffects.OwnToxicSpikes
Case 1
InflictPoison(False, True, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes")
@ -8444,14 +8291,8 @@
Next
For i = 0 To Core.Player.Pokemons.Count - 1
If Core.Player.Inventory.GetItemAmount(658.ToString) > 0 And Core.Player.EnableExpAll = True Then
If expPokemon.Contains(i) = False AndAlso Core.Player.Pokemons(i).Status <> Pokemon.StatusProblems.Fainted AndAlso Core.Player.Pokemons(i).IsEgg() = False Then
expPokemon.Add(i)
End If
Else
If expPokemon.Contains(i) = False And Not Core.Player.Pokemons(i).Item Is Nothing AndAlso Core.Player.Pokemons(i).Item.OriginalName.ToLower() = "exp. share" AndAlso Core.Player.Pokemons(i).Status <> Pokemon.StatusProblems.Fainted AndAlso Core.Player.Pokemons(i).IsEgg() = False Then
expPokemon.Add(i)
End If
If expPokemon.Contains(i) = False And Not Core.Player.Pokemons(i).Item Is Nothing AndAlso Core.Player.Pokemons(i).Item.OriginalName.ToLower() = "exp. share" AndAlso Core.Player.Pokemons(i).Status <> Pokemon.StatusProblems.Fainted AndAlso Core.Player.Pokemons(i).IsEgg() = False Then
expPokemon.Add(i)
End If
Next
@ -8465,7 +8306,7 @@
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, PokeIndex)
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 moveLevel As Integer = originalLevel
@ -8473,12 +8314,7 @@
For e = 1 To EXP
Dim oldStats() As Integer
With Core.Player.Pokemons(PokeIndex)
If .IsTransformed = True Then
oldStats = { .MaxHP, .OriginalStats(0), .OriginalStats(1), .OriginalStats(2), .OriginalStats(3), .OriginalStats(4)}
Else
oldStats = { .MaxHP, .Attack, .Defense, .SpAttack, .SpDefense, .Speed}
End If
oldStats = { .MaxHP, .Attack, .Defense, .SpAttack, .SpDefense, .Speed}
End With
Core.Player.Pokemons(PokeIndex).GetExperience(1, False)

View File

@ -991,7 +991,7 @@
Return CalculateEffectiveness(move, BattleScreen, p, op, own)
End Function
Public Shared Function GainExp(ByVal p As Pokemon, ByVal BattleScreen As BattleScreen, ByVal PokemonList As List(Of Integer), ByVal PokeIndex As Integer) As Integer
Public Shared Function GainExp(ByVal p As Pokemon, ByVal BattleScreen As BattleScreen, ByVal PokemonList As List(Of Integer)) As Integer
Dim op As Pokemon = BattleScreen.OppPokemon
Dim a As Double = 1D
@ -1002,25 +1002,8 @@
Dim b As Double = op.BaseExperience
Dim t As Double = 1D
If Not p.Item Is Nothing AndAlso p.Item.IsGameModeItem = True Then
If CType(p.Item, GameModeItem).gmExpMultiplier <> -1D AndAlso CType(p.Item, GameModeItem).gmOverrideTradeExp = True Then
t = CType(p.Item, GameModeItem).gmExpMultiplier
Else
If p.OT <> Core.Player.OT Then
t = 1.5D
End If
End If
Else
If p.OT <> Core.Player.OT Then
t = 1.5D
End If
End If
Dim gm As Double = 1D
If Not p.Item Is Nothing AndAlso p.Item.IsGameModeItem = True Then
If CType(p.Item, GameModeItem).gmExpMultiplier <> -1D AndAlso CType(p.Item, GameModeItem).gmOverrideTradeExp = False Then
gm = CType(p.Item, GameModeItem).gmExpMultiplier
End If
If p.OT <> Core.Player.OT Then
t = 1.5D
End If
Dim e As Double = 1D
@ -1036,33 +1019,25 @@
Dim s As Double = PokemonList.Count
Dim expShares As Integer = 0
Dim expAllMultiplier As Single = 1
If Core.Player.Inventory.GetItemAmount(658.ToString) > 0 And Core.Player.EnableExpAll = True Then
s = 1D
If BattleScreen.ParticipatedPokemon.Contains(PokeIndex) = False Then
expAllMultiplier = 0.5F
End If
Else
For Each po As Pokemon In Core.Player.Pokemons
If Not po.Item Is Nothing Then
If po.Item.OriginalName.ToLower() = "exp. share" Then
expShares += 1
End If
For Each po As Pokemon In Core.Player.Pokemons
If Not po.Item Is Nothing Then
If po.Item.OriginalName.ToLower() = "exp. share" Then
expShares += 1
End If
Next
End If
Next
If expShares > 0 Then
If Not p.Item Is Nothing Then
If p.Item.OriginalName.ToLower() = "exp. share" Then
s = 2D
Else
s = (PokemonList.Count * 2D) * expShares
End If
If expShares > 0 Then
If Not p.Item Is Nothing Then
If p.Item.OriginalName.ToLower() = "exp. share" Then
s = 2D
Else
s = (PokemonList.Count * 2D) * expShares
End If
End If
End If
Dim EXP As Integer = CInt((((a * b * L) / (5 * s)) * (((2 * L + 10) ^ 2.5D) / ((L + Lp + 10) ^ 2.5D)) + 1) * t * e * gm * expAllMultiplier)
Dim EXP As Integer = CInt((((a * b * L) / (5 * s)) * (((2 * L + 10) ^ 2.5D) / ((L + Lp + 10) ^ 2.5D)) + 1) * t * e * 1)
If EXP < 2 Then
EXP = 2
@ -1074,10 +1049,6 @@
End If
Next
If Core.Player.Inventory.GetItemAmount(656.ToString) > 0 Then 'Exp. Charm
EXP = CInt(EXP * 1.5F)
End If
Return EXP
End Function

View File

@ -111,7 +111,7 @@
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Battle\Interface"), New Rectangle(CInt(pos.X) + 14, CInt(pos.Y) + 14, 182, 42), New Rectangle(0, 0, 91, 21), shinyHue)
'Name:
Dim nameInformation As String = p.GetDisplayName() & " " & Localization.GetString("property_Lv.", "Lv.") & " " & p.Level.ToString()
Dim nameInformation As String = p.GetDisplayName() & " Lv. " & p.Level.ToString()
Core.SpriteBatch.DrawString(FontManager.MainFont, nameInformation, New Vector2(pos.X + 2, pos.Y + 2), New Color(0, 0, 0, _moveMenuAlpha))
Core.SpriteBatch.DrawString(FontManager.MainFont, nameInformation, New Vector2(pos.X, pos.Y), shinyHue)
@ -168,7 +168,7 @@
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Battle\Interface"), New Rectangle(CInt(pos.X) + 14, CInt(pos.Y) + 14, 182, 32), New Rectangle(0, 21, 91, 16), shinyHue)
'Name:
Dim nameInformation As String = p.GetDisplayName() & " " & Localization.GetString("property_Lv.", "Lv.") & " " & p.Level.ToString()
Dim nameInformation As String = p.GetDisplayName() & " Lv. " & p.Level.ToString()
Core.SpriteBatch.DrawString(FontManager.MainFont, nameInformation, New Vector2(pos.X + 2, pos.Y + 2), New Color(0, 0, 0, _moveMenuAlpha))
Core.SpriteBatch.DrawString(FontManager.MainFont, nameInformation, New Vector2(pos.X, pos.Y), shinyHue)
@ -317,7 +317,7 @@
Public Sub Update(ByRef BattleScreen As BattleScreen)
Dim blockinteractscreen() As Screen.Identifications = {Screen.Identifications.PartyScreen, Screen.Identifications.SummaryScreen, Screen.Identifications.PauseScreen, Screen.Identifications.ChatScreen}
If blockinteractscreen.Contains(Core.CurrentScreen.Identification) = True OrElse (BattleScreen.BattleQuery.Count > 0 AndAlso BattleScreen.BattleQuery(0).QueryType = QueryObject.QueryTypes.Textbox) Then
If blockinteractscreen.Contains(Core.CurrentScreen.Identification) = True Then
CanInteract = False
Else
CanInteract = True
@ -342,7 +342,6 @@
Private _moveMenuIndex As Integer = 0
Private _moveMenuNextIndex As Integer = 0
Private _moveMenuLastIndex As Integer = 0
Private _moveMenuItemList As New List(Of MoveMenuItem)
Private _moveMenuCreatedID As String = ""
Private _moveMenuAlpha As Integer = 255
@ -392,20 +391,20 @@
Public Sub Draw(ByVal AllExtended As Integer, ByVal SelExtended As Integer, ByVal isSelected As Boolean)
Dim extraExtended As Integer = 0
If isSelected = True Then
Canvas.DrawGradient(New Rectangle(Core.windowSize.Width - 255, 100 + Index * 96, 255, 112), New Color(42, 167, 198, 0), New Color(42, 167, 198, (SelExtended + AllExtended)), True, -1)
Canvas.DrawGradient(New Rectangle(Core.ScreenSize.Width - 255, 100 + Index * 96, 255, 112), New Color(42, 167, 198, 0), New Color(42, 167, 198, (SelExtended + AllExtended)), True, -1)
extraExtended = SelExtended
End If
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), Color.White)
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), Color.White)
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), Color.White)
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), Color.White)
Core.SpriteBatch.Draw(Me.IconUnselected, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 48), Color.White)
Core.SpriteBatch.Draw(Me.IconUnselected, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 48), Color.White)
If isSelected = True Then
Core.SpriteBatch.Draw(Me.IconSelected, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 48), New Color(255, 255, 255, (SelExtended + AllExtended)))
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Text, New Vector2(CInt(Core.windowSize.Width - (AllExtended + extraExtended) + 86), CInt(144 + Index * 96)), New Color(0, 0, 0, (SelExtended + AllExtended)))
Core.SpriteBatch.Draw(Me.IconSelected, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 48), New Color(255, 255, 255, (SelExtended + AllExtended)))
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Text, New Vector2(CInt(Core.ScreenSize.Width - (AllExtended + extraExtended) + 86), CInt(144 + Index * 96)), New Color(0, 0, 0, (SelExtended + AllExtended)))
Else
If IconFading > 0 Then
Core.SpriteBatch.Draw(Me.IconSelected, New Rectangle(Core.windowSize.Width - (AllExtended) + 28, 132 + Index * 96, 48, 48), New Color(255, 255, 255, IconFading))
Core.SpriteBatch.Draw(Me.IconSelected, New Rectangle(Core.ScreenSize.Width - (AllExtended) + 28, 132 + Index * 96, 48, 48), New Color(255, 255, 255, IconFading))
End If
End If
End Sub
@ -413,7 +412,7 @@
Public Sub Update(ByVal BattleScreen As BattleScreen, ByVal AllExtended As Integer, ByVal isSelected As Boolean)
Me.Activate(BattleScreen, AllExtended, isSelected)
If isSelected = False Then
If MouseHandler.IsInRectangle(New Rectangle(Core.windowSize.Width - (AllExtended) + 28, 132 + Index * 96, 48, 48)) = True Then
If MouseHandler.IsInRectangle(New Rectangle(Core.ScreenSize.Width - (AllExtended) + 28, 132 + Index * 96, 48, 48)) = True Then
If IconFading < 255 Then
IconFading += 15
If IconFading > 255 Then
@ -440,7 +439,7 @@
Me.ClickAction(BattleScreen)
End If
If Controls.Accept(True, False, False) = True Then
If MouseHandler.IsInRectangle(New Rectangle(Core.windowSize.Width - 255, 116 + Index * 96, 255, 80)) = True Then
If MouseHandler.IsInRectangle(New Rectangle(Core.ScreenSize.Width - 255, 116 + Index * 96, 255, 80)) = True Then
If isSelected = True Then
SoundManager.PlaySound("select")
Me.ClickAction(BattleScreen)
@ -476,31 +475,27 @@
Dim extraExtended As Integer = 0
If isSelected = True Then
Canvas.DrawGradient(New Rectangle(Core.windowSize.Width - 255, 100 + Index * 96, 255, 112), New Color(42, 167, 198, 0), New Color(42, 167, 198, (SelExtended + AllExtended) - deductAlpha), True, -1)
Canvas.DrawGradient(New Rectangle(Core.ScreenSize.Width - 255, 100 + Index * 96, 255, 112), New Color(42, 167, 198, 0), New Color(42, 167, 198, (SelExtended + AllExtended) - deductAlpha), True, -1)
extraExtended = SelExtended
End If
Dim BackgroundDrawColor As Color = Color.White
If Move.Disabled > 0 OrElse BattleScreen.FieldEffects.OwnEncore > 0 AndAlso BattleScreen.FieldEffects.OwnEncoreMove.ID <> Move.ID Then
BackgroundDrawColor = New Color(210, 210, 210)
End If
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), New Color(BackgroundDrawColor.R, BackgroundDrawColor.G, BackgroundDrawColor.B, 255 - deductAlpha))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), New Color(BackgroundDrawColor.R, BackgroundDrawColor.G, BackgroundDrawColor.B, 255 - deductAlpha))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), New Color(255, 255, 255, 255 - deductAlpha))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), New Color(255, 255, 255, 255 - deductAlpha))
Core.SpriteBatch.Draw(TextureManager.GetTexture(Element.GetElementTexturePath(), Me.Move.Type.GetElementImage(), ""), New Rectangle(Core.windowSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 16), New Color(255, 255, 255, 255 - deductAlpha))
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types", Me.Move.Type.GetElementImage(), ""), New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 16), New Color(255, 255, 255, 255 - deductAlpha))
If isSelected = True Then
If Move.Disabled > 0 OrElse BattleScreen.FieldEffects.OwnEncore > 0 AndAlso BattleScreen.FieldEffects.OwnEncoreMove.ID <> Move.ID Then
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("battle_MoveDisabled", "Disabled!"), New Vector2(CInt(Core.windowSize.Width - (AllExtended + extraExtended) + 28), CInt(152 + Index * 96)), Color.Black)
If Move.Disabled > 0 Then
Core.SpriteBatch.DrawString(FontManager.MainFont, "Disabled!", New Vector2(CInt(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28), CInt(152 + Index * 96)), Color.Black)
Else
Dim ppColor As Color = GetPPColor()
ppColor.A = CByte((extraExtended + AllExtended - deductAlpha).Clamp(0, 255))
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.CurrentPP & "/" & Me.Move.MaxPP, New Vector2(CInt(Core.windowSize.Width - (AllExtended + extraExtended) + 28), CInt(152 + Index * 96)), ppColor)
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.CurrentPP & "/" & Me.Move.MaxPP, New Vector2(CInt(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28), CInt(152 + Index * 96)), ppColor)
End If
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.Name, New Vector2(CInt(Core.windowSize.Width - (AllExtended + extraExtended) + 86), CInt(132 + Index * 96)), New Color(0, 0, 0, (SelExtended + AllExtended) - deductAlpha))
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.Name, New Vector2(CInt(Core.ScreenSize.Width - (AllExtended + extraExtended) + 86), CInt(132 + Index * 96)), New Color(0, 0, 0, (SelExtended + AllExtended) - deductAlpha))
Else
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.Name, New Vector2(Core.windowSize.Width - (AllExtended + extraExtended) + 28, 152 + Index * 96), New Color(0, 0, 0, 255 - (extraExtended + AllExtended) - deductAlpha))
Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Move.Name, New Vector2(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28, 152 + Index * 96), New Color(0, 0, 0, 255 - (extraExtended + AllExtended) - deductAlpha))
End If
End Sub
@ -527,22 +522,19 @@
If Controls.Accept(False, True, True) = True And isSelected = True Then
SoundManager.PlaySound("select")
If Me.Move.Disabled = 0 AndAlso BattleScreen.FieldEffects.OwnEncore = 0 OrElse BattleScreen.FieldEffects.OwnEncoreMove.ID = Move.ID Then
BattleScreen.BattleMenu._moveMenuLastIndex = Me.Index
If Me.Move.Disabled = 0 Then
Me.ClickAction(BattleScreen)
End If
End If
If Controls.Accept(True, False, False) = True Then
If MouseHandler.IsInRectangle(New Rectangle(Core.windowSize.Width - 255, 116 + Index * 96, 255, 80)) = True Then
If MouseHandler.IsInRectangle(New Rectangle(Core.ScreenSize.Width - 255, 116 + Index * 96, 255, 80)) = True Then
If isSelected = True Then
SoundManager.PlaySound("select")
If Me.Move.Disabled = 0 AndAlso BattleScreen.FieldEffects.OwnEncore = 0 OrElse BattleScreen.FieldEffects.OwnEncoreMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnEncoreMove.ID = Move.ID Then
BattleScreen.BattleMenu._moveMenuLastIndex = Me.Index
If Me.Move.Disabled = 0 Then
Me.ClickAction(BattleScreen)
End If
Else
BattleScreen.BattleMenu._moveMenuNextIndex = Me.Index
BattleScreen.BattleMenu._moveMenuLastIndex = Me.Index
BattleScreen.BattleMenu._isRetracting = True
End If
End If
@ -647,7 +639,7 @@
TempBattleScreen = BattleScreen
Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, Localization.GetString("party_screen_ChoosePokemon", "Choose Pokémon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False}
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, "Choose Pokémon", False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False}
AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler
Core.SetScreen(selScreen)
@ -667,26 +659,26 @@
_mainMenuItemList.Clear()
Select Case BattleScreen.BattleMode
Case BattleSystem.BattleScreen.BattleModes.Safari
Dim safariBallText As String = Localization.GetString("item_name_181", "Safari Ball") & " x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(181.ToString) = 0 Then
safariBallText = Localization.GetString("battle_NoSafariBalls", "No Safari Balls.")
safariBallText = "No Safari Balls."
End If
_mainMenuItemList.Add(New MainMenuItem(4, safariBallText, 0, AddressOf MainMenuUseSafariBall))
_mainMenuItemList.Add(New MainMenuItem(0, Localization.GetString("battle_action_ThrowMud", "Throw Mud"), 1, AddressOf MainMenuThrowMud))
_mainMenuItemList.Add(New MainMenuItem(0, Localization.GetString("battle_action_ThrowBait", "Throw Bait"), 2, AddressOf MainMenuThrowBait))
_mainMenuItemList.Add(New MainMenuItem(0, "Throw Mud", 1, AddressOf MainMenuThrowMud))
_mainMenuItemList.Add(New MainMenuItem(0, "Throw Bait", 2, AddressOf MainMenuThrowBait))
_mainMenuItemList.Add(New MainMenuItem(3, Localization.GetString("battle_action_Run", "Run"), 3, AddressOf MainMenuRun))
_mainMenuItemList.Add(New MainMenuItem(3, "Run", 3, AddressOf MainMenuRun))
Case BattleSystem.BattleScreen.BattleModes.BugContest
_mainMenuItemList.Add(New MainMenuItem(0, Localization.GetString("battle_action_Battle", "Battle"), 0, AddressOf MainMenuOpenBattleMenu))
_mainMenuItemList.Add(New MainMenuItem(0, "Battle", 0, AddressOf MainMenuOpenBattleMenu))
Dim sportBallText As String = Localization.GetString("item_name_177", "Sport Ball") & " x" & Core.Player.Inventory.GetItemAmount(177.ToString).ToString()
Dim sportBallText As String = "Sport Ball x" & Core.Player.Inventory.GetItemAmount(177.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(177.ToString) = 0 Then
sportBallText = Localization.GetString("battle_NoSportBalls", "No Sport Balls.")
sportBallText = "No Sport Balls."
End If
_mainMenuItemList.Add(New MainMenuItem(4, sportBallText, 1, AddressOf MainMenuUseSportBall))
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 2, AddressOf MainMenuOpenPokemon))
_mainMenuItemList.Add(New MainMenuItem(3, Localization.GetString("battle_action_Run", "Run"), 3, AddressOf MainMenuRun))
_mainMenuItemList.Add(New MainMenuItem(3, "Run", 3, AddressOf MainMenuRun))
Case BattleSystem.BattleScreen.BattleModes.Standard
If BattleScreen.OwnFaint Then
@ -709,12 +701,12 @@
End If
BattleScreen.OppFaint = False
Else
_mainMenuItemList.Add(New MainMenuItem(0, Localization.GetString("battle_action_Battle", "Battle"), 0, AddressOf MainMenuOpenBattleMenu))
_mainMenuItemList.Add(New MainMenuItem(0, "Battle", 0, AddressOf MainMenuOpenBattleMenu))
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 1, AddressOf MainMenuOpenPokemon))
_mainMenuItemList.Add(New MainMenuItem(2, Localization.GetString("battle_action_Bag", "Bag"), 2, AddressOf MainMenuOpenBag))
_mainMenuItemList.Add(New MainMenuItem(2, "Bag", 2, AddressOf MainMenuOpenBag))
If BattleScreen.IsTrainerBattle = False Then
_mainMenuItemList.Add(New MainMenuItem(3, Localization.GetString("battle_action_Run", "Run"), 3, AddressOf MainMenuRun))
_mainMenuItemList.Add(New MainMenuItem(3, "Run", 3, AddressOf MainMenuRun))
MainMenuAddMegaEvolution(BattleScreen, 4)
Else
MainMenuAddMegaEvolution(BattleScreen, 3)
@ -722,9 +714,9 @@
End If
Case BattleSystem.BattleScreen.BattleModes.PVP
_mainMenuItemList.Add(New MainMenuItem(0, Localization.GetString("battle_action_Battle", "Battle"), 0, AddressOf MainMenuOpenBattleMenu))
_mainMenuItemList.Add(New MainMenuItem(0, "Battle", 0, AddressOf MainMenuOpenBattleMenu))
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 1, AddressOf MainMenuOpenPokemon))
_mainMenuItemList.Add(New MainMenuItem(3, Localization.GetString("battle_action_Surrender", "Surrender"), 2, AddressOf MainMenuOpenBag))
_mainMenuItemList.Add(New MainMenuItem(3, "Surrender", 2, AddressOf MainMenuOpenBag))
End Select
End Sub
@ -758,14 +750,14 @@
If Core.Player.Pokemons(PokeIndex).Item.IsGameModeItem = True Then
If Core.Player.Pokemons(PokeIndex).Item.gmIsMegaStone = True Then
If Core.Player.Pokemons(PokeIndex).Number = CType(Core.Player.Pokemons(PokeIndex).Item, GameModeItem).gmMegaPokemonNumber Then
_mainMenuItemList.Add(New MainMenuItem(5, Localization.GetString("battle_action_MegaEvolve", "Mega Evolve!"), Index, AddressOf MainMenuMegaEvolve))
_mainMenuItemList.Add(New MainMenuItem(5, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve))
End If
End If
Else
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(PokeIndex).Number Then
_mainMenuItemList.Add(New MainMenuItem(5, Localization.GetString("battle_action_MegaEvolve", "Mega Evolve!"), Index, AddressOf MainMenuMegaEvolve))
_mainMenuItemList.Add(New MainMenuItem(5, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve))
End If
End If
End If
@ -781,10 +773,7 @@
_retractMenu = True
_nextMenuState = MenuStates.Moves
PartyScreen.Selected = -1
If _moveMenuIndex <> _moveMenuLastIndex Then
_moveMenuNextIndex = _moveMenuLastIndex
_moveMenuIndex = _moveMenuLastIndex
End If
BattleScreen.BattleQuery.Clear()
Dim q As New CameraQueryObject(New Vector3(11, 0.5F, 14.0F), New Vector3(11, 0.5F, 14.0F), Screen.Camera.Speed, Screen.Camera.Speed, -(CSng(MathHelper.PiOver4) + 0.3F), -(CSng(MathHelper.PiOver4) + 0.3F), -0.3F, -0.3F, 0.04F, 0.04F)
BattleScreen.BattleQuery.AddRange({q})
@ -794,7 +783,7 @@
TempBattleScreen = BattleScreen
Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, Localization.GetString("party_screen_ChoosePokemon", "Choose Pokémon"), True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, "Choose Pokémon", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler
Core.SetScreen(selScreen)
@ -824,32 +813,10 @@
Battle.Won = True
Battle.Fled = True
Else
Dim Trapped As Boolean = False
Dim p As Pokemon = BattleScreen.OwnPokemon
Dim op As Pokemon = BattleScreen.OppPokemon
If op.Ability.Name.ToLower() = "shadow tag" And p.Ability.Name.ToLower() <> "shadow tag" And op.HP > 0 Then
Trapped = True
End If
If op.Ability.Name.ToLower() = "arena trap" And op.HP > 0 And BattleScreen.FieldEffects.IsGrounded(True, BattleScreen) = True Then
Trapped = True
End If
If op.Ability.Name.ToLower() = "magnet pull" And op.HP > 0 Then
If p.Type1.Type = Element.Types.Steel Or p.Type2.Type = Element.Types.Steel Then
Trapped = True
End If
End If
If Trapped = True Then
Screen.TextBox.Show(Localization.GetString("battle_cannot_run_ability", "Failed to run away because of~") & Localization.GetString("ability_name_" & op.Ability.ID.ToString, op.Ability.Name) & ".", {}, True, True)
Else
BattleScreen.BattleQuery.Clear()
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
BattleScreen.Battle.InitializeRound(BattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Text, .Argument = Localization.GetString("battle_cannot_run", "Failed to run away.")})
End If
BattleScreen.BattleQuery.Clear()
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
BattleScreen.Battle.InitializeRound(BattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Text, .Argument = "Failed to run away."})
End If
End Sub
@ -861,11 +828,9 @@
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
Core.SetScreen(New BattleCatchScreen(BattleScreen, Item.GetItemByID(181.ToString)))
Core.Player.UsedItemsToCheckScriptDelayFor.Add("181")
Dim safariBallText As String = Localization.GetString("item_name_181", "Safari Ball") & " x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(181.ToString) = 0 Then
safariBallText = Localization.GetString("battle_NoSafariBalls", "No Safari Balls.")
safariBallText = "No Safari Balls."
End If
_mainMenuItemList(0).Text = safariBallText
End If
@ -944,10 +909,6 @@
_moveMenuItemList.Clear()
BattleScreen.ClearMoveMenuTime = False
End If
If _moveMenuIndex > _moveMenuItemList.Count - 1 Then
_moveMenuIndex = 0
_moveMenuNextIndex = 0
End If
If _moveMenuChoseMove = True Then
_moveMenuAlpha -= 15
@ -955,7 +916,7 @@
_moveMenuAlpha = 0
If BattleScreen.OwnPokemon.Attacks(_moveMenuIndex).SwapsOutOwnPokemon = True Then
If PartyScreen.Selected = -1 Then
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), Nothing, Localization.GetString("party_screen_ChoosePokemon", "Choose Pokémon"), False, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False, .SelectButtonText = Localization.GetString("global_switch", "Switch")}
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), Nothing, "Choose Pokémon", False, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False}
AddHandler selScreen.SelectedObject, Nothing
Core.SetScreen(selScreen)
@ -978,21 +939,11 @@
Else
UseStruggle(BattleScreen)
If _moveMenuItemList.Count = 0 Or _moveMenuCreatedID <> BattleScreen.OwnPokemon.IndividualValue Then
If _moveMenuItemList.Count = 0 Or _moveMenuCreatedID <> BattleScreen.OwnPokemon.IndividualValue Or BattleScreen.IsChoiced Then
If _moveMenuCreatedID <> BattleScreen.OwnPokemon.IndividualValue Then
_moveMenuIndex = 0
End If
CreateMoveMenuItems(BattleScreen)
If _moveMenuIndex <> _moveMenuLastIndex Then
_moveMenuNextIndex = _moveMenuLastIndex
_moveMenuIndex = _moveMenuLastIndex
If _moveMenuIndex > _moveMenuItemList.Count - 1 Then
_moveMenuNextIndex = 0
_moveMenuIndex = 0
_moveMenuLastIndex = 0
End If
End If
_moveMenuCreatedID = BattleScreen.OwnPokemon.IndividualValue
End If
If _retractMenu = False Then
@ -1152,7 +1103,7 @@
If Item.IsBall = True Then
Core.Player.Inventory.RemoveItem(itemID.ToString, 1)
If TempBattleScreen.IsTrainerBattle = False Then
If BattleScreen.CanCatch = True Or CBool(GameModeManager.GetGameRuleValue("OnlyCaptureFirst", "0")) = True And Core.Player.PokeFiles.Contains(BattleScreen.TempPokeFile) = False Then
If BattleScreen.CanCatch = True Or CBool(GameModeManager.GetGameRuleValue("OnlyCaptureFirst", "0")) = True And Core.Player.PokeFiles.Contains(BattleScreen.TempPokeFile) = True Then
TempBattleScreen.BattleQuery.Clear()
TempBattleScreen.BattleQuery.Add(TempBattleScreen.FocusBattle())
TempBattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
@ -1175,7 +1126,7 @@
If Item.BattleSelectPokemon = True Then
'Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item, AddressOf UseItem, "Use " & Item.Name, True))
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item, AddressOf Item.UseOnPokemon, Localization.GetString("global_use", "Use") & " " & Item.OneLineName(), True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item, AddressOf Item.UseOnPokemon, "Use " & Item.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf UseItemHandler
Core.SetScreen(selScreen)

View File

@ -88,9 +88,6 @@
Public Shared BattleMapOffset As New Vector3(0)
Public BackgroundTarget As RenderTarget2D
Public NPCTarget As RenderTarget2D
Public Overrides Function GetScreenStatus() As String
Dim pokemonString As String = "OwnPokemon=OWNEMPTY" & Environment.NewLine &
"OppPokemon=OPPEMPTY"
@ -180,10 +177,6 @@
Me.BattleMenu = New BattleMenu()
BattleMenu.Reset()
BackgroundTarget = New RenderTarget2D(Core.GraphicsDevice, Core.windowSize.Width, Core.windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
NPCTarget = New RenderTarget2D(Core.GraphicsDevice, Core.windowSize.Width, Core.windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
End Sub
Public Sub InitializeWild(ByVal WildPokemon As Pokemon, ByVal OverworldScreen As Screen, ByVal defaultMapType As Integer)
@ -261,12 +254,10 @@
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
Screen.Level.Entities.Add(OppPokemonNPC)
@ -421,12 +412,10 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OppPokemon), 1, OppPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOpp,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
@ -609,6 +598,7 @@
SavedOverworld.SkyDome = Screen.SkyDome
InitializeScreen()
FieldEffects.Weather = BattleWeather.WeatherTypes.Clear
PlayerStatistics.Track("Safari battles", 1)
@ -671,12 +661,10 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
@ -796,12 +784,10 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
@ -952,8 +938,6 @@
#End Region
Public Overrides Sub Draw()
DebugDisplay.MaxVertices = 0
DebugDisplay.MaxVisibleVertices = 0
Dim ForegroundEntities As New List(Of Entity)
@ -1026,6 +1010,7 @@ nextIndexBackground:
cQuery.Reverse()
Dim BackgroundTarget As New RenderTarget2D(Core.GraphicsDevice, Core.windowSize.Width, Core.windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
Core.GraphicsDevice.SetRenderTarget(BackgroundTarget)
GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent)
@ -1034,13 +1019,12 @@ nextIndexBackground:
Next
Core.GraphicsDevice.SetRenderTarget(Nothing)
Dim NPCTarget As New RenderTarget2D(Core.GraphicsDevice, Core.windowSize.Width, Core.windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
Core.GraphicsDevice.SetRenderTarget(NPCTarget)
GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent)
For i = 0 To ForegroundEntities.Count - 1
ForegroundEntities(i).Render()
If ForegroundEntities(i).Visible = True Then
DebugDisplay.MaxVisibleVertices += ForegroundEntities(i).VertexCount
End If
DebugDisplay.MaxVertices += ForegroundEntities(i).VertexCount
Next
@ -1094,8 +1078,6 @@ nextIndexForeground:
If DrawColoredScreen = True Then
Canvas.DrawRectangle(Core.windowSize, Me.ColorOverlay)
End If
ForegroundAnimationList.Clear()
BackgroundAnimationList.Clear()
End Sub
Public Overrides Sub Update()
@ -1298,9 +1280,6 @@ nextIndex:
Else
Core.Player.RoamingPokemonData = RoamingPokemon.ReplaceRoamingPokemon(RoamingPokemonStorage)
End If
If RoamingPokemonStorage.ScriptPath <> "" Then
CType(SavedOverworld.OverworldScreen, OverworldScreen).AfterRoamingBattleScript = RoamingPokemonStorage.ScriptPath
End If
RoamingPokemon.ShiftRoamingPokemon(RoamingPokemonStorage.WorldID)
End If
@ -1356,7 +1335,6 @@ nextIndex:
End If
Dim hasLevelUp As Boolean = False
Dim ItemReturnScript As String = "@Text.Show("
For Each p As Pokemon In Core.Player.Pokemons
If p.hasLeveledUp = True Then
hasLevelUp = True
@ -1370,10 +1348,7 @@ nextIndex:
End If
p.Item.AdditionalData = p.OriginalItem.AdditionalData
If ItemReturnScript <> "" Then
ItemReturnScript &= "*"
End If
ItemReturnScript &= Core.Player.Name & " received~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName & "!"
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing
End If
Else
@ -1386,12 +1361,7 @@ nextIndex:
End If
p.Item.AdditionalData = p.OriginalItem.AdditionalData
If ItemReturnScript <> "" Then
ItemReturnScript &= "*"
End If
ItemReturnScript &= Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName & "!"
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing
Else
If p.OriginalItem.IsGameModeItem = True Then
@ -1399,28 +1369,15 @@ nextIndex:
Else
Core.Player.Inventory.AddItem(p.OriginalItem.ID.ToString, 1)
End If
If ItemReturnScript <> "" Then
ItemReturnScript &= ")" & Environment.NewLine
End If
ItemReturnScript &= "@Sound.Play(item_found)" & Environment.NewLine & "@Text.Show(" & Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
p.OriginalItem = Nothing
End If
End If
End If
End If
p.ResetTemp()
Next
If ItemReturnScript <> "@Text.Show(" Then
ItemReturnScript &= ")"
Dim s As String =
"version=2" & Environment.NewLine &
ItemReturnScript & Environment.NewLine &
":end"
CType(SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.StartScript(s, 2, False)
End If
If hasLevelUp = False Then
Core.SetScreen(New TransitionScreen(Me, SavedOverworld.OverworldScreen, New Color(255, 255, 255), False, AddressOf ChangeSavedScreen))
@ -1461,68 +1418,38 @@ nextIndex:
FieldEffects.OppRageFistPower = 0
Else
Dim ItemReturnScript As String = "@Text.Show("
For Each p As Pokemon In Core.Player.Pokemons
If IsRemoteBattle = True Then
If p.OriginalItem IsNot Nothing Then
If p.OriginalItem.IsGameModeItem = True Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.gmID)
p.Item = P3D.Item.GetItemByID(p.OriginalItem.gmID.ToString)
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
End If
p.Item.AdditionalData = p.OriginalItem.AdditionalData
If ItemReturnScript <> "" Then
ItemReturnScript &= "*"
End If
ItemReturnScript &= Core.Player.Name & " received~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName & "!"
p.OriginalItem = Nothing
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
End If
Else
If Not p.OriginalItem Is Nothing Then
If p.Item Is Nothing Then
If p.OriginalItem.IsGameModeItem = True Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.gmID.ToString)
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
End If
p.Item.AdditionalData = p.OriginalItem.AdditionalData
If ItemReturnScript <> "" Then
ItemReturnScript &= "*"
End If
ItemReturnScript &= Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName & "!"
p.OriginalItem = Nothing
Else
If p.Item IsNot Nothing Then
If p.OriginalItem.IsGameModeItem = True Then
Core.Player.Inventory.AddItem(p.OriginalItem.gmID, 1)
Else
Core.Player.Inventory.AddItem(p.OriginalItem.ID.ToString, 1)
End If
If ItemReturnScript <> "" Then
ItemReturnScript &= ")" & Environment.NewLine
End If
ItemReturnScript &= "@Sound.Play(item_found)" & Environment.NewLine & "@Text.Show(" & Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
p.OriginalItem = Nothing
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing
End If
End If
End If
p.ResetTemp()
Next
If ItemReturnScript <> "@Text.Show(" Then
ItemReturnScript &= ")"
Dim s As String =
"version=2" & Environment.NewLine &
ItemReturnScript & Environment.NewLine &
":end"
CType(SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.StartScript(s, 2, False)
End If
FieldEffects.OwnRageFistPower = 0
FieldEffects.OppRageFistPower = 0
@ -1533,9 +1460,6 @@ nextIndex:
BattleMapOffset = New Vector3(0)
OwnLeadIndex = 0
OppLeadIndex = 0
BackgroundTarget.Dispose()
NPCTarget.Dispose()
End Sub
Public Sub ChangeSavedScreen()

View File

@ -129,9 +129,6 @@
Public OwnFutureSightTurns As Integer = 0 'Turns until Futuresight hits
Public OwnFutureSightID As Integer = 0 'Move ID for the Futuresight move
Public OwnUsedRandomMove As Boolean = False 'Metronome for example
Public OwnUsedMirrorMove As Boolean = False
'Opp stuff
Public OppSpikes As Integer = 0
Public OppStealthRock As Integer = 0
@ -256,9 +253,6 @@
Public OppSandTomb As Integer = 0
Public OppInfestation As Integer = 0
Public OppUsedRandomMove As Boolean = False
Public OppUsedMirrorMove As Boolean = False
Public OppUsedMoves As New List(Of Integer)
'Weather
@ -393,7 +387,7 @@
End If
Else
p = BattleScreen.OppPokemon
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
If p.Type1.Type = Element.Types.Flying Or p.Type2.Type = Element.Types.Flying Or p.Ability.Name.ToLower() = "levitate" And BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen) = True Then
grounded = False
End If
If BattleScreen.FieldEffects.Gravity > 0 Or BattleScreen.FieldEffects.OppSmacked > 0 Or BattleScreen.FieldEffects.OppIngrain > 0 Then

View File

@ -5,47 +5,44 @@ Namespace BattleSystem
Public Class AnimationQueryObject
Inherits QueryObject
Dim AnimationStarted As Boolean = False
Dim AnimationEnded As Boolean = False
Dim BattleFlipped As Boolean = Nothing
Dim AnimationSequence As List(Of BattleAnimation3D)
Dim SpawnedEntities As List(Of Entity)
Dim CurrentEntity As Entity
Public AnimationStarted As Boolean = False
Public AnimationEnded As Boolean = False
Public BattleFlipped As Boolean = Nothing
Public AnimationSequence As List(Of BattleAnimation3D)
Public SpawnedEntities As List(Of Entity)
Public CurrentEntity As Entity
Public StartPosition As New Vector3(0)
Public DrawBeforeEntities As Boolean
Dim Backgrounds As List(Of Entity)
Dim RenderObjects As List(Of Entity)
Public Overrides ReadOnly Property IsReady As Boolean
Get
Return AnimationEnded
End Get
End Property
Public Sub New(ByVal Entity As Entity, ByVal BattleFlipped As Boolean, Optional DrawBeforeEntities As Boolean = False)
Public Sub New(ByVal entity As Entity, ByVal BattleFlipped As Boolean, Optional DrawBeforeEntities As Boolean = False)
MyBase.New(QueryTypes.MoveAnimation)
Me.AnimationSequence = New List(Of BattleAnimation3D)
Me.SpawnedEntities = New List(Of Entity)
Me.DrawBeforeEntities = DrawBeforeEntities
Me.BattleFlipped = BattleFlipped
Me.Backgrounds = New List(Of Entity)
Me.RenderObjects = New List(Of Entity)
If Entity IsNot Nothing Then
Me.CurrentEntity = Entity
If entity IsNot Nothing Then
Me.CurrentEntity = entity
Me.StartPosition = entity.Position
End If
AnimationSequenceBegin()
End Sub
Public Overrides Sub Draw(ByVal BV2Screen As BattleScreen)
Dim Backgrounds As New List(Of Entity)
Dim RenderObjects As New List(Of Entity)
For Each a As BattleAnimation3D In Me.AnimationSequence
If Backgrounds.Contains(a) = False AndAlso a.AnimationType = BattleAnimation3D.AnimationTypes.Background Then
If a.AnimationType = BattleAnimation3D.AnimationTypes.Background Then
Backgrounds.Add(a)
End If
Next
For Each entity As BattleAnimation3D In Me.SpawnedEntities
If RenderObjects.Contains(entity) = False Then
RenderObjects.Add(entity)
End If
RenderObjects.Add(entity)
Next
If RenderObjects.Count > 0 Then
RenderObjects = (From r In RenderObjects Order By r.CameraDistance Descending).ToList()
@ -57,8 +54,6 @@ Namespace BattleSystem
[Object].UpdateModel()
[Object].Render()
Next
RenderObjects.Clear()
Backgrounds.Clear()
End Sub
Public Overrides Sub Update(BV2Screen As BattleScreen)
@ -103,32 +98,23 @@ Namespace BattleSystem
End Sub
Public Sub AnimationSequenceEnd()
SpawnedEntities.Clear()
Backgrounds.Clear()
RenderObjects.Clear()
AnimationEnded = True
End Sub
Public Function SpawnEntity(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal Opacity As Single, Optional ByVal startDelay As Single = 0.0F, Optional ByVal endDelay As Single = 0.0F, Optional ModelPath As String = "") As Entity
Dim NewPosition As Vector3
If Not Position = Nothing Then
If BattleFlipped = True Then
Position.X *= -1
End If
If CurrentEntity IsNot Nothing Then
If BattleFlipped = True Then
Position.X *= -1
End If
NewPosition = CurrentEntity.Position + Position
If CurrentEntity.Model IsNot Nothing Then
NewPosition.Y += 0.5F
End If
Else
NewPosition = Position
End If
Else
If CurrentEntity IsNot Nothing Then
NewPosition = CurrentEntity.Position
If CurrentEntity.Model IsNot Nothing Then
NewPosition.Y += 0.5F
End If
Else
NewPosition = New Vector3(0, 0, 0)
End If
@ -198,11 +184,12 @@ Namespace BattleSystem
Destination = CurrentEntity.Position + New Vector3(DestinationX, DestinationY, DestinationZ)
End If
Dim baEntityMove As BAEntityMove = New BAEntityMove(MoveEntity, RemoveEntityAfter, Destination, Speed, SpinX, SpinZ, startDelay, endDelay, SpinXSpeed, SpinZSpeed, MovementCurve, MoveYSpeed)
AnimationSequence.Add(baEntityMove)
End Sub
Public Sub AnimationOscillateMove(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Distance As Vector3, ByVal Speed As Single, ByVal BothWays As Boolean, ByVal Duration As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional MovementCurve As Integer = 0, Optional ReturnToStart As Vector3 = Nothing)
Public Sub AnimationOscillateMove(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Distance As Vector3, ByVal Speed As Single, ByVal BothWays As Boolean, ByVal Duration As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional MovementCurve As Integer = 0, Optional ReturnToStart As Vector3 = Nothing)
Dim MoveEntity As Entity
Dim ReturnPosition As New Vector3(0)
@ -314,7 +301,7 @@ Namespace BattleSystem
AnimationSequence.Add(BAEntityFaceRotate)
End Sub
Public Sub AnimationScale(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Grow As Boolean, ByVal EndSizeX As Single, ByVal EndSizeY As Single, ByVal EndSizeZ As Single, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal Anchors As String = "", Optional SpeedMultiplier As Vector3 = Nothing)
Public Sub AnimationScale(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Grow As Boolean, ByVal EndSizeX As Single, ByVal EndSizeY As Single, ByVal EndSizeZ As Single, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal Anchors As String = "")
Dim ScaleEntity As Entity
If Entity Is Nothing Then
ScaleEntity = CurrentEntity
@ -330,7 +317,7 @@ Namespace BattleSystem
Dim Scale As Vector3 = ScaleEntity.Scale
Dim EndSize As Vector3 = New Vector3(EndSizeX, EndSizeY, EndSizeZ)
Dim baEntityScale As BAEntityScale = New BAEntityScale(ScaleEntity, RemoveEntityAfter, Scale, Grow, EndSize, SizeSpeed, startDelay, endDelay, Anchors, SpeedMultiplier)
Dim baEntityScale As BAEntityScale = New BAEntityScale(ScaleEntity, RemoveEntityAfter, Scale, Grow, EndSize, SizeSpeed, startDelay, endDelay, Anchors)
AnimationSequence.Add(baEntityScale)
End Sub

View File

@ -60,11 +60,11 @@
If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then
Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, Localization.GetString("global_ok", "OK"))
d.Add(Buttons.A, "OK")
BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40))
Else
If TextReady = True Then
Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_ok", "OK"), New Vector2(rec.X + rec.Width - FontManager.InGameFont.MeasureString(Localization.GetString("global_ok", "OK")).X - 20, rec.Y + rec.Height - FontManager.InGameFont.MeasureString(Localization.GetString("global_ok", "OK")).Y - 5), Color.White)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "OK", New Vector2(rec.X + rec.Width - FontManager.InGameFont.MeasureString("OK").X - 20, rec.Y + rec.Height - FontManager.InGameFont.MeasureString("OK").Y - 5), Color.White)
End If
End If
End Sub
@ -96,8 +96,7 @@
Else
SoundManager.PlaySound("select")
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
FinishOppSwitchEffects(TempScreen)
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -117,8 +116,7 @@
Else
SoundManager.PlaySound("select")
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
FinishOppSwitchEffects(TempScreen)
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -140,8 +138,7 @@
_chooseIndex = 1
SoundManager.PlaySound("select")
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
FinishOppSwitchEffects(TempScreen)
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -155,8 +152,7 @@
If Controls.Dismiss(True, True, True) = True Then
SoundManager.PlaySound("select")
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
FinishOppSwitchEffects(TempScreen)
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -208,9 +204,9 @@
TempScreen.OppFaint = False
TempScreen.OwnStatistics.Switches += 1
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, -1)
FinishOppSwitchEffects(TempScreen)
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, TempScreen.BattleQuery.Count)
TempScreen.BattleQuery.Reverse()
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -219,9 +215,9 @@
TempScreen.Battle.StartRound(TempScreen)
Else
TempScreen.BattleQuery.Clear()
FinishOppSwitchAnimation(TempScreen)
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, -1)
FinishOppSwitchEffects(TempScreen)
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, TempScreen.BattleQuery.Count)
TempScreen.BattleQuery.Reverse()
FinishOppSwitch(TempScreen)
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
cq2.PassThis = True
@ -252,7 +248,7 @@
Dim delay As Single = 2.0F
Public Sub FinishOppSwitchAnimation(BattleScreen As BattleScreen)
Public Sub FinishOppSwitch(BattleScreen As BattleScreen)
BattleScreen.OppPokemonNPC.Position.Y = 0 + BattleScreen.BattleMapOffset.Y
BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen)
Dim oppModel As String = BattleScreen.GetModelName(False)
@ -305,9 +301,6 @@
End If
BattleScreen.BattleQuery.Add(BallThrow)
End Sub
Public Sub FinishOppSwitchEffects(BattleScreen As BattleScreen)
With BattleScreen
Dim p As Pokemon = .OppPokemon
Dim op As Pokemon = .OwnPokemon

View File

@ -29,7 +29,6 @@
Me._text = Me._text.Replace("~", " ")
Me._text = Me._text.Replace("<player.name>", Core.Player.Name)
Me._text = Me._text.Replace("<playername>", Core.Player.Name)
Me._text = Me._text.Replace("<rival.name>", Core.Player.RivalName)
Me._text = Me._text.Replace("<rivalname>", Core.Player.RivalName)
Me._text = Me._text.Replace("[POKE]", "Poké")
@ -80,11 +79,11 @@
If GamePad.GetState(PlayerIndex.One).IsConnected = True And Core.GameOptions.GamePadEnabled = True And BV2Screen.IsCurrentScreen() = True Then
Dim d As New Dictionary(Of Buttons, String)
d.Add(Buttons.A, Localization.GetString("global_ok", "OK"))
d.Add(Buttons.A, "OK")
BV2Screen.DrawGamePadControls(d, New Vector2(rec.X + rec.Width - 100, rec.Y + rec.Height - 40))
Else
If TextReady = True Then
Core.SpriteBatch.DrawString(FontManager.TextFont, Localization.GetString("global_ok", "OK"), New Vector2(rec.X + rec.Width - (FontManager.TextFont.MeasureString(Localization.GetString("global_ok", "OK")).X * 2.0F) - 20, rec.Y + rec.Height - (FontManager.TextFont.MeasureString(Localization.GetString("global_ok", "OK")).Y * 2.0F) - 5), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
Core.SpriteBatch.DrawString(FontManager.TextFont, "OK", New Vector2(rec.X + rec.Width - (FontManager.TextFont.MeasureString("OK").X * 2.0F) - 20, rec.Y + rec.Height - (FontManager.TextFont.MeasureString("OK").Y * 2.0F) - 5), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
End If
End If
End Sub

View File

@ -112,13 +112,11 @@
Case 2
Select Case Me._entity
Case BattleEntities.OwnPokemon
BV2Screen.OwnPokemonNPC.Scale = New Vector3(BV2Screen.OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
BV2Screen.OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(BV2Screen.OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
BV2Screen.OwnPokemonNPC.Scale = New Vector3(BV2Screen.OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
BV2Screen.OwnPokemonNPC.ModelPath = _newTexture
BV2Screen.OwnPokemonNPC.Model = ModelManager.GetModel(BV2Screen.OwnPokemonNPC.ModelPath)
Case BattleEntities.OppPokemon
BV2Screen.OppPokemonNPC.Scale = New Vector3(BV2Screen.OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
BV2Screen.OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(BV2Screen.OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
BV2Screen.OppPokemonNPC.Scale = New Vector3(BV2Screen.OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
BV2Screen.OppPokemonNPC.ModelPath = _newTexture
BV2Screen.OppPokemonNPC.Model = ModelManager.GetModel(BV2Screen.OppPokemonNPC.ModelPath)
End Select

View File

@ -5,15 +5,15 @@ Namespace BattleSystem
Public Class TrainerAI
'Trainer AI Levels:---------------------------------------------------------------------------------------------------------------------
'Normal Trainers: 0-1 (0 being not very smart trainers like Bugcatchers, 1 being Cooltrainers, get higher levels when rematches occur)
'(Johto) Gym Leaders: 0-2 (0 for Falkner, 2 for Clair)
'(Kanto) Gym Leaders: All 2
'Elite 4: 2
'Lance: 2
'Elder Li: 0
'Rival: 2
'Team Rocket Grunts: 0
'Team Rocket Admins: 1
'Normal Trainers: 0-20 (0 being not very smart trainers like Bugcatchers, 20 being Cooltrainers, get higher levels when rematches occur)
'(Johto) Gym Leaders: 10-40 (10 for Falkner, 40 for Clair)
'(Kanto) Gym Leaders: All 60
'Elite 4: 60
'Lance: 100
'Elder Li: 10
'Rival: 40
'Team Rocket Grunts: 5
'Team Rocket Admins: 20
Public Shared Function GetAIMove(ByVal BattleScreen As BattleScreen, ByVal OwnStep As Battle.RoundConst) As Battle.RoundConst
Dim p As Pokemon = BattleScreen.OppPokemon
@ -123,8 +123,8 @@ Namespace BattleSystem
'-------------------------------------Random move depending on difficulty---------------------------------------------------------'
'Only applies if trainer has an AI level of 0:
If BattleScreen.Trainer.AILevel <= 0 Then
'Only applies if trainer has an AI level below 20:
If BattleScreen.Trainer.AILevel < 20 Then
Dim AvailableAttacks As List(Of Integer) = New List(Of Integer)
For i = 0 To m.Count - 1
AvailableAttacks.Add(i)
@ -143,143 +143,150 @@ Namespace BattleSystem
Ready = True
End If
End While
'Chance of 35% that the trainer is using a random move:
If Core.Random.Next(0, 100) < 35 Then
Return ProduceOppStep(m, OppAttackChoice)
If Core.Player.DifficultyMode = 0 Then
'Chance of 35% that the trainer is using a random move:
If Core.Random.Next(0, 100) < 35 Then
Return ProduceOppStep(m, OppAttackChoice)
End If
ElseIf Core.Player.DifficultyMode = 1 Then
'Chance of 18% that the trainer is using a random move:
If Core.Random.Next(0, 100) < 18 Then
Return ProduceOppStep(m, OppAttackChoice)
End If
End If
End If
'-------------------------------------Switching-----------------------------------------------------------------------------------'
'Only applies if trainer has an AI level above or equal to 2:
If BattleScreen.Trainer.AILevel >= 2 Then
If BattleCalculation.CanSwitch(BattleScreen, False) = True Then
If BattleScreen.Trainer.Pokemons.Count > 0 Then
Dim living As Integer = 0
For Each cP As Pokemon In BattleScreen.Trainer.Pokemons
If cP.HP > 0 And cP.Status <> Pokemon.StatusProblems.Fainted Then
living += 1
End If
Next
If living > 1 Then
'check for opponent moves: if super effective: 1.5x: 25%, 2x: 50%, 4x: 75%: check for pokemon in party that reacts to every move with less the detected effectiveness
Dim maxOpponentEff As Single = 0.0F
For Each Attack As BattleSystem.Attack In op.Attacks
Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, op, p, True)
If effectiveness > maxOpponentEff Then
maxOpponentEff = effectiveness
End If
Next
If maxOpponentEff > 1.0F Then
Dim chance As Integer = 0
'Only applies if trainer has an AI level above or equal 40:
'If BattleScreen.Trainer.AILevel >= 40 Then
' If BattleCalculation.CanSwitch(BattleScreen, False) = True Then
' If BattleScreen.Trainer.Pokemons.Count > 0 Then
' Dim living As Integer = 0
' For Each cP As Pokemon In BattleScreen.Trainer.Pokemons
' If cP.HP > 0 And cP.Status <> Pokemon.StatusProblems.Fainted Then
' living += 1
' End If
' Next
' If living > 1 Then
' 'check for opponent moves: if super effective: 1.5x: 25%, 2x: 50%, 4x: 75%: check for pokemon in party that reacts to every move with less the detected effectiveness
' Dim maxOpponentEff As Single = 0.0F
' For Each Attack As BattleSystem.Attack In op.Attacks
' Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, op, p, True)
' If effectiveness > maxOpponentEff Then
' maxOpponentEff = effectiveness
' End If
' Next
' If maxOpponentEff > 1.0F Then
' Dim chance As Integer = 0
Select Case maxOpponentEff
Case 1.25F
chance = 10
Case 1.5F
chance = 25
Case 2.0F
chance = 35
Case 4.0F
chance = 50
End Select
' Select Case maxOpponentEff
' Case 1.25F
' chance = 10
' Case 1.5F
' chance = 25
' Case 2.0F
' chance = 35
' Case 4.0F
' chance = 50
' End Select
If RPercent(chance) = True Then
Dim lessTeamPs As New List(Of Integer)
' If RPercent(chance) = True Then
' Dim lessTeamPs As New List(Of Integer)
For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
If i <> BattleScreen.OppPokemonIndex Then
Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted Then
Dim alwaysLess As Boolean = True
For Each Attack As BattleSystem.Attack In op.Attacks
Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, op, TeamP, True)
' For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
' If i <> BattleScreen.OppPokemonIndex Then
' Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
' If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted Then
' Dim alwaysLess As Boolean = True
' For Each Attack As BattleSystem.Attack In op.Attacks
' Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, op, TeamP, True)
If effectiveness >= maxOpponentEff Then
alwaysLess = False
Exit For
End If
Next
If alwaysLess = True Then
lessTeamPs.Add(i)
End If
End If
End If
Next
' If effectiveness >= maxOpponentEff Then
' alwaysLess = False
' Exit For
' End If
' Next
' If alwaysLess = True Then
' lessTeamPs.Add(i)
' End If
' End If
' End If
' Next
If lessTeamPs.Count > 0 Then
Return ProduceOppStep(lessTeamPs(Core.Random.Next(0, lessTeamPs.Count)))
End If
End If
End If
' If lessTeamPs.Count > 0 Then
' Return ProduceOppStep(lessTeamPs(Core.Random.Next(0, lessTeamPs.Count)))
' End If
' End If
' End If
'check for own moves: if only 0x: check for other pokemon in party (best fitting) and switch in
Dim only0 As Boolean = True
For Each Attack As BattleSystem.Attack In p.Attacks
Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, p, op, False)
If effectiveness <> 0.0F Then
only0 = False
Exit For
End If
Next
If only0 = True Then
Dim switchList As New List(Of Integer)
For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
If i <> BattleScreen.OppPokemonIndex Then
Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted Then
switchList.Add(i)
End If
End If
Next
If switchList.Count > 0 Then
Return ProduceOppStep(switchList(Core.Random.Next(0, switchList.Count)))
End If
End If
' 'check for own moves: if only 0x: check for other pokemon in party (best fitting) and switch in
' Dim only0 As Boolean = True
' For Each Attack As BattleSystem.Attack In p.Attacks
' Dim effectiveness As Single = BattleCalculation.CalculateEffectiveness(Attack.GetAttackByID(Attack.ID), BattleScreen, p, op, False)
' If effectiveness <> 0.0F Then
' only0 = False
' Exit For
' End If
' Next
' If only0 = True Then
' Dim switchList As New List(Of Integer)
' For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
' If i <> BattleScreen.OppPokemonIndex Then
' Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
' If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted Then
' switchList.Add(i)
' End If
' End If
' Next
' If switchList.Count > 0 Then
' Return ProduceOppStep(switchList(Core.Random.Next(0, switchList.Count)))
' End If
' End If
'own pokemon got cursed: 75%
If BattleScreen.FieldEffects.OppCurse > 0 Then
If RPercent(75) = True Then
Dim newSwitchIndex As Integer = 0
Dim canSwitchTo As New List(Of Integer)
For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted And i <> BattleScreen.OppPokemonIndex Then
canSwitchTo.Add(i)
End If
Next
' 'own pokemon got cursed: 75%
' If BattleScreen.FieldEffects.OppCurse > 0 Then
' If RPercent(75) = True Then
' Dim newSwitchIndex As Integer = 0
' Dim canSwitchTo As New List(Of Integer)
' For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
' Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
' If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted And i <> BattleScreen.OppPokemonIndex Then
' canSwitchTo.Add(i)
' End If
' Next
If canSwitchTo.Count > 0 Then
newSwitchIndex = canSwitchTo(Core.Random.Next(0, canSwitchTo.Count))
' If canSwitchTo.Count > 0 Then
' newSwitchIndex = canSwitchTo(Core.Random.Next(0, canSwitchTo.Count))
Return ProduceOppStep(newSwitchIndex)
End If
End If
End If
' Return ProduceOppStep(newSwitchIndex)
' End If
' End If
' End If
'own pokemon got confused: 50%
If p.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True Then
If RPercent(50) = True Then
Dim newSwitchIndex As Integer = 0
Dim canSwitchTo As New List(Of Integer)
For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted And i <> BattleScreen.OppPokemonIndex Then
canSwitchTo.Add(i)
End If
Next
' 'own pokemon got confused: 50%
' If p.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True Then
' If RPercent(50) = True Then
' Dim newSwitchIndex As Integer = 0
' Dim canSwitchTo As New List(Of Integer)
' For i = 0 To BattleScreen.Trainer.Pokemons.Count - 1
' Dim TeamP As Pokemon = BattleScreen.Trainer.Pokemons(i)
' If TeamP.HP > 0 And TeamP.Status <> Pokemon.StatusProblems.Fainted And i <> BattleScreen.OppPokemonIndex Then
' canSwitchTo.Add(i)
' End If
' Next
If canSwitchTo.Count > 0 Then
newSwitchIndex = canSwitchTo(Core.Random.Next(0, canSwitchTo.Count))
' If canSwitchTo.Count > 0 Then
' newSwitchIndex = canSwitchTo(Core.Random.Next(0, canSwitchTo.Count))
Return ProduceOppStep(newSwitchIndex)
End If
End If
End If
End If
End If
End If
End If
' Return ProduceOppStep(newSwitchIndex)
' End If
' End If
' End If
' End If
' End If
' End If
'End If
'-------------------------------------Items---------------------------------------------------------------------------------------'

View File

@ -23,7 +23,7 @@ Public Class Trainer
Public VSImageOrigin As String = "VSIntro"
Public VSImagePosition As Vector2 = New Vector2(0, 0)
Public VSImageSize As Size = New Size(64, 64)
Public VSImageSize As Size = New Size(61, 54)
Public BarImagePosition As Vector2 = New Vector2(0, 0)
Public OutroMessage As String = "TRAINER_DEFAULT_MESSAGE"
@ -212,29 +212,22 @@ Public Class Trainer
If PokeData.StartsWith("{") = True And PokeData.EndsWith("}") = True Then
Dim p As Pokemon = Pokemon.GetPokemonByData(PokeData)
Dim level As Integer = p.Level
If Core.Player.DifficultyMode > 0 Then
Dim level As Integer = p.Level
Dim addLevel As Integer = 0
If Core.Player.DifficultyMode = 0 Then
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.0").InsertDecSeparator) - level))
ElseIf Core.Player.DifficultyMode = 1 Then
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.1").InsertDecSeparator) - level))
ElseIf Core.Player.DifficultyMode = 2 Then
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2").InsertDecSeparator) - level))
End If
Dim addLevel As Integer = 0
If Core.Player.DifficultyMode = 1 Then
addLevel = CInt(Math.Ceiling(level / 10))
ElseIf Core.Player.DifficultyMode = 2 Then
addLevel = CInt(Math.Ceiling(level / 5))
End If
If level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - level
While level + addLevel > p.Level
p.LevelUp(False)
p.Experience = p.NeedExperience(p.Level)
End While
p.HP = p.MaxHP
End If
If addLevel <= 0 Then
addLevel = 0
End If
While level + addLevel > p.Level
p.LevelUp(False)
p.Experience = p.NeedExperience(p.Level)
End While
p.HP = p.MaxHP
Pokemons.Add(p)
Else
@ -278,20 +271,11 @@ Public Class Trainer
End If
Dim addLevel As Integer = 0
If Core.Player.DifficultyMode = 0 Then
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.0").InsertDecSeparator) - Level))
ElseIf Core.Player.DifficultyMode = 1 Then
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.1").InsertDecSeparator) - Level))
If Core.Player.DifficultyMode = 1 Then
addLevel = CInt(Math.Ceiling(Level / 10))
ElseIf Core.Player.DifficultyMode = 2 Then
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2").InsertDecSeparator) - Level))
addLevel = CInt(Math.Ceiling(Level / 5))
End If
If Level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - Level
End If
If addLevel <= 0 Then
addLevel = 0
End If
Level += addLevel
Dim maxLevel As Integer = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100"))
@ -348,25 +332,25 @@ Public Class Trainer
Me.VSImagePosition = New Vector2(0, 0)
Case "orange", "1"
Me.VSImagePosition = New Vector2(1, 0)
Case "lightgreen", "2"
Case "green", "2"
Me.VSImagePosition = New Vector2(0, 1)
Case "gray", "3"
Case "3"
Me.VSImagePosition = New Vector2(1, 1)
Case "violet", "4"
Case "4"
Me.VSImagePosition = New Vector2(0, 2)
Case "green", "5"
Case "5"
Me.VSImagePosition = New Vector2(1, 2)
Case "yellow", "6"
Case "6"
Me.VSImagePosition = New Vector2(0, 3)
Case "brown", "7"
Case "7"
Me.VSImagePosition = New Vector2(1, 3)
Case "lightblue", "8"
Case "8"
Me.VSImagePosition = New Vector2(0, 4)
Case "lightgray", "9"
Case "9"
Me.VSImagePosition = New Vector2(1, 4)
Case "red", "10"
Me.VSImagePosition = New Vector2(0, 5)
Case "empty", "11"
Case "11"
Me.VSImagePosition = New Vector2(1, 5)
Case "battlefrontier"
Me.VSImagePosition = New Vector2(0, 0)
@ -408,7 +392,7 @@ Public Class Trainer
Me.BarImagePosition = New Vector2(1, 4)
Case "red", "10"
Me.BarImagePosition = New Vector2(0, 5)
Case "empty", "11"
Case "11"
Me.BarImagePosition = New Vector2(1, 5)
Case Else
If StringHelper.IsNumeric(barType) = True Then

Binary file not shown.

View File

@ -5,9 +5,6 @@ version=2
:else
@battle.wild(494,70,0,,12)
:endif
:if:<battle.caught>=true
@register.register(caughtvictini)
:endif
@register.register(battlevictini)
@npc.register(liberty\room.dat|0|remove|0)
@npc.remove(0)

View File

@ -4,7 +4,7 @@ version=2
:endif
:if:<register.registered(postblueoak)>=false <and> <player.badges>=16
@text.show(Hello, you are beginning~to hold the air of~a great Champion,~<player.name>.*It is time for your~Pokédex to match~who you are.*Let me see your~Pokédex for a moment.*I will upgrade your~Pokédex with the~National Mode.)
@text.show(Hello, you are begining~to hold the air of~a great Champion,~<player.name>.*It is time for your~Pokédex to match~who you are.*Let me see your~Pokédex for a moment.*I will upgrade your~Pokédex with the~National Mode.)
@sound.play(success,1)
@text.color(playercolor)
@text.show(<player.name> received~the National Pokédex!)
@ -43,14 +43,6 @@ version=2
:end
:endif
:if:<Register.Registered(pokedex_sevii)>=true <and> <Register.Registered(ReceivedCatchingCharm)>=false
@Text.show(Oh, by the way, my Aide~was supposed to give you~this, but I suppose he~forgot to do so.*Here you go!)
@Item.Give(657,1)
@Item.MessageGive(657,1)
@Register.Register(ReceivedCatchingCharm)
@text.show(Having this charm on you~increases the chance to~get a critical catch and~thus your odds of~catching a Pokémon.)
:endif
#This sets a flag for the evaldist script so that it knows where the call came from:
@storage.set(str,pallet_oak_scriptcaller,flag)
@script.start(pallet\evaldist)

View File

@ -33,7 +33,7 @@ version=2
:if:<system.scripttrigger>=phonereceiving
@text.notification(Day-Care Man*Receiving call.......,500,5,5,phone,phone\012)
:else
@text.show(Hello <player.name>!*We were raising your~Pokémon, and my goodness,~we were surprised!*Your Pokémon was holding~an Egg!*We don't know how it~got there, but your~Pokémon had it.*If you want to have it~visit us on Four Island.)
@text.show(Hello <player.name>!*We were raising your~Pokémon, and my goodness,~we were surprised!*Your Pokémon was holding~an Egg!*We don't know how it~got there, but your~Pokémon had it.*If you want to have it~visit us on Route 34.)
:endif
:endif

Some files were not shown because too many files have changed in this diff Show More