示例#1
0
        internal List <SkillStats> FindSkills(int level, Constants.SkillTypes type)
        {
            if (skills == null)
            {
                LoadSkills();
            }
            List <SkillStats> foundSkills;

            if (level < 5)
            {
                foundSkills = skills.FindAll(x => x.RLvl <= level && x.SkillType == type);
            }
            else
            {
                foundSkills = skills.FindAll(x => x.RLvl + Constants.MONSTER_SKILL_RLVL_PENALTY <= level && x.SkillType == type);
            }
            if (foundSkills.Count == 0)
            {
                return(foundSkills);
            }
            int maxRlvl = foundSkills.Max(x => x.RLvl);

            foundSkills.RemoveAll(x => x.RLvl < maxRlvl - Constants.SKILL_RLVL_LENIANCE);
            return(foundSkills);
        }
示例#2
0
 public bool CheckParticle(Constants.SkillTypes type)
 {
     if (!partMap.ContainsKey(type))
     {
         return(false);
     }
     return(true);
 }
示例#3
0
 public float PlayParticle(Constants.SkillTypes type, int pos)
 {
     if (partMap == null)
     {
         InitPartMap();
     }
     if (pos < Constants.MAX_ENEMIES)
     {
         if (!monsterParts[pos].isPlaying)
         {
             CopyParticle(monsterParts[pos], particleBps[partMap[type]]);
             monsterParts[pos].Play(true);
         }
     }
     else
     {
         if (!playerPart.isPlaying)
         {
             CopyParticle(playerPart, particleBps[partMap[type]]);
             playerPart.Play(true);
         }
     }
     return(particleBps[partMap[type]].main.duration);
 }
示例#4
0
        public void StartRound()
        {
            unitManager.ClearMonsters();
            Level++;
            if (Level > 1)
            {
                unitManager.player.ClearEffects();
            }
            levelText.text = "Level: " + Level;
            log.Add("Advanced to Level " + Level);
            if (Level % Constants.BACKGROUND_CHANGE_LVLS == 0)
            {
                int background = (int)(((float)Level / Constants.BACKGROUND_CHANGE_LVLS) % 10) + 1;
                this.background.sprite = backgroundAtlas.GetSprite(Constants.BACKGROUND_BASE + background.ToString());
            }
            //Pick monsters
            List <MonsterData> chosen = PickMonsters();
            //Place monsters
            int pos = 0;

            foreach (MonsterData pick in chosen)
            {
                if (pick.SkillTypeFull == null)
                {
                    Constants.SkillTypes[] temp = new Constants.SkillTypes[Constants.ENEMY_SKILL_TYPE_MAX];
                    int counter = 0;
                    if (pick.SkillType1 != Constants.SkillTypes.None)
                    {
                        counter++;
                        temp[0] = pick.SkillType1;
                    }
                    if (pick.SkillType2 != Constants.SkillTypes.None)
                    {
                        counter++;
                        temp[1] = pick.SkillType2;
                    }
                    if (pick.SkillType3 != Constants.SkillTypes.None)
                    {
                        counter++;
                        temp[2] = pick.SkillType3;
                    }
                    if (pick.SkillType4 != Constants.SkillTypes.None)
                    {
                        counter++;
                        temp[3] = pick.SkillType4;
                    }
                    if (pick.SkillType5 != Constants.SkillTypes.None)
                    {
                        counter++;
                        temp[4] = pick.SkillType5;
                    }
                    pick.SkillTypeFull = new Constants.SkillTypes[counter];
                    int tempCount = 0;
                    for (int j = 0; j < temp.Length; j++)
                    {
                        if (temp[j] != Constants.SkillTypes.None)
                        {
                            pick.SkillTypeFull[tempCount] = temp[j];
                            tempCount++;
                        }
                    }
                }
                //Select skills
                unitManager.MakeMonster(pos, pick, unitManager.ChooseSkills(pick).ToList());
                pos++;
            }
            //Pass to Turn manager
            unitManager.InitTurns();
        }