Example #1
0
        public static string GetSkillDisplayName(SkillEnum skillCode)
        {
            var skillIntroTextConfig =
                ConfigManager.GetConfig(ConfigManager.ConfigType.SkillIntroTextConfig) as SkillIntroTextConfig;

            if (skillIntroTextConfig != null)
            {
                var index = skillIntroTextConfig.SkillCodeList.FindIndex(x => x == (int)skillCode);
                if (index < 0)
                {
                    Debug.LogError("配置里不存在该技能的数据skillCode:" + skillCode);
                    return(null);
                }
                if (index < skillIntroTextConfig.DisplayNameList.Count)
                {
                    return(skillIntroTextConfig.DisplayNameList[index]);
                }
                else
                {
                    Debug.LogError("skillIntroTextConfig.DisplayNameList长度不对.Count:" +
                                   skillIntroTextConfig.DisplayNameList.Count);
                }
            }
            Debug.LogError("怎能没有SkillIntroTextConfig");
            return(null);
        }
Example #2
0
 private void CmdChangeAttribute(NetworkInstanceId unitId, SkillEnum attEnum, float value)
 {
     if (NetworkServer.objects.ContainsKey(unitId))
     {
         NetworkServer.objects[unitId].GetComponent <Unit>().SetSkillLevel(attEnum, value);
     }
 }
Example #3
0
    private void createPirates()
    {
        SkillEnum[] skillList = new SkillEnum[] {};

        // Create pirates. Randomize pirate skills.
        for (int pi = 0; pi < numPirates; pi++)
        {
            Pirate pirate = new Pirate();
            pirates.Add(pirate);

            for (int si = 0; si < Pirate.numSkills; si++)
            {
                if (skillList.Length == 0)
                {
                    skillList = getAllSkills();
                }
                SkillEnum skill = skillList.Rnd();
                pirate.skills.Add(skill);
            }
            pirate.skills.Sort();

            onPirateCreated.Invoke(pirate);
        }

        // Choose the mutineer
        Pirate mutineer = pirates.Rnd();

        mutineer.mutiny   = Pirate.maxMutiny;
        mutineer.mutineer = true;
    }
Example #4
0
        public int GetSkillModifier(SkillEnum skill)
        {
            var sk = Skills.First(a => a.Name == skill);
            var ab = Abilities.First(a => a.Name == sk.Category);

            return(sk.IsProficient ? ab.Modifier + ProficiencyBonus : ab.Modifier);
        }
Example #5
0
    public static Skill GetSkill(SkillEnum kind, Level level)
    {
        SkillTimeConfig stc = skillTimeDictionary[kind][level];

        // need to optimize
        switch (kind)
        {
        case SkillEnum.AbsIntonation:
            return(new AbsIntonation(stc));

        case SkillEnum.BlockReduction:
            return(new BlockReduction(stc));

        case SkillEnum.BonusScore:
            return(new BonusScore(stc));

        case SkillEnum.Clear:
            return(new Clear(stc));

        case SkillEnum.DoubleScore:
            return(new DoubleScore(stc));

        case SkillEnum.LoserEatDust:
            return(new LoserEatDust(stc));

        case SkillEnum.TripleScore:
            return(new TripleScore(stc));

        case SkillEnum.NullSkill:
            return(new NullSkill(stc));

        default:
            return(null);
        }
    }
 public static SkillEnum FsmEnumPopup(GUIContent label, Skill fsm, SkillEnum fsmEnum, Type objectType)
 {
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     fsmEnum = VariableEditor.DoFsmEnumPopup(label, fsm, fsmEnum, objectType);
     VariableEditor.EndVariableEditor(fsmEnum);
     return(fsmEnum);
 }
Example #7
0
    private void createTasks()
    {
        SkillEnum[] skillList = new SkillEnum[] {};

        for (int ti = 0; ti < 3; ti++)
        {
            Task task = new Task();
            tasks.Add(task);

            for (int si = 0; si < Task.numSkills; si++)
            {
                if (skillList.Length == 0)
                {
                    skillList = getAllSkills();
                }

                SkillEnum skill = skillList.Rnd();
                task.skills.Add(skill);
            }
            task.skills.Sort();

            task.gold = Random.Range(Task.minGold, Task.maxGold + 1);
            float v = Random.value;
            task.crew = v < 0.5 ? 1 : (v < 0.9 ? 2 : 3);

            onTaskCreated.Invoke(task);
        }
    }
