//Doubles the damage, makes the next shot kill the player, and stores the amount we buffed the player for later private void StartEffect(PlayerController user) { //user.healthHaver.NextShotKills = true; ETGModConsole.Log("start"); RagePassiveItem rageitem = PickupObjectDatabase.GetById(353).GetComponent <RagePassiveItem>(); RageOverheadVFX = rageitem.OverheadVFX.gameObject; user.PlayEffectOnActor(this.RageOverheadVFX, Vector3.zero, true, true, false); }
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; }
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; }