Пример #1
0
 private void changeAction(GActions action)
 {
     if (this.owner.VLife > 0.0)
     {
         double        newDirection = (double)((int)Global.GetDirectionByAspect((int)this.target.CurrentPos.X, (int)this.target.CurrentPos.Y, (int)this.owner.CurrentPos.X, (int)this.owner.CurrentPos.Y));
         List <object> listObjs     = Global.GetAll9Clients(this.owner);
         GameManager.ClientMgr.NotifyOthersDoAction(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, this.owner, this.owner.MonsterZoneNode.MapCode, this.owner.CopyMapID, this.owner.RoleID, (int)newDirection, (int)action, (int)this.owner.SafeCoordinate.X, (int)this.owner.SafeCoordinate.Y, (int)this.target.CurrentPos.X, (int)this.target.CurrentPos.Y, 114, listObjs);
         Global.RemoveStoryboard(this.owner.Name);
         this.monsterMoving.ChangeDirection(this.owner, newDirection);
         this.owner.Action = action;
     }
 }
Пример #2
0
 private void changeAction(GActions action)
 {
     if (this.owner.VLife > 0.0)
     {
         Point         enemyPos     = this.owner.EnemyTarget;
         double        newDirection = this.owner.Direction;
         List <object> listObjs     = Global.GetAll9Clients(this.owner);
         GameManager.ClientMgr.NotifyOthersDoAction(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, this.owner, this.owner.MonsterZoneNode.MapCode, this.owner.CopyMapID, this.owner.RoleID, (int)newDirection, (int)action, (int)this.owner.SafeCoordinate.X, (int)this.owner.SafeCoordinate.Y, (int)enemyPos.X, (int)enemyPos.Y, 114, listObjs);
         this.owner.DestPoint = new Point(-1.0, -1.0);
         Global.RemoveStoryboard(this.owner.Name);
         this.owner.Action = action;
     }
 }
Пример #3
0
        /// <summary>
        /// 切换动作
        /// </summary>
        /// <param name="action"></param>
        private void changeAction(GActions action)
        {
            //如果已经死亡
            if (owner.VLife <= 0)
            {
                return;
            }

            Point  enemyPos     = owner.EnemyTarget;
            double newDirection = owner.Direction;

            //通知其他人自己开始做动作
            List <Object> listObjs = Global.GetAll9Clients(owner);

            GameManager.ClientMgr.NotifyOthersDoAction(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool,
                                                       owner, owner.MonsterZoneNode.MapCode, owner.CopyMapID, owner.RoleID, (int)newDirection, (int)action,
                                                       (int)owner.SafeCoordinate.X, (int)owner.SafeCoordinate.Y, (int)enemyPos.X, (int)enemyPos.Y, (int)TCPGameServerCmds.CMD_SPR_ACTTION, listObjs);

            owner.DestPoint = new Point(-1, -1);
            Global.RemoveStoryboard(owner.Name);
            owner.Action = action;
        }
Пример #4
0
        /// <summary>
        /// 切换动作
        /// </summary>
        /// <param name="action"></param>
        private void changeAction(GActions action)
        {
            //如果已经死亡
            if (owner.VLife <= 0)
            {
                return;
            }

            //计算方向是否还一致
            double newDirection = (int)Global.GetDirectionByAspect((int)target.CurrentPos.X, (int)target.CurrentPos.Y, (int)owner.CurrentPos.X, (int)owner.CurrentPos.Y);;

            //通知其他人自己开始做动作
            List <Object> listObjs = Global.GetAll9Clients(owner);

            GameManager.ClientMgr.NotifyOthersDoAction(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool,
                                                       owner, owner.MonsterZoneNode.MapCode, owner.CopyMapID, owner.RoleID, (int)newDirection, (int)action,
                                                       (int)owner.SafeCoordinate.X, (int)owner.SafeCoordinate.Y, (int)target.CurrentPos.X, (int)target.CurrentPos.Y, (int)TCPGameServerCmds.CMD_SPR_ACTTION, listObjs);

            Global.RemoveStoryboard(owner.Name);

            monsterMoving.ChangeDirection(owner, newDirection);

            owner.Action = action;
        }