public static void RubyMatUpdate(CharacterBody self)
 {
     if (self && self.inventory)
     {
         EliteIndex equipmentEliteIndex = RoR2.EliteCatalog.GetEquipmentEliteIndex(self.inventory.GetEquipmentIndex());
         if (self && equipmentEliteIndex == EliteIndex.None && self.isElite)
         {
             int itemCount = self.inventory.GetItemCount(Assets.AffixOrangeItemIndex);
             if (itemCount > 0)
             {
                 equipmentEliteIndex = EliteAspectsChanges.AffixOrangeIndex;
             }
         }
         RoR2.CharacterModel characterModelFromCharacterBody = CloudUtils.GetCharacterModelFromCharacterBody(self);
         if (equipmentEliteIndex == EliteAspectsChanges.AffixOrangeIndex && !self.gameObject.GetComponent <DestroyEffectOnBuffEnd>() && characterModelFromCharacterBody)
         {
             DestroyEffectOnBuffEnd destroyEffectOnBuffEnd = self.gameObject.AddComponent <DestroyEffectOnBuffEnd>();
             destroyEffectOnBuffEnd.body = self;
             destroyEffectOnBuffEnd.buff = EliteAspectsChanges.AffixOrangeBuff;
             RoR2.TemporaryOverlay temporaryOverlay = characterModelFromCharacterBody.gameObject.AddComponent <RoR2.TemporaryOverlay>();
             temporaryOverlay.duration              = float.PositiveInfinity;
             temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
             temporaryOverlay.animateShaderAlpha    = true;
             temporaryOverlay.destroyComponentOnEnd = true;
             temporaryOverlay.originalMaterial      = Cloudburst.Cores.AssetsCore.mainAssetBundle.LoadAsset <Material>("Assets/Cloudburst/753network/Crystallize/Ruby.mat");
             temporaryOverlay.AddToCharacerModel(characterModelFromCharacterBody);
             destroyEffectOnBuffEnd.effect = temporaryOverlay;
         }
     }
 }
예제 #2
0
        public void CreateElite()
        {
            var eliteDef = new RoR2.EliteDef
            {
                name                = "Hypercharged",
                modifierToken       = "ARES_HYPERCHARGED",
                color               = Color.white,
                eliteEquipmentIndex = AffixEquipmentIndex
            };

            EliteIndex = EliteAPI.Add(new CustomElite(eliteDef, 2));
            LanguageAPI.Add(eliteDef.modifierToken, eliteDef.name + " {0}");

            EliteBuffDef.eliteIndex       = EliteIndex;
            EliteBuffIndex                = BuffAPI.Add(new CustomBuff(EliteBuffDef));
            AffixEquipmentDef.passiveBuff = EliteBuffIndex;

            EliteAffixCard = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };
            EsoLib.Cards.Add(EliteAffixCard);
        }
예제 #3
0
 // Token: 0x060021E2 RID: 8674 RVA: 0x000A0630 File Offset: 0x0009E830
 private static HUDBossHealthBarController.BossMemory GetBossMemory(CharacterMaster bossMaster)
 {
     if (!bossMaster)
     {
         return(null);
     }
     for (int i = 0; i < HUDBossHealthBarController.bossMemoryList.Count; i++)
     {
         if (HUDBossHealthBarController.bossMemoryList[i].master == bossMaster)
         {
             return(HUDBossHealthBarController.bossMemoryList[i]);
         }
     }
     HUDBossHealthBarController.BossMemory bossMemory = new HUDBossHealthBarController.BossMemory
     {
         master = bossMaster
     };
     HUDBossHealthBarController.bossMemoryList.Add(bossMemory);
     if (HUDBossHealthBarController.bossMemoryList.Count == 1)
     {
         HUDBossHealthBarController.bossNameString = Language.GetString(bossMaster.bodyPrefab.GetComponent <CharacterBody>().baseNameToken);
         string text = bossMaster.bodyPrefab.GetComponent <CharacterBody>().GetSubtitle();
         if (text.Length == 0)
         {
             text = Language.GetString("NULL_SUBTITLE");
         }
         HUDBossHealthBarController.bossSubtitleResolvedString = "<sprite name=\"CloudLeft\" tint=1> " + text + "<sprite name=\"CloudRight\" tint=1>";
         EliteIndex eliteIndex = EliteCatalog.IsEquipmentElite(bossMaster.inventory.currentEquipmentIndex);
         if (eliteIndex != EliteIndex.None)
         {
             HUDBossHealthBarController.bossNameString = EliteCatalog.GetEliteDef(eliteIndex).prefix + HUDBossHealthBarController.bossNameString;
         }
     }
     return(bossMemory);
 }
 // Token: 0x06000ADF RID: 2783 RVA: 0x00035AA5 File Offset: 0x00033CA5
 public static EliteDef GetEliteDef(EliteIndex eliteIndex)
 {
     if (eliteIndex < EliteIndex.Fire || eliteIndex >= EliteIndex.Count)
     {
         return(null);
     }
     return(EliteCatalog.eliteDefs[(int)eliteIndex]);
 }
