public sealed override void SetDefaults()
        {
            item.useAnimation = 0;
            item.useTime      = 0;
            item.shootSpeed   = 0f;
            item.damage       = 0;
            item.crit         = 0;
            SafeSetDefaults();
            item.melee        = false;
            item.ranged       = false;
            item.magic        = false;
            item.thrown       = false;
            item.summon       = false;
            item.noMelee      = this.catalystType != 1;
            item.useStyle     = 1;
            item.UseSound     = SoundID.Item1;
            item.consumable   = false;
            item.noUseGraphic = this.catalystType == 2;
            item.useAnimation = item.useAnimation == 0 ? 20 : 0;
            item.useTime      = item.useTime == 0 ? 20 : 0;
            item.autoReuse    = false;
            item.shootSpeed   = item.shootSpeed == 0f ? 10f : item.shootSpeed;
            item.knockBack    = 0f;
            item.crit         = item.crit == 0 ? 0 : item.crit;
            item.damage       = item.damage == 0 ? 0 : item.damage;

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.alchemistCatalyst = true;
        }
        public static void ShootBonusProjectiles(Player player, Vector2 position, bool dummy)
        {
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            if (modPlayer.gamblerSlimyLollipop)
            {
                OrchidModGlobalItem orchidItem = modPlayer.gamblerCardCurrent.GetGlobalItem <OrchidModGlobalItem>();
                if (orchidItem.gamblerCardSets.Contains("Slime") && Main.rand.Next(180) == 0)
                {
                    float scale    = 1f - (Main.rand.NextFloat() * .3f);
                    int   rand     = Main.rand.Next(3) + 1;
                    int   projType = ProjectileType <Gambler.Projectiles.SlimeRainCardProj2>();
                    for (int i = 0; i < rand; i++)
                    {
                        int newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 5f, projType, 15, 0f, player.whoAmI), dummy);
                        Main.projectile[newProjectile].ai[1]     = 1f;
                        Main.projectile[newProjectile].netUpdate = true;
                    }
                }
            }

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile projectile = Main.projectile[l];
                if (projectile.active && projectile.owner == player.whoAmI)
                {
                    OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>();
                    if (modProjectile.gamblerDummyProj == dummy && modProjectile.gamblerBonusTrigger)
                    {
                        modProjectile.gamblerBonusProjectilesDelegate(player, modPlayer, projectile, modProjectile, dummy);
                    }
                }
            }
        }
Esempio n. 3
0
        public sealed override void SetDefaults()
        {
            SafeSetDefaults();
            item.melee        = false;
            item.ranged       = false;
            item.magic        = false;
            item.thrown       = false;
            item.summon       = false;
            item.noMelee      = true;
            item.maxStack     = 1;
            item.width        = 34;
            item.height       = 34;
            item.useStyle     = 1;
            item.noUseGraphic = true;
            //item.UseSound = SoundID.Item7;
            item.useAnimation = 30;
            item.useTime      = 30;
            item.knockBack    = 1f;
            item.damage       = 1;
            item.rare         = 1;
            item.shootSpeed   = 1f;
            item.shoot        = 1;
            item.autoReuse    = true;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.gamblerDeck = true;
        }
