public override void AI() { if (projectile.localAI[0] == 0) { projectile.localAI[0] = Main.rand.NextBool() ? 1 : -1; projectile.localAI[1] = projectile.ai[1] - projectile.ai[0]; //store difference for animated spin startup projectile.rotation = Main.rand.NextFloat(MathHelper.TwoPi); } if (--projectile.ai[0] == 0) { projectile.netUpdate = true; projectile.velocity = Vector2.Zero; } if (--projectile.ai[1] == 0) { projectile.netUpdate = true; Player target = Main.player[Player.FindClosest(projectile.position, projectile.width, projectile.height)]; projectile.velocity = projectile.DirectionTo(target.Center); if (FargoSoulsUtil.BossIsAlive(ref NPCs.EModeGlobalNPC.abomBoss, ModContent.NPCType <NPCs.AbomBoss.AbomBoss>()) && Main.npc[NPCs.EModeGlobalNPC.abomBoss].localAI[3] > 1) { projectile.velocity *= 7f; } else { projectile.velocity *= 24f; } Main.PlaySound(SoundID.Item84, projectile.Center); } float rotation = projectile.ai[0] < 0 && projectile.ai[1] > 0 ? 1f - projectile.ai[1] / projectile.localAI[1] : 0.8f; projectile.rotation += rotation * projectile.localAI[0]; }
public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation() - (float)Math.PI / 2; if (Projectile.localAI[0] == 0) //choose a texture to use { Projectile.localAI[0] += Main.rand.Next(1, 4); } if (Projectile.timeLeft % Projectile.MaxUpdates == 0) { //if (Projectile.timeLeft < 45 * Projectile.MaxUpdates) Projectile.velocity *= 1.015f; if (++Projectile.frameCounter >= 6) { Projectile.frameCounter = 0; if (++Projectile.frame >= Main.projFrames[Projectile.type]) { Projectile.frame = 0; } } } if (++Projectile.localAI[1] > 10 && FargoSoulsUtil.BossIsAlive(ref NPCs.EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>())) { float yOffset = Projectile.Center.Y - Main.npc[NPCs.EModeGlobalNPC.mutantBoss].Center.Y; if (Math.Sign(yOffset) == Math.Sign(Projectile.velocity.Y) && Projectile.Distance(Main.npc[NPCs.EModeGlobalNPC.mutantBoss].Center) > 1200 + Projectile.ai[0]) { Projectile.timeLeft = 0; } } }
public override void Kill(int timeLeft) { if (Main.LocalPlayer.active && !Main.dedServ) { Main.LocalPlayer.GetModPlayer <FargoSoulsPlayer>().Screenshake = 30; } SoundEngine.PlaySound(SoundID.Item92, Projectile.Center); int type; switch ((int)Projectile.ai[0]) { case 0: type = 242; break; //nebula case 1: type = 127; break; //solar case 2: type = 229; break; //vortex default: type = 135; break; //stardust } for (int index = 0; index < 80; ++index) { Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, type, 0.0f, 0.0f, 0, new Color(), 1f)]; dust.velocity *= 10f; dust.fadeIn = 1f; dust.scale = 1 + Main.rand.NextFloat() + Main.rand.Next(4) * 0.3f; if (Main.rand.Next(3) != 0) { dust.noGravity = true; dust.velocity *= 3f; dust.scale *= 2f; } } if (Main.netMode != NetmodeID.MultiplayerClient) { int fragmentDuration = 240; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>()) && Main.npc[EModeGlobalNPC.mutantBoss].ai[0] == 19) { fragmentDuration = (int)Main.npc[EModeGlobalNPC.mutantBoss].localAI[0]; } const int max = 24; const float rotationInterval = 2f * (float)Math.PI / max; float speed = FargoSoulsWorld.MasochistModeReal ? 5.5f : 5f; for (int j = 0; j < 4; j++) { Vector2 vel = new Vector2(0f, speed * (j + 0.5f)).RotatedBy(Projectile.rotation); for (int i = 0; i < max; i++) { int p = Projectile.NewProjectile(Projectile.InheritSource(Projectile), Projectile.Center, vel.RotatedBy(rotationInterval * i), ModContent.ProjectileType <MutantFragment>(), Projectile.damage / 2, 0f, Main.myPlayer, Projectile.ai[0]); if (p != Main.maxProjectiles) { Main.projectile[p].timeLeft = fragmentDuration; } } } } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(BuffID.Wet, 420); //target.AddBuff(mod.BuffType("SqueakyToy"), Main.rand.Next(60, 180)); target.AddBuff(mod.BuffType("OceanicMaul"), 1800); target.GetModPlayer <FargoPlayer>().MaxLifeReduction += FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25; }
public override void Update(Player player, ref int buffIndex) { FargoPlayer fargoPlayer = player.GetModPlayer <FargoPlayer>(); player.poisoned = true; player.venom = true; player.ichor = true; player.onFire2 = true; player.electrified = true; //fargoPlayer.OceanicMaul = true; fargoPlayer.CurseoftheMoon = true; if (fargoPlayer.FirstInfection) { fargoPlayer.MaxInfestTime = player.buffTime[buffIndex]; fargoPlayer.FirstInfection = false; } fargoPlayer.Infested = true; fargoPlayer.Rotting = true; fargoPlayer.MutantNibble = true; fargoPlayer.noDodge = true; fargoPlayer.noSupersonic = true; fargoPlayer.MutantPresence = true; player.moonLeech = true; player.potionDelay = player.buffTime[buffIndex]; if (Fargowiltas.Instance.MasomodeEXLoaded && !FargoSoulsWorld.downedFishronEX && player.buffTime[buffIndex] > 1 && FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, mod.NPCType("MutantBoss"))) { player.AddBuff(ModLoader.GetMod("MasomodeEX").BuffType("MutantJudgement"), player.buffTime[buffIndex]); player.buffTime[buffIndex] = 1; } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(mod.BuffType("Defenseless"), 600); //target.AddBuff(BuffID.WitheredWeapon, 600); target.AddBuff(mod.BuffType("OceanicMaul"), 1800); target.GetModPlayer <FargoPlayer>().MaxLifeReduction += FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25; }
public override void AI() { if (!FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.beeBoss, NPCID.QueenBee) && !NPC.AnyNPCs(NPCID.QueenBee)) { NPC.life = 0; NPC.HitEffect(); NPC.checkDead(); return; } //tries to stinger, force into dash if (NPC.ai[0] != 0) { NPC.ai[0] = 0f; NPC.netUpdate = true; } if (NPC.ai[1] != 2f && NPC.ai[1] != 3f) { NPC.ai[1] = 2f; NPC.netUpdate = true; } NPC.position -= NPC.velocity / 3; }
public override bool CanHitPlayer(Player target) { if (Projectile.Colliding(Projectile.Hitbox, target.Hitbox)) { if (target.GetModPlayer <FargoSoulsPlayer>().DevianttHeartItem == null) { target.hurtCooldowns[0] = 0; int defense = target.statDefense; float endurance = target.endurance; target.statDefense = 0; target.endurance = 0; target.Hurt(PlayerDeathReason.ByCustomReason(target.name + " felt heartbroken."), Projectile.damage, 0, false, false, false, 0); target.statDefense = defense; target.endurance = endurance; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.deviBoss, ModContent.NPCType <NPCs.DeviBoss.DeviBoss>())) { target.AddBuff(ModContent.BuffType <Lovestruck>(), 240); } } else { target.statLife += 1; target.HealEffect(1); } Projectile.timeLeft = 0; } return(false); }
public override void AI() { if (!npc.GetGlobalNPC <EModeGlobalNPC>().masoBool[0]) { npc.GetGlobalNPC <EModeGlobalNPC>().masoBool[0] = true; Main.npcTexture[npc.type] = Main.npcTexture[NPCID.QueenBee]; } if (!FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.beeBoss, NPCID.QueenBee) && !NPC.AnyNPCs(NPCID.QueenBee)) { npc.life = 0; npc.HitEffect(); npc.checkDead(); return; } //tries to stinger, force into dash if (npc.ai[0] != 0) { npc.ai[0] = 0f; npc.netUpdate = true; } if (npc.ai[1] != 2f && npc.ai[1] != 3f) { npc.ai[1] = 2f; npc.netUpdate = true; } npc.position -= npc.velocity / 3; }
public override void FindFrame(int frameHeight) { if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.brainBoss, NPCID.BrainofCthulhu)) { npc.frame.Y = Main.npc[EModeGlobalNPC.brainBoss].frame.Y; } }
public override void AI(NPC npc) { base.AI(npc); if (DD2Event.Ongoing && DD2Event.TimeLeftBetweenWaves > 600) { DD2Event.TimeLeftBetweenWaves = 600; } //cant use HasValidTarget for this because that returns true even if betsy is targeting the crystal (npc.target seems to become -1) if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.betsyBoss, NPCID.DD2Betsy)) { int p = npc.FindClosestPlayer(out float distanceToPlayer); if (p != -1 && distanceToPlayer < 3000) { InvulTimer = 30; //wait before becoming fully vulnerable if (npc.life < npc.lifeMax && npc.life < 500) { npc.life++; } } } if (InvulTimer > 0) { InvulTimer--; } }
public override void AI() { int index = Dust.NewDust(projectile.Center, 0, 0, 229, 0.0f, 0.0f, 100, new Color(), 1f); Main.dust[index].noLight = true; Main.dust[index].noGravity = true; Main.dust[index].velocity = projectile.velocity; Main.dust[index].position -= Vector2.One * 4f; Main.dust[index].scale = 0.8f; /*if (++projectile.frameCounter >= 12 * 12) * { * projectile.frameCounter = 0; * if (++projectile.frame >= 5) * projectile.frame = 0; * }*/ if (FargoSoulsWorld.EternityMode && FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.championBoss, ModContent.NPCType <NPCs.Champions.CosmosChampion>())) { float rotation = projectile.velocity.ToRotation(); Vector2 vel = Main.player[Main.npc[EModeGlobalNPC.championBoss].target].Center - projectile.Center; float targetAngle = vel.ToRotation(); projectile.velocity = new Vector2(projectile.velocity.Length(), 0f).RotatedBy(rotation.AngleLerp(targetAngle, 0.001f)); } }
public override void AI() { if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>()) && !Main.npc[EModeGlobalNPC.mutantBoss].dontTakeDamage) { int modifier = 60 - Projectile.timeLeft; Projectile.scale = 4f - 3f / 60f * modifier; //start big, shrink down Projectile.rotation = (float)Math.PI * 2 / 30 * modifier; } else { Projectile.Kill(); } if (Projectile.timeLeft < 10) { Projectile.alpha += 25; } else { Projectile.alpha -= 4; if (Projectile.alpha < 0) //fade in { Projectile.alpha = 0; } } }
public override void OnHitPlayer(Player player, int damage, bool crit) { //player.AddBuff(ModContent.BuffType<Defenseless>(), 600); //player.AddBuff(BuffID.WitheredWeapon, 600); player.GetModPlayer <FargoSoulsPlayer>().MaxLifeReduction += FargoSoulsUtil.BossIsAlive(ref NPCs.EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25; player.AddBuff(ModContent.BuffType <OceanicMaul>(), 1800); }
public override void Update(GameTime gameTime) { int vulState = -1; int vulTimer = 0; bool bossAlive = false; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.moonBoss, NPCID.MoonLordCore)) { vulState = Main.npc[EModeGlobalNPC.moonBoss].GetEModeNPCMod <MoonLordCore>().VulnerabilityState; vulTimer = Main.npc[EModeGlobalNPC.moonBoss].GetEModeNPCMod <MoonLordCore>().VulnerabilityTimer; bossAlive = true; } if (!Main.dedServ && vulTimer % 30 == 0) { bool HandleScene(string name, int neededState) { if (Filters.Scene[$"FargowiltasSouls:{name}"].IsActive()) { if (vulState != neededState) { Filters.Scene.Deactivate($"FargowiltasSouls:{name}"); } return(false); } return(true); } if (HandleScene("Solar", 0) & HandleScene("Vortex", 1) & HandleScene("Nebula", 2) & HandleScene("Stardust", 3) & !bossAlive) { Deactivate(); } } }
public override bool PreAI(NPC npc) { bool result = base.PreAI(npc); if (FargoSoulsWorld.SwarmActive) { return(result); } npc.dontTakeDamage = true; npc.immortal = true; npc.chaseable = false; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.cultBoss, NPCID.CultistBoss) && !FargoSoulsWorld.MasochistModeReal) { if (++Timer > 20 && Timer < 60) { npc.position -= npc.velocity; return(false); } } /*if (MoonLordAlive) * { * if (npc.HasPlayerTarget) * { * Vector2 speed = Main.player[npc.target].Center - npc.Center; * speed.Normalize(); * speed *= 9f; * * npc.ai[2] += speed.X / 100f; * if (npc.ai[2] > 9f) * npc.ai[2] = 9f; * if (npc.ai[2] < -9f) * npc.ai[2] = -9f; * npc.ai[3] += speed.Y / 100f; * if (npc.ai[3] > 9f) * npc.ai[3] = 9f; * if (npc.ai[3] < -9f) * npc.ai[3] = -9f; * } * else * { * npc.TargetClosest(false); * } * * Timer++; * if (Timer > 240) * { * npc.HitEffect(0, 9999); * npc.active = false; * } * * npc.velocity.X = npc.ai[2]; * npc.velocity.Y = npc.ai[3]; * }*/ return(result); }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType <Defenseless>(), 300); target.AddBuff(ModContent.BuffType <Lethargic>(), 300); if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian)) { target.AddBuff(ModContent.BuffType <MarkedforDeath>(), 300); } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(mod.BuffType("Defenseless"), 300); target.AddBuff(mod.BuffType("Lethargic"), 300); if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian)) { target.AddBuff(mod.BuffType("MarkedForDeath"), 300); } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(BuffID.Wet, 420); if (FargoSoulsWorld.MasochistModeReal) { target.AddBuff(ModContent.BuffType <SqueakyToy>(), 120); } target.AddBuff(ModContent.BuffType <OceanicMaul>(), 20 * 60); target.GetModPlayer <FargoSoulsPlayer>().MaxLifeReduction += FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25; }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType<CurseoftheMoon>(), 360); if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType<NPCs.MutantBoss.MutantBoss>())) { target.GetModPlayer<FargoSoulsPlayer>().MaxLifeReduction += 100; target.AddBuff(ModContent.BuffType<OceanicMaul>(), 5400); target.AddBuff(ModContent.BuffType<MutantFang>(), 180); } }
public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item92, projectile.Center); int type; switch ((int)projectile.ai[0]) { case 0: type = 242; break; //nebula case 1: type = 127; break; //solar case 2: type = 229; break; //vortex default: type = 135; break; //stardust } for (int index = 0; index < 80; ++index) { Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, type, 0.0f, 0.0f, 0, new Color(), 1f)]; dust.velocity *= 10f; dust.fadeIn = 1f; dust.scale = 1 + Main.rand.NextFloat() + Main.rand.Next(4) * 0.3f; if (Main.rand.Next(3) != 0) { dust.noGravity = true; dust.velocity *= 3f; dust.scale *= 2f; } } if (Main.netMode != NetmodeID.MultiplayerClient) { int fragmentDuration = 240; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>()) && Main.npc[EModeGlobalNPC.mutantBoss].ai[0] == 19) { fragmentDuration = 420 - (int)Main.npc[EModeGlobalNPC.mutantBoss].ai[1] + 120; } const int max = 24; const float rotationInterval = 2f * (float)Math.PI / max; for (int j = 0; j < 4; j++) { Vector2 speed = new Vector2(0f, 5f * (j + 0.5f)).RotatedBy(projectile.rotation); for (int i = 0; i < max; i++) { int p = Projectile.NewProjectile(projectile.Center, speed.RotatedBy(rotationInterval * i), mod.ProjectileType("MutantFragment"), projectile.damage / 2, 0f, Main.myPlayer, projectile.ai[0]); if (p != Main.maxProjectiles) { Main.projectile[p].timeLeft = fragmentDuration; } } } } }
public override void Update(GameTime gameTime) { if (Filters.Scene["FargowiltasSouls:FinalSpark"].IsActive()) { if (!(FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <MutantBoss>()) && Main.npc[EModeGlobalNPC.mutantBoss].ai[0] == -5 && Main.npc[EModeGlobalNPC.mutantBoss].ai[2] >= 420)) { Filters.Scene.Deactivate("FargowiltasSouls:FinalSpark"); } } }
public override bool CheckDead(NPC npc) { if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.skeleBoss, NPCID.SkeletronHead)) { npc.life = 0; npc.HitEffect(); return(false); } return(base.CheckDead(npc)); }
public override void OnHitPlayer(Player target, int damage, bool crit) { if (FargoSoulsUtil.BossIsAlive(ref NPCs.EModeGlobalNPC.mutantBoss, mod.NPCType("MutantBoss"))) { if (FargoSoulsWorld.EternityMode) { target.GetModPlayer <FargoPlayer>().MaxLifeReduction += 100; target.AddBuff(mod.BuffType("OceanicMaul"), 5400); target.AddBuff(mod.BuffType("MutantFang"), 180); } } target.AddBuff(mod.BuffType("CurseoftheMoon"), 360); }
public override bool CheckDead(NPC npc) { if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.beeBoss, NPCID.QueenBee)) { npc.active = false; if (npc.DeathSound != null) { SoundEngine.PlaySound(npc.DeathSound.Value, npc.Center); } return(false); } return(base.CheckDead(npc)); }
public override void OnHitPlayer(Player target, int damage, bool crit) { if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian)) { target.AddBuff(mod.BuffType("MarkedforDeath"), 300); /*target.AddBuff(mod.BuffType("GodEater"), 420); * target.AddBuff(mod.BuffType("FlamesoftheUniverse"), 420); * target.immune = false; * target.immuneTime = 0; * target.hurtCooldowns[1] = 0;*/ } target.AddBuff(mod.BuffType("Lethargic"), 300); }
public override void SetDefaults() { projectile.CloneDefaults(ProjectileID.SkeletonBone); aiType = ProjectileID.SkeletonBone; projectile.light = 1f; projectile.scale = 1.5f; projectile.timeLeft = 240; projectile.tileCollide = false; if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian) || (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.skeleBoss, NPCID.SkeletronHead) && Main.npc[EModeGlobalNPC.skeleBoss].ai[1] == 2f)) { cooldownSlot = 1; } }
public override void OnKill(NPC npc) { base.OnKill(npc); if (Main.netMode != NetmodeID.MultiplayerClient && !FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>()) && ModContent.TryFind("Fargowiltas", "Mutant", out ModNPC mutant) && !NPC.AnyNPCs(mutant.Type)) { int n = NPC.NewNPC(npc.GetSource_FromThis(), (int)npc.Center.X, (int)npc.Center.Y, mutant.Type); if (n != Main.maxNPCs && Main.netMode == NetmodeID.Server) { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, n); } } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(BuffID.Darkness, 300); if (FargoSoulsWorld.EternityMode) { target.AddBuff(mod.BuffType("Shadowflame"), 300); target.AddBuff(BuffID.Blackout, 300); target.AddBuff(mod.BuffType("Defenseless"), 300); target.AddBuff(mod.BuffType("Lethargic"), 300); } if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian)) { target.AddBuff(mod.BuffType("MarkedForDeath"), 300); } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(BuffID.Darkness, 300); if (FargoSoulsWorld.EternityMode) { target.AddBuff(ModContent.BuffType <Shadowflame>(), 300); target.AddBuff(BuffID.Blackout, 300); target.AddBuff(ModContent.BuffType <Defenseless>(), 300); target.AddBuff(ModContent.BuffType <Lethargic>(), 300); } if (FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian)) { target.AddBuff(ModContent.BuffType <MarkedforDeath>(), 300); } }