private IEnumerator Jump(Vector2 direction)
        {
            m_isJumping = true;
            if (player.CurrentFireMeterValue > 0f)
            {
                player.CurrentFireMeterValue = Mathf.Max(0f, player.CurrentFireMeterValue -= 0.5f);
                if (player.CurrentFireMeterValue == 0f)
                {
                    player.IsOnFire = false;
                }
            }
            Func <bool, bool> noFallsForYou = ((bool b) => false);
            AnimationCurve    jumpCurve     = new AnimationCurve(new Keyframe[] { new Keyframe {
                                                                                      time = 0, value = 6f
                                                                                  }, new Keyframe {
                                                                                      time = (0.5f * player.rollStats.GetModifiedTime(player)), value = 0f
                                                                                  }, new Keyframe {
                                                                                      time =
                                                                                          player.rollStats.GetModifiedTime(player), value = -6f
                                                                                  } });

            player.SetInputOverride("king slime's jump");
            player.ToggleGunRenderers(false, "king slime's jump");
            player.ToggleHandRenderers(false, "king slime's jump");
            player.OnAboutToFall += noFallsForYou;
            player.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.Projectile));
            player.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyHitBox));
            player.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyCollider));
            float ela = 0f;

            while (ela < (player.rollStats.GetModifiedTime(player)))
            {
                ela = BraveTime.DeltaTime + ela;
                player.sprite.transform.position = new Vector2(player.sprite.transform.position.x, Mathf.Max(player.sprite.transform.position.y + (jumpCurve.Evaluate(ela) * BraveTime.DeltaTime), player.ShadowObject.GetAnyComponent <tk2dBaseSprite>().WorldCenter.y));
                float time  = Mathf.Clamp01((ela - BraveTime.DeltaTime) / player.rollStats.GetModifiedTime(player));
                float time2 = Mathf.Clamp01(ela / player.rollStats.GetModifiedTime(player));
                float num   = (Mathf.Clamp01(player.rollStats.speed.Evaluate(time2)) - Mathf.Clamp01(player.rollStats.speed.Evaluate(time))) * player.rollStats.GetModifiedDistance(player);
                player.specRigidbody.Velocity = direction.normalized * (num / BraveTime.DeltaTime) + player.knockbackComponent + player.immutableKnockbackComponent;
                yield return(null);
            }
            player.specRigidbody.Velocity = Vector2.zero;
            player.specRigidbody.RemoveCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.Projectile));
            player.specRigidbody.RemoveCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyHitBox));
            player.specRigidbody.RemoveCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyCollider));
            player.OnAboutToFall -= noFallsForYou;
            player.ToggleGunRenderers(true, "king slime's jump");
            player.ToggleHandRenderers(true, "king slime's jump");
            player.ClearInputOverride("king slime's jump");
            Exploder.DoRadialPush(player.sprite.WorldBottomCenter.ToVector3ZUp(player.sprite.WorldBottomCenter.y), 22f, 1.5f);
            Exploder.DoRadialKnockback(player.sprite.WorldBottomCenter.ToVector3ZUp(player.sprite.WorldBottomCenter.y), 100f, 1.5f);
            Exploder.DoRadialDamage(5f * player.stats.GetStatValue(PlayerStats.StatType.DodgeRollDamage), player.sprite.WorldBottomCenter.ToVector3ZUp(player.sprite.WorldBottomCenter.y), 1.5f, false, true, false, null);
            GameObject gameObject = SpawnManager.SpawnVFX(BraveResources.Load <GameObject>("Global VFX/VFX_DBZ_Charge", ".prefab"), false);

            gameObject.transform.position = player.specRigidbody.UnitCenter;
            tk2dBaseSprite component = gameObject.GetComponent <tk2dBaseSprite>();

            component.HeightOffGround = -1f;
            component.UpdateZDepth();
            m_isJumping = false;
            yield break;
        }
