예제 #1
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            if (!spawned)
            {
                spawned = true;
                SpawnedDuringLunarEvent = NPC.LunarApocalypseIsUp;
                npc.damage    += 150;
                npc.defDamage += 150;
                npc.netUpdate  = true;
                npc.buffImmune[ModContent.BuffType <ClippedWings>()] = true;
            }

            if (SpawnedDuringLunarEvent)
            {
                if (ShieldStrength > NPC.LunarShieldPowerExpert)
                {
                    ShieldStrength = NPC.LunarShieldPowerExpert;
                }

                void Aura(int debuff)
                {
                    if (DebuffNotToInflict != debuff)
                    {
                        EModeGlobalNPC.Aura(npc, 5000, debuff, dustid: AuraDust);
                    }
                }

                Aura(ModContent.BuffType <Atrophied>());
                Aura(ModContent.BuffType <Jammed>());
                Aura(ModContent.BuffType <ReverseManaFlow>());
                Aura(ModContent.BuffType <Antisocial>());
            }

            if (npc.dontTakeDamage)
            {
                npc.life = npc.lifeMax;
            }
            else
            {
                ShieldsDownAI(npc);

                if (++HealCounter > 60)
                {
                    HealCounter = 0;
                    npc.TargetClosest(false);
                    if (!npc.HasValidTarget || npc.Distance(Main.player[npc.target].Center) > 4000)
                    {
                        const int heal = 2000;
                        npc.life += heal;
                        if (npc.life > npc.lifeMax)
                        {
                            npc.life = npc.lifeMax;
                        }
                        CombatText.NewText(npc.Hitbox, CombatText.HealLife, heal);
                    }
                }
            }
        }
예제 #2
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            if (npc.HasPlayerTarget)
            {
                if (npc.velocity.Y < 0f && npc.position.Y < Main.player[npc.target].position.Y)
                {
                    npc.velocity.Y = 0f;
                }
                if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 200)
                {
                    Counter++;
                }
            }
            if (Counter >= 60)
            {
                if (!Main.dedServ)
                {
                    SoundEngine.PlaySound(new SoundStyle("FargowiltasSouls/Sounds/Navi")
                    {
                        Pitch = 0.5f
                    }, npc.Center);
                }
                Counter = 0;
            }
            EModeGlobalNPC.Aura(npc, 100, ModContent.BuffType <SqueakyToy>());
        }
예제 #3
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 450, BuffID.WitheredWeapon, true, 15);
            EModeGlobalNPC.Aura(npc, 150, BuffID.Cursed, false, 20);
        }
예제 #4
0
 public override void FindFrame(int frameHeight)
 {
     if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.brainBoss, NPCID.BrainofCthulhu))
     {
         npc.frame.Y = Main.npc[EModeGlobalNPC.brainBoss].frame.Y;
     }
 }
        public override void AI()
        {
            if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType <NPCs.MutantBoss.MutantBoss>()) &&
                !Main.npc[EModeGlobalNPC.mutantBoss].dontTakeDamage)
            {
                int modifier = Math.Min(60, 90 - 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;
                }
            }
        }
예제 #6
0
        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.MasochistMode && EModeGlobalNPC.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));
            }
        }
예제 #7
0
        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 &&
                EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.mutantBoss, mod.NPCType("MutantBoss")))
            {
                player.AddBuff(ModLoader.GetMod("MasomodeEX").BuffType("MutantJudgement"), player.buffTime[buffIndex]);
                player.buffTime[buffIndex] = 1;
            }
        }
예제 #8
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 300, BuffID.WitheredArmor, false, 119);
            EModeGlobalNPC.Aura(npc, 300, BuffID.WitheredWeapon, false, 14);
        }
예제 #9
0
        public override bool CanHitPlayer(Player target)
        {
            if (projectile.Colliding(projectile.Hitbox, target.Hitbox))
            {
                if (target.GetModPlayer <FargoPlayer>().DevianttHearts)
                {
                    target.statLife += 1;
                    target.HealEffect(1);
                }
                else
                {
                    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 (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.deviBoss, mod.NPCType("DeviBoss")))
                    {
                        target.AddBuff(mod.BuffType("Lovestruck"), 240);
                    }
                }

                projectile.timeLeft = 0;
            }
            return(false);
        }
