Eclipse's Fall glow
+ Lifetime restoration
This commit is contained in:
1 parent
05cb3a93dc
commit
ebbef4b90d
10 files changed
+51
-9
No files matched your search
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
@@ -43,6 +44,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>(Texture + "Glow").Value);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 853 B |
@@ -1,4 +1,6 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
@@ -35,5 +37,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (Projectile.frameCounter > Lifetime)
|
||||
Projectile.Kill();
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
|
||||
Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -17,8 +18,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[Type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -66,8 +67,14 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,11 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -22,8 +23,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[Type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -65,12 +66,13 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
// Eclipse's Fall is guaranteed to impale for 10 seconds, no more, no less
|
||||
if (!changedTimeLeft)
|
||||
{
|
||||
Projectile.timeLeft = 600 * Projectile.MaxUpdates;
|
||||
Projectile.MaxUpdates = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
changedTimeLeft = true;
|
||||
}
|
||||
|
||||
// Spawn spears. As this uses local AI, it's done client-side only.
|
||||
if (Projectile.owner == Main.myPlayer && Projectile.FinalExtraUpdate())
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.localAI[1] -= 1f;
|
||||
|
||||
@@ -107,10 +109,16 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target) => Projectile.ai[0] == 1f ? false : base.CanHitNPC(target);
|
||||
|
||||
public override bool CanHitPvp(Player target) => Projectile.ai[0] != 1f;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -54,5 +56,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (!Main.dayTime || Main.rand.NextBool(3)) //100% at night, 33.33% chance during day
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 45);
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
|
||||
Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in new issue
Block a user