Example #8
0
        public Character(SocketUser user, string charName, CharacterStats.SPECIAL special, CharacterStats.Skills charSkills,
                         SkillEnum skillTag1, SkillEnum skillTag2, SkillEnum skillTag3, List <CharacterStats.Trait> traits)
        {
            if (skillTag1.Equals(skillTag2) || skillTag1.Equals(skillTag3) || skillTag2.Equals(skillTag3))
            {
                throw new ArgumentException("All tagged skills must be unique.");
            }

            // Adds 15 to each tagged skill
            foreach (var skill in charSkills.skillDict.ToList())
            {
                string skillName = skill.Key.ToLower();
                if (skillName == skillTag1.ToString() || skillName == skillTag2.ToString() || skillName == skillTag3.ToString())
                {
                    charSkills.skillDict[skill.Key] += 15;
                }
            }

            DiscordId   = user.Id;
            Name        = charName;
            CharSpecial = special;
            CharSkills  = charSkills;
            if (traits != null)
            {
                CharTraits = traits;
            }
            else
            {
                CharTraits = new List <CharacterStats.Trait>();
            }
            CharPerks            = new List <CharacterStats.Perk>();
            RemainingSkillPoints = 0;
            ExpPoints            = 0;
        }
Example #9
0
    public void Set(SkillEnum attribute, float value)
    {
        switch (attribute)
        {
        case SkillEnum.Gathering:
            Gathering = value;
            break;

        case SkillEnum.Intelligence:
            Intelligence = value;
            break;

        case SkillEnum.Swordsmanship:
            Swordsmanship = value;
            break;

        case SkillEnum.Healing:
            Healing = value;
            break;

        case SkillEnum.Building:
            Building = value;
            break;
        }
    }
Example #10
0
        public void SetSkill(SkillEnum skill)
        {
            switch (skill)
            {
            case SkillEnum.StaminaRegen:
                _hasAcquired[0] = true;
                break;

            case SkillEnum.MoveSpeed:
                _hasAcquired[1] = true;
                break;

            case SkillEnum.XPBoost:
                _hasAcquired[2] = true;
                break;

            case SkillEnum.ResistanceBoost:
                _hasAcquired[3] = true;
                break;

            default:
                Debug.Log("Error");
                break;
            }

            skillPoints--;
        }
Example #11
0
 void GetSkillInput(SkillEnum skillEnum, KeyCode key)
 {
     if (Input.GetKeyDown(key))
     {
         input.Skills.Add(skillEnum);
     }
 }
Example #12
0
 protected Skill(SkillEnum @enum, byte expertise)
 {
     Console.WriteLine("~~~ IN SKILL CONSTRUCTOR 2 ~~~");
     //ID = (int)@enum;
     Type      = (int)@enum;
     Expertise = expertise;
 }
Example #13
0
 private Skill(SkillEnum @enum)
 {
     Console.WriteLine("~~~ IN SKILL CONSTRUCTOR 1 ~~~");
     //ID = (int)@enum;
     Type       = (int)@enum;
     _expertise = 0x00;
 }
Example #14
0
 public void BeAttackedBySkill(SkillEnum skillCode, int skillLevel, int physicalDamage)
 {
     CurrenctRivalHealth = Mathf.Max(CurrenctRivalHealth - physicalDamage, 0);
     if (CurrenctRivalHealth <= 0)
     {
         //游戏结束
     }
 }
Example #15
0
 public HeroSkill GetSkill(SkillEnum type)
 {
     if (skills.ContainsKey(type))
     {
         return(skills[type]);
     }
     return(null);
 }
Example #16
0
        public Skill(SkillEnum se)
        {
            this.skillEnum = se;
            this.Index     = (int)se * 2 + 1;

            switch (this.skillEnum)
            {
            case SkillEnum.Electic:
            {
                this.skillName = "雷击";
            }; break;

            case SkillEnum.Water:
            {
                this.skillName = "水淹";
            }; break;

            case SkillEnum.Fire:
            {
                this.skillName = "火烧";
            }; break;

            case SkillEnum.Confusion:
            {
                this.skillName = "混乱";
            }; break;

            case SkillEnum.Ambush:
            {
                this.skillName = "潜伏";
            }; break;

            case SkillEnum.Lose:
            {
                this.skillName = "迷失";
            }; break;

            case SkillEnum.Speed:
            {
                this.skillName = "提速";
            }; break;

            case SkillEnum.Attack:
            {
                this.skillName = "红牛";
            }; break;

            case SkillEnum.Defense:
            {
                this.skillName = "守护";
            }; break;

            default:
            {
                this.skillName = "";
            }; break;
            }
        }
Example #17
0
        public float GetPlaySanxiaoEffectTime(SkillEnum skillCode)
        {
            var index = SkillCodeList.ToList().FindIndex(x => x == skillCode);

            if (index < 0)
            {
                return(0.1f);
            }
            return(PlaySanxiaoEffectTimeList[index]);
        }
Example #18
0
        public float GetTrajectoryAnimationLength(SkillEnum skillCode)
        {
            var index = SkillCodeList.ToList().FindIndex(x => x == skillCode);

            if (index < 0)
            {
                return(0.1f);
            }
            return(TrajectoryAnimationLengthList[index]);
        }
