Exemplo n.º 1
0
        public override int AutoUseWeight(ParentPokemon mon, Vector2 pos, TerramonPlayer player)
        {
            NPC target = GetNearestNPC(pos);

            if (target == null)
            {
                return(0);
            }
            return(30);
        }
Exemplo n.º 2
0
 public override void Action(CommandCaller caller, string input, string[] args)
 {
     if (args.Length == 0)
     {
         TerramonPlayer modPlayer = Main.LocalPlayer.GetModPlayer <TerramonPlayer>();
         //modPlayer.PartySlot1.HP = 2;
         caller.Reply(modPlayer.PartySlot1.PhysDmgIV.ToString());
         caller.Reply(modPlayer.PartySlot1.PhysDmg.ToString());
         //Process.Start("https://terrariamods.gamepedia.com/Terramon");
     }
 }
        public void Send(TerramonMod mod, TerramonPlayer pl, int target = -1)
        {
            if (Main.netMode == NetmodeID.Server)
            {
                return;
            }
            var p = GetPacket(mod);

            p.Write(pl.Save());
            p.Send();
        }
Exemplo n.º 4
0
        public void Send(TerramonMod mod, TerramonPlayer pl)
        {
            if (Main.netMode == NetmodeID.Server)
            {
                return;
            }
            var p = GetPacket(mod);

            p.Write(pl.ActivePartySlot);
            p.Send();
        }
Exemplo n.º 5
0
        public override bool PerformInWorld(ParentPokemon mon, Vector2 target, TerramonPlayer player)
        {
            Player pl = Main.player[player.whoAmI];

            if (pl.statLife < pl.statLifeMax - (100 * ((float)pl.statLifeMax / 500f))) //The more hp player have the more hp threshold
            {
                pl.HealEffect(200 * (pl.statLifeMax / 500));
                pl.statLife += 200;
                return(true);
            }
            return(false);
        }
Exemplo n.º 6
0
        public override void AI()
        {
            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>(mod);

            if (player.dead)
            {
                modPlayer.pikachuPet = false;
            }
            if (modPlayer.pikachuPet)
            {
                projectile.timeLeft = 2;
            }
        }
