Exemplo n.º 1
0
 public override void BonusProjectiles(Player player, OrchidModPlayer modPlayer, Projectile projectile, OrchidModGlobalProjectile modProjectile, bool dummy)
 {
     if (modProjectile.gamblerInternalCooldown == 0)
     {
         modProjectile.gamblerInternalCooldown = 30;
         float scale    = 1f - (Main.rand.NextFloat() * .3f);
         int   rand     = Main.rand.Next(3) + 1;
         int   projType = ProjectileType <Gambler.Projectiles.ForestCardProj>();
         for (int i = 0; i < rand; i++)
         {
             Vector2 target  = Main.MouseWorld;
             Vector2 heading = target - projectile.position;
             heading.Normalize();
             heading *= new Vector2(0f, 10f).Length();
             Vector2 vel = heading.RotatedByRandom(MathHelper.ToRadians(30));
             vel = vel * scale;
             int newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, projType, projectile.damage, projectile.knockBack, player.whoAmI), dummy);
             Main.projectile[newProjectile].ai[1]     = 1f;
             Main.projectile[newProjectile].netUpdate = true;
             if (i == 0)
             {
                 OrchidModProjectile.spawnDustCircle(projectile.Center, 31, 10, 10, true, 1.5f, 1f, 5f, true, true, false, 0, 0, true);
             }
         }
     }
 }
Exemplo n.º 2
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
            int projType = ProjectileType <Gambler.Projectiles.SkyCardProjAlt>();

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI && proj.ai[1] == 0f)
                {
                    float distance = (position - proj.Center).Length();
                    if (distance < 500f)
                    {
                        return;
                    }
                }
            }

            Vector2 vel           = (new Vector2(0f, -1f).RotatedBy(MathHelper.ToRadians(10)));
            int     newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);

            Main.projectile[newProjectile].ai[1]     = 0f;
            Main.projectile[newProjectile].netUpdate = true;
            for (int i = 0; i < 5; i++)
            {
                int dustType = 31;
                Main.dust[Dust.NewDust(player.Center, 10, 10, dustType)].velocity *= 0.25f;
            }
        }
Exemplo n.º 3
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int  projType = ProjectileType <Gambler.Projectiles.DungeonCardProj>();
            bool found    = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                for (int k = 0; k < Main.npc.Length; k++)
                {
                    if (Main.npc[k].active)
                    {
                        OrchidModGlobalNPC modTarget = Main.npc[k].GetGlobalNPC <OrchidModGlobalNPC>();
                        modTarget.gamblerDungeonCardCount = 0;
                    }
                }
            }

            int newProj = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy);

            Main.projectile[newProj].ai[1]     = Main.rand.Next(4);
            Main.projectile[newProj].netUpdate = true;
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 8);
        }
Exemplo n.º 4
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            OrchidModPlayer modPlayer   = player.GetModPlayer <OrchidModPlayer>();
            int             projType    = ProjectileType <Gambler.Projectiles.ShuffleCardProj>();
            float           aiType      = Main.rand.Next(4);
            int             count       = 0;
            int             damageCount = damage + (int)(OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer) * 1.2f);

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (player.whoAmI == proj.owner && proj.active && proj.ai[1] != 6f && proj.type == projType)
                {
                    aiType = proj.ai[0];
                    count++;
                    damageCount    = damage * (count + 1);
                    proj.damage    = damageCount;
                    proj.netUpdate = true;
                }
            }
            if (count < 5)
            {
                int        newProjInt = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, 0f, 0f, projType, damageCount, knockBack, player.whoAmI), dummy);
                Projectile newProj    = Main.projectile[newProjInt];
                newProj.ai[1]     = (float)(count + 1);
                newProj.ai[0]     = (float)aiType;
                newProj.netUpdate = true;
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, count == 4 ? 35 : 1);
            }
            else
            {
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 7);
            }
        }
