thank you iban
This commit is contained in:
1 parent
f56d0e433b
commit
c3b11ce65f
3 files changed
+75
-7
No files matched your search
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Quiver of Nihility");
|
||||
Tooltip.SetDefault("Summons a ring of four void fields to orbit you\n"+"Arrows that pass through these fields gain a boost in speed");
|
||||
Tooltip.SetDefault("Summons a ring of four void fields to orbit you\n"+"Arrows that pass through these fields gain 20% more damage and double the speed");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Particles
|
||||
{
|
||||
//This is basically just the Stream Gouge set with a couple very minor differences for now
|
||||
public class VoidGeneratorParticleSet : BaseFusableParticleSet
|
||||
{
|
||||
public override float BorderSize => 3f;
|
||||
public override bool BorderShouldBeSolid => false;
|
||||
public override Color BorderColor => Color.Lerp(Color.Purple, Color.Black, 0.75f) * 0.85f;
|
||||
public override FusableParticleRenderLayer RenderLayer => FusableParticleRenderLayer.OverNPCsBeforeProjectiles;
|
||||
|
||||
public override List<Effect> BackgroundShaders => new List<Effect>()
|
||||
{
|
||||
GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"].Shader,
|
||||
};
|
||||
public override List<Texture2D> BackgroundTextures => new List<Texture2D>()
|
||||
{
|
||||
ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ParticleBackgrounds/StreamGougeLayer").Value,
|
||||
};
|
||||
public override FusableParticle SpawnParticle(Vector2 center, float sizeStrength)
|
||||
{
|
||||
Particles.Add(new FusableParticle(center, sizeStrength));
|
||||
return Particles.Last();
|
||||
}
|
||||
|
||||
public override void UpdateBehavior(FusableParticle particle)
|
||||
{
|
||||
particle.Size = MathHelper.Clamp(particle.Size - 25f, 0f, 200f) * 0.98f;
|
||||
}
|
||||
|
||||
public override void PrepareOptionalShaderData(Effect effect, int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
// Background.
|
||||
case 0:
|
||||
Vector2 offset = Vector2.UnitX * Main.GlobalTimeWrappedHourly * 0.045f;
|
||||
effect.Parameters["generalBackgroundOffset"].SetValue(offset);
|
||||
effect.Parameters["upscaleFactor"].SetValue(Vector2.One * -0.3f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawParticles()
|
||||
{
|
||||
Texture2D fusableParticleBase = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/FusableParticleBase").Value;
|
||||
foreach (FusableParticle particle in Particles)
|
||||
{
|
||||
Vector2 drawPosition = particle.Center - Main.screenPosition;
|
||||
Vector2 origin = fusableParticleBase.Size() * 0.5f;
|
||||
Vector2 scale = Vector2.One * particle.Size / fusableParticleBase.Size();
|
||||
Main.spriteBatch.Draw(fusableParticleBase, drawPosition, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public bool start = true;
|
||||
int auratimer = 0;
|
||||
public BaseFusableParticleSet.FusableParticle voidaura;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -84,12 +85,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
}
|
||||
|
||||
float offsetX = Projectile.Center.X + Main.rand.Next(-10, 11);
|
||||
float offsetY = Projectile.Center.Y + Main.rand.Next(-10, 11);
|
||||
auratimer++;
|
||||
BloomRing aura = new BloomRing(new Vector2(offsetX, offsetY), Vector2.Zero, Color.Purple, 1f, 5);
|
||||
FusableParticleManager.GetParticleSetByType<StreamGougeParticleSet>()?.SpawnParticle(new Vector2(offsetX, offsetY), 500);
|
||||
GeneralParticleHandler.SpawnParticle(aura);
|
||||
if (voidaura == null)
|
||||
{
|
||||
voidaura = FusableParticleManager.GetParticleSetByType<VoidGeneratorParticleSet>()?.SpawnParticle(Projectile.Center, 500);
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
|
||||
}
|
||||
else
|
||||
{
|
||||
voidaura.Center = Projectile.Center;
|
||||
voidaura.Size = 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user