protected void SecondShoot(Motherboard boss) { if (!boss.isInsideTerrain()) { --_secondShootTime; } if (_secondShootTime <= 0) { _secondShootTime = SecondShootRate; for (int i = 0; i < 2; i++) { Main.PlaySound(SoundID.Item113.WithPitchVariance(Main.rand.NextFloat()), boss.npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(boss.npc.Center.X, boss.npc.Center.Y + 95, 0, 0, boss.mod.ProjectileType("projMotherboardSuperLaser"), SecondShootDamage, SecondShootKn, 0, boss.npc.whoAmI, i); } } } }
public override void Start(Motherboard boss) { _clampers = new List <int> { NPC.NewNPC((int)boss.npc.Center.X - 15, (int)boss.npc.Center.Y + 25, boss.mod.NPCType("Clamper"), 0, 0, 0, 0, boss.npc.whoAmI), NPC.NewNPC((int)boss.npc.Center.X - 10, (int)boss.npc.Center.Y + 25, boss.mod.NPCType("Clamper"), 0, 0, 0, 0, boss.npc.whoAmI), NPC.NewNPC((int)boss.npc.Center.X + 10, (int)boss.npc.Center.Y + 25, boss.mod.NPCType("Clamper"), 0, 0, 0, 0, boss.npc.whoAmI), NPC.NewNPC((int)boss.npc.Center.X + 15, (int)boss.npc.Center.Y + 25, boss.mod.NPCType("Clamper"), 0, 0, 0, 0, boss.npc.whoAmI) }; for (int i = 0; i <= 3; i++) { Main.npc[_clampers[i]].localAI[1] = i + 1; } boss.npc.dontTakeDamage = false; boss.npc.aiStyle = 2; Main.PlaySound(15, (int)boss.npc.position.X, (int)boss.npc.position.Y, 2, pitchOffset: Main.rand.NextFloat()); // high tonal boss screech Main.PlaySound(SoundID.DD2_LightningBugDeath.AsSound().WithPitchVariance(Main.rand.NextFloat()).WithVolume(Main.soundVolume * 1.5f), boss.npc.position); }
private void ShootOneLaser(Motherboard boss) { // this code is still poop try { int ai0 = _lastSignalDrone == -1 ? boss.npc.whoAmI : _signalDrones[_lastSignalDrone]; ++_lastSignalDrone; var zapSound = new LegacySoundStyle(SoundID.Trackable, TremorUtils.GetIdForSoundName($"dd2_lightning_aura_zap_{Main.rand.Next(4)}")); Main.PlayTrackedSound(zapSound.WithPitchVariance(Main.rand.NextFloat() * .5f).WithVolume(Main.soundVolume * 1.5f)); int newProj = Projectile.NewProjectile(boss.npc.Center.X, boss.npc.Center.Y, 0, 0, boss.mod.ProjectileType("projMotherboardLaser"), LaserDamage, LaserKb, 0, ai0, _signalDrones[_lastSignalDrone]); if (_lastSignalDrone == 0) { Main.projectile[newProj].localAI[1] = 1; } } catch { // POOP I TELL YOU } }
public override void AI(Motherboard boss) { RemoveDeadDrones(boss); TrySpawnOneDrone(boss); if (_signalDrones.Count > 0) // we have drones, we can shoot { --_timeToShoot; if (_timeToShoot < 0) { // only shoot lasers if there are any and we are in moving phase if (boss.npc.ai[0] == -1) { ShootDroneLasers(boss); } } } else // no drones, advance stage { boss.stage = boss.stage2; boss.stage.Start(boss); } }
public virtual void Start(Motherboard boss) { }
public virtual void AdjustHead(Motherboard boss) { }
public virtual void AI(Motherboard motherboard) { }
public override void AI(Motherboard boss) { boss.Move(); boss.npc.TargetClosest(true); // this was never actually executed // not sure what is meant to do, or where it is supposed to go // for (int i = 0; i < _clampers.Count; i++) // Main.npc[_clampers[i]].ai[2] = 1; // following if (boss.npc.ai[1] == 0f) { // runs only SP/server side if (Main.netMode != 1) { // increment the something timer boss.npc.localAI[1] += 1f; // if the timer is due, plus some random amount of ticks if (boss.npc.localAI[1] >= 120 + Main.rand.Next(200)) { boss.npc.localAI[1] = 0f; boss.npc.TargetClosest(true); // attempt to find coords somewhere around the target (max 100 tries) // break as soon as we find a place around the player that we can move to for (int attempts = 0; attempts < 100; attempts++) { Player target = Main.player[boss.npc.target]; int coordX = (int)target.Center.X / 16 + Main.rand.Next(-50, 51); int coordY = (int)target.Center.Y / 16 + Main.rand.Next(-50, 51); if (!WorldGen.SolidTile(coordX, coordY) && Collision.CanHit(new Vector2(coordX, coordY).ToWorldCoordinates(), 1, 1, target.position, target.width, target.height)) { boss.npc.teleportTime = 1f; boss.npc.ai[1] = 1f; boss.npc.ai[2] = coordX; boss.npc.ai[3] = coordY; boss.npc.netUpdate = true; break; } } return; } } } // disappearing else if (boss.npc.ai[1] == 1f) { ChangeAlpha(boss, 3); // finished disappearing if (boss.npc.alpha >= 255) { boss.npc.teleportTime = 0f; boss.npc.position.X = boss.npc.ai[2] * 16f - boss.npc.width / 2; boss.npc.position.Y = boss.npc.ai[3] * 16f - boss.npc.height / 2; boss.npc.ai[1] = 2f; // Motherboard screech var screech = new LegacySoundStyle(SoundID.Trackable, TremorUtils.GetIdForSoundName($"dd2_lightning_bug_death_{Main.rand.Next(3)}")); Main.PlayTrackedSound(screech.WithPitchVariance(Main.rand.NextFloat())); //Main.PlaySound(SoundID.DD2_LightningBugDeath.WithPitchVariance(Main.rand.NextFloat()).WithVolume(Main.soundVolume * 2.5f), boss.npc.position); Main.PlaySound(SoundID.Item78.WithVolume(Main.soundVolume * 1.15f), boss.npc.position); // tp return; } } // appearing else if (boss.npc.ai[1] == 2f) { ChangeAlpha(boss, -3); // finished appearing if (boss.npc.alpha <= 0) { boss.npc.ai[1] = 0f; return; } } // not finished appearing, disappearing, or didn't find a new place to move to....? CheckClampers(boss); SecondShoot(boss); }
protected void ChangeAlpha(Motherboard boss, float difference) { boss.npc.alpha = (int)MathHelper.Clamp(boss.npc.alpha + difference, 0, 255); }
public override void AdjustHead(Motherboard boss) { Main.npcHeadBossTexture[boss.headTexture] = boss.mod.GetTexture("NPCs/Motherboard_Head_Boss"); }