Exemplo n.º 5
0
 public override void BonusProjectiles(Player player, OrchidModPlayer modPlayer, Projectile projectile, OrchidModGlobalProjectile modProjectile, bool dummy)
 {
     if (modProjectile.gamblerInternalCooldown == 0)
     {
         modProjectile.gamblerInternalCooldown = 40;
         int     projType = ProjectileType <Gambler.Projectiles.SnowCardProj>();
         Vector2 target   = Main.MouseWorld;
         Vector2 vel      = new Vector2(0f, 0f);
         float   absX     = (float)Math.Sqrt((projectile.Center.X - target.X) * (projectile.Center.X - target.X));
         float   absY     = (float)Math.Sqrt((projectile.Center.Y - target.Y) * (projectile.Center.Y - target.Y));
         if (absX > absY)
         {
             vel.X = target.X < projectile.Center.X ? 1f : -1f;
         }
         else
         {
             vel.Y = target.Y < projectile.Center.Y ? 1f : -1f;
         }
         vel.Normalize();
         vel *= new Vector2(0f, 5f).Length();
         int newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, projType, projectile.damage, projectile.knockBack, player.whoAmI), dummy);
         Main.projectile[newProjectile].ai[1]     = 1f;
         Main.projectile[newProjectile].netUpdate = true;
         OrchidModProjectile.spawnDustCircle(projectile.Center, 31, 25, 10, true, 1.5f, 1f, 5f, true, true, false, 0, 0, true);
     }
 }
Exemplo n.º 6
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int  projType = ProjectileType <Gambler.Projectiles.EaterCardProj1>();
            bool found    = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                int newProjectile2 = (OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X - speedX * 3f, position.Y - speedY * 3f, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy));
                Main.projectile[newProjectile2].ai[0] = 1f;
                int newProjectile = (OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy));
                Main.projectile[newProjectile].ai[0]      = 0f;
                Main.projectile[newProjectile2].ai[1]     = newProjectile;
                Main.projectile[newProjectile].localAI[0] = newProjectile2;
                Main.projectile[newProjectile].netUpdate  = true;
                Main.projectile[newProjectile2].netUpdate = true;
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
            }
            else
            {
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 7);
            }
        }
Exemplo n.º 7
0
        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            bool dummy = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;

            for (int i = 0; i < 3; i++)
            {
                int     projType = ProjectileType <Gambler.Projectiles.JungleSlimeCardProjAlt>();
                Vector2 vel      = new Vector2(0f, -3f).RotatedBy(MathHelper.ToRadians(20 * (i - 1)));
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.position.X + (5 * (i - 1)), projectile.position.Y - 10, vel.X, vel.Y, projType, (int)(projectile.damage * 0.75f), projectile.knockBack, projectile.owner), dummy);
            }

            if (projectile.velocity.Y > 0f)
            {
                projectile.velocity.Y = -8;
                if (this.baseDamage < projectile.damage)
                {
                    projectile.damage = this.baseDamage;
                    OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 10, 10, true, 1.5f, 1f, 2f, true, true, false, 0, 0, false, true);
                }
            }
            else
            {
                projectile.velocity.Y = 1f;
            }
            if (projectile.velocity.X != oldVelocity.X)
            {
                projectile.velocity.X = -oldVelocity.X;
                projectile.velocity.Y = 0f;
            }

            return(false);
        }
Exemplo n.º 8
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int projType = ProjectileType <Gambler.Projectiles.IvyChestCardProj>();

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                {
                    proj.ai[1]++;
                    if (proj.ai[1] >= 3f)
                    {
                        proj.Kill();
                    }
                    proj.netUpdate = true;
                }
            }

            for (int i = 0; i < 5 + Main.rand.Next(4); i++)
            {
                float   scale = 1f - (Main.rand.NextFloat() * .3f);
                Vector2 vel   = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(10));
                vel = vel * scale;
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);
            }

            Main.PlaySound(6, (int)player.Center.X, (int)player.Center.Y, 0);
        }
