Пример #1
0
        public override void AI()
        {
            effects(0);

            projectile.ai[0]       = projectile.ai[0] + 1;
            projectile.velocity.Y += 0.15f;
            projectile.rotation    = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;


            NPC target = Main.npc[Idglib.FindClosestTarget(0, projectile.Center, new Vector2(0f, 0f), true, true, true, projectile)];

            if (target != null)
            {
                if (new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height).Intersects
                        (new Rectangle((int)target.position.X, (int)target.position.Y, target.width, target.height)))
                {
                    IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("Sodden"), 60 * 45);
                    if (Main.player[projectile.owner].GetModPlayer <SGAPlayer>().MVMBoost)
                    {
                        IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("SoddenSlow"), 60 * 45);
                    }
                    projectile.Kill();
                }
            }
        }
Пример #2
0
        public override void OnRealHit(Player player, Projectile proj, NPC npc, int damage)
        {
            if (npc.HasBuff(ModContent.BuffType <SoulSapDebuff>()))
            {
                int index = npc.FindBuffIndex(ModContent.BuffType <SoulSapDebuff>());
                if (npc.buffTime[index] > 10)
                {
                    return;
                }
            }

            if (proj == null || Main.rand.Next(100) < ((proj.modProjectile != null && proj.modProjectile is ITrueMeleeProjectile) ? 100 : 20))
            {
                ;
            }
            {
                if (npc.SGANPCs().flaskCooldown < 1)
                {
                    Item.NewItem(npc.Center, ItemID.Star);
                    //npc.buffType[npc.buffType.Length - 1] = ModContent.BuffType<SoulSapDebuff>();
                    //npc.buffTime[npc.buffType.Length - 1] = 8 * 60;
                    IdgNPC.AddBuffBypass(npc.whoAmI, ModContent.BuffType <SoulSapDebuff>(), 60 * 8);
                    npc.SGANPCs().flaskCooldown = 8 * 60;

                    for (int i = 0; i < 25; i += 1)
                    {
                        Vector2 value = new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11));
                        value.Normalize();
                        int num45 = Gore.NewGore(npc.position + new Vector2(Main.rand.Next(npc.width), Main.rand.Next(npc.height)), value * Main.rand.NextFloat(3, 6), 17, (float)Main.rand.Next(20, 60) * 0.01f);
                        Main.gore[num45].sticky = false;
                    }
                }
            }
        }
Пример #3
0
 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(0, 100) < 20)
     {
         IdgNPC.AddBuffBypass(target.whoAmI, BuffID.Oiled, 60 * 5);
     }
     target.AddBuff(BuffID.Oiled, 60 * 20);
 }
Пример #4
0
        public override void AI()
        {
            Player player = Main.player[projectile.owner];
            NPC    target = Main.npc[(int)projectile.ai[0]];

            if (!target.active || player.dead)
            {
                projectile.Kill();
            }
            projectile.Center = target.Center;
            IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("Targeted"), 3, false);
            projectile.timeLeft = 3;
        }
Пример #5
0
        public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
        {
            SGAnpcs nyx = target.GetGlobalNPC <SGAnpcs>();
            float   it  = nyx.truthbetold;

            nyx.truthbetold = it + 0.02f;
            if (nyx.truthbetold > 0.5f)
            {
                nyx.truthbetold = 0.5f;
                IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("SunderedDefense"), 60 * 3);
            }
            damage = (int)(damage + (target.defense * nyx.truthbetold));
            //Idglib.Chat("Defense: "+nyx.truthbetold,244, 179, 66);
        }
Пример #6
0
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            projectile.velocity *= -0.5f;
            Vector2 dist     = (target.Center - projectile.Center);
            Vector2 distnorm = dist; distnorm.Normalize();

            projectile.velocity            -= distnorm * 30f;
            target.immune[projectile.owner] = 7;
            target.AddBuff(mod.BuffType("InfinityWarStormbreaker"), 600);
            if (Main.rand.Next(0, 100) < 40)
            {
                IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("InfinityWarStormbreaker"), 400);
            }
        }
