예제 #1
0
 public virtual bool AddItem(HolderObject item)
 {
     if (AddItem(item, Slots, MaxSlots))
     {
         _simpleEvents.Call(INVENTORY_ADD_ITEM, item);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
        public void UpdateStates()
        {
            if (Dead)
            {
                return;
            }

            if (Energy > 0)
            {
                Energy -= 0.06f;
            }
            else
            {
                Energy = 0.0f;
            }

            if (Thirst > 0)
            {
                Thirst -= 0.09f;
            }
            else
            {
                Thirst = 0.0f;
            }

            if (Hunger > 0)
            {
                Hunger -= 0.07f;
            }
            else
            {
                Hunger = 0.0f;
            }

            if (UnderWater)
            {
                if (Breath > 0)
                {
                    Breath -= 5f;
                }
                else
                {
                    Breath = 0;
                }
            }
            else
            {
                Breath = 100f;
            }

            if (Thirst <= 0.0f)
            {
                ChangeHealth(-ThirstLifeDecSpeed);
            }
            if (Hunger <= 0.0f)
            {
                ChangeHealth(-HungerLifeDecSpeed);
            }
            if (Breath <= 0.0f)
            {
                ChangeHealth(-O2LifeDecSpeed);
            }



            _simpleEvents.Call(PLAYER_UPDATE_STATS, null);

            CheckIfSleep();
        }