Esempio n. 1
0
        private float GetClassDamage(DamageType _type)
        {
            float     value   = 1;
            RPGPlayer pEntity = Main.player[Main.myPlayer].GetModPlayer <RPGPlayer>();

            if (ActiveClass == null)
            {
                return(1);
            }
            JsonChrClass actualClass = JsonCharacterClass.GetJsonCharList.GetClass(ActiveClass.GetClassType);

            value *= 1 + actualClass.Damage[(int)_type];
            if (_type == DamageType.Ranged)
            {
                if (pEntity.HaveBow())
                {
                    value *= 1 + actualClass.Damage[5];
                }
                if (pEntity.HaveRangedWeapon() && !pEntity.HaveBow())
                {
                    value *= 1 + actualClass.Damage[6];
                }
            }
            return(value);
        }
Esempio n. 2
0
        static public string GetClassDescription(ClassType classType)
        {
            JsonChrClass ClassInfo = JsonCharacterClass.GetJsonCharList.GetClass(classType);
            string       desc      = "";



            bool  allDamage = true;
            float damage    = ClassInfo.Damage[0];

            int id = 0;

            foreach (float d in ClassInfo.Damage)
            {
                id++;
                if (!allDamage || id > 4)
                {
                    break;
                }
                if (d != damage)
                {
                    allDamage = false;
                }
            }


            if (allDamage && ClassInfo.Damage[0] != 0)
            {
                desc += "+ " + (ClassInfo.Damage[0] * 100) + "% All Damage\n";
            }
            else
            {
                for (int i = 0; i < ClassInfo.Damage.Length; i++)
                {
                    if (ClassInfo.Damage[i] != 0)
                    {
                        if (ClassInfo.Damage[i] > 0)
                        {
                            desc += "+ " + (ClassInfo.Damage[i] * 100) + "% " + ((DamageNameTree)i).ToString() + " Damage\n";
                        }
                        else
                        {
                            desc += "- " + (-ClassInfo.Damage[i] * 100) + "% " + ((DamageNameTree)i).ToString() + " Damage\n";
                        }
                    }
                }
            }


            if (ClassInfo.Speed != 0)
            {
                if (ClassInfo.Speed > 0)
                {
                    desc += "+ " + (ClassInfo.Speed * 100) + "% Melee Speed\n";
                }
                else
                {
                    desc += "- " + (-ClassInfo.Speed * 100) + "% Melee Speed\n";
                }
            }

            if (ClassInfo.Health != 0)
            {
                if (ClassInfo.Health > 0)
                {
                    desc += "+ " + (ClassInfo.Health * 100) + "% Health\n";
                }
                else
                {
                    desc += "- " + (-ClassInfo.Health * 100) + "% Health\n";
                }
            }
            if (ClassInfo.Armor != 0)
            {
                if (ClassInfo.Armor > 0)
                {
                    desc += "+ " + (ClassInfo.Armor * 100) + "% Armor\n";
                }
                else
                {
                    desc += "- " + (-ClassInfo.Armor * 100) + "% Armor\n";
                }
            }
            if (ClassInfo.MovementSpeed != 0)
            {
                if (ClassInfo.MovementSpeed > 0)
                {
                    desc += "+ " + (ClassInfo.MovementSpeed * 100) + "% Movement Speed\n";
                }
                else
                {
                    desc += "- " + (-ClassInfo.MovementSpeed * 100) + "% Movement Speed\n";
                }
            }
            if (ClassInfo.Dodge != 0)
            {
                if (ClassInfo.Dodge != 0)
                {
                    desc += "+ " + (ClassInfo.Dodge * 100) + "% Dodge\n";
                }
                else
                {
                    desc += "- " + (-ClassInfo.Dodge * 100) + "% Dodge\n";
                }
            }
            if (ClassInfo.Ammo != 0)
            {
                if (ClassInfo.Ammo < 0)
                {
                    desc += "+ " + (-ClassInfo.Ammo * 100) + "% Ammo consumation\n";
                }
                else
                {
                    desc += "- " + (ClassInfo.Ammo * 100) + "% Ammo consumation\n";
                }
            }
            if (ClassInfo.Summons != 0)
            {
                if (ClassInfo.Summons < 0)
                {
                    desc += "- " + (-ClassInfo.Summons) + " Max Summon\n";
                }
                else
                {
                    desc += "+ " + ClassInfo.Summons + " Max Summon\n";
                }
            }
            if (ClassInfo.ManaCost != 0)
            {
                if (ClassInfo.ManaCost < 0)
                {
                    desc += "- " + (-ClassInfo.ManaCost * 100) + " Mana Cost";
                }
                else
                {
                    desc += "+ " + (ClassInfo.ManaCost * 100) + " Mana Cost";
                }
            }

            if (ClassInfo.ManaShield > 0 && (ClassInfo.ManaEfficiency > 0 || ClassInfo.ManaBaseEfficiency > 0))
            {
                int intelect = Main.player[Main.myPlayer].GetModPlayer <RPGPlayer>().GetStat(Stat.Int);
                desc += "Grand Mana Shield : " + (ClassInfo.ManaShield * 100) +
                        "% damage are absorbed by mana (" + (ClassInfo.ManaBaseEfficiency + (intelect * ClassInfo.ManaEfficiency)) + " Damage per mana)";
            }
            if (classType == ClassType.Shinobi)
            {
                desc += "+50% throw velocity";
            }
            if (classType == ClassType.Ninja)
            {
                desc += "+20% throw velocity";
            }
            return(desc);
        }