예제 #5
0
        private static void CCSpawnAI(ConCommandArgs args)
        {
            string prefabString    = ArgsHelper.GetValue(args.userArgs, 0);
            string eliteString     = ArgsHelper.GetValue(args.userArgs, 1);
            string teamString      = ArgsHelper.GetValue(args.userArgs, 2);
            string braindeadString = ArgsHelper.GetValue(args.userArgs, 3);

            var character = Character.GetCharacter(prefabString);

            if (character == null)
            {
                Debug.LogFormat("Could not spawn {0}, Try: spawn_ai GolemBody", character.body);
                return;
            }

            var prefab = MasterCatalog.FindMasterPrefab(character.master);
            var body   = BodyCatalog.FindBodyPrefab(character.body);


            var             bodyGameObject = Instantiate <GameObject>(prefab, args.sender.master.GetBody().transform.position, Quaternion.identity);
            CharacterMaster master         = bodyGameObject.GetComponent <CharacterMaster>();

            NetworkServer.Spawn(bodyGameObject);
            master.SpawnBody(body, args.sender.master.GetBody().transform.position, Quaternion.identity);

            EliteIndex eliteIndex = EliteIndex.None;

            if (Enum.TryParse <EliteIndex>(eliteString, true, out eliteIndex))
            {
                if ((int)eliteIndex > (int)EliteIndex.None && (int)eliteIndex < (int)EliteIndex.Count)
                {
                    master.inventory.SetEquipmentIndex(EliteCatalog.GetEliteDef(eliteIndex).eliteEquipmentIndex);
                }
            }

            TeamIndex teamIndex = TeamIndex.Neutral;

            if (Enum.TryParse <TeamIndex>(teamString, true, out teamIndex))
            {
                if ((int)teamIndex >= (int)TeamIndex.None && (int)teamIndex < (int)TeamIndex.Count)
                {
                    master.teamIndex = teamIndex;
                }
            }

            bool braindead;

            if (bool.TryParse(braindeadString, out braindead))
            {
                if (braindead)
                {
                    Destroy(master.GetComponent <BaseAI>());
                }
            }
            Debug.Log("Attempting to spawn " + character.body);
        }
예제 #6
0
 // Token: 0x0600056D RID: 1389 RVA: 0x000160D8 File Offset: 0x000142D8
 private static void RegisterElite(EliteIndex eliteIndex, EliteDef eliteDef)
 {
     if (eliteIndex < EliteIndex.Count)
     {
         eliteDef.name = eliteIndex.ToString();
     }
     eliteDef.eliteIndex = eliteIndex;
     EliteCatalog.eliteList.Add(eliteIndex);
     EliteCatalog.eliteDefs[(int)eliteIndex] = eliteDef;
 }
예제 #7
0
        private static void CCNextBoss(ConCommandArgs args)
        {
            //Log.MessageNetworked("This feature is currently not working. We'll hopefully provide an update to this soon.", args);
            //return;
            Log.MessageNetworked(Lang.PARTIALIMPLEMENTATION_WARNING, args, LogLevel.MessageClientOnly);
            if (args.Count == 0)
            {
                Log.MessageNetworked(Lang.NEXTBOSS_ARGS, args);
            }
            StringBuilder s = new StringBuilder();

            if (args.Count >= 1)
            {
                try
                {
                    nextBoss = StringFinder.Instance.GetDirectorCardFromPartial(args[0]);
                    s.AppendLine($"Next boss is: {nextBoss.spawnCard.name}. ");
                    if (args.Count >= 2)
                    {
                        if (!int.TryParse(args[1], out nextBossCount))
                        {
                            Log.MessageNetworked(Lang.COUNTISNUMERIC, args, LogLevel.MessageClientOnly);
                            nextBossCount = 1;
                        }
                        else
                        {
                            if (nextBossCount > 6)
                            {
                                nextBossCount = 6;
                            }
                            else if (nextBossCount <= 0)
                            {
                                nextBossCount = 1;
                            }
                            s.Append($"Count:  {nextBossCount}. ");
                            if (args.Count >= 3)
                            {
                                nextBossElite = StringFinder.GetEnumFromPartial <EliteIndex>(args[2]);
                                s.Append("Elite: " + nextBossElite.ToString());
                            }
                        }
                    }
                    On.RoR2.CombatDirector.SetNextSpawnAsBoss += Hooks.CombatDirector_SetNextSpawnAsBoss;
                    Log.MessageNetworked(s.ToString(), args);
                }
                catch (Exception ex)
                {
                    Log.MessageNetworked(Lang.OBJECT_NOTFOUND + args[0], args, LogLevel.ErrorClientOnly);
                    Log.MessageNetworked(ex.ToString(), args, LogLevel.ErrorClientOnly);
                }
            }
        }
예제 #8
0
        public BarrierElitesManager()
        {
            var eliteDef = new EliteDef
            {
                modifierToken = BarrierElitesManager.EliteName,
                color         = new Color32(162, 179, 241, 255)
            };
            var equipDef = new EquipmentDef
            {
                cooldown         = 10f,
                pickupModelPath  = "",
                pickupIconPath   = HailstormAssets.IconBarrierElite,
                nameToken        = EquipName,
                pickupToken      = "Shield-Bearer",
                descriptionToken = "Shield-Bearer",
                canDrop          = false,
                enigmaCompatible = false
            };
            var buffDef = new BuffDef
            {
                buffColor = eliteDef.color,
                iconPath  = HailstormAssets.IconBarrierElite,
                canStack  = false
            };

            var equip = new CustomEquipment(equipDef, new ItemDisplayRule[0]);
            var buff  = new CustomBuff(BuffName, buffDef);
            var elite = new CustomElite(EliteName, eliteDef, equip, buff, 1);

            _eliteIndex = (EliteIndex)ItemAPI.AddCustomElite(elite);
            _buffIndex  = (BuffIndex)ItemAPI.AddCustomBuff(buff);
            _equipIndex = (EquipmentIndex)ItemAPI.AddCustomEquipment(equip);
            eliteDef.eliteEquipmentIndex = _equipIndex;
            equipDef.passiveBuff         = _buffIndex;
            buffDef.eliteIndex           = _eliteIndex;

            //Barrier elites are a bit more uncommon than regular tier 1 elites
            //They're also a bit tankier than usual, but not more damaging
            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 10.0f,
                damageBoostCoeff = 1.0f,
                healthBoostCoeff = 10.0f,
                eliteType        = _eliteIndex
            };

            //Register the card for spawning if ESO is enabled
            EsoLib.Cards.Add(card);
            Card = card;
        }
