Пример #1
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            if (!Fargowiltas.Instance.ThoriumLoaded)
            {
                return;
            }

            ThoriumPlayer thoriumPlayer = player.GetModPlayer <ThoriumPlayer>();

            //durasteel effect
            if (player.statLife == player.statLifeMax2)
            {
                player.endurance += .12f;
            }

            //ball n chain
            thoriumPlayer.ballnChain = true;

            if (player.GetModPlayer <FargoPlayer>().ThoriumSoul)
            {
                return;
            }

            //spiked bracers
            player.thorns += 0.25f;

            //ogre sandals
            ModContent.GetModItem(ModContent.ItemType <OgreSandal>()).UpdateAccessory(player, hideVisual);

            //crystal spear tip
            ModContent.GetModItem(ModContent.ItemType <CrystalSpearTip>()).UpdateAccessory(player, hideVisual);
        }
Пример #2
0
 public override bool PreAI()
 {
     if (ModContent.GetModItem(Main.LocalPlayer.HeldItem.type) is Items.KnifeDamageItem)
     {
         ParentWeapon = Main.LocalPlayer.HeldItem.GetGlobalItem <KnifeWeapon>();
     }
     return(true);
 }
Пример #3
0
        public void Draw(SpriteBatch sb)
        {
            PlayerFixer pf          = Main.LocalPlayer.GetModPlayer <PlayerFixer>();
            bool        canPurchase = pf.CanPurchase(item.cost);
            Color       color;

            if (canPurchase)
            {
                Rectangle mouseRect = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);
                if (mouseRect.Intersects(rect))
                {
                    color = Color.LightBlue;
                    if (!intersect && Main.hasFocus)
                    {
                        Main.PlaySound(SoundID.MenuTick, Main.LocalPlayer.position);
                    }
                    intersect = true;
                }
                else
                {
                    intersect = false;
                    color     = Color.CornflowerBlue;
                }
            }
            else
            {
                color = Color.DarkRed;
            }
            ModItem   mit          = ModContent.GetModItem(item.itemID);
            Texture2D boxTex       = ModContent.GetInstance <StarSailorMod>().box;
            Texture2D boxInsideTex = ModContent.GetInstance <StarSailorMod>().boxInside;
            Texture2D itemTex      = Main.itemTexture[item.itemID];

            DrawBox(sb, rect, color, alpha);
            sb.Draw(boxTex, new Rectangle(rect.X + 10, rect.Y + (rect.Height / 2) - (boxTex.Height / 2), boxTex.Width, boxTex.Height), Color.White);
            sb.Draw(boxInsideTex, new Rectangle(rect.X + 10, rect.Y + (rect.Height / 2) - (boxTex.Height / 2), boxTex.Width, boxTex.Height), Color.White * 0.9f);
            sb.Draw(itemTex, new Rectangle(rect.X + 10 + (boxTex.Width / 2) - (itemTex.Width / 2), rect.Y + (rect.Height / 2) - (itemTex.Height / 2), itemTex.Width, itemTex.Height), Color.White);
            float scale = 0.3f;

            ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontMouseText, GetNameString(), new Vector2(rect.X + 20 + boxTex.Width, rect.Y + (rect.Height / 2) - (boxTex.Height / 2)), Color.White, 0f, new Vector2(0), new Vector2(1f), -1f, 1.5f);
            ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, item.description, new Vector2(rect.X + 20 + boxTex.Width, 30 + rect.Y + (rect.Height / 2) - (boxTex.Height / 2)), Color.White, 0f, new Vector2(0), new Vector2(scale), -1f, 1.5f);
            string  costString = GetCostString();
            Vector2 dims       = Main.fontMouseText.MeasureString(GetCostMeasureString());

            ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, costString, new Vector2(rect.X + rect.Width - dims.X, rect.Y + 5), Color.White, 0f, Vector2.Zero, Vector2.One, -1f, 2f);
        }
Пример #4
0
        public override void Action(CommandCaller caller, string input, string[] args)
        {
            PotPotPlayer modPlayer = Main.LocalPlayer.GetModPlayer <PotPotPlayer>();

            switch (args[0].ToLower())
            {
            case "items":
                int j = 0;
                foreach (Item i in modPlayer.PotPotContent)
                {
                    string msg = "[" + j + "] " + i.Name;
                    if (i.Name == "")
                    {
                        msg += "<Empty>";
                    }

                    Main.NewText(msg, 111, 111, 111);
                    mod.Logger.Info(msg);

                    j++;
                }
                break;

            case "buffs":
                foreach (int i in modPlayer.Buffs)
                {
                    string msg = "[" + i + "] ";

                    if (ModContent.GetModItem(i) != null)
                    {
                        msg += ModContent.GetModItem(i)?.Name;
                    }
                    else
                    {
                        msg += Lang.GetItemName(i);
                    }

                    Main.NewText(msg, 111, 111, 111);
                    mod.Logger.Debug(msg);
                }
                break;
            }
        }
Пример #5
0
        string GetNameString()
        {
            ModItem mit = ModContent.GetModItem(item.itemID);

            switch (mit.item.rare)
            {
            case ItemRarityID.Blue:
                return("[c/" + Colors.AlphaDarken(Colors.RarityBlue).Hex3() + ":" + mit.DisplayName.GetTranslation(GameCulture.English) + "] ");

            case ItemRarityID.LightPurple:
                return("[c/" + Colors.AlphaDarken(Colors.RarityPurple).Hex3() + ":" + mit.DisplayName.GetTranslation(GameCulture.English) + "] ");

            case ItemRarityID.LightRed:
                return("[c/" + Colors.AlphaDarken(Colors.RarityPink).Hex3() + ":" + mit.DisplayName.GetTranslation(GameCulture.English) + "] ");

            case ItemRarityID.Red:
                return("[c/" + Colors.AlphaDarken(Colors.RarityRed).Hex3() + ":" + mit.DisplayName.GetTranslation(GameCulture.English) + "] ");
            }
            return("");
        }
Пример #6
0
        public override void PostUpdate()
        {
            if (unboxed != -1)
            {
                string text = player.name + " unboxed an " + ModContent.GetModItem(unboxed).item.Name + "!";

                if (Main.netMode == NetmodeID.Server)
                {
                    NetworkText message = NetworkText.FromLiteral(text);
                    NetMessage.BroadcastChatMessage(message, Color.MediumPurple);
                }

                unboxed = -1;
            }

            if (receivingAura)
            {
                player.statDefense += 8;
            }
            //Main.NewText(player.bodyFrame.Y / player.bodyFrame.Height);

            clock = (byte)((clock + 1) % 60);
        }
Пример #7
0
        public static int GetShovelRadius(int shovel)
        {
            Item i = ModContent.GetModItem(shovel).item;

            return(i.GetGlobalItem <GlobalTrelamiumItem>().radius);
        }
Пример #8
0
        public static int GetDigPower(int shovel)
        {
            Item i = ModContent.GetModItem(shovel).item;

            return(i.GetGlobalItem <GlobalTrelamiumItem>().digPower);
        }
Пример #9
0
        private static bool CheckMask(int type)
        {
            ModItem item = ModContent.GetModItem(type);

            return(item != null && item.mod == ZEROWORLD.Instance && !ItemCollection.ContainsKey(type));
        }