Exemplo n.º 9
0
        public override void Kill(int timeLeft)
        {
            int projType = ProjectileType <Gambler.Projectiles.EaterCardProj2>();

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == projectile.owner)
                {
                    proj.Kill();
                }
            }
            for (int i = 0; i < 10; i++)
            {
                int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 18);
                Main.dust[dust].velocity *= 1.5f;
                Main.dust[dust].scale    *= 1f;
            }
            projType = ProjectileType <Gambler.Projectiles.EaterCardProj3>();
            bool dummy = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;

            OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, projectile.damage * 5, 0, projectile.owner), dummy);
            OrchidModProjectile.spawnDustCircle(projectile.Center, 18, 5, 3 + Main.rand.Next(5), false, 1.5f, 1f, 7f, true, true, false, 0, 0, true);
            OrchidModProjectile.spawnDustCircle(projectile.Center, 18, 10, 5 + Main.rand.Next(5), false, 1f, 1f, 5f, true, true, false, 0, 0, true);
            Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 83);
        }
Exemplo n.º 10
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int projType = ProjectileType <Gambler.Projectiles.MushroomCardProj>();

            OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy);
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
        }
Exemplo n.º 11
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int  projType = ProjectileType <Gambler.Projectiles.KingSlimeCardProj>();
            bool found    = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy);
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
            }
            else
            {
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 7);
            }
        }