예제 #9
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 40;

            var buffDef = new BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/ApollosBrillianceMain.mat");
        }
예제 #10
0
 private static void CCNextBoss(ConCommandArgs args)
 {
     Log.Message(MagicVars.PARTIAL_IMPLEMENTATION);
     if (args.Count == 0)
     {
         Log.Message(MagicVars.NEXTBOSS_ARGS);
     }
     if (args.Count >= 1)
     {
         try
         {
             RoR2Cheats.nextBoss = Alias.Instance.GetDirectorCardFromPartial(args[0]);
             Log.Message($"Next boss is: {RoR2Cheats.nextBoss.spawnCard.name}");
             if (args.Count >= 2)
             {
                 if (!int.TryParse(args[1], out nextBossCount))
                 {
                     Log.Message(MagicVars.COUNTISNUMERIC);
                     return;
                 }
                 else
                 {
                     if (nextBossCount > 6)
                     {
                         nextBossCount = 6;
                     }
                     else if (nextBossCount <= 0)
                     {
                         nextBossCount = 1;
                     }
                     Log.Message("Count: " + nextBossCount);
                     if (args.Count >= 3)
                     {
                         nextBossElite = Alias.GetEnumFromPartial <EliteIndex>(args[2]);
                         Log.Message("Elite: " + nextBossElite.ToString());
                     }
                 }
             }
             nextBossSet = true;
         }
         catch (Exception ex)
         {
             Log.Message(MagicVars.OBJECT_NOTFOUND + args[0]);
             Log.Message(ex);
         }
     }
 }
예제 #11
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            if (KaliberWrath_Enable)
            {
                equipmentDef.canDrop          = true;
                equipmentDef.enigmaCompatible = false;

                var jammedEliteDef = new CustomElite(
                    new EliteDef
                {
                    name                = "Jammed",
                    modifierToken       = "ROB_ELITE_MODIFIER_JAMMED",
                    color               = new Color32(150, 10, 10, 255),
                    eliteEquipmentIndex = equipmentDef.equipmentIndex
                }, 1);
                JammedEliteIndex = EliteAPI.Add(jammedEliteDef);
                LanguageAPI.Add(jammedEliteDef.EliteDef.modifierToken, "Jammed {0}");

                var jammedBuffDef = new CustomBuff(
                    new BuffDef
                {
                    name       = "Affix_Jammed",
                    buffColor  = new Color32(150, 10, 10, 255),
                    iconPath   = "",
                    eliteIndex = JammedEliteIndex,
                    canStack   = false
                });
                JammedBuffIndex          = BuffAPI.Add(jammedBuffDef);
                equipmentDef.passiveBuff = JammedBuffIndex;

                JammedEliteCard = new EliteAffixCard
                {
                    spawnWeight      = 0.8f,
                    costMultiplier   = 15.0f,
                    damageBoostCoeff = 1.0f,
                    healthBoostCoeff = 4.0f,
                    eliteOnlyScaling = 0.5f,
                    eliteType        = JammedEliteIndex,
                };

                EsoLib.Cards.Add(JammedEliteCard);
            }
        }
예제 #12
0
        public static CombatDirector.EliteTierDef GetTierDef(EliteIndex index)
        {
            int tier = 0;

            CombatDirector.EliteTierDef[] tierdefs = typeof(CombatDirector).GetFieldValue <CombatDirector.EliteTierDef[]>("eliteTiers");
            if ((int)index > (int)EliteIndex.None && (int)index < (int)EliteIndex.Count)
            {
                for (int i = 0; i < tierdefs.Length; i++)
                {
                    for (int j = 0; j < tierdefs[i].eliteTypes.Length; j++)
                    {
                        if (tierdefs[i].eliteTypes[j] == (index))
                        {
                            tier = i;
                        }
                    }
                }
            }
            return(tierdefs[tier]);
        }
예제 #13
0
        internal static CombatDirector.EliteTierDef GetTierDef(EliteIndex index)
        {
            foreach (var eliteTier in CombatDirector.eliteTiers)
            {
                if (eliteTier != null)
                {
                    foreach (var eliteDef in eliteTier.eliteTypes)
                    {
                        if (eliteDef)
                        {
                            if (eliteDef.eliteIndex == index)
                            {
                                return(eliteTier);
                            }
                        }
                    }
                }
            }

            return(null);
        }
