Exemplo n.º 1
0
        public override void Start(Player player)
        {
            base.Start(player);
            player.BeginAttacking += new PlayerEventHandle(player_BeginFitting);
            player.IsNoHole = true;

        }
Exemplo n.º 2
0
        public override void Start(Player player)
        {
            base.Start(player);
            player.BeginAttacking += player_BeginFitting;
            player.IsHide = true;

        }
Exemplo n.º 3
0
 public void Execute(Game.Server.Games.BaseGame game, Player player, ItemTemplateInfo item)
 {
     if (!player.IsSpecialSkill)
     {
         player.BallCount = item.Property2;
     }
 }
 public WaitPlayerAttackingAction(int delay, Player player,int turnIndex)
 {
     m_tick = GameMgr.GetTickCount() + delay;
     m_player = player;
     m_turnIndex = turnIndex;
     player.EndAttacking += player_EndAttacking;
 }
Exemplo n.º 5
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (player.IsAttacking)
     {
         player.Skip(packet.ReadByte());
     }
 }
Exemplo n.º 6
0
        public void Execute(Game.Server.Games.BaseGame game, Player player, ItemTemplateInfo item)
        {
            switch (item.Property2)
            {
                case 0:
                    if (player.IsLiving)
                    {
                        player.AddBlood(item.Property3, true);
                    }
                    break;
                case 1:
                    Player[] temps = player.Game.GetAllFightPlayersSafe();
                    foreach (Player p in temps)
                    {
                        if (p.IsLiving && p.Team == player.Team)
                        {
                            p.AddBlood(item.Property3, true);
                        }
                    }

                    break;
                default:
                    break;
            }
        }
Exemplo n.º 7
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (player.IsAttacking)
     {
         player.UseSpecialSkill();
     }
 }
Exemplo n.º 8
0
 private void player_BeginFitting(Player player)
 {
     Count--;
     if (Count <= 0)
     {
         Stop();
     }
 }
Exemplo n.º 9
0
 public GhostMoveAction(Player player,Point target)
 {
     m_player = player;
     m_target = target;
     m_isFinished = false;
     m_v = new Point(target.X - m_player.X, target.Y - m_player.Y);
     m_v.Normalize(2);
 }
Exemplo n.º 10
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (player.IsLiving == false)
     {
         player.TargetPoint.X = packet.ReadInt();
         player.TargetPoint.Y = packet.ReadInt();
     }
 }
Exemplo n.º 11
0
 private void player_BeginFitting(Player player)
 {
     m_count--;
     if (m_count <= 0)
     {
         this.Stop();
     }
 }
Exemplo n.º 12
0
 void player_BeginFitting(Player player)
 {
     m_count--;
     if (m_count <= 0)
     {
         Stop();
     }
 }
Exemplo n.º 13
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (player.IsLiving && game.GameState == eGameState.Playing)
     {
         game.SendToAll(packet);
         player.Die();
         game.CheckState(0);
     }
 }
Exemplo n.º 14
0
        public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
        {
            player.ShootCount += item.Property2;

            if (item.Property2 == 2)
                player.CurrentShootMinus *= 0.6f;
            else
                player.CurrentShootMinus *= 0.9f;
        }
Exemplo n.º 15
0
 public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
 {
     NoHoleEffect effect = (NoHoleEffect)player.EffectList.GetOfType(typeof(NoHoleEffect));
     if (effect != null)
     {
         effect.Count = item.Property3;
     }
     else
     {
         new NoHoleEffect(item.Property3).Start(player);
     }
 }
Exemplo n.º 16
0
 public void  HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (game.GameState == eGameState.Loading)
     {
         player.LoadingProcess = packet.ReadInt();
         if (player.LoadingProcess >= 100)
         {
             game.CheckState(0);
         }
         game.SendToAll(packet);
     }
 }
Exemplo n.º 17
0
 private void AddHideEffect(Player player, int count)
 {
     HideEffect effect = (HideEffect)player.EffectList.GetOfType(typeof(HideEffect));
     if (effect == null)
     {
         new HideEffect(count).Start(player);
     }
     else
     {
         effect.Count = count;
     }
 }
Exemplo n.º 18
0
 public static void ExecuteSpell(BaseGame game,Player player,ItemTemplateInfo item)
 {
     try
     {
         ISpellHandler spellHandler = SpellMgr.LoadSpellHandler(item.Property1);
         spellHandler.Execute(game, player, item);
     }
     catch (Exception ex)
     {
         log.Error("Execute Spell Error:", ex);
     }
 }
Exemplo n.º 19
0
        public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
        {
            if (player.IsAttacking)
            {
                game.SendToAll(packet);

                bool tag = packet.ReadBoolean();
                byte speedTime = packet.ReadByte();

                player.PrepareShoot(speedTime);
            }
        }
Exemplo n.º 20
0
        public SimpleBomb(int id,BombType type, Player owner,BaseGame game,BallInfo info, Tile shape,bool controled)
            :base(id,info.Mass,info.Weight,info.Wind,info.DragIndex)
        {
            m_owner = owner;
            m_game = game;
            m_info = info;

            m_shape = shape;
            m_type = type;
            m_power = info.Power;
            m_radius = info.Radii;
            m_controled = controled;

            m_lifeTime = 0;
        }