Exemplo n.º 7
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140)
            {
                BattleMode.UI.splashText.SetText("");

                TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 165)
            {
                MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                cutID     = Projectile.NewProjectile(target.projectile.Center, new Vector2(0, 0), ModContent.ProjectileType <CutProjectile>(), 0, 0);
                Main.projectile[cutID].maxPenetrate    = 99;
                Main.projectile[cutID].penetrate       = 99;
                Main.projectile[cutID].direction       = mon.projectile.Center.X > target.projectile.Center.X ? -1 : 1;
                Main.projectile[cutID].spriteDirection = mon.projectile.Center.X > target.projectile.Center.X ? -1 : 1;
            }
            else if (AnimationFrame == 200)
            {
                InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                {
                    CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                }
                BattleMode.queueEndMove = true;
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                AnimationFrame     = 0;
                BattleMode.moveEnd = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 8
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140) //Move animation begin after 140 frames
            {
                BattleMode.UI.splashText.SetText("");

                MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
            }

            if (AnimationFrame > 140 && AnimationFrame < 195)
            {
                for (int i = 0; i < 1; i++)
                {
                    Dust dust1 = Dust.NewDustDirect(mon.projectile.position, mon.projectile.width, mon.projectile.height, 174, 0f, 0f, 0, Color.White, 1.1f);
                    dust1.alpha      = 50;
                    dust1.velocity.Y = -1.5f;
                    dust1.noGravity  = true;
                }
            }

            if (AnimationFrame == 275)
            {
                s = ModifyStat(attacker, mon, GetStat.CritRatio, 1, state, !opponent).ToString();
                BattleMode.UI.splashText.SetText(s);
            }

            if (AnimationFrame >= 415)
            {
                AnimationFrame = 0;
                s = "";
                BattleMode.moveEnd = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 9
0
        public override void AI()
        {
            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>();

            if (player.dead)
            {
                modPlayer.ResetEffects();
                modPlayer.ActivePetId = -1;
            }

            if (modPlayer.IsPetActive(GetType().Name))
            {
                projectile.timeLeft = 2;
            }
        }
Exemplo n.º 10
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                AnimationFrame     = 0;
                BattleMode.moveEnd = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 11
0
        public bool HoldingFullRestore()
        {
            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>();

            if (!highlighted)
            {
                return(false);
            }
            if (modPlayer.Battle != null)
            {
                return(false);
            }
            if (Main.LocalPlayer.HeldItem.type == ModContent.ItemType <Items.MiscItems.Medication.FullRestore>())
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 12
0
        public override bool PerformInWorld(ParentPokemon mon, Vector2 pos, TerramonPlayer player)
        {
            NPC target = GetNearestNPC(pos);

            if (target == null)
            {
                return(false);
            }

            player.Attacking = true;
            Vector2 vel = (target.position + (target.Size / 2)) - (mon.projectile.position + (mon.projectile.Size / 2));
            var     l   = vel.Length();

            vel += target.velocity * (l / 100); //Make predict shoot
            vel.Normalize();                    //Direction
            vel *= 15;                          //Speed
            Projectile.NewProjectile((mon.projectile.position + (mon.projectile.Size / 2)), vel, ProjectileID.DD2PhoenixBowShot, 20, 1f, player.whoAmI);
            return(true);
        }
        private void SpawnPKMN6(UIMouseEvent evt, UIElement listeningElement)
        {
            Player         player    = Main.LocalPlayer;
            TerramonPlayer modPlayer = Main.LocalPlayer.GetModPlayer <TerramonPlayer>();

            if (modPlayer.sixthslotname == "*")
            {
                return;
            }
            var pokeBuff = ModContent.GetInstance <TerramonMod>().BuffType(nameof(PokemonBuff));

            if (!player.HasBuff(pokeBuff))
            {
                player.AddBuff(pokeBuff, 2);
            }

            modPlayer.ActivePetName = modPlayer.PartySlot6.GetString(nameof(BaseCaughtClass.PokemonName));
            CombatText.NewText(player.Hitbox, Color.White, "Go! " + modPlayer.sixthslotname + "!", true);
            Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/sendout"));
        }
Exemplo n.º 14
0
 public override bool OverrideAI(Projectile proj, ParentPokemon mon, TerramonPlayer player)
 {
     if (!moveDone)
     {
         NPC target = GetNearestNPC(proj.position);
         if (target == null)
         {
             moveDone = true;
         }
         proj.velocity = proj.position - target.position; //gets a line and direction to the enemy
         proj.velocity.Normalize();                       //sets it to something between 0 and 1
         proj.velocity *= 7f;                             //multiplies that angle by 7
         if (proj.Distance(target.Center) <= 10f)
         {
             target.StrikeNPC(32, 6f, proj.direction);
             moveDone = true;
         }
     }
     return(!moveDone);       //return the opposite of moveDone so that when moveDone goes true it goes back to normal AI
 }
Exemplo n.º 15
0
        // TO-DO: Make full restore cure status conditions once they are implemented
        public void UseFullRestore()
        {
            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>();

            if (modPlayer.ActivePet.HP == modPlayer.ActivePet.MaxHP)
            {
                Main.NewText($"It'll have no effect on {TerramonMod.Localisation.GetLocalisedString(new LocalisedString(modPlayer.ActivePetName))}.", Color.LightGray);
                return;
            }
            Main.PlaySound(SoundID.Item, Main.LocalPlayer.position, 13);
            Main.LocalPlayer.HeldItem.stack--;
            CombatText.NewText(projectile.Hitbox, CombatText.HealLife, modPlayer.ActivePet.Heal(modPlayer.ActivePet.MaxHP));
            for (int i = 0; i < 24; i++)
            {
                var d = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height,
                                           156, 0, 0, 0, new Color(165, 132, 206));
                d.noGravity = true;
            }
        }
Exemplo n.º 16
0
        public override void Update(Player player, ref int buffIndex)
        {
            player.noFallDmg = true;

            player.buffTime[buffIndex] = 40000;
            TerramonPlayer modPlayer = (TerramonPlayer)player.GetModPlayer(mod, "TerramonPlayer");

            modPlayer.charizardPet = true;
            bool petProjectileNotSpawned = true;

            if (player.ownedProjectileCounts[mod.ProjectileType("Charizard")] > 0)
            {
                petProjectileNotSpawned = false;
            }


            if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
            {
                Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Charizard"), 0, 0f, player.whoAmI, 0f, 0f);
            }
        }
Exemplo n.º 17
0
        public override void SetupShop(Chest shop, ref int nextSlot)
        {
            TerramonPlayer player = Main.LocalPlayer.GetModPlayer <TerramonPlayer>();

            player.premierBallRewardCounter = 0;
            shop.item[nextSlot].SetDefaults(mod.ItemType("PokeballItem"));
            nextSlot++;
            shop.item[nextSlot].SetDefaults(mod.ItemType("GreatBallItem"));
            nextSlot++;
            shop.item[nextSlot].SetDefaults(mod.ItemType("UltraBallItem"));
            nextSlot++;
            if (!Main.dayTime)
            {
                shop.item[nextSlot].SetDefaults(mod.ItemType("DuskBallItem"));
                nextSlot++;
            }

            if (NPC.downedBoss1)
            {
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyGray"));
                nextSlot++;
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyRed"));
                nextSlot++;
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyBlue"));
                nextSlot++;
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyYellow"));
                nextSlot++;
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyTeal"));
                nextSlot++;
                shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyPink"));
                nextSlot++;
                if (!Main.bloodMoon)
                {
                    shop.item[nextSlot].SetDefaults(mod.ItemType("GameBoyDark"));
                    nextSlot++;
                }
            }

            //gray blue pink purple turquoise yellow
        }
Exemplo n.º 18
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            // Finished all hits
            if (displayHitCountAndEnd)
            {
                hitCountTimer++;
                if (hitCountTimer == 55)
                {
                    BattleMode.UI.splashText.SetText($"Hit {hits} time(s)!");
                    BattleMode.queueEndMove = true;
                }
            }

            if (!displayHitCountAndEnd)
            {
                if (AnimationFrame == 1) //At initial frame we pan camera to attacker
                {
                    TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);

                    // Decide total amounts to hit
                    hits = GetHits();
                }
                else if (AnimationFrame == 140)
                {
                    BattleMode.UI.splashText.SetText("");

                    TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);
                }
                else if (AnimationFrame == 154)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 155)
                {
                    kchop = Projectile.NewProjectile(target.projectile.Center + new Vector2(-90, 0), new Vector2(12, 0), ModContent.ProjectileType <Hand>(), 0, 0);
                }
                else if (AnimationFrame == 170)
                {
                    Main.projectile[kchop].velocity = new Vector2(-12, 0);
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 188)
                {
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 190)
                {
                    Main.projectile[kchop].timeLeft = 0;
                    Main.projectile[kchop].active   = false;
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    //BattleMode.queueEndMove = true;
                }

                // SECOND HIT, GUARENTEED

                if (AnimationFrame == 250)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                    kchop     = Projectile.NewProjectile(target.projectile.Center + new Vector2(-90, 0), new Vector2(12, 0), ModContent.ProjectileType <Hand>(), 0, 0);
                }
                else if (AnimationFrame == 265)
                {
                    Main.projectile[kchop].velocity = new Vector2(-12, 0);
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 283)
                {
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 285)
                {
                    Main.projectile[kchop].timeLeft = 0;
                    Main.projectile[kchop].active   = false;
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 2 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // THIRD HIT, NOT GUARENTEED

                if (AnimationFrame == 345)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                    kchop     = Projectile.NewProjectile(target.projectile.Center + new Vector2(-90, 0), new Vector2(12, 0), ModContent.ProjectileType <Hand>(), 0, 0);
                }
                else if (AnimationFrame == 360)
                {
                    Main.projectile[kchop].velocity = new Vector2(-12, 0);
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 378)
                {
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 380)
                {
                    Main.projectile[kchop].timeLeft = 0;
                    Main.projectile[kchop].active   = false;
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 3 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // FOURTH HIT, NOT GUARENTEED

                if (AnimationFrame == 440)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                    kchop     = Projectile.NewProjectile(target.projectile.Center + new Vector2(-90, 0), new Vector2(12, 0), ModContent.ProjectileType <Hand>(), 0, 0);
                }
                else if (AnimationFrame == 455)
                {
                    Main.projectile[kchop].velocity = new Vector2(-12, 0);
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 473)
                {
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 475)
                {
                    Main.projectile[kchop].timeLeft = 0;
                    Main.projectile[kchop].active   = false;
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 4 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // FIFTH HIT, NOT GUARENTEED

                if (AnimationFrame == 535)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                    kchop     = Projectile.NewProjectile(target.projectile.Center + new Vector2(-90, 0), new Vector2(12, 0), ModContent.ProjectileType <Hand>(), 0, 0);
                }
                else if (AnimationFrame == 550)
                {
                    Main.projectile[kchop].velocity = new Vector2(-12, 0);
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 568)
                {
                    Vector2 stored = target.projectile.position;

                    for (int i = 0; i < 16; i++)
                    {
                        Dust.NewDust(stored, target.projectile.width, target.projectile.height,
                                     ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"), 0, 0, 0, Color.White);
                    }
                }
                else if (AnimationFrame == 570)
                {
                    Main.projectile[kchop].timeLeft = 0;
                    Main.projectile[kchop].active   = false;
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 5 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                AnimationFrame        = 0;
                hits                  = 0;
                hitCountTimer         = 0;
                displayHitCountAndEnd = false;
                BattleMode.moveEnd    = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
 protected virtual void PostPokeballThrown(TerramonPlayer terramonPlayer, int thrownPokeballsCount)
 {
 }
 protected virtual void OnPokeballThrown(TerramonPlayer terramonPlayer)
 {
     terramonPlayer.IncrementThrownPokeballs(this);
 }
Exemplo n.º 21
0
        public override void AI()
        {
            //Fix shifted hitbox
            var rect = projectile.Hitbox;

            rect.X      -= rect.Width;
            rect.Y      -= rect.Height;
            rect.Width  *= 2;
            rect.Height *= 2;
            //Set flag if hovered
            highlighted = rect.Contains(Main.MouseWorld.ToPoint());

            if (!highlighted)
            {
                justHighlighted = false;
            }

            if (!Wild && !flying)
            {
                PuppyAI();
            }

            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>();

            if (modPlayer.ActivePetShiny)
            {
                shiny = true;
            }
            else
            {
                shiny = false;
            }

            //Animations

            if (!Wild)
            {
                projectile.spriteDirection = projectile.velocity.X > 0 ? -1 : (projectile.velocity.X < 0 ? 1 : projectile.spriteDirection);

                if (highlighted && Main.mouseRight)
                {
                    if (Main.mouseRightRelease)
                    {
                        if (HoldingPotion())
                        {
                            UsePotion();
                        }
                        if (HoldingSuperPotion())
                        {
                            UseSuperPotion();
                        }
                        if (HoldingHyperPotion())
                        {
                            UseHyperPotion();
                        }
                        if (HoldingMaxPotion())
                        {
                            UseMaxPotion();
                        }
                        if (HoldingFullRestore())
                        {
                            UseFullRestore();
                        }
                    }
                }
            }

            if (projectile.velocity.X != 0 || projectile.velocity.Y > 1 && !Wild)
            {
                frameCounter++;
                if (frameCounter > 15)
                {
                    frame       += 1;
                    frameCounter = 0;
                    if (frame >= Main.projFrames[projectile.type])
                    {
                        frame = 0;
                    }
                }
            }
            else
            {
                frame        = 1;
                frameCounter = 0;
            }

            if (Wild)
            {
                frameCounter++;
                if (frameCounter > 15)
                {
                    frame       += 1;
                    frameCounter = 0;
                    if (frame >= Main.projFrames[projectile.type])
                    {
                        frame = 0;
                    }
                }
            }

            SpawnTime++;
            if (SpawnTime == 1 && player.active)
            {
                if (player.direction == -1) // direction right
                {
                    projectile.direction = -1;
                }
                else
                {
                    projectile.direction = 1;
                }

                string n = Regex.Replace(projectile.Name, nameMatcher, "$1 ");

                if (n == "Nidoran ♂")
                {
                    n = "Nidoranm";
                }
                if (n == "Nidoran ♀")
                {
                    n = "Nidoranf";
                }
                if (n == "Mr. Mime")
                {
                    n = "Mrmime";
                }

                if (!Main.dedServ)
                {
                    Main.PlaySound(ModContent.GetInstance <TerramonMod>()
                                   .GetLegacySoundSlot(SoundType.Custom, "Sounds/Cries/cry" + n).WithVolume(0.55f));
                }

                for (int i = 0; i < 18; i++)
                {
                    Dust.NewDust(projectile.position, projectile.width, projectile.height,
                                 mod.DustType("SmokeTransformDust"));
                }
            }

            /// <summary>
            /// Battling animations
            /// </summary>

            // Damage received

            if (damageReceived)
            {
                damageReceivedTimer++;
                if (damageReceivedTimer <= 10)
                {
                    flashFrame = true;
                }
                if (damageReceivedTimer >= 11 && damageReceivedTimer <= 20)
                {
                    flashFrame = false;
                }
                if (damageReceivedTimer >= 21 && damageReceivedTimer <= 30)
                {
                    flashFrame = true;
                }
                if (damageReceivedTimer >= 31 && damageReceivedTimer <= 40)
                {
                    flashFrame = false;
                }
                if (damageReceivedTimer >= 41 && damageReceivedTimer <= 50)
                {
                    flashFrame = true;
                }
                if (damageReceivedTimer >= 51 && damageReceivedTimer <= 60)
                {
                    flashFrame          = false;
                    damageReceived      = false;
                    damageReceivedTimer = 0;
                }
            }

            // Health restoration

            if (healedHealth)
            {
                healedHealthTimer++;
                if (healedHealthTimer < 90)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        Dust dust1 = Dust.NewDustDirect(projectile.position + new Vector2(Main.rand.Next(-7, 7), Main.rand.Next(-7, 7)), projectile.width, projectile.height, 74, 0f, 0f, 0, Color.White, 0.75f);
                        dust1.alpha      = 100;
                        dust1.velocity.Y = -3f;
                        dust1.noGravity  = true;
                    }
                }
                else
                {
                    healedHealthTimer = 0;
                    healedHealth      = false;
                }
            }

            // Stat modified up

            if (statModifiedUp)
            {
                statModifiedUpTimer++;
                if (statModifiedUpTimer < 90)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        Dust dust1 = Dust.NewDustDirect(projectile.position + new Vector2(Main.rand.Next(-7, 7), Main.rand.Next(-7, 7)), projectile.width, projectile.height, 182, 0f, 0f, 0, Color.White, 0.75f);
                        dust1.alpha      = 100;
                        dust1.velocity.Y = -1.7f;
                        dust1.noGravity  = true;
                    }
                }
                else
                {
                    statModifiedUpTimer = 0;
                    statModifiedUp      = false;
                }
            }

            // Stat modified down

            if (statModifiedDown)
            {
                statModifiedDownTimer++;
                if (statModifiedDownTimer < 90)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        Dust dust1 = Dust.NewDustDirect(projectile.position + new Vector2(Main.rand.Next(-7, 7), Main.rand.Next(-7, 7)), projectile.width, projectile.height, 56, 0f, 0f, 0, Color.White, 0.75f);
                        dust1.alpha      = 100;
                        dust1.velocity.Y = 1.25f;
                        dust1.noGravity  = true;
                    }
                }
                else
                {
                    statModifiedDownTimer = 0;
                    statModifiedDown      = false;
                }
            }

            // Getting pumped (Currently obsolete)

            if (gettingPumped)
            {
                gettingPumped = false;
            }

            /// <summary>
            /// End battling animations
            /// </summary>

            if (hopTimer <= 1)
            {
                lockedPosX = projectile.position.X;
            }

            if (Wild)
            {
                hopTimer++;
                projectile.timeLeft = 5;
                //projectile.tileCollide = false;
                if (hopTimer >= 40 && hopTimer <= 48)
                {
                    projectile.velocity.Y += -0.4f;
                    jumping = true;
                }
                if (hopTimer >= 48)
                {
                    jumping = false;
                }
                if (hopTimer >= 62 && hopTimer <= 72)
                {
                    projectile.velocity.Y += -0.4f;
                    jumping = true;
                }
                if (hopTimer >= 72)
                {
                    jumping = false;
                }
                if (!jumping)
                {
                    projectile.velocity.Y = 1f;
                }
                projectile.position.X      = lockedPosX;
                projectile.spriteDirection = projectile.position.X > player.position.X ? 1 : -1;
                return;
            }

            if (!player.active)
            {
                projectile.timeLeft = 0;
            }


            if (player.dead)
            {
                modPlayer.ResetEffects();
                modPlayer.ActivePetId = -1;
            }

            if (modPlayer.IsPetActive(GetType().Name))
            {
                projectile.timeLeft = 2;
            }
            else if ((modPlayer.Battle?.awaitSync ?? false) || modPlayer.Battle?.WildNPC == this)
            {
                projectile.timeLeft = 2;
                Wild = true;
            }

            if (modPlayer.ActiveMove != null)
            {
                if (modPlayer.ActiveMove.OverrideAI(this, modPlayer))
                {
                    aiType = 0;
                }
            }
            else if (modPlayer.Battle?.AIOverride(this) != null) //If used inside battle
            {
                var t = modPlayer.Battle?.AIOverride(this);
                t.TurnAnimation = true;
                if (t.OverrideAI(this, modPlayer))
                {
                    aiType = 0;
                }

                t.TurnAnimation = false;
            }
            else if (aiType == 0)
            {
                aiType = mainAi;
            }

            if (modPlayer.Attacking)
            {
                AttackDuration++;
                if (AttackDuration < 60)
                {
                    if (projectile.type == ModContent.ProjectileType <Bulbasaur>())
                    {
                        Projectile.NewProjectile(projectile.position.X + 23, projectile.position.Y + 8, 0f, 0f,
                                                 ModContent.ProjectileType <AngerOverlay>(), 0, 0, Main.myPlayer);
                    }

                    AttackDuration = 0;
                }
                else
                {
                    // dont make any more.
                }
            }
            else
            {
            }
        }
