protected override void Update() { if (this.m_extantOrbital != null & Owner) { if (Owner.IsInCombat && extantBeam == null) { extantBeam = BeamToolbox.FreeFireBeamFromAnywhere(InfraredBeam, Owner, this.m_extantOrbital, Vector2.zero, false, 0, float.MaxValue); extantBeam.projectile.gameObject.AddComponent <AlwaysPointAwayFromPlayerBeam>(); if (Owner.PlayerHasActiveSynergy("Infraredder Guon Stone")) { extantBeam.projectile.baseData.damage *= 2; } if (Owner.PlayerHasActiveSynergy("Xenochrome")) { extantBeam.GetComponent <BasicBeamController>().penetration++; extantBeam.GetComponent <BasicBeamController>().reflections++; } } else if (!Owner.IsInCombat && extantBeam != null) { extantBeam.CeaseAttack(); extantBeam = null; } } else if (((m_extantOrbital == null) || (Owner == null)) && extantBeam != null) { extantBeam.CeaseAttack(); extantBeam = null; } base.Update(); }
public override void PostProcessProjectile(Projectile projectile) { if (projectile.ProjectilePlayerOwner()) { PlayerController player = projectile.ProjectilePlayerOwner(); if (player.PlayerHasActiveSynergy("Infrared Camera")) { foreach (PassiveItem item in player.passiveItems) { if (item is InfraredGuonStone) { GameObject orbital = (item as InfraredGuonStone).GimmeOrbital(); if (orbital != null) { float angle = 0; for (int i = 0; i < 8; i++) { BeamToolbox.FreeFireBeamFromAnywhere(InfraredGuonStone.InfraredBeam, player, orbital, Vector2.zero, false, angle, 1); angle += 45; } } } } } } base.PostProcessProjectile(projectile); }
private IEnumerator DoLaserAttack() { isAttacking = true; this.aiAnimator.PlayUntilFinished("attack", false, null, -1f, false); yield return(new WaitForSeconds(0.5f)); //Start Firing Lasers this.aiActor.MovementSpeed *= 0.0001f; this.aiAnimator.PlayForDuration("contattack", 1); Projectile beamToFire = LaserBullets.SimpleRedBeam.projectile; if (UnityEngine.Random.value <= 0.5f) { int angle = 135; for (int i = 0; i < 4; i++) { BeamController beam = BeamToolbox.FreeFireBeamFromAnywhere(beamToFire, this.m_owner, this.gameObject, Vector2.zero, false, angle, 1, true); Projectile beamprojcomponent = beam.GetComponent <Projectile>(); beamprojcomponent.baseData.damage *= 3f; if (PassiveItem.IsFlagSetForCharacter(this.Owner, typeof(BattleStandardItem))) { beamprojcomponent.baseData.damage *= BattleStandardItem.BattleStandardCompanionDamageMultiplier; } if (this.Owner.CurrentGun && this.Owner.CurrentGun.LuteCompanionBuffActive) { beamprojcomponent.baseData.damage *= 2; } angle -= 90; } } else { int angle = 180; for (int i = 0; i < 4; i++) { BeamController beam = BeamToolbox.FreeFireBeamFromAnywhere(beamToFire, this.m_owner, this.gameObject, Vector2.zero, false, angle, 1, true); Projectile beamprojcomponent = beam.GetComponent <Projectile>(); beamprojcomponent.baseData.damage *= 3f; if (PassiveItem.IsFlagSetForCharacter(this.Owner, typeof(BattleStandardItem))) { beamprojcomponent.baseData.damage *= BattleStandardItem.BattleStandardCompanionDamageMultiplier; } if (this.Owner.CurrentGun && this.Owner.CurrentGun.LuteCompanionBuffActive) { beamprojcomponent.baseData.damage *= 2; } angle -= 90; } } yield return(new WaitForSeconds(1f)); //Stop shit isAttacking = false; timer = 1.5f; this.aiActor.MovementSpeed /= 0.0001f; yield break; }
private IEnumerator HentaiTime() { yield return(new WaitForSeconds(1)); BeamToolbox.FreeFireBeamFromAnywhere((PickupObjectDatabase.GetById(474) as Gun).DefaultModule.projectiles[0], self.ProjectilePlayerOwner(), self.gameObject, Vector2.zero, false, 90, 5, true); BeamToolbox.FreeFireBeamFromAnywhere((PickupObjectDatabase.GetById(474) as Gun).DefaultModule.projectiles[0], self.ProjectilePlayerOwner(), self.gameObject, Vector2.zero, false, -45, 5, true); BeamToolbox.FreeFireBeamFromAnywhere((PickupObjectDatabase.GetById(474) as Gun).DefaultModule.projectiles[0], self.ProjectilePlayerOwner(), self.gameObject, Vector2.zero, false, -135, 5, true); yield return(new WaitForSeconds(6)); Die(); yield break; }
private void DoLaser(FlippableCover obj) { SpeculativeRigidbody rigidBody = obj.GetComponentInChildren <SpeculativeRigidbody>(); PlayerController owner = base.Owner; Vector2 vector = DungeonData.GetIntVector2FromDirection(obj.DirectionFlipped).ToVector2(); BeamController cont = BeamToolbox.FreeFireBeamFromAnywhere(lasa, owner, obj.gameObject, rigidBody.UnitCenter, false, vector.ToAngle(), 20, true); GameObject gameObject = SpawnManager.SpawnProjectile(lasa.gameObject, rigidBody.UnitCenter, Quaternion.identity, true); Projectile component = gameObject.GetComponent <Projectile>(); component.Owner = owner; BeamController component2 = gameObject.GetComponent <BeamController>(); component2.chargeDelay = 0f; component2.usesChargeDelay = false; component2.Owner = owner; component2.HitsPlayers = false; component2.HitsEnemies = true; component2.Direction = vector; component2.Origin = rigidBody.UnitCenter; GameManager.Instance.Dungeon.StartCoroutine(HandleFreeFiringBeam(component2, rigidBody, 20)); }