Пример #1
0
 // Token: 0x06001787 RID: 6023 RVA: 0x0006F864 File Offset: 0x0006DA64
 public override void OverrideRuleChoices(RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
 {
     base.OverrideRuleChoices(mustInclude, mustExclude);
     base.ForceChoice(mustInclude, mustExclude, "Difficulty.Normal");
     base.ForceChoice(mustInclude, mustExclude, "Misc.StartingMoney.50");
     base.ForceChoice(mustInclude, mustExclude, "Misc.StageOrder.Random");
     base.ForceChoice(mustInclude, mustExclude, "Misc.KeepMoneyBetweenStages.Off");
     for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
     {
         RuleDef       ruleDef       = RuleCatalog.FindRuleDef(artifactIndex.ToString());
         RuleChoiceDef ruleChoiceDef = (ruleDef != null) ? ruleDef.FindChoice("Off") : null;
         if (ruleChoiceDef != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef);
         }
     }
     for (ItemIndex itemIndex = ItemIndex.Syringe; itemIndex < ItemIndex.Count; itemIndex++)
     {
         RuleDef       ruleDef2       = RuleCatalog.FindRuleDef("Items." + itemIndex.ToString());
         RuleChoiceDef ruleChoiceDef2 = (ruleDef2 != null) ? ruleDef2.FindChoice("On") : null;
         if (ruleChoiceDef2 != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef2);
         }
     }
     for (EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile; equipmentIndex < EquipmentIndex.Count; equipmentIndex++)
     {
         RuleDef       ruleDef3       = RuleCatalog.FindRuleDef("Equipment." + equipmentIndex.ToString());
         RuleChoiceDef ruleChoiceDef3 = (ruleDef3 != null) ? ruleDef3.FindChoice("On") : null;
         if (ruleChoiceDef3 != null)
         {
             base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef3);
         }
     }
 }
Пример #2
0
        // Token: 0x060018B4 RID: 6324 RVA: 0x0006A460 File Offset: 0x00068660
        public void Copy([NotNull] RuleChoiceMask src)
        {
            byte[] bytes  = src.bytes;
            byte[] bytes2 = this.bytes;
            int    i      = 0;
            int    num    = bytes2.Length;

            while (i < num)
            {
                bytes2[i] = bytes[i];
                i++;
            }
        }
Пример #3
0
 public void SetRuleChoiceMask([NotNull] RuleChoiceMask newRuleChoiceMask)
 {
     if (!NetworkServer.active)
     {
         Debug.LogWarning("[Server] function 'System.Void RoR2.NetworkRuleChoiceMask::SetRuleChoiceMask(RoR2.RuleChoiceMask)' called on client");
         return;
     }
     if (this.ruleChoiceMask.Equals(newRuleChoiceMask))
     {
         return;
     }
     base.SetDirtyBit(1u);
     this.ruleChoiceMask.Copy(newRuleChoiceMask);
 }
Пример #4
0
        // Token: 0x060018B2 RID: 6322 RVA: 0x0006A3F0 File Offset: 0x000685F0
        public override bool Equals(object obj)
        {
            RuleChoiceMask ruleChoiceMask = obj as RuleChoiceMask;

            if (ruleChoiceMask != null)
            {
                for (int i = 0; i < this.bytes.Length; i++)
                {
                    if (this.bytes[i] != ruleChoiceMask.bytes[i])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #5
0
        // Token: 0x060015BF RID: 5567 RVA: 0x0005CB68 File Offset: 0x0005AD68
        public override void OverrideRuleChoices(RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
        {
            base.OverrideRuleChoices(mustInclude, mustExclude);
            base.ForceChoice(mustInclude, mustExclude, "Difficulty.Normal");
            base.ForceChoice(mustInclude, mustExclude, "Misc.StartingMoney.50");
            base.ForceChoice(mustInclude, mustExclude, "Misc.StageOrder.Random");
            base.ForceChoice(mustInclude, mustExclude, "Misc.KeepMoneyBetweenStages.Off");
            for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++)
            {
                RuleDef       ruleDef       = RuleCatalog.FindRuleDef(artifactIndex.ToString());
                RuleChoiceDef ruleChoiceDef = (ruleDef != null) ? ruleDef.FindChoice("Off") : null;
                if (ruleChoiceDef != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef);
                }
            }
            ItemIndex itemIndex = ItemIndex.Syringe;
            ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount;

            while (itemIndex < itemCount)
            {
                ItemDef       itemDef        = ItemCatalog.GetItemDef(itemIndex);
                RuleDef       ruleDef2       = RuleCatalog.FindRuleDef("Items." + itemDef.name);
                RuleChoiceDef ruleChoiceDef2 = (ruleDef2 != null) ? ruleDef2.FindChoice("On") : null;
                if (ruleChoiceDef2 != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef2);
                }
                itemIndex++;
            }
            EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile;
            EquipmentIndex equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount;

            while (equipmentIndex < equipmentCount)
            {
                EquipmentDef  equipmentDef   = EquipmentCatalog.GetEquipmentDef(equipmentIndex);
                RuleDef       ruleDef3       = RuleCatalog.FindRuleDef("Equipment." + equipmentDef.name);
                RuleChoiceDef ruleChoiceDef3 = (ruleDef3 != null) ? ruleDef3.FindChoice("On") : null;
                if (ruleChoiceDef3 != null)
                {
                    base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef3);
                }
                equipmentIndex++;
            }
        }
Пример #6
0
        private void ResolveChoiceMask()
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.PreGameController::ResolveChoiceMask()' called on client");
                return;
            }
            RuleChoiceMask ruleChoiceMask          = new RuleChoiceMask();
            RuleChoiceMask ruleChoiceMask2         = new RuleChoiceMask();
            Run            gameModePrefabComponent = GameModeCatalog.GetGameModePrefabComponent(this.gameModeIndex);

            if (gameModePrefabComponent)
            {
                gameModePrefabComponent.OverrideRuleChoices(ruleChoiceMask, ruleChoiceMask2);
            }
            for (int i = 0; i < this.choiceMaskBuffer.length; i++)
            {
                RuleChoiceDef choiceDef = RuleCatalog.GetChoiceDef(i);
                this.choiceMaskBuffer[i] = (ruleChoiceMask[i] || (!ruleChoiceMask2[i] && this.serverAvailableChoiceMask[i] && this.unlockedChoiceMask[i] && !choiceDef.excludeByDefault));
            }
            this.networkRuleChoiceMaskComponent.SetRuleChoiceMask(this.choiceMaskBuffer);
            this.EnforceValidRuleChoices();
        }
Пример #7
0
 // Token: 0x060009BA RID: 2490 RVA: 0x00030CED File Offset: 0x0002EEED
 public static void ReadRuleChoiceMask(this NetworkReader reader, RuleChoiceMask dest)
 {
     dest.Deserialize(reader);
 }
Пример #8
0
 // Token: 0x060009B9 RID: 2489 RVA: 0x00030CE4 File Offset: 0x0002EEE4
 public static void Write(this NetworkWriter writer, RuleChoiceMask src)
 {
     src.Serialize(writer);
 }
 // Token: 0x06000EF0 RID: 3824 RVA: 0x0004230B File Offset: 0x0004050B
 private void Awake()
 {
     this.ruleChoiceMask = new RuleChoiceMask();
 }