This commit is contained in:
Heart-Plus-Up committed 2023-01-23 21:42:26 -07:00
commit 48ea2c3db9
15 files changed
+252 -43

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+42
View File
@@ -0,0 +1,42 @@
using CalamityMod.Projectiles.Ranged;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Ammo
{
public class MarksmanRound : ModItem
{
public override void SetStaticDefaults()
{
SacrificeTotal = 99;
DisplayName.SetDefault("Marksman Round");
Tooltip.SetDefault("A carefully crafted round which can be ricocheted off of midair coins\nAny gun firing this bullet can perform Ricoshots with coins tossed using Midas Prime");
}
public override void SetDefaults()
{
Item.damage = 12;
Item.DamageType = DamageClass.Ranged;
Item.width = 12;
Item.height = 26;
Item.maxStack = 999;
Item.consumable = true;
Item.knockBack = 2.25f;
Item.value = Item.sellPrice(copper: 10);
Item.rare = ItemRarityID.LightRed;
Item.shoot = ModContent.ProjectileType<MidasBlast>();
Item.shootSpeed = 1f;
Item.ammo = AmmoID.Bullet;
}
public override void AddRecipes()
{
CreateRecipe(999).
AddIngredient(ItemID.GoldenBullet, 999).
AddIngredient(ItemID.GoldCoin).
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+2 -7
View File
@@ -5,7 +5,6 @@ using CalamityMod.Sounds;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -57,14 +56,10 @@ namespace CalamityMod.Items.Weapons.Ranged
Register();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
if (type == ProjectileID.Bullet)
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<AMRShot>(), damage, knockback, player.whoAmI);
else
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
return false;
type = ModContent.ProjectileType<AMRShot>();
}
}
}
+4 -5
View File
@@ -5,7 +5,6 @@ using CalamityMod.Sounds;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
DisplayName.SetDefault("Tyranny's End");
Tooltip.SetDefault("Pierce the heart of even the most heavily-armored foe\n" +
"Fires a .70 caliber sniper round that bypasses enemy defense and DR\n" +
"Converts musket balls into .70 caliber sniper rounds that bypass enemy defense and DR\n" +
"Rounds mark enemies for death and summon a swarm of additional bullets on crits");
SacrificeTotal = 1;
}
@@ -61,10 +60,10 @@ namespace CalamityMod.Items.Weapons.Ranged
Register();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<PiercingBullet>(), damage, knockback, player.whoAmI, 0f, 0f);
return false;
if (type == ProjectileID.Bullet)
type = ModContent.ProjectileType<PiercingBullet>();
}
}
}
+2 -2
View File
@@ -35,8 +35,8 @@ namespace CalamityMod.NPCs.AstrumAureus
public class AstrumAureus : ModNPC
{
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/AureusHit", 4);
public static readonly SoundStyle StompSound = new("CalamityMod/Sounds/Custom/LegStomp");
public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/AureusJump");
public static readonly SoundStyle StompSound = new("CalamityMod/Sounds/Custom/AstrumAureus/LegStomp");
public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/AstrumAureus/AureusJump");
private bool stomping = false;
public int slimeProjCounter = 0;
+1 -1
View File
@@ -236,7 +236,7 @@ namespace CalamityMod.NPCs.AstrumAureus
spriteEffects = SpriteEffects.FlipHorizontally;
if (NPC.ai[0] >= 60f)
NPC.DrawBackglow(Color.Lerp(Color.Cyan, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 1f) with { A = 0 }, 2f + 8f * ((float)Math.Sin(Main.GlobalTimeWrappedHourly * (float)Math.PI * 2f) + 1f), spriteEffects, NPC.frame, screenPos);
NPC.DrawBackglow(Color.Lerp(Color.Cyan, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 1f) with { A = 0 }, 2f + 8f * ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f), spriteEffects, NPC.frame, screenPos);
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
@@ -92,6 +92,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
writer.Write(spearType);
writer.Write(healTimer);
writer.Write(biomeEnrageTimer);
writer.Write(NPC.localAI[1]);
writer.Write(NPC.localAI[2]);
}
public override void ReceiveExtraAI(BinaryReader reader)
@@ -99,6 +101,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
spearType = reader.ReadInt32();
healTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
NPC.localAI[1] = reader.ReadSingle();
NPC.localAI[2] = reader.ReadSingle();
}
public override void FindFrame(int frameHeight)
@@ -302,7 +306,35 @@ namespace CalamityMod.NPCs.ProfanedGuardians
bool biomeEnraged = biomeEnrageTimer <= 0;
bool phase1 = healerAlive || defenderAlive;
if (!phase1)
{
// Spawn particles when the defender dies to indicate the shield has broken apart
if (NPC.localAI[2] == 0f)
{
// Star Wrath use sound and dust circles
NPC.localAI[2] += 1f;
SoundEngine.PlaySound(SoundID.Item105, NPC.Center);
int shieldRings = 4;
int totalDust = 36;
for (int j = 0; j < shieldRings; j++)
{
for (int k = 0; k < totalDust; k++)
{
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(320f, 320f);
dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center;
Vector2 dustVelocity = dustSpawnPos - NPC.Center;
Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.OrangeRed).X, 1f, 0.5f);
dustColor.A = 255;
int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, 267, dustVelocity.X, dustVelocity.Y, 0, dustColor, 1.4f);
Main.dust[dust].noGravity = true;
Main.dust[dust].noLight = true;
Main.dust[dust].velocity = dustVelocity * (j * 0.1f + 0.1f);
}
}
}
}
float inertia = (bossRush || biomeEnraged) ? 50f : death ? 60f : revenge ? 65f : expertMode ? 70f : 80f;
if (lifeRatio < 0.5f)
inertia *= 0.8f;
@@ -352,11 +384,19 @@ namespace CalamityMod.NPCs.ProfanedGuardians
// Alternate between firing profaned spears and holy fire
NPC.ai[3] += 1f;
float projectileShootGateValue = (bossRush || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f;
if (healerAlive)
projectileShootGateValue *= 2;
if (NPC.ai[3] % projectileShootGateValue == 0f)
{
bool shootSpears = NPC.ai[3] % (projectileShootGateValue * 2f) == 0f;
float spearVelocity = (bossRush || biomeEnraged) ? 11f : death ? 10f : revenge ? 9.5f : expertMode ? 9f : 8f;
Vector2 finalSpearVelocity = Vector2.Normalize(player.Center - shootFrom) * spearVelocity;
int totalDustPerProjectile = 15;
for (int k = 0; k < totalDustPerProjectile; k++)
Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, finalSpearVelocity.X, finalSpearVelocity.Y, 0, default, 1f);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int type = shootSpears ? ModContent.ProjectileType<ProfanedSpear>() : ModContent.ProjectileType<HolyFire>();
@@ -370,7 +410,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians
for (int i = 0; i < baseProjectileAmt; i++)
{
Vector2 perturbedSpeed = finalSpearVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(baseProjectileAmt - 1)));
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
for (int k = 0; k < totalDustPerProjectile; k++)
Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, perturbedSpeed.X, perturbedSpeed.Y, 0, default, 1f);
Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, type, damage, 0f, Main.myPlayer);
}
}
}
@@ -488,6 +532,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
Vector2 drawPos = NPC.Center - screenPos;
Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
@@ -510,7 +555,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
}
Vector2 vector43 = NPC.Center - screenPos;
Vector2 vector43 = drawPos;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
@@ -540,6 +585,60 @@ namespace CalamityMod.NPCs.ProfanedGuardians
spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
bool defenderAlive = false;
bool healerAlive = false;
if (CalamityGlobalNPC.doughnutBossDefender != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBossDefender].active)
defenderAlive = true;
}
if (CalamityGlobalNPC.doughnutBossHealer != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].active)
healerAlive = true;
}
// Draw shields while healer or defender are alive
if (defenderAlive || healerAlive)
{
float maxOscillation = 60f;
float minScale = 0.8f;
float maxPulseScale = 1f - minScale;
float minOpacity = 0.5f;
float maxOpacityScale = 1f - minOpacity;
float currentOscillation = MathHelper.Lerp(0f, maxOscillation, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi) + 1f) * 0.5f);
float shieldOpacity = minOpacity + maxOpacityScale * Utils.Remap(currentOscillation, 0f, maxOscillation, 1f, 0f);
float oscillationRatio = currentOscillation / maxOscillation;
float invertedOscillationRatio = 1f - (1f - oscillationRatio) * (1f - oscillationRatio);
float oscillationScale = 1f - (1f - invertedOscillationRatio) * (1f - invertedOscillationRatio);
float remappedOscillation = Utils.Remap(currentOscillation, maxOscillation - 15f, maxOscillation, 0f, 1f);
float twoOscillationsMultipliedTogetherForScaleCalculation = remappedOscillation * remappedOscillation;
float invertedOscillationUsedForScale = MathHelper.Lerp(minScale, 1f, 1f - twoOscillationsMultipliedTogetherForScaleCalculation);
float shieldScale = (minScale + maxPulseScale * oscillationScale) * invertedOscillationUsedForScale;
float smallerRemappedOscillation = Utils.Remap(currentOscillation, 20f, maxOscillation, 0f, 1f);
float invertedSmallerOscillationRatio = 1f - (1f - smallerRemappedOscillation) * (1f - smallerRemappedOscillation);
float smallerOscillationScale = 1f - (1f - invertedSmallerOscillationRatio) * (1f - invertedSmallerOscillationRatio);
float shieldScale2 = (minScale + maxPulseScale * smallerOscillationScale) * invertedOscillationUsedForScale;
Texture2D shieldTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value;
Rectangle shieldFrame = shieldTexture.Frame();
Vector2 origin = shieldFrame.Size() * 0.5f;
Vector2 shieldDrawPos = NPC.Center - screenPos;
shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f;
shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
float minHue = (defenderAlive && healerAlive) ? 0.18f : 0.06f;
float maxHue = minHue + 0.12f;
Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity;
Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity;
color2.A = 0;
color *= 0.6f;
color2 *= 0.6f;
float scaleMult = 3f;
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f);
}
return false;
}
@@ -591,9 +690,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f);
}
if (NPC.life <= 0)
{
if (Main.netMode != NetmodeID.Server)
@@ -603,10 +701,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("ProfanedGuardianBossA3").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("ProfanedGuardianBossA4").Type, 1f);
}
for (int k = 0; k < 50; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f);
}
}
}
}
@@ -11,6 +11,8 @@ using System.IO;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.Drawing;
using Terraria.Graphics.Renderers;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
@@ -85,6 +87,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
writer.Write(healTimer);
writer.Write(biomeEnrageTimer);
writer.Write(NPC.localAI[0]);
writer.Write(NPC.localAI[1]);
}
public override void ReceiveExtraAI(BinaryReader reader)
@@ -92,6 +95,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
healTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
NPC.localAI[0] = reader.ReadSingle();
NPC.localAI[1] = reader.ReadSingle();
}
public override void FindFrame(int frameHeight)
@@ -255,7 +259,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
int rockRings = 3;
int totalRocksPerRing = maxRocks / rockRings;
int spacing = 360 / totalRocksPerRing;
int distance2 = 80;
int distance2 = 200;
bool justSpawnedRocks = false;
if (NPC.localAI[0] == 0f || respawnRocksInPhase2)
{
@@ -300,6 +304,34 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
}
// Spawn particles when the healer dies to indicate the shield has broken apart
else
{
if (NPC.localAI[1] == 0f)
{
// Star Wrath use sound and dust circles
NPC.localAI[1] += 1f;
SoundEngine.PlaySound(SoundID.Item105, NPC.Center);
int shieldRings = 4;
int totalDust = 36;
for (int j = 0; j < shieldRings; j++)
{
for (int k = 0; k < totalDust; k++)
{
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(320f, 320f);
dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center;
Vector2 dustVelocity = dustSpawnPos - NPC.Center;
Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.OrangeRed).X, 1f, 0.5f);
dustColor.A = 255;
int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, 267, dustVelocity.X, dustVelocity.Y, 0, dustColor, 1.4f);
Main.dust[dust].noGravity = true;
Main.dust[dust].noLight = true;
Main.dust[dust].velocity = dustVelocity * (j * 0.1f + 0.1f);
}
}
}
}
// Spawn three dust circles and play noise whenever rock shields are spawned
if (justSpawnedRocks)
{
@@ -310,7 +342,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
for (int k = 0; k < totalDust; k++)
{
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(80f, 160f) * 0.75f;
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(distance2, distance2);
dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center;
Vector2 dustVelocity = dustSpawnPos - NPC.Center;
Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.Orange).X, 1f, 0.5f);
@@ -371,10 +403,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
// Lay a holy bomb every once in a while in phase 1
float projectileShootGateValue = (bossRush || biomeEnraged) ? 360f : death ? 400f : revenge ? 420f : expertMode ? 440f : 480f;
float projectileShootGateValue = (bossRush || biomeEnraged) ? 480f : death ? 520f : revenge ? 540f : expertMode ? 560f : 600f;
NPC.ai[1] += 1f;
if (NPC.ai[1] >= projectileShootGateValue)
{
NPC.ai[1] = 0f;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float projectileVelocityY = NPC.velocity.Y;
@@ -513,7 +546,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
int totalDust = 36;
for (int k = 0; k < totalDust; k++)
{
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(80f, 160f) * 0.75f;
Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(160f, 160f);
dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + shootFrom;
Vector2 dustVelocity = dustSpawnPos - shootFrom;
int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, (int)CalamityDusts.ProfanedFire, dustVelocity.X, dustVelocity.Y, 0, default, 1f);
@@ -603,6 +636,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
Vector2 drawPos = NPC.Center - screenPos;
Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
@@ -625,7 +659,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
}
Vector2 vector43 = NPC.Center - screenPos;
Vector2 vector43 = drawPos;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
@@ -655,6 +689,54 @@ namespace CalamityMod.NPCs.ProfanedGuardians
spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
bool healerAlive = false;
if (CalamityGlobalNPC.doughnutBossHealer != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].active)
healerAlive = true;
}
// Draw shields while healer is alive
if (healerAlive)
{
float maxOscillation = 60f;
float minScale = 0.8f;
float maxPulseScale = 1f - minScale;
float minOpacity = 0.5f;
float maxOpacityScale = 1f - minOpacity;
float currentOscillation = MathHelper.Lerp(0f, maxOscillation, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi) + 1f) * 0.5f);
float shieldOpacity = minOpacity + maxOpacityScale * Utils.Remap(currentOscillation, 0f, maxOscillation, 1f, 0f);
float oscillationRatio = currentOscillation / maxOscillation;
float invertedOscillationRatio = 1f - (1f - oscillationRatio) * (1f - oscillationRatio);
float oscillationScale = 1f - (1f - invertedOscillationRatio) * (1f - invertedOscillationRatio);
float remappedOscillation = Utils.Remap(currentOscillation, maxOscillation - 15f, maxOscillation, 0f, 1f);
float twoOscillationsMultipliedTogetherForScaleCalculation = remappedOscillation * remappedOscillation;
float invertedOscillationUsedForScale = MathHelper.Lerp(minScale, 1f, 1f - twoOscillationsMultipliedTogetherForScaleCalculation);
float shieldScale = (minScale + maxPulseScale * oscillationScale) * invertedOscillationUsedForScale;
float smallerRemappedOscillation = Utils.Remap(currentOscillation, 20f, maxOscillation, 0f, 1f);
float invertedSmallerOscillationRatio = 1f - (1f - smallerRemappedOscillation) * (1f - smallerRemappedOscillation);
float smallerOscillationScale = 1f - (1f - invertedSmallerOscillationRatio) * (1f - invertedSmallerOscillationRatio);
float shieldScale2 = (minScale + maxPulseScale * smallerOscillationScale) * invertedOscillationUsedForScale;
Texture2D shieldTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value;
Rectangle shieldFrame = shieldTexture.Frame();
Vector2 origin = shieldFrame.Size() * 0.5f;
Vector2 shieldDrawPos = NPC.Center - screenPos;
shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f;
shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
float minHue = 0.06f;
float maxHue = 0.18f;
Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity;
Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity;
color2.A = 0;
color *= 0.6f;
color2 *= 0.6f;
float scaleMult = 3f;
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f);
spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f);
}
return false;
}
@@ -692,9 +774,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f);
}
if (NPC.life <= 0)
{
if (Main.netMode != NetmodeID.Server)
@@ -704,10 +785,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("ProfanedGuardianBossT3").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("ProfanedGuardianBossT4").Type, 1f);
}
for (int k = 0; k < 50; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f);
}
}
}
}
+3 -4
View File
@@ -8,7 +8,6 @@ using System;
using System.IO;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
using Terraria.ModLoader;
@@ -19,9 +18,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
private int invinceTime = 180;
private bool start = true;
private const double MinDistance = 80D;
private const double MinDistance = 200D;
private double distance = MinDistance;
private const double MinMaxDistance = 320D;
private const double MinMaxDistance = 300D;
public const int MaxHP = 12000;
public const int MaxBossRushHP = 20000;
@@ -252,7 +251,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
// Distance from Defender Guardian
double maxDistance = bossRush ? 380D : death ? 360D : revenge ? 350D : expertMode ? 340D : MinMaxDistance;
double maxDistance = bossRush ? 360D : death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance;
double rateOfChangeIncrease = (maxDistance / MinMaxDistance) - 1D;
double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease;
if (NPC.Calamity().newAI[0] == 0f)
+1 -1
View File
@@ -1525,7 +1525,7 @@ namespace CalamityMod.NPCs.Providence
int circleDustSpawned = 0;
for (int k = 0; k < totalDust; k++)
{
Vector2 dustSpawnPos = Vector2.Normalize(NPC.velocity) * new Vector2(80f, 160f) * 0.75f;
Vector2 dustSpawnPos = Vector2.Normalize(NPC.velocity) * new Vector2(80f, 160f);
dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + dustLineEnd;
Vector2 dustVelocity = dustSpawnPos - dustLineEnd;
Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(circleDustSpawned * 7.08f)))).X, 1f, 0.5f);
+2 -4
View File
@@ -48,11 +48,11 @@ namespace CalamityMod.Projectiles.Boss
Projectile.ai[1] = 1f;
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
}
Projectile.alpha -= (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 10 : 5;
if (Projectile.alpha <= 0)
{
Projectile.Kill();
}
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
@@ -60,9 +60,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.frameCounter = 0;
}
if (Projectile.frame > 3)
{
Projectile.frame = 0;
}
}
public override Color? GetAlpha(Color lightColor)
+1 -2
View File
@@ -1,6 +1,5 @@
using System;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -21,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Blast");
DisplayName.SetDefault("Crack Shot");
ProjectileID.Sets.TrailCacheLength[Projectile.type] = TrailLenght;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 4000;
+1 -1
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Blast");
DisplayName.SetDefault("Marksman Shot");
ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 4000;
}
File renamed without changes.