Exemplo n.º 1
0
    public override void OnRemoved(IResultControl control)
    {
        base.OnRemoved(control);
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            Debug.LogWarning("OnGetBuffEffect failed! actor is not exist! actor id=" + TargetID.ToString());
            return;
        }
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("OnGetBuffEffect failed! buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        if (actor.Type == ActorType.enNPC)
        {//此buff效果只对npc生效
            foreach (var item in info.BuffResultList)
            {
                if (item.ID == (int)ClassID)
                {
                    switch ((ENFearType)item.ParamList[0])
                    {
                    case ENFearType.enEscape:
                    {        //更改ai
                        actor.SelfAI = m_selfAI;
                    }
                    break;
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    public override void OnGetBuffEffect()
    {
        base.OnGetBuffEffect();
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            Debug.LogWarning("actor is not exist! actor id=" + TargetID.ToString());
            return;
        }
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        IsNeedResultPass = true;
        if (actor.Type == ActorType.enNPC)
        {//npc不能潜行
            Debug.LogWarning("npc can not sneak");
            return;
        }
        //开始潜行
        actor.StartSneak(BuffID);
    }
Exemplo n.º 3
0
    public override void OnGetBuffEffect()
    {
        base.OnGetBuffEffect();
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        FindSneak(true);
    }
Exemplo n.º 4
0
 public override void OnGetResult(IResult result, IResultControl control)
 {
     base.OnGetResult(result, control);
     if (result.ClassID == (int)ENResult.Dead)
     {
         m_self = ActorManager.Singleton.Lookup(TargetID);
         if (m_self == null)
         {
             Debug.LogWarning("actor is not exist, actor id is " + TargetID);
             return;
         }
         BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);
         if (info == null)
         {
             Debug.LogWarning("buff is not exist! buff id=" + BuffID.ToString());
             return;
         }
         foreach (var item in info.BuffResultList)
         {
             if (item.ID == (int)ClassID)
             {
                 switch ((ENPlagueType)item.ParamList[0])
                 {
                 case ENPlagueType.enInfect:
                 {
                     m_target = null;
                     ActorManager.Singleton.ForEach(FindFriend);
                     if (m_target != null)
                     {
                         //给友方添加buff
                         IResult r = BattleFactory.Singleton.CreateResult(ENResult.AddBuff, TargetID, m_target.ID, 0, 0, new float[1] {
                                 item.ParamList[2]
                             });
                         if (r != null)
                         {
                             r.ResultExpr(new float[1] {
                                     item.ParamList[2]
                                 });
                             BattleFactory.Singleton.DispatchResult(r);
                         }
                     }
                 }
                 break;
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
    public override void OnGetBuffEffect()
    {
        base.OnGetBuffEffect();
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            Debug.LogWarning("OnGetBuffEffect failed! actor is not exist! actor id=" + TargetID.ToString());
            return;
        }
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("OnGetBuffEffect failed! buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        if (actor.Type == ActorType.enNPC)
        {                               //此buff效果只对npc生效
            actor.CurrentTarget = null; //重新选择目标
            actor.TempType      = ActorType.enNPC_AllEnemy;
        }
    }
Exemplo n.º 6
0
    public override void OnGetBuffEffect()
    {
        base.OnGetBuffEffect();
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        foreach (var item in info.BuffResultList)
        {
            if (item.ID == (int)ClassID)
            {
                switch ((ENPlagueType)item.ParamList[0])
                {
                case ENPlagueType.enInfect:
                {
                    //给自己添加buff
                    IResult r = BattleFactory.Singleton.CreateResult(ENResult.AddBuff, TargetID, TargetID, 0, 0, new float[1] {
                            item.ParamList[1]
                        });
                    if (r != null)
                    {
                        r.ResultExpr(new float[1] {
                                item.ParamList[1]
                            });
                        BattleFactory.Singleton.DispatchResult(r);
                    }
                }
                break;
                }
            }
        }
        IsNeedResultPass = true;
    }
Exemplo n.º 7
0
    void NotifySkillSilence(bool isSilence)
    {
        Actor actor = ActorManager.Singleton.Lookup(TargetID);

        if (null == actor)
        {
            Debug.LogWarning("actor is not exist! actor id=" + TargetID.ToString());
            return;
        }
        BuffInfo info = GameTable.BuffTableAsset.Lookup(BuffID);

        if (info == null)
        {
            Debug.LogWarning("buff is not exist! buff id=" + BuffID.ToString());
            return;
        }
        foreach (var item in info.BuffResultList)
        {
            if (item.ID == (int)ClassID)
            {
                actor.NotifySkillSilence((int)item.ParamList[0], (int)item.ParamList[1], isSilence);
            }
        }
    }