From 8dddb3b6d012a735d7a81dff4cb7c81c9a740474 Mon Sep 17 00:00:00 2001
From: Capt_Segis <F20121237@outlook.com>
Date: Sun, 18 Sep 2016 14:13:20 -0500
Subject: [PATCH] Create CircleThrow.vb

---
 .../Pokemon/Attacks/Fighting/CircleThrow.vb   | 133 ++++++++++++++++++
 1 file changed, 133 insertions(+)
 create mode 100644 2.5DHero/2.5DHero/Pokemon/Attacks/Fighting/CircleThrow.vb

diff --git a/2.5DHero/2.5DHero/Pokemon/Attacks/Fighting/CircleThrow.vb b/2.5DHero/2.5DHero/Pokemon/Attacks/Fighting/CircleThrow.vb
new file mode 100644
index 000000000..e1669fc07
--- /dev/null
+++ b/2.5DHero/2.5DHero/Pokemon/Attacks/Fighting/CircleThrow.vb
@@ -0,0 +1,133 @@
+Namespace BattleSystem.Moves.Fighting
+
+    Public Class CircleThrow
+
+        Inherits Attack
+
+        Public Sub New()
+            '#Definitions
+            Me.Type = New Element(Element.Types.Fighting)
+            Me.ID = 509
+            Me.OriginalPP = 10
+            Me.CurrentPP = 10
+            Me.MaxPP = 10
+            Me.Power = 60
+            Me.Accuracy = 90
+            Me.Category = Categories.Physical
+            Me.ContestCategory = ContestCategories.Cool
+            Me.Name = "Circle Throw"
+            Me.Description = "	The target is thrown, and a different Pokémon is dragged out. In the wild, this ends a battle against a single Pokémon."
+            Me.CriticalChance = 1
+            Me.IsHMMove = False
+            Me.Target = Targets.OneAdjacentTarget
+            Me.Priority = -6
+            Me.TimesToAttack = 1
+            '#End
+
+            '#SpecialDefinitions
+            Me.MakesContact = True
+            Me.ProtectAffected = True
+            Me.MagicCoatAffected = False
+            Me.SnatchAffected = False
+            Me.MirrorMoveAffected = True
+            Me.KingsrockAffected = False
+            Me.CounterAffected = True
+
+            Me.DisabledWhileGravity = False
+            Me.UseEffectiveness = True
+            Me.ImmunityAffected = True
+            Me.HasSecondaryEffect = False
+            Me.RemovesFrozen = False
+
+            Me.IsHealingMove = False
+            Me.IsRecoilMove = False
+            Me.IsPunchingMove = False
+            Me.IsDamagingMove = True
+            Me.IsProtectMove = False
+            Me.IsSoundMove = False
+
+            Me.IsAffectedBySubstitute = True
+            Me.IsOneHitKOMove = False
+            Me.IsWonderGuardAffected = True
+            '#End
+
+            Me.AIField1 = AIField.Damage
+            Me.AIField2 = AIField.Nothing
+        End Sub
+
+        Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
+            Dim op As Pokemon = BattleScreen.OppPokemon
+            If own = False Then
+                op = BattleScreen.OwnPokemon
+            End If
+
+            'Not fainted:
+            If op.HP > 0 And op.Status <> Pokemon.StatusProblems.Fainted Then
+                Dim substitude As Integer = BattleScreen.FieldEffects.OppSubstitute
+                If own = False Then
+                    substitude = BattleScreen.FieldEffects.OwnSubstitute
+                End If
+
+                'substitute:
+                If substitude <= 0 Then
+
+                    'suction cups ability:
+                    If op.Ability.Name.ToLower() <> "suction cups" Then
+                        Dim ingrain As Integer = BattleScreen.FieldEffects.OppIngrain
+                        If own = False Then
+                            ingrain = BattleScreen.FieldEffects.OwnIngrain
+                        End If
+
+                        'check ingrain set up:
+                        If ingrain <= 0 Then
+
+                            If BattleCalculation.CanSwitch(BattleScreen, Not own) = True Then
+                                 BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " got thrown away!"))
+                                If BattleScreen.IsPVPBattle = True Or BattleScreen.IsTrainerBattle = True Or BattleScreen.IsRemoteBattle = True Then
+                                    'trainer battle
+                                    If own = True Then
+                                        If BattleScreen.Trainer.CountUseablePokemon > 1 Then
+                                            Dim i As Integer = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
+                                            While BattleScreen.Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OppPokemonIndex = i OrElse BattleScreen.Trainer.Pokemons(i).HP <= 0
+                                                i = Core.Random.Next(0, BattleScreen.Trainer.Pokemons.count)
+                                            End While
+                                            BattleScreen.Battle.SwitchOutOpp(BattleScreen, i, "")
+                                        Else
+                                            BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
+                                        End If
+                                    Else
+                                        If Core.Player.CountFightablePokemon > 1 Then
+                                             Dim i As Integer = Core.Random.Next(0, Core.Player.Pokemons.Count)
+                                            While Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse BattleScreen.OwnPokemonIndex = i OrElse Core.Player.Pokemons(i).HP <= 0
+                                                i = Core.Random.Next(0, Core.Player.Pokemons.Count)
+                                            End While
+                                            BattleScreen.Battle.SwitchOutOwn(BattleScreen, i, -1)
+                                        Else
+                                            BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
+                                        End If
+                                    End If
+                                Else
+                                    'wild battle
+
+                                    If own = True Then
+                                        BattleScreen.BattleQuery.Add(New EndBattleQueryObject(False))
+                                    Else
+                                        If Core.Player.CountFightablePokemon > 1 Then
+                                            BattleScreen.Battle.SwitchOutOwn(BattleScreen, -1, -1)
+                                        Else
+                                            BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
+                                        End If
+                                    End If
+                                End If
+                            Else
+                                BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
+                            End If
+                        End If
+                    End If
+                End If
+            End If
+        End Sub
+
+    End Class
+
+End Namespace