private void Update() { if (m_projectile != null) { if (timer > 0) { timer -= BraveTime.DeltaTime; } if (timer <= 0) { this.tongue = this.DoTongueFlick(m_projectile); cooldownTime *= 2f; timer = cooldownTime; hasKnockedBackEnemy = false; } if (tongue != null && !this.hasKnockedBackEnemy) { RaidenBeamController slurp = tongue.GetComponent <RaidenBeamController>(); List <AIActor> targets = Stuff.ReflectGetField <List <AIActor> >(typeof(RaidenBeamController), "m_targets", slurp); foreach (AIActor enemy in targets) { if (enemy && enemy.healthHaver && enemy.healthHaver.IsAlive && enemy.knockbackDoer && !enemy.gameActor.behaviorSpeculator.IsStunned) { hasKnockedBackEnemy = true; float origWeight = enemy.knockbackDoer.weight; enemy.knockbackDoer.weight = 10; enemy.knockbackDoer.shouldBounce = false; float distance = m_projectile.baseData.speed * 0.2f; Vector2 angle = m_projectile.Direction; Vector2 vector = BraveMathCollege.DegreesToVector(angle.ToAngle(), distance); enemy.knockbackDoer.ApplyKnockback((enemy.specRigidbody.UnitCenter - (m_projectile.sprite.WorldCenter + vector)), -5f * Vector2.Distance(enemy.specRigidbody.UnitCenter, m_projectile.sprite.WorldCenter)); if (!enemy.gameActor.behaviorSpeculator.IsStunned) { enemy.gameActor.behaviorSpeculator.Stun(2f, true); } enemy.knockbackDoer.weight = origWeight; } } } } }
private void Update() { if (this.user != null && Time.frameCount % 10 == 0 && this.proj) { GungeonActions m_activeActions = Stuff.ReflectGetField <GungeonActions>(typeof(PlayerController), "m_activeActions", this.user); bool IsKeyboardAndMouse = BraveInput.GetInstanceForPlayer(this.user.PlayerIDX).IsKeyboardAndMouse(false); if (IsKeyboardAndMouse) { this.spawnpos = this.user.unadjustedAimPoint.XY() - (this.user.CenterPosition - this.user.specRigidbody.UnitCenter); } else { if (m_activeActions != null) { spawnpos = m_activeActions.Aim.Vector; } } this.proj.SendInDirection(spawnpos - this.proj.specRigidbody.UnitCenter, true); this.proj.shouldRotate = false; } }
private static IEnumerator HandleBlinkTeleport(PlayerController Owner, Vector2 targetPoint, Vector2 targetDirection) { //targetPoint = (targetPoint - new Vector2(0.30f, 0.125f)); //Owner.PlayEffectOnActor(BloodiedScarfPoofVFX, Vector3.zero, false, true, false); AkSoundEngine.PostEvent("Play_ENM_wizardred_vanish_01", Owner.gameObject); List <AIActor> m_rollDamagedEnemies = Stuff.ReflectGetField <List <AIActor> >(typeof(PlayerController), "m_rollDamagedEnemies", Owner); if (m_rollDamagedEnemies != null) { m_rollDamagedEnemies.Clear(); FieldInfo m_rollDamagedEnemiesClear = typeof(PlayerController).GetField("m_rollDamagedEnemies", BindingFlags.Instance | BindingFlags.NonPublic); m_rollDamagedEnemiesClear.SetValue(Owner, m_rollDamagedEnemies); } if (Owner.knockbackDoer) { Owner.knockbackDoer.ClearContinuousKnockbacks(); } Owner.IsEthereal = true; Owner.IsVisible = false; float RecoverySpeed = GameManager.Instance.MainCameraController.OverrideRecoverySpeed; bool IsLerping = GameManager.Instance.MainCameraController.IsLerping; yield return(new WaitForSeconds(0.1f)); GameManager.Instance.MainCameraController.OverrideRecoverySpeed = 80f; GameManager.Instance.MainCameraController.IsLerping = true; if (Owner.IsPrimaryPlayer) { GameManager.Instance.MainCameraController.UseOverridePlayerOnePosition = true; GameManager.Instance.MainCameraController.OverridePlayerOnePosition = targetPoint; yield return(new WaitForSeconds(0.12f)); Owner.specRigidbody.Velocity = Vector2.zero; Owner.specRigidbody.Position = new Position(targetPoint); GameManager.Instance.MainCameraController.UseOverridePlayerOnePosition = false; } else { GameManager.Instance.MainCameraController.UseOverridePlayerTwoPosition = true; GameManager.Instance.MainCameraController.OverridePlayerTwoPosition = targetPoint; yield return(new WaitForSeconds(0.12f)); Owner.specRigidbody.Velocity = Vector2.zero; Owner.specRigidbody.Position = new Position(targetPoint); GameManager.Instance.MainCameraController.UseOverridePlayerTwoPosition = false; } GameManager.Instance.MainCameraController.OverrideRecoverySpeed = RecoverySpeed; GameManager.Instance.MainCameraController.IsLerping = IsLerping; Owner.IsEthereal = false; Owner.IsVisible = true; //Owner.PlayEffectOnActor(BloodiedScarfPoofVFX, Vector3.zero, false, true, false); //m_CurrentlyBlinking = false; if (Owner.CurrentFireMeterValue <= 0f) { yield break; } Owner.CurrentFireMeterValue = Mathf.Max(0f, Owner.CurrentFireMeterValue -= 0.5f); if (Owner.CurrentFireMeterValue == 0f) { Owner.IsOnFire = false; yield break; } // yield return null; //CorrectForWalls(Owner); yield break; }