misc cleanups to rogue weapon code suggested by my laptop's visual studio
This commit is contained in:
1 parent
281c2b52d4
commit
157f2a4dc9
8 files changed
+11
-18
No files matched your search
@@ -47,8 +47,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
float num72 = item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2));
|
||||
Vector2 vector3 = Main.MouseWorld - vector2;
|
||||
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
|
||||
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
|
||||
if (player.gravDir == -1f)
|
||||
@@ -56,7 +54,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
|
||||
}
|
||||
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
|
||||
float num81 = num80;
|
||||
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
|
||||
{
|
||||
num78 = (float)player.direction;
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles
|
||||
projectile.light = 0.9f;
|
||||
|
||||
if (Main.rand.Next(10) == 0)
|
||||
Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f);
|
||||
Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
||||
|
||||
if (Main.rand.Next(20) == 0)
|
||||
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num190 = Main.rand.Next(5, 9);
|
||||
for (int num191 = 0; num191 < num190; num191++)
|
||||
{
|
||||
int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f);
|
||||
int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default, 1.4f);
|
||||
Main.dust[num192].velocity *= 0.8f;
|
||||
Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f);
|
||||
Main.dust[num192].noGravity = true;
|
||||
|
||||
@@ -12,9 +12,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class EpidemicShredderProjectile : ModProjectile
|
||||
{
|
||||
// This is never used
|
||||
bool justhit = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Epidemic Shredder");
|
||||
|
||||
@@ -43,10 +43,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 176, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, default(Color), 0.75f);
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 176, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, default, 0.75f);
|
||||
Main.dust[num195].noGravity = true;
|
||||
Main.dust[num195].velocity *= 3f;
|
||||
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 177, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, default(Color), 0.75f);
|
||||
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 177, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, default, 0.75f);
|
||||
Main.dust[num195].noGravity = true;
|
||||
Main.dust[num195].velocity *= 3f;
|
||||
}
|
||||
|
||||
@@ -92,10 +92,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.damage /= 4;
|
||||
for (int num194 = 0; num194 < 10; num194++)
|
||||
{
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 0, default(Color), 1.5f);
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 0, default, 1.5f);
|
||||
Main.dust[num195].noGravity = true;
|
||||
Main.dust[num195].velocity *= 3f;
|
||||
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default(Color), 1f);
|
||||
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num195].velocity *= 2f;
|
||||
Main.dust[num195].noGravity = true;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 265, 0f, 0f, 100, default(Color), 1f);
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 265, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num304].noGravity = true;
|
||||
Main.dust[num304].velocity *= 1.2f;
|
||||
Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default(Color), 1f);
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace CalamityMod
|
||||
{
|
||||
Player player = Main.player[Main.myPlayer];
|
||||
Item item = player.inventory[player.selectedItem];
|
||||
float hitbox_X = 0, hitbox_Y = 0;
|
||||
float hitbox_X, hitbox_Y;
|
||||
float mountOffsetY = player.mount.PlayerOffsetHitbox;
|
||||
|
||||
// Third hitbox shifting values
|
||||
@@ -492,10 +492,10 @@ namespace CalamityMod
|
||||
time += 54000D;
|
||||
|
||||
// Divide by seconds in an hour
|
||||
time = time / 3600D;
|
||||
time /= 3600D;
|
||||
|
||||
// Terraria night starts at 7:30 PM, so offset accordingly
|
||||
time = time - 19.5;
|
||||
time -= 19.5;
|
||||
|
||||
// Offset time to ensure it is not negative, then change to PM if necessary
|
||||
if (time < 0D)
|
||||
@@ -709,7 +709,6 @@ namespace CalamityMod
|
||||
public static bool LockedChestRightClick(bool isLocked, int left, int top, int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
Tile tile = Main.tile[i, j];
|
||||
|
||||
// If the player right clicked the chest while editing a sign, finish that up
|
||||
if (player.sign >= 0)
|
||||
|
||||
Reference in new issue
Block a user