示例#1
0
        public bool Has(Data.Skill.Skill skill)
        {
            List <Data.Skill.Skill> SelectedList;
            int limit;

            if (skill == null)
            {
                Debug.Log("ConstellationPreset.Has() skill null");
                throw new Exception();
            }

            switch (skill.Category)
            {
            case Data.Skill.Skill.ECategory.Ability:
                SelectedList = SelectedAbilityList;
                limit        = App.Content.GameSettings.NumAbilities;
                break;

            case Data.Skill.Skill.ECategory.Class:
                SelectedList = SelectedClassList;
                limit        = App.Content.GameSettings.NumClasses;
                break;

            case Data.Skill.Skill.ECategory.Kit:
                SelectedList = SelectedKitList;
                limit        = App.Content.GameSettings.NumKits;
                break;

            default:
                Debug.Log("ConstellationPreset.Has() skill no type");
                throw new Exception();
            }

            return(SelectedList.Contains(skill));
        }
示例#2
0
        public SkillUpgrade(Data.Skill.Skill skill_)
        {
            Skill = skill_;

            foreach (var metric in Skill.Metrics)
            {
                metricUpgradeMap.Add(metric, new MetricUpgrade(metric, 0));
            }
        }
示例#3
0
        public ConstellationNode KitNode(Data.Skill.Skill skill)
        {
            foreach (var kitNode in KitNodeList)
            {
                if (kitNode.Skill == skill)
                {
                    return(kitNode);
                }
            }

            return(null);
        }
示例#4
0
        public ConstellationNode ClassNode(Data.Skill.Skill skill)
        {
            foreach (var classNode in ClassNodeList)
            {
                if (classNode.Skill == skill)
                {
                    return(classNode);
                }
            }

            return(null);
        }
示例#5
0
        public ConstellationNode AbilityNode(Data.Skill.Skill skill)
        {
            foreach (var abilityNode in AbilityNodeList)
            {
                if (abilityNode.Skill == skill)
                {
                    return(abilityNode);
                }
            }

            return(null);
        }
示例#6
0
        public void OnPresetUpdated()
        {
            Data.Skill.Skill newSkill = null;
            if (selectedSkillList.Count > index)
            {
                newSkill = selectedSkillList[index];
            }

            if (newSkill != skill)
            {
                skill = newSkill;
                SkillChanged();
            }
        }
示例#7
0
        public SkillUpgrade this[Data.Skill.Skill skill_]
        {
            get
            {
                if (skillUpgradeMap.ContainsKey(skill_))
                {
                    return(skillUpgradeMap[skill_]);
                }

                var skillUpgrade = new SkillUpgrade(skill_);
                skillUpgradeMap.Add(skill_, skillUpgrade);
                return(skillUpgrade);
            }
        }
示例#8
0
        public NodeEmpty(
            Data.Skill.Skill skill_,
            Model.Json scale_,
            Material mat_,
            Vector2 position_)
        {
            Debug.Assert(mat_ != null);

            skill    = skill_;
            scale    = scale_;
            mat      = mat_;
            position = position_;

            scale.ChangedEvent += OnScaleUpdated;
        }
示例#9
0
        public void Add(Data.Skill.Skill skill)
        {
            List <Data.Skill.Skill> SelectedIndexList;
            int limit;

            if (skill == null)
            {
                Debug.Log("ConstellationPreset.Add() skill null");
                throw new Exception();
            }

            switch (skill.Category)
            {
            case Data.Skill.Skill.ECategory.Ability:
                SelectedIndexList = SelectedAbilityList;
                limit             = Limits.Ability;
                break;

            case Data.Skill.Skill.ECategory.Class:
                SelectedIndexList = SelectedClassList;
                limit             = Limits.Class;
                break;

            case Data.Skill.Skill.ECategory.Kit:
                SelectedIndexList = SelectedKitList;
                limit             = Limits.Kit; //App.Content.GameSettings.NumKits;
                break;

            default:
                Debug.Log("ConstellationPreset.Add() skill no type");
                throw new Exception();
            }

            if (SelectedIndexList.Count >= limit)
            {
                Debug.Log("ConstellationPreset.Add() can't");
                throw new Exception();
            }

            SelectedIndexList.Add(skill);
            PresetUpdated();
        }
