Пример #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);
                    }
                }
            }
        }
    }
Пример #2
0
    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 doStartHighEffect_Special()
 {
     if (this.targetUnits != null)
     {
         for (int i = 0; i < this.targetUnits.Count; i++)
         {
             if (this.targetUnits[i] != null && !SkillUtility.IsImmunityHighEff(this.targetUnits[i], this.higheffId))
             {
                 T t = BaseAction.CreateAction <T>();
                 t.targetUnit    = this.targetUnits[i];
                 t.unit          = base.unit;
                 t.higheffId     = this.higheffId;
                 t.skillPosition = this.skillPosition;
                 t.skillId       = this.skillId;
                 t.rotateY       = this.rotateY;
                 t.Play();
                 this.AddAction(t);
             }
         }
     }
 }
Пример #4
0
    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;
                }
            }
        }
    }
Пример #5
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);
        }
Пример #6
0
 public void PVP_DoStartHighEffect_AttachPerformHighEffect(HighEffInfo info)
 {
     if (this.targetUnits == null)
     {
         return;
     }
     if (this.data.attachHighEffs != null)
     {
         for (int i = 0; i < this.data.attachHighEffs.Length; i++)
         {
             string text = this.data.attachHighEffs[i];
             if (StringUtils.CheckValid(text))
             {
                 for (int j = 0; j < this.targetUnits.Count; j++)
                 {
                     if (!SkillUtility.IsImmunityHighEff(this.targetUnits[j], text))
                     {
                         ActionManager.AddHighEffect(text, this.skillId, this.targetUnits[j], base.unit, null, true);
                     }
                 }
             }
         }
     }
 }
Пример #7
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);
        }
    }