コード例 #1
0
 public override void OnHitNPCFirst(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                    OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     modTarget.alchemistNature = 60 * 10;
 }
コード例 #2
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, (float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(180)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProjAlt>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active == true && proj.type == ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProj>() && proj.owner == projectile.owner && proj.localAI[1] != 1f)
                {
                    proj.Kill();
                }
            }
            nb  = alchProj.nbElements + alchProj.nbElementsNoExtract;
            nb += player.HasBuff(BuffType <Alchemist.Buffs.MushroomHeal>()) ? Main.rand.Next(3) : 0;
            for (int i = 0; i < nb; i++)
            {
                Vector2 vel = (new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(180)));
                int     dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Nature.NatureSporeProj>(), dmg, 0f, projectile.owner);
            }
        }
コード例 #3
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(3);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, -(float)((3 * alchProj.nbElements) + Main.rand.Next(3))).RotatedByRandom(MathHelper.ToRadians(10)));
                int     spawnProj = Main.rand.Next(3) == 0 ? ProjectileType <Alchemist.Projectiles.AlchemistSmoke3>() : ProjectileType <Alchemist.Projectiles.AlchemistSmoke2>();
                int     smokeProj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
                Main.projectile[smokeProj].localAI[0] = alchProj.glowColor.R;
                Main.projectile[smokeProj].localAI[1] = alchProj.glowColor.G;
                Main.projectile[smokeProj].ai[1]      = alchProj.glowColor.B;
            }

            if (alchProj.waterFlask.type == ItemType <Alchemist.Weapons.Water.BloodMoonFlask>())
            {
                for (int i = 0; i < nb; i++)
                {
                    int     dmg       = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                    Vector2 vel       = (new Vector2(0f, -(float)((3 * alchProj.nbElements) + Main.rand.Next(3))).RotatedByRandom(MathHelper.ToRadians(10)));
                    int     spawnProj = ProjectileType <Alchemist.Projectiles.Water.BloodMoonFlaskProj>();
                    Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, dmg, 0f, projectile.owner);
                }
            }

            int type    = ProjectileType <Alchemist.Projectiles.Air.CloudInAVialProj>();
            int newProj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, type, 0, 0.5f, projectile.owner);

            Main.projectile[newProj].ai[1]     = alchProj.nbElements;
            Main.projectile[newProj].netUpdate = true;
        }
コード例 #4
0
ファイル: SeafoamVial.cs プロジェクト: pitchrat/Orchid-Mod
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, -(float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(90)));
                int     spawnProj = alchProj.natureFlask.type == ItemType <Alchemist.Weapons.Nature.PoisonVial>() ? ProjectileType <Alchemist.Projectiles.Nature.PoisonVialProjAlt>() : ProjectileType <Alchemist.Projectiles.Water.SeafoamVialProjAlt>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            int dmg   = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
            int shoot = ProjectileType <Alchemist.Projectiles.Water.SeafoamVialProj>();

            if (alchProj.natureFlask.type == ItemType <Alchemist.Weapons.Nature.PoisonVial>())
            {
                dmg   = OrchidModAlchemistHelper.getSecondaryDamage(player, modPlayer, alchProj.natureFlask.type, alchProj.nbElements);
                shoot = ProjectileType <Alchemist.Projectiles.Nature.PoisonVialProj>();
            }
            nb = alchProj.hasCloud() ? 2 : 1;
            for (int i = 0; i < nb; i++)
            {
                Vector2 vel = (new Vector2(0f, -2.5f).RotatedByRandom(MathHelper.ToRadians(30)));
                vel *= (float)(1 - (Main.rand.Next(10) / 10));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, shoot, dmg, 0.5f, projectile.owner);
            }
        }
