示例#1
0
    public Skill GetRandomSkill(FightClass fightClass)
    {
        var collection = collections.FirstOrDefault(col => col.FightClass == fightClass);
        var skillCount = collection.Skills.Count();

        return(collection.Skills[UnityEngine.Random.Range(0, skillCount)]);
    }
示例#2
0
    public Skill GetSkill(FightClass fightClass, int id)
    {
        var tempSkill = ScriptableObject.CreateInstance <Skill>();

        tempSkill.CopyFrom(collections.First(col => col.FightClass == fightClass).GetSkill(id));

        return(tempSkill);
    }
示例#3
0
    static MainStats SetStats(FightClass cla, Rarity rar)
    {
        var points = DataHolder._data.CharCreationDict[rar].startingPoints;
        var stats  = new MainStats();

        float[] dist = CharactersService.LevelStats[cla].StatDistribution;
        stats.str   = (int)(points * dist[0]);
        stats.con   = (int)(points * dist[1]);
        stats.dex   = (int)(points * dist[2]);
        stats.intel = (int)(points * dist[3]);
        stats.lck   = (int)(points * dist[4]);

        return(stats);
    }
示例#4
0
    static SkillInfo[] GetSkillInfos(int amount, FightClass fightClass)
    {
        var skillInfoList = new List <SkillInfo>();
        var skillPool     = DataHolder._data.SkillsManager.GetCollectionByClass(fightClass).Skills.ToList();

        if (amount > skillPool.Count)
        {
            throw new System.Exception($"Not enough Skills in Pool {fightClass.ToString()}");
        }
        for (var i = 0; i < amount; i++)
        {
            var skill = skillPool[UnityEngine.Random.Range(0, skillPool.Count)];
            skillPool.Remove(skill);
            skillInfoList.Add(new SkillInfo(new Level(1, 0), skill.id));
        }
        return(skillInfoList.ToArray());
    }
示例#5
0
 void SpecialAction()
 {
     playAction = false;
     StartCoroutine(waitForAbility());
     //SpecialAbilityScript
     if (gameObject.tag.Equals("Collector"))
     {
         DashClass dash = gameObject.GetComponent <DashClass>();
         dash.Dash(dirX, dirY);
         Debug.Log("Collector");
     }
     else if (gameObject.tag.Equals("Defender"))
     {
         DefendClass defend = gameObject.GetComponent <DefendClass>();
         defend.Defend();
         Debug.Log("Defender");
     }
     else if (gameObject.tag.Equals("Fighter"))
     {
         FightClass fight = gameObject.GetComponent <FightClass>();
         fight.Fight();
         Debug.Log("Fighter");
     }
 }
示例#6
0
    static int GetRandomMana(FightClass fightClass, int level)
    {
        var mana = CharactersService.LevelStats[fightClass].Mana;

        return(BaseStartMana + Random.Range(mana.Item1, mana.Item2) * level);
    }
示例#7
0
    static int GetRandomLife(FightClass fightClass, int level)
    {
        var life = CharactersService.LevelStats[fightClass].Life;

        return(BaseStartLife + Random.Range(life.Item1, life.Item2) * level);
    }
示例#8
0
 public SkillsCollection GetCollectionByClass(FightClass fightClass)
 {
     return(collections.FirstOrDefault(col => col.FightClass == fightClass));
 }