Exemple #1
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));
     }
 }
 public override void AI()
 {
     if (!FargoGlobalNPC.BossIsAlive(ref FargoGlobalNPC.beeBoss, NPCID.QueenBee) &&
         !NPC.AnyNPCs(NPCID.QueenBee))
     {
         npc.StrikeNPCNoInteraction(9999, 0f, 0);
     }
 }
Exemple #3
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;
             *  }
             * }*/
        }
Exemple #4
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;
            }

            if (GetInstance <FargoConfig>().Fountains)
            {
                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;

                    //oasis and cavern fountains
                }
            }
        }
        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;
            }
        }
Exemple #6
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;
                }
            }
        }
Exemple #7
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);
            }
        }