コード例 #5
0
        public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                            OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            if (alchProj.fireFlask.type != 0)
            {
                int dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                modTarget.spreadOilFire(target.Center, dmg, Main.player[projectile.owner]);
                Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 45);
            }

            int rand = alchProj.nbElements;

            rand += alchProj.hasCloud() ? 2 : 0;
            if (Main.rand.Next(6) < rand && !alchProj.noCatalyticSpawn)
            {
                int     dmg            = 0;
                int     proj           = ProjectileType <Alchemist.Projectiles.Reactive.OilBubble>();
                Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(20));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 0f, projectile.owner);
            }
        }
コード例 #6
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, (float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(180)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Nature.SunflowerFlaskProj4>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            if (alchProj.waterFlask.type != 0)
            {
                int     dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Vector2 vel = (new Vector2(0f, -2f).RotatedByRandom(MathHelper.ToRadians(20)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Nature.SunflowerFlaskProj1>(), dmg, 0f, projectile.owner);
            }
        }
コード例 #7
0
 public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                     OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     target.AddBuff(BuffType <Alchemist.Buffs.Debuffs.Attraction>(), 60 * (alchProj.nbElements * 3));
 }
コード例 #8
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int   dmg  = getSecondaryDamage(player, modPlayer, alchProj.nbElements) + ((alchProj.airFlask.type == 0 && alchProj.fireFlask.type != 0) ? 6 : 0);
            int   rand = 2 + alchProj.nbElements + Main.rand.Next(2);
            float kb   = 0.5f * alchProj.nbElements;

            for (int i = 0; i < rand; i++)
            {
                Vector2 vel = (new Vector2(0f, ((alchProj.airFlask.type != 0 && alchProj.fireFlask.type == 0) ? -4f : -2f)).RotatedByRandom(MathHelper.ToRadians(180)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Water.BloodMoonFlaskProj>(), dmg, kb, projectile.owner);
            }
        }
コード例 #9
0
ファイル: SlimeFlask.cs プロジェクト: pitchrat/Orchid-Mod
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            if (alchProj.fireFlask.type != 0)
            {
                int type = ProjectileType <Alchemist.Projectiles.Water.SlimeFlaskProj>();
                int dmg  = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, type, dmg, 0.5f, projectile.owner);
                OrchidModProjectile.spawnDustCircle(projectile.Center, 6, 10, 10, true, 1f, 1f, 5f, true, true, false, 0, 0, true);
                OrchidModProjectile.spawnDustCircle(projectile.Center, 6, 10, 10, true, 1.5f, 1f, 2f, true, true, false, 0, 0, true);
                Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 45);

                if (player.HasBuff(BuffType <Alchemist.Buffs.SlimeFlaskBuff>()))
                {
                    int nb = 2 + Main.rand.Next(3);
                    for (int i = 0; i < nb; i++)
                    {
                        Vector2 vel       = (new Vector2(0f, -(float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(80)));
                        int     spawnProj = ProjectileType <Alchemist.Projectiles.Fire.EmberVialProjAlt>();
                        Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
                    }
                    int itemType = ItemType <Alchemist.Weapons.Fire.EmberVial>();
                    int dmgAlt   = OrchidModAlchemistHelper.getSecondaryDamage(player, modPlayer, itemType, alchProj.nbElements, true);
                    int rand     = alchProj.nbElements + Main.rand.Next(2);
                    for (int i = 0; i < rand; i++)
                    {
                        Vector2 vel = (new Vector2(0f, -3f).RotatedByRandom(MathHelper.ToRadians(60)));
                        Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Fire.EmberVialProj>(), dmgAlt, 0f, projectile.owner);
                    }
                }
            }
        }
