Пример #1
0
        void Start()
        {
            if (Event.attaches)
            {
                StartCoroutine(FollowAttacker());
            }

            if (Event.affix.effectType != Affix.EffectType.None && Event.affix.target == Affix.TargetType.Self)
            {
                if (stateMachine.attacker != null && stateMachine.attacker.GetComponent <NpcAttribute>().IsMine())
                {
                    //stateMachine.attacker.GetComponent<BuffComponent>().AddBuff(Event.affix);
                    NetDateInterface.FastMoveAndPos();
                    NetDateInterface.FastAddBuff(Event.affix, stateMachine.attacker, stateMachine.attacker, stateMachine.skillFullData.skillId, Event.EvtId);
                }
            }


            var skillConfig = Event.layout.GetComponent <SkillLayoutConfig>();

            if (skillConfig != null)
            {
                StartCoroutine(ShowParticle());
            }
        }
Пример #2
0
        public static void AddStaticShootBuff(GameObject who, int skillId, Vector3 pos)
        {
            var skill     = Util.GetSkillData(skillId, 1);
            var skillInfo = SkillLogic.GetSkillInfo(skill);
            var evt       = skillInfo.eventList[0];

            NetDateInterface.FastAddBuff(evt.affix, who, who, skillId, evt.EvtId);
        }
Пример #3
0
        public static bool AddBuffWithNet(GameObject who, int skillId, Vector3 pos, int pid = 0)
        {
            var skill     = Util.GetSkillData(skillId, 1);
            var skillInfo = SkillLogic.GetSkillInfo(skill);
            var evt       = skillInfo.eventList [0];

            //var ret = who.GetComponent<BuffComponent>().AddBuff(evt.affix, pos, pid);
            //if (ret)
            {
                NetDateInterface.FastAddBuff(evt.affix, who, who, skillId, evt.EvtId);
            }
            //return ret;
            return(true);
        }
Пример #4
0
        public void DoDamage(GameObject g)
        {
            Log.AI("SkillLayout DoDamage " + Event.affix.effectType);
            var attr = NetworkUtil.GetAttr(g);

            if (Event.affix.effectType != Affix.EffectType.None && Event.affix.target == Affix.TargetType.Enemy)
            {
                //Buff目标是本地控制
                //通过ID来控制复制信息 实体都要有ID才便于复制
                //if(stateMachine.attacker.GetComponent<NpcAttribute>().IsMine()) {
                if (attr.IsMine())
                {
                    //attr.GetComponent<BuffComponent>().AddBuff(Event.affix, stateMachine.attacker.transform.position);
                    NetDateInterface.FastMoveAndPos();
                    NetDateInterface.FastAddBuff(Event.affix, stateMachine.attacker, attr.gameObject, stateMachine.skillFullData.skillId, Event.EvtId);
                }
            }
            stateMachine.DoDamage(attr.gameObject);
        }
Пример #5
0
        //为玩家增加Buff
        void OnTriggerEnter(Collider other)
        {
            if (NetworkUtil.IsNetMaster())
            {
                if (other.tag == GameTag.Player)
                {
                    //击退技能
                    var pos     = other.transform.position;
                    var otherGo = other.gameObject;

                    var skill     = Util.GetSkillData(140, 1);
                    var skillInfo = SkillLogic.GetSkillInfo(skill);
                    var evt       = skillInfo.eventList[0];
                    var ret       = gameObject.GetComponent <BuffComponent>().AddBuff(evt.affix, pos);
                    if (ret)
                    {
                        NetDateInterface.FastAddBuff(evt.affix, otherGo, gameObject, skill.Id, evt.EvtId);
                    }
                }
            }
        }
Пример #6
0
        void OnTriggerEnter(Collider other)
        {
            Log.Sys("MoveBlock Enter : " + other.gameObject);
            if (NetworkUtil.IsNetMaster())
            {
                if (other.tag == GameTag.Player)
                {
                    //击退技能
                    var pos     = other.transform.position;
                    var otherGo = other.gameObject;
                    //dy dx 比较 那个大 保留那个 同时另外一个修正为 自己的pos
                    var par   = transform.parent.gameObject;
                    var myPos = par.transform.position;

                    //假设箱子都是 正方体
                    var dx = myPos.x - pos.x;
                    var dz = myPos.z - pos.z;
                    if (Mathf.Abs(dx) < Mathf.Abs(dz))
                    {
                        pos.x = myPos.x;
                    }
                    else
                    {
                        pos.z = myPos.z;
                    }

                    var skill     = Util.GetSkillData((int)SkillData.SkillConstId.KnockBack, 1);
                    var skillInfo = SkillLogic.GetSkillInfo(skill);
                    var evt       = skillInfo.eventList [0];
                    var ret       = par.GetComponent <BuffComponent>().AddBuff(evt.affix, pos);
                    if (ret)
                    {
                        NetDateInterface.FastAddBuff(evt.affix, otherGo, par, skill.Id, evt.EvtId, pos);
                    }
                }
            }
        }