Exemplo n.º 12
0
        public void Draw(SpriteBatch spriteBatch)
        {
            Vector2 deckPosition = new Vector2(drawZone.X + 12, drawZone.Y + drawZone.Height * 0.5f - deckTexture.Height * 0.5f);

            // Background
            {
                Color color = new Color(25, 25, 45, 160);
                DrawSeparation(spriteBatch, new Vector2(drawZone.X + 6, drawZone.Y), 6, color);
                DrawSeparation(spriteBatch, new Vector2(drawZone.X + deckTexture.Width + 12, drawZone.Y), 6, color);
                DrawSeparation(spriteBatch, new Vector2(drawZone.X + drawZone.Width - 12, drawZone.Y), 6, color);

                DrawPanel(spriteBatch, backgroundTexture, new Color(25, 25, 60, 140));
                DrawPanel(spriteBatch, borderTexture, new Color(25, 25, 45, 160));

                spriteBatch.Draw(deckTexture, new Vector2(deckPosition.X, deckPosition.Y) + deckTexture.Size() * 0.5f, null, Color.White, 0f, deckTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f);
            }

            // Cards and Info
            {
                Player          player       = Main.player[Main.myPlayer];
                OrchidModPlayer orchidPlayer = player.GetModPlayer <OrchidModPlayer>();

                if (!player.dead)
                {
                    int[] nbCards = new int[20];
                    for (int i = 0; i < 20; i++)
                    {
                        nbCards[i] = 0;
                    }

                    int maxReq        = 0;
                    int playerNbCards = OrchidModGamblerHelper.getNbGamblerCards(player, orchidPlayer);

                    for (int i = 0; i < playerNbCards; i++)
                    {
                        Item currentItem = orchidPlayer.gamblerCardsItem[i];
                        if (currentItem.type != ItemID.None)
                        {
                            OrchidModGlobalItem orchidItem = currentItem.GetGlobalItem <OrchidModGlobalItem>();
                            int cardReq = orchidItem.gamblerCardRequirement;
                            nbCards[cardReq]++;
                            maxReq = cardReq > maxReq ? cardReq : maxReq;
                        }
                    }

                    for (int i = 0; i < playerNbCards; i++)
                    {
                        Item currentItem = orchidPlayer.gamblerCardsItem[i];
                        if (currentItem.type != ItemID.None)
                        {
                            OrchidModGlobalItem orchidItem = currentItem.GetGlobalItem <OrchidModGlobalItem>();
                            int  cardReq   = orchidItem.gamblerCardRequirement;
                            bool canRemove = (playerNbCards > maxReq + 1) || (cardReq == maxReq);

                            DrawCard(currentItem, spriteBatch, new Vector2(deckPosition.X + 8 + (i % 5 * 26), deckPosition.Y + 8 + (i == 0 ? 0 : i / 5) * 32), player, orchidPlayer, maxReq, canRemove);
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
        public override void PostUpdateEquips()
        {
            this.updateBuffEffects();
            this.updateItemEffects();

            this.generalPostUpdateEquips();
            OrchidModShamanHelper.shamanPostUpdateEquips(player, this, mod);
            OrchidModAlchemistHelper.alchemistPostUpdateEquips(player, this, mod);
            OrchidModGamblerHelper.gamblerPostUpdateEquips(player, this, mod);
            OrchidModDancerHelper.dancerPostUpdateEquips(player, this, mod);

            Mod thoriumMod = OrchidMod.ThoriumMod;

            if (thoriumMod != null)
            {
                object result = thoriumMod.Call("GetAllCrit", player);
                if (result is int thoriumCrit && thoriumCrit > 0)
                {
                    this.customCrit += thoriumCrit;
                }
            }

            this.shamanCrit    += this.customCrit;
            this.alchemistCrit += this.customCrit;
            this.gamblerCrit   += this.customCrit;
            this.dancerCrit    += this.customCrit;

            this.CheckWoodBreak(player);
        }
Exemplo n.º 14
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int  projType = ProjectileType <Gambler.Projectiles.BrainCardProj>();
            bool found    = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                for (int i = 0; i < 3; i++)
                {
                    int newProj = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy);
                    Main.projectile[newProj].ai[1]     = (float)(i);
                    Main.projectile[newProj].ai[0]     = (float)(i == 0 ? 300 : 0);
                    Main.projectile[newProj].friendly  = i == 0;
                    Main.projectile[newProj].netUpdate = true;
                }
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
            }
            else
            {
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 7);
            }
        }
Exemplo n.º 15
0
        public override void SafeOnHitNPC(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer)
        {
            OrchidModGlobalNPC modTarget = target.GetGlobalNPC <OrchidModGlobalNPC>();

            if (projectile.owner == Main.myPlayer)
            {
                modTarget.gamblerDungeonCardCount++;
                if (modTarget.gamblerDungeonCardCount >= 3)
                {
                    modTarget.gamblerDungeonCardCount = 0;
                    OrchidModProjectile.spawnDustCircle(projectile.Center, 29, 10, 15, true, 1.3f, 1f, 8f, true, true, false, 0, 0, true);
                    Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 45);
                    int     projType = ProjectileType <Gambler.Projectiles.DungeonCardProjAlt>();
                    float   scale    = 10f - (Main.rand.NextFloat() * 2.5f);
                    Vector2 vel      = (projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20)));
                    vel.Normalize();
                    vel *= scale;
                    bool       dummy      = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;
                    int        newProjInt = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, projType, (int)(projectile.damage * 5), 0.1f, projectile.owner), dummy);
                    Projectile newProj    = Main.projectile[newProjInt];
                    newProj.ai[1]     = (int)target.whoAmI;
                    newProj.netUpdate = true;
                }
            }

            if (modPlayer.gamblerElementalLens)
            {
                target.AddBuff(31, 60 * 3);                 // Confused
            }
        }
Exemplo n.º 16
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            if (Main.mouseLeft && Main.mouseLeftRelease || modPlayer.gamblerJustSwitched)
            {
                int projType = ProjectileType <Gambler.Projectiles.SlimeRainCardProj1>();
                for (int l = 0; l < Main.projectile.Length; l++)
                {
                    Projectile proj = Main.projectile[l];
                    if (proj.active && proj.type == projType && proj.owner == player.whoAmI)
                    {
                        proj.Kill();
                        break;
                    }
                }
                modPlayer.gamblerJustSwitched = false;
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, projType, damage, knockBack, player.whoAmI), dummy);
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
            }
            else
            {
                Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 7);
            }
        }