Exemplo n.º 2
0
        private IEnumerator HandleExplosion(Vector3 position, ExplosionData data, Vector2 sourceNormal, Action onExplosionBegin, bool ignoreQueues, CoreDamageTypes damageTypes, bool ignoreDamageCaps)
        {
            if (data.usesComprehensiveDelay)
            {
                yield return(new WaitForSeconds(data.comprehensiveDelay));
            }
            Exploder.OnExplosionTriggered?.Invoke();
            bool addFireGoop       = (damageTypes | CoreDamageTypes.Fire) == damageTypes;
            bool addFreezeGoop     = (damageTypes | CoreDamageTypes.Ice) == damageTypes;
            bool addPoisonGoop     = (damageTypes | CoreDamageTypes.Poison) == damageTypes;
            bool isFreezeExplosion = data.isFreezeExplosion;

            if (!data.isFreezeExplosion && addFreezeGoop)
            {
                isFreezeExplosion = true;
                data.freezeRadius = data.damageRadius;
                data.freezeEffect = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultFreezeExplosionEffect;
            }
            // Be sure to use a clone of ExplosionManager for this else explosion queueing breaks! //
            // (it won't let you use ExplosionManager's original code on a new Exploder class normally. ;) - [Apache Thunder] //
            if (!ignoreQueues)
            {
                ChaosExplosionManager.Instance.Queue(this);
                while (!ChaosExplosionManager.Instance.IsExploderReady(this))
                {
                    yield return(null);
                }
                ChaosExplosionManager.Instance.Dequeue();
                if (ChaosExplosionManager.Instance.QueueCount == 0)
                {
                    ChaosExplosionManager.Instance.StartCoroutine(HandleCurrentExplosionNotification(0.5f));
                }
            }
            onExplosionBegin?.Invoke();
            float damageRadius            = data.GetDefinedDamageRadius();
            float pushSqrRadius           = data.pushRadius * data.pushRadius;
            float bulletDeletionSqrRadius = damageRadius * damageRadius;

            if (addFreezeGoop)
            {
                DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultFreezeGoop).TimedAddGoopCircle(position.XY(), damageRadius, 0.5f, false);
                DeadlyDeadlyGoopManager.FreezeGoopsCircle(position.XY(), damageRadius);
            }
            if (addFireGoop)
            {
                DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultFireGoop).TimedAddGoopCircle(position.XY(), damageRadius, 0.5f, false);
            }
            if (addPoisonGoop)
            {
                DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPoisonGoop).TimedAddGoopCircle(position.XY(), damageRadius, 0.5f, false);
            }
            if (!isFreezeExplosion)
            {
                DeadlyDeadlyGoopManager.IgniteGoopsCircle(position.XY(), damageRadius);
            }
            if (data.effect)
            {
                GameObject gameObject;
                if (data.effect.GetComponent <ParticleSystem>() != null || data.effect.GetComponentInChildren <ParticleSystem>() != null)
                {
                    gameObject = SpawnManager.SpawnVFX(data.effect, position, Quaternion.identity);
                }
                else
                {
                    gameObject = SpawnManager.SpawnVFX(data.effect, position, Quaternion.identity);
                }
                if (data.rotateEffectToNormal && gameObject)
                {
                    gameObject.transform.rotation = Quaternion.Euler(0f, 0f, sourceNormal.ToAngle());
                }
                tk2dBaseSprite component = gameObject.GetComponent <tk2dBaseSprite>();
                if (component)
                {
                    component.HeightOffGround += UnityEngine.Random.Range(-0.1f, 0.2f);
                    component.UpdateZDepth();
                }
                ExplosionDebrisLauncher[] componentsInChildren = gameObject.GetComponentsInChildren <ExplosionDebrisLauncher>();
                Vector3    position2   = gameObject.transform.position.WithZ(gameObject.transform.position.y);
                GameObject gameObject2 = new GameObject("SoundSource");
                gameObject2.transform.position = position2;
                if (data.playDefaultSFX)
                {
                    AkSoundEngine.PostEvent("Play_WPN_grenade_blast_01", gameObject2);
                }
                Destroy(gameObject2, 5f);
                for (int i = 0; i < componentsInChildren.Length; i++)
                {
                    if (componentsInChildren[i])
                    {
                        if (sourceNormal == Vector2.zero)
                        {
                            componentsInChildren[i].Launch();
                        }
                        else
                        {
                            componentsInChildren[i].Launch(sourceNormal);
                        }
                    }
                }
                if (gameObject)
                {
                    Transform transform = gameObject.transform.Find("scorch");
                    if (transform)
                    {
                        transform.gameObject.SetLayerRecursively(LayerMask.NameToLayer("BG_Critical"));
                    }
                }
                if (data.doExplosionRing)
                {
                }
            }
            yield return(new WaitForSeconds(data.explosionDelay));

            List <HealthHaver> allHealth = StaticReferenceManager.AllHealthHavers;

            if (allHealth != null && (data.doDamage || data.doForce))
            {
                for (int j = 0; j < allHealth.Count; j++)
                {
                    HealthHaver healthHaver = allHealth[j];
                    if (healthHaver)
                    {
                        if (healthHaver && healthHaver.aiActor)
                        {
                            if (!healthHaver.aiActor.HasBeenEngaged)
                            {
                                goto IL_A82;
                            }
                            if (healthHaver.aiActor.CompanionOwner && data.damageToPlayer == 0f)
                            {
                                goto IL_A82;
                            }
                        }
                        if (!data.ignoreList.Contains(healthHaver.specRigidbody))
                        {
                            if (position.GetAbsoluteRoom() == allHealth[j].transform.position.GetAbsoluteRoom())
                            {
                                for (int k = 0; k < healthHaver.NumBodyRigidbodies; k++)
                                {
                                    SpeculativeRigidbody bodyRigidbody    = healthHaver.GetBodyRigidbody(k);
                                    PlayerController     playerController = (!bodyRigidbody) ? null : (bodyRigidbody.gameActor as PlayerController);
                                    Vector2 a      = healthHaver.transform.position.XY();
                                    Vector2 vector = a - position.XY();
                                    bool    flag   = false;
                                    float   num;
                                    if (bodyRigidbody.HitboxPixelCollider != null)
                                    {
                                        a      = bodyRigidbody.HitboxPixelCollider.UnitCenter;
                                        vector = a - position.XY();
                                        num    = BraveMathCollege.DistToRectangle(position.XY(), bodyRigidbody.HitboxPixelCollider.UnitBottomLeft, bodyRigidbody.HitboxPixelCollider.UnitDimensions);
                                    }
                                    else
                                    {
                                        a      = healthHaver.transform.position.XY();
                                        vector = a - position.XY();
                                        num    = vector.magnitude;
                                    }
                                    if (!playerController || ((!data.doDamage || num >= damageRadius) && (!isFreezeExplosion || num >= data.freezeRadius) && (!data.doForce || num >= data.pushRadius)) || !IsPlayerBlockedByWall(playerController, position))
                                    {
                                        if (playerController)
                                        {
                                            if (!bodyRigidbody.CollideWithOthers)
                                            {
                                                goto IL_A6E;
                                            }
                                            if (playerController.DodgeRollIsBlink && playerController.IsDodgeRolling)
                                            {
                                                goto IL_A6E;
                                            }
                                        }
                                        if (data.doDamage && num < damageRadius)
                                        {
                                            if (playerController)
                                            {
                                                bool flag2 = true;
                                                if (PassiveItem.ActiveFlagItems.ContainsKey(playerController) && PassiveItem.ActiveFlagItems[playerController].ContainsKey(typeof(HelmetItem)) && num > damageRadius * HelmetItem.EXPLOSION_RADIUS_MULTIPLIER)
                                                {
                                                    flag2 = false;
                                                }
                                                if (flag2 && !playerController.IsEthereal)
                                                {
                                                    HealthHaver     healthHaver2   = healthHaver;
                                                    float           damage         = data.damageToPlayer;
                                                    Vector2         direction      = vector;
                                                    string          enemiesString  = StringTableManager.GetEnemiesString("#EXPLOSION", -1);
                                                    CoreDamageTypes damageTypes2   = CoreDamageTypes.None;
                                                    DamageCategory  damageCategory = DamageCategory.Normal;
                                                    healthHaver2.ApplyDamage(damage, direction, enemiesString, damageTypes2, damageCategory, false, null, ignoreDamageCaps);
                                                }
                                            }
                                            else
                                            {
                                                HealthHaver     healthHaver3   = healthHaver;
                                                float           damage         = data.damage;
                                                Vector2         direction      = vector;
                                                string          enemiesString  = StringTableManager.GetEnemiesString("#EXPLOSION", -1);
                                                CoreDamageTypes damageTypes2   = CoreDamageTypes.None;
                                                DamageCategory  damageCategory = DamageCategory.Normal;
                                                healthHaver3.ApplyDamage(damage, direction, enemiesString, damageTypes2, damageCategory, false, null, ignoreDamageCaps);
                                                if (data.IsChandelierExplosion && (!healthHaver || healthHaver.healthHaver.IsDead))
                                                {
                                                    GameStatsManager.Instance.RegisterStatChange(TrackedStats.ENEMIES_KILLED_WITH_CHANDELIERS, 1f);
                                                }
                                            }
                                            flag = true;
                                        }
                                        if (isFreezeExplosion && num < data.freezeRadius)
                                        {
                                            if (healthHaver && healthHaver.gameActor != null && !healthHaver.IsDead && (!healthHaver.aiActor || !healthHaver.aiActor.IsGone))
                                            {
                                                healthHaver.gameActor.ApplyEffect(data.freezeEffect, 1f, null);
                                            }
                                            flag = true;
                                        }
                                        if (data.doForce && num < data.pushRadius)
                                        {
                                            KnockbackDoer knockbackDoer = healthHaver.knockbackDoer;
                                            if (knockbackDoer)
                                            {
                                                float num2 = 1f - num / data.pushRadius;
                                                if (data.preventPlayerForce && healthHaver.GetComponent <PlayerController>())
                                                {
                                                    num2 = 0f;
                                                }
                                                knockbackDoer.ApplyKnockback(vector.normalized, num2 * data.force, false);
                                            }
                                            flag = true;
                                        }
                                        if (flag)
                                        {
                                            break;
                                        }
                                    }
                                    IL_A6E :;
                                }
                            }
                        }
                    }
                    IL_A82 :;
                }
            }
            List <MinorBreakable> allBreakables = StaticReferenceManager.AllMinorBreakables;

            if (allBreakables != null)
            {
                for (int l = 0; l < allBreakables.Count; l++)
                {
                    MinorBreakable minorBreakable = allBreakables[l];
                    if (minorBreakable)
                    {
                        if (!minorBreakable.resistsExplosions)
                        {
                            if (!minorBreakable.OnlyBrokenByCode)
                            {
                                Vector2 vector2 = minorBreakable.CenterPoint - position.XY();
                                if (vector2.sqrMagnitude < pushSqrRadius)
                                {
                                    minorBreakable.Break(vector2.normalized);
                                }
                            }
                        }
                    }
                }
            }
            if (data.doDestroyProjectiles)
            {
                float            duration         = 0.2f;
                PlayerController bestActivePlayer = GameManager.Instance.BestActivePlayer;
                if (bestActivePlayer && bestActivePlayer.CurrentRoom != null && bestActivePlayer.CurrentRoom.area != null && bestActivePlayer.CurrentRoom.area.PrototypeRoomCategory == PrototypeDungeonRoom.RoomCategory.BOSS)
                {
                    duration = 0.035f;
                }
                GameManager.Instance.Dungeon.StartCoroutine(HandleBulletDeletionFrames(position, bulletDeletionSqrRadius, duration));
            }
            if (data.doDamage || data.breakSecretWalls)
            {
                List <MajorBreakable> allMajorBreakables = StaticReferenceManager.AllMajorBreakables;
                if (allMajorBreakables != null)
                {
                    for (int m = 0; m < allMajorBreakables.Count; m++)
                    {
                        MajorBreakable majorBreakable = allMajorBreakables[m];
                        if (majorBreakable)
                        {
                            if (majorBreakable.enabled)
                            {
                                if (!majorBreakable.IgnoreExplosions)
                                {
                                    Vector2 sourceDirection = majorBreakable.CenterPoint - position.XY();
                                    if (sourceDirection.sqrMagnitude < pushSqrRadius && (!majorBreakable.IsSecretDoor || !data.forcePreventSecretWallDamage))
                                    {
                                        if (data.doDamage)
                                        {
                                            majorBreakable.ApplyDamage(data.damage, sourceDirection, false, true, false);
                                        }
                                        if (data.breakSecretWalls && majorBreakable.IsSecretDoor)
                                        {
                                            StaticReferenceManager.AllMajorBreakables[m].ApplyDamage(1E+10f, Vector2.zero, false, true, true);
                                            StaticReferenceManager.AllMajorBreakables[m].ApplyDamage(1E+10f, Vector2.zero, false, true, true);
                                            StaticReferenceManager.AllMajorBreakables[m].ApplyDamage(1E+10f, Vector2.zero, false, true, true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (data.doForce)
            {
                Exploder.DoRadialPush(position, data.debrisForce, data.pushRadius);
            }
            if (data.doScreenShake && GameManager.Instance.MainCameraController != null)
            {
                GameManager.Instance.MainCameraController.DoScreenShake(data.ss, new Vector2?(position), false);
            }
            if (data.doStickyFriction && GameManager.Instance.MainCameraController != null)
            {
                StickyFrictionManager.Instance.RegisterExplosionStickyFriction();
            }
            for (int n = 0; n < StaticReferenceManager.AllRatTrapdoors.Count; n++)
            {
                if (StaticReferenceManager.AllRatTrapdoors[n])
                {
                    StaticReferenceManager.AllRatTrapdoors[n].OnNearbyExplosion(position);
                }
            }
            Destroy(this.gameObject);
            yield break;
        }
Exemplo n.º 3
0
        public static void CurseRoomRewardMethod(Action <RoomHandler> orig, RoomHandler self)
        {
            bool harderlotj = JammedSquire.NoHarderLotJ;

            if (harderlotj)
            {
                orig(self);
            }
            else
            {
                orig(self);
                FloorRewardData         currentRewardData = GameManager.Instance.RewardManager.CurrentRewardData;
                LootEngine.AmmoDropType ammoDropType      = LootEngine.AmmoDropType.DEFAULT_AMMO;
                bool   flag  = LootEngine.DoAmmoClipCheck(currentRewardData, out ammoDropType);
                string path  = (ammoDropType != LootEngine.AmmoDropType.SPREAD_AMMO) ? "Ammo_Pickup" : "Ammo_Pickup_Spread";
                float  value = UnityEngine.Random.value;
                float  num   = currentRewardData.ChestSystem_ChestChanceLowerBound;
                //float num2 = GameManager.Instance.PrimaryPlayer.stats.GetStatValue(PlayerStats.StatType.Coolness) / 100f;
                float num3 = (GameManager.Instance.PrimaryPlayer.stats.GetStatValue(PlayerStats.StatType.Curse) / 250f);
                if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
                {
                    num3 += GameManager.Instance.SecondaryPlayer.stats.GetStatValue(PlayerStats.StatType.Curse) / 250f;
                }
                if (PassiveItem.IsFlagSetAtAll(typeof(ChamberOfEvilItem)))
                {
                    num3 *= 1.25f;
                }
                num = Mathf.Clamp(num + GameManager.Instance.PrimaryPlayer.AdditionalChestSpawnChance, currentRewardData.ChestSystem_ChestChanceLowerBound, currentRewardData.ChestSystem_ChestChanceUpperBound) + num3;
                bool  flag2 = currentRewardData.SingleItemRewardTable != null;
                bool  flag3 = false;
                float num4  = 0.1f;
                if (!RoomHandler.HasGivenRoomChestRewardThisRun && MetaInjectionData.ForceEarlyChest)
                {
                    flag3 = true;
                }
                if (flag3)
                {
                    if (!RoomHandler.HasGivenRoomChestRewardThisRun && (GameManager.Instance.CurrentFloor == 1 || GameManager.Instance.CurrentFloor == -1))
                    {
                        flag2 = false;
                        num  += num4;
                        if (GameManager.Instance.PrimaryPlayer && GameManager.Instance.PrimaryPlayer.NumRoomsCleared > 4)
                        {
                            num = 1f;
                        }
                    }
                    if (!RoomHandler.HasGivenRoomChestRewardThisRun && self.distanceFromEntrance < RoomHandler.NumberOfRoomsToPreventChestSpawning)
                    {
                        GameManager.Instance.Dungeon.InformRoomCleared(false, false);
                        return;
                    }
                }
                BraveUtility.Log("Current chest spawn chance: " + num, Color.yellow, BraveUtility.LogVerbosity.IMPORTANT);
                if (value > num)
                {
                    if (flag)
                    {
                        IntVector2 bestRewardLocation = self.GetBestRewardLocation(new IntVector2(1, 1), RoomHandler.RewardLocationStyle.CameraCenter, true);
                        LootEngine.SpawnItem((GameObject)BraveResources.Load(path, ".prefab"), bestRewardLocation.ToVector3(), Vector2.up, 1f, true, true, false);
                    }
                    GameManager.Instance.Dungeon.InformRoomCleared(false, false);
                    return;
                }
                if (flag2)
                {
                    float num5 = currentRewardData.PercentOfRoomClearRewardsThatAreChests;
                    if (PassiveItem.IsFlagSetAtAll(typeof(AmazingChestAheadItem)))
                    {
                        num5 *= 2f;
                        num5  = Mathf.Max(0.5f, num5);
                    }
                    flag2 = (UnityEngine.Random.value > num5);
                }
                if (flag2)
                {
                    float      num6 = (GameManager.Instance.CurrentGameType != GameManager.GameType.COOP_2_PLAYER) ? GameManager.Instance.RewardManager.SinglePlayerPickupIncrementModifier : GameManager.Instance.RewardManager.CoopPickupIncrementModifier;
                    GameObject gameObject;
                    if (UnityEngine.Random.value < 1f / num6)
                    {
                        gameObject = currentRewardData.SingleItemRewardTable.SelectByWeight(false);
                    }
                    else
                    {
                        gameObject = ((UnityEngine.Random.value >= 0.9f) ? GameManager.Instance.RewardManager.FullHeartPrefab.gameObject : GameManager.Instance.RewardManager.HalfHeartPrefab.gameObject);
                    }
                    UnityEngine.Debug.Log(gameObject.name + "SPAWNED");
                    DebrisObject debrisObject = LootEngine.SpawnItem(gameObject, self.GetBestRewardLocation(new IntVector2(1, 1), RoomHandler.RewardLocationStyle.CameraCenter, true).ToVector3() + new Vector3(0.25f, 0f, 0f), Vector2.up, 1f, true, true, false);
                    Exploder.DoRadialPush(debrisObject.sprite.WorldCenter.ToVector3ZUp(debrisObject.sprite.WorldCenter.y), 8f, 3f);
                    AkSoundEngine.PostEvent("Play_OBJ_item_spawn_01", debrisObject.gameObject);
                    GameManager.Instance.Dungeon.InformRoomCleared(true, false);
                }
                else
                {
                    IntVector2 bestRewardLocation = self.GetBestRewardLocation(new IntVector2(2, 1), RoomHandler.RewardLocationStyle.CameraCenter, true);
                    bool       isRainbowRun       = GameStatsManager.Instance.IsRainbowRun;
                    if (isRainbowRun)
                    {
                        LootEngine.SpawnBowlerNote(GameManager.Instance.RewardManager.BowlerNoteChest, bestRewardLocation.ToCenterVector2(), self, true);
                        RoomHandler.HasGivenRoomChestRewardThisRun = true;
                    }
                    else
                    {
                        Chest exists = self.SpawnRoomRewardChest(null, bestRewardLocation);
                        if (exists)
                        {
                            RoomHandler.HasGivenRoomChestRewardThisRun = true;
                        }
                    }
                    GameManager.Instance.Dungeon.InformRoomCleared(true, true);
                }
                if (flag)
                {
                    IntVector2 bestRewardLocation = self.GetBestRewardLocation(new IntVector2(1, 1), RoomHandler.RewardLocationStyle.CameraCenter, true);
                    LootEngine.DelayedSpawnItem(1f, (GameObject)BraveResources.Load(path, ".prefab"), bestRewardLocation.ToVector3() + new Vector3(0.25f, 0f, 0f), Vector2.up, 1f, true, true, false);
                }
            }
        }