示例#1
0
        public override void UpdateBiomes()
        {
            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.eaterBoss, NPCID.EaterofWorldsHead))
            {
                player.ZoneCorrupt = true;
            }

            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.brainBoss, NPCID.BrainofCthulhu))
            {
                player.ZoneCrimson = true;
            }

            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.plantBoss, NPCID.Plantera))
            {
                player.ZoneJungle = true;
            }

            if (GetInstance <FargoConfig>().Fountains)
            {
                switch (Main.fountainColor)
                {
                case 0:
                    player.ZoneBeach = true;
                    break;

                case 6:
                    player.ZoneDesert = true;
                    if (player.Center.Y > 3200f)
                    {
                        player.ZoneUndergroundDesert = true;
                    }
                    break;

                case 3:
                    player.ZoneJungle = true;
                    break;

                case 5:
                    player.ZoneSnow = true;
                    break;

                case 2:
                    player.ZoneCorrupt = true;
                    break;

                case 10:
                    player.ZoneCrimson = true;
                    break;

                case 4:
                    if (Main.hardMode)
                    {
                        player.ZoneHoly = true;
                    }
                    break;

                    //oasis and cavern fountains
                }
            }
        }
示例#2
0
 public override void AI()
 {
     if (!FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.beeBoss, NPCID.QueenBee) &&
         !NPC.AnyNPCs(NPCID.QueenBee))
     {
         npc.StrikeNPCNoInteraction(9999, 0f, 0);
     }
 }
示例#3
0
 public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
 {
     if (FargoWorld.downedFishronEX || !FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.fishBossEX, NPCID.DukeFishron))
     {
         npc.lifeMax = (int)(npc.lifeMax * (1 + FargoWorld.FishronCount * .025));
         npc.damage  = (int)(npc.damage * (1 + FargoWorld.FishronCount * .0125));
     }
 }
示例#4
0
        public override void Update(Player player, ref int buffIndex)
        {
            player.GetModPlayer <FargoPlayer>(mod).noDodge      = true;
            player.GetModPlayer <FargoPlayer>(mod).noSupersonic = true;
            player.moonLeech = true;

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

            /*float distance = player.Distance(Main.npc[FargoGlobalNPC.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[FargoGlobalNPC.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;
             *  }
             * }*/
        }
示例#5
0
        public override void UpdateBiomes()
        {
            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.eaterBoss, NPCID.EaterofWorldsHead))
            {
                player.ZoneCorrupt = true;
            }

            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.brainBoss, NPCID.BrainofCthulhu))
            {
                player.ZoneCrimson = true;
            }

            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.plantBoss, NPCID.Plantera))
            {
                player.ZoneJungle = true;
            }

            switch (Main.fountainColor)
            {
            case 0:
                player.ZoneBeach = true;
                break;

            case 6:
                player.ZoneDesert = true;
                break;

            case 3:
                player.ZoneJungle = true;
                break;

            case 5:
                player.ZoneSnow = true;
                break;

            case 2:
                player.ZoneCorrupt = true;
                break;

            case 10:
                player.ZoneCrimson = true;
                break;

            case 4:
                if (Main.hardMode)
                {
                    player.ZoneHoly = true;
                }
                break;
            }
        }
示例#6
0
        public override void Update(NPC npc, ref int buffIndex)
        {
            FargoGlobalNPC fargoNPC = npc.GetGlobalNPC <FargoGlobalNPC>();

            npc.poisoned            = true;
            npc.venom               = true;
            npc.ichor               = true;
            npc.onFire2             = true;
            npc.betsysCurse         = true;
            npc.midas               = true;
            fargoNPC.Electrified    = true;
            fargoNPC.OceanicMaul    = true;
            fargoNPC.CurseoftheMoon = true;
            fargoNPC.Infested       = true;
            fargoNPC.Rotting        = true;
            fargoNPC.MutantNibble   = true;
            fargoNPC.Sadism         = true;
        }
