This commit is contained in:
mountaindrew10 committed 2023-11-14 11:22:13 -06:00
commit e9c853b03e
435 files changed
+13403 -10198

No files matched your search

+6 -6
View File
@@ -256,15 +256,15 @@ namespace CalamityMod.Balancing
// 30% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
// 25% resist to Aetherflux Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
// 25% resist to Murasama.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MurasamaSlash>()))));
// 20% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo))));
// 20% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
@@ -330,9 +330,6 @@ namespace CalamityMod.Balancing
// 35% resist to Anomaly's Nanogun bomb explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<AnomalysNanogunMPFBBoom>()))));
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
// 30% resist to Eclipse Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
@@ -348,6 +345,9 @@ namespace CalamityMod.Balancing
// 30% resist to Prismatic Breaker's laser beam.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<PrismaticBeam>()))));
// 25% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo))));
// 25% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
+11 -12
View File
@@ -46,11 +46,11 @@ namespace CalamityMod.Buffs.DamageOverTime
GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(player.Calamity().RandomDebuffVisualSpot, speed, Main.rand.NextFloat(1.2f, 1.8f), effectcolor, Main.rand.Next(8, 14)));
int dustType = Main.rand.NextBool() ? 91 : 247;
int dustType = Main.rand.NextBool() ? 66 : 247;
Dust dust = Dust.NewDustPerfect(player.Calamity().RandomDebuffVisualSpot, dustType);
dust.scale = (dustType == 91 ? 1.4f : 1.2f);
dust.velocity = (dustType == 247 ? Vector2.Zero : new Vector2(0, Main.rand.NextFloat(-1.5f, 4f)) - player.velocity / 2);
dust.noGravity = Main.rand.NextBool(4) && dustType == 91 ? false : true;
dust.scale = (dustType == 66 ? 1.4f : 1.2f);
dust.velocity = Vector2.Zero + new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(4f, 8f)) - player.velocity / 2;
dust.noGravity = true;
dust.alpha = Main.rand.Next(90, 150);
dust.color = effectcolor;
}
@@ -71,12 +71,11 @@ namespace CalamityMod.Buffs.DamageOverTime
GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(npcSize, speed, Main.rand.NextFloat(1.2f, 3.1f), effectcolor, Main.rand.Next(8, 14)));
int dustType = Main.rand.NextBool() ? 91 : 247;
int dustType = Main.rand.NextBool() ? 66 : 247;
Dust dust = Dust.NewDustPerfect(npcSize, dustType);
dust.scale = (dustType == 91 ? 1.4f : 1.2f);
dust.velocity = (dustType == 247 ? Vector2.Zero : new Vector2(0, Main.rand.NextFloat(-1.5f, 4f)) - npc.velocity / 2);
dust.noGravity = Main.rand.NextBool(4) && dustType == 91 ? false : true;
dust.velocity = Vector2.Zero;
dust.scale = (dustType == 66 ? 1.4f : 1.2f);
dust.noGravity = true;
dust.velocity = Vector2.Zero + new Vector2(Main.rand.NextFloat(-2, 2), Main.rand.NextFloat(2f, 4f)) - npc.velocity / 2;
dust.alpha = Main.rand.Next(90, 150);
dust.color = effectcolor;
}
@@ -90,11 +89,11 @@ namespace CalamityMod.Buffs.DamageOverTime
_ => Color.Violet,
};
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
int dustType = Main.rand.NextBool() ? 91 : 247;
int dustType = Main.rand.NextBool() ? 66 : 247;
Dust dust = Dust.NewDustPerfect(npcSize, dustType);
dust.scale = (dustType == 91 ? 0.9f : 1.4f);
dust.scale = (dustType == 66 ? 0.9f : 1.4f);
dust.noGravity = true;
dust.velocity = Vector2.Zero;
dust.velocity = Vector2.Zero + new Vector2(Main.rand.NextFloat(-2, 2), Main.rand.NextFloat(2f, 4f));
dust.alpha = Main.rand.Next(35, 90);
dust.color = effectcolor;
}
+31 -44
View File
@@ -36,37 +36,29 @@ namespace CalamityMod.Buffs.DamageOverTime
var sparkColor = Main.rand.Next(4) switch
{
0 => Color.DarkRed,
0 => Color.Red,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, sparkColor, new Vector2(1, 1), 0, Main.rand.NextFloat(0.09f, 0.17f), 0f, 25);
GeneralParticleHandler.SpawnParticle(pulse);
float numberOfDusts = 3f;
float rotFactor = 360f / numberOfDusts;
if (Player.miscCounter % 4 == 0)
if (Main.rand.NextBool(2))
{
for (int i = 0; i < numberOfDusts; i++)
{
var DustType = Main.rand.Next(4) switch
{
0 => 219,
1 => 220,
2 => 226,
_ => 222,
};
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f));
Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f);
Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot + offset, DustType, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
velOffset *= 10;
dust.position = Player.Center - velOffset;
dust.scale = Main.rand.NextFloat(0.7f, 0.8f);
}
Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, 278, CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.7f, 0.85f);
dust.color = sparkColor * 0.45f;
}
float numberOfDusts = 1f;
float rotFactor = 360f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f);
velOffset *= Main.rand.NextFloat(2, 13);
SquishyLightParticle exoEnergy = new(Player.Center + Player.velocity * 3 + velOffset * 1.5f, -velOffset * 0.25f, 0.3f, sparkColor, 8);
GeneralParticleHandler.SpawnParticle(exoEnergy);
}
}
@@ -75,36 +67,31 @@ namespace CalamityMod.Buffs.DamageOverTime
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
var sparkColor = Main.rand.Next(4) switch
{
0 => Color.DarkRed,
0 => Color.Red,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, sparkColor, new Vector2(1, 1), 0, 0.18f + (0.0000007f * npc.width * npc.height), 0f, 25);
GeneralParticleHandler.SpawnParticle(pulse);
float numberOfDusts = 2f;
float rotFactor = 360f / numberOfDusts;
if (Main.rand.NextBool(3))
{
Dust dust = Dust.NewDustPerfect(npcSize, 278, CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.7f, 0.85f) + (0.0000007f * npc.width * npc.height);
dust.color = sparkColor * 0.45f;
}
float numberOfDusts = 1f;
float rotFactor = 360f / numberOfDusts;
if (Main.rand.NextBool())
{
for (int i = 0; i < numberOfDusts; i++)
{
var DustType = Main.rand.Next(4) switch
{
0 => 219,
1 => 220,
2 => 226,
_ => 222,
};
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f));
Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f);
Dust dust = Dust.NewDustPerfect(npc.Center + offset, DustType, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
velOffset *= 10 + (0.0003f * npc.width * npc.height);
dust.position = npc.Center - velOffset;
dust.scale = Main.rand.NextFloat(0.7f, 0.8f);
velOffset *= Main.rand.NextFloat(1, 9) + (0.0002f * npc.width * npc.height);
SquishyLightParticle exoEnergy = new(npc.Center + npc.velocity * 3 + velOffset * 1.5f, -velOffset * 0.25f, 0.3f, sparkColor, 8);
GeneralParticleHandler.SpawnParticle(exoEnergy);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 3.2 KiB

+72 -59
View File
@@ -178,7 +178,16 @@ namespace CalamityMod.CalPlayer
#region Timer and Counter
public int gaelSwipes = 0;
public int dragoonDrizzlefishGelBoost = 1;
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
public int DragonsBreathAudioCooldown2 = 0;
public int PhotoAudioCooldown = 0;
public int PhotoTimer = 90;
public bool brittleStarBuffMode = false;
public bool sBlasterDashActivated = false;
public int saharaSlicersBolts = 0;
public int oceanCrestTimer = 0;
public int Holyhammer = 0;
public int PHAThammer = 0;
public int StellarHammer = 0;
@@ -221,6 +230,7 @@ namespace CalamityMod.CalPlayer
public int spiritOriginConvertedCrit = 0;
public int RustyMedallionCooldown = 0;
public float SulphWaterPoisoningLevel;
public float holyInfernoFadeIntensity;
public NPC unstableSelectedTarget;
public int zapActivity = 0;
public bool ragePulse = false;
@@ -555,6 +565,7 @@ namespace CalamityMod.CalPlayer
public bool hellfireTreads = false;
public bool abyssalAmulet = false;
public bool lumenousAmulet = false;
public bool oceanCrest = false;
public bool aquaticEmblem = false;
public bool spiritOrigin = false;
public bool spiritOriginVanity = false;
@@ -1747,6 +1758,7 @@ namespace CalamityMod.CalPlayer
hellfireTreads = false;
abyssalAmulet = false;
lumenousAmulet = false;
oceanCrest = false;
aquaticEmblem = false;
spiritOrigin = false;
spiritOriginVanity = false;
@@ -2219,6 +2231,7 @@ namespace CalamityMod.CalPlayer
hideOfDeusTimer = 0;
RustyMedallionCooldown = 0;
SulphWaterPoisoningLevel = 0f;
holyInfernoFadeIntensity = 0f;
spiritOriginConvertedCrit = 0;
rage = 0f;
adrenaline = 0f;
@@ -2774,22 +2787,22 @@ namespace CalamityMod.CalPlayer
brimflameFrenzy = true;
Player.AddBuff(ModContent.BuffType<BrimflameFrenzyBuff>(), 10 * 60, true);
SoundEngine.PlaySound(BrimflameScowl.ActivationSound, Player.Center);
for (int num502 = 0; num502 < 36; num502++)
for (int i = 0; i < 36; i++)
{
int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[dust].velocity *= 3f;
Main.dust[dust].scale *= 1.15f;
int brimDust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[brimDust].velocity *= 3f;
Main.dust[brimDust].scale *= 1.15f;
}
int num226 = 36;
for (int num227 = 0; num227 < num226; num227++)
int dustAmt = 36;
for (int j = 0; j < dustAmt; j++)
{
Vector2 vector6 = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f;
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * MathHelper.TwoPi / (float)num226), default) + Player.Center;
Vector2 vector7 = vector6 - Player.Center;
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f);
Main.dust[num228].noGravity = true;
Main.dust[num228].noLight = true;
Main.dust[num228].velocity = vector7;
Vector2 dustRotation = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f;
dustRotation = dustRotation.RotatedBy((double)((float)(j - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center;
Vector2 dustVelocity = dustRotation - Player.Center;
int brimDust2 = Dust.NewDust(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f);
Main.dust[brimDust2].noGravity = true;
Main.dust[brimDust2].noLight = true;
Main.dust[brimDust2].velocity = dustVelocity;
}
}
}
@@ -2868,22 +2881,22 @@ namespace CalamityMod.CalPlayer
if (dsSetBonus)
{
SoundEngine.PlaySound(DemonshadeHelm.ActivationSound, Player.Center);
for (int num502 = 0; num502 < 36; num502++)
for (int i = 0; i < 36; i++)
{
int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[dust].velocity *= 3f;
Main.dust[dust].scale *= 1.15f;
int brimDust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[brimDust].velocity *= 3f;
Main.dust[brimDust].scale *= 1.15f;
}
int num226 = 36;
for (int num227 = 0; num227 < num226; num227++)
int dustAmt = 36;
for (int j = 0; j < dustAmt; j++)
{
Vector2 vector6 = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f;
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * MathHelper.TwoPi / (float)num226), default) + Player.Center;
Vector2 vector7 = vector6 - Player.Center;
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f);
Main.dust[num228].noGravity = true;
Main.dust[num228].noLight = true;
Main.dust[num228].velocity = vector7;
Vector2 dustRotation = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f;
dustRotation = dustRotation.RotatedBy((double)((float)(j - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center;
Vector2 dustVelocity = dustRotation - Player.Center;
int brimDust2 = Dust.NewDust(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f);
Main.dust[brimDust2].noGravity = true;
Main.dust[brimDust2].noLight = true;
Main.dust[brimDust2].velocity = dustVelocity;
}
if (Player.whoAmI == Main.myPlayer)
{
@@ -3137,9 +3150,9 @@ namespace CalamityMod.CalPlayer
public static Vector2? GetUnderworldPosition(Player player)
{
bool canSpawn = false;
int num = Main.maxTilesX / 2;
int num2 = 100;
int num3 = num2 / 2;
int halfWorldXTiles = Main.maxTilesX / 2;
int largerCheckRadius = 100;
int smallerCheckRadius = 50;
int teleportStartY = Main.UnderworldLayer + 20;
int teleportRangeY = 80;
Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings
@@ -3153,12 +3166,12 @@ namespace CalamityMod.CalPlayer
maximumFallDistanceFromOrignalPoint = 30
};
Vector2 vector = player.CheckForGoodTeleportationSpot(ref canSpawn, num - num3, num2, teleportStartY, teleportRangeY, settings);
Vector2 vector = player.CheckForGoodTeleportationSpot(ref canSpawn, halfWorldXTiles - smallerCheckRadius, largerCheckRadius, teleportStartY, teleportRangeY, settings);
if (!canSpawn)
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, num - num2, num3, teleportStartY, teleportRangeY, settings);
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, halfWorldXTiles - largerCheckRadius, smallerCheckRadius, teleportStartY, teleportRangeY, settings);
if (!canSpawn)
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, num + num3, num3, teleportStartY, teleportRangeY, settings);
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, halfWorldXTiles + smallerCheckRadius, smallerCheckRadius, teleportStartY, teleportRangeY, settings);
if (canSpawn)
{
@@ -3896,46 +3909,46 @@ namespace CalamityMod.CalPlayer
{
if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type))
{
float num72 = item.shootSpeed;
Vector2 vector2 = Player.RotatedRelativePoint(Player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float veneratedCloneSpeed = item.shootSpeed;
Vector2 realPlayerPos = Player.RotatedRelativePoint(Player.MountedCenter, true);
float veneratedCloneXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float veneratedCloneYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (Player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
veneratedCloneYPos = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float veneratedCloneDistance = (float)Math.Sqrt((double)(veneratedCloneXPos * veneratedCloneXPos + veneratedCloneYPos * veneratedCloneYPos));
if ((float.IsNaN(veneratedCloneXPos) && float.IsNaN(veneratedCloneYPos)) || (veneratedCloneXPos == 0f && veneratedCloneYPos == 0f))
{
num78 = (float)Player.direction;
num79 = 0f;
num80 = num72;
veneratedCloneXPos = (float)Player.direction;
veneratedCloneYPos = 0f;
veneratedCloneDistance = veneratedCloneSpeed;
}
else
{
num80 = num72 / num80;
veneratedCloneDistance = veneratedCloneSpeed / veneratedCloneDistance;
}
vector2 = new Vector2(Player.position.X + (float)Player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)Player.direction) + ((float)Main.mouseX + Main.screenPosition.X - Player.position.X), Player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + Player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= 100f;
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(Player.position.X + (float)Player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)Player.direction) + ((float)Main.mouseX + Main.screenPosition.X - Player.position.X), Player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + Player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= 100f;
veneratedCloneXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
veneratedCloneYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (veneratedCloneYPos < 0f)
{
num79 *= -1f;
veneratedCloneYPos *= -1f;
}
if (num79 < 20f)
if (veneratedCloneYPos < 20f)
{
num79 = 20f;
veneratedCloneYPos = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.07), knockBack * 0.5f, Player.whoAmI);
veneratedCloneDistance = (float)Math.Sqrt((double)(veneratedCloneXPos * veneratedCloneXPos + veneratedCloneYPos * veneratedCloneYPos));
veneratedCloneDistance = veneratedCloneSpeed / veneratedCloneDistance;
veneratedCloneXPos *= veneratedCloneDistance;
veneratedCloneYPos *= veneratedCloneDistance;
float speedX4 = veneratedCloneXPos + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = veneratedCloneYPos + (float)Main.rand.Next(-30, 31) * 0.02f;
int p = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, (int)(damage * 0.07), knockBack * 0.5f, Player.whoAmI);
if (p.WithinBounds(Main.maxProjectiles))
{
+1 -3
View File
@@ -475,10 +475,8 @@ namespace CalamityMod.CalPlayer
SpriteEffects spriteEffects = Player.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
float num25 = -4f;
float num24 = -8f;
DrawData howDoIDrawThings = new DrawData(thingToDraw,
new Vector2((int)(drawPlayer.position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (9 * drawPlayer.direction)) + num25 * drawPlayer.direction, (int)(drawPlayer.position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num24 * drawPlayer.gravDir)),
new Vector2((int)(drawPlayer.position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (9 * drawPlayer.direction)) - 4f * drawPlayer.direction, (int)(drawPlayer.position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) + 2f * drawPlayer.gravDir - 8f * drawPlayer.gravDir)),
new Rectangle(0, 0, thingToDraw.Width, thingToDraw.Height),
drawInfo.colorArmorBody,
drawPlayer.bodyRotation,
+14 -14
View File
@@ -119,8 +119,8 @@ namespace CalamityMod.CalPlayer
for (int j = 0; j < 100; j++)
{
int num = Dust.NewDust(Player.position, Player.width, Player.height, 235, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[num];
int scarfDodgeDust = Dust.NewDust(Player.position, Player.width, Player.height, 235, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[scarfDodgeDust];
dust.position.X += Main.rand.Next(-20, 21);
dust.position.Y += Main.rand.Next(-20, 21);
dust.velocity *= 0.4f;
@@ -233,8 +233,8 @@ namespace CalamityMod.CalPlayer
for (int j = 0; j < 50; j++)
{
int num = Dust.NewDust(Player.position, Player.width, Player.height, 173, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[num];
int nebulousReviveDust = Dust.NewDust(Player.position, Player.width, Player.height, 173, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[nebulousReviveDust];
dust.position.X += Main.rand.Next(-20, 21);
dust.position.Y += Main.rand.Next(-20, 21);
dust.velocity *= 0.9f;
@@ -2585,18 +2585,18 @@ namespace CalamityMod.CalPlayer
{
if (Player.inventory[i].stack > 0 && ((Player.inventory[i].type >= ItemID.LargeAmethyst && Player.inventory[i].type <= ItemID.LargeDiamond) || Player.inventory[i].type == ItemID.LargeAmber))
{
int num = Item.NewItem(source, (int)Player.position.X, (int)Player.position.Y, Player.width, Player.height, Player.inventory[i].type, 1, false, 0, false, false);
Main.item[num].netDefaults(Player.inventory[i].netID);
Main.item[num].Prefix((int)Player.inventory[i].prefix);
Main.item[num].stack = Player.inventory[i].stack;
Main.item[num].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
Main.item[num].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f;
Main.item[num].noGrabDelay = 100;
Main.item[num].favorited = false;
Main.item[num].newAndShiny = false;
int droppedLargeGem = Item.NewItem(source, (int)Player.position.X, (int)Player.position.Y, Player.width, Player.height, Player.inventory[i].type, 1, false, 0, false, false);
Main.item[droppedLargeGem].netDefaults(Player.inventory[i].netID);
Main.item[droppedLargeGem].Prefix((int)Player.inventory[i].prefix);
Main.item[droppedLargeGem].stack = Player.inventory[i].stack;
Main.item[droppedLargeGem].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
Main.item[droppedLargeGem].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f;
Main.item[droppedLargeGem].noGrabDelay = 100;
Main.item[droppedLargeGem].favorited = false;
Main.item[droppedLargeGem].newAndShiny = false;
if (Main.netMode == NetmodeID.MultiplayerClient)
{
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, droppedLargeGem, 0f, 0f, 0f, 0, 0, 0);
}
Player.inventory[i].SetDefaults(0, false);
}
+56 -16
View File
@@ -190,6 +190,9 @@ namespace CalamityMod.CalPlayer
if (Player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>())
heldGaelsLastFrame = true;
if (Player.ActiveItem().type != ModContent.ItemType<SaharaSlicers>())
saharaSlicersBolts = 0;
// De-equipping Gael's Greatsword deletes all rage.
else if (heldGaelsLastFrame)
{
@@ -323,6 +326,28 @@ namespace CalamityMod.CalPlayer
else
HasReducedDashFirstFrame = false;
}
if (oceanCrest)
{
bool surface = Player.Center.Y < Main.worldSurface * 16.0;
bool GetEffects = ((Main.raining && surface) || Player.dripping || (Player.wet && !Player.lavaWet && !Player.honeyWet));
if (GetEffects)
{
if (oceanCrestTimer < 300)
oceanCrestTimer += 5;
if (Player.StandingStill(0.1f) && !ZoneAbyss && Player.breath < 201 && Player.miscCounter % 2 == 0)
Player.breath += 1;
}
else
if (oceanCrestTimer > 0)
oceanCrestTimer--;
if (oceanCrestTimer > 0 || GetEffects)
Player.pickSpeed -= 0.15f; // 15% mining speed
Vector3 Light = new Vector3(0.090f, 0.180f, 0.200f);
Lighting.AddLight(Player.Center, Light * (0.55f + (oceanCrestTimer * 0.0035f)));
}
}
#endregion
@@ -911,17 +936,24 @@ namespace CalamityMod.CalPlayer
{
if (!Main.rand.NextBool(3))
continue;
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.head, (int)CalamityDusts.ProfanedFire);
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.ProfanedFire);
holyCinder.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
holyCinder.velocity.Y -= Main.rand.NextFloat(1f, 3f);
holyCinder.scale = Main.rand.NextFloat(1.15f, 1.45f);
holyCinder.noGravity = true;
}
}
ProvidenceBurnEffectDrawer.Update();
if (hInferno && holyInfernoFadeIntensity < 1f)
{
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity + 0.015f, 0f, 1f);
}
else if (!hInferno && holyInfernoFadeIntensity > 0f)
{
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f);
}
// Transformer immunity to Electrified
if (transformer)
Player.buffImmune[BuffID.Electrified] = true;
@@ -1160,7 +1192,7 @@ namespace CalamityMod.CalPlayer
Vector2 dustLineEnd = Player.Center;
Vector2 currentDustPos = default;
Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(MathHelper.Pi);
Vector2 value5 = new Vector2(2.1f, 2f);
Vector2 healerDustVel = new Vector2(2.1f, 2f);
Color dustColor = Main.hslToRgb(Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X, 1f, 0.5f);
dustColor.A = 255;
for (int i = 0; i < maxHealDustIterations; i++)
@@ -1168,18 +1200,18 @@ namespace CalamityMod.CalPlayer
if (i % dustDivisor == 0)
{
currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxHealDustIterations);
int dust = Dust.NewDust(currentDustPos, 0, 0, 267, 0f, 0f, 0, dustColor, 1f);
Main.dust[dust].position = currentDustPos;
Main.dust[dust].velocity = spinningpoint.RotatedBy(MathHelper.TwoPi * i / maxHealDustIterations) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f) + Player.velocity;
Main.dust[dust].noGravity = true;
Main.dust[dust].scale = 1f;
Main.dust[dust].fadeIn = Main.rand.NextFloat() * 2f;
Dust dust2 = Dust.CloneDust(dust);
Dust dust3 = dust2;
dust3.scale /= 2f;
dust3 = dust2;
dust3.fadeIn /= 2f;
dust2.color = new Color(255, 255, 255, 255);
int holyDust = Dust.NewDust(currentDustPos, 0, 0, 267, 0f, 0f, 0, dustColor, 1f);
Main.dust[holyDust].position = currentDustPos;
Main.dust[holyDust].velocity = spinningpoint.RotatedBy(MathHelper.TwoPi * i / maxHealDustIterations) * healerDustVel * (0.8f + Main.rand.NextFloat() * 0.4f) + Player.velocity;
Main.dust[holyDust].noGravity = true;
Main.dust[holyDust].scale = 1f;
Main.dust[holyDust].fadeIn = Main.rand.NextFloat() * 2f;
Dust dustClone = Dust.CloneDust(holyDust);
Dust extraDust = dustClone;
extraDust.scale /= 2f;
extraDust = dustClone;
extraDust.fadeIn /= 2f;
dustClone.color = new Color(255, 255, 255, 255);
}
}
}
@@ -1287,6 +1319,12 @@ namespace CalamityMod.CalPlayer
if (expiredCooldowns.Count > 0)
SyncCooldownRemoval(Main.netMode == NetmodeID.Server, expiredCooldowns);
if (DragonsBreathAudioCooldown > 0)
DragonsBreathAudioCooldown--;
if (DragonsBreathAudioCooldown2 > 0)
DragonsBreathAudioCooldown2--;
if (PhotoAudioCooldown > 0)
PhotoAudioCooldown--;
if (fullRageSoundCountdownTimer > 0)
--fullRageSoundCountdownTimer;
if (plagueTaintedSMGDroneCooldown > 0)
@@ -2059,6 +2097,7 @@ namespace CalamityMod.CalPlayer
// Breath Loss Multiplier, depending on gear
double breathLossMult = 1D -
(Player.gills ? 0.2 : 0D) - // 0.8
(oceanCrest ? 0.2 : 0D) - // 0.8
(Player.accDivingHelm ? 0.25 : 0D) - // 0.75
(Player.arcticDivingGear ? 0.25 : 0D) - // 0.75
(aquaticEmblem ? 0.25 : 0D) - // 0.75
@@ -2122,6 +2161,7 @@ namespace CalamityMod.CalPlayer
// Tick (frame) multiplier, depending on gear
double tickMult = 1D +
(Player.gills ? 4D : 0D) + // 5
(oceanCrest ? 4D : 0D) + // 5
(Player.ignoreWater ? 5D : 0D) + // 10
(Player.accDivingHelm ? 10D : 0D) + // 20
(Player.arcticDivingGear ? 10D : 0D) + // 30
-3
View File
@@ -305,9 +305,6 @@ namespace CalamityMod
Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky();
Filters.Scene["CalamityMod:Providence"] = new Filter(new ProvScreenShaderData("FilterMiniTower").UseColor(0.45f, 0.4f, 0.2f).UseOpacity(0.5f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:Providence"] = new ProvSky();
Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky();
+7 -2
View File
@@ -179,12 +179,13 @@ namespace CalamityMod.Effects
#endregion
//
// All below shaders were added by Amber
// Authorship goes to Toasty
// All below shaders were added or created by Amber
// Authorship for the PrimitiveClearShader goes to Toasty
//
#region Amber's Shaders
internal static Effect PrimitiveClearShader;
internal static Effect HolyInfernoShader;
#endregion
// Shorthand to register a loaded shader in Terraria's graphics engine
@@ -390,6 +391,10 @@ namespace CalamityMod.Effects
#region Loading Amber's Shaders
PrimitiveClearShader = LoadShader("PrimitiveClearShader");
RegisterScreenShader(PrimitiveClearShader, "AutoloadPass", "PrimitiveClearShader");
HolyInfernoShader = LoadShader("HolyInfernoShader");
RegisterMiscShader(HolyInfernoShader, "InfernoPass", "HolyInfernoShader");
#endregion
}
}
+86
View File
@@ -0,0 +1,86 @@
sampler diagonalNoise : register(s1);
sampler upwardNoise : register(s2);
sampler upwardPerlinTex : register(s3);
float colorMult;
float time;
float radius;
float maxOpacity;
float burnIntensity;
float2 screenPosition;
float2 screenSize;
float2 anchorPoint;
float2 playerPosition;
float InverseLerp(float a, float b, float t)
{
return saturate((t - a) / (b - a));
}
float3 firePalette(float noise)
{
// Temperature range (in Kelvin).
float temperature = 1500. + 1500. * noise;
float3 orange = float3(0.81, 0.45, 0.23) * colorMult;
float3 golden = float3(1., 0.75, 0.29) * colorMult;
float3 lightYellow = float3(1., 1., 0.95) * colorMult;
float3 fireColor;
if (noise < 0.5)
fireColor = lerp(orange, golden, noise * 2.);
else
fireColor = lerp(golden, lightYellow, (noise - 0.5) * 2.);
fireColor = pow(fireColor, float3(5, 5, 5)) * (exp(1.43876719683e5 / (temperature * fireColor)) - 1.);
// Exposure level. Set to "50." For "70," change the "5" to a "7," etc.
return 1. - exp(-1.3e8 / fireColor);
}
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0
{
float2 worldUV = screenPosition + screenSize * uv;
float2 provUV = anchorPoint / screenSize;
float worldDistance = distance(worldUV, anchorPoint);
float adjustedTime = time * 0.1;
// Pixelate the uvs
float2 pixelatedUV = worldUV / screenSize;
pixelatedUV.x -= worldUV.x % (1 / screenSize.x);
pixelatedUV.y -= worldUV.y % (1 / (screenSize.y / 2) * 2);
// Sample the noise textures
float noiseMesh1 = tex2D(upwardNoise, frac(pixelatedUV * 0.58 + float2(0, time * 0.25))).g;
float noiseMesh2 = tex2D(upwardPerlinTex, frac(pixelatedUV * 1.57 + float2(0, time * 0.35))).g;
float noiseMesh3 = tex2D(diagonalNoise, frac(pixelatedUV * 1.46 + float2(adjustedTime * 0.56, adjustedTime * 1.2))).g;
float noiseMesh4 = tex2D(diagonalNoise, frac(pixelatedUV * 1.57 + float2(adjustedTime * -0.56, adjustedTime * 1.2))).g;
float textureMesh = noiseMesh1 * 0.125 + noiseMesh2 * 0.2 + noiseMesh3 * 0.35 + noiseMesh4 * 0.35;
// Get the distance to the pixel from the player.
float distToPlayer = distance(playerPosition, worldUV);
// And get the correct opacity based on it.
float opacity = burnIntensity;
// Fade in quickly as the player approaches the pixels
opacity += InverseLerp(800, 500, distToPlayer);
// Define the border and mix the inferno for a smooth transition
bool border = worldDistance < radius && opacity > 0;
float colorMult = 1;
if (border)
colorMult = InverseLerp(radius * 0.94, radius, worldDistance);
opacity = clamp(opacity, 0, maxOpacity);
// If the color multi has not been changed (not border pixel) and opacity is 0 OR it's within
if (colorMult == 1 && (opacity == 0 || worldDistance < radius))
return sampleColor;
return float4(firePalette(textureMesh), 1) * colorMult * opacity;
}
technique Technique1
{
pass InfernoPass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+12 -7
View File
@@ -442,13 +442,6 @@ namespace CalamityMod.Events
{
CalamityUtils.KillAllHostileProjectiles();
HostileProjectileKillCounter = 3;
// Mark Boss Rush as complete
DownedBossSystem.downedBossRush = true;
CalamityNetcode.SyncWorld();
if (Main.netMode != NetmodeID.MultiplayerClient)
Projectile.NewProjectile(Source, npc.Center, Vector2.Zero, ModContent.ProjectileType<BossRushEndEffectThing>(), 0, 0f, Main.myPlayer);
}
};
}
@@ -744,7 +737,19 @@ namespace CalamityMod.Events
HostileProjectileKillCounter = 3;
if (BossDeathEffects.ContainsKey(npc.type))
{
BossDeathEffects[npc.type].Invoke(npc);
}
if (npc.type == Bosses[Bosses.Count -1].EntityID)
{
// Mark Boss Rush as complete
DownedBossSystem.downedBossRush = true;
CalamityNetcode.SyncWorld();
if (Main.netMode != NetmodeID.MultiplayerClient)
Projectile.NewProjectile(Source, npc.Center, Vector2.Zero, ModContent.ProjectileType<BossRushEndEffectThing>(), 0, 0f, Main.myPlayer);
}
}
// Sync the stage and progress of Boss Rush whenever a relevant boss dies.
Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 300 B