예제 #14
0
        public static bool Init()
        {
            On.RoR2.GlobalEventManager.ServerDamageDealt += GlobalEventManager_ServerDamageDealt;

            var equipDef = new EquipmentDef
            {
                name             = EquipName,
                cooldown         = 10f,
                pickupModelPath  = "",
                pickupIconPath   = "",
                nameToken        = EquipName,
                pickupToken      = "Pickup_Blightborne",
                descriptionToken = "Description_Blightborne",
                canDrop          = false,
                enigmaCompatible = false
            };

            var equip = new CustomEquipment(equipDef, new ItemDisplayRule[0]);

            var buffDef = new BuffDef
            {
                name      = BuffName,
                buffColor = new Color32(141, 51, 19, 255),
                iconPath  = "",
                canStack  = false
            };
            var buff = new CustomBuff(buffDef);

            var eliteDef = new EliteDef
            {
                name                = EliteName,
                modifierToken       = "ELITE_MODIFIER_BLIGHTBORNE",
                color               = buffDef.buffColor,
                eliteEquipmentIndex = _equipIndex
            };

            var elite = new CustomElite(eliteDef, 1);

            _eliteIndex = EliteAPI.Add(elite);
            _buffIndex  = BuffAPI.Add(buff);
            _equipIndex = ItemAPI.Add(equip);
            eliteDef.eliteEquipmentIndex = _equipIndex;
            equipDef.passiveBuff         = _buffIndex;
            buffDef.eliteIndex           = _eliteIndex;

            On.RoR2.CharacterBody.OnEquipmentLost   += CharacterBody_OnEquipmentLost;
            On.RoR2.CharacterBody.OnEquipmentGained += CharacterBody_OnEquipmentGained;
            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 16f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 8.0f,
                eliteOnlyScaling = 1f,
                eliteType        = _eliteIndex,
                onSpawned        = OnSpawned,
                isAvailable      = new Func <bool>(() => Run.instance.stageClearCount > 3 && Run.instance.selectedDifficulty != DifficultyIndex.Easy)
            };

            //Register the card for spawning if ESO is enabled
            EsoLib.Cards.Add(card);
            Card = card;

            //Description of elite in UI when boss
            LanguageAPI.Add(eliteDef.modifierToken, "Blightborne {0}");
            LanguageAPI.Add(equipDef.pickupToken, "Blight's Embrace");
            LanguageAPI.Add(equipDef.descriptionToken, "Become an aspect of Blight");

            return(true);
        }
예제 #15
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 60;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            //If we want to load a base game material, then we use this.

            /*GameObject worm = Resources.Load<GameObject>("Prefabs/characterbodies/ElectricWormBody");
             * Debug.Log($"WORM: {worm}");
             * var modelLocator = worm.GetComponent<ModelLocator>();
             * Debug.Log($"MODEL LOCATOR: {modelLocator}");
             * var model = modelLocator.modelTransform.GetComponent<CharacterModel>();
             * Debug.Log($"MODEL: {model}");
             * if (model)
             * {
             *  var rendererInfos = model.baseRendererInfos;
             *  foreach (CharacterModel.RendererInfo renderer in rendererInfos)
             *  {
             *      if (renderer.defaultMaterial.name == "matElectricWorm")
             *      {
             *          HyperchargedMaterial = renderer.defaultMaterial;
             *      }
             *  }
             * }*/

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/TheirReminder.mat");
        }
예제 #16
0
 // Token: 0x0600056F RID: 1391 RVA: 0x0001614D File Offset: 0x0001434D
 public static EliteDef GetEliteDef(EliteIndex eliteIndex)
 {
     return(HGArrayUtilities.GetSafe <EliteDef>(EliteCatalog.eliteDefs, (int)eliteIndex));
 }
예제 #17
0
        public static bool Init()
        {
            On.RoR2.GlobalEventManager.OnCharacterDeath += GlobalEventManager_OnCharacterDeath;

            var equipDef = new EquipmentDef
            {
                name             = EquipName,
                cooldown         = 10f,
                pickupModelPath  = "",
                pickupIconPath   = "",
                nameToken        = EquipName,
                pickupToken      = "Pickup_Tarborne",
                descriptionToken = "Description_Tarborne",
                canDrop          = false,
                enigmaCompatible = false
            };

            On.RoR2.CharacterBody.OnEquipmentLost   += CharacterBody_OnEquipmentLost;
            On.RoR2.CharacterBody.OnEquipmentGained += CharacterBody_OnEquipmentGained;
            var equip = new CustomEquipment(equipDef, new ItemDisplayRule[0]);

            var buffDef = new BuffDef
            {
                name      = BuffName,
                buffColor = new Color32(41, 41, 41, 255),
                iconPath  = "",
                canStack  = false
            };
            var buff = new CustomBuff(buffDef);

            var eliteDef = new EliteDef
            {
                name                = EliteName,
                modifierToken       = "ELITE_MODIFIER_TARBORNE",
                color               = buffDef.buffColor,
                eliteEquipmentIndex = _equipIndex
            };

            var elite = new CustomElite(eliteDef, 1);

            _eliteIndex = EliteAPI.Add(elite);
            _buffIndex  = BuffAPI.Add(buff);
            _equipIndex = ItemAPI.Add(equip);
            eliteDef.eliteEquipmentIndex = _equipIndex;
            equipDef.passiveBuff         = _buffIndex;
            buffDef.eliteIndex           = _eliteIndex;


            var card = new EliteAffixCard
            {
                spawnWeight      = 1f,
                costMultiplier   = 6f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.0f,
                eliteOnlyScaling = 1f,
                eliteType        = _eliteIndex,
                onSpawned        = OnSpawned,
                isAvailable      = new Func <bool>(() => true)
            };

            //Register the card for spawning if ESO is enabled
            EsoLib.Cards.Add(card);
            Card = card;

            //Description of elite in UI when boss
            LanguageAPI.Add(eliteDef.modifierToken, "Tarborne {0}");
            LanguageAPI.Add(equipDef.pickupToken, "Dunestrider's Dominion");
            LanguageAPI.Add(equipDef.descriptionToken, "Become an aspect of Tar");

            return(true);
        }