Example #19
0
        /// <summary>
        /// -1表示不要播放动画
        /// </summary>
        /// <param name="skillCode"></param>
        /// <returns></returns>
        public float GetBeMagicallyAttackTime(SkillEnum skillCode)
        {
            var index = SkillCodeList.ToList().FindIndex(x => x == skillCode);

            if (index < 0)
            {
                return(-1);
            }
            return(BeMagicallyAttackTimeList[index]);
        }
 public static void EnumTypeSelector(SkillEnum fsmEnum)
 {
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     EditorGUILayout.PrefixLabel(Strings.get_Label_Enum_Type());
     if (GUILayout.Button(SkillEditorContent.TempContent(Labels.GetShortTypeName(fsmEnum.get_EnumType()), fsmEnum.get_EnumName()), EditorStyles.get_popup(), new GUILayoutOption[0]))
     {
         VariableEditor.DoFsmEnumTypeMenu(fsmEnum);
     }
     GUILayout.EndHorizontal();
 }
Example #21
0
        public Vector2 GetScatterPoint(SkillEnum skillCode)
        {
            var index = SkillCodeList.ToList().FindIndex(x => x == skillCode);

            if (index < 0)
            {
                return(new Vector2(-172, 50));
            }
            return(ScatterPointList[index]);
        }
Example #22
0
    public bool ReleaseSkill(SkillEnum skillType)
    {
        if (IsAttacking())
        {
            return(false);
        }


        var skill = GetSkill(skillType);

        return(ReleaseSkill(skill));
    }
Example #23
0
 public bool ApplySkill(SkillEnum skill, float data)
 {
     if (mSkillAbilities.ContainsKey(skill))
     {
         mSkillAbilities[skill].OnCallback(data);
         return(true);
     }
     {
         Debug.LogWarning("No this skill: " + skill.ToString());
         return(false);
     }
 }
Example #24
0
 public Sprite getSpriteForSkill(SkillEnum skillEnum)
 {
     foreach (SkillView skill in skills)
     {
         if (skill.type == skillEnum)
         {
             return(skill.sprite);
         }
     }
     Debug.Log("Skill not found:" + skillEnum);
     return(null);
 }
Example #25
0
    public void ShowEffect(SkillEnum skill)
    {
        var prefab = GetPrefab(skill);

        if (prefab == null)
        {
            return;
        }
        var go = PrefabHelper.InstantiateAndReset(prefab, transform);

        Destroy(go, 10);
    }
Example #26
0
 public void setSkill(int pos, SkillEnum skill)
 {
     if (skill == SkillEnum.None)
     {
         skills[pos].enabled = false;
     }
     else
     {
         skills[pos].enabled = true;
         Sprite spr = gameView.getSpriteForSkill(skill);
         skills[pos].sprite = spr;
     }
 }
Example #27
0
    /// <summary>Unlocks the skill with the given index</summary>
    public void UnlockSkill(SkillEnum skillEnum)
    {
        int skillIndex = (int)skillEnum;

        if (skillIndex < GetSkillAmount())
        {
            Skill skillToUnlock = GetSkill(skillEnum);
            if (skillToUnlock != null && !skillToUnlock.IsSkillUnlocked())
            {
                skillToUnlock.UnlockSkill();
            }
        }
    }
Example #28
0
 public PAPISkill(string _name, SkillEnum _skillEnum, SkillTypeEnum _skillTypeEnum, Value _value, CharacteristicEnum _characteristicEnum,
                  List <GenreEnum> _availableGenres, bool _isCareer)
 {
     this._skillEnum          = _skillEnum;
     this._name               = (_name == null || _name == "" || _skillEnum != SkillEnum.CUSTOM) ? ("Skill_" + _skillEnum.ToString()) : _name;
     this._skillTypeEnum      = _skillTypeEnum;
     this._value              = (_value._value <MIN_VALUE || _value._value> MAX_VALUE)? this._value = new Value(0, null) : this._value = _value;
     this._characteristicEnum = this._characteristicEnum;
     this._availableGenres    = (_availableGenres == null || _availableGenres.Count == 0) ?
                                new List <GenreEnum>(PAPIApplication.GetAllGenres()) : _availableGenres;
     this._isCareer = _isCareer;
     WfLogger.Log(this, LogLevel.DETAILED, "Skill '" + this._name + "' was created");
 }
Example #29
0
        //public List<DesignSkillConfigItem> ConfigList;

        public static SkillParameter GetSkillParameterItem(SkillEnum skillCode)
        {
            var skillParameterConfig = ConfigManager.GetConfig(ConfigManager.ConfigType.SkillParameterConfig) as SkillParameterConfig;

            if (skillParameterConfig != null)
            {
                return(skillParameterConfig.SkillParameterList.Find(x => x.SkillCode == (int)skillCode));
            }
            else
            {
                Debug.LogError("没有SkillParameterConfig");
                return(null);
            }
        }
Example #30
0
 public static Skill GetSkill(this SkillEnum skillCode)
 {
     try
     {
         var skillConfig = ConfigManager.GetConfig(ConfigManager.ConfigType.SkillConfig) as SkillConfig;
         if (skillConfig != null)
         {
             return(skillConfig.SkillList.Find(x => x.SkillCode == (int)skillCode));
         }
         return(null);
     }
     catch
     {
         return(null);
     }
 }