+24 -24
View File
@@ -28,52 +28,52 @@ namespace CalamityMod.Gores
{
gore.alpha = 100;
}
int num = 4;
int goreFrameDelay = 4;
gore.frameCounter++;
if (gore.frame <= 4)
{
int num2 = (int)(gore.position.X / 16f);
int num3 = (int)(gore.position.Y / 16f) - 1;
if (WorldGen.InWorld(num2, num3, 0) && !Main.tile[num2, num3].HasTile)
int goreXPos = (int)(gore.position.X / 16f);
int goreYPos = (int)(gore.position.Y / 16f) - 1;
if (WorldGen.InWorld(goreXPos, goreYPos, 0) && !Main.tile[goreXPos, goreYPos].HasTile)
{
gore.active = false;
}
if (gore.frame == 0)
{
num = 24 + Main.rand.Next(256);
goreFrameDelay = 24 + Main.rand.Next(256);
}
if (gore.frame == 1)
{
num = 24 + Main.rand.Next(256);
goreFrameDelay = 24 + Main.rand.Next(256);
}
if (gore.frame == 2)
{
num = 24 + Main.rand.Next(256);
goreFrameDelay = 24 + Main.rand.Next(256);
}
if (gore.frame == 3)
{
num = 24 + Main.rand.Next(96);
goreFrameDelay = 24 + Main.rand.Next(96);
}
if (gore.frame == 5)
{
num = 16 + Main.rand.Next(64);
goreFrameDelay = 16 + Main.rand.Next(64);
}
if ((int)gore.frameCounter >= num)
if ((int)gore.frameCounter >= goreFrameDelay)
{
gore.frameCounter = 0;
gore.frame += 1;
if (gore.frame == 5 && Main.netMode != NetmodeID.Server)
{
int num4 = Gore.NewGore(new EntitySource_Misc("0"), gore.position, gore.velocity, gore.type, 1f);
Main.gore[num4].frame = 9;
Main.gore[num4].velocity *= 0f;
int astralWater = Gore.NewGore(new EntitySource_Misc("0"), gore.position, gore.velocity, gore.type, 1f);
Main.gore[astralWater].frame = 9;
Main.gore[astralWater].velocity *= 0f;
}
}
}
else if (gore.frame <= 6)
{
num = 8;
if ((int)gore.frameCounter >= num)
goreFrameDelay = 8;
if ((int)gore.frameCounter >= goreFrameDelay)
{
gore.frameCounter = 0;
gore.frame += 1;
@@ -85,7 +85,7 @@ namespace CalamityMod.Gores
}
else if (gore.frame <= 9)
{
num = 6;
goreFrameDelay = 6;
gore.velocity.Y += 0.2f;
if ((double)gore.velocity.Y < 0.5)
{
@@ -95,7 +95,7 @@ namespace CalamityMod.Gores
{
gore.velocity.Y = 12f;
}
if ((int)gore.frameCounter >= num)
if ((int)gore.frameCounter >= goreFrameDelay)
{
gore.frameCounter = 0;
gore.frame += 1;
@@ -108,7 +108,7 @@ namespace CalamityMod.Gores
else
{
gore.velocity.Y += 0.1f;
if ((int)gore.frameCounter >= num)
if ((int)gore.frameCounter >= goreFrameDelay)
{
gore.frameCounter = 0;
gore.frame += 1;
@@ -120,9 +120,9 @@ namespace CalamityMod.Gores
}
}
Vector2 value3 = gore.velocity;
Vector2 goreVelCheck = gore.velocity;
gore.velocity = Collision.TileCollision(gore.position, gore.velocity, 16, 14, false, false, 1);
if (gore.velocity != value3)
if (gore.velocity != goreVelCheck)
{
if (gore.frame < 10)
{
@@ -146,12 +146,12 @@ namespace CalamityMod.Gores
}
((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(gore.position + new Vector2(8f, 8f), 1f, RippleShape.Square, 0f);
}
int num21 = (int)(gore.position.X + 8f) / 16;
int num22 = (int)(gore.position.Y + 14f) / 16;
if (Main.tile[num21, num22] != null && Main.tile[num21, num22].LiquidAmount > 0)
int goreTileX = (int)(gore.position.X + 8f) / 16;
int goreTileY = (int)(gore.position.Y + 14f) / 16;
if (Main.tile[goreTileX, goreTileY] != null && Main.tile[goreTileX, goreTileY].LiquidAmount > 0)
{
gore.velocity *= 0f;
gore.position.Y = (float)(num22 * 16 - (int)(Main.tile[num21, num22].LiquidAmount / 16));
gore.position.Y = (float)(goreTileY * 16 - (int)(Main.tile[goreTileX, goreTileY].LiquidAmount / 16));
}
}
+3 -3
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Graphics.Drawers
On_Main.DrawNPCs += DrawNPCDrawers;
On_Main.DrawProjectiles += DrawProjectileDrawers;
On_Main.DrawPlayers_AfterProjectiles += DrawPlayerDrawers;
On_Main.DoDraw_WallsTilesNPCs += DrawBeforeTileDrawers;
On_Main.DrawBackgroundBlackFill += DrawBeforeTileDrawers;
On_Main.DrawInfernoRings += DrawAfterEverythingDrawers;
var drawerType = typeof(BaseDrawer);
@@ -64,7 +64,7 @@ namespace CalamityMod.Graphics.Drawers
On_Main.DrawNPCs -= DrawNPCDrawers;
On_Main.DrawProjectiles -= DrawProjectileDrawers;
On_Main.DrawPlayers_AfterProjectiles -= DrawPlayerDrawers;
On_Main.DoDraw_WallsTilesNPCs -= DrawBeforeTileDrawers;
On_Main.DrawBackgroundBlackFill -= DrawBeforeTileDrawers;
On_Main.DrawInfernoRings -= DrawAfterEverythingDrawers;
foreach (var drawer in Drawers)
@@ -143,7 +143,7 @@ namespace CalamityMod.Graphics.Drawers
Main.spriteBatch.End();
}
private void DrawBeforeTileDrawers(On_Main.orig_DoDraw_WallsTilesNPCs orig, Main self)
private void DrawBeforeTileDrawers(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
var drawers = Drawers.Where(drawer => drawer.ShouldDraw && drawer.Layer is DrawerLayer.BeforeTiles);
+68
View File
@@ -0,0 +1,68 @@
using CalamityMod.NPCs;
using CalamityMod.NPCs.Providence;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
using Rectangle = Microsoft.Xna.Framework.Rectangle;
namespace CalamityMod.Graphics.Drawers
{
public class HolyInfernoDrawer : BaseDrawer
{
#region Fields/Properties
public override DrawerLayer Layer => DrawerLayer.BeforeTiles;
public Providence Provi => (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence);
//Should only draw if not in the main menu, provi is active and the boolean for drawing the border is true.
public override bool ShouldDraw => !Main.gameMenu && CalamityGlobalNPC.holyBoss != -1 &&
Main.npc[CalamityGlobalNPC.holyBoss].active && (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence).shouldDrawInfernoBorder;
#endregion
#region Methods
public override void DrawToTarget(SpriteBatch spriteBatch)
{
var npc = Main.npc[CalamityGlobalNPC.holyBoss];
var provi = npc.ModNPC as Providence;
var borderStartEnd = provi.borderStartEnd;
if (borderStartEnd.Item1 > 0f && npc.HasValidTarget)
{
var target = Main.player[Main.myPlayer];
var holyInfernoIntensity = target.Calamity().holyInfernoFadeIntensity;
//Begin drawing the inferno
var blackTile = TextureAssets.MagicPixel;
var diagonalNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
var upwardPerlinNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Perlin");
var upwardNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise");
var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader;
shader.Parameters["colorMult"].SetValue(7.35f); //I want you to know it took considerable restraint to deliberately misspell colour.
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
shader.Parameters["radius"].SetValue(borderStartEnd.Item2);
shader.Parameters["anchorPoint"].SetValue(npc.Center);
shader.Parameters["screenPosition"].SetValue(Main.screenPosition);
shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2());
shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity);
shader.Parameters["playerPosition"].SetValue(target.Center);
shader.Parameters["maxOpacity"].SetValue(1f);
spriteBatch.GraphicsDevice.Textures[1] = diagonalNoise.Value;
spriteBatch.GraphicsDevice.Textures[2] = upwardNoise.Value;
spriteBatch.GraphicsDevice.Textures[3] = upwardPerlinNoise.Value;
//Manual end begin for the sampler state
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, shader, Main.GameViewMatrix.TransformationMatrix);
Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight);
spriteBatch.Draw(blackTile.Value, rekt, null, default, 0f, blackTile.Value.Size() * 0.5f, 0, 0f);
//Inferno drawing complete
spriteBatch.ExitShaderRegion();
}
}
#endregion
}
}
+104
View File
@@ -0,0 +1,104 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class BloodBoilerMetaball : Metaball
{
public class BloodBoilerParticle
{
public Vector2 Center;
public float Size;
public BloodBoilerParticle(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < 20f)
Size = Size * 0.8f - 1f;
}
}
public static List<BloodBoilerParticle> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override Color EdgeColor => Color.DarkRed;
public override void Update()
{
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float pureRedIntensity = 0.15f;
float opacity = 0.5f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value;
foreach (BloodBoilerParticle particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float pureRedInterpolant = Utils.GetLerpValue(25f, 60f, particle.Size, true) * pureRedIntensity;
Color drawColor = Color.Lerp(EdgeColor, Color.DarkRed, pureRedInterpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+104
View File
@@ -0,0 +1,104 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class BloodBoilerMetaball2 : Metaball
{
public class BloodBoilerParticle2
{
public Vector2 Center;
public float Size;
public BloodBoilerParticle2(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < 20f)
Size = Size * 0.8f - 1f;
}
}
public static List<BloodBoilerParticle2> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override Color EdgeColor => Color.DarkRed;
public override void Update()
{
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float pureRedIntensity = 0.15f;
float opacity = 0.3f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value;
foreach (BloodBoilerParticle2 particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float pureRedInterpolant = Utils.GetLerpValue(25f, 60f, particle.Size, true) * pureRedIntensity;
Color drawColor = Color.Lerp(EdgeColor, Color.DarkRed, pureRedInterpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+127
View File
@@ -0,0 +1,127 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class DragonsBreathFlameMetaball : DragonsBreathMetaball
{
// OrangeRed is FF4500
// new Color(0xFF, 0x3A, 0x0A);
public override Color EdgeColor => Color.Orange;
// Flame metaballs never turn white
public override void DrawInstances() => DrawInstancesInternal(0.03f, -1f);
}
public class DragonsBreathBeamMetaball : DragonsBreathMetaball
{
private static float whiteSizeThreshold = 72f;
public override Color EdgeColor => Color.Orange;
// Laser metaballs very suddenly turn white at a specific size
public override void DrawInstances() => DrawInstancesInternal(0.4f, whiteSizeThreshold);
}
public abstract class DragonsBreathMetaball : Metaball
{
// Identical behavior to Blood Boiler particles
public class DragonsBreathParticle
{
public Vector2 Center;
public float Size;
public DragonsBreathParticle(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < 5f)
Size = Size * 0.8f - 1f;
}
}
public List<DragonsBreathParticle> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override void Update()
{
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
internal void DrawInstancesInternal(float opacity, float whiteSizeThreshold)
{
float pureWhiteIntensity = 0.16f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (DragonsBreathParticle particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
Color drawColor;
if (whiteSizeThreshold >= 0f)
{
float pureWhiteInterpolant = Utils.GetLerpValue(0.8f * whiteSizeThreshold, whiteSizeThreshold, particle.Size, true) * pureWhiteIntensity;
drawColor = Color.Lerp(EdgeColor, Color.DarkOrange, pureWhiteInterpolant) * opacity;
}
else
drawColor = Color.Lerp(EdgeColor, new Color(0xE0, 0x70, 0x10), Utils.GetLerpValue(60f, 100f, particle.Size, true) * 0.75f);
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
@@ -0,0 +1,127 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class DragonsBreathFlameMetaball2 : DragonsBreathMetaball
{
// OrangeRed is FF4500
// new Color(0xFF, 0x3A, 0x0A);
public override Color EdgeColor => Color.OrangeRed;
// Flame metaballs never turn white
public override void DrawInstances() => DrawInstancesInternal(0.03f, -1f);
}
public class DragonsBreathBeamMetaball2 : DragonsBreathMetaball2
{
private static float whiteSizeThreshold = 72f;
public override Color EdgeColor => Color.OrangeRed * 1.2f;
// Laser metaballs very suddenly turn white at a specific size
public override void DrawInstances() => DrawInstancesInternal(0.4f, whiteSizeThreshold);
}
public abstract class DragonsBreathMetaball2 : Metaball
{
// Identical behavior to Blood Boiler particles
public class DragonsBreathParticle2
{
public Vector2 Center;
public float Size;
public DragonsBreathParticle2(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.1f, 0f, 200f) * 0.91f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < 20f)
Size = Size * 0.8f - 1f;
}
}
public List<DragonsBreathParticle2> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override void Update()
{
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
internal void DrawInstancesInternal(float opacity, float whiteSizeThreshold)
{
float pureWhiteIntensity = 0.16f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (DragonsBreathParticle2 particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
Color drawColor;
if (whiteSizeThreshold >= 0f)
{
float pureWhiteInterpolant = Utils.GetLerpValue(0.8f * whiteSizeThreshold, whiteSizeThreshold, particle.Size, true) * pureWhiteIntensity;
drawColor = Color.Lerp(EdgeColor, Color.White, pureWhiteInterpolant) * opacity;
}
else
drawColor = Color.Lerp(EdgeColor, Color.DarkOrange, Utils.GetLerpValue(60f, 100f, particle.Size, true) * 0.3f);
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+3 -4
View File
@@ -1,11 +1,10 @@
using CalamityMod.Graphics.Metaballs;
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

File renamed without changes.
+122
View File
@@ -0,0 +1,122 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class PhotoMetaball : Metaball
{
public class PhotoParticle
{
public Vector2 Center;
public float Size;
public int Time = 0;
public float OrginSize;
public PhotoParticle(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
Time++;
if (Time == 1)
OrginSize = Size;
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.8f, 0f, 1000f) * 0.96f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < OrginSize * 0.15f)
Size = 2;
}
}
public static List<PhotoParticle> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time = 0;
public override Color EdgeColor => sparkColor;
public override void Update()
{
Time++;
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
if (Time % 10 == 0)
{
sparkColor = Main.rand.Next(4) switch
{
0 => Color.Red,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
}
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float opacity = 1f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (PhotoParticle particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float Interpolant = Utils.GetLerpValue(25f, 60f, particle.Size * 0.6f, true);
Color drawColor = Color.Lerp(EdgeColor, Color.White * 0.9f, Interpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+123
View File
@@ -0,0 +1,123 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class PhotoMetaball2 : Metaball
{
public class PhotoParticle2
{
public Vector2 Center;
public float Size;
public int Time = 0;
public float OrginSize;
public PhotoParticle2(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
Time++;
if (Time == 1)
OrginSize = Size;
// Always slowly shrink the particles.
Size = MathHelper.Clamp(Size - 0.8f, 0f, 1000f) * 0.96f;
// Once sufficiently small, the particles very rapidly shrink.
if (Size < OrginSize * 0.15f)
Size = 2;
}
}
public static List<PhotoParticle2> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time;
public override Color EdgeColor => sparkColor * 5;
public override void Update()
{
Time++;
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
if (Time % 8 == 0)
{
sparkColor = Main.rand.Next(4) switch
{
0 => Color.DarkRed,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
}
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float opacity = 1f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (PhotoParticle2 particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float Interpolant = Utils.GetLerpValue(25f, 60f, particle.Size * 0.6f, true);
Color drawColor = Color.Lerp(Color.White, EdgeColor, Interpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+116
View File
@@ -0,0 +1,116 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class PhotoMetaball3 : Metaball
{
public class PhotoParticle3
{
public Vector2 Center;
public float Size;
public int Time = 0;
public PhotoParticle3(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
Time++;
if (Time >= 6)
Size = 2;
}
}
public static List<PhotoParticle3> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time = 0;
public override Color EdgeColor => sparkColor;
public override void Update()
{
Time++;
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
if (Time % 10 == 0)
{
sparkColor = Main.rand.Next(4) switch
{
0 => Color.Red,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
}
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float opacity = 1f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (PhotoParticle3 particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float Interpolant = Utils.GetLerpValue(25f, 60f, particle.Size * 0.6f, true);
Color drawColor = Color.Lerp(EdgeColor, Color.White * 0.9f, Interpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class PhotoMetaball4 : Metaball
{
public class PhotoParticle4
{
public Vector2 Center;
public float Size;
public int Time = 0;
public PhotoParticle4(Vector2 center, float size)
{
Center = center;
Size = size;
}
public void Update()
{
Time++;
if (Time >= 6)
Size = 2;
}
}
public static List<PhotoParticle4> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time;
public override Color EdgeColor => sparkColor * 5;
public override void Update()
{
Time++;
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
if (Time % 8 == 0)
{
sparkColor = Main.rand.Next(4) switch
{
0 => Color.Red,
1 => Color.MediumTurquoise,
2 => Color.Orange,
_ => Color.LawnGreen,
};
}
}
// Copied from Rancor Lava metaballs, since these need to be additive metaballs.
public override void PrepareShaderForTarget(int layerIndex)
{
// Store the shader in an easy to use local variable.
var metaballShader = CalamityShaders.AdditiveMetaballEdgeShader;
// Calculate the layer scroll offset. This is used to ensure that the texture contents of the given metaball have parallax, rather than being static over the screen
// regardless of world position.
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
public override void DrawInstances()
{
float opacity = 1f;
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Graphics/Metaballs/MetaballMessy").Value;
foreach (PhotoParticle4 particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
var origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
float Interpolant = Utils.GetLerpValue(25f, 60f, particle.Size * 0.6f, true);
Color drawColor = Color.Lerp(Color.White, EdgeColor, Interpolant).MultiplyRGBA(new Color(1f, 1f, 1f, opacity));
Main.spriteBatch.Draw(tex, drawPosition, null, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+1 -1
View File
@@ -297,7 +297,7 @@ namespace CalamityMod.ILEditing
self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1);
return;
}
if (self.active && self.Calamity().ShouldFallThroughPlatforms)
fall = true;
+3 -20
View File
@@ -17,15 +17,15 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5));
ItemID.Sets.AnimatesAsSoul[Type] = true;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<StressPills>();
}
public override void SetDefaults()
{
Item.width = 26;
Item.height = 26;
Item.width = 46;
Item.height = 66;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
@@ -36,22 +36,5 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.heartOfDarkness = true;
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
CalamityUtils.DrawInventoryCustomScale(
spriteBatch,
texture: TextureAssets.Item[Type].Value,
position,
frame,
drawColor,
itemColor,
origin,
scale,
wantedScale: 0.8f,
drawOffset: new(-2f, -2f)
);
return false;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 1.2 KiB

+29 -30
View File
@@ -22,9 +22,9 @@ namespace CalamityMod.Items.Accessories
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.35f * num, 0.05f * num, 0.35f * num);
float projLighting = Main.rand.Next(90, 111) * 0.01f;
projLighting *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.35f * projLighting, 0.05f * projLighting, 0.35f * projLighting);
}
public override void UpdateAccessory(Player player, bool hideVisual)
@@ -36,61 +36,60 @@ namespace CalamityMod.Items.Accessories
float knockBack = 3f;
if (Main.rand.NextBool(15))
{
int num = 0;
int numProj = 0;
for (int i = 0; i < Main.maxProjectiles; i++)
{
if (Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType<NebulaStar>())
{
num++;
numProj++;
}
}
var source = player.GetSource_Accessory(Item);
if (Main.rand.Next(15) >= num && num < 10)
if (Main.rand.Next(15) >= numProj && numProj < 10)
{
int num2 = 50;
int num3 = 24;
int num4 = 90;
for (int j = 0; j < num2; j++)
int spawnRadius = 24;
int backupSpawnRadius = 90;
for (int j = 0; j < 50; j++)
{
int num5 = Main.rand.Next(200 - j * 2, 400 + j * 2);
int randomProjOffset = Main.rand.Next(200 - j * 2, 400 + j * 2);
Vector2 center = player.Center;
center.X += (float)Main.rand.Next(-num5, num5 + 1);
center.Y += (float)Main.rand.Next(-num5, num5 + 1);
if (!Collision.SolidCollision(center, num3, num3) && !Collision.WetCollision(center, num3, num3))
center.X += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
center.Y += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
if (!Collision.SolidCollision(center, spawnRadius, spawnRadius) && !Collision.WetCollision(center, spawnRadius, spawnRadius))
{
center.X += (float)(num3 / 2);
center.Y += (float)(num3 / 2);
center.X += (float)(spawnRadius / 2);
center.Y += (float)(spawnRadius / 2);
if (Collision.CanHit(new Vector2(player.Center.X, player.position.Y), 1, 1, center, 1, 1) || Collision.CanHit(new Vector2(player.Center.X, player.position.Y - 50f), 1, 1, center, 1, 1))
{
int num6 = (int)center.X / 16;
int num7 = (int)center.Y / 16;
bool flag = false;
if (Main.rand.NextBool(3) && Main.tile[num6, num7] != null && Main.tile[num6, num7].WallType > 0)
int projTileX = (int)center.X / 16;
int projTileY = (int)center.Y / 16;
bool canSpawnProj = false;
if (Main.rand.NextBool(3) && Main.tile[projTileX, projTileY] != null && Main.tile[projTileX, projTileY].WallType > 0)
{
flag = true;
canSpawnProj = true;
}
else
{
center.X -= (float)(num4 / 2);
center.Y -= (float)(num4 / 2);
if (Collision.SolidCollision(center, num4, num4))
center.X -= (float)(backupSpawnRadius / 2);
center.Y -= (float)(backupSpawnRadius / 2);
if (Collision.SolidCollision(center, backupSpawnRadius, backupSpawnRadius))
{
center.X += (float)(num4 / 2);
center.Y += (float)(num4 / 2);
flag = true;
center.X += (float)(backupSpawnRadius / 2);
center.Y += (float)(backupSpawnRadius / 2);
canSpawnProj = true;
}
}
if (flag)
if (canSpawnProj)
{
for (int k = 0; k < Main.maxProjectiles; k++)
{
if (Main.projectile[k].active && Main.projectile[k].owner == player.whoAmI && Main.projectile[k].type == ModContent.ProjectileType<NebulaStar>() && (center - Main.projectile[k].Center).Length() < 48f)
{
flag = false;
canSpawnProj = false;
break;
}
}
if (flag && Main.myPlayer == player.whoAmI)
if (canSpawnProj && Main.myPlayer == player.whoAmI)
{
Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
return;
+4 -7
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -18,12 +19,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.npcTypeNoAggro[NPCID.Shark] = true;
player.npcTypeNoAggro[NPCID.SeaSnail] = true;
player.npcTypeNoAggro[NPCID.PinkJellyfish] = true;
player.npcTypeNoAggro[NPCID.Crab] = true;
player.npcTypeNoAggro[NPCID.Squid] = true;
player.gills = true;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.oceanCrest = true;
}
}
}
+3 -3
View File
@@ -43,9 +43,9 @@ namespace CalamityMod.Items.Accessories
int myPlayer = Main.myPlayer;
if (Main.player[myPlayer].team == player.team && player.team != 0)
{
float num = player.position.X - Main.player[myPlayer].position.X;
float num2 = player.position.Y - Main.player[myPlayer].position.Y;
if ((float)Math.Sqrt(num * num + num2 * num2) < 800f)
float teamPlayerXDist = player.position.X - Main.player[myPlayer].position.X;
float teamPlayerYDist = player.position.Y - Main.player[myPlayer].position.Y;
if ((float)Math.Sqrt(teamPlayerXDist * teamPlayerXDist + teamPlayerYDist * teamPlayerYDist) < 800f)
Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20);
}
}
+6 -7
View File
@@ -27,9 +27,8 @@ namespace CalamityMod.Items.Accessories
player.buffImmune[ModContent.BuffType<Plague>()] = true;
int plagueCounter = 0;
Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.05f, 1f, 0.1f);
int num = ModContent.BuffType<Plague>();
float num2 = 300f;
bool flag = plagueCounter % 60 == 0;
int plagueDebuff = ModContent.BuffType<Plague>();
bool shouldInflictPlague = plagueCounter % 60 == 0;
int auraDamage = (int)player.GetBestClassDamage().ApplyTo(50);
int random = Main.rand.Next(10);
var source = player.GetSource_Accessory(Item);
@@ -40,13 +39,13 @@ namespace CalamityMod.Items.Accessories
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2)
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage && !nPC.buffImmune[plagueDebuff] && Vector2.Distance(player.Center, nPC.Center) <= 300f)
{
if (nPC.FindBuffIndex(num) == -1)
if (nPC.FindBuffIndex(plagueDebuff) == -1)
{
nPC.AddBuff(num, 120, false);
nPC.AddBuff(plagueDebuff, 120, false);
}
if (flag)
if (shouldInflictPlague)
{
if (player.whoAmI == Main.myPlayer)
{
+12 -12
View File
@@ -38,12 +38,12 @@ namespace CalamityMod.Items.Accessories.Wings
SoundEngine.PlaySound(SoundID.Item13, player.Center);
player.rocketDelay2 = 60;
}
int num66 = 2;
int dustAmt = 2;
if (player.controlUp)
{
num66 = 4;
dustAmt = 4;
}
for (int num67 = 0; num67 < num66; num67++)
for (int i = 0; i < dustAmt; i++)
{
int type = 6;
float scale = 1.75f;
@@ -53,27 +53,27 @@ namespace CalamityMod.Items.Accessories.Wings
{
x = player.position.X + (float)(player.width / 2) - 26f;
}
float num68 = player.position.Y + (float)player.height - 18f;
if (num67 == 1 || num67 == 3)
float dustYPos = player.position.Y + (float)player.height - 18f;
if (i == 1 || i == 3)
{
x = player.position.X + (float)(player.width / 2) + 8f;
if (player.direction > 0)
{
x = player.position.X + (float)(player.width / 2) - 20f;
}
num68 += 6f;
dustYPos += 6f;
}
if (num67 > 1)
if (i > 1)
{
num68 += player.velocity.Y;
dustYPos += player.velocity.Y;
}
int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default, scale);
Dust dust = Main.dust[num69];
int boosterDust = Dust.NewDust(new Vector2(x, dustYPos), 8, 8, type, 0f, 0f, alpha, default, scale);
Dust dust = Main.dust[boosterDust];
dust.velocity.X *= 0.1f;
dust.velocity.Y = Main.dust[num69].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f;
dust.velocity.Y = Main.dust[boosterDust].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f;
dust.noGravity = true;
dust.shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
if (num66 == 4)
if (dustAmt == 4)
{
dust.velocity.Y += 6f;
}
+7 -7
View File
@@ -31,19 +31,19 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
+7 -7
View File
@@ -40,19 +40,19 @@ namespace CalamityMod.Items.Accessories.Wings
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
+3 -3
View File
@@ -69,10 +69,10 @@ namespace CalamityMod.Items.Accessories.Wings
{
yStart += player.velocity.Y;
}
int num69 = Dust.NewDust(new Vector2(xStart, yStart), 8, 8, type, 0f, 0f, alpha, default, scale);
Dust dust = Main.dust[num69];
int boosterDust = Dust.NewDust(new Vector2(xStart, yStart), 8, 8, type, 0f, 0f, alpha, default, scale);
Dust dust = Main.dust[boosterDust];
dust.velocity.X *= 0.1f;
dust.velocity.Y = Main.dust[num69].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f;
dust.velocity.Y = Main.dust[boosterDust].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f;
dust.noGravity = true;
dust.shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
if (dustAmt == 4)
+7 -7
View File
@@ -41,19 +41,19 @@ namespace CalamityMod.Items.Accessories.Wings
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
+3 -3
View File
@@ -33,9 +33,9 @@ namespace CalamityMod.Items.Accessories.Wings
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0f * num, 0.3f * num, 0.3f * num);
float lightOffset = (float)Main.rand.Next(90, 111) * 0.01f;
lightOffset *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0f * lightOffset, 0.3f * lightOffset, 0.3f * lightOffset);
}
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
+7 -7
View File
@@ -40,19 +40,19 @@ namespace CalamityMod.Items.Accessories.Wings
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 173, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 173, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
+7 -7
View File
@@ -43,19 +43,19 @@ namespace CalamityMod.Items.Accessories.Wings
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
+7 -7
View File
@@ -34,19 +34,19 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 107, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 107, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
CalamityPlayer modPlayer = player.Calamity();
player.accRunSpeed = 8f;
+7 -7
View File
@@ -37,19 +37,19 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool() ? 206 : 173, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, Main.rand.NextBool() ? 206 : 173, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
CalamityPlayer modPlayer = player.Calamity();
player.accRunSpeed = 8.5f;
+7 -7
View File
@@ -37,19 +37,19 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int num59 = 4;
int dustXOffset = 4;
if (player.direction == 1)
{
num59 = -40;
dustXOffset = -40;
}
int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f);
Main.dust[num60].noGravity = true;
Main.dust[num60].velocity *= 0.3f;
int flightDust = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)dustXOffset, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f);
Main.dust[flightDust].noGravity = true;
Main.dust[flightDust].velocity *= 0.3f;
if (Main.rand.NextBool(10))
{
Main.dust[num60].fadeIn = 2f;
Main.dust[flightDust].fadeIn = 2f;
}
Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
CalamityPlayer modPlayer = player.Calamity();
player.accRunSpeed = 9f;
@@ -15,6 +15,7 @@ using Terraria.Audio;
using Terraria.DataStructures;
using CalamityMod.Dusts;
using ReLogic.Utilities;
using Terraria.Localization;
namespace CalamityMod.Items.Armor.DesertProwler
{
@@ -47,7 +48,7 @@ namespace CalamityMod.Items.Armor.DesertProwler
private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir)
{
if (keyDir == 0 && HasArmorSet(player) && !player.mount.Active)
if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active)
{
// The set bonus can only be activated if the player does not have the cooldown.
if (!player.Calamity().cooldowns.TryGetValue(SandsmokeBomb.ID, out CooldownInstance cd))
@@ -166,7 +167,8 @@ namespace CalamityMod.Items.Armor.DesertProwler
if (setBonusIndex != -1)
{
TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem<DesertProwlerHat>("AbilityBrief"));
string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN");
TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem<DesertProwlerHat>("AbilityBrief").Format(dir));
setBonus1.OverrideColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f));
tooltips.Insert(setBonusIndex + 1, setBonus1);
+5 -3
View File
@@ -10,6 +10,7 @@ using CalamityMod.Cooldowns;
using Terraria.Audio;
using System;
using System.Collections.Generic;
using Terraria.Localization;
using static Microsoft.Xna.Framework.Input.Keys;
using static Terraria.ModLoader.ModContent;
@@ -69,7 +70,7 @@ namespace CalamityMod.Items.Armor.Wulfrum
private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir)
{
if (keyDir == 0 && HasArmorSet(player) && !player.mount.Active)
if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active)
{
//Only activate if no cooldown & available scrap.
if (player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd))
@@ -84,7 +85,7 @@ namespace CalamityMod.Items.Armor.Wulfrum
else if (player.HasItem(ModContent.ItemType<WulfrumMetalScrap>()))
{
player.ConsumeItem(ModContent.ItemType<WulfrumMetalScrap>());
//I Thiiiinnnk there's no need to add mp syncing packets sicne cooldowns get auto synced right.
//I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right.
player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime);
//Though do i need to sync that or is the player inventory auto synced?
DummyCannon.SetDefaults(ItemType<WulfrumFusionCannon>());
@@ -228,7 +229,8 @@ namespace CalamityMod.Items.Armor.Wulfrum
if (setBonusIndex != -1)
{
TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem<WulfrumHat>("AbilityBrief"));
string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN");
TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem<WulfrumHat>("AbilityBrief").Format(dir));
setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f));
tooltips.Insert(setBonusIndex + 1, setBonus1);
-1
View File
@@ -22,7 +22,6 @@ namespace CalamityMod.Items.BaseItems
Terraria.UI.On_ItemSlot.LeftClick_ItemArray_int_int += LockMouseToSpecialItem;
Terraria.UI.On_ItemSlot.Draw_SpriteBatch_ItemArray_int_int_Vector2_Color += DrawSpecial;
}
private void DrawSpecial(Terraria.UI.On_ItemSlot.orig_Draw_SpriteBatch_ItemArray_int_int_Vector2_Color orig, SpriteBatch sb, Item[] inv, int context, int slot, Vector2 position, Color color)
{
if (inv[slot].ModItem is HeldOnlyItem && !(inv[slot].ModItem as HeldOnlyItem).VisibleInUI)
+6 -6
View File
@@ -1597,7 +1597,7 @@ namespace CalamityMod.Items
public static bool HasEnoughAmmo(Player player, Item item, int ammoConsumed)
{
bool flag = false;
bool hasEnoughAmmo = false;
bool canShoot = false;
for (int i = 54; i < Main.InventorySlotsTotal; i++)
@@ -1605,12 +1605,12 @@ namespace CalamityMod.Items
if (player.inventory[i].ammo == item.useAmmo && (player.inventory[i].stack >= ammoConsumed || !player.inventory[i].consumable))
{
canShoot = true;
flag = true;
hasEnoughAmmo = true;
break;
}
}
if (!flag)
if (!hasEnoughAmmo)
{
for (int j = 0; j < 54; j++)
{
@@ -1627,7 +1627,7 @@ namespace CalamityMod.Items
public static void ConsumeAdditionalAmmo(Player player, Item item, int ammoConsumed)
{
Item itemAmmo = new Item();
bool flag = false;
bool hasEnoughAmmo = false;
bool dontConsumeAmmo = false;
for (int i = 54; i < Main.InventorySlotsTotal; i++)
@@ -1635,12 +1635,12 @@ namespace CalamityMod.Items
if (player.inventory[i].ammo == item.useAmmo && (player.inventory[i].stack >= ammoConsumed || !player.inventory[i].consumable))
{
itemAmmo = player.inventory[i];
flag = true;
hasEnoughAmmo = true;
break;
}
}
if (!flag)
if (!hasEnoughAmmo)
{
for (int j = 0; j < 54; j++)
{
+2 -2
View File
@@ -93,7 +93,7 @@ namespace CalamityMod.Items
{ ItemID.DemonScythe, Do(AutoReuse, DamageExact(33)) },
{ ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar
{ ItemID.ElectrosphereLauncher, Do(DamageRatio(1.1f)) },
{ ItemID.ElfMelter, Do(DamageExact(94), ShootSpeedDelta(+3f)) },
{ ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) },
{ ItemID.EmeraldStaff, Do(DamageExact(27)) },
{ ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) },
@@ -107,7 +107,7 @@ namespace CalamityMod.Items
{ ItemID.Flairon, Do(DamageExact(73)) },
{ ItemID.Flamarang, Do(DamageExact(43)) },
{ ItemID.Flamelash, Do(DamageRatio(1.25f)) },
{ ItemID.Flamethrower, Do(ShootSpeedDelta(+3f)) },
{ ItemID.Flamethrower, Do(DamageExact(24), ShootSpeedDelta(+3f)) },
{ ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed
{ ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) },
{ ItemID.FlyingKnife, Do(DamageExact(70)) },
@@ -1,6 +1,10 @@
using CalamityMod.Projectiles.Ranged;
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,6 +14,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public class DragoonDrizzlefish : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public bool ballShot = true;
public int shotCounter = 0;
public override void SetStaticDefaults()
{
Item.staff[Item.type] = true; //so it doesn't look weird af when holding it
@@ -17,7 +24,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public override void SetDefaults()
{
Item.damage = 20;
Item.damage = 18;
Item.DamageType = DamageClass.Ranged;
Item.width = 42;
Item.height = 38;
@@ -25,31 +32,108 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2f;
Item.knockBack = 1.1f;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.UseSound = SoundID.Item20;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<DrizzlefishFireball>();
Item.shootSpeed = 11f;
Item.useAmmo = AmmoID.Gel; // for GFB
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
public override bool CanUseItem(Player player)
{
if (!Main.zenithWorld)
{
return true;
}
if (player.altFunctionUse == 2)
{
if (Main.zenithWorld)
{
CalamityGlobalItem.HasEnoughAmmo(player, Item, 5);
return true;
}
else
return false;
}
else
return true;
}
//so it looks normal when holding
public override Vector2? HoldoutOrigin() => new Vector2(10, 10);
public override Vector2? HoldoutOrigin() => new Vector2(7, 7);
public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false;
public override bool CanConsumeAmmo(Item ammo, Player player)
{
if (Main.zenithWorld && player.altFunctionUse == 2 && player.Calamity().dragoonDrizzlefishGelBoost < 6)
return true;
else
return false;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
velocity = velocity.RotatedByRandom(MathHelper.ToRadians(10f));
int shotType = ModContent.ProjectileType<DrizzlefishFireball>();
if (Main.rand.NextBool())
if (Main.zenithWorld && player.altFunctionUse == 2)
{
shotType = ModContent.ProjectileType<DrizzlefishFire>();
//GFB stuff
if (player.Calamity().dragoonDrizzlefishGelBoost < 6)
{
player.Calamity().dragoonDrizzlefishGelBoost++;
SoundStyle roar = Sunskater.DeathSound;
SoundEngine.PlaySound(roar with { Pitch = 0.3f }, player.Center);
SoundEngine.PlaySound(SoundID.Item2 with { Pitch = 0.3f }, player.Center);
CombatText.NewText(player.Hitbox, Color.OrangeRed, ":)");
for (int i = 0; i <= 11; i++)
{
Vector2 hVelocity = Main.rand.NextVector2Unit();
hVelocity.X *= 0.66f;
hVelocity *= Main.rand.NextFloat(1f, 2f);
int heart = Gore.NewGore(player.GetSource_FromThis(), player.Center + Main.rand.NextVector2Circular(14, 14), hVelocity, 331, Main.rand.NextFloat(0.2f, 1.3f));
Main.gore[heart].sticky = false;
Main.gore[heart].velocity *= 0.4f;
Main.gore[heart].velocity.Y -= 0.7f;
}
}
}
else
{
shotType = ModContent.ProjectileType<DrizzlefishFireball>();
if (Main.zenithWorld)
{
if (Main.rand.NextBool(25) && player.Calamity().dragoonDrizzlefishGelBoost > 1)
{
SoundStyle roar = Sunskater.DeathSound;
SoundEngine.PlaySound(roar, player.Center);
player.Calamity().dragoonDrizzlefishGelBoost--;
}
if (player.Calamity().dragoonDrizzlefishGelBoost == 1 && Main.rand.NextBool(3))
{
bool MADFISH = Main.rand.NextBool(4) ? true : false;
CombatText.NewText(player.Hitbox, Color.OrangeRed, MADFISH ? ">:(" : ":(");
SoundStyle roar = Sunskater.DeathSound;
SoundEngine.PlaySound(roar with { Pitch = -0.3f }, player.Center);
if (MADFISH)
player.AddBuff(ModContent.BuffType<Dragonfire>(), 240, true);
return false;
}
}
velocity = velocity.RotatedByRandom(MathHelper.ToRadians(5.5f));
int shotType = ModContent.ProjectileType<DrizzlefishFireball>();
if (shotCounter < 3)
{
shotType = ModContent.ProjectileType<DrizzlefishFireball>();
shotCounter++;
}
else
{
shotType = ModContent.ProjectileType<DrizzlefishFire>();
shotCounter = 0;
}
Projectile.NewProjectile(source, position, velocity, shotType, damage, knockback, player.whoAmI, 0f, Main.rand.Next(2));
}
Projectile.NewProjectile(source, position, velocity, shotType, damage, knockback, player.whoAmI, 0f, Main.rand.Next(2));
return false;
}
}
+3 -3
View File
@@ -26,9 +26,9 @@ namespace CalamityMod.Items.Materials
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.25f * num, 0.05f * num, 0.25f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.25f * brightness, 0.05f * brightness, 0.25f * brightness);
}
}
}
+3 -3
View File
@@ -25,9 +25,9 @@ namespace CalamityMod.Items.Materials
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (Item.width / 2)) / 16f), (int)((Item.position.Y + (Item.height / 2)) / 16f), 0.75f * num, 0f, 0f);
float brightness = Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (Item.width / 2)) / 16f), (int)((Item.position.Y + (Item.height / 2)) / 16f), 0.75f * brightness, 0f, 0f);
}
public override void AddRecipes()
+3 -3
View File
@@ -28,9 +28,9 @@ namespace CalamityMod.Items.Materials
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0f * num, 0.45f * num, 0.7f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0f * brightness, 0.45f * brightness, 0.7f * brightness);
}
}
}
+3 -3
View File
@@ -24,9 +24,9 @@ namespace CalamityMod.Items.Materials
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.45f * num, 0.3f * num, 0f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.45f * brightness, 0.3f * brightness, 0f * brightness);
}
}
}
+3 -3
View File
@@ -38,9 +38,9 @@ namespace CalamityMod.Items.Materials
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 1f * num, 0.3f * num, 0.3f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 1f * brightness, 0.3f * brightness, 0.3f * brightness);
}
}
}
+3 -3
View File
@@ -14,15 +14,15 @@ namespace CalamityMod.Items.Materials
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 25;
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 5));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 6));
ItemID.Sets.AnimatesAsSoul[Type] = true;
ItemID.Sets.SortingPriorityMaterials[Type] = 110;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.width = 24;
Item.height = 52;
Item.maxStack = 9999;
Item.value = Item.sellPrice(gold: 1);
Item.rare = ItemRarityID.Purple;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+3 -3
View File
@@ -26,9 +26,9 @@ namespace CalamityMod.Items.Materials
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.5f * num, 0.1f * num, 0.7f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.5f * brightness, 0.1f * brightness, 0.7f * brightness);
}
}
}
+3 -3
View File
@@ -27,9 +27,9 @@ namespace CalamityMod.Items.Materials
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.45f * num, 0.3f * num, 0f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.45f * brightness, 0.3f * brightness, 0f * brightness);
}
}
}
+1
View File
@@ -68,6 +68,7 @@ namespace CalamityMod.Items.Materials
}
public override void Load() => Terraria.On_Item.CanFillEmptyAmmoSlot += AvoidDefaultingToAmmoSlot;
private bool AvoidDefaultingToAmmoSlot(Terraria.On_Item.orig_CanFillEmptyAmmoSlot orig, Item self)
{
if (self.type == Type)
+3 -3
View File
@@ -18,9 +18,9 @@ namespace CalamityMod.Items.Materials
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num);
float brightness = (float)Main.rand.Next(90, 111) * 0.01f;
brightness *= Main.essScale;
Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 0.5f * brightness, 0.3f * brightness, 0.05f * brightness);
}
public override void SetDefaults()
+9 -9
View File
@@ -64,9 +64,9 @@ namespace CalamityMod.Items.Mounts
public override bool UpdateFrame(Player mountedPlayer, int state, Vector2 velocity)
{
bool speed = Math.Abs(velocity.X) > mountedPlayer.mount.RunSpeed / 2f;
float num10 = (float)Math.Sign(mountedPlayer.velocity.X);
float num11 = 12f;
float num12 = 40f;
float direction = (float)Math.Sign(mountedPlayer.velocity.X);
float dustYOffset = 12f;
float dustXOffset = 40f;
if (!speed)
{
mountedPlayer.basiliskCharge = 0f;
@@ -92,19 +92,19 @@ namespace CalamityMod.Items.Mounts
}
if (mountedPlayer.cMount == 0)
{
mountedPlayer.position += new Vector2(num10 * 24f, 0f);
mountedPlayer.position += new Vector2(direction * 24f, 0f);
mountedPlayer.FloorVisuals(true);
mountedPlayer.position -= new Vector2(num10 * 24f, 0f);
mountedPlayer.position -= new Vector2(direction * 24f, 0f);
}
}
if (num10 == (float)mountedPlayer.direction)
if (direction == (float)mountedPlayer.direction)
{
for (int j = 0; j < (int)(3f * mountedPlayer.basiliskCharge); j++)
{
Dust dust = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 67, 0f, 0f, 0, default, 1f)];
Vector2 value2 = mountedPlayer.Center + new Vector2(num10 * num12, num11);
dust.position = mountedPlayer.Center + new Vector2(num10 * (num12 - 2f), num11 - 6f + Main.rand.NextFloat() * 12f);
dust.velocity = (dust.position - value2).SafeNormalize(Vector2.Zero) * (3.5f + Main.rand.NextFloat() * 0.5f);
Vector2 dustVel = mountedPlayer.Center + new Vector2(direction * dustXOffset, dustYOffset);
dust.position = mountedPlayer.Center + new Vector2(direction * (dustXOffset - 2f), dustYOffset - 6f + Main.rand.NextFloat() * 12f);
dust.velocity = (dust.position - dustVel).SafeNormalize(Vector2.Zero) * (3.5f + Main.rand.NextFloat() * 0.5f);
if (dust.velocity.Y < 0f)
{
Dust expr_808_cp_0_cp_0 = dust;
+11 -11
View File
@@ -67,31 +67,31 @@ namespace CalamityMod.Items.SummonItems
safeBox.Height = 2500;
spawnYAdd = 125;
int num52 = (int)(safeBox.X + (float)(safeBox.Width / 2)) / 16;
int num53 = (int)(safeBox.Y + (float)(safeBox.Height / 2)) / 16;
int num54 = safeBox.Width / 2 / 16 + 1;
for (int num55 = num52 - num54; num55 <= num52 + num54; num55++)
int safeBoxTilesX = (int)(safeBox.X + (float)(safeBox.Width / 2)) / 16;
int safeBoxTilesY = (int)(safeBox.Y + (float)(safeBox.Height / 2)) / 16;
int safeBoxTilesWidth = safeBox.Width / 2 / 16 + 1;
for (int i = safeBoxTilesX - safeBoxTilesWidth; i <= safeBoxTilesX + safeBoxTilesWidth; i++)
{
for (int num56 = num53 - num54; num56 <= num53 + num54; num56++)
for (int j = safeBoxTilesY - safeBoxTilesWidth; j <= safeBoxTilesY + safeBoxTilesWidth; j++)
{
if (!WorldGen.InWorld(num55, num56, 2))
if (!WorldGen.InWorld(i, j, 2))
continue;
int xoffset = 0;
int yoffset = 0;
if ((num55 == num52 - num54 || num55 == num52 + num54 || num56 == num53 - num54 || num56 == num53 + num54) && !Main.tile[num55 + xoffset, num56 + yoffset].HasTile)
if ((i == safeBoxTilesX - safeBoxTilesWidth || i == safeBoxTilesX + safeBoxTilesWidth || j == safeBoxTilesY - safeBoxTilesWidth || j == safeBoxTilesY + safeBoxTilesWidth) && !Main.tile[i + xoffset, j + yoffset].HasTile)
{
Main.tile[num55 + xoffset, num56 + yoffset].TileType = (ushort)ModContent.TileType<Tiles.ArenaTile>();
Main.tile[num55 + xoffset, num56 + yoffset].Get<TileWallWireStateData>().HasTile = true;
Main.tile[i + xoffset, j + yoffset].TileType = (ushort)ModContent.TileType<Tiles.ArenaTile>();
Main.tile[i + xoffset, j + yoffset].Get<TileWallWireStateData>().HasTile = true;
}
if (Main.netMode == NetmodeID.Server)
{
NetMessage.SendTileSquare(-1, num55 + xoffset, num56 + yoffset, 1, TileChangeType.None);
NetMessage.SendTileSquare(-1, i + xoffset, j + yoffset, 1, TileChangeType.None);
}
else
{
WorldGen.SquareTileFrame(num55 + xoffset, num56 + yoffset, true);
WorldGen.SquareTileFrame(i + xoffset, j + yoffset, true);
}
}
}
+3 -3
View File
@@ -39,9 +39,9 @@ namespace CalamityMod.Items.SummonItems
bool canSummon = false;
if (player.Center.Y > Main.worldSurface * 16.0)
{
int num = (int)player.Center.X / 16;
int num2 = (int)player.Center.Y / 16;
Tile tile = Framing.GetTileSafely(num, num2);
int playerTileX = (int)player.Center.X / 16;
int playerTileY = (int)player.Center.Y / 16;
Tile tile = Framing.GetTileSafely(playerTileX, playerTileY);
if (tile.WallType == 87)
canSummon = true;
}
+2 -2
View File
@@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools
Item.axe = 100 / 5;
Item.DamageType = DamageClass.Melee;
Item.width = 36;
Item.height = 36;
Item.width = 50;
Item.height = 46;
Item.scale = 1.5f;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 598 B

+23 -23
View File
@@ -59,64 +59,64 @@ namespace CalamityMod.Items.Tools
player.itemAnimation == (int)(player.itemAnimationMax * 0.7) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
float num339 = 0f;
float num340 = 0f;
float num341 = 0f;
float num342 = 0f;
float sparkYVel = 0f;
float sparkXVel = 0f;
float sparkYSpawn = 0f;
float sparkXSpawn = 0f;
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num339 = -7f;
sparkYVel = -7f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num339 = -6f;
num340 = 2f;
sparkYVel = -6f;
sparkXVel = 2f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5))
{
num339 = -4f;
num340 = 4f;
sparkYVel = -4f;
sparkXVel = 4f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num339 = -2f;
num340 = 6f;
sparkYVel = -2f;
sparkXVel = 6f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num340 = 7f;
sparkXVel = 7f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 = 26f;
sparkXSpawn = 26f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num342 -= 4f;
num341 -= 20f;
sparkXSpawn -= 4f;
sparkYSpawn -= 20f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num341 += 6f;
sparkYSpawn += 6f;
}
if (player.direction == -1)
{
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num342 -= 8f;
sparkXSpawn -= 8f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 -= 6f;
sparkXSpawn -= 6f;
}
}
num339 *= 1.5f;
num340 *= 1.5f;
num342 *= (float)player.direction;
num341 *= player.gravDir;
sparkYVel *= 1.5f;
sparkXVel *= 1.5f;
sparkXSpawn *= (float)player.direction;
sparkYSpawn *= player.gravDir;
var source = player.GetSource_ItemUse(Item);
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(Item.damage * 0.2f);
int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI);
int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + sparkXSpawn, (float)(hitbox.Y + hitbox.Height / 2) + sparkYSpawn, (float)player.direction * sparkXVel, sparkYVel * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI);
if (spark.WithinBounds(Main.maxProjectiles))
Main.projectile[spark].DamageType = DamageClass.Melee;
}
+3 -3
View File
@@ -68,10 +68,10 @@ namespace CalamityMod.Items.TreasureBags
// Weapons
itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[]
{
ModContent.ItemType<AquaticDischarge>(),
ModContent.ItemType<SaharaSlicers>(),
ModContent.ItemType<Barinade>(),
ModContent.ItemType<StormSpray>(),
ModContent.ItemType<SeaboundStaff>(),
ModContent.ItemType<SandstreamScepter>(),
ModContent.ItemType<BrittleStarStaff>(),
ModContent.ItemType<ScourgeoftheDesert>()
}));
Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 3.4 KiB