Exemplo n.º 22
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140) //Move animation begin after 140 frames
            {
                BattleMode.UI.splashText.SetText("");

                MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));

                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.Center.X, 300, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.Center.Y - 60, 300, Easing.OutExpo);

                acidBubble = Projectile.NewProjectile(mon.projectile.Center + new Vector2(0, -60), new Vector2(0, 0), ModContent.ProjectileType <AcidBubble>(), 0, 0);
                Main.projectile[acidBubble].maxPenetrate = 99;
                Main.projectile[acidBubble].penetrate    = 99;
            }
            else if (AnimationFrame == 170)
            {
                acidBubble1 = Projectile.NewProjectile(Main.projectile[acidBubble].position, new Vector2(0, 0), ModContent.ProjectileType <AcidBubble>(), 0, 0);
                Main.projectile[acidBubble1].alpha        = 0;
                Main.projectile[acidBubble1].maxPenetrate = 99;
                Main.projectile[acidBubble1].penetrate    = 99;
                Main.projectile[acidBubble].timeLeft      = 0;
            }
            else if (AnimationFrame == 300)//At Last frame we destroy new proj
            {
                InflictDamage(mon, target, player, attacker, deffender, state, opponent);

                // create some particles

                for (int i = 0; i < 50; i++)
                {
                    Dust dust1 = Dust.NewDustDirect(target.projectile.position, target.projectile.width, target.projectile.height, 86, 0f, 0f, 0);
                    dust1.alpha     = 0;
                    dust1.noGravity = true;
                }

                var id = acidBubble1;
                if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                {
                    CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                }
                Main.projectile[id].timeLeft = 0;
                Main.projectile[id].active   = false;
                BattleMode.queueEndMove      = true;
            }

            if (AnimationFrame > 170 && AnimationFrame < 301)
            {
                Main.projectile[acidBubble1].position = Interpolation.ValueAt(AnimationFrame, mon.projectile.Center + new Vector2(0, -60), target.projectile.position, 170, 300,
                                                                              Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosX(Main.projectile[acidBubble1].position.X, 1, Easing.None);
                TerramonMod.ZoomAnimator.ScreenPosY(Main.projectile[acidBubble1].position.Y, 1, Easing.None);
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                endMoveTimer++;

                // Acid deals damage and has a 10% chance of lowering the target's Special Defense by one stage.
                if (endMoveTimer == 1 && Main.rand.NextFloat() > .1323f)
                {
                    endMoveTimer       = 0;
                    AnimationFrame     = 0;
                    BattleMode.moveEnd = false;
                    return(false);
                }

                if (endMoveTimer == 50)
                {
                    s = ModifyStat(deffender, target, GetStat.SpDef, -1, state, opponent).ToString();
                    if (s.Contains("won't go"))
                    {
                        endMoveTimer = 190;
                    }

                    TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);
                }
                if (endMoveTimer == 190)
                {
                    BattleMode.UI.splashText.SetText(s);
                }
                if (endMoveTimer >= 330)
                {
                    endMoveTimer       = 0;
                    AnimationFrame     = 0;
                    BattleMode.moveEnd = false;
                    return(false);
                }
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 23
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140)
            {
                BattleMode.UI.splashText.SetText("");

                mon.useAi = false;
                mon.projectile.tileCollide = false;

                oldCenter = mon.projectile.Center;

                someCenterPoint = mon.projectile.Center + new Vector2(0, -20);

                for (int i = 0; i < 10; i++)
                {
                    Dust.NewDust(mon.projectile.Center, mon.projectile.width, mon.projectile.height,
                                 ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"));
                }

                MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
            }
            else if (AnimationFrame == 170)
            {
                for (int i = 0; i < 10; i++)
                {
                    Dust.NewDust(oldCenter, mon.projectile.width, mon.projectile.height,
                                 ModContent.GetInstance <TerramonMod>().DustType("SmokeTransformDust"));
                }

                mon.projectile.Center = oldCenter;

                if (mon.projectile.spriteDirection == -1)
                {
                    adder = 10;
                }
                else
                {
                    adder = -10;
                }

                xposStart  = (int)mon.projectile.position.X;
                xposTarget = (int)mon.projectile.position.X + adder;
            }
            else if (AnimationFrame == 235)
            {
                string s = ModifyStat(attacker, mon, GetStat.Speed, 2, state, !opponent).ToString();
                BattleMode.UI.splashText.SetText(s);
            }
            else if (AnimationFrame >= 385)
            {
                mon.useAi = true;
                mon.projectile.tileCollide = true;
                AnimationFrame             = 0;
                someCenterPoint            = Vector2.Zero;
                oldCenter          = Vector2.Zero;
                rotTimer           = 0;
                xposStart          = 0;
                xposTarget         = 0;
                adder              = 0;
                AnimationFrame     = 0;
                BattleMode.moveEnd = false;
                return(false);
            }
            else if (AnimationFrame > 170 && AnimationFrame < 177)
            {
                mon.projectile.position.X = Interpolation.ValueAt(AnimationFrame, xposStart, xposTarget, 170, 176,
                                                                  Easing.None);
            }
            else if (AnimationFrame > 176 && AnimationFrame < 185)
            {
                mon.projectile.position.X = Interpolation.ValueAt(AnimationFrame, xposTarget, xposStart - adder, 176, 184,
                                                                  Easing.None);
            }
            else if (AnimationFrame > 184 && AnimationFrame < 191)
            {
                mon.projectile.position.X = Interpolation.ValueAt(AnimationFrame, xposStart - adder, xposStart, 184, 190,
                                                                  Easing.None);
            }

            if (AnimationFrame > 140 && AnimationFrame < 170)
            {
                rotTimer += MathHelper.Pi * 6f / 30;

                mon.projectile.Center = someCenterPoint + Vector2.One.RotatedBy(rotTimer) * 6.3f;
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
        public override void Update(GameTime gameTime)
        {
            // Don't delete this or the UIElements attached to this UIState will cease to function.
            base.Update(gameTime);
            if (TerramonMod.PartyUIAutoMode == false || TerramonMod.PartyUIReverseAutoMode == false)
            {
                if (TerramonMod.PartyUITheme == false)
                {
                    mainPanel.BackgroundColor = new Color(255, 250, 250) * 0.5f;
                }
                else
                {
                    mainPanel.BackgroundColor = new Color(50, 50, 50) * 0.5f;
                }
            }
            if (TerramonMod.PartyUIAutoMode == true)
            {
                if (!Main.dayTime)
                {
                    mainPanel.BackgroundColor = new Color(50, 50, 50) * 0.5f;
                }
                else
                {
                    mainPanel.BackgroundColor = new Color(255, 250, 250) * 0.5f;
                }
            }
            else if (TerramonMod.PartyUIReverseAutoMode == true)
            {
                if (!Main.dayTime)
                {
                    mainPanel.BackgroundColor = new Color(255, 250, 250) * 0.5f;
                }
                else
                {
                    mainPanel.BackgroundColor = new Color(50, 50, 50) * 0.5f;
                }
            }

            TerramonPlayer modPlayer = Main.LocalPlayer.GetModPlayer <TerramonPlayer>();

            if (modPlayer.firstslotname != "*")
            {
                firstpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.firstslotname));
                firstpkmn.test1     = firstpkmntexture;
                firstpkmn.HoverText = modPlayer.firstslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                      $"\nLVL: {modPlayer.PartySlot1.GetInt(nameof(BaseCaughtClass.Level))}" +
                                      $"\nEXP: {modPlayer.PartySlot1.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                      $"\nLeft click to send out!";
                firstpkmn.Recalculate();
            }
            if (modPlayer.secondslotname != "*")
            {
                secondpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.secondslotname));
                secondpkmn.test2     = secondpkmntexture;
                secondpkmn.HoverText = modPlayer.secondslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                       $"\nLVL: {modPlayer.PartySlot2.GetInt(nameof(BaseCaughtClass.Level))}" +
                                       $"\nEXP: {modPlayer.PartySlot2.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                       $"\nLeft click to send out!";
                secondpkmn.Recalculate();
            }
            if (modPlayer.thirdslotname != "*")
            {
                thirdpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.thirdslotname));
                thirdpkmn.test3     = thirdpkmntexture;
                thirdpkmn.HoverText = modPlayer.thirdslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                      $"\nLVL: {modPlayer.PartySlot3.GetInt(nameof(BaseCaughtClass.Level))}" +
                                      $"\nEXP: {modPlayer.PartySlot3.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                      $"\nLeft click to send out!";
                thirdpkmn.Recalculate();
            }
            if (modPlayer.fourthslotname != "*")
            {
                fourthpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.fourthslotname));
                fourthpkmn.test4     = fourthpkmntexture;
                fourthpkmn.HoverText = modPlayer.fourthslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                       $"\nLVL: {modPlayer.PartySlot4.GetInt(nameof(BaseCaughtClass.Level))}" +
                                       $"\nEXP: {modPlayer.PartySlot4.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                       $"\nLeft click to send out!";
                fourthpkmn.Recalculate();
            }
            if (modPlayer.fifthslotname != "*")
            {
                fifthpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.fifthslotname));
                fifthpkmn.test5     = fifthpkmntexture;
                fifthpkmn.HoverText = modPlayer.fifthslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                      $"\nLVL: {modPlayer.PartySlot5.GetInt(nameof(BaseCaughtClass.Level))}" +
                                      $"\nEXP: {modPlayer.PartySlot5.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                      $"\nLeft click to send out!";
                fifthpkmn.Recalculate();
            }
            if (modPlayer.sixthslotname != "*")
            {
                sixthpkmn.SetImage(ModContent.GetTexture("Terramon/Minisprites/Regular/SidebarSprites/" + modPlayer.sixthslotname));
                sixthpkmn.test6     = sixthpkmntexture;
                sixthpkmn.HoverText = modPlayer.sixthslotname + $"[i:{ModContent.ItemType<Items.Pokeballs.SidebarPKBALL>()}]" +
                                      $"\nLVL: {modPlayer.PartySlot6.GetInt(nameof(BaseCaughtClass.Level))}" +
                                      $"\nEXP: {modPlayer.PartySlot6.GetInt(nameof(BaseCaughtClass.Exp))}" +
                                      $"\nLeft click to send out!";
                sixthpkmn.Recalculate();
            }
        }
        public override void AI()
        {
            Player         player    = Main.player[projectile.owner];
            TerramonPlayer modPlayer = player.GetModPlayer <TerramonPlayer>();

            if (modPlayer.ActivePetShiny)
            {
                shiny = true;
            }
            else
            {
                shiny = false;
            }

            //Animations

            projectile.spriteDirection = projectile.velocity.X > 0 ? -1 : (projectile.velocity.X < 0 ? 1 : projectile.spriteDirection);

            if (projectile.velocity.X != 0 || projectile.velocity.Y > 1)
            {
                frameCounter++;
                if (frameCounter > 15)
                {
                    frame       += 1;
                    frameCounter = 0;
                    if (frame >= Main.projFrames[projectile.type])
                    {
                        frame = 0;
                    }
                }
            }
            else
            {
                frame        = 1;
                frameCounter = 0;
            }

            SpawnTime++;
            if (SpawnTime == 1)
            {
                if (player.direction == -1) // direction right
                {
                    projectile.direction = -1;
                }
                else
                {
                    projectile.direction = 1;
                }
                if (!Main.dedServ)
                {
                    Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/Cries/Kanto/cry" + projectile.Name).WithVolume(0.55f));
                }

                for (int i = 0; i < 18; i++)
                {
                    Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("SmokeTransformDust"));
                }
            }

            if (player.dead)
            {
                modPlayer.ResetEffects();
                modPlayer.ActivePetId = -1;
            }

            if (modPlayer.IsPetActive(GetType().Name))
            {
                projectile.timeLeft = 2;
            }

            if (modPlayer.ActiveMove != null)
            {
                if (modPlayer.ActiveMove.OverrideAI(projectile, this, modPlayer))
                {
                    aiType = 0;
                }
            }
            else if (aiType == 0)
            {
                aiType = mainAi;
            }

            if (modPlayer.Attacking)
            {
                AttackDuration++;
                if (AttackDuration < 60)
                {
                    if (projectile.type == ModContent.ProjectileType <Bulbasaur>())
                    {
                        Projectile.NewProjectile(projectile.position.X + 23, projectile.position.Y + 8, 0f, 0f, ModContent.ProjectileType <AngerOverlay>(), 0, 0, Main.myPlayer);
                    }
                    AttackDuration = 0;
                }
                else
                {
                    // dont make any more.
                }
            }
            else
            {
            }
        }
