items and projectiles

This commit is contained in:
GinYuH committed 2023-01-19 20:49:34 -08:00
1 parent 58eb373295
commit dd1e845ecb
11 files changed
+17 -18

No files matched your search

+3 -4
View File
@@ -14,7 +14,6 @@ namespace CalamityMod.Items.SummonItems
{
public class CryoKey : ModItem
{
// Todo: Change all Main.getGoodWorlds here once 1.4.4 porting has begun
public override void SetStaticDefaults()
{
SacrificeTotal = 1;
@@ -59,7 +58,7 @@ namespace CalamityMod.Items.SummonItems
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/CryoKey").Value;
Color overlay = Main.getGoodWorld ? Color.Red : Color.White;
Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : Color.White;
spriteBatch.Draw(texture, position, null, overlay, 0f, origin, scale, 0, 0);
return false;
}
@@ -67,7 +66,7 @@ namespace CalamityMod.Items.SummonItems
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/CryoKey").Value;
Color overlay = Main.getGoodWorld ? Color.Red : lightColor;
Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : lightColor;
spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, overlay, 0f, Vector2.Zero, 1f, 0, 0);
return false;
}
@@ -78,7 +77,7 @@ namespace CalamityMod.Items.SummonItems
TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName");
TooltipLine line0 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
name.Text = "Pyro Key";
line0.Text = "Summons Cryogen when used in the tundra...?";
+1 -1
View File
@@ -109,7 +109,7 @@ namespace CalamityMod.Items.SummonItems
Player player = Main.LocalPlayer;
TooltipLine line3 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
line3.Text = "Creates a square arena of blocks, with you at its center\nEnrages during the day";
}
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Items.SummonItems
Player player = Main.LocalPlayer;
TooltipLine line0 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0");
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
line0.Text = "Summons the Great Sand Shark when used in the astral desert";
}
+5 -5
View File
@@ -26,8 +26,8 @@ namespace CalamityMod.Items.SummonItems
public override void SetDefaults()
{
Item.rare = ItemRarityID.Blue;
Item.width = Main.getGoodWorld ? 54 : 28;
Item.height = Main.getGoodWorld ? 78 : 28;
Item.width = CalamityMod.Instance.legendaryMode ? 54 : 28;
Item.height = CalamityMod.Instance.legendaryMode ? 78 : 28;
Item.useAnimation = 45;
Item.useTime = 45;
Item.channel = true;
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.SummonItems
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus_GFB").Value;
Color overlay = Color.White;
@@ -52,7 +52,7 @@ namespace CalamityMod.Items.SummonItems
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus_GFB").Value;
spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, 0, 0);
@@ -67,7 +67,7 @@ namespace CalamityMod.Items.SummonItems
Player player = Main.LocalPlayer;
TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName");
if (Main.getGoodWorld)
if (CalamityMod.Instance.legendaryMode)
{
name.Text = "Ogscule";
}
+1 -1
View File
@@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss
if (damage <= 0 || Projectile.Opacity != 1f)
return;
if (Projectile.ai[0] == 0f || Main.getGoodWorld)
if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode)
target.AddBuff(ModContent.BuffType<VulnerabilityHex>(), 120);
else
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
+1 -1
View File
@@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss
if (damage <= 0 || Projectile.timeLeft < 51)
return;
if (Projectile.ai[0] == 0f || Main.getGoodWorld)
if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode)
target.AddBuff(ModContent.BuffType<VulnerabilityHex>(), 120);
else
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
+1 -1
View File
@@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss
if (damage <= 0 || Projectile.Opacity != 1f)
return;
if (Projectile.ai[0] == 0f || Main.getGoodWorld)
if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode)
target.AddBuff(ModContent.BuffType<VulnerabilityHex>(), 120);
else
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
+1 -1
View File
@@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Boss
// If the other projectile is indeed the same owned by the same player and they're too close, nudge them away.
bool sameProjType = otherProj.type == Projectile.type;
float taxicabDist = Vector2.Distance(Projectile.Center, otherProj.Center);
float distancegate = Main.getGoodWorld ? 360f : 320f;
float distancegate = CalamityMod.Instance.legendaryMode ? 360f : 320f;
if (sameProjType && taxicabDist < distancegate)
{
if (Projectile.position.X < otherProj.position.X)
+1 -1
View File
@@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Boss
num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623;
Projectile.position.X += num624 * -Projectile.direction;
}
if (Projectile.ai[0] == breakThreshold && Main.getGoodWorld)
if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode)
{
Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed;
}
+1 -1
View File
@@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss
num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623;
Projectile.position.X += num624 * -Projectile.direction;
}
if (Projectile.ai[0] == breakThreshold && Main.getGoodWorld)
if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode)
{
Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed;
}
+1 -1
View File
@@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss
num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623;
Projectile.position.X += num624 * -Projectile.direction;
}
if (Projectile.ai[0] == breakThreshold && Main.getGoodWorld)
if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode)
{
Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed;
}