示例#7
0
        public override void PostUpdateEquips()
        {
            Mod soulsMod = ModLoader.GetMod("FargowiltasSouls");

            if (!hasMirror)
            {
                hasMirror = player.HasAnyItem(ItemID.IceMirror, ItemID.MagicMirror, ItemID.CellPhone);

                if (Fargowiltas.ModLoaded["FargowiltasSouls"])
                {
                    hasMirror = player.HasAnyItem(ItemID.IceMirror, ItemID.MagicMirror, ItemID.CellPhone, soulsMod.ItemType("WorldShaperSoul"), soulsMod.ItemType("DimensionSoul"), soulsMod.ItemType("EternitySoul"));
                }
            }

            if (!hasRod)
            {
                hasRod = player.HasItem(ItemID.RodofDiscord);
            }

            if (mirrorCD != 0)
            {
                mirrorCD--;
            }

            if (rodCD != 0)
            {
                rodCD--;
            }

            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.eaterBoss, NPCID.EaterofWorldsHead))
            {
                player.ZoneCorrupt = true;
            }

            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.brainBoss, NPCID.BrainofCthulhu))
            {
                player.ZoneCrimson = true;
            }

            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.plantBoss, NPCID.Plantera))
            {
                player.ZoneJungle = true;
            }
        }
示例#8
0
        public override bool UseItem(Player player)
        {
            Fargowiltas.SwarmActive = true;
            Fargowiltas.SwarmTotal  = 10 * player.inventory[player.selectedItem].stack;
            Fargowiltas.SwarmKills  = 0;

            if (Fargowiltas.SwarmTotal < 100)
            {
                Fargowiltas.SwarmSpawned = 10;
            }
            else
            {
                //energizer swarms
                Fargowiltas.SwarmSpawned = maxSpawn;
            }

            //DG special case
            if (npcType == NPCID.SkeletronHead && Main.dayTime)
            {
                npcType = NPCID.DungeonGuardian;
            }
            //twins special case
            else if (npcType == NPCID.Retinazer)
            {
                Fargowiltas.SwarmTotal *= 2;
            }

            //wof mega special case
            if (npcType == NPCID.WallofFlesh)
            {
                FargoGlobalNPC.SpawnWalls(player);
                counter++;

                if (counter < 10)
                {
                    return(true);
                }
            }
            else
            {
                //spawn the bosses
                for (int i = 0; i < Fargowiltas.SwarmSpawned; i++)
                {
                    //spawn the other twin as well
                    if (npcType == NPCID.Retinazer)
                    {
                        int twin = NPC.NewNPC((int)player.position.X + Main.rand.Next(-1000, 1000), (int)player.position.Y + Main.rand.Next(-1000, -400), NPCID.Spazmatism);
                        Main.npc[twin].GetGlobalNPC <FargoGlobalNPC>().SwarmActive = true;
                    }

                    int boss = NPC.NewNPC((int)player.position.X + Main.rand.Next(-1000, 1000), (int)player.position.Y + Main.rand.Next(-1000, -400), npcType);
                    Main.npc[boss].GetGlobalNPC <FargoGlobalNPC>().SwarmActive = true;
                }
            }

            // Kill whole stack
            player.inventory[player.selectedItem].stack = 0;

            if (Main.netMode == 2)
            {
                NetMessage.BroadcastChatMessage(NetworkText.FromLiteral(spawnMessage), new Color(175, 75, 255));
            }
            else
            {
                Main.NewText(spawnMessage, 175, 75, 255);
            }

            Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
            return(true);
        }
示例#9
0
        public override void AI()
        {
            if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.cultBoss, NPCID.CultistBoss))
            {
                projectile.alpha -= 2;
                if (projectile.alpha < 0)
                {
                    projectile.alpha = 0;
                }

                Player player = Main.player[Main.myPlayer];
                if (player.active && !player.dead)
                {
                    float distance = player.Distance(projectile.Center);
                    if (Math.Abs(distance - threshold) < 46f && player.hurtCooldowns[0] == 0 && projectile.alpha == 0)
                    {
                        int hitDirection = projectile.Center.X > player.Center.X ? 1 : -1;
                        player.Hurt(PlayerDeathReason.ByProjectile(player.whoAmI, projectile.whoAmI),
                                    Main.npc[FargoGlobalNPC.cultBoss].damage, hitDirection, false, false, false, 0);
                        player.AddBuff(mod.BuffType("CurseoftheMoon"), Main.rand.Next(300, 600));
                    }
                    if (distance > threshold && distance < threshold * 4f)
                    {
                        if (distance > threshold * 2f)
                        {
                            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   = projectile.Center - player.Center;
                        float   difference = movement.Length() - threshold;
                        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;
                        }
                    }
                }
            }
            else
            {
                projectile.velocity = Vector2.Zero;
                projectile.alpha   += 2;
                if (projectile.alpha > 255)
                {
                    projectile.Kill();
                    return;
                }
            }

            projectile.timeLeft = 2;
            projectile.scale    = (1f - projectile.alpha / 255f) * 2f;
            projectile.ai[0]   -= rotationPerTick;
            if (projectile.ai[0] > PI)
            {
                projectile.ai[0]    -= 2f * PI;
                projectile.netUpdate = true;
            }

            projectile.frameCounter++;
            if (projectile.frameCounter >= 6)
            {
                projectile.frameCounter = 0;
                projectile.frame++;
                if (projectile.frame > 1)
                {
                    projectile.frame = 0;
                }
            }
        }
