Implemented Exp. Charm

This commit is contained in:
JappaWakka 2024-08-24 15:31:51 +02:00
parent 90b13caf94
commit 1c3e30d59e
5 changed files with 63 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

@ -28925,6 +28925,7 @@
<Compile Include="Pokemon\Items\KeyItems\LightStone.vb" /> <Compile Include="Pokemon\Items\KeyItems\LightStone.vb" />
<Compile Include="Pokemon\Items\KeyItems\DarkStone.vb" /> <Compile Include="Pokemon\Items\KeyItems\DarkStone.vb" />
<Compile Include="Pokemon\Items\KeyItems\LibertySeaMap.vb" /> <Compile Include="Pokemon\Items\KeyItems\LibertySeaMap.vb" />
<Compile Include="Pokemon\Items\KeyItems\ExpCharm.vb" />
<Compile Include="Pokemon\Items\KeyItems\SeaPlaneTicket.vb" /> <Compile Include="Pokemon\Items\KeyItems\SeaPlaneTicket.vb" />
<Compile Include="Pokemon\Items\Machines\TM171.vb" /> <Compile Include="Pokemon\Items\Machines\TM171.vb" />
<Compile Include="Pokemon\Items\Machines\TM172.vb" /> <Compile Include="Pokemon\Items\Machines\TM172.vb" />

View File

@ -0,0 +1,16 @@
Namespace Items.KeyItems
<Item(656, "Exp. Charm")>
Public Class ExpCharm
Inherits KeyItem
Public Overrides ReadOnly Property Description As String = "Having one of these charms increases the Exp. Points your Pokémon get. It's a strange, stretchy charm that encourages growth."
Public Sub New()
_textureRectangle = New Rectangle(456, 408, 24, 24)
End Sub
End Class
End Namespace

Binary file not shown.

View File

@ -8,6 +8,7 @@
Dim AnimationIndex As Integer = 0 Dim AnimationIndex As Integer = 0
Dim InBall As Boolean = False Dim InBall As Boolean = False
Dim CriticalCapture As Boolean = False
Dim textboxStart As Boolean = False Dim textboxStart As Boolean = False
Dim showPokedexEntry As Boolean = False Dim showPokedexEntry As Boolean = False
@ -137,6 +138,15 @@ nextIndex:
Dim Shakes As List(Of Boolean) = New List(Of Boolean) Dim Shakes As List(Of Boolean) = New List(Of Boolean)
For i = 0 To 3 For i = 0 To 3
If StayInBall() = True Then If StayInBall() = True Then
If CriticalCapture = True Then
Select Case i
Case 0
Shakes.Add(False)
Case 1
InBall = True
Exit For
End Select
Else
Select Case i Select Case i
Case 0 Case 0
Shakes.Add(False) Shakes.Add(False)
@ -147,6 +157,7 @@ nextIndex:
Case 3 Case 3
InBall = True InBall = True
End Select End Select
End If
Else Else
Exit For Exit For
InBall = False InBall = False
@ -480,6 +491,31 @@ nextIndex:
CaptureRate = 1 CaptureRate = 1
End If End If
Dim CriticalMultiplier As Single = CaptureRate
Select Case P3D.Pokedex.CountEntries(Core.Player.PokedexData, {2, 3})
Case 0 To 30
CriticalMultiplier *= 0.0F
Case 31 To 150
CriticalMultiplier *= 0.5F
Case 151 To 300
CriticalMultiplier *= 1.0F
Case 301 To 450
CriticalMultiplier *= 1.5F
Case 451 To 600
CriticalMultiplier *= 2.0F
Case Else 'Larger than 600
CriticalMultiplier *= 2.5F
End Select
If Core.Player.Inventory.GetItemAmount(656.ToString) > 0 Then 'Exp. Charm
CriticalMultiplier *= 2.0F
End If
Dim CriticalCaptureChance As Integer = CInt(Math.Floor(CriticalMultiplier / 6))
Dim CriticalCheck As Integer = Core.Random.Next(0, 255 + 1)
If CriticalCheck < CriticalCaptureChance Then
CriticalCapture = True
End If
Dim B As Integer = CInt(1048560 / Math.Sqrt(Math.Sqrt(16711680 / CaptureRate))) Dim B As Integer = CInt(1048560 / Math.Sqrt(Math.Sqrt(16711680 / CaptureRate)))
Dim R As Integer = Core.Random.Next(0, 65535 + 1) Dim R As Integer = Core.Random.Next(0, 65535 + 1)