예제 #18
0
        public DarkElitesManager()
        {
            _rng = new Xoroshiro128Plus((ulong)DateTime.Now.Ticks);

            var eliteDef = new EliteDef
            {
                modifierToken = EliteName,
                color         = new Color32(0, 0, 0, 255),
            };
            var equipDef = new EquipmentDef
            {
                cooldown         = 10f,
                pickupModelPath  = "",
                pickupIconPath   = HailstormAssets.IconDarkElite,
                nameToken        = EquipName,
                pickupToken      = "Darkness",
                descriptionToken = "Night-bringer",
                canDrop          = false,
                enigmaCompatible = false
            };
            var buffDef = new BuffDef
            {
                buffColor = new Color32(255, 255, 255, 255),
                iconPath  = HailstormAssets.IconDarkElite,
                canStack  = false
            };

            var equip = new CustomEquipment(equipDef, new ItemDisplayRule[0]);
            var buff  = new CustomBuff(BuffName, buffDef);
            var elite = new CustomElite(EliteName, eliteDef, equip, buff, 1);

            _eliteIndex = (EliteIndex)ItemAPI.AddCustomElite(elite);
            _buffIndex  = (BuffIndex)ItemAPI.AddCustomBuff(buff);
            _equipIndex = (EquipmentIndex)ItemAPI.AddCustomEquipment(equip);
            eliteDef.eliteEquipmentIndex = _equipIndex;
            equipDef.passiveBuff         = _buffIndex;
            buffDef.eliteIndex           = _eliteIndex;

            //When the camera starts up, hook in our darkness effect
            On.RoR2.CameraRigController.Start += CameraRigControllerOnStart;

            //Update elite materials
            On.RoR2.CharacterModel.InstanceUpdate += CharacterModelOnInstanceUpdate;

            //Dark elites spawn much less frequently, but are only slightly stronger/costlier than tier 1s
            var card = new EliteAffixCard
            {
                spawnWeight      = 0.3f,
                costMultiplier   = 10.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 6.0f,
                eliteType        = _eliteIndex
            };

            //Register the card for spawning if ESO is enabled
            EsoLib.Cards.Add(card);
            Card = card;

            //Create random walk trackers for dark elite material texture animation
            _walkerU = new AnimatedFloat
            {
                Accel    = 0.3f,
                MaxSpeed = 0.6f
            };
            _walkerV = new AnimatedFloat
            {
                Accel    = 0.3f,
                MaxSpeed = 0.6f
            };

            //Whenever scene changes, stop the breathing sound
            SceneManager.sceneUnloaded += s => AkSoundEngine.PostEvent(SoundEvents.StopLargeBreathing, null);
        }
예제 #19
0
        private static Boolean ShouldInheritEquipment(EquipmentIndex index)
        {
            EliteIndex eliteInd = EliteCatalog.GetEquipmentEliteIndex(index);

            return(eliteInd != EliteIndex.None);
        }
예제 #20
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 60;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            //If we want to load a base game material, then we use this.

            /*GameObject worm = Resources.Load<GameObject>("Prefabs/characterbodies/ElectricWormBody");
             * Debug.Log($"WORM: {worm}");
             * var modelLocator = worm.GetComponent<ModelLocator>();
             * Debug.Log($"MODEL LOCATOR: {modelLocator}");
             * var model = modelLocator.modelTransform.GetComponent<CharacterModel>();
             * Debug.Log($"MODEL: {model}");
             * if (model)
             * {
             *  var rendererInfos = model.baseRendererInfos;
             *  foreach (CharacterModel.RendererInfo renderer in rendererInfos)
             *  {
             *      if (renderer.defaultMaterial.name == "matElectricWorm")
             *      {
             *          HyperchargedMaterial = renderer.defaultMaterial;
             *      }
             *  }
             * }*/

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/TheirReminder.mat");

            HyperchargedProjectile = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/LightningStake"), "HyperchargedProjectile", true);

            var controller = HyperchargedProjectile.GetComponent <ProjectileController>();

            controller.startSound = "Play_titanboss_shift_shoot";

            var impactExplosion = HyperchargedProjectile.GetComponent <RoR2.Projectile.ProjectileImpactExplosion>();

            impactExplosion.lifetime        = 0.5f;
            impactExplosion.impactEffect    = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/LightningStrikeImpact");
            impactExplosion.blastRadius     = 7f;
            impactExplosion.bonusBlastForce = new Vector3(0, 750, 0);

            // register it for networking
            if (HyperchargedProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(HyperchargedProjectile);
            }

            // add it to the projectile catalog or it won't work in multiplayer
            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(HyperchargedProjectile);
            };
        }
