Пример #1
0
    private void doBuff_Master(string buff_id)
    {
        if (!StringUtils.CheckValid(buff_id))
        {
            return;
        }
        BuffVo buffVo = null;

        if (this.buffList.ContainsKey(buff_id))
        {
            buffVo = this.buffList[buff_id];
        }
        if (buffVo != null)
        {
            if (!this.buffActionList.ContainsKey(buff_id))
            {
                ActionManager.StartBuff(buff_id, this.self, false);
            }
            else
            {
                this.buffActionList[buff_id].Play();
            }
            if (this.IsPropertyBuff(buff_id))
            {
                this.self.dataChange.doBuffWoundAction(buff_id, buffVo.casterUnit, false);
            }
            else
            {
                this.self.dataChange.doSkillWoundAction(buffVo.data.damage_ids, buffVo.casterUnit, true, new float[0]);
            }
            if (StringUtils.CheckValid(buffVo.data.higheff_ids))
            {
                for (int i = 0; i < buffVo.data.higheff_ids.Length; i++)
                {
                    if (!SkillUtility.IsImmunityHighEff(this.self, buffVo.data.higheff_ids[i]))
                    {
                        ActionManager.AddHighEffect(buffVo.data.higheff_ids[i], string.Empty, this.self, buffVo.casterUnit, null, true);
                    }
                }
            }
            if (StringUtils.CheckValid(buffVo.data.buff_ids))
            {
                for (int j = 0; j < buffVo.data.buff_ids.Length; j++)
                {
                    if (!SkillUtility.IsImmunityBuff(this.self, buffVo.data.buff_ids[j]))
                    {
                        ActionManager.AddBuff(buffVo.data.buff_ids[j], this.self, buffVo.casterUnit, true, string.Empty);
                    }
                }
            }
        }
    }
 protected override void doStartHighEffect_Special()
 {
     if (StringUtils.CheckValid(this.data.strParam1) && this.targetUnits != null)
     {
         for (int i = 0; i < this.targetUnits.Count; i++)
         {
             if (this.targetUnits[i] != null && !SkillUtility.IsImmunityBuff(this.targetUnits[i], this.data.strParam1))
             {
                 ActionManager.AddBuff(this.data.strParam1, this.targetUnits[i], base.unit, true, string.Empty);
             }
         }
     }
 }
Пример #3
0
    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;
                }
            }
        }
    }
Пример #4
0
        protected override void OnSkillDamage(BaseSkillAction action, List <Units> targets)
        {
            this.AddAction(ActionManager.HitSkill(action.skillKey, base.unit, targets, true));
            SkillData data = GameManager.Instance.SkillData.GetData(this.skillKey);

            string[] highEffects = data.GetHighEffects(SkillPhrase.Hit);
            if (highEffects != null && this.skill.GetPreConjureIndex() < highEffects.Length)
            {
                string text = highEffects[this.skill.GetPreConjureIndex()];
                if (StringUtils.CheckValid(text))
                {
                    for (int i = 0; i < targets.Count; i++)
                    {
                        if (targets[i] != null && targets[i].isLive && !SkillUtility.IsImmunityHighEff(targets[i], text))
                        {
                            ActionManager.AddHighEffect(text, this.skill.skillMainId, targets[i], base.unit, this.targetPosition, true);
                        }
                    }
                }
            }
            string[] buffs = data.GetBuffs(SkillPhrase.Hit);
            if (buffs != null && this.skill.GetPreConjureIndex() < buffs.Length)
            {
                string text2 = buffs[this.skill.GetPreConjureIndex()];
                if (StringUtils.CheckValid(text2))
                {
                    for (int j = 0; j < targets.Count; j++)
                    {
                        if (targets[j] != null && targets[j].isLive && !SkillUtility.IsImmunityBuff(targets[j], text2))
                        {
                            ActionManager.AddBuff(text2, targets[j], base.unit, true, string.Empty);
                        }
                    }
                }
            }
            base.OnSkillDamage(action, targets);
        }