Exemplo n.º 17
0
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            Player          player    = Main.player[Main.myPlayer];
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            if (firstButton)
            {
                if (OrchidMod.Instance.croupierUI.Visible)
                {
                    OrchidMod.Instance.croupierUI.Visible = false;

                    Main.npcShop           = 0;
                    Main.npcChatCornerItem = 0;
                    Recipe.FindRecipes();
                    Main.npcChatText = Main.npc[player.talkNPC].GetChat();
                }
                else
                {
                    shop = true;
                }
            }
            else
            {
                if (OrchidModGamblerHelper.hasGamblerDeck(player))
                {
                    Main.npcChatText = $"Not too fond of your odds, eh? Aight, go on.";

                    /*switch (Main.rand.Next(0, 1))
                     * {
                     *      case 0:
                     *              Main.npcChatText = $"Not too fond of your odds, eh? Aight, go on.\n" +
                     *                      $"Calamity - best mod...";
                     *              break;
                     * }*/

                    Main.npcChatText  += "\n\n\n\n\n";
                    Main.npcChatFocus2 = false;
                    Main.npcChatFocus3 = false;

                    OrchidMod.Instance.croupierUI.UpdateOnChatButtonClicked();
                    OrchidMod.Instance.croupierUI.Visible = true;
                }
                else
                {
                    for (int i = 0; i < 50; i++)
                    {
                        Item item = Main.LocalPlayer.inventory[i];
                        if (item.type == 0)
                        {
                            Main.npcChatText = $"You lost it already? Here chief, take your new deck.";
                            int gamblerDeck = ItemType <Gambler.Decks.GamblerAttack>();
                            player.QuickSpawnItem(gamblerDeck, 1);
                            return;
                        }
                    }
                    Main.npcChatText = $"My man, your pockets are full. You wouldn't let a brand new deck sitting on the ground, would ya?";
                }
            }
        }
Exemplo n.º 18
0
        public override void PostUpdate()
        {
            ignoreScrollHotbar = false;

            OrchidModShamanHelper.postUpdateShaman(player, this, mod);
            OrchidModGamblerHelper.postUpdateGambler(player, this, mod);
            OrchidModAlchemistHelper.postUpdateAlchemist(player, this, mod);
        }
Exemplo n.º 19
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            Vector2 vel      = new Vector2(speedX, speedY / 5f).RotatedByRandom(MathHelper.ToRadians(15));
            int     projType = ProjectileType <Gambler.Projectiles.JungleCardProj>();

            OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 1);
        }
Exemplo n.º 20
0
        public override void AI()
        {
            Player          player    = Main.player[Main.myPlayer]; // < TEST MP
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();
            NPC             target    = Main.npc[(int)projectile.ai[1]];

            projectile.velocity *= 0.95f;

            if (Main.time % 5 == 0)
            {
                projectile.frame++;
            }
            if (projectile.frame == 7)
            {
                projectile.frame = 0;
            }

            if (target.active == false)
            {
                projectile.Kill();
            }

            if (projectile.timeLeft < 540)
            {
                for (int k = 0; k < Main.player.Length; k++)
                {
                    Player  playerMove = Main.player[k];
                    Vector2 newMove    = playerMove.Center - projectile.Center;
                    float   distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y);
                    if (distanceTo < 100f)
                    {
                        newMove             *= 3f / distanceTo;
                        projectile.velocity  = newMove;
                        projectile.netUpdate = true;
                    }

                    if (projectile.owner == Main.myPlayer)
                    {
                        if (playerMove.Hitbox.Intersects(projectile.Hitbox))
                        {
                            bool dummy = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;
                            if (!dummy)
                            {
                                OrchidModGamblerHelper.addGamblerChip(this.gamblingChipChance, player, modPlayer);
                            }

                            bool crit = (Main.rand.Next(101) <= modPlayer.gamblerCrit + this.baseCritChance);
                            player.ApplyDamageToNPC(target, Main.DamageVar(projectile.damage), 0.1f, player.direction, crit);
                            OrchidModProjectile.spawnDustCircle(projectile.Center, 29, 10, 10, true, 1.3f, 1f, 5f, true, true, false, 0, 0, true);
                            OrchidModProjectile.spawnDustCircle(target.Center, 29, 10, 10, true, 1.3f, 1f, 5f, true, true, false, 0, 0, true);
                            Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 45);
                            projectile.Kill();
                        }
                    }
                }
            }
        }