Exemplo n.º 21
0
 public void HandleCommand(BaseGame game, Player player, Game.Base.Packets.GSPacketIn packet)
 {
     if (player.HasTakeCard == false && player.CanTakeOut == true)
     {
         int index = packet.ReadByte();
         if (index < 0 || index > 7)
         {
             game.TakeCard(player);
         }
         else
         {
             game.TakeCard(player,index);
         }
     }
 }
Exemplo n.º 22
0
        public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
        {
            if (player.IsAttacking)
            {
                int x = packet.ReadInt();
                int y = packet.ReadInt();

                //检查开炮点的距离有效性
                if (player.CheckShootPoint(x, y) == false)
                    return;

                int force = packet.ReadInt();
                int angle = packet.ReadInt();
                player.Shoot(x, y, force, angle);
            }
        }
Exemplo n.º 23
0
        public BombObject(int id,BombType type, Player owner, Tile shape, int radius, bool controled, float mass, float gravityFactor, float windFactor, float airResitFactor,double power)
            : base(id)
        {
            _power = power;
            _owner = owner;
            _controled = controled;
            _mass = mass;
            _gravityFactor = gravityFactor;
            _windFactor = windFactor;
            _airResitFactor = airResitFactor;
            _type = type;
            _isHole = true;

            _radius = radius;

            _vx = new EulerVector(0, 0, 0);
            _vy = new EulerVector(0, 0, 0);

            _shape = shape;
            _rect = new Rectangle(-3,-3,6,6);
        }
Exemplo n.º 24
0
        public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
        {
            if (player.IsLiving || player.IsAttacking)
            {
                GSPacketIn pkg = packet.Clone();
                pkg.ClientID = player.Id;
                game.SendToAll(pkg, player.PlayerDetail);

                byte type = packet.ReadByte();
                int tx = packet.ReadInt();
                int ty = packet.ReadInt();
                byte dir = packet.ReadByte();
                bool isLiving = packet.ReadBoolean();

                switch (type)
                {
                    case 0:
                    case 1:
                        //p.X = tx;
                        //p.Y = ty;
                        player.SetXY(tx, ty);
                        player.StartMoving();
                        if (player.Y - ty > 1 || player.IsLiving != isLiving)
                        {
                            //GameServer.log.Error(string.Format("修正掉落: 动作类型  {0}    原始Y:{1}     最新Y:{2}", type, ty, p.Y));
                            //把服务器修正的掉落指令和客户掉落指令加以区分。
                            pkg = player.PlayerDetail.Out.SendPlayerMove(player,3, player.X, player.Y, 0, player.IsLiving);
                            game.SendToAll(pkg, player.PlayerDetail);
                        }
                        break;
                    case 2:
                        if (player.IsLiving == false)
                        {
                            player.TargetPoint = new Point(tx, ty);
                        }
                        break;
                }
            }
        }
Exemplo n.º 25
0
 public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
 {
     switch(item.Property2)
     {
         case 0:
             if(player.IsLiving)
             {
                 AddHideEffect(player,item.Property3);
             }
             break;
         case 1:
             Player[] players = player.Game.GetAllFightPlayersSafe();
             foreach(Player p in players)
             {
                 if(p.IsLiving && p.Team == player.Team)
                 {
                     AddHideEffect(p, item.Property3);
                 }
             }
             break;
         default:
             break;
     }
 }
Exemplo n.º 26
0
 public ProcessPacketAction(Player player, GSPacketIn pkg)
 {
     m_player = player;
     m_packet = pkg;
 }
Exemplo n.º 27
0
        public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
        {
            player.IgnoreArmor = true;

        }
Exemplo n.º 28
0
 public void HandleCommand(BaseGame game,Player player, Game.Base.Packets.GSPacketIn packet)
 {
     player.WannaLeader = packet.ReadBoolean();
     game.SendToAll(packet);
 }
Exemplo n.º 29
0
 protected int MakeCriticalDamage(Player target,int baseDamage)
 {
     int lucky = m_owner.PlayerDetail.PlayerCharacter.Luck;
     Random rd = new Random();
     bool canHit = lucky * 45 > rd.Next(100000);
     if (canHit)
     {
         return (int)((0.5 + lucky * 0.0005) * baseDamage);
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 30
0
        protected int MakeDamage(Player target)
        {
            int baseDamage = m_owner.PlayerDetail.BaseAttack;
            int baseGuard = target.PlayerDetail.BaseDefence;

            int defence = target.PlayerDetail.PlayerCharacter.Defence;
            int attack = m_owner.PlayerDetail.PlayerCharacter.Attack;
            if (m_owner.IgnoreArmor)
            {
                baseGuard = 0;
                defence = 0;
            }

            float damagePlus = m_owner.CurrentDamagePlus;
            float shootMinus = m_owner.CurrentShootMinus;

            //伤害={ 基础伤害*(1+攻击*0.1%)*[1-(基础护甲/200+防御*0.03%)] }*(1+道具攻击加成)*炸弹威力*连击系数
            double damage = (baseDamage * ( 1 + attack * 0.001) * (1 - (baseGuard / 200 + defence * 0.003))) * (1 + damagePlus) * shootMinus ;

            double distance = Math.Sqrt((target.X - X) * (target.X - X) + (target.Y - Y) * (target.Y - Y));

            damage = damage * (1 - distance / m_radius / 4);

            return (int)damage;
        }