예제 #10
0
        public override void AI()
        {
            if (projectile.localAI[0] == 0)
            {
                for (int i = 0; i < 5; i++)
                {
                    int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire,
                                         projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1.5f);
                    Main.dust[d].velocity *= 6f;
                }
            }

            if (++projectile.localAI[0] > 30 && projectile.localAI[0] < 120)
            {
                projectile.velocity *= projectile.ai[0];
            }

            if (projectile.localAI[0] > 60 && projectile.localAI[0] < 180)
            {
                if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.championBoss, ModContent.NPCType <NPCs.Champions.ShadowChampion>()))
                {
                    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, projectile.ai[1]));
                }
            }

            projectile.rotation = projectile.velocity.ToRotation() + (float)Math.PI / 2;
        }
예제 #11
0
        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 >= 6 * 4) //projectile extra updates + 1
            {
                projectile.frameCounter = 0;
                if (++projectile.frame >= 5)
                {
                    projectile.frame = 0;
                }
            }

            if (projectile.timeLeft % (projectile.extraUpdates + 1) == 0 && ++projectile.localAI[1] > 30) //only run once per tick
            {
                if (projectile.localAI[1] < 90)                                                           //accelerate
                {
                    projectile.velocity *= 1.04f;
                }
                else if (projectile.localAI[1] < 150 && EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.moonBoss, NPCID.MoonLordCore) &&
                         Main.npc[EModeGlobalNPC.moonBoss].HasValidTarget) //home
                {
                    float   rotation = projectile.velocity.ToRotation();
                    Vector2 vel      = Main.player[Main.npc[EModeGlobalNPC.moonBoss].target].Center
                                       + Main.player[Main.npc[EModeGlobalNPC.moonBoss].target].velocity * 10f - projectile.Center;
                    float targetAngle = vel.ToRotation();
                    projectile.velocity = new Vector2(projectile.velocity.Length(), 0f).RotatedBy(rotation.AngleLerp(targetAngle, 0.03f));
                }
            }
        }
예제 #12
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            if (npc.type == NPCID.Nymph)
            {
                npc.knockBackResist = 0f;

                EModeGlobalNPC.Aura(npc, 250, ModContent.BuffType <Lovestruck>(), true, DustID.PinkTorch);

                if (--Counter < 0)
                {
                    Counter = 300;

                    if (Main.netMode != NetmodeID.MultiplayerClient && npc.HasPlayerTarget && npc.Distance(Main.player[npc.target].Center) < 1000)
                    {
                        Vector2 spawnVel = npc.DirectionFrom(Main.player[npc.target].Center) * 10f;
                        for (int i = -3; i < 3; i++)
                        {
                            Projectile.NewProjectile(npc.GetSource_FromThis(),
                                                     npc.Center, spawnVel.RotatedBy(Math.PI / 7 * i),
                                                     ModContent.ProjectileType <FakeHeart2>(),
                                                     20, 0f, Main.myPlayer, 30, 90 + 10 * i);
                        }
                    }
                }
            }
        }
예제 #13
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 200, ModContent.BuffType <Shadowflame>(), false, DustID.Shadowflame);
            if (++AttackTimer > 180)
            {
                AttackTimer = 0;
                Main.PlaySound(SoundID.Item8, npc.Center);
                if (npc.HasPlayerTarget && Main.netMode != NetmodeID.MultiplayerClient)
                {
                    for (int i = 0; i < 4; i++)
                    {
                        Vector2 spawnPos = npc.Center + new Vector2(200f, 0f).RotatedBy(Math.PI / 2 * (i + 0.5));
                        //Vector2 speed = Vector2.Normalize(Main.player[npc.target].Center - spawnPos) * 10f;
                        int n = NPC.NewNPC((int)spawnPos.X, (int)spawnPos.Y, NPCID.ChaosBall);
                        if (n != 200 && Main.netMode == NetmodeID.Server)
                        {
                            NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, n);
                        }
                        for (int j = 0; j < 20; j++)
                        {
                            int d = Dust.NewDust(spawnPos, 0, 0, DustID.Shadowflame);
                            Main.dust[d].noGravity = true;
                            Main.dust[d].scale    += 0.5f;
                            Main.dust[d].velocity *= 6f;
                        }
                    }
                }
            }
        }
예제 #14
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 450, BuffID.Silenced, true, 15);
            EModeGlobalNPC.Aura(npc, 150, BuffID.Cursed, false, 20);
        }
예제 #15
0
 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 += EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25;
 }