예제 #21
0
        // Token: 0x06000D25 RID: 3365 RVA: 0x000412A8 File Offset: 0x0003F4A8
        private void UpdateOverlays()
        {
            for (int i = 0; i < this.overlaysCount; i++)
            {
                this.currentOverlays[i] = null;
            }
            this.overlaysCount = 0;
            if (this.visibility == VisibilityLevel.Invisible)
            {
                return;
            }
            EliteIndex eliteIndex = EliteCatalog.IsEquipmentElite(this.inventoryEquipmentIndex);

            this.myEliteIndex = (int)eliteIndex;
            if (this.myEliteIndex >= 0)
            {
                if (this.body)
                {
                    AkSoundEngine.SetRTPCValue("eliteEnemy", 1f, this.body.gameObject);
                }
            }
            else if (this.body)
            {
                AkSoundEngine.SetRTPCValue("eliteEnemy", 0f, this.body.gameObject);
            }
            if (this.body)
            {
                bool      flag      = this.body.HasBuff(BuffIndex.ClayGoo);
                Inventory inventory = this.body.inventory;
                this.isGhost = (inventory != null && inventory.GetItemCount(ItemIndex.Ghost) > 0);
                if (this.body.HasBuff(BuffIndex.RepairMode))
                {
                    Material[] array = this.currentOverlays;
                    int        j     = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array[j]           = CharacterModel.repairModeMaterial;
                }
                if (this.body.HasBuff(BuffIndex.AttackSpeedOnCrit))
                {
                    Material[] array2 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array2[j]          = CharacterModel.wolfhatMaterial;
                }
                if (this.body.healthComponent && this.body.healthComponent.shield > 0f)
                {
                    Material[] array3 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array3[j]          = CharacterModel.energyShieldMaterial;
                }
                if (this.body.HasBuff(BuffIndex.FullCrit))
                {
                    Material[] array4 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array4[j]          = CharacterModel.fullCritMaterial;
                }
                if (this.body.HasBuff(BuffIndex.BeetleJuice))
                {
                    Material[] array5 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array5[j]          = CharacterModel.beetleJuiceMaterial;
                }
                if (this.body.HasBuff(BuffIndex.Immune))
                {
                    Material[] array6 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array6[j]          = CharacterModel.immuneMaterial;
                }
                if (this.body.HasBuff(BuffIndex.Slow80))
                {
                    Material[] array7 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array7[j]          = CharacterModel.slow80Material;
                }
                if (this.body.HasBuff(BuffIndex.Invincibility))
                {
                    Material[] array8 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array8[j]          = CharacterModel.bellBuffMaterial;
                }
                if (flag)
                {
                    Material[] array9 = this.currentOverlays;
                    int        j      = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array9[j]          = CharacterModel.clayGooMaterial;
                }
                if (this.body.inventory && this.body.inventory.GetItemCount(ItemIndex.LunarDagger) > 0)
                {
                    Material[] array10 = this.currentOverlays;
                    int        j       = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array10[j]         = CharacterModel.brittleMaterial;
                }
                if (this.isGhost)
                {
                    Material[] array11 = this.currentOverlays;
                    int        j       = this.overlaysCount;
                    this.overlaysCount = j + 1;
                    array11[j]         = CharacterModel.ghostMaterial;
                }
                if (this.body.equipmentSlot)
                {
                    if (this.body.equipmentSlot.equipmentIndex == EquipmentIndex.AffixGold)
                    {
                        if (!this.goldAffixEffect)
                        {
                            this.goldAffixEffect = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/GoldAffixEffect"), base.transform);
                            ParticleSystem      component           = this.goldAffixEffect.GetComponent <ParticleSystem>();
                            SkinnedMeshRenderer skinnedMeshRenderer = null;
                            foreach (CharacterModel.RendererInfo rendererInfo in this.rendererInfos)
                            {
                                if (rendererInfo.renderer is SkinnedMeshRenderer)
                                {
                                    skinnedMeshRenderer = (SkinnedMeshRenderer)rendererInfo.renderer;
                                    break;
                                }
                            }
                            ParticleSystem.ShapeModule shape = component.shape;
                            if (skinnedMeshRenderer)
                            {
                                shape.shapeType           = ParticleSystemShapeType.SkinnedMeshRenderer;
                                shape.skinnedMeshRenderer = skinnedMeshRenderer;
                            }
                        }
                    }
                    else if (this.goldAffixEffect)
                    {
                        UnityEngine.Object.Destroy(this.goldAffixEffect);
                    }
                }
                if (this.wasPreviouslyClayGooed && !flag)
                {
                    TemporaryOverlay temporaryOverlay = base.gameObject.AddComponent <TemporaryOverlay>();
                    temporaryOverlay.duration              = 0.6f;
                    temporaryOverlay.animateShaderAlpha    = true;
                    temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                    temporaryOverlay.destroyComponentOnEnd = true;
                    temporaryOverlay.originalMaterial      = CharacterModel.clayGooMaterial;
                    temporaryOverlay.AddToCharacerModel(this);
                }
                this.wasPreviouslyClayGooed = this.body.HasBuff(BuffIndex.ClayGoo);
            }
            for (int k = 0; k < this.temporaryOverlays.Count; k++)
            {
                Material[] array13 = this.currentOverlays;
                int        j       = this.overlaysCount;
                this.overlaysCount = j + 1;
                array13[j]         = this.temporaryOverlays[k].materialInstance;
            }
            this.materialsDirty = true;
        }
 // Token: 0x06000ADD RID: 2781 RVA: 0x00035A46 File Offset: 0x00033C46
 private static void RegisterElite(EliteIndex eliteIndex, EliteDef eliteDef)
 {
     eliteDef.eliteIndex = eliteIndex;
     EliteCatalog.eliteList.Add(eliteIndex);
     EliteCatalog.eliteDefs[(int)eliteIndex] = eliteDef;
 }
예제 #23
0
 public static extern EliteDef GetEliteDef(EliteIndex eliteIndex);
예제 #24
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab          = Resources.Load <GameObject>("@Aetherium:Assets/Models/Prefabs/HisVengeanceDisplay.prefab");
                SecondaryItemBodyModelPrefab = Resources.Load <GameObject>("@Aetherium:Assets/Models/Prefabs/HisVengeanceCluster.prefab");
                displayRules = GenerateItemDisplayRules();
            }
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 15.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 2.0f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/HisVengeanceBody.mat");

            SplinteringProjectile = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/ImpVoidspikeProjectile"), "SplinteringProjectile", true);

            var model = Resources.Load <GameObject>("@Aetherium:Assets/Models/Prefabs/HisVengeanceProjectile.prefab");

            model.AddComponent <NetworkIdentity>();
            var ghost = model.AddComponent <RoR2.Projectile.ProjectileGhostController>();

            var controller = SplinteringProjectile.GetComponent <RoR2.Projectile.ProjectileController>();

            controller.procCoefficient = 0.25f;
            controller.ghostPrefab     = model;

            var damage = SplinteringProjectile.GetComponent <RoR2.Projectile.ProjectileDamage>();

            damage.damageType = DamageType.Generic;

            var impactExplosion = SplinteringProjectile.GetComponent <ProjectileImpactExplosion>();

            impactExplosion.impactEffect = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ImpactCrowbar");

            var stickOnImpact = SplinteringProjectile.GetComponent <RoR2.Projectile.ProjectileStickOnImpact>();

            stickOnImpact.stickSoundString = "Play_bellBody_attackLand";

            if (SplinteringProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(SplinteringProjectile);
            }

            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(SplinteringProjectile);
            };
        }
