コード例 #1
0
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float rotation = MathHelper.ToRadians(16);

            CaliburnTypeA.SpectralSummon(player, type, damage, player.Center);

            /*List<NPC> guys = new List<NPC>();
             *
             * for (int a = 0; a < Main.maxNPCs; a++)
             * {
             *      NPC npchim = Main.npc[a];
             *      Projectile proj = new Projectile();
             *      proj.SetDefaults(ProjectileID.ChlorophyteBullet);
             *
             *      if (npchim.active && !npchim.friendly && !npchim.dontTakeDamage && npchim.CanBeChasedBy(proj) && (npchim.Center-player.Center).Length()<400)
             *      {
             *              guys.Add(npchim);
             *      }
             *
             * }
             * if (guys.Count > 0)
             * {
             *      for (int i = 0; i < numberProjectiles; i++)
             *      {
             *              NPC theone = guys[Main.rand.Next(0, guys.Count)];
             *
             *              Vector2 perturbedSpeed = new Vector2(Main.rand.NextFloat(2f, 7f) * (Main.rand.NextBool() ? 1f : -1f), Main.rand.NextFloat(1f, 4f)); // Watch out for dividing by 0 if there is only 1 projectile.
             *              perturbedSpeed *= Main.rand.NextFloat(0.7f, 2.2f);
             *              int proj = Projectile.NewProjectile((theone.Center.X- perturbedSpeed.X*((float)(8f)))+ ((perturbedSpeed.X > 0 ? -0.5f : 0.5f) *theone.width), (theone.Center.Y-64)- perturbedSpeed.Y*12f, perturbedSpeed.X, perturbedSpeed.Y, type, (int)((float)damage * 1f), 0, player.whoAmI);
             *              Main.projectile[proj].melee = true;
             *              Main.projectile[proj].magic = false;
             *              Main.projectile[proj].hostile = false;
             *              Main.projectile[proj].friendly = true;
             *              Main.projectile[proj].netUpdate = true;
             *              Main.PlaySound(SoundID.Item18, Main.projectile[proj].Center);
             *              IdgProjectile.Sync(proj);
             *      }
             * }*/

            return(false);
        }
コード例 #2
0
 public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
 {
     CaliburnTypeA.SpectralSummon(Main.player[projectile.owner], mod.ProjectileType("CaliburnSpectralBlade"), damage, projectile.Center);
 }