Exemplo n.º 26
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140) //Move animation begin after 140 frames
            {
                BattleMode.UI.splashText.SetText("");

                Vector2 vel = (target.projectile.position + (target.projectile.Size / 2)) - (mon.projectile.position + (mon.projectile.Size / 2));
                vel.Normalize();
                vel *= 15;
                int id = Projectile.NewProjectile(mon.projectile.position, vel,
                                                  ProjectileID.DD2PhoenixBowShot, 0, 0);
                Main.projectile[id].maxPenetrate = 99;
                Main.projectile[id].penetrate    = 99;
                Main.projectile[id].tileCollide  = false;

                if (attacker.CustomData.ContainsKey(PROJID_KEY))
                {
                    attacker.CustomData[PROJID_KEY] = id.ToString();
                }
                else
                {
                    attacker.CustomData.Add(PROJID_KEY, id.ToString());
                }
            }
            else if (AnimationFrame == 260)//At Last frame we destroy new proj
            {
                InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                var id = int.Parse(attacker.CustomData[PROJID_KEY]);
                if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                {
                    CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                }
                Main.projectile[id].timeLeft = 0;
                Main.projectile[id].active   = false;
                BattleMode.queueEndMove      = true;
            }
            else if (AnimationFrame > 140 && AnimationFrame < 261)
            {
                var id = int.Parse(attacker.CustomData[PROJID_KEY]);
                //Vector2 vel = (target.projectile.position + (target.projectile.Size / 2)) - (mon.projectile.position + (mon.projectile.Size / 2));
                //var l = vel.Length();
                //vel.Normalize();
                //Main.projectile[id].position = mon.projectile.position + (vel * (l * (AnimationFrame / 120)));
                Main.projectile[id].position = Interpolation.ValueAt(AnimationFrame, mon.projectile.position, target.projectile.position, 140, 260,
                                                                     Easing.Out);
                TerramonMod.ZoomAnimator.ScreenPosX(Main.projectile[id].position.X, 1, Easing.None);
                TerramonMod.ZoomAnimator.ScreenPosY(Main.projectile[id].position.Y, 1, Easing.None);
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                AnimationFrame     = 0;
                BattleMode.moveEnd = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 27
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            // Finished all hits
            if (displayHitCountAndEnd)
            {
                hitCountTimer++;
                if (hitCountTimer == 55)
                {
                    BattleMode.UI.splashText.SetText($"Hit {hits} time(s)!");
                    BattleMode.queueEndMove = true;
                }
            }

            if (!displayHitCountAndEnd)
            {
                if (AnimationFrame == 1) //At initial frame we pan camera to attacker
                {
                    TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);

                    // Decide total amounts to hit
                    hits = GetHits();
                }
                else if (AnimationFrame == 140)
                {
                    BattleMode.UI.splashText.SetText("");

                    TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);
                }
                else if (AnimationFrame == 154)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 155)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 160)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 165)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 170)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 175)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 210)
                {
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                }

                // SECOND HIT, GUARENTEED

                //if (AnimationFrame == 269) MoveSound = Main.PlaySound(ModContent.GetInstance<TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                else if (AnimationFrame == 270)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 275)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 280)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 285)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 290)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 295)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 330)
                {
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 2 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // THIRD HIT, NOT GUARENTEED

                //if (AnimationFrame == 389) MoveSound = Main.PlaySound(ModContent.GetInstance<TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                else if (AnimationFrame == 390)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 395)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 400)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 405)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 410)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 415)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 450)
                {
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 3 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // FOURTH HIT, NOT GUARENTEED

                //if (AnimationFrame == 509) MoveSound = Main.PlaySound(ModContent.GetInstance<TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                else if (AnimationFrame == 510)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 515)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 520)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 525)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 530)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 535)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 570)
                {
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 4 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }

                // FIFTH HIT, NOT GUARENTEED

                //if (AnimationFrame == 629) MoveSound = Main.PlaySound(ModContent.GetInstance<TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                else if (AnimationFrame == 630)
                {
                    MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));
                }
                else if (AnimationFrame == 635)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 640)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 645)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 650)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 655)
                {
                    Projectile.NewProjectile(target.projectile.Center + new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18)), Vector2.Zero, ModContent.ProjectileType <CometPunchFist>(), 0, 0);
                }
                else if (AnimationFrame == 690)
                {
                    InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                    if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                    {
                        CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                    }
                    if (hits == 5 || deffender.HP == 0)
                    {
                        displayHitCountAndEnd = true;
                    }
                }
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                AnimationFrame        = 0;
                hits                  = 0;
                hitCountTimer         = 0;
                displayHitCountAndEnd = false;
                BattleMode.moveEnd    = false;
                return(false);
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 28
0
        public override int Cooldown => 20 * 60; //20 sec cooldown

        public override int AutoUseWeight(Projectile proj, ParentPokemon mon, Vector2 target, TerramonPlayer player)
        {
            Player pl = Main.player[player.whoAmI];

            if (!(pl.statLife < pl.statLifeMax - (100 * (pl.statLifeMax / 500f))))
            {
                return(0);
            }
            return((int)Math.Round(100 * ((float)pl.statLife / pl.statLifeMax))); // The less hp left, the more chance to cast
        }
