Finished Transformer
This commit is contained in:
1 parent
bc308bf2f4
commit
a51efd7621
9 files changed
+153
-92
No files matched your search
@@ -3184,12 +3184,15 @@ namespace CalamityMod.CalPlayer
|
||||
projectile.localAI[0] = 5;
|
||||
}
|
||||
}
|
||||
|
||||
SoundStyle activate = new("CalamityMod/Sounds/Item/NullShot");
|
||||
for (int i = 0; i < 3; i++)
|
||||
SoundEngine.PlaySound(activate with { Volume = 0.3f, Pitch = 0.2f + i * 0.3f, MaxInstances = -1 }, Player.Center);
|
||||
Particle orb2 = new CustomPulse(Player.Center, Vector2.Zero, Color.SkyBlue, "CalamityMod/Particles/BloomRingThinLarge", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.2f, 20);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
if (transformerVisual)
|
||||
{
|
||||
SoundStyle activate = new("CalamityMod/Sounds/Item/NullShot");
|
||||
for (int i = 0; i < 3; i++)
|
||||
SoundEngine.PlaySound(activate with { Volume = 0.3f, Pitch = 0.2f + i * 0.3f, MaxInstances = -1 }, Player.Center);
|
||||
Particle orb2 = new CustomPulse(Player.Center, Vector2.Zero, Color.DodgerBlue, "CalamityMod/Particles/BloomRingThinLarge", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.2f, 20);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Only increment hotkey holdtime if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset hold time to zero
|
||||
|
||||
@@ -1536,24 +1536,31 @@ namespace CalamityMod.CalPlayer
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
{
|
||||
Projectile projectile = Main.projectile[x];
|
||||
if (Main.zenithWorld && Vector2.Distance(Player.Center, projectile.Center) <= zoneSize && projectile.active && projectile.hostile)
|
||||
{
|
||||
projectile.velocity *= 0.9f;
|
||||
projectile.timeLeft = (int)(projectile.timeLeft * 0.92f);
|
||||
}
|
||||
if (Vector2.Distance(Player.Center, projectile.Center) <= zoneSize && projectile.active && projectile.hostile && projectile.Calamity().TransformerTimer == 0 && transformerDelay == 0)
|
||||
{
|
||||
transformerDelay = 2; // 2 frame delay between projectile transformation
|
||||
int numOfBlobs = Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()];
|
||||
|
||||
if (numOfBlobs < 30)
|
||||
if (numOfBlobs < 30 || Main.zenithWorld) // 30 normally, uncapped on GFB
|
||||
{
|
||||
projectile.Calamity().TransformerTimer = 90;
|
||||
int blobDamage = (int)Player.GetBestClassDamage().ApplyTo(55);
|
||||
int layer = ((numOfBlobs + 1) > 20 ? 3 : (numOfBlobs + 1) > 10 ? 2 : 1);
|
||||
projectile.Calamity().TransformerTimer = Main.zenithWorld ? 10 : 90;
|
||||
int blobDamage = (int)Player.GetBestClassDamage().ApplyTo(45);
|
||||
int layer = (int)(Utils.GetLerpValue(0, 10, numOfBlobs + 1) + 0.9f);
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), projectile.Center, projectile.velocity.SafeNormalize(Vector2.UnitX) * 16f, ModContent.ProjectileType<TransformerBlob>(), blobDamage, 0f, Player.whoAmI, layer, numOfBlobs + 1);
|
||||
Particle orb2 = new CustomPulse(projectile.Center, Vector2.Zero, Color.DodgerBlue, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.5f, 11);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
|
||||
if (Player.Calamity().transformerVisual)
|
||||
{
|
||||
Particle orb2 = new CustomPulse(projectile.Center, Vector2.Zero, Color.LightSkyBlue, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.5f, 11);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
|
||||
SoundStyle transform = new("CalamityMod/Sounds/Item/NullImpact");
|
||||
SoundEngine.PlaySound(transform with { Volume = 0.1f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) + numOfBlobs * 0.015f, MaxInstances = -1 }, projectile.Center);
|
||||
|
||||
float topAngle = Utils.Remap(Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()], 0, 29, 360, 1080, true);
|
||||
SoundStyle transform = new("CalamityMod/Sounds/Item/NullImpact");
|
||||
SoundEngine.PlaySound(transform with { Volume = 0.1f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) + numOfBlobs * 0.015f, MaxInstances = -1 }, projectile.Center);
|
||||
}
|
||||
|
||||
float index = 1f;
|
||||
foreach (Projectile p in Main.ActiveProjectiles)
|
||||
@@ -1561,13 +1568,7 @@ namespace CalamityMod.CalPlayer
|
||||
float angleMax = MathHelper.ToRadians(360 * layer);
|
||||
if (numOfBlobs == 0)
|
||||
angleMax = 0f;
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] > 30)
|
||||
{
|
||||
angleMax += MathHelper.ToRadians((Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] - 30) * 2.5f);
|
||||
}
|
||||
angleMax = angleMax > MathHelper.ToRadians(topAngle) ? MathHelper.ToRadians(topAngle) : angleMax; // More intuative than using a min function
|
||||
|
||||
|
||||
|
||||
if (p.type == ModContent.ProjectileType<TransformerBlob>() && p.owner == Player.whoAmI)
|
||||
{
|
||||
float insanityValue = ((p.ai[1] % 10) + 1);
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace CalamityMod.CalPlayer
|
||||
target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
target.Calamity().IncreasedElectricityEffects_Transformer = transformer;
|
||||
target.Calamity().IncreasedElectricityEffects_Unused = false;
|
||||
|
||||
target.Calamity().IncreasedHeatEffects_Fireball = fireball;
|
||||
target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
|
||||
@@ -190,7 +190,7 @@ namespace CalamityMod.CalPlayer
|
||||
cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
cgn.IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
cgn.IncreasedElectricityEffects_Transformer = transformer;
|
||||
cgn.IncreasedElectricityEffects_Unused = false;
|
||||
|
||||
cgn.IncreasedHeatEffects_Fireball = fireball;
|
||||
cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.SunkenSea;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
@@ -17,6 +18,11 @@ namespace CalamityMod.Items.Accessories
|
||||
public class TheTransformer : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey);
|
||||
list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")));
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16));
|
||||
|
||||
@@ -1868,7 +1868,25 @@ TheSponge: {
|
||||
|
||||
TheTransformer: {
|
||||
DisplayName: The Transformer
|
||||
Tooltip: Multiplies all electricity debuff damage by 1.5x
|
||||
Tooltip: "[GFB]"
|
||||
TooltipNormal:
|
||||
'''
|
||||
Generates an aura around you that creates morphing globs when projectiles pass through it
|
||||
The globs encircle you and deal low damage and knockback to enemies they collide with
|
||||
The circle can contain up to 30 globs at once
|
||||
Press [KEY] to transform all globs into needles and launch them at your cursor
|
||||
[c/1FFBFF:'What you hold now is an unstable blueprint of a substance far more potent.]
|
||||
[c/1FFBFF:Though, perhaps the material instability of this matter can still be of service.']
|
||||
'''
|
||||
TooltipGFB:
|
||||
'''
|
||||
Generates an aura around you that creates morphing globs when projectiles pass through it
|
||||
The globs encircle you and deal low damage and knockback to enemies they collide with
|
||||
The circle has no limit to the number of globs it can hold, but your PC might
|
||||
Press [KEY] to transform all globs into needles and launch them at your cursor
|
||||
[c/1FFBFF:'What IS this thing? How did you even make this?]
|
||||
[c/1FFBFF:It looks like shit.']
|
||||
'''
|
||||
}
|
||||
|
||||
ToxicHeart: {
|
||||
|
||||
@@ -126,6 +126,8 @@ TarragonAura.DisplayName: Tarragon Aura
|
||||
TatteredFairyDust.DisplayName: Tattered Fairy Dust
|
||||
TeslaAura.DisplayName: Tesla's Electricity
|
||||
TitanHeartBoom.DisplayName: Titan Heart Boom
|
||||
TransformerAura.DisplayName: Transformer Aura
|
||||
TransformerBlob.DisplayName: Transformer Shard
|
||||
UrsaSlash.DisplayName: Ursa Slash
|
||||
VerstaltiteBobber.DisplayName: Verstaltite Bobber
|
||||
VoidFieldGenerator.DisplayName: Void Field Generator
|
||||
@@ -141,5 +143,3 @@ YanmeisKnifeSlash.DisplayName: Yanmei's Knife
|
||||
YellowLabSeeker.DisplayName: Seeking Mechanism
|
||||
VoidofExtinctionCrit.DisplayName: Void of Extinction Crit
|
||||
XykDeathAnim.DisplayName: Xyk Death Animation
|
||||
TransformerBlob.DisplayName: Transformer Blob
|
||||
TransformerAura.DisplayName: Transformer Aura
|
||||
@@ -156,8 +156,8 @@ namespace CalamityMod.NPCs
|
||||
public bool IncreasedColdEffects_FrozenWings = false;
|
||||
public bool IncreasedColdEffects_CryoStone = false;
|
||||
|
||||
// Transformer effect
|
||||
public bool IncreasedElectricityEffects_Transformer = false;
|
||||
// Electric effects
|
||||
public bool IncreasedElectricityEffects_Unused = false;
|
||||
|
||||
// Heat debuff effects
|
||||
public bool IncreasedHeatEffects_Fireball = false;
|
||||
@@ -506,7 +506,7 @@ namespace CalamityMod.NPCs
|
||||
myClone.IncreasedColdEffects_EskimoSet = IncreasedColdEffects_EskimoSet;
|
||||
myClone.IncreasedColdEffects_FrozenWings = IncreasedColdEffects_FrozenWings;
|
||||
myClone.IncreasedColdEffects_CryoStone = IncreasedColdEffects_CryoStone;
|
||||
myClone.IncreasedElectricityEffects_Transformer = IncreasedElectricityEffects_Transformer;
|
||||
myClone.IncreasedElectricityEffects_Unused = IncreasedElectricityEffects_Unused;
|
||||
myClone.IncreasedHeatEffects_Fireball = IncreasedHeatEffects_Fireball;
|
||||
myClone.IncreasedHeatEffects_CinnamonRoll = IncreasedHeatEffects_CinnamonRoll;
|
||||
myClone.IncreasedHeatEffects_FireBoots = IncreasedHeatEffects_FireBoots;
|
||||
@@ -921,7 +921,7 @@ namespace CalamityMod.NPCs
|
||||
if (IncreasedColdEffects_CryoStone)
|
||||
coldDamageMult += 0.5;
|
||||
|
||||
if (IncreasedElectricityEffects_Transformer)
|
||||
if (IncreasedElectricityEffects_Unused)
|
||||
electricityDamageMult += 0.5;
|
||||
|
||||
if (IncreasedHeatEffects_Fireball)
|
||||
@@ -5738,7 +5738,7 @@ namespace CalamityMod.NPCs
|
||||
veriumDoomStacks = 0;
|
||||
}
|
||||
|
||||
// Amidias' Spark and Transformer spark spawning
|
||||
// Amidias' Spark spark spawning
|
||||
if (shocked > 0)
|
||||
{
|
||||
var player = Main.LocalPlayer;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public float fullSine = 1;
|
||||
public Vector2 squareRandomPos1;
|
||||
public Vector2 squareRandomPos2;
|
||||
public float fullChargeMult = 1;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = Projectile.height = 1;
|
||||
@@ -42,8 +43,8 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
float rate = Main.GlobalTimeWrappedHourly * 5;
|
||||
List<Color> eColors = new List<Color>()
|
||||
{
|
||||
Color.DodgerBlue,
|
||||
Color.DeepSkyBlue
|
||||
Color.LightSkyBlue,
|
||||
Color.DodgerBlue
|
||||
};
|
||||
|
||||
int colorIndex = (int)(rate / 2 % eColors.Count);
|
||||
@@ -52,6 +53,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
bColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
|
||||
|
||||
Projectile.Center = Owner.MountedCenter;
|
||||
fullChargeMult = MathHelper.Lerp(fullChargeMult, (Owner.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] >= 30 ? 0 : 1), 0.033f);
|
||||
|
||||
if (moddedOwner.transformerVisual && moddedOwner.transformer)
|
||||
{
|
||||
@@ -87,23 +89,25 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D rTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/QuarterCircle").Value;
|
||||
Texture2D vTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRingThinLarge").Value;
|
||||
Texture2D bTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
|
||||
Texture2D b2Texture = ModContent.Request<Texture2D>("CalamityMod/Particles/Light").Value;
|
||||
Color drawColor = bColor;
|
||||
float deathLerp = (float)Math.Pow(Utils.GetLerpValue(10, 300, Projectile.timeLeft), 2);
|
||||
|
||||
float bScale2 = 0.75f;
|
||||
Main.EntitySpriteDraw(bTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * deathLerp, 0, bTexture.Size() * 0.5f, bScale2 * rot2 * Projectile.scale * deathLerp, SpriteEffects.None, 0);
|
||||
float bScale2 = 0.95f;
|
||||
Main.EntitySpriteDraw(bTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * deathLerp, 0, bTexture.Size() * 0.5f, (bScale2 * rot2 * Projectile.scale * deathLerp) + 2.5f * (fullChargeMult - 1), SpriteEffects.None, 0);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
Main.EntitySpriteDraw(b2Texture, Owner.Center - Main.screenPosition, null, new Color(30, 30, 30) * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 1.2f * rot2, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(b2Texture, Owner.Center - Main.screenPosition, null, Color.Black * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 0.8f * rot2, SpriteEffects.None, 0);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float subsine = rot2;//MathHelper.Lerp(Math.Abs(fullSine), 0.3f, 0.5f);
|
||||
float subsine = rot2;
|
||||
float rot = (MathHelper.TwoPi * i / 3f) + Main.GlobalTimeWrappedHourly;
|
||||
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.05f * deathLerp, rot + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.97f) * 0.16f * deathLerp, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.05f * deathLerp, rot * 2 + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.97f) * 0.157f * deathLerp, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.16f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot * 2 + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.157f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
|
||||
}
|
||||
//Main.EntitySpriteDraw(rTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 }, , rTexture.Size() * 0.5f, 0.04f * rot2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Particles;
|
||||
@@ -17,8 +19,10 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public CalamityPlayer moddedOwner => Owner.Calamity();
|
||||
private float radius = 25f;
|
||||
public bool visuals => Owner.Calamity().transformerVisual;
|
||||
public bool visuals => moddedOwner.transformerVisual;
|
||||
public float visualMult => (!visuals && !powered) ? 0.2f : 1;
|
||||
public ref float layer => ref Projectile.ai[0];
|
||||
public bool canDamage = false;
|
||||
public float speed = 250;
|
||||
@@ -29,8 +33,10 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public float rotSpeed = 1f;
|
||||
public int savedFrame = 0;
|
||||
public bool powered => Projectile.localAI[0] == 5;
|
||||
public int poweredTimerMax => (int)(140 + 6 * Projectile.ai[1]);
|
||||
public int poweredTimerMax => (int)(140 + (MathHelper.Clamp(Utils.Remap(Owner.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()], 1, 30, 7, 6, false), 3, 7)) * Projectile.ai[1]);
|
||||
public int poweredTimer = -1;
|
||||
public Color cl1 = Color.LightSkyBlue;
|
||||
public Color cl2 = Color.DodgerBlue;
|
||||
public float poweredLerp => (float)Math.Pow(Utils.GetLerpValue(poweredTimerMax, 90, poweredTimer, true), 4);
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -55,7 +61,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
|
||||
Lighting.AddLight(Projectile.Center, Color.SkyBlue.ToVector3() * 0.5f);
|
||||
Lighting.AddLight(Projectile.Center, cl1.ToVector3() * 0.5f);
|
||||
|
||||
sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (Projectile.ai[1] % 2 == 0 ? 10 : 6) / MathHelper.Pi) * 0.4f;
|
||||
|
||||
@@ -87,11 +93,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
else
|
||||
Projectile.frame = (int)MathHelper.Lerp(savedFrame, 8, poweredLerp);
|
||||
|
||||
layer = (Projectile.ai[1] > 20 ? 3 : Projectile.ai[1] > 10 ? 2 : 1);
|
||||
layer = (int)(Utils.GetLerpValue(0, 10, Projectile.ai[1]) + 0.9f);
|
||||
|
||||
if (time >= 90)
|
||||
canDamage = true;
|
||||
|
||||
if (!moddedOwner.transformer || Owner.dead)
|
||||
{
|
||||
Projectile.Kill();
|
||||
}
|
||||
|
||||
if (layer != currentLayer)
|
||||
{
|
||||
currentLayer = (int)layer;
|
||||
@@ -117,29 +128,37 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
dust2.scale = Main.rand.NextFloat(0.9f, 1.2f) - Math.Abs(variance);
|
||||
dust2.velocity = (Projectile.velocity * 2).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance));
|
||||
dust2.noGravity = true;
|
||||
dust2.color = Color.Cyan;
|
||||
dust2.color = cl1;
|
||||
}
|
||||
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/OmicronBeam");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = Main.rand.NextFloat(0.3f, 0.5f) + Projectile.ai[1] * 0.015f, MaxInstances = -1 }, Projectile.Center);
|
||||
if (visuals)
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/OmicronBeam");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = Main.rand.NextFloat(0.3f, 0.5f) + Projectile.ai[1] * 0.015f, MaxInstances = -1 }, Projectile.Center);
|
||||
}
|
||||
}
|
||||
else if (poweredTimer == 0)
|
||||
{
|
||||
//trail shit
|
||||
float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi);
|
||||
|
||||
Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 20f;
|
||||
|
||||
Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity, -Projectile.velocity * 0.3f, false, 21, 0.04f, Color.DodgerBlue * 0.65f, new Vector2(0.6f, 0.5f), true, false, 0.7f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
if (time % 2 == 0)
|
||||
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
|
||||
if (targetDist < 1400)
|
||||
{
|
||||
Vector2 dustVel = (-Projectile.velocity).RotatedByRandom(0.3f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, ModContent.DustType<VoidDustInverted>(), dustVel * Main.rand.NextFloat(0.1f, 0.8f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.6f);
|
||||
dust.color = new Color(30, 30, 30);
|
||||
dust.noLightEmittence = true;
|
||||
if (visuals)
|
||||
{
|
||||
Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity, -Projectile.velocity * 0.3f, false, 21, 0.04f, cl1 * 0.65f, new Vector2(0.6f, 0.5f), true, false, 0.7f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (time % 2 == 0)
|
||||
{
|
||||
Vector2 dustVel = (-Projectile.velocity).RotatedByRandom(0.3f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, ModContent.DustType<VoidDustInverted>(), dustVel * Main.rand.NextFloat(0.1f, 0.8f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.6f);
|
||||
dust.color = new Color(30, 30, 30);
|
||||
dust.noLightEmittence = true;
|
||||
}
|
||||
}
|
||||
|
||||
Projectile.rotation = (Projectile.velocity.RotatedBy(MathHelper.ToRadians(-90))).ToRotation();
|
||||
@@ -147,13 +166,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
else
|
||||
{
|
||||
Vector2 centerPoint = (powered ? Vector2.Lerp(Owner.Center, Vector2.Lerp(Owner.Calamity().mouseWorld, Owner.Center, 0.6f), poweredLerp) : Owner.Center);
|
||||
float positioning = (-60 - (55 * layer) + 30 * sine) * MathHelper.Clamp((powered ? 1.25f - poweredLerp : 1), 0.25f, 1);
|
||||
Projectile.velocity = ((centerPoint + new Vector2(0, positioning).RotatedBy(rotationAngle * -rotSpeed + Main.GlobalTimeWrappedHourly * 2.5f * (1 - layer * (powered ? 0.33f : 0.15f)) * (layer == 2 ? -1 : 1))) - Projectile.Center) / (speed);
|
||||
float layerDist = (Utils.Remap(Owner.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()], 1, 20, 60, 55, false) * layer);
|
||||
float fadeValue = MathHelper.Clamp(Utils.Remap(Projectile.ai[1], 1, 10, 0.3f, 0.1f, false), 0.3f, 0);
|
||||
float positioning = (-60 - layerDist + 30 * sine) * MathHelper.Clamp((powered ? (1 - poweredLerp) : 1), fadeValue, 1);
|
||||
Projectile.velocity = ((centerPoint + new Vector2(0, positioning).RotatedBy(rotationAngle * -rotSpeed + Main.GlobalTimeWrappedHourly * 2.5f * (1 - layer * (powered ? 0.33f : 0.15f)) * (layer % 2 == 0 ? -1 : 1))) - Projectile.Center) / (speed);
|
||||
Projectile.rotation = Projectile.rotation.AngleLerp(sine, 0.02f);
|
||||
}
|
||||
if (powered && poweredTimer != 0)
|
||||
{
|
||||
rotSpeed *= 1.0067f;
|
||||
rotSpeed *= Utils.Remap(Projectile.ai[1], 1, 10, 1.0067f, 1.0058f, false);
|
||||
|
||||
Projectile.rotation = Projectile.rotation.AngleLerp(Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(MathHelper.ToRadians(-90)).ToRotation(), poweredLerp);
|
||||
}
|
||||
}
|
||||
@@ -164,7 +186,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
speed = MathHelper.Lerp(speed, 1, (float)Math.Pow(Utils.GetLerpValue(0, 180, time), 2));
|
||||
|
||||
if (!powered)
|
||||
if (poweredTimer != 0)
|
||||
Projectile.timeLeft++;
|
||||
if (poweredTimer > 0)
|
||||
poweredTimer--;
|
||||
@@ -179,17 +201,39 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
if (poweredTimer == 0)
|
||||
{
|
||||
float minMult = 0.25f;
|
||||
int hitsToMinMult = 5;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true) * (Projectile.numHits == 0 ? 1.5f : 1); // +50% damage on first hit
|
||||
modifiers.SourceDamage *= damageMult;
|
||||
float minMult = 0.05f;
|
||||
int hitsToMinMult = 4;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true) * (Projectile.numHits == 0 ? 1.5f : 1); // +50% damage on first hit, if it kills an enemy it keeps the bonus
|
||||
modifiers.SourceDamage *= (damageMult + (Main.zenithWorld ? 0.2f * Projectile.ai[1] : 0));
|
||||
}
|
||||
else
|
||||
modifiers.SourceDamage *= 0.2f;
|
||||
|
||||
if (target.CanBeMoved(true))
|
||||
target.velocity = Utils.DirectionTo(Owner.Center, target.Center) * (poweredTimer == 0 ? 7 : 3) * (target.knockBackResist == 0 ? 0.5f : 1f);
|
||||
|
||||
if (Projectile.numHits == 0 && poweredTimer == 0)
|
||||
{
|
||||
for (int i = 0; i <= 6; i++)
|
||||
{
|
||||
float variance = Main.rand.NextFloat(-0.4f, 0.4f);
|
||||
Vector2 fxVel = (Projectile.velocity * 3).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance));
|
||||
Particle spark2 = new SparkParticle(Projectile.Center + fxVel, fxVel, false, 45, Main.rand.NextFloat(0.8f, 1f) - Math.Abs(variance), Main.rand.NextBool(4) ? cl2 : cl1);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
|
||||
for (int i = 0; i < 14; i++)
|
||||
{
|
||||
Vector2 dustVel = (Vector2.One * 5).RotatedByRandom(100);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDustInverted>(), dustVel * Main.rand.NextFloat(0.1f, 0.8f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 1.1f);
|
||||
dust.color = new Color(30, 30, 30);
|
||||
dust.noLightEmittence = true;
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
@@ -200,39 +244,24 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
if (powered)
|
||||
{
|
||||
Color auraColor = Color.DodgerBlue with { A = 0 } * poweredLerp;
|
||||
for (int i = 0; i < 2; i++)
|
||||
Color auraColor = cl1 with { A = 0 } * poweredLerp * visualMult;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float bScale2 = 0.25f;
|
||||
Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, Color.DodgerBlue with { A = 0 }, Projectile.rotation, bTexture.Size() * 0.5f, Vector2.Lerp(new Vector2(0.6f, 1.4f), Vector2.One, MathHelper.Min(Utils.GetLerpValue(8, 15, Projectile.frame, true), Utils.GetLerpValue(8, 0, Projectile.frame, true))) * bScale2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, cl2 with { A = 0 } * Utils.GetLerpValue(poweredTimerMax, 180, poweredTimer, true) * visualMult, Projectile.rotation, bTexture.Size() * 0.5f, Vector2.Lerp(new Vector2(0.6f, 1.4f), Vector2.One, MathHelper.Min(Utils.GetLerpValue(8, 15, Projectile.frame, true), Utils.GetLerpValue(8, 0, Projectile.frame, true))) * bScale2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
Main.EntitySpriteDraw(orbTexture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(orbTexture, Projectile.Center - Main.screenPosition, frame, Color.White * visualMult, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
|
||||
if (!powered)
|
||||
if (true)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Color auraColor = Color.DodgerBlue with { A = 0 } * sine * 0.6f;
|
||||
Color auraColor = cl1 with { A = 0 } * (powered ? (float)Math.Pow(Utils.GetLerpValue(poweredTimerMax, 20, poweredTimer, true), 3) : sine) * 0.6f * visualMult;
|
||||
Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4;
|
||||
Main.EntitySpriteDraw(orbTexture, Projectile.Center - Main.screenPosition + drawOffset, frame, auraColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Texture2D rTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/ShatteredExplosion").Value;
|
||||
Texture2D bTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
|
||||
Color drawColor = Color.DodgerBlue;
|
||||
float rot2 = 0.3f;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
float bScale2 = 0.75f;
|
||||
Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, i * 0.15f) with { A = 0 }, 0, bTexture.Size() * 0.5f, (bScale2 - i * 0.15f) * rot2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
|
||||
Main.EntitySpriteDraw(rTexture, Projectile.Center - Main.screenPosition, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.03f * rot2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(rTexture, Projectile.Center - Main.screenPosition, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.04f * rot2 * Projectile.scale, SpriteEffects.None, 0);
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox);
|
||||
|
||||
Reference in new issue
Block a user