Example #1
0
 //掉落金币
 private void DropItem(int id, int count, Vector2 pos)
 {
     count    *= AutoActivityManager.GetActivity(6200);
     addMoney += count;
     CreateDropItem(99, new List <ulong> {
         mPlayer.ObjId
     }, mPlayer.GetTeamId(), id, count, pos);
 }
Example #2
0
        //拾取
        public bool Pickup(ObjDropItem _this, ObjPlayer picker)
        {
            if (picker.mIsDead)//死亡玩家尸体无法拾取
            {
                return(false);
            }
            var IsCan = false;

            if ((picker.GetPosition() - _this.GetPosition()).LengthSquared() > ObjDropItem.PickDistanceSquared)
            {
                return(false);
            }
            if (_this.IsOwnerList(picker.ObjId))
            {
                IsCan = true;
            }
            else
            {
                switch (_this.BelongType)
                {
                case 0:     //队内自由拾取
                {
                    if (DateTime.Now >= _this.mDropTime.AddSeconds(ObjDropItem.SafeSecondsByTeamFree))
                    {
                        IsCan = true;
                    }
                }
                break;

                case 1:     //队内伤害拾取
                {
                    if (_this.TeamId == 0)
                    {
//没有队
                        if (DateTime.Now >= _this.mDropTime.AddSeconds(ObjDropItem.TeamSecondsByTeamDamage))
                        {
                            IsCan = true;
                        }
                    }
                    else if (picker.GetTeamId() == _this.TeamId)
                    {
//本队成员
                        if (DateTime.Now >= _this.mDropTime.AddSeconds(ObjDropItem.SafeSecondsByTeamDamage))
                        {
                            IsCan = true;
                        }
                    }
                    else
                    {
//非本队成员
                        if (DateTime.Now >= _this.mDropTime.AddSeconds(ObjDropItem.TeamSecondsByTeamDamage))
                        {
                            IsCan = true;
                        }
                    }
                }
                break;

                case 2:     //队内分别拾取
                {
                }
                break;

                case 3:     //所有人分别拾取
                {
                }
                break;

                case 4:
                {
                    IsCan = true;
                }
                break;
                }
            }
            if (IsCan)
            {
                PushPick(_this, picker);
            }
            return(IsCan);
        }