예제 #16
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 200, BuffID.Bleeding, false, DustID.Blood);

            if (++Counter > 10)
            {
                Counter = 0;

                if (Main.LocalPlayer.active && !Main.LocalPlayer.ghost && !Main.LocalPlayer.dead &&
                    Main.LocalPlayer.bleed && npc.Distance(Main.LocalPlayer.Center) < 200)
                {
                    const int damage = 5;

                    Player target = Main.LocalPlayer;
                    target.statLife -= damage;
                    CombatText.NewText(target.Hitbox, Color.Red, damage, false, true);

                    if (target.statLife < 0)
                    {
                        target.KillMe(PlayerDeathReason.ByCustomReason(target.name + " was sucked dry."), 999, 0);
                    }

                    npc.life += damage;
                    if (npc.life > npc.lifeMax)
                    {
                        npc.life = npc.lifeMax;
                    }

                    npc.HealEffect(damage);
                }
            }
        }
예제 #17
0
 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 += EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.fishBossEX, NPCID.DukeFishron) ? 100 : 25;
 }
예제 #18
0
        public override void Update(Player player, ref int buffIndex)
        {
            player.GetModPlayer <FargoPlayer>().MutantPresence = true; //LUL

            player.GetModPlayer <FargoPlayer>().noDodge      = true;
            player.GetModPlayer <FargoPlayer>().noSupersonic = true;
            player.moonLeech = true;

            if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.fishBoss, NPCID.DukeFishron))
            {
                player.buffTime[buffIndex] = 2;
                if (player.whoAmI == Main.npc[EModeGlobalNPC.fishBoss].target &&
                    player.whoAmI == Main.myPlayer &&
                    player.ownedProjectileCounts[mod.ProjectileType("FishronRitual2")] < 1)
                {
                    Projectile.NewProjectile(Main.npc[EModeGlobalNPC.fishBoss].Center, Vector2.Zero,
                                             mod.ProjectileType("FishronRitual2"), 0, 0f, player.whoAmI, 0f, EModeGlobalNPC.fishBoss);
                }
            }
            else
            {
                return;
            }

            /*float distance = player.Distance(Main.npc[FargoSoulsGlobalNPC.fishBoss].Center);
             * const float threshold = 1200f;
             * if (distance > threshold)
             * {
             *  if (distance > threshold * 1.5f)
             *  {
             *      if (distance > threshold * 2f)
             *      {
             *          player.KillMe(PlayerDeathReason.ByCustomReason(player.name + " tried to escape."), 7777, 0);
             *          return;
             *      }
             *
             *      player.frozen = true;
             *      player.controlHook = false;
             *      player.controlUseItem = false;
             *      if (player.mount.Active)
             *          player.mount.Dismount(player);
             *      player.velocity.X = 0f;
             *      player.velocity.Y = -0.4f;
             *  }
             *
             *  Vector2 movement = Main.npc[FargoSoulsGlobalNPC.fishBoss].Center - player.Center;
             *  float difference = movement.Length() - 1200f;
             *  movement.Normalize();
             *  movement *= difference < 17f ? difference : 17f;
             *  player.position += movement;
             *
             *  for (int i = 0; i < 20; i++)
             *  {
             *      int d = Dust.NewDust(player.position, player.width, player.height, 135, 0f, 0f, 0, default(Color), 2.5f);
             *      Main.dust[d].noGravity = true;
             *      Main.dust[d].noLight = true;
             *      Main.dust[d].velocity *= 5f;
             *  }
             * }*/
        }
예제 #19
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            EModeGlobalNPC.Aura(npc, 80, BuffID.Obstructed, false, 199);

            npc.aiStyle = 5;
        }
예제 #20
0
        public override void OnFirstTick(NPC npc)
        {
            base.OnFirstTick(npc);

            if (Main.rand.NextBool(4))
            {
                EModeGlobalNPC.Horde(npc, Main.rand.Next(6) + 1);
            }
        }
        public override void AI(NPC npc)
        {
            base.AI(npc);

            if (npc.dontTakeDamage)
            {
                EModeGlobalNPC.CustomReflect(npc, DustID.Granite, 2);
            }
        }
예제 #22
0
        public override void OnFirstTick(NPC npc)
        {
            base.OnFirstTick(npc);

            if (Main.rand.NextBool(3) && NPC.downedGolemBoss)
            {
                EModeGlobalNPC.Horde(npc, Main.rand.Next(2, 10));
            }
        }
예제 #23
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            if (npc.ai[2] < 0f) //while shielding, reflect
            {
                EModeGlobalNPC.CustomReflect(npc, DustID.Granite, 2);
            }
        }
예제 #24
0
        public override void OnFirstTick(NPC npc)
        {
            base.OnFirstTick(npc);

            if (npc.type == NPCID.Shark && Main.rand.NextBool(3))
            {
                EModeGlobalNPC.Horde(npc, Main.rand.Next(1, 5));
            }
        }
