Пример #1
0
    public void DoBuff(string buff_id, StartBuffAction action)
    {
        if (!StringUtils.CheckValid(buff_id))
        {
            return;
        }
        if (action == null)
        {
            return;
        }
        BuffVo buffVo = null;

        if (this.buffList.ContainsKey(buff_id))
        {
            buffVo = this.buffList[buff_id];
        }
        if (buffVo != null)
        {
            if ((!this.buffActionList.ContainsKey(buff_id) || buffVo.data.config.isReaptPerform == 1f) && buffVo.data.perform_ids != null)
            {
                for (int i = 0; i < buffVo.data.perform_ids.Length; i++)
                {
                    if (StringUtils.CheckValid(buffVo.data.perform_ids[i]) && !buffVo.IsHpOverflow(this.self) && !buffVo.IsMpOverflow(this.self))
                    {
                        action.AddAction(ActionManager.PlayEffect(buffVo.data.perform_ids[i], this.self, null, null, true, string.Empty, buffVo.casterUnit));
                    }
                }
            }
            this.AddAction(buff_id, action);
        }
    }
Пример #2
0
 private void AddAction(string buff_id, StartBuffAction action)
 {
     if (!this.buffActionList.ContainsKey(buff_id) && action != null && !action.isDestroyed)
     {
         this.buffActionList.Add(buff_id, action);
     }
 }
Пример #3
0
 private void DestroyAction(string buff_id)
 {
     if (this.buffActionList.ContainsKey(buff_id))
     {
         StartBuffAction startBuffAction = this.buffActionList[buff_id];
         if (startBuffAction != null)
         {
             startBuffAction.Destroy();
         }
         this.RemoveAction(buff_id);
     }
 }
Пример #4
0
 private void DestroyActions()
 {
     List<string> list = this.buffActionList.Keys.ToList<string>();
     for (int i = 0; i < list.Count; i++)
     {
         StartBuffAction startBuffAction = this.buffActionList[list[i]];
         if (startBuffAction != null)
         {
             startBuffAction.Destroy();
         }
     }
     this.buffActionList.Clear();
 }