mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-09-25 19:09:00 +02:00
Implemented Cud Chew Ability
This commit is contained in:
parent
9cb12a4130
commit
034fa14393
@ -4927,6 +4927,59 @@
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub UseEffectBerry(ByVal own As Boolean, ByVal from As Boolean, ByVal BerryItem As Item, ByVal BattleScreen As BattleScreen, ByVal message As String, ByVal cause As String)
|
||||
Dim p As Pokemon = BattleScreen.OwnPokemon
|
||||
Dim op As Pokemon = BattleScreen.OppPokemon
|
||||
If own = False Then
|
||||
p = BattleScreen.OppPokemon
|
||||
op = BattleScreen.OwnPokemon
|
||||
End If
|
||||
|
||||
Select Case BerryItem.Name.ToLower()
|
||||
Case "lum"
|
||||
If p.Status = Pokemon.StatusProblems.Burn Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Lum Berry cured the burn of " & p.GetDisplayName() & "!", "berry:lum")
|
||||
End If
|
||||
|
||||
If p.Status = Pokemon.StatusProblems.Freeze Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Lum Berry thraw out " & p.GetDisplayName() & "!", "berry:lum")
|
||||
End If
|
||||
|
||||
If p.Status = Pokemon.StatusProblems.Paralyzed Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Lum Berry cured the paralysis of " & p.GetDisplayName() & "!", "berry:lum")
|
||||
End If
|
||||
|
||||
If p.Status = Pokemon.StatusProblems.Sleep Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Lum Berry woke up " & p.GetDisplayName() & "!", "berry:lum")
|
||||
End If
|
||||
Case "rawst"
|
||||
If p.Status = Pokemon.StatusProblems.Burn Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Rawst Berry cured the burn of " & p.GetDisplayName() & "!", "berry:rawst")
|
||||
End If
|
||||
Case "aspear"
|
||||
If p.Status = Pokemon.StatusProblems.Freeze Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Aspear Berry thraw out " & p.GetDisplayName() & "!", "berry:aspear")
|
||||
End If
|
||||
Case "cheri"
|
||||
If p.Status = Pokemon.StatusProblems.Paralyzed Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Cheri Berry cured the paralysis of " & p.GetDisplayName() & "!", "berry:cheri")
|
||||
End If
|
||||
Case "chesto"
|
||||
If p.Status = Pokemon.StatusProblems.Sleep Then
|
||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("single_heal", False))
|
||||
CureStatusProblem(own, own, BattleScreen, "The Chesto Berry woke up " & p.GetDisplayName() & "!", "berry:chesto")
|
||||
End If
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub UseBerry(ByVal own As Boolean, ByVal from As Boolean, ByVal BerryItem As Item, ByVal BattleScreen As BattleScreen, ByVal message As String, ByVal cause As String)
|
||||
Dim p As Pokemon = BattleScreen.OwnPokemon
|
||||
Dim op As Pokemon = BattleScreen.OppPokemon
|
||||
@ -5056,6 +5109,21 @@
|
||||
Dim ItemID As Integer = p.Item.ID
|
||||
Dim lostItem As Item = Item.GetItemByID(ItemID.ToString)
|
||||
|
||||
Dim CudChewBerries As String() = {"oran", "sitrus", "figy", "wiki", "mago", "aguav", "iapapa", "liechi", "ganlon", "salac", "petaya", "apicot", "lansat", "starf", "lum", "rawst", "aspear", "cheri", "chesto"}
|
||||
If CudChewBerries.Contains(lostItem.Name.ToLower) Then
|
||||
If lostItem.IsBerry = True Then
|
||||
If p.Ability.Name.ToLower() = "cud chew" Then
|
||||
If own = True Then
|
||||
BattleScreen.FieldEffects.OwnCudChewBerry = lostItem
|
||||
BattleScreen.FieldEffects.OwnCudChewIndex = BattleScreen.OwnPokemonIndex
|
||||
Else
|
||||
BattleScreen.FieldEffects.OppCudChewBerry = lostItem
|
||||
BattleScreen.FieldEffects.OppCudChewIndex = BattleScreen.OppPokemonIndex
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If from = own Then
|
||||
If own = True Then
|
||||
BattleScreen.FieldEffects.OwnConsumedItem = lostItem
|
||||
@ -6615,6 +6683,18 @@
|
||||
End If
|
||||
End If
|
||||
|
||||
If .FieldEffects.OwnCudChewIndex <> -1 AndAlso .FieldEffects.OwnCudChewBerry IsNot Nothing Then
|
||||
.BattleQuery.Add(New TextQueryObject(.OwnPokemon.GetDisplayName() & " regurgitated the " & .FieldEffects.OwnCudChewBerry.Name & " Berry due to Cud Chew!"))
|
||||
Dim RegularBerries As String() = {"oran", "sitrus", "figy", "wiki", "mago", "aguav", "iapapa", "liechi", "ganlon", "salac", "petaya", "apicot", "lansat", "starf"}
|
||||
If RegularBerries.Contains(.FieldEffects.OwnCudChewBerry.Name.ToLower) Then
|
||||
UseBerry(True, True, .FieldEffects.OwnCudChewBerry, BattleScreen, "", "ability:cudchew")
|
||||
Else
|
||||
UseEffectBerry(True, True, .FieldEffects.OwnCudChewBerry, BattleScreen, "", "ability:cudchew")
|
||||
End If
|
||||
.FieldEffects.OwnCudChewBerry = Nothing
|
||||
.FieldEffects.OwnCudChewIndex = -1
|
||||
End If
|
||||
|
||||
If .OwnPokemon.HP > 0 Then
|
||||
If .OwnPokemon.Ability.Name.ToLower() = "moody" Then
|
||||
Dim cannotRaise As New List(Of Integer)
|
||||
@ -7508,6 +7588,19 @@
|
||||
End If
|
||||
End If
|
||||
|
||||
If .FieldEffects.OppCudChewIndex <> -1 AndAlso .FieldEffects.OppCudChewBerry IsNot Nothing Then
|
||||
.BattleQuery.Add(New TextQueryObject(.OppPokemon.GetDisplayName() & " regurgitated the " & .FieldEffects.OppCudChewBerry.Name & " Berry due to Cud Chew!"))
|
||||
Dim RegularBerries As String() = {"oran", "sitrus", "figy", "wiki", "mago", "aguav", "iapapa", "liechi", "ganlon", "salac", "petaya", "apicot", "lansat", "starf"}
|
||||
If RegularBerries.Contains(.FieldEffects.OppCudChewBerry.Name.ToLower) Then
|
||||
UseBerry(False, False, .FieldEffects.OppCudChewBerry, BattleScreen, "", "ability:cudchew")
|
||||
Else
|
||||
UseEffectBerry(False, False, .FieldEffects.OwnCudChewBerry, BattleScreen, "", "ability:cudchew")
|
||||
End If
|
||||
|
||||
.FieldEffects.OppCudChewBerry = Nothing
|
||||
.FieldEffects.OppCudChewIndex = -1
|
||||
End If
|
||||
|
||||
If .OppPokemon.HP > 0 Then
|
||||
If .OppPokemon.Ability.Name.ToLower() = "moody" Then
|
||||
Dim cannotRaise As New List(Of Integer)
|
||||
|
@ -1198,6 +1198,12 @@
|
||||
Dim Item As Item = Item.GetItemByID(TempItemID)
|
||||
|
||||
If Item.UseOnPokemon(PokeIndex) = True Then
|
||||
Dim CudChewBerries As String() = {"oran", "sitrus", "figy", "wiki", "mago", "aguav", "iapapa", "liechi", "ganlon", "salac", "petaya", "apicot", "lansat", "starf", "lum", "rawst", "aspear", "cheri", "chesto"}
|
||||
If Core.Player.Pokemons(PokeIndex).Ability.Name.ToLower() = "cud chew" AndAlso Item.IsBerry = True AndAlso CudChewBerries.Contains(Item.Name.ToLower) Then
|
||||
TempBattleScreen.FieldEffects.OwnCudChewBerry = Item
|
||||
TempBattleScreen.FieldEffects.OwnCudChewIndex = PokeIndex
|
||||
End If
|
||||
|
||||
TempBattleScreen.BattleQuery.Clear()
|
||||
TempBattleScreen.BattleQuery.Add(TempBattleScreen.FocusBattle())
|
||||
TempBattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
|
||||
|
@ -102,6 +102,8 @@
|
||||
Public OwnUsedMoves As New List(Of Integer)
|
||||
Public OwnMagicCoat As Integer = 0
|
||||
Public OwnConsumedItem As Item = Nothing
|
||||
Public OwnCudChewBerry As Item = Nothing 'Cud Chew Ability
|
||||
Public OwnCudChewIndex As Integer = -1
|
||||
Public OwnSmacked As Integer = 0 'Smack Down effect condition
|
||||
Public OwnPursuit As Boolean = False
|
||||
Public OwnMegaEvolved As Boolean = False
|
||||
@ -231,6 +233,8 @@
|
||||
Public OppPokemonDamagedLastTurn As Boolean = False
|
||||
Public OppMagicCoat As Integer = 0
|
||||
Public OppConsumedItem As Item = Nothing
|
||||
Public OppCudChewBerry As Item = Nothing
|
||||
Public OppCudChewIndex As Integer = -1
|
||||
Public OppSmacked As Integer = 0
|
||||
Public OppPursuit As Boolean = False
|
||||
Public OppMegaEvolved As Boolean = False
|
||||
|
@ -28842,6 +28842,7 @@
|
||||
<Compile Include="Entites\Enviroment\HoleBlock.vb" />
|
||||
<Compile Include="Overworld\NotificationPopup.vb" />
|
||||
<Compile Include="Overworld\RouteSign.vb" />
|
||||
<Compile Include="Pokemon\Abilities\CudChew.vb" />
|
||||
<Compile Include="Pokemon\Abilities\SteamEngine.vb" />
|
||||
<Compile Include="Pokemon\Abilities\Aerilate.vb" />
|
||||
<Compile Include="Pokemon\Abilities\PsychicSurge.vb" />
|
||||
|
@ -619,8 +619,8 @@
|
||||
'Hadron Engine
|
||||
'Case 290
|
||||
'Opportunist
|
||||
'Case 291
|
||||
'Cud Chew
|
||||
Case 291
|
||||
Return New Abilities.CudChew
|
||||
'Case 292
|
||||
'Sharpness
|
||||
'Case 293
|
||||
|
13
P3D/Pokemon/Abilities/CudChew.vb
Normal file
13
P3D/Pokemon/Abilities/CudChew.vb
Normal file
@ -0,0 +1,13 @@
|
||||
Namespace Abilities
|
||||
|
||||
Public Class CudChew
|
||||
|
||||
Inherits Ability
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New(291, "Cud Chew", "When the Pokémon eats a Berry, it will regurgitate that Berry at the end of the next turn and eat it one more time.")
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
Loading…
x
Reference in New Issue
Block a user