public void Update() { if (timer > 0) { timer -= BraveTime.DeltaTime; } if (timer <= 0) { if (target) { GoldenEffectEnd(target); } } if (ParticleTimer > 0) { ParticleTimer -= BraveTime.DeltaTime; } if (ParticleTimer <= 0) { if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && target && target.IsVisible && !target.IsFalling) { GlobalSparksDoer.DoRandomParticleBurst(3, target.sprite.WorldBottomLeft.ToVector3ZisY(0f), target.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.RED_MATTER); } ParticleTimer = 0.1f; } }
//* private void Update() { RoomHandler room; try { room = sprite.transform.position.GetAbsoluteRoom(); } catch { room = null; } if (!(GameManager.Instance.IsPaused || room == null || (room.visibility == RoomHandler.VisibilityStatus.OBSCURED || room.visibility == RoomHandler.VisibilityStatus.REOBSCURED)) && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW) { //GlobalSparksDoer.DoRandomParticleBurst(Mathf.Max(1, (int)((float)this.SparksPerSecond * BraveTime.DeltaTime)), this.m_transform.localPosition + this.localMin, this.m_transform.localPosition + this.localMax, this.baseDirection, this.angleVariance, this.magnitudeVariance, null, new float?(UnityEngine.Random.Range(this.LifespanMin, this.LifespanMax)), null, this.sparksType); GlobalSparksDoer.DoRandomParticleBurst( Mathf.Max(1, (int)((float)this.SparksPerSecond * BraveTime.DeltaTime)), sprite.WorldTopLeft, sprite.WorldBottomRight, this.baseDirection, this.angleVariance, this.magnitudeVariance, null, new float?(UnityEngine.Random.Range(this.LifespanMin, this.LifespanMax)), null, this.sparksType); } }
public void Update() { if (!base.healthHaver.IsDead && this.m_shouldEnrage && base.behaviorSpeculator.IsInterruptable) { this.m_shouldEnrage = false; base.behaviorSpeculator.InterruptAndDisable(); base.aiActor.ClearPath(); base.StartCoroutine(this.EnrageCR()); } if (this.m_isEnraged) { this.m_overheadVfxTimer += BraveTime.DeltaTime; if (this.m_overheadVfxInstance && this.m_overheadVfxTimer > 1.5f) { this.m_overheadVfxInstance.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); this.m_overheadVfxInstance = null; } if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && base.aiActor && !base.aiActor.IsGone) { this.m_particleCounter += BraveTime.DeltaTime * 40f; if (this.m_particleCounter > 1f) { int num = Mathf.FloorToInt(this.m_particleCounter); this.m_particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, base.aiActor.sprite.WorldBottomLeft.ToVector3ZisY(0f), base.aiActor.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } } }
public static void DestroyFlames(RuntimeGameActorEffectData effectData) { if (effectData.vfxObjects == null) { return; } if (!effectData.actor.IsFrozen) { for (int i = 0; i < effectData.vfxObjects.Count; i++) { GameObject first = effectData.vfxObjects[i].First; if (first) { first.transform.parent = SpawnManager.Instance.VFX; } } } effectData.vfxObjects.Clear(); effectData.destroyVfx = true; if (GameManager.Options.ShaderQuality == GameOptions.GenericHighMedLowOption.HIGH && effectData.actor && effectData.actor.healthHaver && effectData.actor.healthHaver.GetCurrentHealth() <= 0f && effectData.actor.specRigidbody.HitboxPixelCollider != null) { Vector2 unitBottomLeft = effectData.actor.specRigidbody.HitboxPixelCollider.UnitBottomLeft; Vector2 unitTopRight = effectData.actor.specRigidbody.HitboxPixelCollider.UnitTopRight; float num = (unitTopRight.x - unitBottomLeft.x) * (unitTopRight.y - unitBottomLeft.y); GlobalSparksDoer.DoRandomParticleBurst(Mathf.Max(1, (int)(75f * num)), unitBottomLeft, unitTopRight, new Vector3(1f, 1f, 0f), 120f, 0.75f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } }
private void FixedUpdate() { if (sprite && doParticles) { vector = sprite.WorldBottomLeft.ToVector3ZisY(zOffset); vectorDos = sprite.WorldTopRight.ToVector3ZisY(zOffset); float num = (vectorDos.y - vector.y) * (vectorDos.x - vector.x); float num2 = 12f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vectorDos; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 0.2f; float? startLifetime = new float?(UnityEngine.Random.Range(0.8f, 1.25f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.STRAIGHT_UP_FIRE); if (gun.gameObject.GetComponent <MimicGunMimicModifier>() != null) { Destroy(gun.gameObject.GetComponent <MimicGunMimicModifier>()); } } if (gun.HasBeenPickedUp) { doParticles = false; HandleAddAmmo(); if (!DidOnPickup) { PseudoOnPickup(); DidOnPickup = true; } } }
private System.Collections.IEnumerator InflictRage(PlayerController player) { float elapsed = 0f; float particleCounter = 0f; while (elapsed == 0) { bool flag2 = GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && base.Owner && base.Owner.IsVisible && !base.Owner.IsFalling; if (flag2) { particleCounter += BraveTime.DeltaTime * 40f; bool flag4 = particleCounter > 1f; if (flag4) { if (Murder == true) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, base.Owner.sprite.WorldBottomLeft.ToVector3ZisY(0f), base.Owner.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } } yield return(null); } yield break; }
private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider) { PlayerController player = this.Owner; PhysicsEngine.SkipCollision = true; RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom; AIActor component = otherRigidbody.GetComponent <AIActor>(); bool flag = component != null; if (flag) { if (component.healthHaver && component.CenterPosition.GetAbsoluteRoom() == currentRoom) { if (didDamage == false && !player.IsStealthed) { didDamage = true; GameManager.Instance.StartCoroutine(this.DamageTimer()); if (player.HasPickupID(822) || player.HasPickupID(457)) { Gun gun = PickupObjectDatabase.GetById(616) as Gun; GameActorHealthEffect bleedEffect = new GameActorHealthEffect { TintColor = Color.red, DeathTintColor = Color.red, AppliesTint = true, AppliesDeathTint = true, AffectsEnemies = true, AffectsPlayers = false, effectIdentifier = "sharpguonbleed", resistanceType = EffectResistanceType.None, duration = 3f, DamagePerSecondToEnemies = 3f, stackMode = GameActorEffect.EffectStackingMode.Refresh }; component.ApplyEffect(bleedEffect, 1, null); Vector3 vector = component.sprite.WorldBottomLeft.ToVector3ZisY(0); Vector3 vector2 = component.sprite.WorldTopRight.ToVector3ZisY(0); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 50f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 3f; float? startLifetime = new float?(UnityEngine.Random.Range(12, 20f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD); } component.healthHaver.ApplyDamage(4f, Vector2.zero, "Sharp Guon", CoreDamageTypes.None, DamageCategory.Normal, false, null, false); } } } }
private void Update() { particleCounter += BraveTime.DeltaTime * 40f; if (particleCounter > 1f) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, m_self.sprite.WorldBottomLeft.ToVector3ZisY(0f), m_self.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } }
private void preCollide(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider) { if (baseEnemy && baseEnemy.EnemyScale.x < 0.55f) { if (otherRigidbody.GetComponent <PlayerController>()) { baseEnemy.EraseFromExistenceWithRewards(false); GlobalSparksDoer.DoRandomParticleBurst(5, baseEnemy.specRigidbody.UnitBottomLeft, baseEnemy.specRigidbody.UnitTopRight, new Vector3(1, 1, 1), 360, 4, null, null, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD); } } }
protected override void Update() { base.Update(); if (this.everPickedUpByPlayer && this.Owner == null && this.canEat) { this.fiveSecondsTimer -= BraveTime.DeltaTime; if (this.fiveSecondsTimer <= 0) { this.gun.gameObject.AddComponent <CantEatBehavior>(); if (this.gun.sprite != null) { SpawnManager.SpawnVFX(ResourceCache.Acquire("Global VFX/VFX_Curse") as GameObject, this.gun.sprite.WorldTopLeft + Vector2.up / 2f, Quaternion.identity); } } } if (!this.canEat && !this.Owner) { Vector3 vector = this.gun.sprite.WorldBottomLeft.ToVector3ZisY(0); Vector3 vector2 = this.gun.sprite.WorldTopRight.ToVector3ZisY(0); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 25f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 0.2f; float? startLifetime = new float?(UnityEngine.Random.Range(0.8f, 1.25f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } if (this.Owner != null) { this.fiveSecondsTimer = 5f; } if (this.Player != null) { if (this.Player.PlayerHasActiveSynergy("#LITERALLY")) { foreach (ProjectileModule mod in this.gun.Volley.projectiles) { mod.projectiles[0] = HotDogController.literallySynergyReplacementProjectile; } } else { foreach (ProjectileModule mod in this.gun.Volley.projectiles) { mod.projectiles[0] = HotDogController.hotDogBasicProjectile; } } } }
public override void EffectTick(GameActor actor, RuntimeGameActorEffectData effectData) { base.EffectTick(actor, effectData); if (GameManager.Options.ShaderQuality == GameOptions.GenericHighMedLowOption.HIGH && effectData.actor && effectData.actor.specRigidbody.HitboxPixelCollider != null) { Vector2 unitBottomLeft = effectData.actor.specRigidbody.HitboxPixelCollider.UnitBottomLeft; Vector2 unitTopRight = effectData.actor.specRigidbody.HitboxPixelCollider.UnitTopRight; this.m_emberCounter += 30f * BraveTime.DeltaTime; if (this.m_emberCounter > 1f) { int num = Mathf.FloorToInt(this.m_emberCounter); this.m_emberCounter -= (float)num; GlobalSparksDoer.DoRandomParticleBurst(num, unitBottomLeft, unitTopRight, new Vector3(1f, 1f, 0f), 120f, 0.75f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } if (actor && actor.specRigidbody) { Vector2 unitDimensions = actor.specRigidbody.HitboxPixelCollider.UnitDimensions; Vector2 a = unitDimensions / 2f; int num2 = Mathf.RoundToInt((float)this.flameNumPerSquareUnit * 0.5f * Mathf.Min(30f, Mathf.Min(new float[] { unitDimensions.x *unitDimensions.y }))); this.m_particleTimer += BraveTime.DeltaTime * (float)num2; if (this.m_particleTimer > 1f) { int num3 = Mathf.FloorToInt(this.m_particleTimer); Vector2 vector = actor.specRigidbody.HitboxPixelCollider.UnitBottomLeft; Vector2 vector2 = actor.specRigidbody.HitboxPixelCollider.UnitTopRight; PixelCollider pixelCollider = actor.specRigidbody.GetPixelCollider(ColliderType.Ground); if (pixelCollider != null && pixelCollider.ColliderGenerationMode == PixelCollider.PixelColliderGeneration.Manual) { vector = Vector2.Min(vector, pixelCollider.UnitBottomLeft); vector2 = Vector2.Max(vector2, pixelCollider.UnitTopRight); } vector += Vector2.Min(a * 0.15f, new Vector2(0.25f, 0.25f)); vector2 -= Vector2.Min(a * 0.15f, new Vector2(0.25f, 0.25f)); vector2.y -= Mathf.Min(a.y * 0.1f, 0.1f); GlobalSparksDoer.DoRandomParticleBurst(num3, vector, vector2, Vector3.zero, 0f, 0f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); this.m_particleTimer -= Mathf.Floor(this.m_particleTimer); } } if (actor.IsGone) { effectData.elapsed = 10000f; } if ((actor.IsFalling || actor.IsGone) && effectData.vfxObjects != null && effectData.vfxObjects.Count > 0) { GameActorFireEffect.DestroyFlames(effectData); } }
private System.Collections.IEnumerator InflictRage(PlayerController player) { bool flag = this.rageActive; if (flag) { base.StopCoroutine(this.removeRageCoroutine); this.RemoveStat(PlayerStats.StatType.Damage); player.stats.RecalculateStats(player, true, false); this.rageActive = false; } player.stats.RecalculateStats(player, true, false); RagePassiveItem rageitem = PickupObjectDatabase.GetById(353).GetComponent <RagePassiveItem>(); this.RageOverheadVFX = rageitem.OverheadVFX.gameObject; this.instanceVFX = base.Owner.PlayEffectOnActor(this.RageOverheadVFX, new Vector3(0f, 1.375f, 0f), true, true, false); this.AddStat(PlayerStats.StatType.Damage, 1.90f, StatModifier.ModifyMethod.MULTIPLICATIVE); player.stats.RecalculateStats(player, true, false); this.rageActive = true; float elapsed = 0f; float particleCounter = 0f; float Duration = 5f; while (elapsed < Duration) { elapsed += BraveTime.DeltaTime; base.Owner.baseFlatColorOverride = this.flatColorOverride.WithAlpha(Mathf.Lerp(this.flatColorOverride.a, 0f, Mathf.Clamp01(elapsed - (Duration - 1f)))); bool flag2 = GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && base.Owner && base.Owner.IsVisible && !base.Owner.IsFalling; if (flag2) { particleCounter += BraveTime.DeltaTime * 40f; bool flag3 = this.instanceVFX && elapsed > 1f; if (flag3) { this.instanceVFX.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); this.instanceVFX = null; } bool flag4 = particleCounter > 1f; if (flag4) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, base.Owner.sprite.WorldBottomLeft.ToVector3ZisY(0f), base.Owner.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } yield return(null); } this.removeRageCoroutine = GameManager.Instance.StartCoroutine(this.RemoveRage(player)); yield break; }
public override void Update() { base.Update(); if (this.m_pickedUp && this.m_isCurrentlyActive && this.LastOwner != null) { this.LastOwner.baseFlatColorOverride = new Color(0.5f, 0f, 0f).WithAlpha(0.75f); particleCounter += BraveTime.DeltaTime * 40f; if (particleCounter > 1f) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, this.LastOwner.sprite.WorldBottomLeft.ToVector3ZisY(0f), this.LastOwner.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } }
private void DoParticleBurst(Projectile proj) { Vector3 vector = proj.sprite.WorldBottomLeft.ToVector3ZisY(0); Vector3 vector2 = proj.sprite.WorldTopRight.ToVector3ZisY(0); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 25f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 0.2f; float? startLifetime = new float?(UnityEngine.Random.Range(0.8f, 1.25f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.EMBERS_SWIRLING); }
private IEnumerator HandleDelayedFireDamage() { Vector2 BottomOffset1 = new Vector3(5, 2); Vector2 TopOffset1 = new Vector3(9, 6); Vector2 BottomOffset2 = new Vector3(4, 1); Vector2 TopOffset2 = new Vector3(8, 6); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(0.75f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.SOLID_SPARKLES); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(1.5f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.SOLID_SPARKLES); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(2.25f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.SOLID_SPARKLES); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(3), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.SOLID_SPARKLES); yield return(new WaitForSeconds(2f)); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(1.75f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.STRAIGHT_UP_FIRE); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(2.5f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.STRAIGHT_UP_FIRE); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(3.25f), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.STRAIGHT_UP_FIRE); GlobalSparksDoer.DoRandomParticleBurst(25, (sprite.WorldBottomLeft + BottomOffset2), (sprite.WorldBottomLeft + TopOffset2), Vector3.up, 70f, 0.5f, null, new float?(4), new Color?(new Color(4f, 0.3f, 0f)), GlobalSparksDoer.SparksType.STRAIGHT_UP_FIRE); Exploder.DoDefaultExplosion((transform.position + PitOffset.ToVector3() + new Vector3(1, 0)), Vector2.zero, ignoreQueues: true); specRigidbody.PixelColliders[0].Enabled = false; specRigidbody.RecheckTriggers = true; specRigidbody.RegenerateColliders = true; IntVector2 basePosition = (transform.position.IntXY(VectorConversions.Floor) + PitOffset); IntVector2 cellPos = basePosition; IntVector2 cellPos2 = (basePosition + new IntVector2(1, 0)); DeadlyDeadlyGoopManager.ForceClearGoopsInCell(cellPos); DeadlyDeadlyGoopManager.ForceClearGoopsInCell(cellPos2); sprite.SetSprite("Jungle_Tree_Large_Open"); yield return(new WaitForSeconds(0.4f)); m_ParentRoom.ForcePitfallForFliers = true; CellData cellData = GameManager.Instance.Dungeon.data[cellPos]; CellData cellData2 = GameManager.Instance.Dungeon.data[cellPos2]; cellData.fallingPrevented = false; cellData2.fallingPrevented = false; GameObject JungleTreeFrame = Instantiate(JungleTreeTopFrame, transform.position, Quaternion.identity); if (m_ParentRoom != null) { JungleTreeFrame.transform.SetParent(m_ParentRoom.hierarchyParent, true); } yield break; }
private void FixedUpdate() { if (sprite) { vector = sprite.WorldBottomLeft.ToVector3ZisY(zOffset); vectorDos = sprite.WorldTopRight.ToVector3ZisY(zOffset); float num = (vectorDos.y - vector.y) * (vectorDos.x - vector.x); float num2 = 25f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vectorDos; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 0.2f; float? startLifetime = new float?(UnityEngine.Random.Range(0.8f, 1.25f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD); } }
private void DoParticles() { if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW) { Vector3 vector = Rigidbody.UnitBottomLeft.ToVector3ZisY(0f); Vector3 vector2 = Rigidbody.UnitTopRight.ToVector3ZisY(0f); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 40 * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 up = Vector3.up; float angleVariance = 120f; float magnitudeVariance = 0.5f; float? startLifetime = new float?(UnityEngine.Random.Range(1f, 1.65f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, up, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } }
private IEnumerator HandleRageDur(float dur) { remainingRageTime = dur; m_attachedPlayer.stats.RecalculateStats(m_attachedPlayer, true, false); this.instanceVFX = m_attachedPlayer.PlayEffectOnActor(RageVFX, new Vector3(0f, 1.375f, 0f), true, true, false); ///ETGModConsole.Log("Applied VFX"); m_attachedPlayer.ownerlessStatModifiers.Add(DoubleDamageStatMod); m_attachedPlayer.stats.RecalculateStats(m_attachedPlayer, true, false); // ETGModConsole.Log("Applied DMG"); float elapsed = 0f; float particleCounter = 0f; while (elapsed < remainingRageTime) { elapsed += BraveTime.DeltaTime; m_attachedPlayer.baseFlatColorOverride = this.flatColorOverride.WithAlpha(Mathf.Lerp(this.flatColorOverride.a, 0f, Mathf.Clamp01(elapsed - (remainingRageTime - 1f)))); if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && m_attachedPlayer && m_attachedPlayer.IsVisible && !m_attachedPlayer.IsFalling) { particleCounter += BraveTime.DeltaTime * 40f; if (this.instanceVFX && elapsed > 1f) { this.instanceVFX.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); this.instanceVFX = null; } if (particleCounter > 1f) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, m_attachedPlayer.sprite.WorldBottomLeft.ToVector3ZisY(0f), m_attachedPlayer.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } yield return(null); } if (this.instanceVFX) { this.instanceVFX.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); } m_attachedPlayer.ownerlessStatModifiers.Remove(DoubleDamageStatMod); m_attachedPlayer.stats.RecalculateStats(m_attachedPlayer, true, false); remainingRageTime = 0; }
private void OnHitEnemy(Projectile arg1, SpeculativeRigidbody arg2, bool arg3) { if (bighead2 == 6) { base.StartCoroutine(this.HandleFear(gun.CurrentOwner as PlayerController, arg2)); } if (bighead2 == 5) { GameActorHealthEffect irradiatedLeadEffect = PickupObjectDatabase.GetById(204).GetComponent <BulletStatusEffectItem>().HealthModifierEffect; arg2.aiActor.ApplyEffect(irradiatedLeadEffect, 2f, arg1); } if (bighead2 == 2) { GameActorFireEffect hotLeadEffect = PickupObjectDatabase.GetById(295).GetComponent <BulletStatusEffectItem>().FireModifierEffect; arg2.aiActor.ApplyEffect(hotLeadEffect, 2f, arg1); } if (bighead2 == 1) { arg2.aiActor.healthHaver.ApplyDamage(1f * (gun.CurrentOwner as PlayerController).stats.GetStatValue(PlayerStats.StatType.Damage), Vector2.zero, "Erasure", CoreDamageTypes.None, DamageCategory.Normal, true, null, false); GlobalSparksDoer.DoRadialParticleBurst(50, arg2.specRigidbody.HitboxPixelCollider.UnitCenter, arg2.specRigidbody.HitboxPixelCollider.UnitCenter, 90f, 2f, 0f, null, null, Color.red, GlobalSparksDoer.SparksType.BLOODY_BLOOD); } if (bighead2 == 3) { arg2.aiActor.ApplyEffect(this.cheeseEffect, 3f, null); } if (bighead2 == 7) { GameActorCharmEffect charmingRoundsEffect = PickupObjectDatabase.GetById(527).GetComponent <BulletStatusEffectItem>().CharmModifierEffect; arg2.aiActor.ApplyEffect(charmingRoundsEffect, 3f, null); } if (bighead2 == 4) { GameActorFreezeEffect frostBulletsEffect = PickupObjectDatabase.GetById(278).GetComponent <BulletStatusEffectItem>().FreezeModifierEffect; arg2.aiActor.ApplyEffect(frostBulletsEffect, 3f, null); } if (bighead2 == 8) { GameActorSpeedEffect tripleCrossbowSlowEffect = (PickupObjectDatabase.GetById(381) as Gun).DefaultModule.projectiles[0].speedEffect; arg2.aiActor.ApplyEffect(tripleCrossbowSlowEffect, 3f, null); } }
protected override void Update() { if (this.PickedUp && this.Player != null) { if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW) { Vector3 vector = this.Owner.sprite.WorldBottomLeft.ToVector3ZisY(0f); Vector3 vector2 = this.Owner.sprite.WorldTopRight.ToVector3ZisY(0f); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 50f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 up = Vector3.up; float angleVariance = 120f; float magnitudeVariance = 0.5f; float? startLifetime = new float?(UnityEngine.Random.Range(1f, 1.65f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, up, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } if (GameManager.Instance != null && GameManager.Instance.Dungeon != null && !GameManager.Instance.Dungeon.CurseReaperActive) { GameManager.Instance.Dungeon.CurseReaperActive = true; } if (SuperReaperController.Instance != null && SuperReaperController.Instance.gameObject != null) { Destroy(SuperReaperController.Instance.gameObject); } } if (!this.gun.PreventNormalFireAudio) { this.gun.PreventNormalFireAudio = true; } if (!this.gun.IsReloading && !this.HasReloaded) { this.HasReloaded = true; } base.Update(); }
protected void Update() { PlayerController player = this.gun.CurrentOwner as PlayerController; bool flag4 = !player; if (flag4) { Vector3 vector = this.gun.sprite.WorldBottomLeft.ToVector3ZisY(0f); Vector3 vector2 = this.gun.sprite.WorldTopRight.ToVector3ZisY(0f); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 25f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 0.2f; float? startLifetime = new float?(UnityEngine.Random.Range(0.8f, 1.25f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } }
private IEnumerator HandleRage() { this.m_isRaged = true; this.instanceVFX = null; RagePassiveItem rageitem = PickupObjectDatabase.GetById(353).GetComponent <RagePassiveItem>(); this.OverheadVFX = rageitem.OverheadVFX.gameObject; if (this.OverheadVFX) { this.instanceVFX = base.LastOwner.PlayEffectOnActor(this.OverheadVFX, new Vector3(0f, 1.375f, 0f), true, true, false); } StatModifier damageStat = new StatModifier(); damageStat.amount = this.boostAmount; damageStat.modifyType = StatModifier.ModifyMethod.MULTIPLICATIVE; damageStat.statToBoost = PlayerStats.StatType.Damage; base.LastOwner.ownerlessStatModifiers.Add(damageStat); StatModifier speedStat = new StatModifier(); speedStat.amount = this.boostAmount; speedStat.modifyType = StatModifier.ModifyMethod.ADDITIVE; speedStat.statToBoost = PlayerStats.StatType.MovementSpeed; base.LastOwner.ownerlessStatModifiers.Add(speedStat); base.LastOwner.stats.RecalculateStats(base.LastOwner, false, false); if (base.LastOwner.CurrentGun != null) { base.LastOwner.CurrentGun.ForceImmediateReload(false); } this.m_elapsed = 0f; float particleCounter = 0f; while (this.m_elapsed < this.rageDuration) { this.m_elapsed += BraveTime.DeltaTime; base.LastOwner.baseFlatColorOverride = this.flatColorOverride.WithAlpha(Mathf.Lerp(this.flatColorOverride.a, 0f, Mathf.Clamp01(this.m_elapsed - (this.rageDuration - 1f)))); if (this.instanceVFX && this.m_elapsed > 1f) { this.instanceVFX.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); this.instanceVFX = null; } if (GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.LOW && GameManager.Options.ShaderQuality != GameOptions.GenericHighMedLowOption.VERY_LOW && base.LastOwner && base.LastOwner.IsVisible && !base.LastOwner.IsFalling) { particleCounter += BraveTime.DeltaTime * 40f; if (particleCounter > 1f) { int num = Mathf.FloorToInt(particleCounter); particleCounter %= 1f; GlobalSparksDoer.DoRandomParticleBurst(num, base.LastOwner.sprite.WorldBottomLeft.ToVector3ZisY(0f), base.LastOwner.sprite.WorldTopRight.ToVector3ZisY(0f), Vector3.up, 90f, 0.5f, null, null, null, GlobalSparksDoer.SparksType.BLACK_PHANTOM_SMOKE); } } yield return(null); } if (this.instanceVFX) { this.instanceVFX.GetComponent <tk2dSpriteAnimator>().PlayAndDestroyObject("rage_face_vfx_out", null); } base.LastOwner.ownerlessStatModifiers.Remove(damageStat); base.LastOwner.ownerlessStatModifiers.Remove(speedStat); base.LastOwner.stats.RecalculateStats(base.LastOwner, false, false); this.m_isRaged = false; yield break; }
private void HandlePostRigidbodyMovement(SpeculativeRigidbody inSrb, Vector2 inVec2, IntVector2 inPixels) { if (!this.m_player || this.m_player.IsGhost || this.m_player.IsStealthed || Dungeon.IsGenerating || BraveTime.DeltaTime == 0f) { return; } if (this.m_player.HasPickupID(Vampirecloak.VampirecloakPickupID)) { RedMatterParticleController redMatterController = GlobalSparksDoer.GetRedMatterController(); BloodthirstSettings bloodthirstOptions = GameManager.Instance.BloodthirstOptions; float radius = 5f; float damagePerSecond = 10f; float SynergydamagePerSecond = 20f; float percentAffected = 1f; int gainPerHeal = 5; int maxRequired = 50; if (this.AuraAction == null) { this.AuraAction = delegate(AIActor actor, float dist) { if (!actor || !actor.healthHaver) { return; } actor.HasBeenBloodthirstProcessed = true; actor.CanBeBloodthirsted = (UnityEngine.Random.value < percentAffected); if (actor.CanBeBloodthirsted && actor.sprite) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(actor.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(1f, 0f, 0f)); } } if (dist < radius && actor.CanBeBloodthirsted && !actor.IsGone) { float Synergydamage = SynergydamagePerSecond * BraveTime.DeltaTime; float damage = damagePerSecond * BraveTime.DeltaTime; bool isDead = actor.healthHaver.IsDead; if (m_player.HasPickupID(285)) { actor.healthHaver.ApplyDamage(Synergydamage, Vector2.zero, "Bloodthirst", CoreDamageTypes.None, DamageCategory.Normal, false, null, false); } if (!m_player.HasPickupID(285)) { actor.healthHaver.ApplyDamage(damage, Vector2.zero, "Bloodthirst", CoreDamageTypes.None, DamageCategory.Normal, false, null, false); } if (!isDead && actor.healthHaver.IsDead) { this.m_currentNumKills++; if (this.m_currentNumKills >= this.m_currentNumKillsRequired) { this.m_currentNumKills = 0; if (this.m_player.healthHaver.GetCurrentHealthPercentage() < 1f) { this.m_player.healthHaver.ApplyHealing(0.5f); this.m_currentNumKillsRequired = Mathf.Min(maxRequired, this.m_currentNumKillsRequired + gainPerHeal); GameObject gameObject = BraveResources.Load <GameObject>("Global VFX/VFX_Healing_Sparkles_001", ".prefab"); if (gameObject != null) { this.m_player.PlayEffectOnActor(gameObject, Vector3.zero, true, false, false); } AkSoundEngine.PostEvent("Play_OBJ_med_kit_01", this.gameObject); } } } GlobalSparksDoer.DoRadialParticleBurst(3, actor.specRigidbody.HitboxPixelCollider.UnitBottomLeft, actor.specRigidbody.HitboxPixelCollider.UnitTopRight, 90f, 4f, 0f, null, null, null, GlobalSparksDoer.SparksType.RED_MATTER); } }; } if (this.m_player != null && this.m_player.CurrentRoom != null) { this.m_player.CurrentRoom.ApplyActionToNearbyEnemies(this.m_player.CenterPosition, 100f, this.AuraAction); } if (redMatterController) { redMatterController.target.position = this.m_player.CenterPosition; redMatterController.ProcessParticles(); } } }
private IEnumerator HandleTransitionToBellyFloor(PlayerController player) { player.ToggleRenderer(false, "got eaten"); player.ToggleGunRenderers(false, "got eaten"); player.ToggleHandRenderers(false, "got eaten"); yield return(null); float elapsed = 0f; float duration = 0.5f; Vector3 startPos = player.specRigidbody.GetUnitCenter(ColliderType.Ground); Vector3 finalOffset = (transform.position + new Vector3(4, 6)); GameObject dummySpriteObject = new GameObject("PlayerSpriteDupe", new Type[] { typeof(tk2dSprite) }) { layer = 22 }; dummySpriteObject.transform.position = startPos; tk2dSprite targetSprite = dummySpriteObject.GetComponent <tk2dSprite>(); ExpandUtility.DuplicateSprite(targetSprite, (player.sprite as tk2dSprite)); targetSprite.SetSprite(player.sprite.spriteId); yield return(null); AkSoundEngine.PostEvent("Stop_MUS_All", gameObject); while (elapsed < duration) { elapsed += BraveTime.DeltaTime; if (!targetSprite || !targetSprite.transform) { break; } targetSprite.transform.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.01f, 0.01f, 1f), elapsed / duration); targetSprite.transform.position = Vector3.Lerp(startPos, finalOffset, elapsed / duration); yield return(null); } // AkSoundEngine.PostEvent("Play_CHR_muncher_eat_01", gameObject); // yield return new WaitForSeconds(0.15f); AkSoundEngine.PostEvent("Play_VO_lichA_cackle_01", gameObject); Vector2 BottomOffset = dummySpriteObject.transform.position; Vector2 TopOffset = dummySpriteObject.transform.position + new Vector3(1, 1); Color TargetColor = new Color(0.5f, 0.1f, 0.1f); GlobalSparksDoer.DoRandomParticleBurst(25, BottomOffset, TopOffset, new Vector3(-1, 1), 70f, 0.5f, null, new float?(0.75f), new Color?(TargetColor), GlobalSparksDoer.SparksType.BLOODY_BLOOD); GlobalSparksDoer.DoRandomParticleBurst(25, BottomOffset, TopOffset, Vector3.left, 70f, 0.5f, null, new float?(1.5f), new Color?(TargetColor), GlobalSparksDoer.SparksType.BLOODY_BLOOD); GlobalSparksDoer.DoRandomParticleBurst(25, BottomOffset, TopOffset, Vector3.left, 70f, 0.5f, null, new float?(2.25f), new Color?(TargetColor), GlobalSparksDoer.SparksType.BLOODY_BLOOD); GlobalSparksDoer.DoRandomParticleBurst(25, BottomOffset, TopOffset, new Vector3(-1, -1), 70f, 0.5f, null, new float?(3), new Color?(TargetColor), GlobalSparksDoer.SparksType.BLOODY_BLOOD); yield return(new WaitForSeconds(1)); Pixelator.Instance.FadeToBlack(0.15f, false, 0f); yield return(new WaitForSeconds(0.3f)); AkSoundEngine.PostEvent("Play_CHR_muncher_chew_01", gameObject); yield return(new WaitForSeconds(4));; Destroy(dummySpriteObject); player.ToggleRenderer(true, "got eaten"); player.ToggleGunRenderers(true, "got eaten"); player.ToggleHandRenderers(true, "got eaten"); player.ClearAllInputOverrides(); GameManager.Instance.LoadCustomLevel("tt_belly"); yield break; }