Exemplo n.º 21
0
        public override bool OnPickup(Player player)
        {
            OrchidModPlayer modPlayer         = player.GetModPlayer <OrchidModPlayer>();
            Color           floatingTextColor = new Color(255, 200, 0);

            CombatText.NewText(player.Hitbox, floatingTextColor, 1);
            OrchidModGamblerHelper.addGamblerChip(100, player, modPlayer);
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 65);
            return(false);
        }
Exemplo n.º 22
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int     projType = ProjectileType <Gambler.Projectiles.BubbleCardProj>();
            float   scale    = 1f - (Main.rand.NextFloat() * .3f);
            Vector2 vel      = new Vector2(0f, -3f).RotatedByRandom(MathHelper.ToRadians(30));

            vel = vel * scale;
            OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 86);
        }
Exemplo n.º 23
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            type = ModContent.ProjectileType <Gambler.Projectiles.SapCardProj>();

            Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 1);

            if (player.ownedProjectileCounts[type] == 0 && player.channel)
            {
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI), dummy);
            }
        }
Exemplo n.º 24
0
        public override void SafeAI()
        {
            if (!this.initialized)
            {
                this.initialized  = true;
                this.baseVelocity = projectile.velocity;
            }

            Player          player    = Main.player[projectile.owner];
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();
            int             cardType  = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj ? modPlayer.gamblerCardDummy.type : modPlayer.gamblerCardCurrent.type;

            projectile.rotation += projectile.ai[1] * 0.05f;
            this.fireTimer--;
            this.dustVal--;
            projectile.velocity += this.baseVelocity / 100f;

            if (Main.rand.Next(20) == 0)
            {
                int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27);
                Main.dust[dust].scale    *= 1.5f;
                Main.dust[dust].noGravity = true;
            }

            if (Main.myPlayer == projectile.owner)
            {
                Vector2 vectorDist = player.Center - projectile.Center;
                float   distanceTo = (float)Math.Sqrt(vectorDist.X * vectorDist.X + vectorDist.Y * vectorDist.Y);
                if ((!(Main.mouseLeft && cardType == ItemType <Gambler.Weapons.Cards.GoblinArmyCard>() && modPlayer.GamblerDeckInHand) && projectile.timeLeft < 840) || distanceTo > distance)
                {
                    bool dummy = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;
                    OrchidModProjectile.spawnDustCircle(projectile.Center, 27, 5, 5, true, 1.3f, 1f, 5f, true, true, false, 0, 0, true);
                    OrchidModProjectile.spawnDustCircle(projectile.Center, 27, 5, 5, true, 1.3f, 1f, 3f, true, true, false, 0, 0, true);
                    projectile.Kill();
                }
            }

            if (fireTimer <= 0 && projectile.ai[1] == 1f)
            {
                Vector2 target  = Main.MouseWorld;
                Vector2 heading = target - projectile.Center;
                heading.Normalize();
                heading *= 15f;
                int  projType = ProjectileType <Gambler.Projectiles.GoblinArmyCardProjAlt>();
                bool dummy    = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, heading.X, heading.Y, projType, projectile.damage, projectile.knockBack, projectile.owner), dummy);
                OrchidModProjectile.spawnDustCircle(projectile.Center, 27, 5, 5, true, 1.3f, 1f, 3f, true, true, false, 0, 0, true);
                fireTimerRef -= fireTimerRef > 15 ? 4 : 0;
                fireTimer     = fireTimerRef;
                Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 8);
            }

            this.spawnDust(27, (int)distance);
        }
