Example #1
0
 public void CallFuction(LivingCallBack func, int delay)
 {
     if (m_game != null)
     {
         m_game.AddAction(new LivingCallFunctionAction(this, func, delay));
     }
 }
 public LivingPlayeMovieAction(Living living, string action, int delay, int movieTime, LivingCallBack callBack) : base(delay, movieTime)
 {
     this.m_living    = living;
     this.m_action    = action;
     this.m_callBack  = callBack;
     this.m_movieTime = movieTime;
 }
 public LivingMoveToAction(Living living, List<Point> path, string action, int delay, LivingCallBack callback)
     : base(delay, 0)
 {
     m_living = living;
     m_path = path;
     m_action = action;
     m_isSent = false;
     m_index = 0;
     m_callback = callback;
 }
 public LivingMoveToAction(Living living, List <Point> path, int stepx, string action, int delay, LivingCallBack callback) : base(delay, 0)
 {
     this.m_living   = living;
     this.m_path     = path;
     this.m_stepx    = stepx;
     this.m_action   = action;
     this.m_isSent   = false;
     this.m_index    = 0;
     this.m_callback = callback;
 }
Example #5
0
 public LivingMoveToAction(Living living, List <Point> path, string action, int delay, LivingCallBack callback)
     : base(delay, 0)
 {
     m_living   = living;
     m_path     = path;
     m_action   = action;
     m_isSent   = false;
     m_index    = 0;
     m_callback = callback;
 }
