void OnTriggerEnter2D(Collider2D collider) { if (deathTimer == 0) { return; } bool destroyMe = false; var fc = collider.gameObject.GetComponentInParent <FighterController>(); if (fc != null) { int side = GetHitSide(startPos, collider.gameObject.transform.position, collider.gameObject.transform.right); fc.GotHit(side, damage, team); destroyMe = true; //Debug.Log ("Angle: " + angle + " AngleDir: " + angleDir + " side: " + side); } Exploder ex = collider.gameObject.GetComponent <Exploder>(); if (ex != null) { ex.Explode(); destroyMe = true; } // destroy missile if (destroyMe || collider.gameObject.layer == 11) { deathTimer = 0; NetworkServer.Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D collider) { if (deathTimer == 0) { return; } bool destroyMe = false; TankCombat tc = collider.gameObject.GetComponent <TankCombat>(); if (tc != null) { int side = GetHitSide(startPos, collider.gameObject.transform.position, collider.gameObject.transform.right); tc.GotHitByMissile(side, damage, team); destroyMe = true; //Debug.Log ("Angle: " + angle + " AngleDir: " + angleDir + " side: " + side); } Exploder ex = collider.gameObject.GetComponent <Exploder>(); if (ex != null) { ex.Explode(); PlayGame.singleton.AddBarrelScore(); destroyMe = true; } // destroy missile if (destroyMe) { deathTimer = 0; NetworkServer.Destroy(this.gameObject); } }
private void onDestroyed(Projectile proj) { //plays the sound i made in my sound bank AkSoundEngine.PostEvent("Play_Wooden_Box_Break", GameManager.Instance.PrimaryPlayer.gameObject); var p = proj.Owner as PlayerController; //makes sure player doesnt have who needs money synergy. if (!p.PlayerHasActiveSynergy("who even needs money.")) { //spawns 35 casings and 3 hegemony credit, //the manual gives it the effect of lootbag, where they disapear over time. LootEngine.SpawnCurrencyManual(proj.sprite.WorldCenter, 35); LootEngine.SpawnCurrency(proj.sprite.WorldCenter, 3, true); } else { //cause explosion var data = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData; data.damageToPlayer = 0; data.damage = 5; Exploder.Explode(proj.sprite.WorldCenter, data, Vector2.zero, null, false, CoreDamageTypes.None, false); } //spawns random item at proj position if player has a certain synergy. if (p.PlayerHasActiveSynergy("oh you can open that!")) { var itemtopick = UnityEngine.Random.Range(0, Module.items.Count); LootEngine.SpawnItem(Game.Items[Module.items[itemtopick]].gameObject, proj.sprite.WorldCenter, Vector2.zero, 0); } }
void detector_Collided(Volume collisonObject, Voxel voxel, Vector3 worldPosition) { // If the bullet hits an invader and is owned by the player, explode and destroy the invader - and deactivate the bullet if (collisonObject.name == "Invader" && Owner is InvadersPlayerShip) { collisonObject.Destruct(3f, true); Destroy(collisonObject.gameObject); gameObject.SetActive(false); } // If we hit a shield, just explode and deactivate the bullet if (collisonObject.name == "Shield") { exploder.ExplosionRadius = 1f; exploder.Explode(); gameObject.SetActive(false); } // If we hit the player ship if (collisonObject.name == "Player Ship") { collisonObject.Destruct(3f, true); collisonObject.GetComponent <InvadersPlayerShip>().Die(); gameObject.SetActive(false); } }
private void DoSafeExplosion(Vector2 position) { ExplosionData data = DataCloners.CopyExplosionData(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData); data.ignoreList.Add(Owner.specRigidbody); Exploder.Explode(position, data, Vector2.zero); }
public void OnMouseOver() { HighlightColor = Color.white; if (this is Multiblock.Multiblock && transform.name.Equals("Tree")) { Exploder.Explode(this as Multiblock.Multiblock); } }
// Token: 0x0600768F RID: 30351 RVA: 0x002E4130 File Offset: 0x002E2330 private void HandleTriggerCollisionExplosion(SpeculativeRigidbody otherRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData) { if (otherRigidbody && otherRigidbody.aiActor && Time.time - this.m_lastExplosionTime > 5f) { this.m_lastExplosionTime = Time.time; Exploder.Explode(base.specRigidbody.UnitCenter, this.TriggerExplosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); this.Disappear(); } }
private void Explode() { _NormalCubesContainer.SetActive(false); _ExplosionCubesContainer.gameObject.SetActive(true); _ExplosionCubesContainer.Explode(); _Exploding = true; }
public void DoSafeExplosion(Vector3 position) { ExplosionData defaultSmallExplosionData2 = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData; this.smallPlayerSafeExplosion.effect = defaultSmallExplosionData2.effect; this.smallPlayerSafeExplosion.ignoreList = defaultSmallExplosionData2.ignoreList; this.smallPlayerSafeExplosion.ss = defaultSmallExplosionData2.ss; Exploder.Explode(position, this.smallPlayerSafeExplosion, Vector2.zero, null, false, CoreDamageTypes.None, false); }
private void OnDestruction(Projectile bullet) { if (Owner && Owner.specRigidbody) { ExplosionData LinearChainExplosionData = Gungeon.Game.Items["katana_bullets"].GetComponent <ComplexProjectileModifier>().LinearChainExplosionData.CopyExplosionData(); LinearChainExplosionData.ignoreList.Add(Owner.specRigidbody); Exploder.Explode(bullet.specRigidbody.UnitCenter, LinearChainExplosionData, Vector2.zero); } }
public override void OnBeamHit(Vector2 contact, Projectile projectile) { if (projectile) { ExplosionData explosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData; explosion.damage = 130; explosion.doDestroyProjectiles = true; Exploder.Explode(contact, explosion, Vector2.zero, damageTypes: projectile.damageTypes); } }
public void Blam(Vector3 position) { AkSoundEngine.PostEvent("Play_OBJ_nuke_blast_01", gameObject); ExplosionData defaultSmallExplosionData2 = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData; this.smallPlayerSafeExplosion.effect = defaultSmallExplosionData2.effect; this.smallPlayerSafeExplosion.ignoreList = defaultSmallExplosionData2.ignoreList; this.smallPlayerSafeExplosion.ss = defaultSmallExplosionData2.ss; Exploder.Explode(position, this.smallPlayerSafeExplosion, Vector2.zero, null, false, CoreDamageTypes.None, false); }
private IEnumerator HandleEnemySuck(AIActor target) { Transform copySprite = this.CreateEmptySprite(target); if (this.m_owner.PlayerHasActiveSynergy("#RELODIN_-_EXPLODIN")) { ExplosionData explosionData = new ExplosionData(); explosionData.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData); explosionData.damageToPlayer = 0f; Exploder.Explode(target.sprite.WorldCenter, explosionData, new Vector2()); } if (this.m_owner.PlayerHasActiveSynergy("RECYCLE_COLLECT_AND_USE") && UnityEngine.Random.value <= 0.05f) { GenericLootTable singleItemRewardTable = GameManager.Instance.RewardManager.CurrentRewardData.SingleItemRewardTable; LootEngine.SpawnItem(singleItemRewardTable.SelectByWeight(false), this.m_owner.CenterPosition, Vector2.up, 1f, true, false, false); } Vector3 startPosition = copySprite.transform.position; float elapsed = 0f; float duration = 0.5f; while (elapsed < duration) { elapsed += BraveTime.DeltaTime; if (this.m_owner.CurrentGun && copySprite) { Vector3 position = this.m_owner.CurrentGun.PrimaryHandAttachPoint.position; float t = elapsed / duration * (elapsed / duration); copySprite.position = Vector3.Lerp(startPosition, position, t); copySprite.rotation = Quaternion.Euler(0f, 0f, 360f * BraveTime.DeltaTime) * copySprite.rotation; copySprite.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), t); } yield return(null); } if (copySprite) { UnityEngine.Object.Destroy(copySprite.gameObject); } if (this.m_owner.CurrentGun) { this.m_owner.CurrentGun.GainAmmo(1); if (this.m_owner.PlayerHasActiveSynergy("#OILER_CYLINDER") && UnityEngine.Random.value <= 0.25f) { this.m_owner.CurrentGun.GainAmmo(1); } } if (this.m_owner.PlayerHasActiveSynergy("#SIXTHER_CHAMBER")) { DevilishSynergy(); } if (this.m_owner.PlayerHasActiveSynergy("#YELLOWER_CHAMBER")) { KaliberSynergy(); } yield break; }
private void DoExplosion() { if (useDefaultExplosion) { Exploder.DoDefaultExplosion(specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, null, true, CoreDamageTypes.None); Exploder.DoRadialDamage(120f, specRigidbody.GetUnitCenter(ColliderType.HitBox), 3.5f, true, true, false); } else { Exploder.Explode(specRigidbody.GetUnitCenter(ColliderType.HitBox), ChaosExplosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); } }
public void Explode() { foreach (var gameObject in _fence) { foreach (var multiblock in gameObject.GetComponentsInChildren <Multiblock>()) { Exploder.Explode(multiblock); } } foreach (var childs in _farm.GetComponentsInChildren <Transform>()) { Object.Destroy(childs.gameObject); } }
private void HandleIBombSynergy(PlayerController player, PlayerItem item) { if (!(item is BombCompanionAppItem)) { return; } var enemy = player.CurrentRoom.GetRandomActiveEnemy(false); if (!enemy) { return; } Exploder.Explode(enemy.specRigidbody.UnitCenter, IBombExplosionData, Vector2.zero); }
private void DoOnCollisionEffect(Vector2 position) { if (this.owner) { if (UnityEngine.Random.value <= 0.5f && this.owner.PlayerHasActiveSynergy("Parallel Lines")) { doMiniBlank(position); } else { Exploder.Explode(position, TheThinLine.DataForProjectiles, Vector2.zero); } } }
private IEnumerator HandleChainExplosion(SpeculativeRigidbody enemySRB, Vector2 startPosition, Vector2 direction) { float perExplosionTime = this.LCEChainDuration / (float)this.LCEChainNumExplosions; float[] explosionTimes = new float[this.LCEChainNumExplosions]; explosionTimes[0] = 0f; explosionTimes[1] = perExplosionTime; for (int i = 2; i < this.LCEChainNumExplosions; i++) { explosionTimes[i] = explosionTimes[i - 1] + perExplosionTime; } Vector2 lastValidPosition = startPosition; bool hitWall = false; int index = 0; float elapsed = 0f; lastValidPosition = startPosition; hitWall = false; Vector2 currentDirection = direction; RoomHandler currentRoom = startPosition.GetAbsoluteRoom(); float enemyDistance = -1f; AIActor nearestEnemy = currentRoom.GetNearestEnemyInDirection(startPosition, currentDirection, 35f, out enemyDistance, true, (!enemySRB) ? null : enemySRB.aiActor); if (nearestEnemy && enemyDistance < 20f) { currentDirection = (nearestEnemy.CenterPosition - startPosition).normalized; } while (elapsed < this.LCEChainDuration) { elapsed += BraveTime.DeltaTime; while (index < this.LCEChainNumExplosions && elapsed >= explosionTimes[index]) { Vector2 vector = startPosition + currentDirection.normalized * this.LCEChainDistance; Vector2 vector2 = Vector2.Lerp(startPosition, vector, ((float)index + 1f) / (float)this.LCEChainNumExplosions); if (!this.ValidExplosionPosition(vector2)) { hitWall = true; } if (!hitWall) { lastValidPosition = vector2; } Exploder.Explode(lastValidPosition, this.LinearChainExplosionData, currentDirection, null, false, CoreDamageTypes.None, false); index++; } yield return(null); } yield break; }
private void Explode(Vector2 pos) { if (!canHarmOwner && owner != null) { for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++) { PlayerController playerController = GameManager.Instance.AllPlayers[i]; if (playerController && playerController.specRigidbody) { this.explosionData.ignoreList.Add(playerController.specRigidbody); } } } Exploder.Explode(pos, this.explosionData, Vector2.zero, null, this.ignoreQueues); }
private IEnumerator HandleBarrage(List <Vector2> targets) { this.m_isDoingBarrage = true; while (targets.Count > 0) { Vector2 currentTarget = targets[0]; targets.RemoveAt(0); Exploder.Explode(currentTarget, this.barrageExplosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); yield return(new WaitForSeconds(this.delayBetweenStrikes / (float)this.BarrageColumns)); } yield return(new WaitForSeconds(0.25f)); this.m_isDoingBarrage = false; this.IsCurrentlyActive = false; yield break; }
protected override void Update() { if (gun && gun.IsCharging) { timeChargine += BraveTime.DeltaTime; } if (timeChargine > 5) { Exploder.Explode(gun.sprite.WorldCenter, StaticExplosionDatas.explosiveRoundsExplosion, Vector2.zero); timeChargine = 0; } if (!gun.IsCharging && timeChargine > 0) { timeChargine = 0; } base.Update(); }
// Token: 0x0600717F RID: 29055 RVA: 0x002C2DE4 File Offset: 0x002C0FE4 // Token: 0x06007180 RID: 29056 RVA: 0x002C2E7C File Offset: 0x002C107C protected override void DoEffect(PlayerController user) { AkSoundEngine.PostEvent("Play_OBJ_dead_again_01", base.gameObject); //bool flag = false; for (int i = 0; i < StaticReferenceManager.AllCorpses.Count; i++) { GameObject gameObject = StaticReferenceManager.AllCorpses[i]; if (gameObject && gameObject.GetComponent <tk2dBaseSprite>() && gameObject.transform.position.GetAbsoluteRoom() == user.CurrentRoom) { Vector2 worldCenter = gameObject.GetComponent <tk2dBaseSprite>().WorldCenter; Exploder.Explode(worldCenter, CorpseExplosionData, Vector2.zero, null, true, CoreDamageTypes.None, false); //Exploder.DoDefaultExplosion(worldCenter, Vector2.zero, null, true, CoreDamageTypes.None, false); UnityEngine.Object.Destroy(gameObject.gameObject); } } }
public void DoSafeExplosion(Vector3 position) { if (Owner.HasPickupID(304) || Owner.HasPickupID(Gungeon.Game.Items["nn:nitro_bullets"].PickupObjectId)) { var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData; bigPlayerSafeExplosion.effect = defaultExplosion.effect; bigPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList; bigPlayerSafeExplosion.ss = defaultExplosion.ss; Exploder.Explode(position, bigPlayerSafeExplosion, Vector2.zero); } else { var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData; smallPlayerSafeExplosion.effect = defaultExplosion.effect; smallPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList; smallPlayerSafeExplosion.ss = defaultExplosion.ss; Exploder.Explode(position, smallPlayerSafeExplosion, Vector2.zero); } }
public void DoSafeExplosion(Vector3 position) { if (LastOwner.HasPickupID(332)) { var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData; bigPlayerSafeExplosion.effect = defaultExplosion.effect; bigPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList; bigPlayerSafeExplosion.ss = defaultExplosion.ss; Exploder.Explode(position, bigPlayerSafeExplosion, Vector2.zero); } else { var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData; smallPlayerSafeExplosion.effect = defaultExplosion.effect; smallPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList; smallPlayerSafeExplosion.ss = defaultExplosion.ss; Exploder.Explode(position, smallPlayerSafeExplosion, Vector2.zero); } }
private void ReaverBeat(Projectile projectile) { this.Boom(projectile.sprite.WorldCenter); bool flag = projectile != null; if (flag) { PlayerController playerController = this.gun.CurrentOwner as PlayerController; Vector2 a = playerController.sprite.WorldCenter - projectile.sprite.WorldCenter; playerController.knockbackDoer.ApplyKnockback(-a, 0f, false); Projectile projectile1 = ((Gun)ETGMod.Databases.Items[180]).DefaultModule.projectiles[0]; ExplosiveModifier component = projectile.GetComponent <ExplosiveModifier>(); ExplosionData explosionData = component.explosionData; component.doDistortionWave = true; component.explosionData.damage = 0f; Exploder.Explode(projectile.sprite.WorldCenter, explosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); playerController.ForceBlank(0f, 0.5f, false, true, new Vector2?(projectile.sprite.WorldCenter), false, 300f); } }
private void DoExplosion() { if (ExplosionNotGuranteed) { if (Random.value > ExplosionOdds) { return; } } if (useDefaultExplosion) { Exploder.DoDefaultExplosion(specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, null, true, CoreDamageTypes.None); Exploder.DoRadialDamage(ExplosionDamage, specRigidbody.GetUnitCenter(ColliderType.HitBox), 3.5f, true, true, false); } else { Exploder.Explode(specRigidbody.GetUnitCenter(ColliderType.HitBox), ExpandExplosionData, Vector2.zero, null, true, CoreDamageTypes.None, false); } }
public static IEnumerator AttachBomb(SpeculativeRigidbody enemy, PlayerController murdler, bool fatal) { var obj = GameObject.Instantiate(stickyBombPrefab); obj.SetActive(true); var sprite = obj.GetComponent <tk2dSprite>(); sprite.PlaceAtPositionByAnchor(enemy.sprite.WorldCenter, tk2dBaseSprite.Anchor.MiddleCenter); if (!fatal) { sprite.transform.SetParent(enemy.transform); } yield return(new WaitForSeconds(.75f)); if (murdler) { AkSoundEngine.PostEvent("Play_OBJ_mine_beep_01", murdler.gameObject); } yield return(new WaitForSeconds(.1f)); if (murdler) { AkSoundEngine.PostEvent("Play_OBJ_mine_beep_01", murdler.gameObject); } yield return(new WaitForSeconds(.1f)); if (murdler) { AkSoundEngine.PostEvent("Play_OBJ_mine_beep_01", murdler.gameObject); } if (sprite && murdler) { explosionData.damage = murdler.stats.GetBaseStatValue(PlayerStats.StatType.Damage) * 20f; Exploder.Explode(sprite.WorldCenter, explosionData, Vector2.zero, null, false); GameObject.Destroy(sprite); } }
void OnCollisionEnter2D(Collision2D col) { if (!GameManager.Instance.AllowExplosions || col.gameObject.tag == "Trolley" || col.gameObject.tag == "Collectable" || col.gameObject.tag == "NPC" || col.gameObject.tag == "Hazard" || col.gameObject.tag == "Player") { return; } if (Random.Range(0f, 1f) > 0.1f) { audioExplode.clip = explosion; } else { audioExplode.clip = unexpected; } audioExplode.Play(); exploder.Explode(); }
private void DetonateDrone() { Vector2 position = extant_drone.GetComponent <tk2dSprite>().WorldCenter; var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData; explosionData.effect = defaultExplosion.effect; explosionData.ignoreList = defaultExplosion.ignoreList; if (LastOwner.HasMTGConsoleID("remote_bullets") || LastOwner.HasMTGConsoleID("3rd_party_controller")) //remote bullets = x2 damage { explosionData.damage = 100f; } else { explosionData.damage = 50f; } if (LastOwner.HasMTGConsoleID("air_strike")) //air strike = +4 'splosions { for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { if (Mathf.Abs(i) + Mathf.Abs(j) == 1) { Exploder.Explode(position + new Vector2(i * 3f, j * 3f), explosionData, Vector2.zero); } } } } if (LastOwner.HasMTGConsoleID("napalm_strike")) //napalm strike = fire circle { DoNapalmSynergy(position); } Exploder.Explode(position, explosionData, Vector2.zero); GameObject.Destroy(extant_drone); }
private IEnumerator HandleDelayedTableExplosion(FlippableCover sourceTable, SpeculativeRigidbody flipperSource, float delay) { yield return(new WaitForSeconds(delay)); if (sourceTable.sprite) { Vector2 ExplosionCenterPosition = sourceTable.sprite.WorldCenter; if (sourceTable.specRigidbody) { sourceTable.specRigidbody.CollideWithOthers = false; } MajorBreakable breakable = sourceTable.GetComponentInChildren <MajorBreakable>(); if (breakable) { breakable.ApplyDamage(90, Vector2.zero, false, true, false); } Exploder.Explode(ExplosionCenterPosition, TableExplosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); } else if (sourceTable.specRigidbody) { Vector2 ExplosionCenterPosition = sourceTable.transform.position; if (sourceTable.specRigidbody) { sourceTable.specRigidbody.CollideWithOthers = false; } MajorBreakable breakable = sourceTable.GetComponentInChildren <MajorBreakable>(); if (breakable) { breakable.ApplyDamage(90, Vector2.zero, false, true, false); } Exploder.Explode(ExplosionCenterPosition, TableExplosionData, Vector2.zero, null, false, CoreDamageTypes.None, false); } yield break; }