Example #1
0
 public void Deserialize(P2PNetworkReader reader)
 {
     this.m_Position           = reader.ReadVector3();
     this.m_ItemID             = (ItemID)reader.ReadInt32();
     this.m_ActiveChildrenMask = reader.ReadInt32();
     this.m_Group = BalanceSystem20.Get().GetGroupByIndex((int)reader.ReadInt16());
 }
Example #2
0
 public void OnChallenge(string name)
 {
     ChallengesManager.Get().m_ChallengeToActivate = name;
     ScenarioManager.Get().m_SkipTutorial          = true;
     MainLevel.Instance.m_GameMode     = GameMode.Survival;
     GreenHellGame.Instance.m_GameMode = GameMode.Survival;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
     BalanceSystem20.Get().Initialize();
 }
        public int GetCurrentGroupMembersCount()
        {
            float weightedAverage = BalanceSystem20.Get().m_WeightedAverage;
            int   num             = this.m_MaxGroupMembersCount;

            if (weightedAverage < 0.4f)
            {
                num -= 2;
            }
            else if (weightedAverage < 0.8f)
            {
                num--;
            }
            return(Mathf.Min(this.m_CurrentGroupMembersCount, num));
        }
Example #4
0
 protected override void Update()
 {
     base.Update();
     if (this.m_Info.m_Health != this.m_Info.m_MaxHealth && Time.time - this.m_LastDamageTime > this.m_ResetHitsCountToDestroyTime)
     {
         this.m_CurrentHitsCount = 0;
         if (this.ReplIsOwner())
         {
             this.ReplSetDirty();
         }
     }
     if (!this.m_RegisteredInBalanceSystem)
     {
         BalanceSystem20.Get().OnCreateConstruction(this);
         this.m_RegisteredInBalanceSystem = true;
     }
 }
Example #5
0
 public override void OnReplicationDeserialize(P2PNetworkReader reader, bool initial_state)
 {
     if (!initial_state)
     {
         uint num  = reader.ReadPackedUInt32();
         int  num2 = 0;
         while ((long)num2 < (long)((ulong)num))
         {
             ReplicatedBalanceObjects.s_TmpObjHolder.Deserialize(reader);
             BalanceSystem20.Get().OnBalanceSystemObjectReplReceived(ReplicatedBalanceObjects.s_TmpObjHolder, false);
             num2++;
         }
         num = reader.ReadPackedUInt32();
         int num3 = 0;
         while ((long)num3 < (long)((ulong)num))
         {
             ReplicatedBalanceObjects.s_TmpObjHolder.Deserialize(reader);
             BalanceSystem20.Get().OnBalanceSystemObjectReplReceived(ReplicatedBalanceObjects.s_TmpObjHolder, true);
             num3++;
         }
     }
 }
Example #6
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     BalanceSystem20.Get().OnItemDestroyed(this);
 }
Example #7
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     Construction.s_AllConstructions.Remove(this);
     BalanceSystem20.Get().OnDestroyConstruction(this);
 }