1 - Renamed Pulse Rifle to Pulse Rifle.
2 - Eradicator and a few other weapons can now fire beams at multiple enemies at once.
This commit is contained in:
1 parent
c03f9c3c06
commit
3bb9829a3b
7 files changed
+31
-16
No files matched your search
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Draedon's Pulse Rifle");
|
||||
DisplayName.SetDefault("Pulse Rifle");
|
||||
Tooltip.SetDefault("Draedon's high-efficiency electromagnetic pulse rifle\n" +
|
||||
"Incredibly accurate pulse weapon, crafted and wielded by Draedon to defend against his own creations\n" +
|
||||
"When the pulse hits a target it will arc to another nearby target\n" +
|
||||
|
||||
@@ -2104,7 +2104,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
}
|
||||
|
||||
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D)
|
||||
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false)
|
||||
{
|
||||
float maxDistance = distanceRequired;
|
||||
bool homeIn = false;
|
||||
@@ -2147,6 +2147,24 @@ namespace CalamityMod.Projectiles
|
||||
Vector2 value = projectile.Center + projectile.velocity * 4f;
|
||||
Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - value) * homingVelocity;
|
||||
|
||||
if (attackMultiple)
|
||||
{
|
||||
for (int i = 0; i < targetArrayIndex; i++)
|
||||
{
|
||||
velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - value) * homingVelocity;
|
||||
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
|
||||
if (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
|
||||
Main.projectile[projectile2].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (projectile.type == ProjectileType<GodsGambitYoyo>())
|
||||
{
|
||||
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
|
||||
@@ -2160,9 +2178,6 @@ namespace CalamityMod.Projectiles
|
||||
if (projectile.type == ProjectileType<CnidarianYoyo>() || projectile.type == ProjectileType<GodsGambitYoyo>() ||
|
||||
projectile.type == ProjectileType<ShimmersparkYoyo>() || projectile.type == ProjectileType<VerdantYoyo>() || (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.melee))
|
||||
Main.projectile[projectile2].Calamity().forceMelee = true;
|
||||
|
||||
else if (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
|
||||
Main.projectile[projectile2].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f);
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 20, ModContent.ProjectileType<NebulaShot>());
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType<NebulaShot>(), 1D, true);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void AI()
|
||||
{
|
||||
timeElapsed += 0.02;
|
||||
projectile.velocity.X = (float)(Math.Sin(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize);
|
||||
projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize);
|
||||
projectile.velocity.X = (float)(Math.Sin(timeElapsed * (0.5f * projectile.ai[0])) * circleSize);
|
||||
projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (0.5f * projectile.ai[0])) * circleSize);
|
||||
circleSize += circleGrowth;
|
||||
|
||||
if (projectile.velocity.X > 0f)
|
||||
@@ -56,14 +56,14 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 8f, 4f, 5, ModContent.ProjectileType<ClimaxBeam>());
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 8f, 4f, 2, ModContent.ProjectileType<ClimaxBeam>(), 1D, true);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.timeLeft < 30)
|
||||
{
|
||||
float num7 = (float)projectile.timeLeft / 30f;
|
||||
float num7 = projectile.timeLeft / 30f;
|
||||
projectile.alpha = (int)(255f - 255f * num7);
|
||||
}
|
||||
return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0);
|
||||
@@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
|
||||
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
|
||||
int y6 = num214 * projectile.frame;
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
|
||||
if (projectile.timeLeft % 2 == projectile.ai[0])
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 5, ModContent.ProjectileType<ClimaxBeam>());
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 2, ModContent.ProjectileType<ClimaxBeam>(), 1D, true);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.timeLeft < 30)
|
||||
{
|
||||
float num7 = (float)projectile.timeLeft / 30f;
|
||||
float num7 = projectile.timeLeft / 30f;
|
||||
projectile.alpha = (int)(255f - 255f * num7);
|
||||
}
|
||||
return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0);
|
||||
@@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
|
||||
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
|
||||
int y6 = num214 * projectile.frame;
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType<FabBolt>());
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType<FabBolt>(), 1D, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 5, ModContent.ProjectileType<MagneticBeam>());
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 2, ModContent.ProjectileType<MagneticBeam>(), 1D, true);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
|
||||
Reference in new issue
Block a user