public static void DoRadialMinorBreakableBreak(Vector3 position, float radius) { float num = radius * radius; List <MinorBreakable> allMinorBreakables = StaticReferenceManager.AllMinorBreakables; if (allMinorBreakables != null) { for (int i = 0; i < allMinorBreakables.Count; i++) { MinorBreakable minorBreakable = allMinorBreakables[i]; if (minorBreakable) { if (!minorBreakable.resistsExplosions) { if (!minorBreakable.OnlyBrokenByCode) { Vector2 vector = minorBreakable.CenterPoint - position.XY(); if (vector.sqrMagnitude < num) { minorBreakable.Break(vector.normalized); } } } } } } }
private IEnumerator BreakBarrel(MinorBreakable breakable) { yield return(new WaitForSeconds(15f)); breakable.Break(); yield break; }
public void Update() { if (m_WasKicked) { if (GetAbsoluteParentRoom() == null) { m_WasKicked = false; willDefinitelyExplode = true; SelfDestructOnKick(); } FlippableCover m_Table = GetComponent <FlippableCover>(); if (m_Table) { if (m_Table.IsBroken) { m_WasKicked = false; willDefinitelyExplode = true; SelfDestructOnKick(); } } } if (m_shouldDisplayOutline) { int num; DungeonData.Direction inverseDirection = DungeonData.GetInverseDirection(DungeonData.GetDirectionFromIntVector2(GetFlipDirection(m_lastInteractingPlayer.specRigidbody, out num))); if (inverseDirection != m_lastOutlineDirection || sprite.spriteId != m_lastSpriteId) { SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); SpriteOutlineManager.AddSingleOutlineToSprite <tk2dSprite>(sprite, DungeonData.GetIntVector2FromDirection(inverseDirection), Color.white, 0.25f, 0f); } m_lastOutlineDirection = inverseDirection; m_lastSpriteId = sprite.spriteId; } if (leavesGoopTrail && specRigidbody.Velocity.magnitude > 0.1f) { m_goopElapsed += BraveTime.DeltaTime; if (m_goopElapsed > goopFrequency) { m_goopElapsed -= BraveTime.DeltaTime; if (m_goopManager == null) { m_goopManager = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(goopType); } m_goopManager.AddGoopCircle(sprite.WorldCenter, goopRadius + 0.1f, -1, false, -1); } if (AllowTopWallTraversal && GameManager.Instance.Dungeon.data.CheckInBoundsAndValid(sprite.WorldCenter.ToIntVector2(VectorConversions.Floor)) && GameManager.Instance.Dungeon.data[sprite.WorldCenter.ToIntVector2(VectorConversions.Floor)].IsFireplaceCell) { MinorBreakable component = GetComponent <MinorBreakable>(); if (component && !component.IsBroken) { component.Break(Vector2.zero); GameStatsManager.Instance.SetFlag(GungeonFlags.FLAG_ROLLED_BARREL_INTO_FIREPLACE, true); } } } }
private IEnumerator HandleShatter(PlayerController interactor, bool skipInitialWait = false) { if (!skipInitialWait) { yield return(new WaitForSeconds(0.5f)); } if (this) { AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", gameObject); AkSoundEngine.PostEvent("Play_OBJ_pot_shatter_01", gameObject); AkSoundEngine.PostEvent("Play_OBJ_glass_shatter_01", gameObject); } StatModifier curse = new StatModifier(); curse.statToBoost = PlayerStats.StatType.Curse; curse.amount = CURSE_EXPOSED; curse.modifyType = StatModifier.ModifyMethod.ADDITIVE; if (!interactor) { interactor = GameManager.Instance.PrimaryPlayer; } if (interactor) { interactor.ownerlessStatModifiers.Add(curse); interactor.stats.RecalculateStats(interactor, false, false); } MinorBreakable childBreakable = GetComponentInChildren <MinorBreakable>(); if (childBreakable) { childBreakable.Break(); while (childBreakable) { yield return(null); } } tk2dSpriteAnimator eyeBall = GetComponentInChildren <tk2dSpriteAnimator>(); if (eyeBall) { eyeBall.Play("haunted_mirror_eye"); } if (ShatterSystem) { ShatterSystem.SetActive(true); } yield return(new WaitForSeconds(2.5f)); if (ShatterSystem) { ShatterSystem.GetComponent <ParticleSystem>().Pause(false); } yield break; }
private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider) { MinorBreakable component = otherRigidbody.GetComponent <MinorBreakable>(); if (component && !component.onlyVulnerableToGunfire && !component.IsBig) { component.Break(specRigidbody.Velocity); PhysicsEngine.SkipCollision = true; } if (otherRigidbody && otherRigidbody.aiActor && !otherRigidbody.aiActor.IsNormalEnemy) { PhysicsEngine.SkipCollision = true; } }
private void OnPlayerCollision(CollisionData rigidbodyCollision) { PlayerController component = rigidbodyCollision.OtherRigidbody.GetComponent <PlayerController>(); if (RollingDestroysSafely && component != null && component.IsDodgeRolling) { MinorBreakable component2 = GetComponent <MinorBreakable>(); component2.destroyOnBreak = true; component2.makeParallelOnBreak = false; if (hasRollingAnimations) { component2.breakAnimName = RollingBreakAnim; } component2.explodesOnBreak = false; component2.Break(-rigidbodyCollision.Normal); } }
private void SuckPots() { List <MinorBreakable> allMinorBreakables = StaticReferenceManager.AllMinorBreakables; for (int k = allMinorBreakables.Count - 1; k >= 0; k--) { MinorBreakable minorBreakable = allMinorBreakables[k]; if (minorBreakable && minorBreakable.specRigidbody) { if (!minorBreakable.IsBroken && minorBreakable.sprite) { Vector2 vector = minorBreakable.sprite.WorldCenter - this.m_owner.sprite.WorldCenter; bool flag = (vector.sqrMagnitude < (6 * 6)); if (flag) { GameManager.Instance.Dungeon.StartCoroutine(this.HandlePotSuck(minorBreakable)); minorBreakable.Break(); } } } } }
protected SpeculativeRigidbody IterativeRaycast(Vector2 rayOrigin, Vector2 rayDirection, float rayDistance, int collisionMask, SpeculativeRigidbody ignoreRigidbody) { int num = 0; RaycastResult raycastResult; while (PhysicsEngine.Instance.Raycast(rayOrigin, rayDirection, rayDistance, out raycastResult, true, true, collisionMask, new CollisionLayer?(CollisionLayer.Projectile), false, null, ignoreRigidbody)) { num++; SpeculativeRigidbody speculativeRigidbody = raycastResult.SpeculativeRigidbody; if (num < 3 && speculativeRigidbody != null) { MinorBreakable component = speculativeRigidbody.GetComponent <MinorBreakable>(); if (component != null) { component.Break(rayDirection.normalized * 3f); RaycastResult.Pool.Free(ref raycastResult); continue; } } RaycastResult.Pool.Free(ref raycastResult); return(speculativeRigidbody); } return(null); }
private static void HandleHeroSwordSlash(List <SpeculativeRigidbody> alreadyHit, Vector2 arcOrigin, float slashAngle, int slashId, PlayerController owner, ProjInteractMode intmode, float damageToDeal, float enemyKnockback, List <GameActorEffect> statusEffects, float jammedDMGMult, float bossDMGMult, float slashRange, float slashDimensions) { ReadOnlyCollection <Projectile> allProjectiles2 = StaticReferenceManager.AllProjectiles; for (int j = allProjectiles2.Count - 1; j >= 0; j--) { Projectile projectile2 = allProjectiles2[j]; if (ProjectileIsValid(projectile2)) { Vector2 projectileCenter = projectile2.sprite.WorldCenter; if (ObjectWasHitBySlash(projectileCenter, arcOrigin, slashAngle, slashRange, slashDimensions)) { if (intmode != ProjInteractMode.IGNORE || projectile2.collidesWithProjectiles) { if (intmode == ProjInteractMode.DESTROY || intmode == ProjInteractMode.IGNORE) { projectile2.DieInAir(false, true, true, true); } else if (intmode == ProjInteractMode.REFLECT) { if (projectile2.LastReflectedSlashId != slashId) { PassiveReflectItem.ReflectBullet(projectile2, true, owner, 2f, 1f, 1f, 0f); projectile2.LastReflectedSlashId = slashId; } } } } } } DealDamageToEnemiesInArc(owner, arcOrigin, slashAngle, slashRange, damageToDeal, enemyKnockback, statusEffects, jammedDMGMult, bossDMGMult, slashDimensions, alreadyHit); List <MinorBreakable> allMinorBreakables = StaticReferenceManager.AllMinorBreakables; for (int k = allMinorBreakables.Count - 1; k >= 0; k--) { MinorBreakable minorBreakable = allMinorBreakables[k]; if (minorBreakable && minorBreakable.specRigidbody) { if (!minorBreakable.IsBroken && minorBreakable.sprite) { if (ObjectWasHitBySlash(minorBreakable.sprite.WorldCenter, arcOrigin, slashAngle, slashRange, slashDimensions)) { minorBreakable.Break(); } } } } List <MajorBreakable> allMajorBreakables = StaticReferenceManager.AllMajorBreakables; for (int l = allMajorBreakables.Count - 1; l >= 0; l--) { MajorBreakable majorBreakable = allMajorBreakables[l]; if (majorBreakable && majorBreakable.specRigidbody) { if (!alreadyHit.Contains(majorBreakable.specRigidbody)) { if (!majorBreakable.IsSecretDoor && !majorBreakable.IsDestroyed) { if (ObjectWasHitBySlash(majorBreakable.specRigidbody.UnitCenter, arcOrigin, slashAngle, slashRange, slashDimensions)) { float num9 = damageToDeal; if (majorBreakable.healthHaver) { num9 *= 0.2f; } majorBreakable.ApplyDamage(num9, majorBreakable.specRigidbody.UnitCenter - arcOrigin, false, false, false); alreadyHit.Add(majorBreakable.specRigidbody); } } } } } }
private static void HandleHeroSwordSlash(List <SpeculativeRigidbody> alreadyHit, Vector2 arcOrigin, float slashAngle, int slashId, GameActor owner, SlashData slashParameters) { float degreesOfSlash = slashParameters.slashDegrees; float slashRange = slashParameters.slashRange; ReadOnlyCollection <Projectile> allProjectiles2 = StaticReferenceManager.AllProjectiles; for (int j = allProjectiles2.Count - 1; j >= 0; j--) { Projectile projectile2 = allProjectiles2[j]; if (ProjectileIsValid(projectile2, owner)) { Vector2 projectileCenter = projectile2.sprite.WorldCenter; if (ObjectWasHitBySlash(projectileCenter, arcOrigin, slashAngle, slashRange, degreesOfSlash)) { if (slashParameters.OnHitBullet != null) { slashParameters.OnHitBullet(projectile2); } if (slashParameters.projInteractMode != ProjInteractMode.IGNORE || projectile2.collidesWithProjectiles) { if (slashParameters.projInteractMode == ProjInteractMode.DESTROY || slashParameters.projInteractMode == ProjInteractMode.IGNORE) { projectile2.DieInAir(false, true, true, true); } else if (slashParameters.projInteractMode == ProjInteractMode.REFLECT || slashParameters.projInteractMode == ProjInteractMode.REFLECTANDPOSTPROCESS) { if (projectile2.Owner != null && projectile2.LastReflectedSlashId != slashId) { projectile2.ReflectBullet(true, owner, 5, (slashParameters.projInteractMode == ProjInteractMode.REFLECTANDPOSTPROCESS), 1, 5, 0, null); projectile2.LastReflectedSlashId = slashId; } } } } } } DealDamageToEnemiesInArc(owner, arcOrigin, slashAngle, slashRange, slashParameters, alreadyHit); if (slashParameters.damagesBreakables) { List <MinorBreakable> allMinorBreakables = StaticReferenceManager.AllMinorBreakables; for (int k = allMinorBreakables.Count - 1; k >= 0; k--) { MinorBreakable minorBreakable = allMinorBreakables[k]; if (minorBreakable && minorBreakable.specRigidbody) { if (!minorBreakable.IsBroken && minorBreakable.sprite) { if (ObjectWasHitBySlash(minorBreakable.sprite.WorldCenter, arcOrigin, slashAngle, slashRange, degreesOfSlash)) { if (slashParameters.OnHitMinorBreakable != null) { slashParameters.OnHitMinorBreakable(minorBreakable); } minorBreakable.Break(); } } } } List <MajorBreakable> allMajorBreakables = StaticReferenceManager.AllMajorBreakables; for (int l = allMajorBreakables.Count - 1; l >= 0; l--) { MajorBreakable majorBreakable = allMajorBreakables[l]; if (majorBreakable && majorBreakable.specRigidbody) { if (!alreadyHit.Contains(majorBreakable.specRigidbody)) { if (!majorBreakable.IsSecretDoor && !majorBreakable.IsDestroyed) { if (ObjectWasHitBySlash(majorBreakable.specRigidbody.UnitCenter, arcOrigin, slashAngle, slashRange, degreesOfSlash)) { float num9 = slashParameters.damage; if (majorBreakable.healthHaver) { num9 *= 0.2f; } if (slashParameters.OnHitMajorBreakable != null) { slashParameters.OnHitMajorBreakable(majorBreakable); } majorBreakable.ApplyDamage(num9, majorBreakable.specRigidbody.UnitCenter - arcOrigin, false, false, false); alreadyHit.Add(majorBreakable.specRigidbody); } } } } } } }
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; }