+14 -14
View File
@@ -59,23 +59,23 @@ namespace CalamityMod.Items.Weapons.Magic
}
else
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num117 = 0.314159274f;
int num118 = 3;
Vector2 vector7 = velocity;
vector7.Normalize();
vector7 *= 80f;
bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0);
for (int num119 = 0; num119 < num118; num119++)
Vector2 laserSpawnPos = player.RotatedRelativePoint(player.MountedCenter, true);
float tenthPi = 0.314159274f;
int laserAmt = 3;
Vector2 laserVelocity = velocity;
laserVelocity.Normalize();
laserVelocity *= 80f;
bool laserHitsTiles = Collision.CanHit(laserSpawnPos, 0, 0, laserSpawnPos + laserVelocity, 0, 0);
for (int i = 0; i < laserAmt; i++)
{
float num120 = (float)num119 - ((float)num118 - 1f) / 2f;
Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default);
if (!flag11)
float laserOffset = (float)i - ((float)laserAmt - 1f) / 2f;
Vector2 offsetSpawnPos = laserVelocity.RotatedBy((double)(tenthPi * laserOffset), default);
if (!laserHitsTiles)
{
value9 -= vector7;
offsetSpawnPos -= laserVelocity;
}
Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X * 1.5f, velocity.Y * 1.5f, type, (int)(damage * 0.8), knockback, player.whoAmI);
int laser = Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X * 2f, velocity.Y * 2f, ProjectileID.LaserMachinegunLaser, (int)(damage * 0.4), knockback * 0.4f, player.whoAmI);
Projectile.NewProjectile(source, laserSpawnPos.X + offsetSpawnPos.X, laserSpawnPos.Y + offsetSpawnPos.Y, velocity.X * 1.5f, velocity.Y * 1.5f, type, (int)(damage * 0.8), knockback, player.whoAmI);
int laser = Projectile.NewProjectile(source, laserSpawnPos.X + offsetSpawnPos.X, laserSpawnPos.Y + offsetSpawnPos.Y, velocity.X * 2f, velocity.Y * 2f, ProjectileID.LaserMachinegunLaser, (int)(damage * 0.4), knockback * 0.4f, player.whoAmI);
Main.projectile[laser].timeLeft = 120;
Main.projectile[laser].tileCollide = false;
}
+28 -28
View File
@@ -39,49 +39,49 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float meteorSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float meteorSpawnXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float meteorSpawnYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
meteorSpawnYPos = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float meteorSpawnDist = (float)Math.Sqrt((double)(meteorSpawnXPos * meteorSpawnXPos + meteorSpawnYPos * meteorSpawnYPos));
if ((float.IsNaN(meteorSpawnXPos) && float.IsNaN(meteorSpawnYPos)) || (meteorSpawnXPos == 0f && meteorSpawnYPos == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
meteorSpawnXPos = (float)player.direction;
meteorSpawnYPos = 0f;
meteorSpawnDist = meteorSpeed;
}
else
{
num80 = num72 / num80;
meteorSpawnDist = meteorSpeed / meteorSpawnDist;
}
int asteroidAmt = 3;
for (int num113 = 0; num113 < asteroidAmt; num113++)
for (int i = 0; i < asteroidAmt; i++)
{
vector2 = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num113);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
meteorSpawnXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X + (float)Main.rand.Next(-40, 41) * 0.03f;
meteorSpawnYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (meteorSpawnYPos < 0f)
{
num79 *= -1f;
meteorSpawnYPos *= -1f;
}
if (num79 < 20f)
if (meteorSpawnYPos < 20f)
{
num79 = 20f;
meteorSpawnYPos = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float num114 = num78;
float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, type, damage, knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f);
meteorSpawnDist = (float)Math.Sqrt((double)(meteorSpawnXPos * meteorSpawnXPos + meteorSpawnYPos * meteorSpawnYPos));
meteorSpawnDist = meteorSpeed / meteorSpawnDist;
meteorSpawnXPos *= meteorSpawnDist;
meteorSpawnYPos *= meteorSpawnDist;
float meteorSpawnXOffset = meteorSpawnXPos;
float meteorSpawnYOffset = meteorSpawnYPos + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, meteorSpawnXOffset * 0.75f, meteorSpawnYOffset * 0.75f, type, damage, knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f);
}
return false;
}
+19 -21
View File
@@ -38,14 +38,12 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
int i = Main.myPlayer;
float num72 = Item.shootSpeed;
int num73 = damage;
float num74 = knockback;
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
int j = Main.myPlayer;
float fangSpeed = Item.shootSpeed;
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
int spikeAmount = 4;
if (Main.rand.NextBool(3))
{
@@ -59,20 +57,20 @@ namespace CalamityMod.Items.Weapons.Magic
{
spikeAmount += 2;
}
for (int num131 = 0; num131 < spikeAmount; num131++)
for (int i = 0; i < spikeAmount; i++)
{
float num132 = num78;
float num133 = num79;
float num134 = 0.05f * (float)num131;
num132 += (float)Main.rand.Next(-400, 400) * num134;
num133 += (float)Main.rand.Next(-400, 400) * num134;
num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133));
num80 = num72 / num80;
num132 *= num80;
num133 *= num80;
float x2 = vector2.X;
float y2 = vector2.Y;
Projectile.NewProjectile(source, x2, y2, num132, num133, ModContent.ProjectileType<AstralachneaFang>(), num73, num74, i, 0f, 0f);
float fangSpawnX = mouseXDist;
float fangSpawnY = mouseYDist;
float offsetDampener = 0.05f * (float)i;
fangSpawnX += (float)Main.rand.Next(-400, 400) * offsetDampener;
fangSpawnY += (float)Main.rand.Next(-400, 400) * offsetDampener;
float fangDistance = (float)Math.Sqrt((double)(fangSpawnX * fangSpawnX + fangSpawnY * fangSpawnY));
fangDistance = fangSpeed / fangDistance;
fangSpawnX *= fangDistance;
fangSpawnY *= fangDistance;
float x2 = realPlayerPos.X;
float y2 = realPlayerPos.Y;
Projectile.NewProjectile(source, x2, y2, fangSpawnX, fangSpawnY, ModContent.ProjectileType<AstralachneaFang>(), damage, knockback, i, 0f, 0f);
}
return false;
}
+15 -15
View File
@@ -35,27 +35,27 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 value2 = new Vector2(num78, num79);
value2.Normalize();
Vector2 value3 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
value3.Normalize();
value2 = value2 * 6f + value3;
value2.Normalize();
value2 *= Item.shootSpeed;
float num91 = (float)Main.rand.Next(10, 50) * 0.001f;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
Vector2 tentacleVelocity = new Vector2(mouseXDist, mouseYDist);
tentacleVelocity.Normalize();
Vector2 tentacleRandVelocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
tentacleRandVelocity.Normalize();
tentacleVelocity = tentacleVelocity * 6f + tentacleRandVelocity;
tentacleVelocity.Normalize();
tentacleVelocity *= Item.shootSpeed;
float tentacleYDirection = (float)Main.rand.Next(10, 50) * 0.001f;
if (Main.rand.NextBool())
{
num91 *= -1f;
tentacleYDirection *= -1f;
}
float num92 = (float)Main.rand.Next(10, 50) * 0.001f;
float tentacleXDirection = (float)Main.rand.Next(10, 50) * 0.001f;
if (Main.rand.NextBool())
{
num92 *= -1f;
tentacleXDirection *= -1f;
}
Projectile.NewProjectile(source, vector2, value2, type, damage, knockback, player.whoAmI, num92, num91);
Projectile.NewProjectile(source, realPlayerPos, tentacleVelocity, type, damage, knockback, player.whoAmI, tentacleXDirection, tentacleYDirection);
return false;
}
+31 -31
View File
@@ -40,57 +40,57 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float bloodSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYPos = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXPos * mouseXPos + mouseYPos * mouseYPos));
if ((float.IsNaN(mouseXPos) && float.IsNaN(mouseYPos)) || (mouseXPos == 0f && mouseYPos == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXPos = (float)player.direction;
mouseYPos = 0f;
mouseDistance = bloodSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = bloodSpeed / mouseDistance;
}
int num107 = 2;
int bloodAmt = 2;
if (Main.rand.NextBool(3))
{
num107++;
bloodAmt++;
}
if (Main.rand.NextBool(3))
{
num107++;
bloodAmt++;
}
for (int num108 = 0; num108 < num107; num108++)
for (int i = 0; i < bloodAmt; i++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num108);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXPos = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYPos = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYPos < 0f)
{
num79 *= -1f;
mouseYPos *= -1f;
}
if (num79 < 20f)
if (mouseYPos < 20f)
{
num79 = 20f;
mouseYPos = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(15));
mouseDistance = (float)Math.Sqrt((double)(mouseXPos * mouseXPos + mouseYPos * mouseYPos));
mouseDistance = bloodSpeed / mouseDistance;
mouseXPos *= mouseDistance;
mouseYPos *= mouseDistance;
float speedX4 = mouseXPos + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = mouseYPos + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(15));
}
return false;
}
+29 -29
View File
@@ -42,28 +42,28 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float projSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = projSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = projSpeed / mouseDistance;
}
int num107 = 3;
for (int num108 = 0; num108 < num107; num108++)
int projAmt = 3;
for (int i = 0; i < projAmt; i++)
{
float damageMult = 1f;
float kbMult = 1f;
@@ -76,26 +76,26 @@ namespace CalamityMod.Items.Weapons.Magic
damageMult = 25f;
kbMult = 1.5f;
}
vector2 = new Vector2(player.Center.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.Center.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num108);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.Center.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.Center.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * damageMult), (int)(knockback * kbMult), player.whoAmI, 0f, (float)Main.rand.Next(15));
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = projSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, (int)(damage * damageMult), (int)(knockback * kbMult), player.whoAmI, 0f, (float)Main.rand.Next(15));
}
return false;
}
+40 -40
View File
@@ -34,66 +34,66 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true);
float num117 = 0.314159274f;
int num118 = 3;
Vector2 vector7 = velocity;
vector7.Normalize();
vector7 *= 60f;
bool flag11 = Collision.CanHit(vector, 0, 0, vector + vector7, 0, 0);
for (int num119 = 0; num119 < num118; num119++)
float tenthPi = 0.314159274f;
int directRainbowAmt = 3;
Vector2 directRainbowVel = velocity;
directRainbowVel.Normalize();
directRainbowVel *= 60f;
bool rainbowHitsTiles = Collision.CanHit(vector, 0, 0, vector + directRainbowVel, 0, 0);
for (int i = 0; i < directRainbowAmt; i++)
{
float num120 = (float)num119 - ((float)num118 - 1f) / 2f;
Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default);
if (!flag11)
float rainbowOffset = (float)i - ((float)directRainbowAmt - 1f) / 2f;
Vector2 offsetSpawnPos = directRainbowVel.RotatedBy((double)(tenthPi * rainbowOffset), default);
if (!rainbowHitsTiles)
{
value9 -= vector7;
offsetSpawnPos -= directRainbowVel;
}
int rainbow = Projectile.NewProjectile(source, vector.X + value9.X, vector.Y + value9.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
int rainbow = Projectile.NewProjectile(source, vector.X + offsetSpawnPos.X, vector.Y + offsetSpawnPos.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
Main.projectile[rainbow].usesLocalNPCImmunity = true;
Main.projectile[rainbow].localNPCHitCooldown = 10;
}
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float skyRainbowSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = skyRainbowSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = skyRainbowSpeed / mouseDistance;
}
for (int num108 = 0; num108 < 2; num108++)
for (int j = 0; j < 2; j++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num108);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * j);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-15, 16) * 0.01f;
float speedY5 = num79 + (float)Main.rand.Next(-15, 16) * 0.01f;
int rainbow2 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI);
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = skyRainbowSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-15, 16) * 0.01f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-15, 16) * 0.01f;
int rainbow2 = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI);
Main.projectile[rainbow2].usesLocalNPCImmunity = true;
Main.projectile[rainbow2].localNPCHitCooldown = 10;
}
+31 -34
View File
@@ -45,56 +45,53 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int i = Main.myPlayer;
float num72 = Item.shootSpeed;
int num73 = damage;
float num74 = knockback;
num74 = player.GetWeaponKnockback(Item, num74);
int j = Main.myPlayer;
float beamSpeed = Item.shootSpeed;
float beamKnockback = knockback;
beamKnockback = player.GetWeaponKnockback(Item, beamKnockback);
player.itemTime = Item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
Vector2 vector3 = Main.MouseWorld - vector2;
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = beamSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = beamSpeed / mouseDistance;
}
int numLasers = 2;
for (int num108 = 0; num108 < numLasers; num108++)
for (int i = 0; i < numLasers; i++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(91) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num108);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(91) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f);
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = beamSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-50, 51) * 0.02f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-50, 51) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, beamKnockback, i, 0f, 0f);
}
return false;
}
+25 -25
View File
@@ -44,47 +44,47 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float spearSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
mouseXDist = (float)player.direction;
}
else
{
num80 = num72 / num80;
mouseDistance = spearSpeed / mouseDistance;
}
int numProjectiles = 5;
for (int i = 0; i < numProjectiles; i++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //-
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200
vector2.Y += (float)(100 * i); //-=
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; //+ -
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; //+ -
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //-
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200
realPlayerPos.Y += (float)(100 * i); //-=
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; //+ -
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; //+ -
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX6 = num78 + (float)Main.rand.Next(-60, 61) * 0.02f;
float speedY7 = num79 + (float)Main.rand.Next(-60, 61) * 0.02f;
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = spearSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX6 = mouseXDist + (float)Main.rand.Next(-60, 61) * 0.02f;
float speedY7 = mouseYDist + (float)Main.rand.Next(-60, 61) * 0.02f;
float ai1 = Main.rand.NextFloat() + 0.5f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX6, -speedY7, type, damage, knockback, player.whoAmI, 0.0f, ai1);
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX6, -speedY7, type, damage, knockback, player.whoAmI, 0.0f, ai1);
}
return false;
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.rare = ItemRarityID.Pink;
Item.UseSound = SoundID.Item13;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<WaterStream>();
Item.shoot = ModContent.ProjectileType<Sandstream>();
Item.shootSpeed = 14f;
}
+26 -26
View File
@@ -41,35 +41,35 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num72 = Item.shootSpeed;
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float projSpeed = Item.shootSpeed;
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
int stardustAmt = 5;
float num132 = num78;
float num133 = num79;
num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133));
num80 = num72 / num80;
num132 *= num80;
num133 *= num80;
float x2 = vector2.X;
float y2 = vector2.Y;
Projectile.NewProjectile(source, x2, y2, num132, num133, ModContent.ProjectileType<IceCluster>(), damage, knockback, player.whoAmI);
float mouseXCopy = mouseXDist;
float mouseYCopy = mouseYDist;
mouseDistance = (float)Math.Sqrt((double)(mouseXCopy * mouseXCopy + mouseYCopy * mouseYCopy));
mouseDistance = projSpeed / mouseDistance;
mouseXCopy *= mouseDistance;
mouseYCopy *= mouseDistance;
float x2 = realPlayerPos.X;
float y2 = realPlayerPos.Y;
Projectile.NewProjectile(source, x2, y2, mouseXCopy, mouseYCopy, ModContent.ProjectileType<IceCluster>(), damage, knockback, player.whoAmI);
for (int i = 0; i < stardustAmt; i++)
{
num132 = num78;
num133 = num79;
float num134 = 0.05f * (float)i;
num132 += (float)Main.rand.Next(-90, 91) * num134;
num133 += (float)Main.rand.Next(-90, 91) * num134;
num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133));
num80 = num72 / num80;
num132 *= num80;
num133 *= num80;
x2 = vector2.X;
y2 = vector2.Y;
Projectile.NewProjectile(source, x2, y2, num132, num133, ModContent.ProjectileType<Starblast>(), damage, knockback, player.whoAmI);
mouseXCopy = mouseXDist;
mouseYCopy = mouseYDist;
float randOffsetDampener = 0.05f * (float)i;
mouseXCopy += (float)Main.rand.Next(-90, 91) * randOffsetDampener;
mouseYCopy += (float)Main.rand.Next(-90, 91) * randOffsetDampener;
mouseDistance = (float)Math.Sqrt((double)(mouseXCopy * mouseXCopy + mouseYCopy * mouseYCopy));
mouseDistance = projSpeed / mouseDistance;
mouseXCopy *= mouseDistance;
mouseYCopy *= mouseDistance;
x2 = realPlayerPos.X;
y2 = realPlayerPos.Y;
Projectile.NewProjectile(source, x2, y2, mouseXCopy, mouseYCopy, ModContent.ProjectileType<Starblast>(), damage, knockback, player.whoAmI);
}
return false;
}
+17 -18
View File
@@ -36,31 +36,30 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int i = Main.myPlayer;
int num73 = damage;
float num74 = knockback;
num74 = player.GetWeaponKnockback(Item, num74);
float playerKnockback = knockback;
playerKnockback = player.GetWeaponKnockback(Item, playerKnockback);
player.itemTime = Item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 value2 = new Vector2(num78, num79);
value2.Normalize();
Vector2 value3 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
value3.Normalize();
value2 = value2 * 4f + value3;
value2.Normalize();
value2 *= Item.shootSpeed;
float num91 = (float)Main.rand.Next(10, 80) * 0.001f;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
Vector2 tentacleVelocity = new Vector2(mouseXDist, mouseYDist);
tentacleVelocity.Normalize();
Vector2 tentacleRandVelocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
tentacleRandVelocity.Normalize();
tentacleVelocity = tentacleVelocity * 4f + tentacleRandVelocity;
tentacleVelocity.Normalize();
tentacleVelocity *= Item.shootSpeed;
float tentacleYDirection = (float)Main.rand.Next(10, 80) * 0.001f;
if (Main.rand.NextBool())
{
num91 *= -1f;
tentacleYDirection *= -1f;
}
float num92 = (float)Main.rand.Next(10, 80) * 0.001f;
float tentacleXDirection = (float)Main.rand.Next(10, 80) * 0.001f;
if (Main.rand.NextBool())
{
num92 *= -1f;
tentacleXDirection *= -1f;
}
Projectile.NewProjectile(source, vector2, value2, ModContent.ProjectileType<EldritchTentacle>(), num73, num74, i, num92, num91);
Projectile.NewProjectile(source, realPlayerPos, tentacleVelocity, ModContent.ProjectileType<EldritchTentacle>(), damage, playerKnockback, i, tentacleXDirection, tentacleYDirection);
return false;
}
}
+15 -15
View File
@@ -46,33 +46,33 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = Item.shootSpeed;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = Item.shootSpeed;
}
else
{
num80 = Item.shootSpeed / num80;
mouseDistance = Item.shootSpeed / mouseDistance;
}
vector += new Vector2(num78, num79);
realPlayerPos += new Vector2(mouseXDist, mouseYDist);
int numProjectiles = 5;
for (int i = 0; i < numProjectiles; i++)
{
vector.X += (float)Main.rand.Next(-100, 101);
vector.Y += (float)(Main.rand.Next(-25, 26) * i);
float spawnX = vector.X;
float spawnY = vector.Y;
realPlayerPos.X += (float)Main.rand.Next(-100, 101);
realPlayerPos.Y += (float)(Main.rand.Next(-25, 26) * i);
float spawnX = realPlayerPos.X;
float spawnY = realPlayerPos.Y;
Projectile.NewProjectile(source, spawnX, spawnY, 0f, 0f, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(3));
}
return false;
+1 -2
View File
@@ -36,10 +36,9 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f);
int num6 = 3;
float SpeedX = velocity.X + (float)Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = velocity.Y + (float)Main.rand.Next(-20, 21) * 0.05f;
for (int index = 0; index < num6; ++index)
for (int index = 0; index < 3; ++index)
{
int projectile = Projectile.NewProjectile(source, position.X, position.Y, SpeedX * 1.05f, SpeedY * 1.05f, ProjectileID.LaserMachinegunLaser, (int)(damage * 0.65), knockback * 0.6f, player.whoAmI, 0f, 0f);
Main.projectile[projectile].timeLeft = 120;
+28 -29
View File
@@ -39,49 +39,48 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = velocity.Length();
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y;
float projSpeed = velocity.Length();
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X + realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y + realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = projSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = projSpeed / mouseDistance;
}
int num130 = 4;
for (int num131 = 0; num131 < num130; num131++)
for (int i = 0; i < 4; i++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num131);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, 0f);
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = projSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-40, 41) * 0.02f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, 0f);
}
return false;
}
+4 -4
View File
@@ -46,10 +46,10 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
vector2.X = Main.mouseX + Main.screenPosition.X;
vector2.Y = Main.mouseY + Main.screenPosition.Y;
Projectile.NewProjectile(source, vector2, Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 0f);
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
realPlayerPos.X = Main.mouseX + Main.screenPosition.X;
realPlayerPos.Y = Main.mouseY + Main.screenPosition.Y;
Projectile.NewProjectile(source, realPlayerPos, Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 0f);
CalamityGlobalItem.ConsumeAdditionalAmmo(player, Item, 2);
+30 -31
View File
@@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Magic
Item.damage = 10;
Item.DamageType = DamageClass.Magic;
Item.mana = 6;
Item.width = 44;
Item.height = 44;
Item.width = 38;
Item.height = 42;
Item.useTime = 7;
Item.useAnimation = 14;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -40,49 +40,48 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int i = Main.myPlayer;
float num72 = velocity.Length();
int num73 = damage;
float num74 = knockback;
num74 = player.GetWeaponKnockback(Item, num74);
float icicleSpeed = velocity.Length();
float playerKnockback = knockback;
playerKnockback = player.GetWeaponKnockback(Item, playerKnockback);
player.itemTime = Item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX - Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY - Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = icicleSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = icicleSpeed / mouseDistance;
}
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78;
float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType<IcicleStaffProj>(), num73, num74, i, 0f, (float)Main.rand.Next(10));
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = icicleSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist;
float speedY5 = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<IcicleStaffProj>(), damage, playerKnockback, i, 0f, (float)Main.rand.Next(10));
return false;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 571 B