Exemplo n.º 29
0
        public override bool AnimateTurn(ParentPokemon mon, ParentPokemon target, TerramonPlayer player, PokemonData attacker,
                                         PokemonData deffender, BattleState state, bool opponent)
        {
            if (AnimationFrame == 1) //At initial frame we pan camera to attacker
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
            }
            else if (AnimationFrame == 140) //Move animation begin after 140 frames
            {
                BattleMode.UI.splashText.SetText("");

                MoveSound = Main.PlaySound(ModContent.GetInstance <TerramonMod>().GetLegacySoundSlot(SoundType.Custom, "Sounds/UI/BattleSFX/" + MoveName).WithVolume(.75f));

                TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);

                a      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore1 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + a, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore1].maxPenetrate = 99;
                Main.projectile[spore1].penetrate    = 99;
            }
            else if (AnimationFrame == 155)
            {
                b      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore2 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + b, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore2].maxPenetrate = 99;
                Main.projectile[spore2].penetrate    = 99;
            }
            else if (AnimationFrame == 170)
            {
                c      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore3 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + c, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore3].maxPenetrate = 99;
                Main.projectile[spore3].penetrate    = 99;
            }
            else if (AnimationFrame == 185)
            {
                TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
                d      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore4 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + d, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore4].maxPenetrate = 99;
                Main.projectile[spore4].penetrate    = 99;
            }
            else if (AnimationFrame == 200)
            {
                e      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore5 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + e, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore5].maxPenetrate = 99;
                Main.projectile[spore5].penetrate    = 99;
            }
            else if (AnimationFrame == 215)
            {
                f      = new Vector2(Main.rand.Next(-18, 18), Main.rand.Next(-18, 18));
                spore6 = Projectile.NewProjectile(target.projectile.Hitbox.Center() + f, new Vector2(0, 0), ModContent.ProjectileType <AbsorbSpore>(), 0, 0);
                Main.projectile[spore6].maxPenetrate = 99;
                Main.projectile[spore6].penetrate    = 99;
            }
            else if (AnimationFrame == 265)//At Last frame we destroy new proj
            {
                TerramonMod.ZoomAnimator.ScreenPosX(target.projectile.position.X + 12, 500, Easing.OutExpo);
                TerramonMod.ZoomAnimator.ScreenPosY(target.projectile.position.Y, 500, Easing.OutExpo);
                damageDealt = InflictDamage(mon, target, player, attacker, deffender, state, opponent);
                if (PostTextLoc.Args.Length >= 4)                                                                      //If we can extract damage number
                {
                    CombatText.NewText(target.projectile.Hitbox, CombatText.DamagedHostile, (int)PostTextLoc.Args[3]); //Print combat text at attacked mon position
                }
                Main.projectile[spore1].timeLeft = 0;
                Main.projectile[spore1].active   = false;
                Main.projectile[spore2].timeLeft = 0;
                Main.projectile[spore2].active   = false;
                Main.projectile[spore3].timeLeft = 0;
                Main.projectile[spore3].active   = false;
                Main.projectile[spore4].timeLeft = 0;
                Main.projectile[spore4].active   = false;
                Main.projectile[spore5].timeLeft = 0;
                Main.projectile[spore5].active   = false;
                Main.projectile[spore6].timeLeft = 0;
                Main.projectile[spore6].active   = false;
                BattleMode.queueEndMove          = true;
            }

            else if (AnimationFrame > 140 && AnimationFrame < 265)
            {
                //Vector2 vel = (target.projectile.position + (target.projectile.Size / 2)) - (mon.projectile.position + (mon.projectile.Size / 2));
                //var l = vel.Length();
                //vel.Normalize();
                //Main.projectile[id].position = mon.projectile.position + (vel * (l * (AnimationFrame / 120)));
                if (AnimationFrame < 190)
                {
                    var pos = Main.projectile[spore1].position;
                    Main.projectile[spore1].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + a, mon.projectile.Hitbox.Center(), 140, 190,
                                                                             Easing.Out);
                    AbsorbSpore ai = (AbsorbSpore)Main.projectile[spore1].modProjectile;
                    ai.vel = Main.projectile[spore1].position - pos;
                }
                if (AnimationFrame > 155 && AnimationFrame < 205)
                {
                    var pos = Main.projectile[spore2].position;
                    Main.projectile[spore2].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + b, mon.projectile.Hitbox.Center(), 155, 205,
                                                                             Easing.Out);
                    AbsorbSpore bi = (AbsorbSpore)Main.projectile[spore2].modProjectile;
                    bi.vel = Main.projectile[spore2].position - pos;
                }
                if (AnimationFrame > 170 && AnimationFrame < 220)
                {
                    var pos = Main.projectile[spore3].position;
                    Main.projectile[spore3].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + c, mon.projectile.Hitbox.Center(), 170, 220,
                                                                             Easing.Out);
                    AbsorbSpore ci = (AbsorbSpore)Main.projectile[spore3].modProjectile;
                    ci.vel = Main.projectile[spore3].position - pos;
                }
                if (AnimationFrame > 185 && AnimationFrame < 235)
                {
                    var pos = Main.projectile[spore4].position;
                    Main.projectile[spore4].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + d, mon.projectile.Hitbox.Center(), 185, 235,
                                                                             Easing.Out);
                    AbsorbSpore di = (AbsorbSpore)Main.projectile[spore4].modProjectile;
                    di.vel = Main.projectile[spore4].position - pos;
                }
                if (AnimationFrame > 200 && AnimationFrame < 250)
                {
                    var pos = Main.projectile[spore5].position;
                    Main.projectile[spore5].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + e, mon.projectile.Hitbox.Center(), 200, 250,
                                                                             Easing.Out);
                    AbsorbSpore ei = (AbsorbSpore)Main.projectile[spore5].modProjectile;
                    ei.vel = Main.projectile[spore5].position - pos;
                }
                if (AnimationFrame > 215 && AnimationFrame < 265)
                {
                    var pos = Main.projectile[spore6].position;
                    Main.projectile[spore6].position = Interpolation.ValueAt(AnimationFrame, target.projectile.Hitbox.Center() + f, mon.projectile.Hitbox.Center(), 215, 265,
                                                                             Easing.Out);
                    AbsorbSpore fi = (AbsorbSpore)Main.projectile[spore6].modProjectile;
                    fi.vel = Main.projectile[spore6].position - pos;
                }
            }

            // This should be at the very bottom of AnimateTurn() in every move.
            if (BattleMode.moveEnd)
            {
                endMoveTimer++;
                if (endMoveTimer >= 50 && endMoveTimer < 190)
                {
                    if (opponent)
                    {
                        BattleMode.UI.splashText.SetText($"{deffender.PokemonName} had its energy drained!");
                    }
                    else
                    {
                        if (state == BattleState.BattleWithWild)
                        {
                            BattleMode.UI.splashText.SetText($"The wild {deffender.PokemonName} had its energy drained!");
                        }
                        else
                        if (state == BattleState.BattleWithTrainer)
                        {
                            BattleMode.UI.splashText.SetText($"The foe's {deffender.PokemonName} had its energy drained!");
                        }
                    }
                    //TerramonMod.ZoomAnimator.ScreenPos(mon.projectile.position + new Vector2(12, 0), 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosX(mon.projectile.position.X + 12, 500, Easing.OutExpo);
                    TerramonMod.ZoomAnimator.ScreenPosY(mon.projectile.position.Y, 500, Easing.OutExpo);
                    //BattleMode.animWindow = 0;
                }
                if (endMoveTimer == 190)
                {
                    BattleMode.UI.splashText.SetText("");
                    // If this attack deals 1 HP of damage, 1 HP will be restored to the user.
                    if ((int)damageDealt == 1)
                    {
                        CombatText.NewText(mon.projectile.Hitbox, CombatText.HealLife, SelfHeal(attacker, mon, 1));
                    }
                    else
                    {
                        CombatText.NewText(mon.projectile.Hitbox, CombatText.HealLife, SelfHeal(attacker, mon, (int)damageDealt / 2));
                    }
                }
                if (endMoveTimer >= 330)
                {
                    endMoveTimer       = 0;
                    AnimationFrame     = 0;
                    BattleMode.moveEnd = false;
                    return(false);
                }
            }

            // IGNORE EVERYTHING BELOW WHEN MAKING YOUR OWN MOVES.
            if (AnimationFrame > 1810)
            {
                return(false);
            }

            return(true);
        }
        private void Catch(ref Projectile proj, ref bool crit, ref int dmg, int type)
        {
            var PokeNam = Regex.Replace(HomeClass().Name, nameMatcher, "$1 ");

            if (pokeName.Value != PokeNam)
            {
                pokeName = TerramonMod.Localisation.GetLocalisedString(new LocalisedString(PokeNam));
            }
            proj.ai[1] = 2;
            crit       = false;
            dmg        = npc.lifeMax;
            CreateDust(4);
            CombatText.NewText(npc.Hitbox, Color.Orange, $"{pokeName.Value} was caught!", true);

            TerramonPlayer modPlayer = Main.LocalPlayer.GetModPlayer <TerramonPlayer>();

            modPlayer.PartySlot2 = new PokemonData()
            {
                Pokemon      = HomeClass().Name,
                pokeballType = 1
            };
            modPlayer.secondslotname = modPlayer.PartySlot2.PokemonName;

            return;

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                var packet = new BaseCatchPacket();
                packet.Send((TerramonMod)mod, HomeClass().Name, npc.TypeName, npc.getRect(), type, shiny);
            }
            else
            {
                if (Main.netMode == NetmodeID.Server)
                {
                    BaseCaughtClass.writeDetour(HomeClass().Name, npc.TypeName, GetSmallSpritePath(npc), 1, "", shiny);
                }

                int index = Item.NewItem(npc.getRect(), type);
                if (index >= 400)
                {
                    return;
                }

                if (Main.netMode == NetmodeID.Server)
                {
                    return;
                }

                if (!(Main.item[index].modItem is BaseCaughtClass item))
                {
                    return;
                }
                item.PokeData = new PokemonData()
                {
                    Pokemon = HomeClass().Name,
                };
                if (shiny)
                {
                    item.isShiny = true;
                }
                else
                {
                    item.isShiny = false;
                }

                item.CapturedPokemon = HomeClass().Name;
            }
        }