Esempio n. 1
0
        public bool Update(Talent talent, PlayerClassEnum playerClassEnum)
        {
            if (talentTabs.Count == 0 || talentTreeElements.Count == 0)
            {
                return(false);
            }

            string playerClass = playerClassEnum.ToString().ToLower();
            int    tabIndex    = talent.TabNum - 1;
            int    tierIndex   = talent.TierNum - 1;
            int    columnIndex = talent.ColumnNum - 1;

            int talentTabIndex = talentTabs.FindIndex(x => x.BackgroundFile.ToLower().Contains(playerClass) && x.OrderIndex == tabIndex);

            if (talentTabIndex == -1)
            {
                return(false);
            }
            int talentElementIndex = talentTreeElements.FindIndex(x => x.TabID == talentTabs[talentTabIndex].Id && x.TierID == tierIndex && x.ColumnIndex == columnIndex);

            if (talentElementIndex == -1)
            {
                return(false);
            }

            var spellId = talentTreeElements[talentElementIndex].SpellIds[talent.CurrentRank - 1];

            if (spellDB.Spells.TryGetValue(spellId, out Spell spell))
            {
                talent.Name = spell.Name;
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
    public static string getClassDescription(PlayerClassEnum cl)
    {
        switch (cl)
        {
        case PlayerClassEnum.Rogue:
            return("If you ask people who is this man, no one will tell you for sure, but it's well known that if you see him in the crowd, you better watch your wallet.");

        case PlayerClassEnum.Mage:
            return("Powerful yet wise, every mage apprentice wished to become more like him. Rumors say, he what lies beyond the Dwarven Halls.");

        case PlayerClassEnum.Warrior:
            return("Everyone in the countryside knew this boy as a local jester, but he changed drastically after he returned from king's army service.");

        default:
            break;
        }
        return(null);
    }
Esempio n. 3
0
    public static string getClassSkillDescription(PlayerClassEnum cl)
    {
        switch (cl)
        {
        case PlayerClassEnum.Rogue:
            return("Originally wielded by all kinds of thiefs, nowadays can be used by people who want to hide their presence from enemies or to stay invisible in both meanings.");

        case PlayerClassEnum.Mage:
            return("Magical sleep that can pacify wild beasts apart from ones with the strongest mind and will.");

        case PlayerClassEnum.Warrior:
            return("Good old trick which can be used to attack or flee.");

        default:
            break;
        }
        return(null);
    }
Esempio n. 4
0
    public static Type getClassSkill(PlayerClassEnum cl)
    {
        switch (cl)
        {
        case PlayerClassEnum.Rogue:
            return(typeof(Cloak));

        case PlayerClassEnum.Mage:
            return(typeof(Sleep));

        case PlayerClassEnum.Warrior:
            return(typeof(Dash));

        default:
            break;
        }
        return(null);
    }
Esempio n. 5
0
    public static Sprite getClassTexture(PlayerClassEnum cl)
    {
        switch (cl)
        {
        case PlayerClassEnum.Rogue:
            return(Resources.Load <Sprite>("rogue_sprite"));

        case PlayerClassEnum.Mage:
            return(Resources.Load <Sprite>("mage_sprite"));

        case PlayerClassEnum.Warrior:
            return(Resources.Load <Sprite>("archer_sprite"));

        default:
            break;
        }
        return(null);
    }
Esempio n. 6
0
    public static RuntimeAnimatorController getClassAnimator(PlayerClassEnum cl)
    {
        switch (cl)
        {
        case PlayerClassEnum.Rogue:
            var r1 = Resources.Load <RuntimeAnimatorController>("Rogue_anim");
            return(r1);

        case PlayerClassEnum.Mage:
            var r2 = Resources.Load <RuntimeAnimatorController>("Mage_anim");
            return(r2);

        case PlayerClassEnum.Warrior:
            var r3 = Resources.Load <RuntimeAnimatorController>("Archer_anim");
            return(r3);

        default:
            break;
        }
        return(null);
    }
Esempio n. 7
0
 public ReadOnlyCollection <SkillContainer> getSkills(PlayerClassEnum _enum)
 {
     return(skills.Where(p => p.spoperties.playerClass == _enum).ToList().AsReadOnly());
 }
Esempio n. 8
0
 public SkillProperties(int id, float damage, float coolDown, float force, float speed, float radius, float ragne, float castTime, PlayerClassEnum playerClass, PlayerSkillEnum playerSkillType, List <UpgradeManager> update, List <float> updateCoof, int nowLevel, int maxLevel, int cost, string _name, string description, float damageDistanсeProcentage, float forceDistanсeProcentage)
 {
     this.id                       = id;
     this.speed                    = speed;
     this.damage                   = damage;
     this.coolDown                 = coolDown;
     this.force                    = force;
     this.speed                    = speed;
     this.radius                   = radius;
     this.castTime                 = castTime;
     this.playerClass              = playerClass;
     this.playerSkillType          = playerSkillType;
     this.update                   = update;
     this.updateCoof               = updateCoof;
     this.maxLevel                 = maxLevel;
     this.cost                     = cost;
     this.ragne                    = ragne;
     this.damageDistanсeProcentage = damageDistanсeProcentage;
     this.forceDistanсeProcentage  = forceDistanсeProcentage;
 }
Esempio n. 9
0
 public Form Get(PlayerReader playerReader, PlayerClassEnum playerClass) => value == 0 ? Form.None : playerClass switch
 {
Esempio n. 10
0
 public bool WithinPullRange(PlayerReader playerReader, PlayerClassEnum playerClass) => playerClass switch
 {