Beispiel #1
0
    private void DisplayAttributes()
    {
        string attributes = "";

        attributes += "Character Class:" + _pc.playerClass.ToString() + "\n";

        foreach (Attribute att in _pc.Attributes)
        {
            attributes += att.AttributeString() + "\n";
        }


        foreach (Vital vit in _pc.Vitals)
        {
            attributes += vit.Name + ": " + vit.CurValue + "/" + vit.MaxValue + "\n";
        }

        Weapon weapon = _pc.EquipedWeapon as Weapon;

        attributes += "\n" + "Offensive: \n";
        if (weapon != null)
        {
            attributes += "Damage: " + _pc.GetDPSString() + " (+" + weapon.DmgValue + ")" + "\n";
            attributes += "Attack Speed: " + _pc.AttackSpeed.ToString("0.00") + "\n";
            attributes += "Critical Chance: " + (_pc.CritChance * 100).ToString("0") + "%";
            attributes += " (" + (_pc.CritDamage * 100).ToString("0") + "%)" + "\n";
            attributes += "Max Hit: " + ((int)(_pc.MaxDamage * _pc.CritDamage) + (int)(weapon.DmgValue * _pc.CritDamage)).ToString() + "\n";
        }
        else
        {
            attributes += "Damage: " + _pc.GetDPSString() + "\n";
            attributes += "Attack Speed: " + _pc.AttackSpeed.ToString("0.00") + "\n";
            attributes += "Critical Chance: " + (_pc.CritChance * 100).ToString("0") + "%";
            attributes += " (" + (_pc.CritDamage * 100).ToString("0") + "%)" + "\n";
            attributes += "Max Hit: " + ((int)(_pc.MaxDamage * _pc.CritDamage)).ToString() + "\n";
        }


        attributes += "\n" + "Defensive: \n";
        attributes += "Armor: " + _pc.PlayerArmor + "\n";
        attributes += "Chance To Block: " + (_pc.PlayerChanceToBlock * 100).ToString("0") + "\n";
        attributes += "Damage Blocked: " + _pc.PlayerDamageBlocked + "\n";

        attributes += "\n" + "Misc: \n";
        attributes += "MoveSpeed: " + (_pc.MoveSpeed * 100).ToString("0") + "%" + "\n";

        //GUI.Box (new Rect(69,21,164,195),attributes,"CharacterWindowAttr");
        GUILayout.BeginArea(new Rect(69, 21, 164, 195));
        _charWindowSlider = GUILayout.BeginScrollView(_charWindowSlider);
        GUILayout.Box(attributes, "CharacterWindowAttr");
        GUILayout.EndScrollView();
        GUILayout.EndArea();
    }