示例#10
0
        public override void PostUpdate()
        {
            if (autoRevertSelectedItem)
            {
                if (Player.itemTime == 0 && Player.itemAnimation == 0)
                {
                    Player.selectedItem    = originalSelectedItem;
                    autoRevertSelectedItem = false;
                }
            }

            if (FargoWorld.OverloadedSlimeRain && Main.rand.Next(20) == 0)
            {
                SlimeRainSpawns();
            }

            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.eaterBoss, NPCID.EaterofWorldsHead))
            {
                Player.ZoneCorrupt = true;
            }

            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.brainBoss, NPCID.BrainofCthulhu))
            {
                Player.ZoneCrimson = true;
            }

            if (FargoGlobalNPC.SpecificBossIsAlive(ref FargoGlobalNPC.plantBoss, NPCID.Plantera))
            {
                Player.ZoneJungle = true;
            }

            if (GetInstance <FargoConfig>().Fountains)
            {
                switch (Main.SceneMetrics.ActiveFountainColor)
                {
                case -1:     //no fountain active
                    goto default;

                case 0:     //pure water, ocean
                    Player.ZoneBeach = true;
                    break;

                case 2:     //corrupt
                    Player.ZoneCorrupt = true;
                    break;

                case 3:     //jungle
                    Player.ZoneJungle = true;
                    break;

                case 4:     //hallow
                    if (Main.hardMode)
                    {
                        Player.ZoneHallow = true;
                    }
                    break;

                case 5:     //ice
                    Player.ZoneSnow = true;
                    break;

                case 6:     //oasis
                    goto case 12;

                case 8:     //cavern
                    goto default;

                case 9:     //blood fountain
                    goto default;

                case 10:     //crimson
                    Player.ZoneCrimson = true;
                    break;

                case 12:     //desert fountain
                    Player.ZoneDesert = true;
                    if (Player.Center.Y > 3200f)
                    {
                        Player.ZoneUndergroundDesert = true;
                    }
                    break;

                default:
                    break;
                }
            }
        }
