mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 07:44:31 +02:00
Updated to Gen 7 Battle Functionality
This commit is contained in:
parent
c19c6d453c
commit
0a721d1045
@ -1231,7 +1231,8 @@
|
|||||||
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion)
|
p.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion)
|
||||||
Else
|
Else
|
||||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is confused!"))
|
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is confused!"))
|
||||||
If Core.Random.Next(0, 2) = 0 Then
|
'Previously 'If Core.Random.Next(0, 2) = 0 Then' (Updated to gen 7's 33% instead of 50%)
|
||||||
|
If Core.Random.Next(0, 3) = 0 Then
|
||||||
Dim a As Attack = New ConfusionAttack()
|
Dim a As Attack = New ConfusionAttack()
|
||||||
Dim damage As Integer = BattleCalculation.CalculateDamage(a, False, True, True, BattleScreen)
|
Dim damage As Integer = BattleCalculation.CalculateDamage(a, False, True, True, BattleScreen)
|
||||||
ReduceHP(damage, own, own, BattleScreen, p.GetDisplayName() & " hurt itself in confusion.", "confusiondamage")
|
ReduceHP(damage, own, own, BattleScreen, p.GetDisplayName() & " hurt itself in confusion.", "confusiondamage")
|
||||||
@ -2061,7 +2062,7 @@
|
|||||||
End If
|
End If
|
||||||
Case "weak armor"
|
Case "weak armor"
|
||||||
If moveUsed.Category = Attack.Categories.Physical Then
|
If moveUsed.Category = Attack.Categories.Physical Then
|
||||||
RaiseStat(Not own, Not own, BattleScreen, "Speed", 1, "Weak Armor causes the Speed to increase!", "weakarmor")
|
RaiseStat(Not own, Not own, BattleScreen, "Speed", 2, "Weak Armor causes the Speed to increase!", "weakarmor")
|
||||||
LowerStat(Not own, Not own, BattleScreen, "Defense", 1, "Weak Armor causes the Defense to decrease!", "weakarmor")
|
LowerStat(Not own, Not own, BattleScreen, "Defense", 1, "Weak Armor causes the Defense to decrease!", "weakarmor")
|
||||||
End If
|
End If
|
||||||
Case "pickpocket"
|
Case "pickpocket"
|
||||||
@ -3725,7 +3726,15 @@
|
|||||||
If RemoveHeldItem(own, own, BattleScreen, "", "berry:sitrus") = True Then
|
If RemoveHeldItem(own, own, BattleScreen, "", "berry:sitrus") = True Then
|
||||||
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
||||||
End If
|
End If
|
||||||
Case "figy"
|
End Select
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If p.HP > 0 And p.HP < CInt(Math.Ceiling(p.MaxHP / 4)) Then
|
||||||
|
If Not p.Item Is Nothing Then
|
||||||
|
If BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then
|
||||||
|
Select Case p.Item.Name.ToLower()
|
||||||
|
Case "figy"
|
||||||
If RemoveHeldItem(own, own, BattleScreen, "", "berry:figy") = True Then
|
If RemoveHeldItem(own, own, BattleScreen, "", "berry:figy") = True Then
|
||||||
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
||||||
End If
|
End If
|
||||||
@ -3745,14 +3754,6 @@
|
|||||||
If RemoveHeldItem(own, own, BattleScreen, "", "berry:iapapa") = True Then
|
If RemoveHeldItem(own, own, BattleScreen, "", "berry:iapapa") = True Then
|
||||||
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
||||||
End If
|
End If
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If p.HP > 0 And p.HP < CInt(Math.Ceiling(p.MaxHP / 4)) Then
|
|
||||||
If Not p.Item Is Nothing Then
|
|
||||||
If BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then
|
|
||||||
Select Case p.Item.Name.ToLower()
|
|
||||||
Case "liechi"
|
Case "liechi"
|
||||||
If RemoveHeldItem(own, own, BattleScreen, "", "berry:liechi") = True Then
|
If RemoveHeldItem(own, own, BattleScreen, "", "berry:liechi") = True Then
|
||||||
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause)
|
||||||
@ -3813,31 +3814,31 @@
|
|||||||
Case "sitrus"
|
Case "sitrus"
|
||||||
GainHP(CInt(p.MaxHP / 4), own, own, BattleScreen, "The Sitrus Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:sitrus")
|
GainHP(CInt(p.MaxHP / 4), own, own, BattleScreen, "The Sitrus Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:sitrus")
|
||||||
Case "figy"
|
Case "figy"
|
||||||
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 8))
|
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 2))
|
||||||
GainHP(healHP, own, own, BattleScreen, "The Figy Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:figy")
|
GainHP(healHP, own, own, BattleScreen, "The Figy Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:figy")
|
||||||
If berry.PokemonLikes(p) = False Then
|
If berry.PokemonLikes(p) = False Then
|
||||||
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Figy Berry!", "berry:figy")
|
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Figy Berry!", "berry:figy")
|
||||||
End If
|
End If
|
||||||
Case "wiki"
|
Case "wiki"
|
||||||
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 8))
|
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 2))
|
||||||
GainHP(healHP, own, own, BattleScreen, "The Wiki Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:wiki")
|
GainHP(healHP, own, own, BattleScreen, "The Wiki Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:wiki")
|
||||||
If berry.PokemonLikes(p) = False Then
|
If berry.PokemonLikes(p) = False Then
|
||||||
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Wiki Berry!", "berry:wiki")
|
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Wiki Berry!", "berry:wiki")
|
||||||
End If
|
End If
|
||||||
Case "mago"
|
Case "mago"
|
||||||
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 8))
|
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 2))
|
||||||
GainHP(healHP, own, own, BattleScreen, "The Mago Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:mago")
|
GainHP(healHP, own, own, BattleScreen, "The Mago Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:mago")
|
||||||
If berry.PokemonLikes(p) = False Then
|
If berry.PokemonLikes(p) = False Then
|
||||||
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Mago Berry!", "mago")
|
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Mago Berry!", "mago")
|
||||||
End If
|
End If
|
||||||
Case "aguav"
|
Case "aguav"
|
||||||
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 8))
|
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 2))
|
||||||
GainHP(healHP, own, own, BattleScreen, "The Aguav Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:aguav")
|
GainHP(healHP, own, own, BattleScreen, "The Aguav Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:aguav")
|
||||||
If berry.PokemonLikes(p) = False Then
|
If berry.PokemonLikes(p) = False Then
|
||||||
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Aguav Berry!", "aguav")
|
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Aguav Berry!", "aguav")
|
||||||
End If
|
End If
|
||||||
Case "iapapa"
|
Case "iapapa"
|
||||||
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 8))
|
Dim healHP As Integer = CInt(Math.Ceiling(p.MaxHP / 2))
|
||||||
GainHP(healHP, own, own, BattleScreen, "The Iapapa Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:iapapa")
|
GainHP(healHP, own, own, BattleScreen, "The Iapapa Berry filled up " & p.GetDisplayName() & "'s HP!", "berry:iapapa")
|
||||||
If berry.PokemonLikes(p) = False Then
|
If berry.PokemonLikes(p) = False Then
|
||||||
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Iapapa Berry!", "berry:iapapa")
|
InflictConfusion(own, own, BattleScreen, p.GetDisplayName() & " disliked the Iapapa Berry!", "berry:iapapa")
|
||||||
@ -4901,9 +4902,9 @@
|
|||||||
If .OwnPokemon.HP > 0 Then 'Burn
|
If .OwnPokemon.HP > 0 Then 'Burn
|
||||||
If .OwnPokemon.Status = Pokemon.StatusProblems.Burn Then
|
If .OwnPokemon.Status = Pokemon.StatusProblems.Burn Then
|
||||||
If .OwnPokemon.Ability.Name.ToLower() <> "water veil" And .OwnPokemon.Ability.Name.ToLower() <> "magic guard" Then
|
If .OwnPokemon.Ability.Name.ToLower() <> "water veil" And .OwnPokemon.Ability.Name.ToLower() <> "magic guard" Then
|
||||||
Dim reduceAmount As Integer = CInt(.OwnPokemon.MaxHP / 8)
|
Dim reduceAmount As Integer = CInt(.OwnPokemon.MaxHP / 16)
|
||||||
If .OwnPokemon.Ability.Name.ToLower() = "heatproof" Then
|
If .OwnPokemon.Ability.Name.ToLower() = "heatproof" Then
|
||||||
reduceAmount = CInt(.OwnPokemon.MaxHP / 16)
|
reduceAmount = CInt(.OwnPokemon.MaxHP / 32)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\effect_ember", False))
|
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\effect_ember", False))
|
||||||
|
@ -75,11 +75,12 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ownPokemon.Ability.Name.ToLower() = "gale wings" And ownAttack.Type.Type = Element.Types.Flying Then
|
'Added condition to check for full HP
|
||||||
|
If ownPokemon.Ability.Name.ToLower() = "gale wings" And ownAttack.Type.Type = Element.Types.Flying And p.HP = p.MaxHP Then
|
||||||
ownPriority += 1
|
ownPriority += 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oppPokemon.Ability.Name.ToLower() = "gale wings" And oppAttack.Type.Type = Element.Types.Flying Then
|
If oppPokemon.Ability.Name.ToLower() = "gale wings" And oppAttack.Type.Type = Element.Types.Flying And Op.HP = Op.MaxHP Then
|
||||||
oppPriority += 1
|
oppPriority += 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -226,7 +227,7 @@
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If p.Status = P3D.Pokemon.StatusProblems.Paralyzed And p.Ability.Name.ToLower() <> "quick feet" Then
|
If p.Status = P3D.Pokemon.StatusProblems.Paralyzed And p.Ability.Name.ToLower() <> "quick feet" Then
|
||||||
speed = CInt(speed / 4) 'Divide the speed by 4 if the Pokemon is paralyzed.
|
speed = CInt(speed / 2) 'Divide the speed by 2 (gen 7 standards) if the Pokemon is paralyzed.
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not p.Item Is Nothing Then
|
If Not p.Item Is Nothing Then
|
||||||
@ -1195,15 +1196,23 @@
|
|||||||
End If
|
End If
|
||||||
Case "refrigerate"
|
Case "refrigerate"
|
||||||
If Attack.Type.Type = Element.Types.Normal Then
|
If Attack.Type.Type = Element.Types.Normal Then
|
||||||
UA = 1.3F
|
UA = 1.2F
|
||||||
End If
|
End If
|
||||||
Case "pixilate"
|
Case "pixilate"
|
||||||
If Attack.Type.Type = Element.Types.Normal Then
|
If Attack.Type.Type = Element.Types.Normal Then
|
||||||
UA = 1.3F
|
UA = 1.2F
|
||||||
|
End If
|
||||||
|
Case "normalize"
|
||||||
|
If Attack.Type.Type = Element.Types.Normal Then
|
||||||
|
UA = 1.2F
|
||||||
|
End If
|
||||||
|
Case "galvanize"
|
||||||
|
If Attack.Type.Type = Element.Types.Normal Then
|
||||||
|
UA = 1.2F
|
||||||
End If
|
End If
|
||||||
Case "aerilate"
|
Case "aerilate"
|
||||||
If Attack.Type.Type = Element.Types.Normal Then
|
If Attack.Type.Type = Element.Types.Normal Then
|
||||||
UA = 1.3F
|
UA = 1.2F
|
||||||
End If
|
End If
|
||||||
Case "mega launcher"
|
Case "mega launcher"
|
||||||
If Attack.IsPulseMove = True Then
|
If Attack.IsPulseMove = True Then
|
||||||
@ -1382,6 +1391,7 @@
|
|||||||
If p.Number = 25 Then
|
If p.Number = 25 Then
|
||||||
IM = 2.0F
|
IM = 2.0F
|
||||||
End If
|
End If
|
||||||
|
'Soul Dew now boosts Lati@s Psychic & Dragon moves by 20% instead of Sp. Atk, this will have to be changed
|
||||||
Case "soul dew"
|
Case "soul dew"
|
||||||
If p.Number = 380 Or p.Number = 381 Then
|
If p.Number = 380 Or p.Number = 381 Then
|
||||||
IM = 1.5F
|
IM = 1.5F
|
||||||
@ -1493,6 +1503,7 @@
|
|||||||
|
|
||||||
If Not Op.Item Is Nothing And BattleScreen.FieldEffects.CanUseItem(Not Own) = True And BattleScreen.FieldEffects.CanUseOwnItem(Not Own, BattleScreen) = True Then
|
If Not Op.Item Is Nothing And BattleScreen.FieldEffects.CanUseItem(Not Own) = True And BattleScreen.FieldEffects.CanUseOwnItem(Not Own, BattleScreen) = True Then
|
||||||
Select Case Op.Item.Name.ToLower()
|
Select Case Op.Item.Name.ToLower()
|
||||||
|
'Soul Dew now boosts Lati@s Psychic & Dragon moves by 20% instead of Sp. Atk, this will have to be changed
|
||||||
Case "soul dew"
|
Case "soul dew"
|
||||||
If Op.Number = 380 Or p.Number = 381 Then
|
If Op.Number = 380 Or p.Number = 381 Then
|
||||||
DMod = 1.5F
|
DMod = 1.5F
|
||||||
|
Loading…
x
Reference in New Issue
Block a user