Пример #7
0
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            Player    player    = Main.player[projectile.owner];
            SGAPlayer sgaplayer = player.GetModPlayer(mod, typeof(SGAPlayer).Name) as SGAPlayer;
            int       ownedproj = player.ownedProjectileCounts[mod.ProjectileType("RevolverTarget")];

            IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("Targeted"), 3, false);
            int thisone = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("RevolverTarget"), 0, 0f, projectile.owner, 0.0f, 0f);

            Main.projectile[thisone].ai[0]     = target.whoAmI;
            Main.projectile[thisone].netUpdate = true;
            sgaplayer.ammoLeftInClip          -= 1;
            //Main.PlaySound(mod.GetSoundSlot(SoundType.Custom, "Sounds/Custom/Wide_Beam_Shot"),(int)Main.player[projectile.owner].position.X,(int)Main.player[projectile.owner].position.Y,1,1.15f,((float)ownedproj)/4f);
            //Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Wide_Beam_Shot").WithVolume(1.1f).WithPitchVariance(.25f));
            Main.PlaySound(SoundLoader.customSoundType, (int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, mod.GetSoundSlot(SoundType.Custom, "Sounds/Custom/Wide_Beam_Shot"), 1.15f, ((float)-0.4 + (ownedproj) / 6f));
        }
Пример #8
0
        public override void AI()
        {
            projectile.velocity = new Vector2(projectile.velocity.X, projectile.velocity.Y * 0.95f);
            int q = 0;

            for (q = 0; q < 1; q++)
            {
                int dust = Dust.NewDust(projectile.position - new Vector2(50, 0), 100, 40, 74, 0f, projectile.velocity.Y * 0.4f, 100, Color.DarkGreen * 0.15f, 2.5f);
                Main.dust[dust].noGravity = true;
                Main.dust[dust].fadeIn    = 2f;
                //Main.dust[dust].velocity *= 1.8f;
                //Main.dust[dust].velocity.Y -= 0.5f;
                //Main.playerDrawDust.Add(dust);
            }

            int minTilePosX = (int)(projectile.position.X / 16.0) - 1;
            int maxTilePosX = (int)((projectile.position.X + 2) / 16.0) + 2;
            int minTilePosY = (int)(projectile.position.Y / 16.0) - 1;
            int maxTilePosY = (int)((projectile.position.Y + 2) / 16.0) + 2;

            int whereisity;

            whereisity = Idglib.RaycastDown(minTilePosX + 1, minTilePosY);
            //Main.NewText(""+(whereisity-minTilePosY),255,255,255);
            projectile.position.Y += whereisity - minTilePosY > 2 ? 1 : 0;


            Rectangle rectangle1      = new Rectangle((int)projectile.Center.X - 40, (int)projectile.Center.Y - 60, 100, 40);
            int       maxDistance     = 50;
            bool      playerCollision = false;

            for (int index = 0; index < Main.maxNPCs; ++index)
            {
                if (Main.npc[index].active)
                {
                    Rectangle rectangle2 = new Rectangle((int)Main.npc[index].position.X - Main.npc[index].width, (int)Main.npc[index].position.Y - Main.npc[index].height, Main.npc[index].height * 2, Main.npc[index].width * 2);
                    if (rectangle1.Intersects(rectangle2))
                    {
                        if (Main.npc[index].GetGlobalNPC <SGAnpcs>().Combusted < 1)
                        {
                            IdgNPC.AddBuffBypass(index, mod.BuffType("DosedInGas"), 60 * 8, true);
                        }
                    }
                }
            }
        }
Пример #9
0
        public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
        {
            for (int a = 0; a < 3; a += 1)
            {
                for (int i = 0; i < 360; i += 120)
                {
                    float   angle  = MathHelper.ToRadians(i + (a * 45));
                    Vector2 hereas = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * (200f + (160f * a));
                    hereas += target.Center;
                    Vector2 gohere = (target.Center - hereas); gohere.Normalize(); gohere *= (16f * a);
                    int     proj   = Projectile.NewProjectile(hereas, gohere, mod.ProjectileType("ProjectilePortalEmnityHit"), (int)(damage * 0.25f), knockBack, player.whoAmI, 167 + Main.rand.Next(4));
                    Main.projectile[proj].magic     = false;
                    Main.projectile[proj].melee     = true;
                    Main.projectile[proj].timeLeft  = 70;
                    Main.projectile[proj].netUpdate = true;
                    IdgProjectile.Sync(proj);
                }
            }

            IdgNPC.AddBuffBypass(target.whoAmI, mod.BuffType("SunderedDefense"), 60 * 12);
        }
