예제 #1
0
        public override void ModifyBuffTip(ref string tip, ref int rare)
        {
            VapePlayer vp = Main.LocalPlayer.GetModPlayer <VapePlayer>();

            tip += String.Format(" (Current: {0}%)", vp.highfiveStacks * 2);
            base.ModifyBuffTip(ref tip, ref rare);
        }
예제 #2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            VapePlayer vp = Main.LocalPlayer.GetModPlayer <VapePlayer>();

            this.skillLevelText.SetText(String.Format("{0}/{1}", vp.SkillLevels[this.skill.name], this.skill.maxLevel));
        }
예제 #3
0
        public override void Update(Player player, ref int buffIndex)
        {
            VapePlayer vp = player.GetModPlayer <VapePlayer>();

            vp.energized        = true;
            player.moveSpeed   *= 2f;
            player.maxRunSpeed += 2;
            Dust.NewDust(player.position, player.width, player.height, 15, Scale: 1.5f);
        }
예제 #4
0
        public override void ModifyBuffTip(ref string tip, ref int rare)
        {
            VapePlayer vp = Main.LocalPlayer.GetModPlayer <VapePlayer>();

            if (vp.HasSkill("Fury"))
            {
                tip += String.Format(" and melee speed");
            }
            tip += String.Format(" ({0}%)", vp.SkillLevels["Rage"] * 3);
            base.ModifyBuffTip(ref tip, ref rare);
        }
예제 #5
0
        public override bool ReApply(Player player, int time, int buffIndex)
        {
            VapePlayer vp = player.GetModPlayer <VapePlayer>();

            vp.highfiveStacks++;
            if (vp.highfiveStacks >= 50)
            {
                vp.highfiveStacks = 0;
                player.ClearBuff(Type);
            }
            return(base.ReApply(player, time, buffIndex));
        }
예제 #6
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            VapePlayer vp = Main.LocalPlayer.GetModPlayer <VapePlayer>();

            if (this.skill.Prerequisites.Count > 0 && !vp.HasPrerequisiteForSkill(this.skill))
            {
                CalculatedStyle dimensions = this.GetDimensions();
                Point           point1     = new Point((int)dimensions.X, (int)dimensions.Y);
                int             width      = (int)Math.Ceiling(dimensions.Width);
                int             height     = (int)Math.Ceiling(dimensions.Height);
                spriteBatch.Draw(this.skillShade, new Rectangle(point1.X, point1.Y, width, height), Color.White);
            }
        }
예제 #7
0
        public override bool UseItem(Player player)
        {
            VapePlayer vp = player.GetModPlayer <VapePlayer>();

            int statPoints  = 0;
            int skillPoints = 0;
            int chaosPoints = 0;

            foreach (string stat in VapeRPG.BaseStats)
            {
                statPoints        += (vp.BaseStats[stat] - 1);
                vp.BaseStats[stat] = 1;
            }

            foreach (Skill skill in VapeRPG.Skills)
            {
                skillPoints += vp.SkillLevels[skill.name];
                vp.SkillLevels[skill.name] = 0;
            }

            foreach (string bonus in VapeRPG.MinorStats)
            {
                if (bonus != "Block Chance")
                {
                    if (bonus.Contains("Crit"))
                    {
                        chaosPoints += (int)vp.ChaosBonuses[bonus];
                    }
                    else if (bonus.Contains("Dodge"))
                    {
                        chaosPoints += (int)(vp.ChaosBonuses[bonus] / 0.005f);
                    }
                    else
                    {
                        chaosPoints += (int)(vp.ChaosBonuses[bonus] / 0.02f);
                    }
                    vp.ChaosBonuses[bonus] = 0;
                }
            }

            vp.statPoints  += statPoints;
            vp.skillPoints += skillPoints;
            vp.chaosPoints += chaosPoints;

            return(true);
        }
예제 #8
0
        public override void Action(CommandCaller caller, string input, string[] args)
        {
            int val;

            if (caller.Player.name == "vapetest")
            {
                VapePlayer player = caller.Player.GetModPlayer <VapePlayer>();

                if (int.TryParse(args[0], out val))
                {
                    player.GainExperience(val);
                }
            }
            else
            {
                Main.NewText("You're not authorized to use this command.", Color.Red);
            }
        }
예제 #9
0
        public override bool ReApply(Player player, int time, int buffIndex)
        {
            VapePlayer vp = player.GetModPlayer <VapePlayer>();

            vp.energizedStacks++;
            if (vp.energizedStacks >= maxStacks)
            {
                player.AddBuff(mod.BuffType <FullyEnergized>(), 600);
                Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Energized"), player.position);
                vp.energizedStacks = 0;
                player.ClearBuff(Type);
            }
            else
            {
                Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Charge"), player.position);
            }
            return(base.ReApply(player, time, buffIndex));
        }