コード例 #10
0
        public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                            OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            if (!(target.boss || target.type == NPCID.TargetDummy) && target.knockBackResist > 0f)
            {
                target.AddBuff(mod.BuffType("SlimeSlow"), 90 * (alchProj.nbElements * 2));
            }

            int rand = alchProj.nbElements;

            rand += alchProj.hasCloud() ? 2 : 0;
            rand += player.HasBuff(BuffType <Alchemist.Buffs.KingSlimeFlaskBuff>()) ? 2 : 0;
            if (Main.rand.Next(10) < rand && !alchProj.noCatalyticSpawn)
            {
                int dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                dmg += player.HasBuff(BuffType <Alchemist.Buffs.KingSlimeFlaskBuff>()) ? 5 : 0;
                int     proj           = ProjectileType <Alchemist.Projectiles.Reactive.SlimeBubble>();
                Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(20));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 0f, projectile.owner);
            }
        }
コード例 #11
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int dmg  = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
            int rand = alchProj.nbElements + Main.rand.Next(2);

            for (int i = 0; i < rand; i++)
            {
                Vector2 vel = (new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(180)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Water.DungeonFlaskProj>(), dmg, 0f, projectile.owner);
            }
        }
コード例 #12
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int dmg       = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
            int spawnProj = ProjectileType <Alchemist.Projectiles.Air.ShadowChestFlaskProj>();

            for (int i = 0; i < 4; i++)
            {
                Vector2 vel = (new Vector2(0f, 5f * alchProj.nbElements).RotatedBy(MathHelper.ToRadians(90 * i)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, dmg, 0f, projectile.owner);
            }
        }
コード例 #13
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);

            Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType <Alchemist.Projectiles.Fire.GunpowderFlaskProj>(), dmg, 3f, projectile.owner, 0.0f, 0.0f);
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
        }
コード例 #14
0
        public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                            OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            if (!(target.boss || target.type == NPCID.TargetDummy) && target.knockBackResist > 0f)
            {
                target.AddBuff(mod.BuffType("SlimeSlow"), 90 * (alchProj.nbElements * 2));
            }

            int rand = alchProj.nbElements;

            rand += alchProj.hasCloud() ? 2 : 0;
            if (Main.rand.Next(10) < rand && !alchProj.noCatalyticSpawn)
            {
                int     dmg            = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                int     proj           = ProjectileType <Alchemist.Projectiles.Reactive.SlimeBubbleLava>();
                Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(20));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 0f, projectile.owner);
            }

            if (modTarget.alchemistFire > 0)
            {
                int nb   = Main.rand.Next(3) + 3;
                int dmg  = (int)(getSecondaryDamage(player, modPlayer, alchProj.nbElements) * 1.5);
                int proj = ProjectileType <Alchemist.Projectiles.Fire.HellSlimeFlaskProj>();
                for (int i = 0; i < nb; i++)
                {
                    Vector2 perturbedSpeed = projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15)) * 0.75f;
                    Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 1f, projectile.owner);
                }
            }
        }