Пример #10
0
 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(0, 100) < 50)
     {
         if (target.GetGlobalNPC <SGAnpcs>().Combusted < 1)
         {
             target.AddBuff(mod.BuffType("DosedInGas"), 60 * 5);
         }
     }
     if (Main.rand.Next(0, 100) < 20)
     {
         IdgNPC.AddBuffBypass(target.whoAmI, BuffID.Oiled, 60 * 10);
     }
     base.OnHitNPC(target, damage, knockback, crit);
     if (target.HasBuff(BuffID.OnFire))
     {
         projectile.type      = ProjectileID.HellfireArrow;
         projectile.penetrate = 0;
         projectile.Kill();
         return;
     }
 }
Пример #11
0
 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     //target.immune[projectile.owner] = 5;
     IdgNPC.AddBuffBypass(target.whoAmI, ModContent.BuffType <NapalmBurn>(), 60 * (target.buffImmune[ModContent.BuffType <NapalmBurn>()] ? 4 : 8));
 }
        private void OnHit(NPC npc, Player player, int damage, float knockback, bool crit, Item item, Projectile projectile, bool isproj = false)
        {
            SGAPlayer moddedplayer = player.GetModPlayer <SGAPlayer>();

            if (moddedplayer.HasGucciGauntlet())
            {
                if (player.ownedLargeGems[0] && Main.rand.Next(0, 10) == 0)
                {
                    npc.AddBuff(BuffID.ShadowFlame, 60 * 15);
                }
            }

            if (moddedplayer.flaskBuff != default && ((projectile != null && projectile.melee) || (item != null && item.melee)))
            {
                if (Main.rand.Next(0, moddedplayer.flaskBuff.Chance) == 0)
                {
                    npc.AddBuff(moddedplayer.flaskBuff.Debuff, moddedplayer.flaskBuff.Period);
                    moddedplayer.flaskBuff.OnRealHit(player, projectile, npc, damage);
                }
            }

            if (item != null && npc.life - damage < 1 && npc.lifeMax > 50)
            {
                if (item.type == mod.ItemType("Powerjack"))
                {
                    player.HealEffect(25, false);
                    player.netLife   = true;
                    player.statLife += 25;
                    if (player.statLife > player.statLifeMax2)
                    {
                        player.statLife = player.statLifeMax2;
                    }
                    NetMessage.SendData(66, -1, -1, null, player.whoAmI, (float)25f, 0f, 0f, 0, 0, 0);
                }
            }

            if (isproj)
            {
                if (projectile.minion && moddedplayer.IDGset)
                {
                    if (npc.immune[projectile.owner] > 0)
                    {
                        npc.immune[projectile.owner] = ((int)(npc.immune[projectile.owner] * 0.75f));
                    }

                    moddedplayer.digiStacks = Math.Min(moddedplayer.digiStacksMax, moddedplayer.digiStacks + (int)Math.Max((float)projectile.damage, (float)damage));
                }

                if (projectile.type == ProjectileID.CultistBossLightningOrbArc)
                {
                    immunitetolightning = projectile.localNPCHitCooldown;
                }

                bool trapdamage = false;
                if (projectile != null && projectile.trap)
                {
                    trapdamage = true;
                }


                if (trapdamage)
                {
                    if (moddedplayer.JaggedWoodenSpike)
                    {
                        if (Main.rand.Next(0, 100) < 15)
                        {
                            npc.AddBuff(mod.BuffType("MassiveBleeding"), 60 * 5);
                        }
                    }
                }

                if (moddedplayer.Mangroveset && player.ownedProjectileCounts[mod.ProjectileType("MangroveOrb")] < 4)
                {
                    if (crit && projectile.thrown)
                    {
                        player.AddBuff(BuffID.DryadsWard, 60 * 5);

                        int newDamage = damage;
                        if (newDamage > 50)
                        {
                            newDamage = 50 + (int)Math.Pow((damage - 50), 0.75f);
                        }

                        List <Projectile> itz = Idglib.Shattershots(player.Center, player.Center + (player.Center - npc.Center), new Vector2(0, 0), mod.ProjectileType("MangroveOrb"), newDamage, 8f, 120, 2, false, 0, false, 400);
                        //itz[0].damage = 30;
                        itz[0].owner = player.whoAmI; itz[0].friendly = true; itz[0].hostile = false;
                        itz[1].owner = player.whoAmI; itz[1].friendly = true; itz[1].hostile = false;
                        Main.projectile[itz[0].whoAmI].netUpdate = true;
                        Main.projectile[itz[1].whoAmI].netUpdate = true;

                        IdgProjectile.AddOnHitBuff(itz[0].whoAmI, BuffID.DryadsWardDebuff, 60 * 5);
                        IdgProjectile.AddOnHitBuff(itz[1].whoAmI, BuffID.DryadsWardDebuff, 60 * 5);

                        if (Main.netMode == 2 && itz[0].whoAmI < 200)
                        {
                            NetMessage.SendData(27, -1, -1, null, itz[0].whoAmI, 0f, 0f, 0f, 0, 0, 0);
                        }
                    }
                }
            }

            SGAWorld.overalldamagedone = ((int)damage) + SGAWorld.overalldamagedone;

            if (item != null)
            {
                if (moddedplayer.FieryheartBuff > 0)
                {
                    if (!npc.buffImmune[BuffID.Daybreak] || moddedplayer.FieryheartBuff > 15)
                    {
                        IdgNPC.AddBuffBypass(npc.whoAmI, 189, 1 * (20 + (int)(player.SGAPly().ExpertiseCollectedTotal / 250f)));
                    }
                }
            }

            if (projectile != null)
            {
                if (moddedplayer.FieryheartBuff > 0 && projectile.owner == player.whoAmI && projectile.friendly)
                {
                    if (!npc.buffImmune[BuffID.Daybreak] || moddedplayer.FieryheartBuff > 15)
                    {
                        IdgNPC.AddBuffBypass(npc.whoAmI, 189, 1 * (20 + (int)(player.SGAPly().ExpertiseCollectedTotal / 250f)));
                    }
                }
                if ((moddedplayer.CirnoWings) && projectile.owner == player.whoAmI)
                {
                    if (isproj && (projectile.magic == true && Main.rand.Next(0, 20) == 0) || projectile.coldDamage)
                    {
                        npc.AddBuff(BuffID.Frostburn, 4 * 60);
                    }
                }
                if ((moddedplayer.glacialStone) && projectile.owner == player.whoAmI && projectile.melee)
                {
                    if (isproj && projectile.melee == true)
                    {
                        npc.AddBuff(BuffID.Frostburn, Main.rand.Next(1, 6) * 60);
                    }
                }
            }

            if (moddedplayer.Redmanastar > 0)
            {
                if (isproj && projectile.magic == true)
                {
                    int[] buffids = { BuffID.OnFire, mod.BuffType("ThermalBlaze"), BuffID.Daybreak };
                    if (projectile != null && Main.rand.Next(0, 100) < 5)
                    {
                        npc.AddBuff(buffids[moddedplayer.Redmanastar - 1], 4 * 60);
                    }
                    if (projectile != null && Main.rand.Next(0, 100) < 1)
                    {
                        npc.buffImmune[buffids[moddedplayer.Redmanastar - 1]] = false;
                    }
                }
            }

            if (moddedplayer.SerratedTooth == true)
            {
                if (damage > npc.defense * 5)
                {
                    npc.AddBuff(mod.BuffType("MassiveBleeding"), Math.Min((int)(1f + ((float)damage - (float)npc.defense * 5f) * 0.02f) * 60, 60 * 5));
                }
            }

            if (moddedplayer.Blazewyrmset)
            {
                if (crit && ((item != null && item.melee && item.pick + item.axe + item.hammer < 1)) || (projectile != null && projectile.melee && (player.heldProj == projectile.whoAmI || (projectile.modProjectile != null && (projectile.modProjectile is IShieldBashProjectile || projectile.modProjectile is ITrueMeleeProjectile)))))
                {
                    if (player.SGAPly().AddCooldownStack(12 * 60))
                    {
                        Main.PlaySound(SoundID.Item45, npc.Center);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("BoulderBlast"), damage * 3, knockback * 3f, player.whoAmI, 0f, 0f);
                    }
                }
            }

            if (moddedplayer.alkalescentHeart)
            {
                int[] maxcrit = { player.meleeCrit, player.rangedCrit, player.magicCrit, player.Throwing().thrownCrit };
                Array.Sort(maxcrit);
                Array.Reverse(maxcrit);
                if (crit || (projectile != null && projectile.minion && Main.rand.Next(0, 100) < maxcrit[0]))
                {
                    Point point = new Point(0, 0);
                    point.X = (!npc.HasBuff(BuffID.Poisoned) ? BuffID.Poisoned : (!npc.HasBuff(BuffID.Venom) ? BuffID.Venom : (!npc.HasBuff(ModContent.BuffType <AcidBurn>()) ? ModContent.BuffType <AcidBurn>() : -1)));
                    if (point.X > -1)
                    {
                        point.Y = (point.X == ModContent.BuffType <AcidBurn>() ? 45 : point.X == BuffID.Venom ? 200 : point.X == BuffID.Poisoned ? 300 : 0);
                        npc.AddBuff(point.X, point.Y);
                        //if (Main.rand.Next(0, 10) == 0)
                        //	player.AddBuff(point.X, point.Y/2);
                    }
                }
            }

            bool hasabuff = false;

            if (npc.HasBuff(BuffID.OnFire))
            {
                hasabuff = true;
            }
            for (int i = 0; i < SGAmod.otherimmunes.Length; i++)
            {
                if (npc.HasBuff(SGAmod.otherimmunes[i]))
                {
                    hasabuff = true;
                }
            }


            if (DosedInGas && hasabuff)
            {
                Combusted = 60 * 6;
                int buff = npc.FindBuffIndex(mod.BuffType("DosedInGas"));

                if ((isproj && Main.player[projectile.owner].GetModPlayer <SGAPlayer>().MVMBoost) || (item != null && player.GetModPlayer <SGAPlayer>().MVMBoost))
                {
                    int prog = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Vector2.Zero.X, Vector2.Zero.Y, ProjectileID.GrenadeIII, 350, 5f, player.whoAmI);
                    Main.projectile[prog].thrown = false; Main.projectile[prog].ranged = false; Main.projectile[prog].timeLeft = 2; Main.projectile[prog].netUpdate = true;
                    IdgProjectile.Sync(prog);
                }


                if (buff > -1)
                {
                    npc.DelBuff(buff);
                    IdgNPC.AddBuffBypass(npc.whoAmI, BuffID.OnFire, 60 * 10);
                }
            }

            if (player != null && player.SGAPly().toxicity > 0 && npc.HasBuff(BuffID.Stinky))
            {
                if (Main.rand.Next(0, 50) == 0)
                {
                    SGAPlayer.SwearExplosion(npc.Center, player, (int)(damage * 0.5f));
                }
            }

            /*if (PinkyMinion>0)
             * {
             *      if ((npc.life-damage)<1 && ((projectile.penetrate<5 && projectile.penetrate >= 0) || projectile == null))
             *      {
             *              NPC[] findnpc = SGAUtils.ClosestEnemies(npc.Center, 1500, checkWalls: false, checkCanChase: false)?.ToArray();
             *              findnpc = findnpc != null ? findnpc.Where(testby => testby.type == ModContent.NPCType<NPCs.SPinkyTrue>()).ToArray() : null;
             *
             *              if (findnpc != null && findnpc.Count()>0 && findnpc[0].type == ModContent.NPCType<NPCs.SPinkyTrue>())
             *              Projectile.NewProjectile(npc.Center, Vector2.Normalize(findnpc[0].Center - npc.Center) * 10f, ModContent.ProjectileType<NPCs.PinkyMinionKilledProj>(), 500, 0);
             *      }
             * }*/
        }