Merge Ben's bug fixes and suggestions

This commit is contained in:
Cameron Ewell authored and GitHub committed 2021-11-11 16:50:41 -05:00
commit e462d9ff83
27 files changed
+89 -106

No files matched your search

+3 -19
View File
@@ -2720,24 +2720,6 @@ namespace CalamityMod.CalPlayer
//Overriding 1.4's ass req boosts
if (Main.snowTiles > 300)
player.ZoneSnow = true;
Mod fargos = CalamityMod.Instance.fargos;
if (fargos != null)
{
//Fargo's fountain effects
if (Main.fountainColor == CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "SunkenSeaWater").Type)
{
ZoneSunkenSea = true;
}
if (Main.fountainColor == CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "SulphuricWater").Type)
{
ZoneSulphur = true;
}
if (Main.fountainColor == CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "AstralWater").Type)
{
ZoneAstral = true;
}
}
}
public override bool CustomBiomesMatch(Player other)
@@ -2862,7 +2844,7 @@ namespace CalamityMod.CalPlayer
}
if (CalamityMod.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == player.whoAmI)
{
if (!player.chaosState)
if (!player.CCed && !player.chaosState)
{
Vector2 teleportLocation;
teleportLocation.X = (float)Main.mouseX + Main.screenPosition.X;
@@ -10899,6 +10881,8 @@ namespace CalamityMod.CalPlayer
light += underwater ? 2 : 1;
if (player.petFlagDD2Ghost)
light += 2;
if (littleLightPet)
light += 3;
if (sirenPet)
light += underwater ? 3 : 1;
if (player.wisp)
+1 -1
View File
@@ -428,7 +428,7 @@ namespace CalamityMod.CalPlayer
for (int i = 0; i < Main.maxNPCs; i++)
{
NPC target = Main.npc[i];
if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage)
if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC)
continue;
// Brighten the sigil because it is dealing damage. This can only happen once per hit event.
@@ -44,6 +44,7 @@ namespace CalamityMod.Items.Accessories
"Explosions or large projectiles cannot strike bullseyes\n" +
"Converts all ranged critical strike chance boosts into extra critical strike damage\n" +
"All ranged weapons will deal even more critical strike damage the slower they are\n" +
"Summons a heroic spirit from another world if accessory visibility is enabled\n" +
"'A strand of a lost cosmos remains, waiting for its master'");
}
+4 -29
View File
@@ -62,9 +62,6 @@ namespace CalamityMod.Items
if (item.type < ItemID.Count)
return;
// Adds tooltips to Calamity fountains which match Fargo's fountain tooltips.
FargoFountainTooltip(item, tooltips);
// Adds a Current Charge tooltip to all items which use charge.
CalamityGlobalItem modItem = item.Calamity();
if (modItem?.UsesCharge ?? false)
@@ -520,8 +517,10 @@ namespace CalamityMod.Items
if (item.type == ItemID.MonkShirt)
EditTooltipByNum(0, (line) => line.text = "10% increased minion and melee damage");
if (item.type == ItemID.MonkPants)
EditTooltipByNum(0, (line) => line.text = "5% increased minion damage and melee critical strike chance\n" +
"20% increased movement speed");
{
EditTooltipByNum(0, (line) => line.text = "5% increased minion damage and melee critical strike chance");
EditTooltipByNum(1, (line) => line.text = "20% increased movement speed");
}
// Huntress armor
if (item.type == ItemID.HuntressJerkin)
@@ -1078,30 +1077,6 @@ namespace CalamityMod.Items
}
#endregion
#region Fargo Biome Fountain Tooltip
private void FargoFountainTooltip(Item item, IList<TooltipLine> tooltips)
{
if (CalamityMod.Instance.fargos is null)
return;
if (item.type == ModContent.ItemType<SunkenSeaFountain>())
{
TooltipLine line = new TooltipLine(mod, "FargoFountain", "Forces surrounding biome state to Sunken Sea upon activation");
tooltips.Add(line);
}
if (item.type == ModContent.ItemType<SulphurousFountainItem>())
{
TooltipLine line = new TooltipLine(mod, "FargoFountain", "Forces surrounding biome state to Sulphurous Sea upon activation");
tooltips.Add(line);
}
if (item.type == ModContent.ItemType<AstralFountainItem>())
{
TooltipLine line = new TooltipLine(mod, "FargoFountain", "Forces surrounding biome state to Astral upon activation");
tooltips.Add(line);
}
}
#endregion
#region Schematic Knowledge Tooltip Utility
public static void InsertKnowledgeTooltip(List<TooltipLine> tooltips, int tier, bool allowOldWorlds = false)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 410 B

