anti sticky movement to pets
This commit is contained in:
1 parent
2b201906a9
commit
1b4b18ce30
8 files changed
+201
No files matched your search
@@ -41,6 +41,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
@@ -55,6 +55,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.1f, 0.3f, 0.5f);
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
@@ -41,6 +41,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
@@ -53,6 +53,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
|
||||
@@ -84,6 +84,32 @@ namespace CalamityMod.Projectiles.Pets
|
||||
projectile.damage = damage2;
|
||||
}
|
||||
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
@@ -41,6 +41,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
@@ -144,6 +144,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
private void PassiveAI()
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -43,6 +43,31 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
bool flag23 = Main.projPet[proj.type];
|
||||
if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
float num16 = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
int num17 = 100;
|
||||
|
||||
Reference in new issue
Block a user