示例#11
0
        public override void HandlePacket(BinaryReader reader, int whoAmI)
        {
            switch (reader.ReadByte())
            {
            case 0:     //server side spawning creepers
                if (Main.netMode == 2)
                {
                    byte p          = reader.ReadByte();
                    int  multiplier = reader.ReadByte();
                    int  n          = NPC.NewNPC((int)Main.player[p].Center.X, (int)Main.player[p].Center.Y, NPCType("CreeperGutted"), 0,
                                                 p, 0f, multiplier, 0f);
                    if (n != 200)
                    {
                        Main.npc[n].velocity = Vector2.UnitX.RotatedByRandom(2 * Math.PI) * 8;
                        NetMessage.SendData(23, -1, -1, null, n);
                    }
                }
                break;

            case 1:     //server side synchronize pillar data request
                if (Main.netMode == 2)
                {
                    byte pillar = reader.ReadByte();
                    if (!Main.npc[pillar].GetGlobalNPC <FargoGlobalNPC>().masoBool[1])
                    {
                        Main.npc[pillar].GetGlobalNPC <FargoGlobalNPC>().masoBool[1] = true;
                        Main.npc[pillar].GetGlobalNPC <FargoGlobalNPC>().SetDefaults(Main.npc[pillar]);
                        Main.npc[pillar].life = Main.npc[pillar].lifeMax;
                    }
                }
                break;

            case 2:     //net updating maso
                FargoGlobalNPC fargoNPC = Main.npc[reader.ReadByte()].GetGlobalNPC <FargoGlobalNPC>();
                fargoNPC.masoBool[0] = reader.ReadBoolean();
                fargoNPC.masoBool[1] = reader.ReadBoolean();
                fargoNPC.masoBool[2] = reader.ReadBoolean();
                fargoNPC.masoBool[3] = reader.ReadBoolean();
                break;

            case 3:     //rainbow slime/paladin, MP clients syncing to server
                if (Main.netMode == 1)
                {
                    byte npc = reader.ReadByte();
                    Main.npc[npc].lifeMax = reader.ReadInt32();
                    float newScale = reader.ReadSingle();
                    Main.npc[npc].position = Main.npc[npc].Center;
                    Main.npc[npc].width    = (int)(Main.npc[npc].width / Main.npc[npc].scale * newScale);
                    Main.npc[npc].height   = (int)(Main.npc[npc].height / Main.npc[npc].scale * newScale);
                    Main.npc[npc].scale    = newScale;
                    Main.npc[npc].Center   = Main.npc[npc].position;
                }
                break;

            case 4:     //moon lord vulnerability synchronization
                if (Main.netMode == 1)
                {
                    int ML = reader.ReadByte();
                    Main.npc[ML].GetGlobalNPC <FargoGlobalNPC>().Counter = reader.ReadInt32();
                    FargoGlobalNPC.masoStateML = reader.ReadByte();
                }
                break;

            case 5:     //retinazer laser MP sync
                if (Main.netMode == 1)
                {
                    int reti = reader.ReadByte();
                    Main.npc[reti].GetGlobalNPC <FargoGlobalNPC>().masoBool[2] = reader.ReadBoolean();
                    Main.npc[reti].GetGlobalNPC <FargoGlobalNPC>().Counter     = reader.ReadInt32();
                }
                break;

            case 6:     //shark MP sync
                if (Main.netMode == 1)
                {
                    int shark = reader.ReadByte();
                    Main.npc[shark].GetGlobalNPC <FargoGlobalNPC>().SharkCount = reader.ReadByte();
                }
                break;

            case 7:     //client to server activate dark caster family
                if (Main.netMode == 2)
                {
                    int caster = reader.ReadByte();
                    if (Main.npc[caster].GetGlobalNPC <FargoGlobalNPC>().Counter2 == 0)
                    {
                        Main.npc[caster].GetGlobalNPC <FargoGlobalNPC>().Counter2 = reader.ReadInt32();
                    }
                }
                break;

            case 8:     //server to clients reset counter
                if (Main.netMode == 1)
                {
                    int caster = reader.ReadByte();
                    Main.npc[caster].GetGlobalNPC <FargoGlobalNPC>().Counter2 = 0;
                }
                break;

            case 9:     //client to server, request heart spawn
                if (Main.netMode == 2)
                {
                    int n = reader.ReadByte();
                    Item.NewItem(Main.npc[n].Hitbox, ItemID.Heart);
                }
                break;

            case 10:     //client to server, sync cultist data
                if (Main.netMode == 2)
                {
                    int            cult    = reader.ReadByte();
                    FargoGlobalNPC cultNPC = Main.npc[cult].GetGlobalNPC <FargoGlobalNPC>();
                    cultNPC.Counter           += reader.ReadInt32();
                    cultNPC.Counter2          += reader.ReadInt32();
                    cultNPC.Timer             += reader.ReadInt32();
                    Main.npc[cult].localAI[3] += reader.ReadSingle();
                }
                break;

            case 11:     //refresh creeper
                if (Main.netMode != 0)
                {
                    byte player  = reader.ReadByte();
                    NPC  creeper = Main.npc[reader.ReadByte()];
                    if (creeper.active && creeper.type == NPCType("CreeperGutted") && creeper.ai[0] == player)
                    {
                        int damage = creeper.lifeMax - creeper.life;
                        creeper.life = creeper.lifeMax;
                        if (damage > 0)
                        {
                            CombatText.NewText(creeper.Hitbox, CombatText.HealLife, damage);
                        }
                        if (Main.netMode == 2)
                        {
                            creeper.netUpdate = true;
                        }
                    }
                }
                break;

            case 77:     //server side spawning fishron EX
                if (Main.netMode == 2)
                {
                    byte target = reader.ReadByte();
                    int  x      = reader.ReadInt32();
                    int  y      = reader.ReadInt32();
                    FargoGlobalNPC.spawnFishronEX = true;
                    NPC.NewNPC(x, y, NPCID.DukeFishron, 0, 0f, 0f, 0f, 0f, target);
                    FargoGlobalNPC.spawnFishronEX = false;
                    NetMessage.BroadcastChatMessage(NetworkText.FromLiteral("Duke Fishron EX has awoken!"), new Color(50, 100, 255));
                }
                break;

            case 78:     //confirming fish EX max life
                int f = reader.ReadInt32();
                Main.npc[f].lifeMax = reader.ReadInt32();
                break;

            default:
                break;
            }
        }