예제 #25
0
 public static void ResetNextBoss()
 {
     RoR2Cheats.nextBossSet   = false;
     RoR2Cheats.nextBossCount = 1;
     RoR2Cheats.nextBossElite = EliteIndex.None;
 }
예제 #26
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 40;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            RadiantProjectile = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/Thermite"), "RadiantProjectile", true);

            var damage = RadiantProjectile.GetComponent <RoR2.Projectile.ProjectileDamage>();

            damage.damageType = DamageType.IgniteOnHit;

            var simpleProjectile = RadiantProjectile.GetComponent <ProjectileSimple>();

            simpleProjectile.velocity           = 100;
            simpleProjectile.oscillateMagnitude = 0;

            if (RadiantProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(RadiantProjectile);
            }

            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(RadiantProjectile);
            };

            //If we want to load a base game material, then we use this.

            /*GameObject worm = Resources.Load<GameObject>("Prefabs/characterbodies/ElectricWormBody");
             * Debug.Log($"WORM: {worm}");
             * var modelLocator = worm.GetComponent<ModelLocator>();
             * Debug.Log($"MODEL LOCATOR: {modelLocator}");
             * var model = modelLocator.modelTransform.GetComponent<CharacterModel>();
             * Debug.Log($"MODEL: {model}");
             * if (model)
             * {
             *  var rendererInfos = model.baseRendererInfos;
             *  foreach (CharacterModel.RendererInfo renderer in rendererInfos)
             *  {
             *      if (renderer.defaultMaterial.name == "matElectricWorm")
             *      {
             *          HyperchargedMaterial = renderer.defaultMaterial;
             *      }
             *  }
             * }*/

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/ApollosBrillianceMain.mat");
            //Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/hgstandard");
        }