Пример #5
0
 protected virtual void doStartHighEffect_AttachBuff()
 {
     if (this.targetUnits == null)
     {
         return;
     }
     if (this.data.attachBuffs != null)
     {
         for (int i = 0; i < this.data.attachBuffs.Length; i++)
         {
             string text = this.data.attachBuffs[i];
             if (StringUtils.CheckValid(text))
             {
                 for (int j = 0; j < this.targetUnits.Count; j++)
                 {
                     if (!SkillUtility.IsImmunityBuff(this.targetUnits[j], text))
                     {
                         ActionManager.AddBuff(text, this.targetUnits[j], base.unit, true, string.Empty);
                     }
                 }
             }
         }
     }
 }
Пример #6
0
    public void RemoveBuff(string buff_id, int reduce_layers = -1)
    {
        if (this.buffList.ContainsKey(buff_id))
        {
            BuffVo buffVo = this.self.buffManager.buffList[buff_id];
            if (buffVo != null && buffVo.layer > 0)
            {
                if (reduce_layers == -1)
                {
                    reduce_layers = buffVo.layer;
                }
                else if (reduce_layers == -2)
                {
                    reduce_layers = buffVo.layer / 2;
                }
                else if (reduce_layers > 0 && reduce_layers > buffVo.layer)
                {
                    reduce_layers = buffVo.layer;
                }
                if (this.buffList.ContainsKey(buff_id))
                {
                    if (reduce_layers > 0)
                    {
                        buffVo.layer -= reduce_layers;
                    }
                    this.doRevertBuff_Master(buffVo, reduce_layers);
                    if (buffVo.layer <= 0)
                    {
                        if (buffVo != null && buffVo.data != null && this.m_BuffGroups.ContainsKey(buffVo.data.m_nBuffGroup))
                        {
                            for (int i = 0; i < this.m_BuffGroups[buffVo.data.m_nBuffGroup].Count; i++)
                            {
                                if (string.Compare(this.m_BuffGroups[buffVo.data.m_nBuffGroup][i], buff_id) == 0)
                                {
                                    this.m_BuffGroups[buffVo.data.m_nBuffGroup].RemoveAt(i);
                                    break;
                                }
                            }
                        }
                        if (StringUtils.CheckValid(buffVo.data.higheff_ids))
                        {
                            for (int j = 0; j < buffVo.data.higheff_ids.Length; j++)
                            {
                                this.self.highEffManager.RemoveHighEffect(buffVo.data.higheff_ids[j]);
                            }
                        }
                        if (StringUtils.CheckValid(buffVo.data.buff_ids))
                        {
                            for (int k = 0; k < buffVo.data.buff_ids.Length; k++)
                            {
                                this.RemoveBuff(buffVo.data.buff_ids[k], -1);
                            }
                        }
                        this.DestroyAction(buff_id);
                        this.buffList.Remove(buff_id);
                        Singleton <TriggerManager> .Instance.SendUnitStateEvent(UnitEvent.UnitRemoveBuff, this.self, null, null);

                        if (buffVo != null && buffVo.data.attachState != null)
                        {
                            int[] attachState = buffVo.data.attachState;
                            for (int l = 0; l < attachState.Length; l++)
                            {
                                int state = attachState[l];
                                this.self.RemoveState((StateType)state);
                            }
                        }
                        if (StringUtils.CheckValid(buffVo.data.end_attach_higheff_ids))
                        {
                            for (int m = 0; m < buffVo.data.end_attach_higheff_ids.Length; m++)
                            {
                                if (!SkillUtility.IsImmunityHighEff(this.self, buffVo.data.end_attach_higheff_ids[m]))
                                {
                                    ActionManager.AddHighEffect(buffVo.data.end_attach_higheff_ids[m], string.Empty, this.self, buffVo.casterUnit, null, true);
                                }
                            }
                        }
                        if (StringUtils.CheckValid(buffVo.data.end_attach_buff_ids))
                        {
                            for (int n = 0; n < buffVo.data.end_attach_buff_ids.Length; n++)
                            {
                                if (!SkillUtility.IsImmunityBuff(this.self, buffVo.data.end_attach_buff_ids[n]))
                                {
                                    ActionManager.AddBuff(buffVo.data.end_attach_buff_ids[n], this.self, buffVo.casterUnit, true, string.Empty);
                                }
                            }
                        }
                    }
                    else
                    {
                        buffVo.Reset(0);
                    }
                }
            }
            Singleton <TriggerManager> .Instance.SendUnitStateEvent(UnitEvent.UnitRemoveBuff, this.self, null, null);
        }
    }