Exemplo n.º 25
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int        projType   = ProjectileType <Gambler.Projectiles.SkyCardProj>();
            Vector2    vel        = new Vector2(0f, 8f).RotatedByRandom(MathHelper.ToRadians(20));
            int        newProjInt = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y - Main.screenHeight / 2 - 20, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);
            Projectile newProj    = Main.projectile[newProjInt];

            newProj.ai[0] = Main.screenPosition.Y + (float)Main.mouseY - 10;

            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 9);
        }
Exemplo n.º 26
0
        public override void GamblerShoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack, bool dummy = false)
        {
            int     projType = ProjectileType <Gambler.Projectiles.GoldChestCardProj>();
            float   scale    = 1f - (Main.rand.NextFloat() * .3f);
            Vector2 vel      = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(15));

            vel = vel * scale;
            int newProj = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(position.X, position.Y, vel.X, vel.Y, projType, damage, knockBack, player.whoAmI), dummy);

            Main.projectile[newProj].ai[1]     = Main.rand.Next(4);
            Main.projectile[newProj].netUpdate = true;
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y - 200, 9);
        }
Exemplo n.º 27
0
        public override void Kill(int timeLeft)
        {
            OrchidModProjectile.spawnDustCircle(projectile.Center, 172, 25, 10, true, 1.5f, 1f, 5f);
            int  projType = ProjectileType <Gambler.Projectiles.MushroomCardProjExplosion>();
            bool dummy    = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;

            OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0f, 0f, projType, (int)(projectile.damage * 0.8), 3f, projectile.owner, 0.0f, 0.0f), dummy);
            int dustType = 172;

            for (int i = 0; i < 3; i++)
            {
                Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType)].noGravity = true;
            }
        }
Exemplo n.º 28
0
        public override void SafeOnHitNPC(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer)
        {
            if (justHit == 0)
            {
                projectile.damage += 2;
                bool dummy    = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj;
                int  projType = ProjectileType <Gambler.Projectiles.KingSlimeCardProj2>();
                OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, projectile.damage, projectile.knockBack, projectile.owner), dummy);
                OrchidModProjectile.spawnDustCircle(projectile.Center, 59, 10, 10, true, 1.5f, 1f, 2f, true, true, false, 0, 0, false, true);
            }

            projectile.velocity.Y  = -10f;
            projectile.velocity.X *= 0.5f;
            this.justHit           = 30;
            projectile.ai[1]       = 1f;
        }
Exemplo n.º 29
0
 public override void BonusProjectiles(Player player, OrchidModPlayer modPlayer, Projectile projectile, OrchidModGlobalProjectile modProjectile, bool dummy)
 {
     if (modProjectile.gamblerInternalCooldown == 0)
     {
         modProjectile.gamblerInternalCooldown = 50;
         int     projType = ProjectileType <Gambler.Projectiles.OceanCardProj>();
         Vector2 target   = Main.MouseWorld;
         Vector2 heading  = target - projectile.position;
         heading.Normalize();
         heading *= new Vector2(0f, 5f).Length();
         int newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, heading.X, heading.Y, projType, projectile.damage, projectile.knockBack, player.whoAmI), dummy);
         Main.projectile[newProjectile].ai[1]     = 1f;
         Main.projectile[newProjectile].netUpdate = true;
         OrchidModProjectile.spawnDustCircle(projectile.Center, 31, 10, 10, true, 1.5f, 1f, 3f, true, true, false, 0, 0, true);
     }
 }
Exemplo n.º 30
0
        public override void Initialize()
        {
            OrchidModGamblerHelper.clearGamblerCards(player, this);
            OrchidModAlchemistHelper.onRespawnAlchemist(player, this, mod);
            OrchidModShamanHelper.onRespawnShaman(player, this, mod);
            OrchidModGamblerHelper.onRespawnGambler(player, this);
            this.alchemistKnownReactions = new List <string>();
            this.alchemistKnownHints     = new List <string>();

            this.alchemistPotionBag = new Item[16];
            for (int i = 0; i < 16; i++)
            {
                this.alchemistPotionBag[i] = new Item();
                this.alchemistPotionBag[i].SetDefaults(0, true);
            }
        }