+15 -15
View File
@@ -44,29 +44,29 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num72 = Item.shootSpeed;
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float projSpeed = Item.shootSpeed;
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
float f = Main.rand.NextFloat() * MathHelper.TwoPi;
float value12 = 20f;
float value13 = 60f;
Vector2 vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat());
for (int num202 = 0; num202 < 50; num202++)
float lowerLerpValue = 20f;
float upperLerpValue = 60f;
Vector2 projSpawnOffset = realPlayerPos + f.ToRotationVector2() * MathHelper.Lerp(lowerLerpValue, upperLerpValue, Main.rand.NextFloat());
for (int i = 0; i < 50; i++)
{
vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat());
if (Collision.CanHit(vector2, 0, 0, vector13 + (vector13 - vector2).SafeNormalize(Vector2.UnitX) * 8f, 0, 0))
projSpawnOffset = realPlayerPos + f.ToRotationVector2() * MathHelper.Lerp(lowerLerpValue, upperLerpValue, Main.rand.NextFloat());
if (Collision.CanHit(realPlayerPos, 0, 0, projSpawnOffset + (projSpawnOffset - realPlayerPos).SafeNormalize(Vector2.UnitX) * 8f, 0, 0))
{
break;
}
f = Main.rand.NextFloat() * MathHelper.TwoPi;
}
Vector2 mouseWorld = Main.MouseWorld;
Vector2 vector14 = mouseWorld - vector13;
Vector2 vector15 = new Vector2(num78, num79).SafeNormalize(Vector2.UnitY) * num72;
vector14 = vector14.SafeNormalize(vector15) * num72;
vector14 = Vector2.Lerp(vector14, vector15, 0.25f);
Projectile.NewProjectile(source, vector13, vector14, type, damage, knockback, player.whoAmI, 0f, 0f);
Vector2 projSpawnPos = mouseWorld - projSpawnOffset;
Vector2 projVelocity = new Vector2(mouseXDist, mouseYDist).SafeNormalize(Vector2.UnitY) * projSpeed;
projSpawnPos = projSpawnPos.SafeNormalize(projVelocity) * projSpeed;
projSpawnPos = Vector2.Lerp(projSpawnPos, projVelocity, 0.25f);
Projectile.NewProjectile(source, projSpawnOffset, projSpawnPos, type, damage, knockback, player.whoAmI, 0f, 0f);
return false;
}
+10 -10
View File
@@ -39,17 +39,17 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int num106 = 2 + Main.rand.Next(3);
for (int num107 = 0; num107 < num106; num107++)
int projAmt = 2 + Main.rand.Next(3);
for (int i = 0; i < projAmt; i++)
{
float num110 = 0.025f * (float)num107;
velocity.X += (float)Main.rand.Next(-35, 36) * num110;
velocity.Y += (float)Main.rand.Next(-35, 36) * num110;
float num84 = velocity.Length();
num84 = Item.shootSpeed / num84;
velocity.X *= num84;
velocity.Y *= num84;
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, (float)Main.rand.Next(0, 10 * (num107 + 1)), 0f);
float randVelocityDampener = 0.025f * (float)i;
velocity.X += (float)Main.rand.Next(-35, 36) * randVelocityDampener;
velocity.Y += (float)Main.rand.Next(-35, 36) * randVelocityDampener;
float projDistance = velocity.Length();
projDistance = Item.shootSpeed / projDistance;
velocity.X *= projDistance;
velocity.Y *= projDistance;
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, (float)Main.rand.Next(0, 10 * (i + 1)), 0f);
Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, damage, knockback, player.whoAmI);
}
return false;
+31 -31
View File
@@ -40,58 +40,58 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
float flameSpeed = Item.shootSpeed;
player.itemTime = Item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = flameSpeed;
}
else
{
num80 = num72 / num80;
mouseDistance = flameSpeed / mouseDistance;
}
int num107 = 30;
int flameAmt = 30;
if (Main.rand.NextBool(3))
{
num107++;
flameAmt++;
}
if (Main.rand.NextBool(3))
{
num107++;
flameAmt++;
}
for (int num108 = 0; num108 < num107; num108++)
for (int i = 0; i < flameAmt; i++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= (float)(100 * num108);
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
num79 *= -1f;
mouseYDist *= -1f;
}
if (num79 < 20f)
if (mouseYDist < 20f)
{
num79 = 20f;
mouseYDist = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(15));
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = flameSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(15));
}
return false;
}
@@ -7,7 +7,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class StormSpray : ModItem, ILocalizedModType
[LegacyName("StormSpray")]
public class SandstreamScepter : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetStaticDefaults()
@@ -17,27 +18,27 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
Item.damage = 14;
Item.damage = 16;
Item.DamageType = DamageClass.Magic;
Item.mana = 8;
Item.width = 42;
Item.height = 42;
Item.useTime = 33;
Item.useAnimation = 33;
Item.mana = 4;
Item.width = 46;
Item.height = 40;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2f;
Item.knockBack = 1f;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item13;
Item.UseSound = SoundID.Item72;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<WaterStream>();
Item.shootSpeed = 10f;
Item.shoot = ModContent.ProjectileType<Sandstream>();
Item.shootSpeed = 11f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0.0f, 0.0f);
Projectile.NewProjectile(source, position + velocity * 5, velocity, type, damage, knockback, player.whoAmI, 0.0f, 0.0f);
return false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