Esempio n. 3
0
        private void OpenToolTip(UIMouseEvent evt, UIElement listeningElement, NodeParent node)
        {
            if (node == null)
            {
                return;
            }
            toolTip = new UIPanel();
            float unzoomMult = ScreenMult;

            toolTip.Left.Set((node.menuPos.X + SKILL_SIZE * 2 + offSet.X) * sizeMultplier, 0);
            toolTip.Top.Set((node.menuPos.Y - SKILL_SIZE * 2 + offSet.Y) * sizeMultplier, 0);

            float TTWidth = 500;

            if (node.GetNodeType == NodeType.Class)
            {
                ClassType    CT        = (node.GetNode as ClassNode).GetClassType;
                JsonChrClass ClassInfo = JsonCharacterClass.GetJsonCharList.GetClass(CT);
                if (ClassInfo.ManaShield > 0)
                {
                    TTWidth = 750;
                }
            }
            toolTip.Width.Set(TTWidth * unzoomMult, 0);
            toolTip.Height.Set(350 * unzoomMult, 0);
            toolTip.SetPadding(0);
            toolTip.BackgroundColor = new Color(73, 94, 171, 150);

            UIText Name = new UIText("", 0.5f, true);

            Name.Left.Set(10, 0);
            Name.Top.Set(10, 0);
            switch (node.GetNodeType)
            {
            case NodeType.Class:
                Name.SetText("Class : " + (node.GetNode as ClassNode).GetClassType);
                break;

            case NodeType.Perk:
                Name.SetText("Perk : " + (node.GetNode as PerkNode).GetPerk + " \nLevel : " + node.GetLevel + " / " + node.GetMaxLevel);
                break;

            case NodeType.Immunity:
                Name.SetText("Class : " + (node.GetNode as ImmunityNode).GetImmunity);
                break;

            case NodeType.Damage:
                Name.SetText("Bonus " + (node.GetNode as DamageNode).GetDamageType + " Damage\nLevel : " + node.GetLevel + " / " + node.GetMaxLevel);
                break;

            case NodeType.Leech:
                Name.SetText("Bonus " + (node.GetNode as LeechNode).GetLeechType + " Leech\nLevel : " + node.GetLevel + " / " + node.GetMaxLevel);
                break;

            case NodeType.Speed:
                Name.SetText("Bonus " + (node.GetNode as SpeedNode).GetDamageType + " Speed\nLevel : " + node.GetLevel + " / " + node.GetMaxLevel);
                break;

            case NodeType.Stats:
                Name.SetText("Bonus " + (node.GetNode as StatNode).GetStatType + " Stats\nLevel : " + node.GetLevel + " / " + node.GetMaxLevel);
                break;

            case NodeType.LimitBreak:
                Name.SetText("LIMIT BREAK : " + (node.GetNode as LimitBreakNode).LimitBreakType, unzoomMult, false);
                break;
            }

            UIText info = new UIText("Level Required : " + node.GetLevelRequirement + "\nCost " + node.GetCostPerLevel + " Points Per Level\n");

            info.Left.Set(50 * unzoomMult, 0);
            info.Top.Set(100 * unzoomMult, 0);

            UIText description = new UIText(SkillInfo.GetDesc(node.GetNode));

            description.Left.Set(50 * unzoomMult, 0);
            description.Top.Set(170 * unzoomMult, 0);

            Main.PlaySound(SoundID.MenuTick);

            backGround.Append(toolTip);
            toolTip.Append(Name);
            toolTip.Append(info);
            toolTip.Append(description);


            backGround.Recalculate();
        }