コード例 #15
0
ファイル: IceChestFlask.cs プロジェクト: pitchrat/Orchid-Mod
        public override void KillFirst(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            if (alchProj.fireFlask.type == 0)
            {
                int range = 135 * alchProj.nbElements;
                int nb    = 20 * alchProj.nbElements;
                OrchidModProjectile.spawnDustCircle(projectile.Center, this.rightClickDust, (int)(range * 0.75), nb, true, 1.5f, 1f, 8f);
                OrchidModProjectile.spawnDustCircle(projectile.Center, this.rightClickDust, (int)(range * 0.5), (int)(nb / 3), true, 1.5f, 1f, 16f, true, true, false, 0, 0, true);

                int damage = getSecondaryDamage(player, modPlayer, alchProj.nbElements);

                /*
                 * int projType = ProjectileType<Alchemist.Projectiles.Water.IceChestFlaskProj>();
                 * int newProjectileInt = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, damage, 0f, projectile.owner);
                 * Projectile newProjectile = Main.projectile[newProjectileInt];
                 * newProjectile.width = range * 2;
                 * newProjectile.height = range * 2;
                 * newProjectile.position.X = projectile.Center.X - (newProjectile.width / 2);
                 * newProjectile.position.Y = projectile.Center.Y - (newProjectile.width / 2);
                 * newProjectile.netUpdate = true;
                 */

                for (int i = 0; i < 20; i++)
                {
                    int dust = Dust.NewDust(projectile.position, range * 2, range * 2, 261);
                    Main.dust[dust].scale       = 1.2f;
                    Main.dust[dust].noGravity   = true;
                    Main.dust[dust].velocity.X /= 3;
                    Main.dust[dust].velocity.Y /= 3;
                }

                for (int l = 0; l < Main.npc.Length; l++)
                {
                    NPC   target   = Main.npc[l];
                    float offsetX  = target.Center.X - projectile.Center.X;
                    float offsetY  = target.Center.Y - projectile.Center.Y;
                    float distance = (float)Math.Sqrt(offsetX * offsetX + offsetY * offsetY);
                    if ((range + (target.width / 2)) > distance)
                    {
                        OrchidModAlchemistNPC modTarget = target.GetGlobalNPC <OrchidModAlchemistNPC>();
                        target.AddBuff(BuffType <Alchemist.Buffs.Debuffs.FlashFreeze>(), modTarget.alchemistWater > 0 ? 60 * 30 : 60 * 3);
                    }
                }

                for (int l = 0; l < Main.projectile.Length; l++)
                {
                    Projectile proj     = Main.projectile[l];
                    float      offsetX  = proj.Center.X - projectile.Center.X;
                    float      offsetY  = proj.Center.Y - projectile.Center.Y;
                    float      distance = (float)Math.Sqrt(offsetX * offsetX + offsetY * offsetY);
                    if (player.whoAmI == proj.owner && proj.active && (range + (proj.width / 2)) > distance)
                    {
                        if (smallProjectiles.Contains(proj.type))
                        {
                            int projType = ProjectileType <IceChestFlaskProjSmall>();
                            Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 1f, projType, damage, 1f, player.whoAmI);
                            proj.active    = false;
                            proj.netUpdate = true;
                        }

                        if (bigProjectiles.Contains(proj.type))
                        {
                            int projType = ProjectileType <IceChestFlaskProjBig>();
                            Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 1f, projType, damage * 5, 5f, player.whoAmI);
                            proj.active    = false;
                            proj.netUpdate = true;
                        }
                    }
                }
            }
        }
コード例 #16
0
 public virtual void KillThird(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
 }
コード例 #17
0
        public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                            OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int rand = alchProj.nbElements;

            rand += alchProj.hasCloud() ? 2 : 0;
            if (Main.rand.Next(10) < rand)
            {
                int     dmg            = getSecondaryDamage(player, modPlayer, alchProj.nbElements + 5);
                int     proj           = ProjectileType <Alchemist.Projectiles.Reactive.LivingSapBubble>();
                Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(20));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 0f, projectile.owner);
            }
        }
コード例 #18
0
 public virtual void OnHitNPCThird(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer, OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
 }
コード例 #19
0
 public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     if (alchProj.nbElements == 1)
     {
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 20, true, 1.5f, 1f, 3f);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 20, true, 1.5f, 1f, 3f, true, false);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 20, true, 1.5f, 1f, 3f, false, true);
     }
     else if (alchProj.nbElements == 2)
     {
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 30, true, 1.5f, 1f, 8f);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 30, true, 1.5f, 1f, 8f, true, false);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 30, true, 1.5f, 1f, 8f, false, true);
     }
     else if (alchProj.nbElements > 2)
     {
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 40, true, 1.5f, 1f, 13f);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 40, true, 1.5f, 1f, 13f, true, false);
         OrchidModProjectile.spawnDustCircle(projectile.Center, 60, 20, 40, true, 1.5f, 1f, 13f, false, true);
     }
     if (!alchProj.hitNPC)
     {
         float baseRange        = 50f;
         int   usedElements     = alchProj.nbElements > 3 ? 3 : alchProj.nbElements;
         float distance         = 20f + usedElements * baseRange;
         NPC   attractiteTarget = null;
         for (int k = 0; k < 200; k++)
         {
             if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly)
             {
                 Vector2 newMove    = Main.npc[k].Center - projectile.Center;
                 float   distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y);
                 if (distanceTo < distance)
                 {
                     distance         = distanceTo;
                     attractiteTarget = Main.npc[k];
                 }
             }
         }
         if (attractiteTarget != null)
         {
             attractiteTarget.AddBuff(BuffType <Alchemist.Buffs.Debuffs.Attraction>(), 60 * (alchProj.nbElements * 3));
         }
     }
 }