Esempio n. 4
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);
                        }
                    }
                }
            }
        }
 public override bool CanUseItem(Player player)
 {
     if (player == Main.player[Main.myPlayer])
     {
         OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();
         Item[]          cards     = modPlayer.gamblerCardsItem;
         int             count     = OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer);
         if (OrchidModGamblerHelper.containsGamblerCard(item, player, modPlayer) || player.altFunctionUse == 2 || count < this.cardRequirement || count >= 20)
         {
             return(false);
         }
         else
         {
             if (OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer) <= 0)
             {
                 bool found = false;
                 for (int i = 0; i < Main.maxInventory; i++)
                 {
                     Item item = Main.LocalPlayer.inventory[i];
                     if (item.type != 0)
                     {
                         OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                         if (orchidItem.gamblerDeck)
                         {
                             found = true;
                             break;
                         }
                     }
                 }
                 if (!found)
                 {
                     int gamblerDeck = ItemType <Gambler.Decks.GamblerAttack>();
                     player.QuickSpawnItem(gamblerDeck, 1);
                 }
             }
             item.useAnimation = 20;
             item.useTime      = 20;
             for (int i = 0; i < 20; i++)
             {
                 if (cards[i].type == 0)
                 {
                     cards[i] = new Item();
                     cards[i].SetDefaults(item.type, true);
                     OrchidModGamblerHelper.clearGamblerCardCurrent(player, modPlayer);
                     OrchidModGamblerHelper.clearGamblerCardsNext(player, modPlayer);
                     modPlayer.gamblerShuffleCooldown = 0;
                     modPlayer.gamblerRedraws         = 0;
                     OrchidModGamblerHelper.drawGamblerCard(player, modPlayer);
                     return(true);
                 }
             }
             //item.TurnToAir();
         }
     }
     return(base.CanUseItem(player));
 }
        public static int getSecondaryDamage(Player player, OrchidModPlayer modPlayer, int itemType, int bonusDamage = 0, bool bonusDamageScaling = true)
        {
            Item item = new Item();

            item.SetDefaults(itemType);
            OrchidModGlobalItem globalItem = item.GetGlobalItem <OrchidModGlobalItem>();
            int dmg = (int)((globalItem.alchemistSecondaryDamage + (int)(bonusDamage * (bonusDamageScaling ? globalItem.alchemistSecondaryScaling : 1f))) * (modPlayer.alchemistDamage + player.allDamage - 1f));

            return(dmg);
        }
        public void checkInventory(bool up, Player player, OrchidModPlayer modPlayer)
        {
            if (modPlayer.alchemistNbElements < modPlayer.alchemistNbElementsMax)
            {
                int elementsChecked = 0;
                this.displayItems = new List <Item>();
                while (displayItems.Count() == 0)
                {
                    foreach (Item item in this.ConcatInventories(Main.LocalPlayer, modPlayer))
                    {
                        if (item.type != 0)
                        {
                            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                            if ((int)element > 0 && (int)element < 7)
                            {
                                if (orchidItem.alchemistElement == this.element && !modPlayer.alchemistElements[(int)element - 1])
                                {
                                    this.displayItems.Add(item);
                                    if (this.displayItems.Count() > 9)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    if (displayItems.Count() == 0)
                    {
                        elementsChecked++;
                        if (elementsChecked == 6)
                        {
                            if (modPlayer.alchemistNbElements == 0)
                            {
                                modPlayer.alchemistSelectUIKeysDisplay = false;
                                CombatText.NewText(player.Hitbox, new Color(255, 0, 0), "No ingredients");
                            }
                            else
                            {
                                element = AlchemistElement.NULL;
                            }
                            return;
                        }
                        else
                        {
                            this.scroll(up);
                        }
                    }
                }
            }
            else
            {
                element = AlchemistElement.NULL;
            }
        }
Esempio n. 8
0
        public static int checkSetCardsInDeck(OrchidModPlayer modPlayer, string setName)
        {
            int nbCards = 0;

            for (int i = 0; i < 20; i++)
            {
                OrchidModGlobalItem orchidItem = modPlayer.gamblerCardsItem[i].GetGlobalItem <OrchidModGlobalItem>();
                nbCards += orchidItem.gamblerCardSets.Contains(setName) ? 1 : 0;
            }
            return(nbCards);
        }
Esempio n. 9
0
        public override void RightClick(Player player)
        {
            //player.QuickSpawnItem(ItemID.LifeCrystal, 1);
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            Item[] potionBag = modPlayer.alchemistPotionBag;
            bool   addedItem = false;
            int    index     = 0;
            int    firstSlot = 0;

            foreach (Item item in potionBag)
            {
                if (item.type != 0)
                {
                    firstSlot++;
                }
                else
                {
                    break;
                }
            }


            while (modPlayer.alchemistPotionBag[potionBag.Length - 1].type == 0 && index < Main.maxInventory)
            {
                Item item = Main.LocalPlayer.inventory[index];
                index++;
                if (item.type != 0)
                {
                    OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                    if (orchidItem.alchemistElement != AlchemistElement.NULL)
                    {
                        potionBag[firstSlot] = new Item();
                        potionBag[firstSlot].SetDefaults(item.type, true);
                        item.TurnToAir();
                        addedItem = true;
                        firstSlot++;
                    }
                }
            }

            if (!addedItem)
            {
                foreach (Item item in potionBag)
                {
                    if (item.type != 0)
                    {
                        player.QuickSpawnItem(item.type, 1);
                        item.TurnToAir();
                    }
                }
            }
        }
Esempio n. 10
0
 public static bool hasGamblerDeck(Player player)
 {
     for (int i = 0; i < Main.maxInventory; i++)
     {
         Item item = player.inventory[i];
         if (item.type != ItemID.None)
         {
             OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
             if (orchidItem.gamblerDeck)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 11
0
        public override void SafeSetDefaults()
        {
            item.damage          = 8;
            item.width           = 30;
            item.height          = 30;
            item.useTime         = 4;
            item.useAnimation    = 32;
            item.knockBack       = 0f;
            item.rare            = 1;
            item.value           = Item.sellPrice(0, 0, 48, 0);
            item.autoReuse       = true;
            item.shootSpeed      = 5.25f;
            item.shoot           = mod.ProjectileType("MeteorPhasestaffProj");
            item.UseSound        = SoundID.Item15;
            this.empowermentType = 1;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            this.energy = 2;
        }
Esempio n. 12
0
        public sealed override void SetDefaults()
        {
            item.melee    = false;
            item.ranged   = false;
            item.magic    = false;
            item.thrown   = false;
            item.summon   = false;
            item.noMelee  = true;
            item.crit     = 4;
            item.useStyle = ItemUseStyleID.Stabbing;

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeapon = true;

            this.SafeSetDefaults();

            orchidItem.shamanWeaponElement = this.empowermentType;
        }
Esempio n. 13
0
        public override void SafeSetDefaults()
        {
            item.damage          = 70;
            item.width           = 30;
            item.height          = 30;
            item.useTime         = 18;
            item.useAnimation    = 18;
            item.knockBack       = 1.15f;
            item.rare            = 8;
            item.value           = Item.sellPrice(0, 10, 0, 0);
            item.UseSound        = SoundID.Item91;
            item.autoReuse       = true;
            item.shootSpeed      = 7f;
            item.shoot           = mod.ProjectileType("MartianBeamerProj");
            this.empowermentType = 1;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoUsetimeReforge = true;
            this.energy = 5;
        }
Esempio n. 14
0
        public override void SafeSetDefaults()
        {
            item.damage          = 63;
            item.width           = 48;
            item.height          = 48;
            item.useTime         = 45;
            item.useAnimation    = 45;
            item.knockBack       = 0f;
            item.rare            = 5;
            item.value           = Item.sellPrice(0, 5, 0, 0);
            item.UseSound        = SoundID.Item28;
            item.autoReuse       = false;
            item.shootSpeed      = 15f;
            item.shoot           = mod.ProjectileType("IceMimicScepterProj");
            this.empowermentType = 2;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoUsetimeReforge = true;
            this.energy = 35;
        }
Esempio n. 15
0
        public override void SafeSetDefaults()
        {
            item.damage          = 25;
            item.width           = 30;
            item.height          = 30;
            item.useTime         = 35;
            item.useAnimation    = 35;
            item.knockBack       = 3.25f;
            item.rare            = 3;
            item.value           = Item.sellPrice(0, 0, 54, 0);
            item.UseSound        = SoundID.Item8;
            item.autoReuse       = true;
            item.shootSpeed      = 16f;
            item.shoot           = mod.ProjectileType("FireBatScepterProj");
            this.empowermentType = 3;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoUsetimeReforge = true;
            this.energy = 6;
        }
        public sealed override void SetDefaults()
        {
            item.crit     = 4;
            item.melee    = false;
            item.ranged   = false;
            item.magic    = false;
            item.thrown   = false;
            item.summon   = false;
            item.noMelee  = true;
            item.maxStack = 1;
            item.useStyle = ItemUseStyleID.Stabbing;

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.guardianWeapon = true;

            this.distance = 10f;

            this.SafeSetDefaults();
        }
Esempio n. 17
0
        public override void SafeSetDefaults()
        {
            item.damage          = 20;
            item.width           = 42;
            item.height          = 42;
            item.useTime         = 25;
            item.useAnimation    = 25;
            item.knockBack       = 3.15f;
            item.rare            = 1;
            item.value           = Item.sellPrice(0, 0, 27, 0);
            item.UseSound        = SoundID.Item43;
            item.autoReuse       = true;
            item.shootSpeed      = 7f;
            item.shoot           = mod.ProjectileType("SpineScepterProj");
            this.empowermentType = 2;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoVelocityReforge = true;
            this.energy = 6;
        }
Esempio n. 18
0
        public override void SafeSetDefaults()
        {
            item.damage          = 12;
            item.channel         = true;
            item.width           = 30;
            item.height          = 30;
            item.useTime         = 6;
            item.useAnimation    = 30;
            item.knockBack       = 0.5f;
            item.rare            = 5;
            item.value           = Item.sellPrice(0, 3, 50, 0);
            item.UseSound        = SoundID.Item15;
            item.autoReuse       = true;
            item.shootSpeed      = 15f;
            item.shoot           = mod.ProjectileType("PiratesGloryProj");
            this.empowermentType = 2;
            this.energy          = 3;
            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoUsetimeReforge = true;
        }
        public void initUI(Player player, OrchidModPlayer modPlayer)
        {
            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 7);
            modPlayer.alchemistSelectUIKeysInitialize = false;
            element = AlchemistElement.NULL;

            foreach (Item item in this.ConcatInventories(Main.LocalPlayer, modPlayer))
            {
                if (item.type != 0)
                {
                    OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                    if (orchidItem.alchemistElement != AlchemistElement.NULL)
                    {
                        element = orchidItem.alchemistElement;
                        break;
                    }
                }
            }

            this.checkInventory(true, player, modPlayer);
        }
Esempio n. 20
0
        public static void ShootBonusProjectiles(Player player, Vector2 position, bool dummy)
        {
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            if (modPlayer.gamblerSlimyLollipop)
            {
                OrchidModGlobalItem orchidItem = modPlayer.gamblerCardCurrent.GetGlobalItem <OrchidModGlobalItem>();
                if (orchidItem.gamblerCardSets.Contains("Slime") && Main.rand.Next(180) == 0)
                {
                    float scale    = 1f - (Main.rand.NextFloat() * .3f);
                    int   rand     = Main.rand.Next(3) + 1;
                    int   projType = ProjectileType <Gambler.Projectiles.SlimeRainCardProj2>();
                    for (int i = 0; i < rand; i++)
                    {
                        Vector2 target  = Main.MouseWorld;
                        Vector2 heading = target - player.position;
                        heading.Normalize();
                        heading *= new Vector2(0f, 5f).Length();
                        Vector2 vel = heading.RotatedByRandom(MathHelper.ToRadians(30));
                        vel = vel * scale;
                        int newProjectile = OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(player.Center.X, player.Center.Y, vel.X, vel.Y, projType, 15, 0f, player.whoAmI), dummy);
                        Main.projectile[newProjectile].ai[1]     = 1f;
                        Main.projectile[newProjectile].netUpdate = true;
                    }
                }
            }

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile projectile = Main.projectile[l];
                if (projectile.active && projectile.owner == player.whoAmI)
                {
                    OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>();
                    if (modProjectile.gamblerDummyProj == dummy && modProjectile.gamblerBonusTrigger)
                    {
                        modProjectile.gamblerBonusProjectilesDelegate(player, modPlayer, projectile, modProjectile, dummy);
                    }
                }
            }
        }
        public sealed override void SetDefaults()
        {
            SafeSetDefaults();
            item.melee        = false;
            item.ranged       = false;
            item.magic        = false;
            item.thrown       = false;
            item.summon       = false;
            item.noMelee      = true;
            item.crit         = 4;
            item.useStyle     = 1;
            item.UseSound     = SoundID.Item106;
            item.consumable   = false;
            item.noUseGraphic = true;
            item.useAnimation = 30;
            item.useTime      = 30;
            item.autoReuse    = false;
            item.shootSpeed   = 10f;
            item.knockBack    = 1f;

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.alchemistColorR           = this.colorR;
            orchidItem.alchemistColorG           = this.colorG;
            orchidItem.alchemistColorB           = this.colorB;
            orchidItem.alchemistRightClickDust   = this.rightClickDust;
            orchidItem.alchemistPotencyCost      = this.potencyCost;
            orchidItem.alchemistElement          = this.element;
            orchidItem.alchemistSecondaryDamage  = this.secondaryDamage;
            orchidItem.alchemistSecondaryScaling = this.secondaryScaling;
            orchidItem.alchemistWeapon           = true;

            orchidItem.killFirstDelegate         = KillFirst;
            orchidItem.killSecondDelegate        = KillSecond;
            orchidItem.killThirdDelegate         = KillThird;
            orchidItem.onHitNPCFirstDelegate     = OnHitNPCFirst;
            orchidItem.onHitNPCSecondDelegate    = OnHitNPCSecond;
            orchidItem.onHitNPCThirdDelegate     = OnHitNPCThird;
            orchidItem.addVariousEffectsDelegate = AddVariousEffects;
        }
Esempio n. 22
0
        public override void SafeSetDefaults()
        {
            item.damage          = 110;
            item.magic           = true;
            item.width           = 42;
            item.height          = 42;
            item.useTime         = 18;
            item.useAnimation    = 18;
            item.knockBack       = 1.15f;
            item.rare            = ItemRarityID.Red;
            item.value           = Item.sellPrice(0, 10, 0, 0);
            item.UseSound        = SoundID.Item122;
            item.autoReuse       = true;
            item.shootSpeed      = 10f;
            item.shoot           = ModContent.ProjectileType <Projectiles.AbyssShardS>();
            this.empowermentType = 1;

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.shamanWeaponNoUsetimeReforge = true;
            this.energy = 5;
        }
Esempio n. 23
0
        public sealed override void SetDefaults()
        {
            item.width      = 20;
            item.height     = 26;
            item.melee      = false;
            item.ranged     = false;
            item.magic      = false;
            item.thrown     = false;
            item.summon     = false;
            item.noMelee    = true;
            item.useStyle   = ItemUseStyleID.HoldingUp;
            item.UseSound   = SoundID.Item64;
            item.consumable = true;
            item.autoReuse  = false;

            this.SafeSetDefaults();

            OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();

            orchidItem.gamblerCardRequirement = this.cardRequirement;
            orchidItem.gamblerCardSets        = this.gamblerCardSets;
            orchidItem.gamblerShootDelegate   = this.GamblerShoot;
        }
        public void checkInventory(OrchidModPlayer modPlayer)
        {
            this.nbAlchemistWeapons = 0;
            int val = this.displayRectangles.Count() - 1;

            this.displayItems = new List <Item>();

            foreach (Item item in this.ConcatInventories(Main.LocalPlayer, modPlayer))
            {
                if (item.type != 0)
                {
                    OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                    if (orchidItem.alchemistWeapon)
                    {
                        this.nbAlchemistWeapons++;
                        this.displayItems.Add(item);
                        if (this.nbAlchemistWeapons >= val)
                        {
                            break;
                        }
                    }
                }
            }
            if (this.nbAlchemistWeapons > val)
            {
                this.nbAlchemistWeapons = val;
            }
            if (this.nbAlchemistWeapons > 0)
            {
                this.displayAngle = 360 / this.nbAlchemistWeapons;
            }
            else
            {
                this.displayAngle = 360;
            }
            this.distanceToPoint = (int)(drawOffSet * 3 + (drawOffSet * this.nbAlchemistWeapons / 4));
        }
Esempio n. 25
0
        public static void drawGamblerCard(Player player, OrchidModPlayer modPlayer)
        {
            modPlayer.gamblerJustSwitched = true;

            if (modPlayer.gamblerCardNext.Count() != 3)
            {
                OrchidModGamblerHelper.clearGamblerCardsNext(player, modPlayer);
            }

            for (int i = 0; i < 3; i++)
            {
                if (modPlayer.gamblerCardNext[i].type == 0)
                {
                    int rand = Main.rand.Next(OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer));
                    modPlayer.gamblerCardNext[i] = new Item();
                    modPlayer.gamblerCardNext[i].SetDefaults(modPlayer.gamblerCardsItem[rand].type, true);
                }
            }

            modPlayer.gamblerCardCurrent = new Item();
            modPlayer.gamblerCardCurrent.SetDefaults(modPlayer.gamblerCardNext[0].type, true);

            for (int i = 0; i < 2; i++)
            {
                modPlayer.gamblerCardNext[i] = new Item();
                modPlayer.gamblerCardNext[i].SetDefaults(modPlayer.gamblerCardNext[i + 1].type, true);
            }

            modPlayer.gamblerCardNext[2] = new Item();
            modPlayer.gamblerCardNext[2].SetDefaults(0, true);

            for (int i = 0; i < 3; i++)
            {
                if (modPlayer.gamblerCardNext[i].type == 0)
                {
                    int rand = Main.rand.Next(OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer));
                    modPlayer.gamblerCardNext[i] = new Item();
                    modPlayer.gamblerCardNext[i].SetDefaults(modPlayer.gamblerCardsItem[rand].type, true);
                }
            }

            if (OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer) > 3)
            {
                for (int i = 2; i > -1; i--)
                {
                    for (int j = 2; j > -1; j--)
                    {
                        int currentType = modPlayer.gamblerCardNext[i].type;
                        if ((currentType == modPlayer.gamblerCardNext[j].type || currentType == modPlayer.gamblerCardCurrent.type) && i != j)
                        {
                            int k = 0;
                            while (k < 5 && (currentType == modPlayer.gamblerCardNext[j].type || currentType == modPlayer.gamblerCardCurrent.type))
                            {
                                k++;
                                int rand = Main.rand.Next(OrchidModGamblerHelper.getNbGamblerCards(player, modPlayer));
                                modPlayer.gamblerCardNext[i] = new Item();
                                modPlayer.gamblerCardNext[i].SetDefaults(modPlayer.gamblerCardsItem[rand].type, true);
                                currentType = modPlayer.gamblerCardNext[i].type;
                            }
                        }
                    }
                }
            }

            modPlayer.gamblerShuffleCooldown = modPlayer.gamblerShuffleCooldownMax;

            if (modPlayer.gamblerDungeon)
            {
                int rand = Main.rand.Next(3);
                for (int i = 0; i < rand; i++)
                {
                    OrchidModGamblerHelper.addGamblerChip(100, player, modPlayer);
                }
            }

            if (modPlayer.gamblerPennant)
            {
                OrchidModGlobalItem orchidItem = modPlayer.gamblerCardCurrent.GetGlobalItem <OrchidModGlobalItem>();
                if (orchidItem.gamblerCardSets.Contains("Boss"))
                {
                    player.AddBuff(BuffType <Gambler.Buffs.ConquerorsPennantBuff>(), 60 * 10);
                }
            }

            if (modPlayer.gamblerVulture)
            {
                int rand     = Main.rand.Next(3) + 1;
                int projType = ProjectileType <Gambler.Projectiles.Equipment.VultureCharmProj>();
                for (int i = 0; i < rand; i++)
                {
                    float   scale   = 1f - (Main.rand.NextFloat() * .3f);
                    Vector2 target  = Main.MouseWorld;
                    Vector2 heading = target - player.Center;
                    heading.Normalize();
                    heading *= new Vector2(0f, 10f).Length();
                    Vector2 vel = heading.RotatedByRandom(MathHelper.ToRadians(20));
                    vel = vel * scale;
                    Projectile.NewProjectile(player.Center.X, player.Center.Y, vel.X, vel.Y, projType, 12, 0f, player.whoAmI);
                    if (i == 0)
                    {
                        OrchidModProjectile.spawnDustCircle(player.Center, 31, 10, 10, true, 1.5f, 1f, 5f, true, true, false, 0, 0, true);
                    }
                }
            }

            modPlayer.gamblerSeedCount = 0;
        }
Esempio n. 26
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, (float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(180)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProjAlt2>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            bool spawnedMushroom = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj        = Main.projectile[l];
                int        projType    = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProj>();
                int        projTypeAlt = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProjAlt>();
                if (proj.active == true && (proj.type == projType || proj.type == projTypeAlt) && proj.owner == projectile.owner)
                {
                    spawnedMushroom = true;
                    break;
                }
            }
            if (!spawnedMushroom)
            {
                int     dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Vector2 vel = (new Vector2(0f, -2f).RotatedByRandom(MathHelper.ToRadians(20)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProj>(), dmg, 0f, projectile.owner);
            }
        }
Esempio n. 27
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(3);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, -(float)((3 * alchProj.nbElements) + Main.rand.Next(3))).RotatedByRandom(MathHelper.ToRadians(10)));
                int     spawnProj = Main.rand.Next(3) == 0 ? ProjectileType <Alchemist.Projectiles.AlchemistSmoke3>() : ProjectileType <Alchemist.Projectiles.AlchemistSmoke2>();
                int     smokeProj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
                Main.projectile[smokeProj].localAI[0] = alchProj.glowColor.R;
                Main.projectile[smokeProj].localAI[1] = alchProj.glowColor.G;
                Main.projectile[smokeProj].ai[1]      = alchProj.glowColor.B;
            }

            if (alchProj.waterFlask.type == ItemType <Alchemist.Weapons.Water.BloodMoonFlask>())
            {
                for (int i = 0; i < nb; i++)
                {
                    int     dmg       = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                    Vector2 vel       = (new Vector2(0f, -(float)((3 * alchProj.nbElements) + Main.rand.Next(3))).RotatedByRandom(MathHelper.ToRadians(10)));
                    int     spawnProj = ProjectileType <Alchemist.Projectiles.Water.BloodMoonFlaskProj>();
                    Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, dmg, 0f, projectile.owner);
                }
            }

            int type    = ProjectileType <Alchemist.Projectiles.Air.CloudInAVialProj>();
            int newProj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, type, 0, 0.5f, projectile.owner);

            Main.projectile[newProj].ai[1]     = alchProj.nbElements;
            Main.projectile[newProj].netUpdate = true;
        }
        public void brew(Item item, Player player, OrchidModPlayer modPlayer)
        {
            if (item.type != 0)
            {
                OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                AlchemistElement    element    = orchidItem.alchemistElement;
                int  damage          = item.damage;
                int  flaskType       = item.type;
                int  potencyCost     = orchidItem.alchemistPotencyCost;
                int  rightClickDust  = orchidItem.alchemistRightClickDust;
                int  colorR          = orchidItem.alchemistColorR;
                int  colorG          = orchidItem.alchemistColorG;
                int  colorB          = orchidItem.alchemistColorB;
                bool noPotency       = modPlayer.alchemistPotency < potencyCost + 1;
                bool alreadyContains = false;
                if ((int)element > 0 && (int)element < 7)
                {
                    alreadyContains = modPlayer.alchemistElements[(int)element - 1];
                }

                if (alreadyContains || noPotency ||
                    modPlayer.alchemistNbElements >= modPlayer.alchemistNbElementsMax ||
                    element == AlchemistElement.NULL || flaskType == 0)
                {
                    if (noPotency && !alreadyContains)
                    {
                        Main.PlaySound(19, (int)player.Center.X, (int)player.Center.Y, 1);
                    }
                    else
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 112);
                        }
                        else
                        {
                            Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, 111);
                        }
                    }
                }
                else
                {
                    OrchidModAlchemistItem.playerAddFlask(player, element, flaskType, damage, potencyCost, rightClickDust, colorR, colorG, colorB);
                    int rand = Main.rand.Next(3);
                    switch (rand)
                    {
                    case 1:
                        rand = 86;
                        break;

                    case 2:
                        rand = 87;
                        break;

                    default:
                        rand = 85;
                        break;
                    }

                    Main.PlaySound(2, (int)player.Center.X, (int)player.Center.Y, rand);
                    this.scroll(true);
                    this.checkInventory(true, player, modPlayer);

                    for (int k = 0; k < 5; k++)
                    {
                        int dust = Dust.NewDust(player.Center, 10, 10, rightClickDust);
                    }
                }
            }

            releasedKey = false;
        }
Esempio n. 29
0
 public override void AddVariousEffects(Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile proj, OrchidModGlobalItem globalItem)
 {
     alchProj.nbElementsNoExtract--;
 }
Esempio n. 30
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, (float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(180)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProjAlt>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active == true && proj.type == ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProj>() && proj.owner == projectile.owner && proj.localAI[1] != 1f)
                {
                    proj.Kill();
                }
            }
            nb  = alchProj.nbElements + alchProj.nbElementsNoExtract;
            nb += player.HasBuff(BuffType <Alchemist.Buffs.MushroomHeal>()) ? Main.rand.Next(3) : 0;
            for (int i = 0; i < nb; i++)
            {
                Vector2 vel = (new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(180)));
                int     dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProj>(), dmg, 0f, projectile.owner);
            }
        }