Esempio n. 1
0
        public override bool UseItem(Player player)
        {
            CustomStats stats = player.GetModPlayer <BluemagicPlayer>(mod).chaosStats;

            stats.Points++;
            return(true);
        }
Esempio n. 2
0
	public SYCreep(int id, Vector2 position, Vector2 velocity, CustomStats stats, Map map)
		:base(position, map)
	{
		this.id = id;
		this.velocity = velocity;

		creepStats = stats;
	}
Esempio n. 3
0
    public SYCreep(Vector2 position, SYCreepCamp camp, CustomStats stats, Map map)
        : base(position, map)
    {
        id = Map.AddCreep(this);

        creepCamp  = camp;
        creepStats = stats;

        health = MaxHealth;         //Required because called virtual method in constructor :(

        SendExistanceToPlayer(Map.playerList);
    }
Esempio n. 4
0
        private static void DrawButtons()
        {
            Mod         mod            = Bluemagic.Instance;
            CustomStats chaosStats     = GetChaosStats();
            CustomStats cataclysmStats = GetCataclysmStats();

            if (testing || chaosStats.Points + chaosStats.UsedPoints > 0)
            {
                chaosButtonPos = new Vector2(Main.screenWidth / 2 + 16f, 70f);
            }
            if (testing || cataclysmStats.Points + cataclysmStats.UsedPoints > 0)
            {
                cataclysmButtonPos = new Vector2(Main.screenWidth / 2 + 80f, 70f);
            }
            if (chaosButtonPos.X >= 0f && chaosButtonPos.Y >= 0f)
            {
                Color color = Color.White;
                if (IsMouseOver(chaosButtonPos, 32, 32))
                {
                    color = Color.Silver;
                    Main.player[Main.myPlayer].mouseInterface = true;
                }
                Main.spriteBatch.Draw(mod.GetTexture("Interface/ChaosButton"), chaosButtonPos, color);
            }
            if (cataclysmButtonPos.X >= 0f && cataclysmButtonPos.Y >= 0f)
            {
                Color color = Color.White;
                if (IsMouseOver(cataclysmButtonPos, 32, 32))
                {
                    color = Color.Silver;
                    Main.player[Main.myPlayer].mouseInterface = true;
                }
                Main.spriteBatch.Draw(mod.GetTexture("Interface/CataclysmButton"), cataclysmButtonPos, color);
            }
            if (Clicking())
            {
                int oldSelected = selected;
                if (chaosButtonPos.X >= 0f && chaosButtonPos.Y >= 0f && IsMouseOver(chaosButtonPos, 32, 32))
                {
                    selected = 0;
                }
                if (cataclysmButtonPos.X >= 0f && cataclysmButtonPos.Y >= 0f && IsMouseOver(cataclysmButtonPos, 32, 32))
                {
                    selected = 1;
                }
                if (oldSelected != selected)
                {
                    scroll = 0;
                    Main.PlaySound(12, -1, -1, 1);
                }
            }
        }
Esempio n. 5
0
    public CustomStats(CustomStats par, params object[] objects)
    {
        foreach (KeyValuePair <string, object> p in par.stats)
        {
            stats.Add(p.Key, p.Value);
        }

        for (int i = 0; i < objects.Length; i += 2)
        {
            string key = objects[i] as string;

            if (stats.ContainsKey(key))
            {
                stats[key] = objects[i + 1];
            }
            else
            {
                stats.Add(key, objects[i + 1]);
            }
        }
    }
Esempio n. 6
0
        public override bool CanUseItem(Player player)
        {
            CustomStats stats = player.GetModPlayer <BluemagicPlayer>(mod).chaosStats;

            return(stats.CanUpgrade());
        }
Esempio n. 7
0
        private static void DrawPanelExtras()
        {
            Mod mod = Bluemagic.Instance;

            if (IsMouseOver(panel))
            {
                Main.player[Main.myPlayer].mouseInterface = true;
                Main.player[Main.myPlayer].showItemIcon   = false;
                InterfaceHelper.HideItemIconCache();
            }
            string text;

            if (selected == 1)
            {
                curStats = GetCataclysmStats();
                text     = "Cataclysm Boosts";
            }
            else
            {
                curStats = GetChaosStats();
                text     = "Chaos Boosts";
            }
            CalculatedStyle   dim      = panel.GetDimensions();
            DynamicSpriteFont font     = Main.fontMouseText;
            Vector2           textSize = font.MeasureString(text);
            Vector2           drawPos  = dim.Position() + new Vector2((dim.Width - textSize.X) / 2f, 10f);

            Utils.DrawBorderString(Main.spriteBatch, text, drawPos, Color.White);
            if (selected == 1)
            {
                text     = "Expert Only";
                textSize = font.MeasureString(text);
                drawPos  = dim.Position() + new Vector2((dim.Width - textSize.X) / 2f, 32f);
                Utils.DrawBorderString(Main.spriteBatch, text, drawPos, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB));
            }
            text     = curStats.Points + " Point(s) Available";
            textSize = font.MeasureString(text);
            drawPos  = dim.Position() + new Vector2((dim.Width - textSize.X) / 2f, 54f);
            Utils.DrawBorderString(Main.spriteBatch, text, drawPos, Color.White);

            for (int k = 0; k < visibleStats.Length; k++)
            {
                int index = scroll * visibleStats.Length + k;
                if (index >= curStats.Stats.Count)
                {
                    break;
                }
                visibleStats[k] = curStats.Stats[index];
                DrawStat(visibleStats[k], GetStatOffset(k));
            }

            Vector2   arrowPos            = dim.Position() + new Vector2(dim.Width / 2f, 278f);
            float     arrowOffset         = 16f;
            Texture2D texture             = LeftArrowActive() ? mod.GetTexture("Interface/ArrowLeftActive") : mod.GetTexture("Interface/ArrowLeftInactive");
            Vector2   leftArrowPos        = arrowPos + new Vector2(-arrowOffset - texture.Width, 0f);
            Vector2   rightArrowPos       = arrowPos + new Vector2(arrowOffset, 0f);
            bool      mouseOverLeftArrow  = IsMouseOver(leftArrowPos, texture.Width, texture.Height);
            bool      mouseOverRightArrow = IsMouseOver(rightArrowPos, texture.Width, texture.Height);

            Main.spriteBatch.Draw(texture, leftArrowPos, mouseOverLeftArrow ? Color.Silver : Color.White);
            texture = RightArrowActive() ? mod.GetTexture("Interface/ArrowRightActive") : mod.GetTexture("Interface/ArrowRightInactive");
            Main.spriteBatch.Draw(texture, rightArrowPos, mouseOverRightArrow ? Color.Silver : Color.White);
            if (LeftArrowActive() && mouseOverLeftArrow && Clicking())
            {
                scroll--;
                Main.PlaySound(12, -1, -1, 1);
            }
            else if (RightArrowActive() && mouseOverRightArrow && Clicking())
            {
                scroll++;
                Main.PlaySound(12, -1, -1, 1);
            }
        }