+2 -1
View File
@@ -11,6 +11,7 @@ namespace CalamityMod.Items.Mounts
DisplayName.SetDefault("Exo Box");
Tooltip.SetDefault("Materializes a quite cozy and extremely nimble flying Exo throne\n" +
"Replaced\n" +
"And hold JUMP to move much slower\n" +
"A comfortable gamer is a dangerous gamer");
}
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Mounts
foreach (TooltipLine line2 in list)
{
if (line2.mod == "Terraria" && line2.Name == "Tooltip1")
line2.text = $"Hold {hotkey} while sitting in the throne to move much faster\n";
line2.text = $"Hold {hotkey} while sitting in the throne to move much faster";
}
}
}
+2 -1
View File
@@ -12,7 +12,8 @@ namespace CalamityMod.Items.Pets
{
DisplayName.SetDefault("Little Light");
Tooltip.SetDefault("It's been looking for you for a long time.\n" +
"Summons a small construct that follows you and provides a great amount of light");
"Summons a small construct that follows you and provides a great amount of light\n" +
"Provides a large amount of light in the abyss");
}
public override void SetDefaults()
+8 -10
View File
@@ -38,16 +38,14 @@ namespace CalamityMod.Items.Weapons.Melee
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
switch (Main.rand.Next(2))
{
case 0:
type = ModContent.ProjectileType<EonBeam>();
break;
case 1:
type = ProjectileID.EnchantedBeam;
break;
}
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer, 1f);
type = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.ProjectileType<EonBeam>(),
ProjectileID.EnchantedBeam
});
int beam = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
if (Main.projectile[beam].type == ModContent.ProjectileType<EonBeam>())
Main.projectile[beam].penetrate = 2;
float num72 = Main.rand.Next(18, 25);
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
+2 -1
View File
@@ -43,8 +43,9 @@ namespace CalamityMod.Items.Weapons.Melee
ModContent.ProjectileType<EonBeam>(),
ModContent.ProjectileType<EonBeamV2>()
});
int beam = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.75), knockBack, Main.myPlayer, 1f);
int beam = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.75), knockBack, Main.myPlayer);
Main.projectile[beam].localNPCHitCooldown = 14;
Main.projectile[beam].penetrate = 2;
int i = Main.myPlayer;
float num72 = Main.rand.Next(18, 27);
float num74 = knockBack;
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.shootSpeed = 10f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 5; //If you already have all 5, no need to resummon
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.summon = true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 4; //If you already have all 4, no need to resummon
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
+4 -3
View File
@@ -609,11 +609,12 @@ namespace CalamityMod
BossDifficulty.TryGetValue("AdultEidolonWyrm", out float order);
int type = NPCType<EidolonWyrmHeadHuge>();
int summon = ItemID.RodofDiscord;
List<int> loot = new List<int>() { ItemType<Voidstone>(), ItemType<Lumenite>(), ItemID.Ectoplasm, ItemType<EidolicWail>(), ItemType<SoulEdge>() };
List<int> collection = new List<int>() { ItemType<HalibutCannon>() };
List<int> loot = new List<int>() { ItemType<Voidstone>(), ItemType<Lumenite>(), ItemID.Ectoplasm, ItemType<EidolicWail>(), ItemType<SoulEdge>(), ItemType<HalibutCannon>() };
List<int> collection = new List<int>() { };
string instructions = $"While in the Abyss, use an item that inflicts Chaos State";
string despawn = CalamityUtils.ColorMessage("...", new Color(0x7F, 0xFF, 0xD4));
AddBoss(bossChecklist, calamity, "Adult Eidolon Wyrm", order, type, DownedAdultEidolonWyrm, summon, loot, collection, instructions, despawn);
string bossLogTex = "CalamityMod/NPCs/Abyss/AdultEidolonWyrm_BossChecklist";
AddBoss(bossChecklist, calamity, "Adult Eidolon Wyrm", order, type, DownedAdultEidolonWyrm, summon, loot, collection, instructions, despawn, bossLogTex);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

