Beispiel #1
0
 public void OnInteractionBegin(Interactor activator)
 {
     if (!NetworkServer.active)
     {
         Debug.LogWarning("[Server] function 'System.Void RoR2.BarrelInteraction::OnInteractionBegin(RoR2.Interactor)' called on client");
         return;
     }
     if (!this.opened)
     {
         this.Networkopened = true;
         EntityStateMachine component = base.GetComponent <EntityStateMachine>();
         if (component)
         {
             component.SetNextState(new Opening());
         }
         CharacterBody component2 = activator.GetComponent <CharacterBody>();
         if (component2)
         {
             TeamIndex objectTeam = TeamComponent.GetObjectTeam(component2.gameObject);
             TeamManager.instance.GiveTeamMoney(objectTeam, (uint)this.goldReward);
         }
         this.CoinDrop();
         ExperienceManager.instance.AwardExperience(base.transform.position, activator.GetComponent <CharacterBody>(), (ulong)this.expReward);
     }
 }
 // Token: 0x0600122B RID: 4651 RVA: 0x00059680 File Offset: 0x00057880
 public override void OnDeserialize(NetworkReader reader, bool initialState)
 {
     if (initialState)
     {
         for (int i = 0; i < this.stateMachines.Length; i++)
         {
             EntityStateMachine entityStateMachine = this.stateMachines[i];
             short stateTypeIndex = (short)reader.ReadPackedUInt32() - 1;
             if (!base.hasAuthority)
             {
                 EntityState entityState = EntityState.Instantiate(stateTypeIndex);
                 if (entityState != null)
                 {
                     entityState.OnDeserialize(reader);
                     if (!this.stateMachines[i])
                     {
                         Debug.LogErrorFormat("State machine [{0}] on object {1} is not set! incoming state = {2}", new object[]
                         {
                             i,
                             base.gameObject,
                             entityState.GetType()
                         });
                     }
                     entityStateMachine.SetNextState(entityState);
                 }
             }
         }
     }
 }
Beispiel #3
0
        public void Open()
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.ChestBehavior::Open()' called on client");
                return;
            }
            EntityStateMachine component = base.GetComponent <EntityStateMachine>();

            if (component)
            {
                component.SetNextState(EntityState.Instantiate(this.openState));
            }
        }
        private void ReadyNextNullWard()
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.ArenaMissionController::ReadyNextNullWard()' called on client");
                return;
            }
            if (this.currentRound > this.nullWards.Length)
            {
                Debug.LogError("Out of null wards! Aborting.");
                return;
            }
            EntityStateMachine component = this.nullWards[this.currentRound].GetComponent <EntityStateMachine>();

            component.initialStateType = new SerializableEntityStateType(typeof(WardOnAndReady));
            component.SetNextState(new WardOnAndReady());
        }