Exemplo n.º 1
0
        // Token: 0x0600139A RID: 5018 RVA: 0x00053B00 File Offset: 0x00051D00
        public override bool OnSerialize(NetworkWriter writer, bool initialState)
        {
            uint num = base.syncVarDirtyBits;

            if (initialState)
            {
                for (int i = 0; i < this.allSkills.Length; i++)
                {
                    GenericSkill genericSkill = this.allSkills[i];
                    if (genericSkill.baseSkill != genericSkill.defaultSkillDef)
                    {
                        num |= 1U << i;
                    }
                }
            }
            writer.WritePackedUInt32(num);
            for (int j = 0; j < this.allSkills.Length; j++)
            {
                if ((num & 1U << j) != 0U)
                {
                    GenericSkill genericSkill2 = this.allSkills[j];
                    SkillDef     baseSkill     = genericSkill2.baseSkill;
                    writer.WritePackedUInt32((uint)(((baseSkill != null) ? baseSkill.skillIndex : -1) + 1));
                }
            }
            return(num > 0U);
        }
Exemplo n.º 2
0
 public void ApplyLoadoutServer(Loadout loadout, int bodyIndex)
 {
     if (!NetworkServer.active)
     {
         Debug.LogWarning("[Server] function 'System.Void RoR2.SkillLocator::ApplyLoadoutServer(RoR2.Loadout,System.Int32)' called on client");
         return;
     }
     if (bodyIndex == -1)
     {
         return;
     }
     for (int i = 0; i < this.allSkills.Length; i++)
     {
         uint         skillVariant = loadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, i);
         GenericSkill genericSkill = this.allSkills[i];
         genericSkill.SetBaseSkill(genericSkill.skillFamily.variants[(int)skillVariant].skillDef);
     }
 }
Exemplo n.º 3
0
        // Token: 0x0600139B RID: 5019 RVA: 0x00053B9C File Offset: 0x00051D9C
        public override void OnDeserialize(NetworkReader reader, bool initialState)
        {
            this.inDeserialize = true;
            uint num = reader.ReadPackedUInt32();

            for (int i = 0; i < this.allSkills.Length; i++)
            {
                if ((num & 1U << i) != 0U)
                {
                    GenericSkill genericSkill = this.allSkills[i];
                    SkillDef     skillDef     = SkillCatalog.GetSkillDef((int)(reader.ReadPackedUInt32() - 1U));
                    if (initialState || !this.hasEffectiveAuthority)
                    {
                        genericSkill.SetBaseSkill(skillDef);
                    }
                }
            }
            this.inDeserialize = false;
        }
Exemplo n.º 4
0
 // Token: 0x060013A4 RID: 5028 RVA: 0x00053E24 File Offset: 0x00052024
 public void ApplyAmmoPack()
 {
     if (NetworkServer.active && !this.networkIdentity.hasAuthority)
     {
         NetworkWriter networkWriter = new NetworkWriter();
         networkWriter.StartMessage(63);
         networkWriter.Write(base.gameObject);
         networkWriter.FinishMessage();
         NetworkConnection clientAuthorityOwner = this.networkIdentity.clientAuthorityOwner;
         if (clientAuthorityOwner != null)
         {
             clientAuthorityOwner.SendWriter(networkWriter, QosChannelIndex.defaultReliable.intVal);
             return;
         }
     }
     else
     {
         GenericSkill[] array = new GenericSkill[]
         {
             this.primary,
             this.secondary,
             this.utility,
             this.special
         };
         Util.ShuffleArray <GenericSkill>(array);
         foreach (GenericSkill genericSkill in array)
         {
             if (genericSkill && genericSkill.CanApplyAmmoPack())
             {
                 Debug.LogFormat("Resetting skill {0}", new object[]
                 {
                     genericSkill.skillName
                 });
                 genericSkill.AddOneStock();
             }
         }
     }
 }
Exemplo n.º 5
0
 // Token: 0x060013A1 RID: 5025 RVA: 0x00053CE0 File Offset: 0x00051EE0
 public SkillSlot FindSkillSlot(GenericSkill skillComponent)
 {
     if (!skillComponent)
     {
         return(SkillSlot.None);
     }
     if (skillComponent == this.primary)
     {
         return(SkillSlot.Primary);
     }
     if (skillComponent == this.secondary)
     {
         return(SkillSlot.Secondary);
     }
     if (skillComponent == this.utility)
     {
         return(SkillSlot.Utility);
     }
     if (skillComponent == this.special)
     {
         return(SkillSlot.Special);
     }
     return(SkillSlot.None);
 }
Exemplo n.º 6
0
 // Token: 0x060013A0 RID: 5024 RVA: 0x00053CD2 File Offset: 0x00051ED2
 public int GetSkillSlotIndex(GenericSkill skillSlot)
 {
     return(Array.IndexOf <GenericSkill>(this.allSkills, skillSlot));
 }