Пример #1
0
        private void PickUpPowerUp(RoomItem item, RoomUser user)
        {
            switch (item.freezePowerUp)
            {
            case FreezePowerUp.BlueArrow:
            case FreezePowerUp.GreenArrow:
            case FreezePowerUp.OrangeSnowball:
                user.banzaiPowerUp = item.freezePowerUp;
                break;

            case FreezePowerUp.Shield:
                Freeze.ActivateShield(user);
                break;

            case FreezePowerUp.Heart:
                if (user.FreezeLives < 5)
                {
                    checked { ++user.FreezeLives; }
                    this.room.GetGameManager().AddPointToTeam(user.team, 10, user);
                }
                ServerMessage serverMessage = new ServerMessage();
                serverMessage.Init(Outgoing.UpdateFreezeLivesMessageComposer);
                serverMessage.AppendInt32(user.InternalRoomID);
                serverMessage.AppendInt32(user.FreezeLives);
                user.GetClient().SendMessage(serverMessage);
                break;
            }
            item.freezePowerUp = FreezePowerUp.None;
            item.ExtraData     = "1" + item.ExtraData;
            item.UpdateState(false, true);
        }
Пример #2
0
 internal void CycleUser(RoomUser user)
 {
     if (user.Freezed)
     {
         checked { ++user.FreezeCounter; }
         if (user.FreezeCounter > 10)
         {
             user.Freezed       = false;
             user.FreezeCounter = 0;
             Freeze.ActivateShield(user);
         }
     }
     if (!user.shieldActive)
     {
         return;
     }
     checked { ++user.shieldCounter; }
     if (user.shieldCounter > 10)
     {
         user.shieldActive  = false;
         user.shieldCounter = 10;
         user.ApplyEffect((int)(user.team + 39));
     }
 }