Exemple #1
0
        public string[] GetBuffs(SkillPhrase phrase)
        {
            switch (phrase)
            {
            case SkillPhrase.Start:
                return(this.start_buff_ids);

            case SkillPhrase.Hit:
                return(this.hit_buff_ids);
            }
            return(null);
        }
Exemple #2
0
        public string[] GetHighEffects(SkillPhrase phrase)
        {
            switch (phrase)
            {
            case SkillPhrase.Start:
                return(this.start_higheff_ids);

            case SkillPhrase.Hit:
                return(this.hit_higheff_ids);

            case SkillPhrase.Init:
                return(this.init_higheff_ids);
            }
            return(null);
        }
    public static void AddBuff(Units selfUnit, SkillDataKey skill_key, SkillPhrase trigger, List <Units> targets = null)
    {
        if (!StringUtils.CheckValid(skill_key.SkillID))
        {
            return;
        }
        SkillData data = GameManager.Instance.SkillData.GetData(skill_key);

        if (data == null)
        {
            return;
        }
        string[] buffs = data.GetBuffs(trigger);
        if (buffs != null)
        {
            for (int i = 0; i < buffs.Length; i++)
            {
                string text = buffs[i];
                switch (trigger)
                {
                case SkillPhrase.Start:
                case SkillPhrase.Init:
                    if (!SkillUtility.IsImmunityBuff(selfUnit, text))
                    {
                        ActionManager.AddBuff(text, selfUnit, selfUnit, true, string.Empty);
                    }
                    break;

                case SkillPhrase.Hit:
                    for (int j = 0; j < targets.Count; j++)
                    {
                        if (targets[j] != null && targets[j].isLive && !SkillUtility.IsImmunityBuff(targets[j], text))
                        {
                            ActionManager.AddBuff(text, targets[j], selfUnit, true, string.Empty);
                        }
                    }
                    break;
                }
            }
        }
    }
    public static void AddHighEff(Units selfUnit, SkillDataKey skill_key, SkillPhrase skillPhrase, List <Units> targets = null, Vector3?skillPosition = null)
    {
        if (!StringUtils.CheckValid(skill_key.SkillID))
        {
            return;
        }
        SkillData data = GameManager.Instance.SkillData.GetData(skill_key);

        if (data == null)
        {
            return;
        }
        string[] highEffects = data.GetHighEffects(skillPhrase);
        if (highEffects != null)
        {
            for (int i = 0; i < highEffects.Length; i++)
            {
                string text = highEffects[i];
                switch (skillPhrase)
                {
                case SkillPhrase.Start:
                case SkillPhrase.Init:
                    if (!SkillUtility.IsImmunityHighEff(selfUnit, text))
                    {
                        ActionManager.AddHighEffect(text, skill_key.SkillID, selfUnit, selfUnit, skillPosition, true);
                    }
                    break;

                case SkillPhrase.Hit:
                    for (int j = 0; j < targets.Count; j++)
                    {
                        if (targets[j] != null && targets[j].isLive && !SkillUtility.IsImmunityHighEff(targets[j], text))
                        {
                            ActionManager.AddHighEffect(text, skill_key.SkillID, targets[j], selfUnit, skillPosition, true);
                        }
                    }
                    break;
                }
            }
        }
    }
    protected override void AddHighEff(SkillDataKey skill_key, SkillPhrase skillPhrase, List <Units> targets = null, Vector3?skillPosition = null)
    {
        if (!StringUtils.CheckValid(skill_key.SkillID))
        {
            return;
        }
        SkillData data = GameManager.Instance.SkillData.GetData(skill_key);

        string[] highEffects = data.GetHighEffects(skillPhrase);
        if (highEffects != null)
        {
            int curConjureIndex = this.GetCurConjureIndex();
            if (highEffects.Length > curConjureIndex)
            {
                string text = highEffects[curConjureIndex];
                switch (skillPhrase)
                {
                case SkillPhrase.Start:
                case SkillPhrase.Init:
                    if (!SkillUtility.IsImmunityHighEff(this.unit, text))
                    {
                        ActionManager.AddHighEffect(text, data.skillId, this.unit, this.unit, skillPosition, true);
                    }
                    break;

                case SkillPhrase.Hit:
                    for (int i = 0; i < targets.Count; i++)
                    {
                        if (targets[i] != null && targets[i].isLive && !SkillUtility.IsImmunityHighEff(targets[i], text))
                        {
                            ActionManager.AddHighEffect(text, data.skillId, targets[i], this.unit, skillPosition, true);
                        }
                    }
                    break;
                }
            }
        }
    }
 protected void AddBuff(SkillDataKey skill_key, SkillPhrase skillPhrase, List <Units> targets = null)
 {
     SkillUtility.AddBuff(base.unit, this.skillKey, skillPhrase, targets);
 }
 protected void AddHighEff(SkillDataKey skill_key, SkillPhrase skillPhrase, List <Units> targets = null, Vector3?skillPosition = null)
 {
     SkillUtility.AddHighEff(base.unit, this.skillKey, skillPhrase, targets, skillPosition);
 }