コード例 #20
0
 public virtual void AddVariousEffects(Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
 }
コード例 #21
0
ファイル: SunplateFlask.cs プロジェクト: pitchrat/Orchid-Mod
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int rand  = Main.rand.Next(180);
            int rand2 = Main.rand.Next(3);

            for (int i = 0; i < 2; i++)
            {
                Vector2 vel       = (new Vector2(0f, -5f).RotatedBy(MathHelper.ToRadians(rand + (180 * i))));
                int     dmg       = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                int     spawnProj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Air.SunplateFlaskProj>(), dmg, 0.1f, projectile.owner);
                Main.projectile[spawnProj].ai[1]     = 180f * i;
                Main.projectile[spawnProj].ai[0]     = rand2;
                Main.projectile[spawnProj].netUpdate = true;
            }
        }
コード例 #22
0
ファイル: EmberVial.cs プロジェクト: pitchrat/Orchid-Mod
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(3);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, -(float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(80)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Fire.EmberVialProjAlt>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            int dmg  = this.getSecondaryDamage(player, modPlayer, 0);
            int rand = alchProj.nbElements + Main.rand.Next(2);

            for (int i = 0; i < rand; i++)
            {
                Vector2 vel = (new Vector2(0f, -3f).RotatedByRandom(MathHelper.ToRadians(60)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Fire.EmberVialProj>(), dmg, 0f, projectile.owner);
            }
        }
コード例 #23
0
ファイル: SeafoamVial.cs プロジェクト: pitchrat/Orchid-Mod
        public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                            OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int rand = alchProj.nbElements;

            rand += alchProj.hasCloud() ? 2 : 0;
            if (Main.rand.Next(10) < rand && !alchProj.noCatalyticSpawn)
            {
                int dmg  = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                int proj = ProjectileType <Alchemist.Projectiles.Reactive.SeafoamBubble>();
                if (alchProj.natureFlask.type == ItemType <Alchemist.Weapons.Nature.PoisonVial>())
                {
                    dmg  = OrchidModAlchemistHelper.getSecondaryDamage(player, modPlayer, alchProj.natureFlask.type, alchProj.nbElements);
                    proj = ProjectileType <Alchemist.Projectiles.Reactive.PoisonBubble>();
                }
                Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(20));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, proj, dmg, 0f, projectile.owner);
            }
        }
コード例 #24
0
ファイル: EmberVial.cs プロジェクト: pitchrat/Orchid-Mod
 public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                     OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     target.AddBuff(BuffID.OnFire, (60 * 3) + (60 * (alchProj.nbElements)));
 }
コード例 #25
0
 public override void AddVariousEffects(Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     if (alchProj.fireFlask.type != 0)
     {
         projectile.damage += (int)(30 * modPlayer.alchemistDamage);
     }
 }