示例#10
0
        public NodeConstellation(
            Data.Skill.Skill skill_,
            Model.ConstellationPreset preset_,
            Model.HoveredSkill hovered_,
            Model.Json scale_,
            Material mat_,
            Vector2 position_)
        {
            Debug.Assert(skill_ != null);
            Debug.Assert(preset_ != null);
            Debug.Assert(hovered_ != null);
            Debug.Assert(mat_ != null);

            skill    = skill_;
            preset   = preset_;
            hovered  = hovered_;
            scale    = scale_;
            mat      = mat_;
            position = position_;

            switch (skill.Category)
            {
            case Data.Skill.Skill.ECategory.Ability:
                selectedSkillList = preset.SelectedAbilityList;
                break;

            case Data.Skill.Skill.ECategory.Class:
                selectedSkillList = preset.SelectedClassList;
                break;

            case Data.Skill.Skill.ECategory.Kit:
                selectedSkillList = preset.SelectedKitList;
                break;
            }

            preset.PresetUpdated += OnPresetUpdated;
            scale.ChangedEvent   += OnScaleUpdated;
        }
示例#11
0
 public Dash(Vector3 direction_, PlayerNew player_)
 {
     data = App.Content.SkillList.Abilities[Asset.Skill.Dash._Id];
     relativeDirection = direction_.normalized;
     player            = player_;
 }
示例#12
0
        public void Remove(Data.Skill.Skill skill)
        {
            List <Data.Skill.Skill> SelectedList;
            int limit;

            if (skill == null)
            {
                Debug.Log("ConstellationPreset.Remove() skill null");
                throw new Exception();
            }

            switch (skill.Category)
            {
            case Data.Skill.Skill.ECategory.Ability:
                SelectedList = SelectedAbilityList;
                limit        = App.Content.GameSettings.NumAbilities;
                break;

            case Data.Skill.Skill.ECategory.Class:
                SelectedList = SelectedClassList;
                limit        = App.Content.GameSettings.NumClasses;
                break;

            case Data.Skill.Skill.ECategory.Kit:
                SelectedList = SelectedKitList;
                limit        = App.Content.GameSettings.NumKits;
                break;

            default:
                Debug.Log("ConstellationPreset.Remove() skill no type");
                throw new Exception();
            }

            if (SelectedList.Count == 0 || !SelectedList.Contains(skill))
            {
                Debug.Log("ConstellationPreset.Remove() can't");
                throw new Exception();
            }

            /*if (skill.Type == Skill.TypeEnum.Ability)
             * {
             *      //clear if preset doesn't contain a starting node
             *      bool hasStartingAbility = false;
             *      foreach (var startingAbilityNodeIndex in Constellation.StartingAbilityNodeIndexList)
             *      {
             *              Skill startingSkill = Constellation.AbilityNodeList[startingAbilityNodeIndex].Skill;
             *              if (SelectedAbilityList.Contains(startingSkill))
             *              {
             *                      hasStartingAbility = true;
             *                      break;
             *              }
             *      }
             *      if (!hasStartingAbility)
             *      {
             *              Clear();
             *              return;
             *      }
             *
             *      SelectedAbilityList.Remove(skill);
             *      //unselect classes and kits that were solely dependent on this ability
             *      var newSelectedClassList = new List<Skill>();
             *      foreach (var selectedClass in SelectedClassList)
             *      {
             *              var selectedClassNode = Constellation.ClassNode(selectedClass);
             *              foreach (var selectedAbility in SelectedAbilityList)
             *              {
             *                      if (Constellation.AbilityNode(selectedAbility).ClassNodeList.Contains(selectedClassNode))
             *                      {
             *                              newSelectedClassList.Add(selectedClass);
             *                              break;
             *                      }
             *              }
             *      }
             *      SelectedClassList = newSelectedClassList;
             *      var newSelectedKitList = new List<Skill>();
             *      foreach (var selectedKit in SelectedKitList)
             *      {
             *              var selectedKitNode = Constellation.KitNode(selectedKit);
             *              foreach (var selectedAbility in SelectedAbilityList)
             *              {
             *                      if (Constellation.AbilityNode(selectedAbility).KitsNodeList.Contains(selectedKitNode))
             *                      {
             *                              newSelectedKitList.Add(selectedKit);
             *                              break;
             *                      }
             *              }
             *      }
             *      SelectedKitList = newSelectedKitList;
             * }
             * else*/
            SelectedList.Remove(skill);

            PresetUpdated();
        }
示例#13
0
 public ConstellationNode(Data.Skill.Skill skill_, int index_, Vector2 position_)
 {
     Skill    = skill_;
     Index    = index_;
     Position = position_;
 }