+13 -13
View File
@@ -34,31 +34,31 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int owner = player.whoAmI;
float num72 = Item.shootSpeed;
float projSpeed = Item.shootSpeed;
player.itemTime = Item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
Vector2 vector3 = Main.MouseWorld - vector2;
float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
Vector2 projRotation = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
Vector2 projSpawnPos = Main.MouseWorld - realPlayerPos;
float velX = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float velY = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
velY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
velY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float dist = (float)Math.Sqrt((double)(velX * velX + velY * velY));
if ((float.IsNaN(velX) && float.IsNaN(velY)) || (velX == 0f && velY == 0f))
{
velX = (float)player.direction;
velY = 0f;
dist = num72;
dist = projSpeed;
}
else
{
dist = num72 / dist;
dist = projSpeed / dist;
}
float num77 = Vector2.Dot(value, vector3);
if (num77 > 0f)
float projDirection = Vector2.Dot(projRotation, projSpawnPos);
if (projDirection > 0f)
{
player.ChangeDir(1);
}
@@ -68,8 +68,8 @@ namespace CalamityMod.Items.Weapons.Magic
}
//velX = 0f;
//velY = 0f;
//vector2.X = (float)Main.mouseX + Main.screenPosition.X;
//vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
//realPlayerPos.X = (float)Main.mouseX + Main.screenPosition.X;
//realPlayerPos.Y = (float)Main.mouseY + Main.screenPosition.Y;
int curr = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<SerpentineHead>(), damage, knockback, owner);
int prev = curr;
+2 -2
View File
@@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int num6 = Main.rand.Next(1, 3);
for (int index = 0; index < num6; ++index)
int projAmt = Main.rand.Next(1, 3);
for (int index = 0; index < projAmt; ++index)
{
float SpeedX = velocity.X + Main.rand.Next(-40, 41) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-40, 41) * 0.05f;
Loaded 100 of 435 files, more files were not shown because too many files have changed in this diff. Show more