コード例 #26
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int  projType        = ProjectileType <Alchemist.Projectiles.Air.CrimsonFlaskProj>();
            int  projType2       = ProjectileType <Alchemist.Projectiles.Air.CrimsonFlaskProjAlt>();
            bool spawnedMushroom = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj = Main.projectile[l];
                if (proj.active == true && proj.type == projType && proj.owner == projectile.owner)
                {
                    spawnedMushroom = true;
                    break;
                }
            }

            if (!spawnedMushroom)
            {
                int dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                int nb  = (alchProj.nbElements * 3) + Main.rand.Next(alchProj.nbElements * 2);
                for (int i = 0; i < nb; i++)
                {
                    float      speed   = (5f / (nb + 1)) * (i + 1);
                    Vector2    vel     = (new Vector2(0f, speed).RotatedByRandom(MathHelper.ToRadians(180)));
                    Projectile newProj = Main.projectile[Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 5, vel.X, vel.Y, projType, dmg, 0.1f, projectile.owner)];
                    newProj.timeLeft  = 70 + (((20 - nb) > 10 ? (20 - nb) : 10) * i);
                    newProj.netUpdate = true;
                }
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 5, 0f, 0f, projType2, 0, 0f, projectile.owner);
            }
        }
コード例 #27
0
 public override void AddVariousEffects(Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile proj, OrchidModGlobalItem globalItem)
 {
     alchProj.nbElementsNoExtract--;
 }
コード例 #28
0
ファイル: IceChestFlask.cs プロジェクト: pitchrat/Orchid-Mod
 public override void OnHitNPCSecond(NPC target, int damage, float knockback, bool crit, Player player, OrchidModPlayer modPlayer,
                                     OrchidModAlchemistNPC modTarget, OrchidModGlobalNPC modTargetGlobal, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
 {
     if (alchProj.fireFlask.type != 0)
     {
         modTarget.alchemistWater = 60 * 10;
     }
 }
コード例 #29
0
        public override void KillSecond(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int nb = 2 + Main.rand.Next(2);

            for (int i = 0; i < nb; i++)
            {
                Vector2 vel       = (new Vector2(0f, (float)(3 + Main.rand.Next(4))).RotatedByRandom(MathHelper.ToRadians(180)));
                int     spawnProj = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProjAlt2>();
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, spawnProj, 0, 0f, projectile.owner);
            }
            bool spawnedMushroom = false;

            for (int l = 0; l < Main.projectile.Length; l++)
            {
                Projectile proj        = Main.projectile[l];
                int        projType    = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProj>();
                int        projTypeAlt = ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProjAlt>();
                if (proj.active == true && (proj.type == projType || proj.type == projTypeAlt) && proj.owner == projectile.owner)
                {
                    spawnedMushroom = true;
                    break;
                }
            }
            if (!spawnedMushroom)
            {
                int     dmg = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
                Vector2 vel = (new Vector2(0f, -2f).RotatedByRandom(MathHelper.ToRadians(20)));
                Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vel.X, vel.Y, ProjectileType <Alchemist.Projectiles.Nature.GlowingMushroomVialProj>(), dmg, 0f, projectile.owner);
            }
        }
コード例 #30
0
        public override void KillFirst(int timeLeft, Player player, OrchidModPlayer modPlayer, AlchemistProj alchProj, Projectile projectile, OrchidModGlobalItem globalItem)
        {
            int range = 100 * alchProj.nbElements;
            int nb    = 20 * alchProj.nbElements;

            OrchidModProjectile.spawnDustCircle(projectile.Center, this.rightClickDust, (int)(range * 0.75), nb, true, 1.5f, 1f, 8f);
            OrchidModProjectile.spawnDustCircle(projectile.Center, this.rightClickDust, (int)(range * 0.5), (int)(nb / 3), true, 1.5f, 1f, 16f, true, true, false, 0, 0, true);

            int        projType         = ProjectileType <Alchemist.Projectiles.Nature.JungleLilyFlaskProj>();
            int        damage           = getSecondaryDamage(player, modPlayer, alchProj.nbElements);
            int        newProjectileInt = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, damage, 0f, projectile.owner);
            Projectile newProjectile    = Main.projectile[newProjectileInt];

            newProjectile.width      = range * 2;
            newProjectile.height     = range * 2;
            newProjectile.position.X = projectile.Center.X - (newProjectile.width / 2);
            newProjectile.position.Y = projectile.Center.Y - (newProjectile.width / 2);
            newProjectile.netUpdate  = true;
        }