예제 #27
0
        private static void CCSpawnAI(ConCommandArgs args)
        {
            GameObject prefab;
            GameObject body;
            GameObject gameObject = null;

            string prefabString    = ArgsHelper.GetValue(args.userArgs, 0);
            string eliteString     = ArgsHelper.GetValue(args.userArgs, 1);
            string teamString      = ArgsHelper.GetValue(args.userArgs, 2);
            string braindeadString = ArgsHelper.GetValue(args.userArgs, 3);

            string bodyString   = GetBodyMasterLink(prefabString, 0); //prefabString.Replace("Master", "");
            string masterString = GetBodyMasterLink(prefabString, 1); //prefabString.Replace("Body", "");

            prefab = MasterCatalog.FindMasterPrefab(masterString);
            body   = BodyCatalog.FindBodyPrefab(bodyString);
            if (prefab == null)
            {
                List <string> array = new List <string>();
                foreach (var item in MasterCatalog.allMasters)
                {
                    array.Add(item.name);
                }
                string list = string.Join("\n", array);
                Debug.LogFormat("Could not spawn {0}, Try: spawn_ai GolemBody   --- \n{1}", prefabString, list);
                return;
            }

            gameObject = Instantiate <GameObject>(prefab, args.sender.master.GetBody().transform.position, Quaternion.identity);
            CharacterMaster master = gameObject.GetComponent <CharacterMaster>();

            NetworkServer.Spawn(gameObject);
            master.SpawnBody(body, args.sender.master.GetBody().transform.position, Quaternion.identity);

            EliteIndex eliteIndex = EliteIndex.None;

            if (Enum.TryParse <EliteIndex>(eliteString, true, out eliteIndex))
            {
                if ((int)eliteIndex > (int)EliteIndex.None && (int)eliteIndex < (int)EliteIndex.Count)
                {
                    master.inventory.SetEquipmentIndex(EliteCatalog.GetEliteDef(eliteIndex).eliteEquipmentIndex);
                }
            }

            TeamIndex teamIndex = TeamIndex.Neutral;

            if (Enum.TryParse <TeamIndex>(teamString, true, out teamIndex))
            {
                if ((int)teamIndex >= (int)TeamIndex.None && (int)teamIndex < (int)TeamIndex.Count)
                {
                    master.teamIndex = teamIndex;
                }
            }

            bool braindead;

            if (bool.TryParse(braindeadString, out braindead))
            {
                if (braindead)
                {
                    Destroy(master.GetComponent <BaseAI>());
                }
            }
            Debug.Log("Attempting to spawn " + prefabString);
        }
        // Token: 0x06000934 RID: 2356 RVA: 0x00027E88 File Offset: 0x00026088
        private bool AttemptSpawnOnTarget(GameObject spawnTarget)
        {
            if (this.currentMonsterCard == null)
            {
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.Log("Current monster card is null, pick new one.");
                }
                this.PrepareNewMonsterWave(this.monsterCards.Evaluate(this.rng.nextNormalizedFloat));
            }
            if (!spawnTarget)
            {
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.LogFormat("Spawn target {0} is invalid.", new object[]
                    {
                        spawnTarget
                    });
                }
                return(false);
            }
            if (this.spawnCountInCurrentWave >= this.maximumNumberToSpawnBeforeSkipping)
            {
                this.spawnCountInCurrentWave = 0;
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.LogFormat("Spawn count has hit the max ({0}/{1}). Aborting spawn.", new object[]
                    {
                        this.spawnCountInCurrentWave,
                        this.maximumNumberToSpawnBeforeSkipping
                    });
                }
                return(false);
            }
            int cost = this.currentMonsterCard.cost;
            int num  = this.currentMonsterCard.cost;
            int num2 = this.currentMonsterCard.cost;

            CombatDirector.EliteTierDef eliteTierDef = this.currentActiveEliteTier;
            EliteIndex eliteIndex = this.currentActiveEliteIndex;

            num2 = (int)((float)num * this.currentActiveEliteTier.costMultiplier);
            if ((float)num2 <= this.monsterCredit)
            {
                num          = num2;
                eliteTierDef = this.currentActiveEliteTier;
                eliteIndex   = this.currentActiveEliteIndex;
            }
            else
            {
                eliteTierDef = CombatDirector.eliteTiers[0];
                eliteIndex   = EliteIndex.None;
            }
            if (!this.currentMonsterCard.CardIsValid())
            {
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.LogFormat("Spawn card {0} is invalid, aborting spawn.", new object[]
                    {
                        this.currentMonsterCard.spawnCard
                    });
                }
                return(false);
            }
            if (this.monsterCredit < (float)num)
            {
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.LogFormat("Spawn card {0} is too expensive, aborting spawn.", new object[]
                    {
                        this.currentMonsterCard.spawnCard
                    });
                }
                return(false);
            }
            if (this.skipSpawnIfTooCheap && (float)(num2 * this.maximumNumberToSpawnBeforeSkipping) < this.monsterCredit)
            {
                if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                {
                    Debug.LogFormat("Card {0} seems too cheap ({1}/{2}). Comparing against most expensive possible ({3})", new object[]
                    {
                        this.currentMonsterCard.spawnCard,
                        num * this.maximumNumberToSpawnBeforeSkipping,
                        this.monsterCredit,
                        this.mostExpensiveMonsterCostInDeck
                    });
                }
                if (this.mostExpensiveMonsterCostInDeck > num)
                {
                    if (CombatDirector.cvDirectorCombatEnableInternalLogs.value)
                    {
                        Debug.LogFormat("Spawn card {0} is too cheap, aborting spawn.", new object[]
                        {
                            this.currentMonsterCard.spawnCard
                        });
                    }
                    return(false);
                }
            }
            SpawnCard             spawnCard             = this.currentMonsterCard.spawnCard;
            DirectorPlacementRule directorPlacementRule = new DirectorPlacementRule
            {
                placementMode   = DirectorPlacementRule.PlacementMode.Approximate,
                spawnOnTarget   = spawnTarget.transform,
                preventOverhead = this.currentMonsterCard.preventOverhead
            };

            DirectorCore.GetMonsterSpawnDistance(this.currentMonsterCard.spawnDistance, out directorPlacementRule.minDistance, out directorPlacementRule.maxDistance);
            directorPlacementRule.minDistance *= this.spawnDistanceMultiplier;
            directorPlacementRule.maxDistance *= this.spawnDistanceMultiplier;
            DirectorSpawnRequest directorSpawnRequest = new DirectorSpawnRequest(spawnCard, directorPlacementRule, this.rng);

            directorSpawnRequest.ignoreTeamMemberLimit = true;
            directorSpawnRequest.teamIndexOverride     = new TeamIndex?(TeamIndex.Monster);
            GameObject gameObject = DirectorCore.instance.TrySpawnObject(directorSpawnRequest);

            if (!gameObject)
            {
                Debug.LogFormat("Spawn card {0} failed to spawn. Aborting cost procedures.", new object[]
                {
                    spawnCard
                });
                return(false);
            }
            this.monsterCredit -= (float)num;
            this.spawnCountInCurrentWave++;
            CharacterMaster component  = gameObject.GetComponent <CharacterMaster>();
            GameObject      bodyObject = component.GetBodyObject();

            if (this.combatSquad)
            {
                this.combatSquad.AddMember(component);
            }
            float          num3 = eliteTierDef.healthBoostCoefficient;
            float          damageBoostCoefficient = eliteTierDef.damageBoostCoefficient;
            EliteDef       eliteDef       = EliteCatalog.GetEliteDef(eliteIndex);
            EquipmentIndex equipmentIndex = (eliteDef != null) ? eliteDef.eliteEquipmentIndex : EquipmentIndex.None;

            if (equipmentIndex != EquipmentIndex.None)
            {
                component.inventory.SetEquipmentIndex(equipmentIndex);
            }
            if (this.combatSquad)
            {
                int livingPlayerCount = Run.instance.livingPlayerCount;
                num3 *= Mathf.Pow((float)livingPlayerCount, 1f);
            }
            component.inventory.GiveItem(ItemIndex.BoostHp, Mathf.RoundToInt((num3 - 1f) * 10f));
            component.inventory.GiveItem(ItemIndex.BoostDamage, Mathf.RoundToInt((damageBoostCoefficient - 1f) * 10f));
            DeathRewards component2 = bodyObject.GetComponent <DeathRewards>();

            if (component2)
            {
                component2.expReward  = (uint)((float)num * this.expRewardCoefficient * Run.instance.compensatedDifficultyCoefficient);
                component2.goldReward = (uint)((float)num * this.expRewardCoefficient * 2f * Run.instance.compensatedDifficultyCoefficient);
            }
            if (this.spawnEffectPrefab && NetworkServer.active)
            {
                Vector3       origin     = gameObject.transform.position;
                CharacterBody component3 = bodyObject.GetComponent <CharacterBody>();
                if (component3)
                {
                    origin = component3.corePosition;
                }
                EffectManager.SpawnEffect(this.spawnEffectPrefab, new EffectData
                {
                    origin = origin
                }, true);
            }
            CombatDirector.OnSpawnedServer onSpawnedServer = this.onSpawnedServer;
            if (onSpawnedServer != null)
            {
                onSpawnedServer.Invoke(gameObject);
            }
            return(true);
        }