Esempio n. 1
0
        public override bool ConsumeAmmo(Item item, Player player)
        {
            CheddarModPlayer modPlayer = player.GetModPlayer <CheddarModPlayer>();

            if (modPlayer.tome || modPlayer.stuff || (modPlayer.ammomancer && Main.rand.Next(2) == 0))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public override void AI(Projectile projectile)
        {
            CheddarModPlayer modPlayer = Main.player[projectile.owner].GetModPlayer <CheddarModPlayer>();

            if ((projectile.aiStyle == 19 || projectile.aiStyle == 699) &&
                Main.player[projectile.owner].HeldItem.melee &&
                (modPlayer.hero || modPlayer.trueHero) &&
                projectile.timeLeft > Main.player[projectile.owner].itemAnimation)
            {
                projectile.timeLeft  = Main.player[projectile.owner].itemAnimation;
                projectile.netUpdate = true;
            }
        }
Esempio n. 3
0
        public override bool ConsumeItem(Item item, Player player)
        {
            CheddarModPlayer modPlayer = player.GetModPlayer <CheddarModPlayer>();

            if (modPlayer.stuff)
            {
                return(false);
            }
            else if (item.thrown && (modPlayer.scroll || (modPlayer.pocket && Main.rand.Next(2) == 0)))
            {
                return(false);
            }
            else if ((item.buffType > 0 || item.potion || item.healLife > 0 || item.healMana > 0) && modPlayer.potionSaver)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
        public override bool CanUseItem(Item item, Player player)
        {
            CheddarModPlayer modPlayer = player.GetModPlayer <CheddarModPlayer>();

            if ((modPlayer.trueHero && item.damage > 0) || (item.melee && modPlayer.hero))
            {
                if (!FakeAutoReuse)
                {
                    RealAutoReuseValue = item.autoReuse;
                    FakeAutoReuse      = true;
                }
                item.autoReuse = true;
            }
            else
            {
                if (FakeAutoReuse)
                {
                    item.autoReuse = RealAutoReuseValue;
                    FakeAutoReuse  = false;
                }
            }
            return(base.CanUseItem(item, player));
        }