示例#12
0
        public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit)
        {
            //Player player = Main.player[Main.myPlayer];
            FargoPlayer modPlayer = target.GetModPlayer <FargoPlayer>(mod);

            if (FargoWorld.MasochistMode)
            {
                switch (projectile.type)
                {
                case ProjectileID.JavelinHostile:
                    target.AddBuff(mod.BuffType <Defenseless>(), Main.rand.Next(60, 600));
                    target.AddBuff(mod.BuffType <Stunned>(), Main.rand.Next(60, 90));
                    break;

                case ProjectileID.DemonSickle:
                    target.AddBuff(BuffID.Darkness, Main.rand.Next(900, 1800));
                    target.AddBuff(BuffID.ShadowFlame, Main.rand.Next(300, 600));
                    break;

                case ProjectileID.HarpyFeather:
                    if (Main.rand.Next(2) == 0)
                    {
                        target.AddBuff(mod.BuffType <ClippedWings>(), Main.rand.Next(60, 480));
                    }
                    break;

                //so only antlion sand and not falling sand
                case ProjectileID.SandBallFalling:
                    if (projectile.velocity.X != 0)
                    {
                        target.AddBuff(mod.BuffType <Stunned>(), Main.rand.Next(60, 120));
                    }
                    break;

                case ProjectileID.Stinger:
                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.beeBoss, NPCID.QueenBee))
                    {
                        target.AddBuff(BuffID.Venom, Main.rand.Next(180, 900));
                    }
                    target.AddBuff(BuffID.BrokenArmor, Main.rand.Next(120, 1200));
                    break;

                case ProjectileID.Skull:
                    if (Main.rand.Next(4) == 0)
                    {
                        target.AddBuff(BuffID.Cursed, Main.rand.Next(60, 360));
                    }
                    break;

                case ProjectileID.EyeLaser:
                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.wallBoss, NPCID.WallofFlesh))
                    {
                        target.AddBuff(BuffID.OnFire, Main.rand.Next(60, 600));
                        target.AddBuff(mod.BuffType <ClippedWings>(), Main.rand.Next(120));
                        target.AddBuff(mod.BuffType <Crippled>(), Main.rand.Next(120));
                    }

                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.retiBoss, NPCID.Retinazer))
                    {
                        target.AddBuff(mod.BuffType <ClippedWings>(), 15);
                    }
                    break;

                case ProjectileID.DeathSickle:
                    if (!target.HasBuff(mod.BuffType <MarkedforDeath>()))
                    {
                        target.AddBuff(mod.BuffType <MarkedforDeath>(), 1800);
                        target.AddBuff(mod.BuffType <LivingWasteland>(), 1800);
                    }
                    break;

                case ProjectileID.DrManFlyFlask:
                    switch (Main.rand.Next(7))
                    {
                    case 0:
                        target.AddBuff(BuffID.Venom, Main.rand.Next(60, 600));
                        break;

                    case 1:
                        target.AddBuff(BuffID.Confused, Main.rand.Next(60, 600));
                        break;

                    case 2:
                        target.AddBuff(BuffID.CursedInferno, Main.rand.Next(60, 600));
                        break;

                    case 3:
                        target.AddBuff(BuffID.OgreSpit, Main.rand.Next(60, 600));
                        break;

                    case 4:
                        target.AddBuff(mod.BuffType <LivingWasteland>(), Main.rand.Next(60, 600));
                        break;

                    case 5:
                        target.AddBuff(mod.BuffType <Defenseless>(), Main.rand.Next(60, 600));
                        break;

                    case 6:
                        target.AddBuff(mod.BuffType <Purified>(), Main.rand.Next(60, 600));
                        break;

                    default:
                        break;
                    }

                    target.AddBuff(BuffID.Stinky, Main.rand.Next(900, 1200));
                    break;

                //CULTIST OP
                case ProjectileID.CultistBossLightningOrb:
                    target.AddBuff(mod.BuffType <LightningRod>(), Main.rand.Next(300, 900));
                    break;

                case ProjectileID.CultistBossLightningOrbArc:
                    target.AddBuff(BuffID.Electrified, Main.rand.Next(60, 300));
                    break;

                case ProjectileID.CultistBossIceMist:
                    if (!target.HasBuff(BuffID.Frozen))
                    {
                        target.AddBuff(BuffID.Frozen, Main.rand.Next(30, 120));
                    }
                    break;

                case ProjectileID.CultistBossFireBall:
                    target.AddBuff(mod.BuffType <Berserked>(), Main.rand.Next(60, 300));
                    target.AddBuff(BuffID.BrokenArmor, Main.rand.Next(90, 900));
                    target.AddBuff(BuffID.OnFire, Main.rand.Next(120, 600));
                    break;

                case ProjectileID.CultistBossFireBallClone:
                    target.AddBuff(BuffID.ShadowFlame, Main.rand.Next(300, 600));
                    break;

                case ProjectileID.PaladinsHammerHostile:
                    target.AddBuff(mod.BuffType <Lethargic>(), Main.rand.Next(480, 720));
                    break;

                case ProjectileID.RuneBlast:
                    target.AddBuff(mod.BuffType <FlamesoftheUniverse>(), Main.rand.Next(300));
                    break;

                case ProjectileID.ThornBall:
                case ProjectileID.PoisonSeedPlantera:
                case ProjectileID.SeedPlantera:
                    target.AddBuff(BuffID.Poisoned, Main.rand.Next(60, 300));
                    target.AddBuff(BuffID.Venom, Main.rand.Next(60, 300));
                    target.AddBuff(mod.BuffType <Infested>(), Main.rand.Next(180, 360));
                    break;

                case ProjectileID.DesertDjinnCurse:
                    if (target.ZoneCorrupt)
                    {
                        target.AddBuff(BuffID.ShadowFlame, Main.rand.Next(300, 900));
                    }
                    else if (target.ZoneCrimson)
                    {
                        target.AddBuff(BuffID.Ichor, Main.rand.Next(900, 1800));
                    }
                    break;

                case ProjectileID.BrainScramblerBolt:
                    target.AddBuff(mod.BuffType <Flipped>(), Main.rand.Next(15, 60));
                    target.AddBuff(mod.BuffType <Unstable>(), Main.rand.Next(60, 180));
                    break;

                case ProjectileID.MartianTurretBolt:
                case ProjectileID.GigaZapperSpear:
                    target.AddBuff(mod.BuffType <LightningRod>(), Main.rand.Next(300, 600));
                    break;

                case ProjectileID.SaucerMissile:
                    target.AddBuff(mod.BuffType <ClippedWings>(), Main.rand.Next(120, 180));
                    target.AddBuff(mod.BuffType <Crippled>(), Main.rand.Next(120, 180));
                    break;

                case ProjectileID.SaucerLaser:
                    target.AddBuff(BuffID.Electrified, Main.rand.Next(240, 480));
                    break;

                case ProjectileID.UFOLaser:
                case ProjectileID.SaucerDeathray:
                    target.AddBuff(mod.BuffType <MarkedforDeath>(), 600);
                    break;

                case ProjectileID.FlamingWood:
                case ProjectileID.GreekFire1:
                case ProjectileID.GreekFire2:
                case ProjectileID.GreekFire3:
                    int duration = Main.rand.Next(90, 120);
                    target.AddBuff(BuffID.OnFire, duration);
                    target.AddBuff(BuffID.CursedInferno, duration);
                    target.AddBuff(BuffID.ShadowFlame, duration);
                    break;

                case ProjectileID.VortexAcid:
                case ProjectileID.VortexLaser:
                    target.AddBuff(mod.BuffType <LightningRod>(), Main.rand.Next(30, 180));
                    target.AddBuff(mod.BuffType <ClippedWings>(), Main.rand.Next(30, 180));
                    break;

                case ProjectileID.VortexLightning:
                    if (NPC.downedGolemBoss)
                    {
                        damage *= 2;
                        target.AddBuff(BuffID.Electrified, Main.rand.Next(30, 300));
                    }
                    break;

                case ProjectileID.PinkLaser:
                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.destroyBoss, NPCID.TheDestroyer))
                    {
                        target.AddBuff(mod.BuffType <ClippedWings>(), 15);
                    }
                    break;

                case ProjectileID.LostSoulHostile:
                    target.AddBuff(mod.BuffType <Unstable>(), Main.rand.Next(30, 120));
                    break;

                case ProjectileID.InfernoHostileBlast:
                case ProjectileID.InfernoHostileBolt:
                    if (Main.rand.Next(5) == 0)
                    {
                        target.AddBuff(mod.BuffType <Fused>(), 1800);
                    }
                    break;

                case ProjectileID.ShadowBeamHostile:
                    target.AddBuff(mod.BuffType <Rotting>(), Main.rand.Next(1800, 3600));
                    break;

                case ProjectileID.DeathLaser:
                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.destroyBoss, NPCID.TheDestroyer) ||
                        FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.retiBoss, NPCID.Retinazer) ||
                        FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.primeBoss, NPCID.SkeletronPrime))
                    {
                        target.AddBuff(mod.BuffType <ClippedWings>(), 15);
                    }
                    break;

                case ProjectileID.PhantasmalDeathray:
                    if (Main.npc[(int)projectile.ai[1]].active)
                    {
                        if (Main.npc[(int)projectile.ai[1]].type == NPCID.MoonLordHead)
                        {
                            target.AddBuff(mod.BuffType <FlamesoftheUniverse>(), Main.rand.Next(60, 600));
                            target.AddBuff(mod.BuffType <GodEater>(), Main.expertMode ? 210 : 420);
                            target.AddBuff(mod.BuffType <MarkedforDeath>(), 120);
                        }
                        else if (Main.npc[(int)projectile.ai[1]].type == NPCID.MoonLordFreeEye)
                        {
                            goto case ProjectileID.PhantasmalSphere;
                        }
                    }
                    break;

                case ProjectileID.PhantasmalBolt:       //if ML alive, ML vulnerable
                case ProjectileID.PhantasmalEye:        //debuff once per hit normally
                case ProjectileID.PhantasmalSphere:     //debuff per tick while overlapping player if 120 MLs killed
                    if (FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.moonBoss, NPCID.MoonLordCore) && !Main.npc[FargoGlobalNPC.moonBoss].dontTakeDamage && (target.hurtCooldowns[1] == 0 || FargoWorld.MoonlordCount >= 120))
                    {
                        int d = Main.rand.Next(Fargowiltas.DebuffIDs.Length);
                        target.AddBuff(Fargowiltas.DebuffIDs[d], Main.rand.Next(60, 600));
                    }
                    break;

                case ProjectileID.MeteorShot:
                    if (masoProj)
                    {
                        int buffTime = Main.rand.Next(120, 600);
                        target.AddBuff(BuffID.OnFire, buffTime / 2);
                        target.AddBuff(BuffID.Burning, buffTime);
                    }
                    break;

                case ProjectileID.SniperBullet:
                case ProjectileID.CrystalShard:
                    if (masoProj)
                    {
                        target.AddBuff(mod.BuffType <Defenseless>(), Main.rand.Next(1200, 3600));

                        int buffTime = Main.rand.Next(300, 600);
                        target.AddBuff(mod.BuffType <Crippled>(), buffTime);
                        target.AddBuff(mod.BuffType <ClippedWings>(), buffTime);
                    }
                    break;

                case ProjectileID.VenomArrow:
                    if (masoProj)
                    {
                        target.AddBuff(BuffID.Venom, Main.rand.Next(60, 480));
                    }
                    break;

                case ProjectileID.ChlorophyteArrow:
                    if (masoProj)
                    {
                        target.AddBuff(BuffID.Poisoned, Main.rand.Next(60, 300));
                        target.AddBuff(BuffID.Venom, Main.rand.Next(60, 300));
                        target.AddBuff(mod.BuffType <Infested>(), Main.rand.Next(180, 360));
                    }
                    break;

                case ProjectileID.MoonlordBullet:
                    if (masoProj)
                    {
                        target.AddBuff(mod.BuffType <LightningRod>(), Main.rand.Next(60, 600));
                        target.AddBuff(mod.BuffType <ClippedWings>(), Main.rand.Next(30, 300));
                    }
                    break;

                case ProjectileID.RocketSkeleton:
                    target.AddBuff(BuffID.Dazed, Main.rand.Next(30, 150));
                    target.AddBuff(BuffID.Confused, Main.rand.Next(60, 300));
                    break;

                default:
                    break;
                }
            }

            if (squeakyToy)
            {
                modPlayer.Squeak(target.Center);
            }
        }