resprites and slowed down death cnidrion

This commit is contained in:
termigator1359 committed 2020-02-18 22:46:51 -05:00
1 parent b387b16b44
commit f95a97a869
10 files changed
+27 -19

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+2 -2
View File
@@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
num823 = 2f;
}
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death)
if ((double)npc.life < (double)npc.lifeMax * 0.1)
{
num823 = 4f;
}
@@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
npc.ai[1] += 1f;
}
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death)
if ((double)npc.life < (double)npc.lifeMax * 0.1)
{
npc.ai[1] += 1f;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+25 -17
View File
@@ -12,8 +12,7 @@ namespace CalamityMod.Projectiles.Ranged
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Drataliornus Flame");
Main.projFrames[projectile.type] = 5;
DisplayName.SetDefault("Drataliornus Arrow");
}
public override void SetDefaults()
@@ -32,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
projectile.rotation = projectile.velocity.ToRotation() + 1.5708f;
projectile.rotation = projectile.velocity.ToRotation();
if (projectile.hide) //called on first AI tick only - more initializations
{
@@ -51,16 +50,6 @@ namespace CalamityMod.Projectiles.Ranged
projectile.netUpdate = true;
}
projectile.frameCounter++;
if (projectile.frameCounter > 4)
{
projectile.frameCounter = 0;
projectile.frame++;
}
if (projectile.frame > 4)
projectile.frame = 0;
//intangible until it's in completely open space
if (!projectile.tileCollide && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
{
@@ -160,9 +149,7 @@ namespace CalamityMod.Projectiles.Ranged
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
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, 0, texture2D13.Width, texture2D13.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)texture2D13.Height / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
@@ -217,15 +204,36 @@ namespace CalamityMod.Projectiles.Ranged
projectile.timeLeft = 0; //should avoid infinite loop if a hit npc calls proj.Kill()
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.damage /= 3;
projectile.Damage();
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Ichor, 540);
target.AddBuff(ModContent.BuffType<HolyFlames>(), 540);
if (projectile.ai[0] != 0f && projectile.owner == Main.myPlayer) //if empowered
{
if (projectile.timeLeft != 0) //will not be called on npcs hit by explosion (only direct hits)
{
//make exo arrow, make meteor
Vector2 vector3 = target.Center + new Vector2(600, 0).RotatedBy(MathHelper.ToRadians(Main.rand.Next(360)));
Vector2 speed = target.Center - vector3;
speed /= 30f;
Projectile.NewProjectile(vector3.X, vector3.Y, speed.X, speed.Y, ModContent.ProjectileType<DrataliornusExoArrow>(), projectile.damage / 2, projectile.knockBack, projectile.owner);
Vector2 vel = new Vector2(Main.rand.Next(-400, 401), Main.rand.Next(500, 801));
Vector2 pos = target.Center - vel;
vel.X += Main.rand.Next(-100, 101);
vel.Normalize();
vel *= 30f;
Projectile.NewProjectile(pos, vel + target.velocity, ModContent.ProjectileType<SkyFlareFriendly>(), projectile.damage * 3, projectile.knockBack * 5f, projectile.owner);
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 288 B