Merge branch '1.4' of https://github.com/CalamityTeam/CalamityMod into 1.4
This commit is contained in:
commit
f3f82a5012
11 files changed
+27
-26
No files matched your search
@@ -224,7 +224,6 @@ namespace CalamityMod
|
||||
// Lore items
|
||||
ItemRedirect(ModContent.ItemType<LoreAstralInfection>(), "Lore#Lore_Items");
|
||||
ItemRedirect(ModContent.ItemType<LoreAbyss>(), "Lore#Lore_Items");
|
||||
|
||||
ItemRedirect(ModContent.ItemType<LoreAquaticScourge>(), "Lore#Lore_Items");
|
||||
ItemRedirect(ModContent.ItemType<LoreArchmage>(), "Lore#Lore_Items");
|
||||
ItemRedirect(ModContent.ItemType<LoreAstrumAureus>(), "Lore#Lore_Items");
|
||||
@@ -279,7 +278,6 @@ namespace CalamityMod
|
||||
ItemRedirect(ModContent.ItemType<LoreYharon>(), "Lore#Lore_Items");
|
||||
|
||||
// Enemies
|
||||
EnemyRedirect(ModContent.NPCType<Toxicatfish>(), "Catfish (enemy)");
|
||||
EnemyRedirect(ModContent.NPCType<HiveEnemy>(), "Hive (enemy)");
|
||||
EnemyRedirect(ModContent.NPCType<KingSlimeJewel>(), "Crown Jewel (enemy)");
|
||||
EnemyRedirect(ModContent.NPCType<OldDukeToothBall>(), "Tooth Ball (Old Duke)");
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
Blue = 5,
|
||||
Violet = 6
|
||||
}
|
||||
public static Color BackglowColor => new Color(20, 0, 30, 40);
|
||||
public int currentMode = (int)BossMode.Day;
|
||||
public int colorShiftTimer = -1;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
@@ -102,6 +100,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Texture2D texture = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,10 +100,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
{
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBombNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFireNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Texture2D texture = Projectile.maxPenetrate == (int)Providence.BossMode.Day ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFlareNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,10 +113,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D texture2D13 = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value;
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value;
|
||||
int num214 = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,10 +80,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D texture2D13 = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value;
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? ModContent.Request<Texture2D>(Texture).Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value;
|
||||
int num214 = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
Projectile.DrawBackglow(Providence.BackglowColor, 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
|
||||
public ref float MovementTimer => ref Projectile.ai[0];
|
||||
public ref float RotationTimer => ref Projectile.ai[0];
|
||||
public ref float SparkleTimer => ref Projectile.ai[1];
|
||||
public float MaxBloomTime = 30f;
|
||||
public float MaxSparkleTime = 150f;
|
||||
@@ -90,15 +90,14 @@ namespace CalamityMod.Projectiles.Pets
|
||||
//Chase after coins
|
||||
if (foundCoin)
|
||||
{
|
||||
float itemDist = Vector2.Distance(targetLocation, Projectile.Center);
|
||||
Vector2 destination = Projectile.SafeDirectionTo(targetLocation);
|
||||
destination *= 12f;
|
||||
Projectile.velocity = (Projectile.velocity * 40f + destination) / 41f;
|
||||
Projectile.rotation = Projectile.velocity.X * 0.05f;
|
||||
MovementTimer = -1f;
|
||||
RotationTimer = -1f;
|
||||
}
|
||||
//Return to resting position
|
||||
else if (MovementTimer == -1f)
|
||||
else if (RotationTimer == -1f)
|
||||
{
|
||||
Vector2 restingSpot = Owner.Center + Vector2.UnitY * -80f;
|
||||
Projectile.velocity = (restingSpot - Projectile.Center) / 15f;
|
||||
@@ -106,15 +105,15 @@ namespace CalamityMod.Projectiles.Pets
|
||||
|
||||
//Start spinning again when rested
|
||||
if (Vector2.Distance(restingSpot, Projectile.Center) <= 2f)
|
||||
MovementTimer++;
|
||||
RotationTimer++;
|
||||
}
|
||||
//Rotate
|
||||
else
|
||||
{
|
||||
Vector2 playerDist = Owner.Center - Projectile.Center;
|
||||
Projectile.rotation = playerDist.ToRotation() - MathHelper.PiOver2;
|
||||
Projectile.Center = Owner.Center + Vector2.UnitY.RotatedBy(MovementTimer) * -80f;
|
||||
MovementTimer += MathHelper.ToRadians(4f);
|
||||
Projectile.Center = Owner.Center + Vector2.UnitY.RotatedBy(RotationTimer) * -80f;
|
||||
RotationTimer += MathHelper.ToRadians(4f);
|
||||
|
||||
if (Main.rand.NextBool(150) && SparkleTimer <= MaxBloomTime)
|
||||
SparkleTimer = MaxSparkleTime * 0.6f; //Slight sparkle randomly
|
||||
@@ -151,14 +150,12 @@ namespace CalamityMod.Projectiles.Pets
|
||||
|
||||
if (bloomPercent > 0f)
|
||||
{
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.EnterShaderRegion(BlendState.Additive);
|
||||
|
||||
Main.EntitySpriteDraw(bloomTex, Projectile.Center - Main.screenPosition, null, GoldColor * bloomPercent * 0.2f, Projectile.rotation, bloomTex.Size() / 2f, bloomPercent * Projectile.scale * 0.3f, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(shineTex, Projectile.Center - Main.screenPosition, null, GoldColor * shinePercent, Projectile.rotation, shineTex.Size() / 2f, shineScale * Projectile.scale, SpriteEffects.None, 0);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.ExitShaderRegion();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -507,9 +507,9 @@ namespace CalamityMod
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void DrawBackglow(this Projectile projectile, Color backglowColor, float backglowArea, Rectangle? frame = null)
|
||||
public static void DrawBackglow(this Projectile projectile, Color backglowColor, float backglowArea, Texture2D? texture = null, Rectangle? frame = null)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Projectile[projectile.type].Value;
|
||||
texture ??= TextureAssets.Projectile[projectile.type].Value;
|
||||
|
||||
// Use a fallback for the frame.
|
||||
frame ??= texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame);
|
||||
@@ -524,9 +524,9 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawProjectileWithBackglow(this Projectile projectile, Color backglowColor, Color lightColor, float backglowArea, Rectangle? frame = null)
|
||||
public static void DrawProjectileWithBackglow(this Projectile projectile, Color backglowColor, Color lightColor, float backglowArea, Texture2D? texture = null, Rectangle? frame = null)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Projectile[projectile.type].Value;
|
||||
texture ??= TextureAssets.Projectile[projectile.type].Value;
|
||||
|
||||
// Use a fallback for the frame.
|
||||
frame ??= texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame);
|
||||
@@ -534,7 +534,7 @@ namespace CalamityMod
|
||||
Vector2 drawPosition = projectile.Center - Main.screenPosition;
|
||||
Vector2 origin = frame.Value.Size() * 0.5f;
|
||||
|
||||
projectile.DrawBackglow(backglowColor, backglowArea, frame);
|
||||
projectile.DrawBackglow(backglowColor, backglowArea, texture, frame);
|
||||
Main.spriteBatch.Draw(texture, drawPosition, frame, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, 0, 0f);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user