diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index e7fce6728..88fb0f5cc 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -3707,12 +3707,12 @@ Me.ChangeCameraAngel(1, own, BattleScreen) Select Case message Case "" 'Print default message only - BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is damaged by recoil")) + BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is damaged by recoil!")) Case "-1" 'Print no message at all 'Do nothing Case Else 'Print message given in 'message' BattleScreen.BattleQuery.Add(New TextQueryObject(message)) - BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is damaged by recoil")) + BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is damaged by recoil!")) End Select ReduceHP(Damage, own, from, BattleScreen, "", "recoildamage") End If diff --git a/P3D/Battle/BattleSystemV2/BattleCalculation.vb b/P3D/Battle/BattleSystemV2/BattleCalculation.vb index ba15a77da..db3de55a2 100644 --- a/P3D/Battle/BattleSystemV2/BattleCalculation.vb +++ b/P3D/Battle/BattleSystemV2/BattleCalculation.vb @@ -306,6 +306,86 @@ Return speed End Function + Public Shared Function DetermineBattleAttack(ByVal own As Boolean, ByVal BattleScreen As BattleScreen) As Integer + Dim p As Pokemon = BattleScreen.OwnPokemon + If own = False Then + p = BattleScreen.OppPokemon + End If + + Dim attack As Integer = CInt(p.Attack * GetMultiplierFromStat(p.StatAttack)) 'Calculate the attack's basic value + + If own = True Then + If BattleScreen.IsPVPBattle = False Then + If Core.Player.Badges.Contains(1) = True Then + attack = CInt(attack + (attack * (1 / 8))) 'Add 1/8 of the attack if the player has the 1st badge and it's not a PvP battle + End If + End If + End If + + If p.Status = P3D.Pokemon.StatusProblems.Burn And p.Ability.Name.ToLower() <> "guts" Then + attack = CInt(attack / 2) + End If + + If Not p.Item Is Nothing Then + If p.Item.Name = "Choice Band" Then + attack = CInt(attack * 1.5F) + End If + If p.Number = 25 Then + If Not p.Item Is Nothing And BattleScreen.FieldEffects.CanUseItem(own) = True Then + If p.Item.Name = "Light Ball" Then + attack *= 2 + End If + End If + End If + If p.Number = 104 OrElse p.Number = 105 Then + If Not p.Item Is Nothing And BattleScreen.FieldEffects.CanUseItem(own) = True Then + If p.Item.Name = "Thick Club" Then + attack *= 2 + End If + End If + End If + End If + + Select Case p.Ability.Name.ToLower() + Case "huge power" + attack *= 2 + Case "pure power" + attack *= 2 + Case "defeatist" + If p.HP / p.MaxHP <= 0.5 Then + attack = CInt(attack / 2) + End If + Case "hustle" + attack = CInt(attack * 1.5F) + Case "flower gift" + If BattleScreen.FieldEffects.Weather = BattleWeather.WeatherTypes.Sunny Then + attack = CInt(attack * 1.5F) + End If + End Select + + If p.Ability.Name.ToLower() = "guts" Then + If p.Status = Pokemon.StatusProblems.Paralyzed Or p.Status = Pokemon.StatusProblems.Burn Or p.Status = Pokemon.StatusProblems.Poison Or p.Status = Pokemon.StatusProblems.Sleep Or p.Status = Pokemon.StatusProblems.Freeze Then + attack = CInt(attack * 1.5F) + End If + End If + + If p.Ability.Name.ToLower() = "slow start" Then + If own = True Then + If BattleScreen.FieldEffects.OwnTurnCounts < 5 Then + attack = CInt(attack / 2) + End If + Else + If BattleScreen.FieldEffects.OppTurnCounts < 5 Then + attack = CInt(attack / 2) + End If + End If + End If + + attack = attack.Clamp(1, 999) + + Return attack + End Function + ''' ''' Outcome: 0=true/>1=false:1=sleeptalk/snore 2=other move 3=start sleep 4=X wont obey 5=X wont obey 6=X turned away 7=X is loafing around 8=X pretended to not notice ''' diff --git a/P3D/Battle/BattleSystemV2/FieldEffects.vb b/P3D/Battle/BattleSystemV2/FieldEffects.vb index daaabc88d..8702b970b 100644 --- a/P3D/Battle/BattleSystemV2/FieldEffects.vb +++ b/P3D/Battle/BattleSystemV2/FieldEffects.vb @@ -52,6 +52,7 @@ Public OwnLeechSeed As Integer = 0 'The opponent used leech seed Public OwnSolarBeam As Integer = 0 'Charge counter for solar beam Public OwnSolarBlade As Integer = 0 'Charge counter for solar blade + Public OwnGeomancy As Integer = 0 'Charge counter for solar beam Public OwnLockOn As Integer = 0 'Counter for the moves lock-on and mind reader Public OwnBideCounter As Integer = 0 'Counter for the Bide move Public OwnBideDamage As Integer = 0 'Half of the damage dealt by bide @@ -181,6 +182,7 @@ Public OppLeechSeed As Integer = 0 Public OppSolarBeam As Integer = 0 Public OppSolarBlade As Integer = 0 + Public OppGeomancy As Integer = 0 Public OppLockOn As Integer = 0 Public OppBideCounter As Integer = 0 Public OppBideDamage As Integer = 0 diff --git a/P3D/Content/Pokemon/Overworld/Normal/609.png b/P3D/Content/Pokemon/Overworld/Normal/609.png index 4c2059c1a..07767f20b 100644 Binary files a/P3D/Content/Pokemon/Overworld/Normal/609.png and b/P3D/Content/Pokemon/Overworld/Normal/609.png differ diff --git a/P3D/Pokemon/Attacks/Dragon/ClangingScales.vb b/P3D/Pokemon/Attacks/Dragon/ClangingScales.vb index 5a8bfcdc6..72a1e93a6 100644 --- a/P3D/Pokemon/Attacks/Dragon/ClangingScales.vb +++ b/P3D/Pokemon/Attacks/Dragon/ClangingScales.vb @@ -56,7 +56,7 @@ Namespace BattleSystem.Moves.Dragon End Sub Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) - BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Defense", 1, "", "move:clangingscales") + BattleScreen.Battle.LowerStat(own, own, BattleScreen, "Defense", 1, "", "move:clangingscales") End Sub End Class diff --git a/P3D/Pokemon/Attacks/Fairy/Geomancy.vb b/P3D/Pokemon/Attacks/Fairy/Geomancy.vb index e27281c6b..8fdeb788b 100644 --- a/P3D/Pokemon/Attacks/Fairy/Geomancy.vb +++ b/P3D/Pokemon/Attacks/Fairy/Geomancy.vb @@ -56,6 +56,94 @@ Namespace BattleSystem.Moves.Fairy Me.AIField3 = AIField.CanRaiseSpeed End Sub + Public Overrides Sub PreAttack(Own As Boolean, BattleScreen As BattleScreen) + Dim Geomancy As Integer = BattleScreen.FieldEffects.OwnGeomancy + If Own = False Then + Geomancy = BattleScreen.FieldEffects.OppGeomancy + End If + + If Geomancy = 0 Then + Me.FocusOppPokemon = False + Else + Me.FocusOppPokemon = True + End If + End Sub + + Public Overrides Function MoveFailBeforeAttack(Own As Boolean, BattleScreen As BattleScreen) As Boolean + Dim p As Pokemon = BattleScreen.OwnPokemon + If Own = False Then + p = BattleScreen.OppPokemon + End If + + Dim hasToCharge As Boolean = True + + Dim beam As Integer = BattleScreen.FieldEffects.OwnGeomancy + If Own = False Then + beam = BattleScreen.FieldEffects.OppGeomancy + End If + + If beam = 0 Then + BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is absorbing power!")) + Else + hasToCharge = False + End If + + If hasToCharge = True Then + If Not p.Item Is Nothing Then + If p.Item.Name.ToLower() = "power herb" And BattleScreen.FieldEffects.CanUseItem(Own) = True And BattleScreen.FieldEffects.CanUseOwnItem(Own, BattleScreen) = True Then + If BattleScreen.Battle.RemoveHeldItem(Own, Own, BattleScreen, "Power Herb pushed the use of Geomancy!", "move:geomancy") = True Then + hasToCharge = False + End If + End If + End If + End If + + If hasToCharge = True Then + If Own = True Then + BattleScreen.FieldEffects.OwnGeomancy = 1 + Else + BattleScreen.FieldEffects.OppGeomancy = 1 + End If + Return True + Else + If Own = True Then + BattleScreen.FieldEffects.OwnGeomancy = 0 + Else + BattleScreen.FieldEffects.OppGeomancy = 0 + End If + Return False + End If + End Function + + Public Overrides Sub MoveSelected(own As Boolean, BattleScreen As BattleScreen) + If own = True Then + BattleScreen.FieldEffects.OwnGeomancy = 0 + Else + BattleScreen.FieldEffects.OppGeomancy = 0 + End If + End Sub + + Public Overrides Function DeductPP(own As Boolean, BattleScreen As BattleScreen) As Boolean + Dim geomancy As Integer = BattleScreen.FieldEffects.OwnGeomancy + If own = False Then + geomancy = BattleScreen.FieldEffects.OppGeomancy + End If + + If Geomancy = 0 Then + Return False + Else + Return True + End If + End Function + + Private Sub MoveFails(own As Boolean, BattleScreen As BattleScreen) + If own = True Then + BattleScreen.FieldEffects.OwnGeomancy = 0 + Else + BattleScreen.FieldEffects.OppGeomancy = 0 + End If + End Sub + Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Dim b As Boolean = BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Attack", 2, "", "move:geomancy") Dim d As Boolean = BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Defense", 2, "", "move:geomancy") @@ -65,6 +153,34 @@ Namespace BattleSystem.Moves.Fairy End If End Sub + Public Overrides Sub MoveMisses(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub AbsorbedBySubstitute(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub MoveProtectedDetected(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub IsSleeping(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub HurtItselfInConfusion(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + + Public Overrides Sub IsAttracted(own As Boolean, BattleScreen As BattleScreen) + MoveFails(own, BattleScreen) + End Sub + End Class End Namespace \ No newline at end of file diff --git a/P3D/Pokemon/Attacks/Fighting/FinalGambit.vb b/P3D/Pokemon/Attacks/Fighting/FinalGambit.vb index 0b98eefca..5b6c70f91 100644 --- a/P3D/Pokemon/Attacks/Fighting/FinalGambit.vb +++ b/P3D/Pokemon/Attacks/Fighting/FinalGambit.vb @@ -61,8 +61,8 @@ p = BattleScreen.OppPokemon End If Dim dmg As Integer = p.HP - BattleScreen.Battle.ReduceHP(dmg, own, own, BattleScreen, "", "move:finalgambit") - BattleScreen.Battle.ReduceHP(dmg, Not own, own, BattleScreen, "", "move:finalgambit") + BattleScreen.Battle.ReduceHP(p.HP, own, own, BattleScreen, "", "move:finalgambit") + BattleScreen.Battle.ReduceHP(p.HP, Not own, own, BattleScreen, "", "move:finalgambit") End Sub End Class diff --git a/P3D/Pokemon/Attacks/Fighting/Ride.vb b/P3D/Pokemon/Attacks/Fighting/Ride.vb index 848e5a8b3..cdcbe5a15 100644 --- a/P3D/Pokemon/Attacks/Fighting/Ride.vb +++ b/P3D/Pokemon/Attacks/Fighting/Ride.vb @@ -18,7 +18,7 @@ Me.Name = "Ride" Me.Description = "The user runs over the target rapidly. The power rises when the user's accuracy stat is low." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Fighting/RockSmash.vb b/P3D/Pokemon/Attacks/Fighting/RockSmash.vb index cd9e434cc..53ac9143f 100644 --- a/P3D/Pokemon/Attacks/Fighting/RockSmash.vb +++ b/P3D/Pokemon/Attacks/Fighting/RockSmash.vb @@ -18,7 +18,7 @@ Me.Name = "Rock Smash" Me.Description = "The user attacks with a punch that can shatter a rock. It may also lower the target's Defense stat." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Flying/Fly.vb b/P3D/Pokemon/Attacks/Flying/Fly.vb index f06be34e9..56874e3a5 100644 --- a/P3D/Pokemon/Attacks/Flying/Fly.vb +++ b/P3D/Pokemon/Attacks/Flying/Fly.vb @@ -18,7 +18,7 @@ Me.Name = "Fly" Me.Description = "The user soars, then strikes its target on the second turn. It can also be used for flying to any familiar town." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Grass/Strength Sap.vb b/P3D/Pokemon/Attacks/Grass/Strength Sap.vb index f2edb170d..d8fc283b0 100644 --- a/P3D/Pokemon/Attacks/Grass/Strength Sap.vb +++ b/P3D/Pokemon/Attacks/Grass/Strength Sap.vb @@ -60,7 +60,9 @@ op = BattleScreen.OwnPokemon End If - Dim heal As Integer = op.StatAttack + Dim op_Attack As Integer = BattleCalculation.DetermineBattleAttack(Not own, BattleScreen) + + Dim heal As Integer = op_Attack Dim b As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Attack", 1, "", "move:strengthsap") If b = True Then diff --git a/P3D/Pokemon/Attacks/Normal/RockClimb.vb b/P3D/Pokemon/Attacks/Normal/RockClimb.vb index a34ccfcd8..d5b435888 100644 Binary files a/P3D/Pokemon/Attacks/Normal/RockClimb.vb and b/P3D/Pokemon/Attacks/Normal/RockClimb.vb differ diff --git a/P3D/Pokemon/Attacks/Normal/TearfulLook.vb b/P3D/Pokemon/Attacks/Normal/TearfulLook.vb index e1a489c4e..c189e462f 100644 --- a/P3D/Pokemon/Attacks/Normal/TearfulLook.vb +++ b/P3D/Pokemon/Attacks/Normal/TearfulLook.vb @@ -51,13 +51,13 @@ Me.IsWonderGuardAffected = False '#End - Me.AIField1 = AIField.LowerDefense - Me.AIField2 = AIField.LowerSpDefense + Me.AIField1 = AIField.LowerAttack + Me.AIField2 = AIField.LowerSpAttack End Sub Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) - Dim b As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Defense", 1, "", "move:tearfullook") - Dim d As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Special Defense", 1, "", "move:tearfullook") + Dim b As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Attack", 1, "", "move:tearfullook") + Dim d As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Special Attack", 1, "", "move:tearfullook") If b = False AndAlso DisabledWhileGravity = False Then BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!")) End If diff --git a/P3D/Pokemon/Attacks/Steel/GearUp.vb b/P3D/Pokemon/Attacks/Steel/GearUp.vb index 1b87e765f..bacba2b6f 100644 --- a/P3D/Pokemon/Attacks/Steel/GearUp.vb +++ b/P3D/Pokemon/Attacks/Steel/GearUp.vb @@ -57,13 +57,13 @@ End Sub Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) - Dim op As Pokemon = BattleScreen.OppPokemon + Dim p As Pokemon = BattleScreen.OwnPokemon If own = False Then - op = BattleScreen.OwnPokemon + p = BattleScreen.OppPokemon End If - If op.Ability.ID = 57 OrElse op.Ability.ID = 58 Then - BattleScreen.Battle.RaiseStat(Not own, own, BattleScreen, "Attack", 1, "", "move:gearup") - BattleScreen.Battle.RaiseStat(Not own, own, BattleScreen, "Special Attack", 1, "", "move:gearup") + If p.Ability.ID = 57 OrElse p.Ability.ID = 58 Then + BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Attack", 1, "", "move:gearup") + BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Attack", 1, "", "move:gearup") End If End Sub diff --git a/P3D/Pokemon/Attacks/Water/Dive.vb b/P3D/Pokemon/Attacks/Water/Dive.vb index 94b296673..09b50415a 100644 --- a/P3D/Pokemon/Attacks/Water/Dive.vb +++ b/P3D/Pokemon/Attacks/Water/Dive.vb @@ -18,7 +18,7 @@ Me.Name = "Dive" Me.Description = "Diving on the first turn, the user floats up and attacks on the next turn." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Water/SparklingAria.vb b/P3D/Pokemon/Attacks/Water/SparklingAria.vb index 115ddc009..8b281009b 100644 --- a/P3D/Pokemon/Attacks/Water/SparklingAria.vb +++ b/P3D/Pokemon/Attacks/Water/SparklingAria.vb @@ -18,7 +18,7 @@ Me.Name = "Sparkling Aria" Me.Description = "The user bursts into song, emitting many bubbles. Any Pokémon suffering from a burn will be healed by the touch of these bubbles." Me.CriticalChance = 1 - Me.IsHMMove = True + Me.IsHMMove = False Me.Target = Targets.AllAdjacentTargets Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Water/Waterfall.vb b/P3D/Pokemon/Attacks/Water/Waterfall.vb index 9a0742456..9be7e2148 100644 --- a/P3D/Pokemon/Attacks/Water/Waterfall.vb +++ b/P3D/Pokemon/Attacks/Water/Waterfall.vb @@ -18,7 +18,7 @@ Me.Name = "Waterfall" Me.Description = "The user charges at the target and may make it flinch. It can also be used to climb a waterfall." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 diff --git a/P3D/Pokemon/Attacks/Water/Whirlpool.vb b/P3D/Pokemon/Attacks/Water/Whirlpool.vb index 2010a20d1..b6de948e2 100644 --- a/P3D/Pokemon/Attacks/Water/Whirlpool.vb +++ b/P3D/Pokemon/Attacks/Water/Whirlpool.vb @@ -18,7 +18,7 @@ Namespace BattleSystem.Moves.Water Me.Name = "Whirlpool" Me.Description = "Traps foes in a violent swirling whirlpool for four to five turns." Me.CriticalChance = 1 - Me.IsHMMove = False + Me.IsHMMove = True Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1