+29 -29
View File
@@ -101,50 +101,50 @@ namespace CalamityMod.NPCs.Calamitas
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 7;
Texture2D texture = Main.npcTexture[npc.type];
Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[npc.type] / 2));
Color white = Color.White;
float colorLerpAmt = 0.5f;
int afterimageAmt = 7;
if (CalamityConfig.Instance.Afterimages)
{
for (int num155 = 1; num155 < num153; num155 += 2)
for (int i = 1; i < afterimageAmt; i += 2)
{
Color color38 = lightColor;
color38 = Color.Lerp(color38, color36, amount9);
color38 = npc.GetAlpha(color38);
color38 *= (float)(num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Color color1 = lightColor;
color1 = Color.Lerp(color1, white, colorLerpAmt);
color1 = npc.GetAlpha(color1);
color1 *= (float)(afterimageAmt - i) / 15f;
Vector2 offset = npc.oldPos[i] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
offset += origin * npc.scale + new Vector2(0f, npc.gfxOffY);
spriteBatch.Draw(texture, offset, npc.frame, color1, npc.rotation, origin, npc.scale, spriteEffects, 0f);
}
}
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2((float)texture2D15.Width, (float)(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(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Vector2 npcOffset = npc.Center - Main.screenPosition;
npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
npcOffset += origin * npc.scale + new Vector2(0f, npc.gfxOffY);
spriteBatch.Draw(texture, npcOffset, npc.frame, npc.GetAlpha(lightColor), npc.rotation, origin, npc.scale, spriteEffects, 0f);
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun3Glow");
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
texture = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun3Glow");
Color color = Color.Lerp(Color.White, Color.Red, 0.5f);
if (CalamityConfig.Instance.Afterimages)
{
for (int num163 = 1; num163 < num153; num163++)
for (int i = 1; i < afterimageAmt; i++)
{
Color color41 = color37;
color41 = Color.Lerp(color41, color36, amount9);
color41 *= (float)(num153 - num163) / 15f;
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Color color2 = color;
color2 = Color.Lerp(color2, white, colorLerpAmt);
color2 *= (float)(afterimageAmt - i) / 15f;
Vector2 offset = npc.oldPos[i] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
offset += origin * npc.scale + new Vector2(0f, npc.gfxOffY);
spriteBatch.Draw(texture, offset, npc.frame, color2, npc.rotation, origin, npc.scale, spriteEffects, 0f);
}
}
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
spriteBatch.Draw(texture, npcOffset, npc.frame, color, npc.rotation, origin, npc.scale, spriteEffects, 0f);
return false;
}
+12
View File
@@ -686,6 +686,16 @@ namespace CalamityMod.NPCs
//NPCID.WanderingEyeFish,
//NPCID.ZombieMerman,
};
public static List<int> BoundNPCIDs = new List<int>
{
NPCID.BoundGoblin,
NPCID.BoundWizard,
NPCID.BoundMechanic,
NPCID.SleepingAngler,
NPCID.BartenderUnconscious,
//NPCID.GolferRescue
};
#endregion
#region Instance Per Entity
@@ -1098,6 +1108,8 @@ namespace CalamityMod.NPCs
RevDeathStatChanges(npc, mod);
OtherStatChanges(npc);
CalamityGlobalTownNPC.BoundNPCSafety(mod, npc);
}
#endregion
+1
View File
@@ -1132,6 +1132,7 @@ namespace CalamityMod.NPCs
break;
case NPCID.RedDevil:
DropHelper.DropItemChance(npc, ModContent.ItemType<DemonicBoneAsh>(), Main.expertMode ? 2 : 3);
DropHelper.DropItemChance(npc, ModContent.ItemType<EssenceofChaos>(), Main.expertMode ? 1f : 0.5f);
break;
+9
View File
@@ -1148,6 +1148,15 @@ namespace CalamityMod.NPCs
#endregion
#region NPC Stat Changes
public static void BoundNPCSafety(Mod mod, NPC npc)
{
// Make Bound Town NPCs take no damage
if (CalamityGlobalNPC.BoundNPCIDs.Contains(npc.type))
{
npc.dontTakeDamageFromHostiles = true;
}
}
public static void MakeTownNPCsTakeMoreDamage(NPC npc, Projectile projectile, Mod mod, ref int damage)
{
if (npc.townNPC && projectile.hostile)
@@ -166,8 +166,6 @@ namespace CalamityMod.Projectiles.Environment
}
}
public override bool CanDamage() => false;
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
+8 -1
View File
@@ -72,7 +72,14 @@ namespace CalamityMod.Projectiles.Magic
}
// Cannot deal damage for the first several frames of existence.
public override bool? CanHitNPC(NPC target) => projectile.timeLeft < 110;
public override bool? CanHitNPC(NPC target)
{
if (projectile.timeLeft >= 110)
{
return false;
}
return null;
}
public override bool CanHitPvp(Player target) => projectile.timeLeft < 110;
}
-3
View File
@@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
if (projectile.ai[0] == 1f) //(True) Ark of the Ancients
projectile.penetrate = 2;
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.3f / 255f, (255 - projectile.alpha) * 0.4f / 255f, (255 - projectile.alpha) * 1f / 255f);
if (projectile.localAI[1] > 7f)
{
-3
View File
@@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
if (projectile.ai[0] == 1f) //True Ark of the Ancients
projectile.penetrate = 2;
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.3f / 255f, (255 - projectile.alpha) * 0.4f / 255f, (255 - projectile.alpha) * 1f / 255f);
if (projectile.localAI[1] > 7f)
{
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetDefaults()
{
projectile.width = 82;
projectile.height = 144;
projectile.height = 114;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 201 B