예제 #25
0
 public override void OnHitPlayer(Player target, int damage, bool crit)
 {
     target.AddBuff(mod.BuffType("Defenseless"), 300);
     target.AddBuff(mod.BuffType("Lethargic"), 300);
     if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian))
     {
         target.AddBuff(mod.BuffType("MarkedForDeath"), 300);
     }
 }
예제 #26
0
        public override void AI(NPC npc)
        {
            base.AI(npc);

            npc.position += npc.velocity / 2f;
            EModeGlobalNPC.Aura(npc, 400, BuffID.WitheredArmor, true, 119);
            EModeGlobalNPC.Aura(npc, 400, BuffID.WitheredWeapon, true, 14);
            if (npc.ai[0] == 2f)                                        //spinning up
            {
                npc.ai[1] += 6f * (1f - (float)npc.life / npc.lifeMax); //FINISH SPINNING FASTER
            }
        }
예제 #27
0
 public override void OnHitPlayer(Player target, int damage, bool crit)
 {
     if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian))
     {
         target.AddBuff(mod.BuffType("GodEater"), 420);
         target.AddBuff(mod.BuffType("FlamesoftheUniverse"), 420);
         target.AddBuff(mod.BuffType("MarkedforDeath"), 420);
         target.immune           = false;
         target.immuneTime       = 0;
         target.hurtCooldowns[1] = 0;
     }
     target.AddBuff(mod.BuffType("Lethargic"), 300);
 }
예제 #28
0
        public override void OnFirstTick(NPC npc)
        {
            base.OnFirstTick(npc);

            if (Main.rand.NextBool(5))
            {
                npc.TargetClosest(false);
                if (npc.HasValidTarget && Main.player[npc.target].ZoneUnderworldHeight)
                {
                    EModeGlobalNPC.Horde(npc, Main.rand.Next(8) + 1);
                }
            }
        }
예제 #29
0
 public override void OnHitPlayer(Player target, int damage, bool crit)
 {
     target.AddBuff(BuffID.Darkness, 300);
     if (FargoSoulsWorld.MasochistMode)
     {
         target.AddBuff(BuffID.Blackout, 300);
         target.AddBuff(mod.BuffType("Defenseless"), 300);
         target.AddBuff(mod.BuffType("Lethargic"), 300);
     }
     if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.guardBoss, NPCID.DungeonGuardian))
     {
         target.AddBuff(mod.BuffType("MarkedForDeath"), 300);
     }
 }
예제 #30
0
        public override void AI()
        {
            Lighting.AddLight(projectile.Center, 0.1f, 0.5f, 0.7f);

            if (projectile.ai[0] == 0)
            {
                projectile.ai[0]      = 1;
                projectile.localAI[0] = projectile.Center.X;
                projectile.localAI[1] = projectile.Center.Y;
                Main.projectileTexture[projectile.type] = Main.npcTexture[NPCID.TheHungry];
            }

            if (projectile.velocity != Vector2.Zero && Main.rand.Next(3) == 0)
            {
                int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 88, projectile.velocity.X * 0.4f, projectile.velocity.Y * 0.4f, 114, default(Color), 2f);
                Main.dust[dust].noGravity   = true;
                Main.dust[dust].velocity   *= 1.8f;
                Main.dust[dust].velocity.Y -= 0.5f;
            }

            //stop moving at vertical limits of underworld
            if ((projectile.velocity.Y > 0 && projectile.Center.Y / 16 >= Main.maxTilesY) ||
                (projectile.velocity.Y < 0 && projectile.Center.Y / 16 <= Main.maxTilesY - 200))
            {
                projectile.position -= projectile.velocity * 2f;
                projectile.velocity  = Vector2.Zero;
            }

            if (EModeGlobalNPC.BossIsAlive(ref EModeGlobalNPC.wallBoss, NPCID.WallofFlesh) &&
                Math.Abs(projectile.Center.X - Main.npc[EModeGlobalNPC.wallBoss].Center.X) < 50)
            {
                projectile.Kill(); //chain dies when wall moves over it
            }

            if (projectile.velocity != Vector2.Zero)
            {
                projectile.rotation = projectile.velocity.ToRotation();

                if (++projectile.frameCounter > 6 * (projectile.extraUpdates + 1))
                {
                    projectile.frameCounter = 0;
                    if (++projectile.frame >= Main.projFrames[projectile.type])
                    {
                        projectile.frame = 0;
                    }
                }
            }
        }