Example #6
0
        public bool MoveTo(int x, int y, string action, int delay, LivingCallBack callback)
        {
            if (this is SimpleBoss)
            {
                Living.speed = (this as SimpleBoss).NpcInfo.DropRate;
            }
            else
            {
                if (this is SimpleNpc)
                {
                    Living.speed = (this as SimpleNpc).NpcInfo.DropRate;
                }
            }
            bool result;

            if (this.m_x == x && this.m_y == y)
            {
                result = false;
            }
            else
            {
                if (x < 0 || x > this.m_map.Bound.Width)
                {
                    result = false;
                }
                else
                {
                    List <Point> path      = new List <Point>();
                    int          tx        = this.m_x;
                    int          ty        = this.m_y;
                    int          direction = (x > tx) ? 1 : -1;
                    while ((x - tx) * direction > 0)
                    {
                        Point p = this.m_map.FindNextWalkPoint(tx, ty, direction, Living.speed * Living.step_X, Living.speed * Living.step_Y + 1);
                        if (!(p != Point.Empty))
                        {
                            break;
                        }
                        path.Add(p);
                        tx = p.X;
                        ty = p.Y;
                    }
                    if (path.Count > 0)
                    {
                        this.m_game.AddAction(new LivingMoveToAction(this, path, Living.speed, action, delay, callback));
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
 public LivingFallingAction(Living living, int toX, int toY, int speed, string action, int delay, int type, LivingCallBack callback) : base(delay, 2000)
 {
     this.m_living    = living;
     this.m_fallSpeed = speed;
     this.m_action    = action;
     this.m_toX       = toX;
     this.m_toY       = toY;
     this.m_isSent    = false;
     this.m_type      = type;
     this.m_callback  = callback;
 }
Example #8
0
 public LivingMoveToAction(Living living, List <Point> path, string action, int delay, int speed, string sAction, LivingCallBack callback) : base(delay, 0)
 {
     this.m_living   = living;
     this.m_path     = path;
     this.m_action   = action;
     this.m_saction  = sAction;
     this.m_isSent   = false;
     this.m_index    = 0;
     this.m_callback = callback;
     this.m_speed    = speed;
 }
Example #9
0
 public LivingJumpAction(Living living, int toX, int toY, int speed, string action, int delay, int type, LivingCallBack callback)
     : base(delay, 2000)
 {
     m_living   = living;
     m_toX      = toX;
     m_toY      = toY;
     m_speed    = speed;
     m_action   = action;
     m_isSent   = false;
     m_type     = type;
     m_callback = callback;
 }
 public LivingFlyToAction(Living living, int fromX, int fromY, int toX, int toY, string action, int delay, int speed, LivingCallBack callback) : base(delay, 0)
 {
     this.m_living   = living;
     this.m_action   = action;
     this.m_speed    = speed;
     this.m_toX      = toX;
     this.m_toY      = toY;
     this.m_fromX    = fromX;
     this.m_fromY    = fromY;
     this.m_isSent   = false;
     this.m_callback = callback;
 }
Example #11
0
 public LivingJumpAction(Living living, int toX, int toY, int speed, string action, int delay, int type, LivingCallBack callback)
     : base(delay, 2000)
 {
     m_living = living;
     m_toX = toX;
     m_toY = toY;
     m_speed = speed;
     m_action = action;
     m_isSent = false;
     m_type = type;
     m_callback = callback;
 }
Example #12
0
        public bool MoveTo(int x, int y, string action, int delay, LivingCallBack callback)
        {
            if (m_x == x && m_y == y)
            {
                return(false);
            }

            if (x < 0 || x > m_map.Bound.Width)
            {
                return(false);
            }

            List <Point> path = new List <Point>();

            int tx        = m_x;
            int ty        = m_y;
            int direction = x > tx ? 1 : -1;

            while ((x - tx) * direction > 0)
            {
                Point p = m_map.FindNextWalkPoint(tx, ty, direction, STEP_X, STEP_Y);
                if (p != Point.Empty)
                {
                    path.Add(p);
                    tx = p.X;
                    ty = p.Y;
                }
                else
                {
                    break;
                    //FallFrom(p.X, p.Y, "fall", 0, 0, 12);
                }
            }

            if (path.Count > 0)
            {
                m_game.AddAction(new LivingMoveToAction(this, path, action, delay, callback));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #13
0
 public void PlayMovie(string action, int delay, int MovieTime,LivingCallBack call)
 {
     m_game.AddAction(new LivingPlayeMovieAction(this, action, delay, MovieTime));
     
 }
 public LivingCallFunctionAction(Living living, LivingCallBack func, int delay) : base(delay)
 {
     this.m_living = living;
     this.m_func   = func;
 }
Example #15
0
 public bool JumpTo(int x, int y, string ation, int delay, int type, LivingCallBack callback)
 {
     return JumpTo(x, y, ation, delay, type, 20, callback);
 }
Example #16
0
        public bool JumpTo(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {

            Point p = m_map.FindYLineNotEmptyPoint(x, y);
            if (p.Y < Y)
            {
                m_game.AddAction(new LivingJumpAction(this, p.X, p.Y, speed, action, delay, type, callback));
                return true;
            }
            return false;
        }
Example #17
0
        public bool FallFrom(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {
            Point left = this.m_map.FindYLineNotEmptyPoint(x, y);

            if (left == Point.Empty)
            {
                left = new Point(x, this.m_game.Map.Bound.Height + 1);
            }
            if (this.Y < left.Y)
            {
                this.m_game.AddAction(new LivingFallingAction(this, left.X, left.Y, speed, action, delay, type, callback));
                return(true);
            }
            return(false);
        }
Example #18
0
        public bool FallFrom(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {
            Point p = m_map.FindYLineNotEmptyPoint(x, y);
            if (p == Point.Empty)
            {
                p = new Point(x, m_game.Map.Bound.Height + 1);
            }
            if (Y < p.Y)
            {
                m_game.AddAction(new LivingFallingAction(this, p.X, p.Y, speed, action, delay, type, callback));

                return true;
            }
            return false;
        }
Example #19
0
        public bool FallFrom(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {
            Point p = m_map.FindYLineNotEmptyPoint(x, y);

            if (p == Point.Empty)
            {
                p = new Point(x, m_game.Map.Bound.Height + 1);
            }
            if (Y < p.Y)
            {
                m_game.AddAction(new LivingFallingAction(this, p.X, p.Y, speed, action, delay, type, callback));

                return(true);
            }
            return(false);
        }
Example #20
0
        public bool JumpToSpeed(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {
            Point point    = this.m_map.FindYLineNotEmptyPoint(x, y);
            int   arg_15_0 = point.Y;

            this.m_game.AddAction(new LivingJumpAction(this, point.X, point.Y, speed, action, delay, type, callback));
            return(true);
        }
Example #21
0
 public bool JumpTo(int x, int y, string ation, int delay, int type, LivingCallBack callback, bool isNotEmptyPoint)
 {
     return(this.JumpTo(x, y, ation, delay, type, 20, callback, isNotEmptyPoint));
 }
 public LivingCallFunctionAction(Living living, LivingCallBack func, int delay)
     : base(delay)
 {
     m_living = living;
     m_func = func;
 }
Example #23
0
        public bool JumpTo(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback, bool isNotEmptyPoint)
        {
            Point p = this.m_map.FindYLineNotEmptyPoint(x, y);
            bool  result;

            if (isNotEmptyPoint)
            {
                if (p.Y >= this.Y)
                {
                    result = false;
                    return(result);
                }
            }
            this.m_game.AddAction(new LivingJumpAction(this, p.X, p.Y, speed, action, delay, type, callback));
            result = true;
            return(result);
        }
Example #24
0
 public bool MoveTo(int x, int y, string action, int delay, LivingCallBack callback)
 {
     return(this.MoveTo(x, y, action, delay, "", 4, callback));
 }
Example #25
0
        public bool MoveTo(int x, int y, string action, int delay, string sAction, int speed, LivingCallBack callback)
        {
            bool result;

            if (this.m_x == x && this.m_y == y)
            {
                result = false;
            }
            else
            {
                if (x < 0 || x > this.m_map.Bound.Width)
                {
                    result = false;
                }
                else
                {
                    List <Point> path      = new List <Point>();
                    int          tx        = this.m_x;
                    int          ty        = this.m_y;
                    int          direction = (x > tx) ? 1 : -1;
                    if (action == "fly")
                    {
                        Point p  = new Point(x, y);
                        Point p2 = new Point(tx - p.X, ty - p.Y);
                        p  = new Point(p.X + p2.X, y + p2.X);
                        p2 = new Point(x - p.X, x - p.Y);
                        if (p != Point.Empty)
                        {
                        }
                        p = new Point(x, y);
                        path.Add(p);
                    }
                    else
                    {
                        while ((x - tx) * direction > 0)
                        {
                            Point p = this.m_map.FindNextWalkPoint(tx, ty, direction, Living.STEP_X, Living.STEP_Y);
                            if (!(p != Point.Empty))
                            {
                                break;
                            }
                            path.Add(p);
                            tx = p.X;
                            ty = p.Y;
                        }
                    }
                    if (path.Count > 0)
                    {
                        this.m_game.AddAction(new LivingMoveToAction(this, path, action, delay, speed, sAction, callback));
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
Example #26
0
 public bool JumpTo(int x, int y, string ation, int delay, int type, int speed, LivingCallBack callback)
 {
     return(this.JumpTo(x, y, ation, delay, type, 20, callback, true));
 }
Example #27
0
        public bool JumpTo(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
        {
            Point p = m_map.FindYLineNotEmptyPoint(x, y);

            if (p.Y < Y)
            {
                m_game.AddAction(new LivingJumpAction(this, p.X, p.Y, speed, action, delay, type, callback));
                return(true);
            }
            return(false);
        }
Example #28
0
 public void CallFuction(LivingCallBack func, int delay)
 {
     if (m_game != null)
     {
         m_game.AddAction(new LivingCallFunctionAction(this, func, delay));
     }
 }
Example #29
0
 public bool FallFromTo(int x, int y, string action, int delay, int type, int speed, LivingCallBack callback)
 {
     this.m_game.AddAction(new LivingFallingAction(this, x, y, speed, action, delay, type, callback));
     return(true);
 }
Example #30
0
 public bool JumpTo(int x, int y, string ation, int delay, int type, LivingCallBack callback)
 {
     return(JumpTo(x, y, ation, delay, type, 20, callback));
 }
Example #31
0
        public bool MoveTo(int x, int y, string action, int delay, LivingCallBack callback)
        {
            if (m_x == x && m_y == y)
                return false;

            if (x < 0 || x > m_map.Bound.Width) return false;

            List<Point> path = new List<Point>();

            int tx = m_x;
            int ty = m_y;
            int direction = x > tx ? 1 : -1;
            while ((x - tx) * direction > 0)
            {
                Point p = m_map.FindNextWalkPoint(tx, ty, direction, STEP_X, STEP_Y);
                if (p != Point.Empty)
                {
                    path.Add(p);
                    tx = p.X;
                    ty = p.Y;
                }
                else
                {
                    break;
                    //FallFrom(p.X, p.Y, "fall", 0, 0, 12);
                }
            }

            if (path.Count > 0)
            {
                m_game.AddAction(new LivingMoveToAction(this, path, action, delay,3, callback));
                return true;
            }
            else
            {
                return false;
            }
        }
Example #32
0
 public void PlayMovie(string action, int delay, int MovieTime, LivingCallBack call)
 {
     m_game.AddAction(new LivingPlayeMovieAction(this, action, delay, MovieTime));
 }
Example #33
0
 public bool FlyTo(int x, int y, string action, int delay, int speed, LivingCallBack callback)
 {
     m_game.AddAction(new LivingFlyToAction(this, this.X, this.Y, x, y, action, delay, speed, callback));
     m_game.AddAction(new LivingFallingAction(this, x, y, 0, action, delay, 0, callback));
     return(true);
 }