made a healing proj AI method
This commit is contained in:
1 parent
c6c8433627
commit
33827e0218
19 files changed
+100
-574
No files matched your search
@@ -1967,6 +1967,52 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
}
|
||||
|
||||
public static void HealingProjectile(Projectile projectile, int healing, int playerToHeal, float homingVelocity, float N, bool autoHomes = true, int timeCheck = 120)
|
||||
{
|
||||
int target = playerToHeal;
|
||||
Player player = Main.player[target];
|
||||
float homingSpeed = homingVelocity;
|
||||
if (player.lifeMagnet)
|
||||
homingSpeed *= 1.5f;
|
||||
|
||||
Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y);
|
||||
float xDist = player.Center.X - projPos.X;
|
||||
float yDist = player.Center.Y - projPos.Y;
|
||||
Vector2 playerVector = new Vector2(xDist, yDist);
|
||||
float playerDist = playerVector.Length();
|
||||
if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int healAmt = healing;
|
||||
player.HealEffect(healAmt, false);
|
||||
player.statLife += healAmt;
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
player.statLife = player.statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (autoHomes)
|
||||
{
|
||||
playerDist = homingSpeed / playerDist;
|
||||
playerVector.X *= playerDist;
|
||||
playerVector.Y *= playerDist;
|
||||
projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f);
|
||||
projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f);
|
||||
}
|
||||
else if (player.lifeMagnet && projectile.timeLeft < timeCheck)
|
||||
{
|
||||
playerDist = homingVelocity / playerDist;
|
||||
playerVector.X *= playerDist;
|
||||
playerVector.Y *= playerDist;
|
||||
projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f);
|
||||
projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false)
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
|
||||
@@ -24,43 +24,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.scale += 0.05f;
|
||||
if ((double)projectile.scale > 1.2)
|
||||
if (projectile.scale > 1.2f)
|
||||
{
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
@@ -36,41 +36,13 @@ namespace CalamityMod.Projectiles.Healing
|
||||
else
|
||||
{
|
||||
projectile.scale -= 0.05f;
|
||||
if ((double)projectile.scale < 0.8)
|
||||
if (projectile.scale < 0.8f)
|
||||
{
|
||||
projectile.localAI[0] = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,42 +27,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 3;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 6f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Dust dust = Main.dust[num500];
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f, false);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= num498;
|
||||
dust.position.Y -= num499;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,42 +26,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
{
|
||||
projectile.velocity.Y *= 0.98f;
|
||||
|
||||
int num487 = projectile.owner;
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 25;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 12f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f);
|
||||
Dust dust = Main.dust[num500];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= num498;
|
||||
dust.position.Y -= num499;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, 25, projectile.owner, 12f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f);
|
||||
Dust dust = Main.dust[num500];
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= num498;
|
||||
dust.position.Y -= num499;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,35 +38,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.frame = 0;
|
||||
}
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 3.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 8;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3.5f, 15f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f);
|
||||
Dust dust = Main.dust[num500];
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= num498;
|
||||
dust.position.Y -= num499;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,35 +40,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5f, 15f);
|
||||
float num494 = projectile.velocity.X * 0.334f;
|
||||
float num495 = -(projectile.velocity.Y * 0.334f);
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.5f);
|
||||
|
||||
@@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Dust dust = Main.dust[num500];
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= num498;
|
||||
dust.position.Y -= num499;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,43 +24,12 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 3f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490);
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1.3f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3f, 15f);
|
||||
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1.3f);
|
||||
Dust dust = Main.dust[dusty];
|
||||
dust.noGravity = true;
|
||||
dust.position.X -= projectile.velocity.X * 0.2f;
|
||||
dust.position.Y += projectile.velocity.Y * 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,35 +25,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 10;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 360)
|
||||
{
|
||||
float num488 = 6f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, 10, (int)projectile.ai[0], 6f, 15f, false, 360);
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f);
|
||||
|
||||
@@ -26,35 +26,8 @@ namespace CalamityMod.Projectiles.Healing
|
||||
{
|
||||
projectile.velocity.X *= 0.985f;
|
||||
projectile.velocity.Y *= 0.985f;
|
||||
int num487 = projectile.owner;
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 8;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 12f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, 8, projectile.owner, 12f, 15f, false);
|
||||
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
|
||||
|
||||
@@ -22,35 +22,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f);
|
||||
for (int num493 = 0; num493 < 3; num493++)
|
||||
{
|
||||
float num494 = projectile.velocity.X * 0.334f * (float)num493;
|
||||
|
||||
@@ -26,36 +26,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = projectile.owner;
|
||||
|
||||
float num488 = 6f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], projectile.owner, 6f, 15f);
|
||||
|
||||
for (int num468 = 0; num468 < 3; num468++)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.scale += 0.05f;
|
||||
if ((double)projectile.scale > 1.2)
|
||||
if (projectile.scale > 1.2f)
|
||||
{
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
@@ -36,41 +36,13 @@ namespace CalamityMod.Projectiles.Healing
|
||||
else
|
||||
{
|
||||
projectile.scale -= 0.05f;
|
||||
if ((double)projectile.scale < 0.8)
|
||||
if (projectile.scale < 0.8f)
|
||||
{
|
||||
projectile.localAI[0] = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,35 +27,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = 9;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 300)
|
||||
{
|
||||
float num488 = 8f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f, false, 300);
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
|
||||
@@ -22,35 +22,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f);
|
||||
float num494 = projectile.velocity.X * 0.334f;
|
||||
float num495 = -(projectile.velocity.Y * 0.334f);
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f);
|
||||
|
||||
@@ -24,35 +24,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f);
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f);
|
||||
|
||||
Reference in new issue
Block a user