예제 #10
0
        public override void Update(Player player, ref int buffIndex)
        {
            VapePlayer vp = player.GetModPlayer <VapePlayer>();

            player.buffTime[buffIndex] = vp.highfiveStacks * 60;

            int   critAmount   = 2 * vp.highfiveStacks;
            float damageAmount = 2 * 0.01f * vp.highfiveStacks;

            player.meleeCrit    += critAmount;
            player.meleeDamage  += damageAmount;
            player.rangedCrit   += critAmount;
            player.rangedDamage += damageAmount;
            player.magicCrit    += critAmount;
            player.magicDamage  += damageAmount;
            player.minionDamage += damageAmount;
            player.thrownDamage += damageAmount;
            player.thrownCrit   += critAmount;
        }
예제 #11
0
        public UISkillInfo(Skill skill, float width = defaultWidth, float height = defaultHeight)
        {
            this.skillShade = ModLoader.GetTexture("VapeRPG/Textures/UI/Skills/SkillShade");

            this.skill = skill;

            this.Width.Set(width, 0);
            this.Height.Set(height, 0);

            this.icon = new UIImage(this.skill.icon);
            this.icon.SetPadding(0);
            this.icon.Width.Set(width, 0);
            this.icon.Height.Set(height, 0);
            this.icon.Left.Set(0, 0);
            this.icon.Top.Set(0, 0);

            this.skillLevelText = new UIText("0/0");
            this.skillLevelText.Left.Set(this.Width.Pixels - this.skillLevelText.MinWidth.Pixels, 0);
            this.skillLevelText.Top.Set(this.Height.Pixels - this.skillLevelText.MinHeight.Pixels, 0);

            this.icon.OnClick += (x, y) =>
            {
                VapePlayer vp = Main.player[Main.myPlayer].GetModPlayer <VapePlayer>();

                if (vp.HasPrerequisiteForSkill(this.skill) && vp.skillPoints > 0 && vp.SkillLevels[this.skill.name] < this.skill.maxLevel)
                {
                    vp.SkillLevels[this.skill.name]++;
                    if (vp.player.name != "vp")
                    {
                        vp.skillPoints--;
                    }
                }
            };

            this.Append(this.icon);
            this.Append(this.skillLevelText);
        }
예제 #12
0
        public UIStatInfo(string stat, float width, float height, bool isMinorStat = false, bool button = true, float textScale = 1f)
        {
            this.stat        = stat;
            this.statValue   = 0;
            this.bonusValue  = 0;
            this.isMinorStat = isMinorStat;

            this.statText = new UIText(stat, textScale);
            this.statText.Left.Set(0, 0);
            this.statText.Top.Set(0, 0);

            this.Width.Set(width, 0);
            this.Height.Set(height, 0);

            if (button)
            {
                this.button = new UIImageButton(ModLoader.GetTexture("VapeRPG/Textures/UI/Button/AddButton"));
                this.button.Width.Set(30, 0);
                this.button.Height.Set(30, 0);
                this.button.Top.Set(0, 0);

                MouseEvent onMouseDown;

                if (this.isMinorStat)
                {
                    onMouseDown = (x, y) =>
                    {
                        VapePlayer vp = Main.player[Main.myPlayer].GetModPlayer <VapePlayer>();
                        if (this.stat.Contains("Max Minions"))
                        {
                            if (vp.chaosPoints >= 5)
                            {
                                vp.ChaosBonuses[this.stat] += 1;
                                vp.chaosPoints             -= 5;
                            }
                        }
                        else
                        {
                            if (vp.chaosPoints > 0)
                            {
                                float value = 0.02f;
                                if (this.stat.Contains("Crit"))
                                {
                                    value = 1;
                                }
                                if (this.stat.Contains("Dodge"))
                                {
                                    value = 0.005f;
                                    if (vp.dodgeChance >= 0.7f)
                                    {
                                        return;
                                    }
                                }
                                vp.ChaosBonuses[this.stat] += value;
                                vp.chaosPoints--;
                            }
                        }
                    };
                    this.button.Left.Set(-50, 1f);
                }
                else
                {
                    onMouseDown = (x, y) =>
                    {
                        VapePlayer vp = Main.player[Main.myPlayer].GetModPlayer <VapePlayer>();
                        if (vp.statPoints > 0)
                        {
                            vp.BaseStats[this.stat]++;
                            vp.statPoints--;
                        }
                    };
                    this.button.Left.Set(-80, 1f);
                }
                this.button.OnClick += onMouseDown;

                this.Append(this.button);
            }

            if (!this.isMinorStat)
            {
                this.bonusText = new UIText("+ 0");
                this.bonusText.Left.Set(-50, 1f);
                this.bonusText.Height.Set(0, 1f);
                this.bonusText.TextColor = Color.LimeGreen;

                this.Append(this.bonusText);
            }

            this.Append(this.statText);
        }