Merge branch '1.4.4' into staging
No files matched your search
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 443 B |
|
After Width: | Height: | Size: 192 B |
|
After Width: | Height: | Size: 199 B |
|
After Width: | Height: | Size: 231 B |
@@ -15,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 46;
|
||||
Item.width = 34;
|
||||
Item.height = 58;
|
||||
Item.damage = 81;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
Item.useTime = Item.useAnimation = 19;
|
||||
|
||||
|
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 867 B |
@@ -63,7 +63,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Grenade, 15).
|
||||
AddIngredient(ItemID.Pumpkin, 10).
|
||||
AddIngredient(ItemID.Pumpkin, 30).
|
||||
AddIngredient(ItemID.PumpkinSeed, 5).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ CosmicTentacle.DisplayName: Dark Tentacle
|
||||
CryoBlast.DisplayName: Cryo Blast
|
||||
DarkSparkBeam.DisplayName: Dark Spark Beam
|
||||
DarkSparkPrism.DisplayName: Dark Crystal
|
||||
HyperdeathRiftScepterBeam.DisplayName: Hyperdeath Rift Ripper
|
||||
DeathValleyDusterProjectile.DisplayName: Death Valley Duster
|
||||
DeathhailBeam.DisplayName: Deathhail Beam
|
||||
EelDrop.DisplayName: Acid Eel Drop
|
||||
@@ -100,7 +101,6 @@ HellfireExplosionFriendly.DisplayName: Explosion
|
||||
HellwingBat.DisplayName: Ashen Hellwing
|
||||
HolyFlame.DisplayName: Holy Flame
|
||||
HolyLaser.DisplayName: Holy Laser
|
||||
HyperdeathRiftScepterBeam.DisplayName: Hyperdeath Rift Ripper
|
||||
IceBarrageMain.DisplayName: Ice Barrage
|
||||
IceBlock.DisplayName: Ice Barrage Block
|
||||
IceBlockIcicle.DisplayName: Ice Barrage Icicle
|
||||
|
||||
@@ -223,8 +223,9 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item27, Projectile.Center);
|
||||
Vector2 splinterVel = Projectile.velocity.RotatedByRandom(MathHelper.Pi / 12f);
|
||||
Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find<ModGore>("FrostcrushValariGore1").Type);
|
||||
Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find<ModGore>("FrostcrushValariGore2").Type);
|
||||
|
||||
for (int i = 1; i <= 5; i++)
|
||||
Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find<ModGore>($"FrostcrushValariGore{i}").Type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,25 +41,17 @@ namespace CalamityMod
|
||||
/// <param name="targetHitbox">The hitbox of the target to check.</param>
|
||||
public static bool CircularHitboxCollision(Vector2 centerCheckPosition, float radius, Rectangle targetHitbox)
|
||||
{
|
||||
// If the center intersects the hitbox, return true immediately
|
||||
Rectangle center = new Rectangle((int)centerCheckPosition.X, (int)centerCheckPosition.Y, 1, 1);
|
||||
if (center.Intersects(targetHitbox))
|
||||
return true;
|
||||
|
||||
float topLeftDistance = Vector2.Distance(centerCheckPosition, targetHitbox.TopLeft());
|
||||
float topRightDistance = Vector2.Distance(centerCheckPosition, targetHitbox.TopRight());
|
||||
float bottomLeftDistance = Vector2.Distance(centerCheckPosition, targetHitbox.BottomLeft());
|
||||
float bottomRightDistance = Vector2.Distance(centerCheckPosition, targetHitbox.BottomRight());
|
||||
if (radius <= 0f)
|
||||
return false;
|
||||
|
||||
float distanceToClosestPoint = topLeftDistance;
|
||||
if (topRightDistance < distanceToClosestPoint)
|
||||
distanceToClosestPoint = topRightDistance;
|
||||
if (bottomLeftDistance < distanceToClosestPoint)
|
||||
distanceToClosestPoint = bottomLeftDistance;
|
||||
if (bottomRightDistance < distanceToClosestPoint)
|
||||
distanceToClosestPoint = bottomRightDistance;
|
||||
float closestX = MathHelper.Clamp(centerCheckPosition.X, targetHitbox.Left, targetHitbox.Right);
|
||||
float closestY = MathHelper.Clamp(centerCheckPosition.Y, targetHitbox.Top, targetHitbox.Bottom);
|
||||
|
||||
return distanceToClosestPoint <= radius;
|
||||
float dx = centerCheckPosition.X - closestX;
|
||||
float dy = centerCheckPosition.Y - closestY;
|
||||
|
||||
return (dx * dx + dy * dy) <= (radius * radius);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -69,60 +69,35 @@ namespace CalamityMod
|
||||
/// </summary>
|
||||
/// <param name="index">whoAmI index to check</param>
|
||||
/// <returns>true if index is in valid range [0 <= index < Main.maxNPCs]</returns>
|
||||
public static bool IndexInRange(this NPC[] _, int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
return index < Main.maxNPCs;
|
||||
return false;
|
||||
}
|
||||
public static bool IndexInRange(this NPC[] _, int index) => (uint)index < Main.maxNPCs;
|
||||
|
||||
/// <summary>
|
||||
/// Fallback method for Main.player.IndexInRange which provide accurate range check (0 <= index < Main.maxPlayers)
|
||||
/// </summary>
|
||||
/// <param name="index">whoAmI index to check</param>
|
||||
/// <returns>true if index is in valid range [0 <= index < Main.maxPlayers]</returns>
|
||||
public static bool IndexInRange(this Player[] _, int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
return index < Main.maxPlayers;
|
||||
return false;
|
||||
}
|
||||
public static bool IndexInRange(this Player[] _, int index) => (uint)index < Main.maxPlayers;
|
||||
|
||||
/// <summary>
|
||||
/// Fallback method for Main.projectile.IndexInRange which provide accurate range check (0 <= index < Main.maxProjectiles)
|
||||
/// </summary>
|
||||
/// <param name="index">whoAmI index to check</param>
|
||||
/// <returns>true if index is in valid range [0 <= index < Main.maxProjectiles]</returns>
|
||||
public static bool IndexInRange(this Projectile[] _, int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
return index < Main.maxProjectiles;
|
||||
return false;
|
||||
}
|
||||
public static bool IndexInRange(this Projectile[] _, int index) => (uint)index < Main.maxProjectiles;
|
||||
|
||||
/// <summary>
|
||||
/// Fallback method for Main.gore.IndexInRange which provide accurate range check (0 <= index < Main.maxGore)
|
||||
/// </summary>
|
||||
/// <param name="index">whoAmI index to check</param>
|
||||
/// <returns>true if index is in valid range [0 <= index < Main.maxGore]</returns>
|
||||
public static bool IndexInRange(this Gore[] _, int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
return index < Main.maxGore;
|
||||
return false;
|
||||
}
|
||||
public static bool IndexInRange(this Gore[] _, int index) => (uint)index < Main.maxGore;
|
||||
|
||||
/// <summary>
|
||||
/// Fallback method for Main.npc.IndexInRange which provide accurate range check (0 <= index < Main.maxDust)
|
||||
/// </summary>
|
||||
/// <param name="index">whoAmI index to check</param>
|
||||
/// <returns>true if index is in valid range [0 <= index < Main.maxDust]</returns>
|
||||
public static bool IndexInRange(this Dust[] _, int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
return index < Main.maxDust;
|
||||
return false;
|
||||
}
|
||||
public static bool IndexInRange(this Dust[] _, int index) => (uint)index < Main.maxDust;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -90,17 +90,7 @@ namespace CalamityMod
|
||||
public static void FindAndReplaceAll(this List<TooltipLine> tooltips, string replacedKey, string newKey)
|
||||
{
|
||||
foreach (TooltipLine line in tooltips)
|
||||
{
|
||||
if (!line.Text.Contains(replacedKey))
|
||||
continue;
|
||||
//loops only 100 times at max per tooltip line to prevent any infinite loops
|
||||
for (var i = 0; i < 100; i++)
|
||||
{
|
||||
line.Text = line.Text.Replace(replacedKey, newKey);
|
||||
if (!line.Text.Contains(replacedKey))
|
||||
break;
|
||||
}
|
||||
}
|
||||
line.Text = line.Text.Replace(replacedKey, newKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace CalamityMod
|
||||
/// <typeparam name="T">The base type of the collection.</typeparam>
|
||||
/// <param name="collection">The collection.</param>
|
||||
/// <param name="type">The type to search for.</param>
|
||||
public static bool ContainsType<T>(this IEnumerable<T> collection, Type type) => collection.Any(entry => entry.GetType() == type.GetType());
|
||||
public static bool ContainsType<T>(this IEnumerable<T> collection, Type type) => collection.Any(entry => entry.GetType() == type);
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the sound volume and panning for a sound which is played at the specified location in the game world.<br/>
|
||||
@@ -156,7 +156,7 @@ namespace CalamityMod
|
||||
|
||||
if (soundPos.X == -1f || soundPos.Y == -1f)
|
||||
volume = 1f;
|
||||
else if (WorldGen.gen || Main.dedServ || Main.dedServ)
|
||||
else if (WorldGen.gen || Main.dedServ)
|
||||
volume = 0f;
|
||||
else
|
||||
{
|
||||
@@ -273,12 +273,12 @@ namespace CalamityMod
|
||||
for (int i = 0; i < originalText.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < 37; j++)
|
||||
{
|
||||
{
|
||||
if (TextKeys[j] == originalText[i])
|
||||
{
|
||||
morseText += MorseKeys[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||