Пример #1
0
        public override bool CanUseItem(Item item, Player player)
        {
            if (ClickerSystem.IsClickerWeapon(item))
            {
                ClickerPlayer clickerPlayer = player.GetModPlayer <ClickerPlayer>();
                if (clickerPlayer.clickerAutoClick || player.HasBuff(ModContent.BuffType <AutoClick>()))
                {
                    item.autoReuse = true;
                }
                else
                {
                    item.autoReuse = false;
                }

                if (!clickerPlayer.HasClickEffect(ClickEffect.PhaseReach))
                {
                    //collision
                    Vector2 motherboardPosition = clickerPlayer.setMotherboardPosition;
                    bool    inRange             = Vector2.Distance(Main.MouseWorld, player.Center) < clickerPlayer.ClickerRadiusReal && Collision.CanHit(new Vector2(player.Center.X, player.Center.Y - 12), 1, 1, Main.MouseWorld, 1, 1);
                    bool    inRangeMotherboard  = Vector2.Distance(Main.MouseWorld, motherboardPosition) < clickerPlayer.ClickerRadiusMotherboard && Collision.CanHit(motherboardPosition, 1, 1, Main.MouseWorld, 1, 1);
                    //bool allowMotherboard = player.GetModPlayer<ClickerPlayer>().clickerMotherboardSet && player.altFunctionUse == 2;

                    if (inRange || (inRangeMotherboard && player.altFunctionUse != 2))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(base.CanUseItem(item, player));
        }
Пример #2
0
        public override bool CanUseItem(Item item, Player player)
        {
            if (ClickerSystem.IsClickerWeapon(item))
            {
                ClickerPlayer clickerPlayer = player.GetModPlayer <ClickerPlayer>();

                if (!clickerPlayer.HasClickEffect(ClickEffect.PhaseReach))
                {
                    clickerPlayer.CheckPositionInRange(Main.MouseWorld, out bool inRange, out bool inRangeMotherboard);
                    if (inRange || (inRangeMotherboard && player.altFunctionUse != 2))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(base.CanUseItem(item, player));
        }