This commit is contained in:
mountaindrew10 committed 2024-03-20 16:01:45 -05:00
commit 3cbbb49925
153 files changed
+1566 -394

No files matched your search

+8
View File
@@ -108,6 +108,9 @@ namespace CalamityMod
public static Texture2D SulphurSeaSkyFront;
public static Texture2D SulphurSeaSurface;
//Destroyer glowmasks
public static Asset<Texture2D>[] DestroyerGlowmasks = new Asset<Texture2D>[3];
// DR data structure
public static SortedDictionary<int, float> DRValues;
@@ -286,6 +289,11 @@ namespace CalamityMod
SulphurSeaSkyFront = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value;
SulphurSeaSurface = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value;
//Destroyer glowmasks
DestroyerGlowmasks[0] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad);
DestroyerGlowmasks[1] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
DestroyerGlowmasks[2] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
// TODO -- Sky shaders should probably be loaded in a ModSystem
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky();
+3
View File
@@ -154,6 +154,9 @@ namespace CalamityMod.ILEditing
// Fix vanilla not accounting for spritebatch modification in held projectile drawing
On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState;
// Fix vanilla not accounting for multiple bobbers when fishing with truffle worm
IL_Player.ItemCheck_CheckFishingBobbers += FixTruffleWormFishing;
//Additional detours that are in their own item files given they are only relevant to these specific items:
//Rover drive detours on Player.DrawInfernoRings to draw its shield
//Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held
+48
View File
@@ -6,6 +6,7 @@ using MonoMod.Cil;
using Terraria;
using Terraria.DataStructures;
using Terraria.Graphics.Renderers;
using Terraria.ID;
namespace CalamityMod.ILEditing
{
@@ -69,5 +70,52 @@ namespace CalamityMod.ILEditing
}
}
#endregion
#region Fix Vanilla Not Accounting For Multiple Bobbers When Fishing With Truffle Worm
private void FixTruffleWormFishing(ILContext il)
{
var cursor = new ILCursor(il);
// Initialize a flag variable whether truffle worm was used.
il.Method.Body.Variables.Add(new VariableDefinition(il.Module.TypeSystem.Boolean));
byte truffleWormUsed = (byte) (il.Method.Body.Variables.Count - 1);
cursor.Emit(OpCodes.Ldc_I4_0);
cursor.Emit(OpCodes.Stloc_S, truffleWormUsed);
// Move after beq.s, which is before Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait gets called
if (!cursor.TryGotoNext(MoveType.After, i => i.Match(OpCodes.Beq_S)))
{
LogFailure("FixTruffleWormFishing", "Could not locate beq.s before Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait.");
return;
}
// Skip if truffle worm was already used.
var loopEnd = il.DefineLabel();
cursor.Emit(OpCodes.Ldloc_S, truffleWormUsed);
cursor.Emit(OpCodes.Brtrue_S, loopEnd);
// Find the call to Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<Player>("ItemCheck_CheckFishingBobber_PickAndConsumeBait")))
{
LogFailure("FixTruffleWormFishing", "Could not locate the call to Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait.");
return;
}
// Retrive baitTypeUsed, compare with truffle worm, and save it.
cursor.Emit(OpCodes.Ldloc_S, (byte)4);
cursor.Emit(OpCodes.Ldc_I4, ItemID.TruffleWorm);
cursor.Emit(OpCodes.Ceq);
cursor.Emit(OpCodes.Stloc_S, truffleWormUsed);
// Move before next ldloc.0, which is the end of the loop
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc0()))
{
LogFailure("FixTruffleWormFishing", "Could not find the end of the loop.");
return;
}
cursor.MarkLabel(loopEnd);
}
#endregion
}
}
+2 -2
View File
@@ -140,10 +140,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)TextureAssets.Npc[NPC.type].Value.Width, (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166));
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value, vector,
Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

+2 -2
View File
@@ -257,11 +257,11 @@ namespace CalamityMod.NPCs.Abyss
var texture = TextureAssets.Npc[NPC.type];
Vector2 halfSizeTexture = new Vector2((float)(texture.Value.Width / 2), (float)(texture.Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
var glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/CannonballJellyfishGlow");
var glowTexture = TextureAssets.Npc[NPC.type];
vector -= new Vector2((float)glowTexture.Value.Width, (float)(glowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166));
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/CannonballJellyfishGlow").Value, vector,
Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

+7 -3
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -22,10 +23,15 @@ namespace CalamityMod.NPCs.Abyss
public bool unpuffing = false;
public int puffTimer = 0;
public int puffingTimer = 0;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 11;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -147,11 +153,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/ChaoticPufferGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Potions;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -17,9 +18,14 @@ namespace CalamityMod.NPCs.Abyss
{
public class Cuttlefish : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -348,11 +354,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/CuttlefishGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -9,6 +9,7 @@ using CalamityMod.Items.Placeables.Ores;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -24,6 +25,7 @@ namespace CalamityMod.NPCs.Abyss
public bool brokenMask = false;
public int hitCounter = 0;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
@@ -34,6 +36,10 @@ namespace CalamityMod.NPCs.Abyss
};
value.Position.X += 30f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -286,11 +292,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/DevilFishGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -19,11 +20,16 @@ namespace CalamityMod.NPCs.Abyss
{
public bool brokenMask = false;
public int hitCounter = 0;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 16;
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/DevilFishGlowAlt", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -268,11 +274,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/DevilFishGlowAlt").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+8 -2
View File
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,9 +12,14 @@ namespace CalamityMod.NPCs.Abyss
public class EidolonWyrmBody : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.EidolonWyrmHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -134,10 +140,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -2
View File
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,9 +12,14 @@ namespace CalamityMod.NPCs.Abyss
public class EidolonWyrmBodyAlt : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.EidolonWyrmHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -134,10 +140,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -3
View File
@@ -14,6 +14,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -34,7 +35,7 @@ namespace CalamityMod.NPCs.Abyss
public float speed = 5f; //10
public float turnSpeed = 0.1f; //0.15
bool TailSpawned = false;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
@@ -44,6 +45,10 @@ namespace CalamityMod.NPCs.Abyss
};
value.Position.X += 40;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -430,10 +435,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -2
View File
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,9 +12,14 @@ namespace CalamityMod.NPCs.Abyss
public class EidolonWyrmTail : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.EidolonWyrmHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -134,10 +140,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+7 -3
View File
@@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -19,10 +20,15 @@ namespace CalamityMod.NPCs.Abyss
public class GiantSquid : ModNPC
{
private bool hasBeenHit = false;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -222,11 +228,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GiantSquidGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+8 -2
View File
@@ -2,6 +2,7 @@
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -13,9 +14,14 @@ namespace CalamityMod.NPCs.Abyss
public class GulperEelBody : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.GulperEelHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -142,10 +148,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -2
View File
@@ -2,6 +2,7 @@
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -13,9 +14,14 @@ namespace CalamityMod.NPCs.Abyss
public class GulperEelBodyAlt : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.GulperEelHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -142,10 +148,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -24,6 +25,7 @@ namespace CalamityMod.NPCs.Abyss
public float speed = 5f; //10
public float turnSpeed = 0.075f; //0.15
bool TailSpawned = false;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
@@ -37,6 +39,10 @@ namespace CalamityMod.NPCs.Abyss
value.Position.X += 50;
value.Position.Y += 20;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -351,10 +357,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+8 -2
View File
@@ -2,6 +2,7 @@
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -13,9 +14,14 @@ namespace CalamityMod.NPCs.Abyss
public class GulperEelTail : ModNPC
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.GulperEelHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -142,10 +148,10 @@ namespace CalamityMod.NPCs.Abyss
Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y);
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 vector = center - screenPos;
vector -= new Vector2((float)ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Value.Width, (float)(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f;
vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY);
Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow);
Main.spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Value, vector,
Main.spriteBatch.Draw(GlowTexture.Value, vector,
new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f);
}
+7 -3
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -16,9 +17,14 @@ namespace CalamityMod.NPCs.Abyss
{
public class Laserfish : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -101,11 +107,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/LaserfishGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+8 -3
View File
@@ -9,6 +9,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -21,6 +22,8 @@ namespace CalamityMod.NPCs.Abyss
{
public class LuminousCorvina : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public static readonly SoundStyle ScreamSound = new("CalamityMod/Sounds/Custom/CorvinaScream");
private bool hasBeenHit = false;
@@ -29,6 +32,10 @@ namespace CalamityMod.NPCs.Abyss
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 8;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -280,11 +287,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Weapons.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -21,6 +22,7 @@ namespace CalamityMod.NPCs.Abyss
private bool teleporting = false;
private bool rephasing = false;
private bool hasBeenHit = false;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
@@ -31,6 +33,10 @@ namespace CalamityMod.NPCs.Abyss
};
value.Position.Y += 30f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -193,11 +199,9 @@ Block:
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/MirageJellyGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -1
View File
@@ -23,6 +23,8 @@ namespace CalamityMod.NPCs.Abyss
{
public class ReaperShark : ModNPC
{
public static Asset<Texture2D> ManTexture;
public static readonly SoundStyle SearchRoarSound = new("CalamityMod/Sounds/Custom/ReaperSearchRoar");
public static readonly SoundStyle EnragedRoarSound = new("CalamityMod/Sounds/Custom/ReaperEnragedRoar");
@@ -33,6 +35,10 @@ namespace CalamityMod.NPCs.Abyss
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
{
ManTexture = ModContent.Request<Texture2D>(Texture + "Man", AssetRequestMode.ImmediateLoad);
}
}
public override void SetDefaults()
@@ -688,7 +694,7 @@ namespace CalamityMod.NPCs.Abyss
SpriteEffects spriteEffects = SpriteEffects.None;
if (NPC.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Asset<Texture2D> npcTexture = Main.zenithWorld ? ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/ReaperSharkMan") : TextureAssets.Npc[NPC.type];
Asset<Texture2D> npcTexture = Main.zenithWorld ? ManTexture : TextureAssets.Npc[NPC.type];
Rectangle nframe = npcTexture.Frame(1, 4, 0, (int)NPC.frameCounter);
Vector2 origin = new Vector2((float)(npcTexture.Value.Width / 2), (float)(npcTexture.Value.Height / Main.npcFrameCount[NPC.type] / 2));
Vector2 npcOffset = NPC.Center - screenPos;
+7 -3
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -36,9 +37,14 @@ namespace CalamityMod.NPCs.Abyss
public const int BaseDefense = 10; // the crab's defense while hostile
public const int BaseAttack = 20; // the crab's damage while hostile
public const float BaseKB = 1f; // the crab's knockback taken while hostile
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 23;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -457,11 +463,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/SlabCrabGlow").Value;
var effects = NPC.spriteDirection != 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -7,6 +7,7 @@ using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -19,6 +20,7 @@ namespace CalamityMod.NPCs.Abyss
{
public class ToxicMinnow : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
@@ -27,6 +29,10 @@ namespace CalamityMod.NPCs.Abyss
Scale = 0.8f,
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -122,11 +128,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/ToxicMinnowGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+7 -3
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -17,6 +18,7 @@ namespace CalamityMod.NPCs.Abyss
{
public class Viperfish : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
@@ -26,6 +28,10 @@ namespace CalamityMod.NPCs.Abyss
};
value.Position.X += 15;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -121,11 +127,9 @@ namespace CalamityMod.NPCs.Abyss
{
if (!NPC.IsABestiaryIconDummy)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Abyss/ViperfishGlow").Value;
var effects = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(tex, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
Main.EntitySpriteDraw(GlowTexture.Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY + 4),
NPC.frame, Color.White * 0.5f, NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, effects, 0);
}
}
+13 -3
View File
@@ -9,6 +9,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Weapons.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -22,6 +23,9 @@ namespace CalamityMod.NPCs.AcidRain
public class AcidEel : ModNPC
{
public Player Target => Main.player[NPC.target];
public static Asset<Texture2D> BodyTexture;
public static Asset<Texture2D> TailTexture;
public static Asset<Texture2D> BestiaryTexture;
public override void SetStaticDefaults()
{
@@ -34,6 +38,12 @@ namespace CalamityMod.NPCs.AcidRain
};
value.Position.X += 15;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
BodyTexture = ModContent.Request<Texture2D>(Texture + "Body", AssetRequestMode.ImmediateLoad);
TailTexture = ModContent.Request<Texture2D>(Texture + "Tail", AssetRequestMode.AsyncLoad);
BestiaryTexture = ModContent.Request<Texture2D>(Texture + "Bestiary", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -184,14 +194,14 @@ namespace CalamityMod.NPCs.AcidRain
Vector2 headDrawPosition = NPC.Center - screenPos;
if (NPC.IsABestiaryIconDummy)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/AcidEelBestiary").Value;
Texture2D texture = BestiaryTexture.Value;
Rectangle eelArea = NPC.frame with { Width = 74 };
Main.EntitySpriteDraw(texture, headDrawPosition, eelArea, NPC.GetAlpha(Color.White), NPC.rotation, eelArea.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0);
return false;
}
Texture2D headTexture = ModContent.Request<Texture2D>(Texture).Value;
Texture2D tailTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/AcidEelTail").Value;
Texture2D tailTexture = TailTexture.Value;
Vector2[] segmentPositions = (Vector2[])NPC.oldPos.Clone();
Vector2 segmentAreaTopLeft = Vector2.One * 999999f;
@@ -221,7 +231,7 @@ namespace CalamityMod.NPCs.AcidRain
float offsetAngle = (NPC.position - NPC.oldPos[1]).ToRotation();
Vector2 primitiveArea = (segmentAreaTopRight - segmentAreaTopLeft).RotatedBy(offsetAngle);
Rectangle tailArea = NPC.frame with { Width = 28 };
GameShaders.Misc["CalamityMod:PrimitiveTexture"].SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/AcidEelBody"));
GameShaders.Misc["CalamityMod:PrimitiveTexture"].SetShaderTexture(BodyTexture);
GameShaders.Misc["CalamityMod:PrimitiveTexture"].Shader.Parameters["uPrimitiveSize"].SetValue(primitiveArea);
GameShaders.Misc["CalamityMod:PrimitiveTexture"].Shader.Parameters["flipVertically"].SetValue(NPC.velocity.X > 0f);
+8 -1
View File
@@ -9,8 +9,10 @@ using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
@@ -51,11 +53,16 @@ namespace CalamityMod.NPCs.AcidRain
return NPC.life / (float)NPC.lifeMax < phase2CeilingRatio && DownedBossSystem.downedPolterghast;
}
}
public static Asset<Texture2D> Phase2Texture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 2;
NPCID.Sets.BossBestiaryPriority.Add(Type);
if (!Main.dedServ)
{
Phase2Texture = ModContent.Request<Texture2D>(Texture + "2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -467,7 +474,7 @@ namespace CalamityMod.NPCs.AcidRain
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D texture = InPhase2 ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire").Value;
Texture2D texture = InPhase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value;
Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, 0, 0);
return false;
}
+7 -1
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -24,10 +25,15 @@ namespace CalamityMod.NPCs.AcidRain
public float LaserTelegraphOpacity => MathHelper.Lerp(0.3f, 0.9f, LaserTelegraphPower);
public ref float GammaAcidShootTimer => ref NPC.ai[0];
public ref float LaserShootCountdown => ref NPC.ai[1];
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 2;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -207,7 +213,7 @@ namespace CalamityMod.NPCs.AcidRain
Vector2 laserTop = laserBottom - Vector2.UnitY * LaserTelegraphLength;
Utils.DrawLine(spriteBatch, laserBottom, laserTop, Color.Lerp(Color.Lime, Color.Transparent, LaserTelegraphOpacity));
}
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, ModContent.Request<Texture2D>(Texture + "Glow").Value);
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, GlowTexture.Value);
}
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
+7 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
@@ -14,10 +15,15 @@ namespace CalamityMod.NPCs.AcidRain
public class IrradiatedSlime : ModNPC
{
public bool Falling = true;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 2;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -126,7 +132,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, ModContent.Request<Texture2D>(Texture + "Glow").Value);
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, GlowTexture.Value);
}
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -44,6 +45,8 @@ namespace CalamityMod.NPCs.AcidRain
set => NPC.localAI[0] = value;
}
public static Asset<Texture2D> GlowTexture;
public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/MaulerRoar");
public override void SetStaticDefaults()
@@ -58,6 +61,10 @@ namespace CalamityMod.NPCs.AcidRain
};
value.Position.X += 10f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glowmask", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -417,7 +424,7 @@ namespace CalamityMod.NPCs.AcidRain
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/MaulerGlowmask").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
Vector2 origin = NPC.frame.Size() * 0.5f;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -36,6 +37,8 @@ namespace CalamityMod.NPCs.AcidRain
public const float ExplosionTelegraphTime = 120f;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
@@ -43,6 +46,10 @@ namespace CalamityMod.NPCs.AcidRain
value.Position.Y += 8;
value.PortraitPositionYOverride = 28f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -206,6 +213,6 @@ namespace CalamityMod.NPCs.AcidRain
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
}
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) => CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, ModContent.Request<Texture2D>(Texture + "Glow").Value, true);
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) => CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, GlowTexture.Value, true);
}
}
+8 -1
View File
@@ -9,6 +9,7 @@ using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.ItemDropRules;
@@ -27,11 +28,17 @@ namespace CalamityMod.NPCs.AcidRain
public const int JumpDelay = 64;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
NPCID.Sets.TrailingMode[NPC.type] = 1;
NPCID.Sets.TrailCacheLength[NPC.type] = 6;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -229,7 +236,7 @@ namespace CalamityMod.NPCs.AcidRain
if (!NPC.IsABestiaryIconDummy)
{
CalamityGlobalNPC.DrawAfterimage(NPC, spriteBatch, drawColor, Color.Transparent, directioning: true, invertedDirection: true);
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, ModContent.Request<Texture2D>(Texture + "Glow").Value, true);
CalamityGlobalNPC.DrawGlowmask(NPC, spriteBatch, GlowTexture.Value, true);
}
}
+3 -3
View File
@@ -18,13 +18,13 @@ namespace CalamityMod.NPCs.Astral
{
public class Aries : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 8;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AriesGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AriesGlow", AssetRequestMode.AsyncLoad);
}
public override void SetDefaults()
@@ -104,7 +104,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
//draw glowmask
spriteBatch.Draw(glowmask, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(33, 31), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(33, 31), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+12 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -19,6 +20,16 @@ namespace CalamityMod.NPCs.Astral
{
public class AstralProbe : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
{
NPC.damage = 20;
@@ -240,7 +251,7 @@ namespace CalamityMod.NPCs.Astral
spriteBatch.Draw(texture2D15, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralProbeGlow").Value;
texture2D15 = GlowTexture.Value;
spriteBatch.Draw(texture2D15, drawPosition, NPC.frame, Color.White * 0.6f, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+3 -3
View File
@@ -15,14 +15,14 @@ namespace CalamityMod.NPCs.Astral
{
public class AstralachneaGround : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaGroundGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaGroundGlow", AssetRequestMode.AsyncLoad);
this.HideFromBestiary();
}
@@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Vector2 origin = new Vector2(40f, 21f);
spriteBatch.Draw(glowmask, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+3 -3
View File
@@ -21,14 +21,14 @@ namespace CalamityMod.NPCs.Astral
{
public class AstralachneaWall : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstralachneaGround.DisplayName");
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaWallGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaWallGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Rotation = -MathHelper.PiOver2 };
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
}
@@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Vector2 origin = new Vector2(40f, 40f);
spriteBatch.Draw(glowmask, NPC.Center - screenPos - new Vector2(0, 8f), NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos - new Vector2(0, 8f), NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, SpriteEffects.None, 0);
}
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
+3 -3
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Astral
{
//TODO -- draw 4 pixels lower than actual bottom position (arm overlaps tiles)
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
//CONSTANTS
private const int sheetHeight = 852;
@@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.Astral
//also it's visuals are messed up on npc spawners etc. because the sheet is 3 wide.
//not much we can do. looks fine in-game so /shrug
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AtlasGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AtlasGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
PortraitPositionYOverride = -5
@@ -590,7 +590,7 @@ namespace CalamityMod.NPCs.Astral
//draw glowmask
spriteBatch.Draw(
glowmask, position, NPC.frame,
glowmask.Value, position, NPC.frame,
Color.White * 0.65f, 0f, default, 1f, //color, rotation, origin, scale
effect, 0f); //effect, drawlayer
+3 -3
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Astral
{
public class FusionFeeder : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public Player Target => Main.player[NPC.target];
@@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Astral
public override void SetStaticDefaults()
{
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/FusionFeederGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/FusionFeederGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
Scale = 0.5f,
@@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.Astral
spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + offset, NPC.frame, drawColor, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
//draw glowmask
spriteBatch.Draw(glowmask, NPC.Center - screenPos + offset, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos + offset, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
return false;
}
+4 -4
View File
@@ -22,12 +22,12 @@ namespace CalamityMod.NPCs.Astral
{
public class Hadarian : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HadarianGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HadarianGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers();
value.Position.X += 10f;
value.Position.Y += 10f;
@@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.Astral
Rectangle src = new Rectangle(20, 34, 38, 42);
spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, position - screenPos, src, drawColor, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
//draw glowmask
spriteBatch.Draw(glowmask, position - screenPos, src, Color.White * 0.6f, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, position - screenPos, src, Color.White * 0.6f, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
return false;
}
return true;
@@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.Astral
Vector2 origin = new Vector2(41f, 39f);
//draw glowmask
spriteBatch.Draw(glowmask, NPC.Center - screenPos - new Vector2(0f, 12f), NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos - new Vector2(0f, 12f), NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
}
+3 -3
View File
@@ -19,12 +19,12 @@ namespace CalamityMod.NPCs.Astral
{
public class HiveEnemy : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HiveGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HiveGlow", AssetRequestMode.AsyncLoad);
Main.npcFrameCount[NPC.type] = 6;
}
@@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
// Draw glowmask.
spriteBatch.Draw(glowmask, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(19, 30), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(19, 30), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override void HitEffect(NPC.HitInfo hit)
+3 -3
View File
@@ -17,12 +17,12 @@ namespace CalamityMod.NPCs.Astral
{
public class Hiveling : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HivelingGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HivelingGlow", AssetRequestMode.AsyncLoad);
Main.npcFrameCount[NPC.type] = 4;
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers();
value.Position.Y -= 8;
@@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
//draw glowmask
spriteBatch.Draw(glowmask, NPC.Center - screenPos + new Vector2(0, 12), NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(15, 10), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos + new Vector2(0, 12), NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(15, 10), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override void HitEffect(NPC.HitInfo hit)
+3 -3
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Astral
{
public class Mantis : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
value.Position.Y += 15;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/MantisGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/MantisGlow", AssetRequestMode.AsyncLoad);
}
public override void SetDefaults()
@@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
//draw glowmask
spriteBatch.Draw(glowmask, NPC.Center - screenPos - new Vector2(0, 8), NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(70, 40), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos - new Vector2(0, 8), NPC.frame, Color.White * 0.6f, NPC.rotation, new Vector2(70, 40), 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+3 -3
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Astral
{
public class Nova : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
private float travelAcceleration = 0.2f;
private float targetTime = 120f;
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral
Main.npcFrameCount[NPC.type] = 8;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/NovaGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/NovaGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
Scale = 0.64f,
@@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.Astral
return;
Vector2 drawPosition = NPC.Center - screenPos - new Vector2(0, NPC.scale * 4f);
spriteBatch.Draw(glowmask, drawPosition, NPC.frame, Color.White * 0.75f, NPC.rotation, new Vector2(57f, 37f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
spriteBatch.Draw(glowmask.Value, drawPosition, NPC.frame, Color.White * 0.75f, NPC.rotation, new Vector2(57f, 37f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+3 -3
View File
@@ -19,14 +19,14 @@ namespace CalamityMod.NPCs.Astral
{
public class SightseerCollider : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SightseerColliderGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SightseerColliderGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
PortraitPositionXOverride = 0
@@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
spriteBatch.Draw(glowmask, NPC.Center - screenPos + new Vector2(0, 4f), new Rectangle(0, NPC.frame.Y, 80, NPC.frame.Height), Color.White * 0.75f, NPC.rotation, new Vector2(40f, 20f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos + new Vector2(0, 4f), new Rectangle(0, NPC.frame.Y, 80, NPC.frame.Height), Color.White * 0.75f, NPC.rotation, new Vector2(40f, 20f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+3 -3
View File
@@ -19,13 +19,13 @@ namespace CalamityMod.NPCs.Astral
{
public class SightseerSpitter : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SightseerSpitterGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SightseerSpitterGlow", AssetRequestMode.AsyncLoad);
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
Scale = 0.7f,
@@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
if (!NPC.IsABestiaryIconDummy)
spriteBatch.Draw(glowmask, NPC.Center - screenPos + new Vector2(0, 4f), NPC.frame, Color.White * 0.75f, NPC.rotation, new Vector2(59f, 28f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos + new Vector2(0, 4f), NPC.frame, Color.White * 0.75f, NPC.rotation, new Vector2(59f, 28f), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+3 -3
View File
@@ -19,12 +19,12 @@ namespace CalamityMod.NPCs.Astral
{
public class StellarCulex : ModNPC
{
private static Texture2D glowmask;
public static Asset<Texture2D> glowmask;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/StellarCulexGlow", AssetRequestMode.ImmediateLoad).Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/StellarCulexGlow", AssetRequestMode.AsyncLoad);
Main.npcFrameCount[NPC.type] = 4;
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
@@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.Astral
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Vector2 origin = new Vector2(50, 30f);
spriteBatch.Draw(glowmask, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+33 -12
View File
@@ -22,6 +22,7 @@ using CalamityMod.NPCs.TownNPCs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -43,6 +44,15 @@ namespace CalamityMod.NPCs.AstrumAureus
public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/AstrumAureus/AureusJump");
public static readonly SoundStyle TeleportSound = new("CalamityMod/Sounds/Custom/AstrumAureus/AureusTeleport");
public static Asset<Texture2D> JumpTexture;
public static Asset<Texture2D> RechargeTexture;
public static Asset<Texture2D> StompTexture;
public static Asset<Texture2D> WalkTexture;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> JumpTexture_Glow;
public static Asset<Texture2D> StompTexture_Glow;
public static Asset<Texture2D> WalkTexture_Glow;
private bool stomping = false;
public int slimeProjCounter = 0;
public int slimePhase = 0;
@@ -61,6 +71,17 @@ namespace CalamityMod.NPCs.AstrumAureus
value.Position.Y -= 20f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
JumpTexture = ModContent.Request<Texture2D>(Texture + "Jump", AssetRequestMode.AsyncLoad);
RechargeTexture = ModContent.Request<Texture2D>(Texture + "Recharge", AssetRequestMode.AsyncLoad);
StompTexture = ModContent.Request<Texture2D>(Texture + "Stomp", AssetRequestMode.AsyncLoad);
WalkTexture = ModContent.Request<Texture2D>(Texture + "Walk", AssetRequestMode.AsyncLoad);
JumpTexture_Glow = ModContent.Request<Texture2D>(Texture + "JumpGlow", AssetRequestMode.AsyncLoad);
StompTexture_Glow = ModContent.Request<Texture2D>(Texture + "StompGlow", AssetRequestMode.AsyncLoad);
WalkTexture_Glow = ModContent.Request<Texture2D>(Texture + "WalkGlow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -237,33 +258,33 @@ namespace CalamityMod.NPCs.AstrumAureus
if (NPC.ai[0] == 0f || (slimePhaseHP && Main.zenithWorld))
{
NPCTexture = TextureAssets.Npc[NPC.type].Value;
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusGlow").Value;
GlowMaskTexture = Texture_Glow.Value;
}
else if (NPC.ai[0] == 1f) //nothing special done here
{
NPCTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusRecharge").Value;
NPCTexture = RechargeTexture.Value;
}
else if (NPC.ai[0] == 2f) //nothing special done here
{
NPCTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusWalk").Value;
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusWalkGlow").Value;
NPCTexture = WalkTexture.Value;
GlowMaskTexture = WalkTexture_Glow.Value;
}
else if (NPC.ai[0] == 3f || NPC.ai[0] == 4f) //needs to have an in-air frame
{
if (NPC.velocity.Y == 0f && NPC.ai[1] >= 0f && NPC.ai[0] == 3f) //idle before jump
{
NPCTexture = TextureAssets.Npc[NPC.type].Value; //idle frames
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusGlow").Value;
GlowMaskTexture = Texture_Glow.Value;
}
else if (NPC.velocity.Y <= 0f || NPC.ai[1] < 0f) //jump frames if flying upward or if about to jump
{
NPCTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusJump").Value;
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusJumpGlow").Value;
NPCTexture = JumpTexture.Value;
GlowMaskTexture = JumpTexture_Glow.Value;
}
else //stomping
{
NPCTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusStomp").Value;
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusStompGlow").Value;
NPCTexture = StompTexture.Value;
GlowMaskTexture = StompTexture_Glow.Value;
}
}
else if (NPC.ai[0] >= 5f) //needs to have an in-air frame
@@ -271,12 +292,12 @@ namespace CalamityMod.NPCs.AstrumAureus
if (NPC.velocity.Y == 0f) //idle before teleport
{
NPCTexture = TextureAssets.Npc[NPC.type].Value; //idle frames
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusGlow").Value;
GlowMaskTexture = Texture_Glow.Value;
}
else //in-air frames
{
NPCTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusJump").Value;
GlowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AstrumAureusJumpGlow").Value;
NPCTexture = JumpTexture.Value;
GlowMaskTexture = JumpTexture_Glow.Value;
}
}
+7 -1
View File
@@ -9,6 +9,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -19,11 +20,16 @@ namespace CalamityMod.NPCs.AstrumAureus
{
public class AureusSpawn : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 4;
NPCID.Sets.TrailingMode[NPC.type] = 1;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -263,7 +269,7 @@ namespace CalamityMod.NPCs.AstrumAureus
drawLocation += originalDrawSize * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, originalDrawSize, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumAureus/AureusSpawnGlow").Value;
texture2D15 = GlowTexture.Value;
Color afterimageColorLerp = Color.Lerp(Color.White, Color.Orange, 0.5f) * NPC.Opacity;
if (CalamityConfig.Instance.Afterimages)
+24 -5
View File
@@ -6,6 +6,7 @@ using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -18,10 +19,28 @@ namespace CalamityMod.NPCs.AstrumDeus
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstrumDeusHead.DisplayName");
public static Asset<Texture2D> AltTexture;
public static Asset<Texture2D> TextureGlow1;
public static Asset<Texture2D> TextureGlow2;
public static Asset<Texture2D> TextureGlow3;
public static Asset<Texture2D> TextureGlow4;
public static Asset<Texture2D> TextureAltGlow1;
public static Asset<Texture2D> TextureAltGlow2;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 1;
if (!Main.dedServ)
{
AltTexture = ModContent.Request<Texture2D>(Texture + "AltSpectral", AssetRequestMode.AsyncLoad);
TextureGlow1 = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
TextureGlow2 = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
TextureGlow3 = ModContent.Request<Texture2D>(Texture + "Glow3", AssetRequestMode.AsyncLoad);
TextureGlow4 = ModContent.Request<Texture2D>(Texture + "Glow4", AssetRequestMode.AsyncLoad);
TextureAltGlow1 = ModContent.Request<Texture2D>(Texture + "AltGlow", AssetRequestMode.AsyncLoad);
TextureAltGlow2 = ModContent.Request<Texture2D>(Texture + "AltGlow2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -99,8 +118,8 @@ namespace CalamityMod.NPCs.AstrumDeus
bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f;
bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase;
Texture2D mainWormTex = altBodyTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D secondWormTex = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2").Value;
Texture2D mainWormTex = altBodyTextures ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value;
Texture2D secondWormTex = TextureGlow2.Value;
Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2);
Vector2 drawLocation = NPC.Center - screenPos;
@@ -108,12 +127,12 @@ namespace CalamityMod.NPCs.AstrumDeus
drawLocation += halfSizeTex * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(mainWormTex, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTex, NPC.scale, spriteEffects, 0f);
mainWormTex = altBodyTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow").Value;
mainWormTex = altBodyTextures ? TextureAltGlow1.Value : TextureGlow1.Value;
Color phaseColor = drawCyan ? Color.Cyan : Color.Orange;
if (doubleWormPhase)
{
mainWormTex = drawCyan ? mainWormTex : (altBodyTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow3").Value);
secondWormTex = drawCyan ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow4").Value : secondWormTex;
mainWormTex = drawCyan ? mainWormTex : (altBodyTextures ? TextureAltGlow2.Value : TextureGlow3.Value);
secondWormTex = drawCyan ? TextureGlow4.Value : secondWormTex;
}
Color mainWormColorLerp = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity);
Color secondWormColorLerp = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity);
+17 -4
View File
@@ -22,6 +22,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -43,6 +44,11 @@ namespace CalamityMod.NPCs.AstrumDeus
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/AstrumDeusHit", 2) { Volume = 1.25f };
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/AstrumDeusDeath");
public static Asset<Texture2D> TextureGlow1;
public static Asset<Texture2D> TextureGlow2;
public static Asset<Texture2D> TextureGlow3;
public static Asset<Texture2D> TextureGlow4;
public override void SetStaticDefaults()
{
NPCID.Sets.TrailingMode[NPC.type] = 1;
@@ -56,6 +62,13 @@ namespace CalamityMod.NPCs.AstrumDeus
value.Position.X += 55f;
value.Position.Y += 23f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
TextureGlow1 = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
TextureGlow2 = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
TextureGlow3 = ModContent.Request<Texture2D>(Texture + "Glow3", AssetRequestMode.AsyncLoad);
TextureGlow4 = ModContent.Request<Texture2D>(Texture + "Glow4", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -153,7 +166,7 @@ namespace CalamityMod.NPCs.AstrumDeus
bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase;
Texture2D mainWormTex = TextureAssets.Npc[NPC.type].Value;
Texture2D secondWormTex = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2").Value;
Texture2D secondWormTex = TextureGlow2.Value;
Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2);
Vector2 drawLocation = NPC.Center - screenPos;
@@ -161,12 +174,12 @@ namespace CalamityMod.NPCs.AstrumDeus
drawLocation += halfSizeTex * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(mainWormTex, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTex, NPC.scale, spriteEffects, 0f);
mainWormTex = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow").Value;
mainWormTex = TextureGlow1.Value;
Color phaseColor = drawCyan ? Color.Cyan : Color.Orange;
if (doubleWormPhase)
{
mainWormTex = drawCyan ? mainWormTex : ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow3").Value;
secondWormTex = drawCyan ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow4").Value : secondWormTex;
mainWormTex = drawCyan ? mainWormTex : TextureGlow3.Value;
secondWormTex = drawCyan ? TextureGlow4.Value : secondWormTex;
}
Color mainWormColorLerp = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity);
Color secondWormColorLerp = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity);
+11 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -18,10 +19,18 @@ namespace CalamityMod.NPCs.AstrumDeus
{
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstrumDeusHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> GlowTexture2;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 1;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
GlowTexture2 = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -106,10 +115,10 @@ namespace CalamityMod.NPCs.AstrumDeus
drawLocation += halfSizeTex * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(wormTexture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTex, NPC.scale, spriteEffects, 0f);
wormTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow").Value;
wormTexture = GlowTexture.Value;
Color phaseColor = drawCyan ? Color.Cyan : Color.Orange;
if (doubleWormPhase)
wormTexture = drawCyan ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow2").Value : wormTexture;
wormTexture = drawCyan ? GlowTexture2.Value : wormTexture;
Color wormColorLerp = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity);
+7 -1
View File
@@ -20,6 +20,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -33,6 +34,7 @@ namespace CalamityMod.NPCs.Bumblebirb
[AutoloadBossHead]
public class Bumblefuck : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -48,6 +50,10 @@ namespace CalamityMod.NPCs.Bumblebirb
value.Position.Y += 8f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Bumblebirb/BirbGlow", AssetRequestMode.AsyncLoad);
}
}
public override string Texture => "CalamityMod/NPCs/Bumblebirb/Birb";
@@ -350,7 +356,7 @@ namespace CalamityMod.NPCs.Bumblebirb
if (phase2)
{
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/Bumblebirb/BirbGlow").Value;
texture2D15 = GlowTexture.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Red, 0.5f);
altColor = Color.Red;
+8 -1
View File
@@ -20,6 +20,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -33,6 +34,8 @@ namespace CalamityMod.NPCs.CalClone
[AutoloadBossHead]
public class CalamitasClone : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -46,6 +49,10 @@ namespace CalamityMod.NPCs.CalClone
value.Position.Y -= 10f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -155,7 +162,7 @@ namespace CalamityMod.NPCs.CalClone
npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, npcOffset, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/CalClone/CalamitasCloneGlow").Value;
texture = GlowTexture.Value;
Color color = Color.Lerp(Color.White, Color.Red, 0.5f);
if (Main.zenithWorld)
{
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -19,6 +20,8 @@ namespace CalamityMod.NPCs.CalClone
[AutoloadBossHead]
public class Cataclysm : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -31,6 +34,10 @@ namespace CalamityMod.NPCs.CalClone
PortraitPositionYOverride = 0
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -130,7 +137,7 @@ namespace CalamityMod.NPCs.CalClone
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/CalClone/CataclysmGlow").Value;
texture2D15 = GlowTexture.Value;
Color pinkLerp = Color.Lerp(Color.White, Color.Red, 0.5f);
if (CalamityConfig.Instance.Afterimages)
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -19,6 +20,8 @@ namespace CalamityMod.NPCs.CalClone
[AutoloadBossHead]
public class Catastrophe : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -31,6 +34,10 @@ namespace CalamityMod.NPCs.CalClone
};
value.Position.Y -= 10;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -130,7 +137,7 @@ namespace CalamityMod.NPCs.CalClone
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/CalClone/CatastropheGlow").Value;
texture2D15 = GlowTexture.Value;
Color pinkLerp = Color.Lerp(Color.White, Color.Red, 0.5f);
if (CalamityConfig.Instance.Afterimages)
+7 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -17,12 +18,17 @@ namespace CalamityMod.NPCs.CalClone
{
private int timer = 0;
private bool start = true;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 5;
NPCID.Sets.TrailingMode[NPC.type] = 1;
NPCID.Sets.BossBestiaryPriority.Add(Type);
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -212,7 +218,7 @@ namespace CalamityMod.NPCs.CalClone
drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/CalClone/SoulSeekerGlow").Value;
texture = GlowTexture.Value;
Color glow = Color.Lerp(Color.White, Color.Red, colorLerpAmt);
if (CalamityConfig.Instance.Afterimages)
+6 -6
View File
@@ -6833,7 +6833,7 @@ namespace CalamityMod.NPCs
intensity *= intensityAndOpacityMult;
opacity *= intensityAndOpacityMult;
Texture2D forcefieldTexture = Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/ForcefieldTexture").Value;
Texture2D forcefieldTexture = SupremeCalamitas.SupremeCalamitas.ForcefieldTexture.Value;
if (npc.type == NPCID.CultistBoss)
GameShaders.Misc["CalamityMod:SupremeShield"].SetShaderTexture(Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak"));
@@ -6993,7 +6993,7 @@ namespace CalamityMod.NPCs
}
}
Texture2D glowTexture = Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow").Value;
Texture2D glowTexture = CalamityMod.DestroyerGlowmasks[0].Value;
switch (npc.type)
{
default:
@@ -7001,11 +7001,11 @@ namespace CalamityMod.NPCs
break;
case NPCID.TheDestroyerBody:
glowTexture = Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow").Value;
glowTexture = CalamityMod.DestroyerGlowmasks[1].Value;
break;
case NPCID.TheDestroyerTail:
glowTexture = Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow").Value;
glowTexture = CalamityMod.DestroyerGlowmasks[2].Value;
break;
}
@@ -7240,8 +7240,8 @@ namespace CalamityMod.NPCs
if (masterMode && revenge)
{
int alpha = 192;
eyesColor = npc.type == ModContent.NPCType<SkeletronPrime2>() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha);
Texture2D glowTexture = Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow").Value;
eyesColor = npc.type == NPCType<SkeletronPrime2>() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha);
Texture2D glowTexture = SkeletronPrime2.EyeTexture.Value;
for (int i = 0; i < 3; i++)
spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
}
+8 -1
View File
@@ -17,6 +17,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -33,6 +34,8 @@ namespace CalamityMod.NPCs.CeaselessVoid
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/CeaselessVoidDeath");
public static readonly SoundStyle BuildupSound = new("CalamityMod/Sounds/Custom/CeaselessVoidDeathBuild");
public static Asset<Texture2D> GlowTexture;
public bool playedbuildsound = false;
public override void SetStaticDefaults()
@@ -46,6 +49,10 @@ namespace CalamityMod.NPCs.CeaselessVoid
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -169,7 +176,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/CeaselessVoid/CeaselessVoidGlow").Value;
texture2D15 = GlowTexture.Value;
Color cyanLerp = Color.Lerp(Color.White, Color.Cyan, 0.5f);
if (CalamityConfig.Instance.Afterimages)
+8 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -27,11 +28,17 @@ namespace CalamityMod.NPCs.CeaselessVoid
public const int HitboxSize = 64;
public const int FrameCount = 8;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = FrameCount;
NPCID.Sets.TrailingMode[NPC.type] = 1;
NPCID.Sets.BossBestiaryPriority.Add(Type);
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -243,7 +250,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
if (NPC.dontTakeDamage)
return false;
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow").Value;
Texture2D glowTexture = GlowTexture.Value;
Color glowColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f) * NPC.Opacity;
if (CalamityConfig.Instance.Afterimages)
+8 -2
View File
@@ -2,9 +2,9 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
using Terraria.ModLoader;
@@ -12,11 +12,17 @@ namespace CalamityMod.NPCs.Crabulon
{
public class CrabShroom : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 4;
NPCID.Sets.BossBestiaryPriority.Add(Type);
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -133,7 +139,7 @@ namespace CalamityMod.NPCs.Crabulon
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
Texture2D glow = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabShroomGlow").Value;
Texture2D glow = GlowTexture.Value;
Color colorToShift = Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan;
Color glowColor = Color.Lerp(Color.White, colorToShift, 0.5f);
+20 -5
View File
@@ -19,6 +19,7 @@ using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -35,6 +36,12 @@ namespace CalamityMod.NPCs.Crabulon
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private bool stomping = false;
public static Asset<Texture2D> AltTexture;
public static Asset<Texture2D> AttackTexture;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> AltTexture_Glow;
public static Asset<Texture2D> AttackTexture_Glow;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -48,6 +55,14 @@ namespace CalamityMod.NPCs.Crabulon
value.Position.Y += 80f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
AltTexture = ModContent.Request<Texture2D>(Texture + "Alt", AssetRequestMode.AsyncLoad);
AttackTexture = ModContent.Request<Texture2D>(Texture + "Attack", AssetRequestMode.AsyncLoad);
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
AltTexture_Glow = ModContent.Request<Texture2D>(Texture + "AltGlow", AssetRequestMode.AsyncLoad);
AttackTexture_Glow = ModContent.Request<Texture2D>(Texture + "AttackGlow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -769,11 +784,11 @@ namespace CalamityMod.NPCs.Crabulon
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D textureIdle = TextureAssets.Npc[NPC.type].Value;
Texture2D glowIdle = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabulonGlow").Value;
Texture2D textureWalk = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabulonAlt").Value;
Texture2D glowWalk = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabulonAltGlow").Value;
Texture2D textureAttack = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabulonAttack").Value;
Texture2D glowAttack = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crabulon/CrabulonAttackGlow").Value;
Texture2D glowIdle = Texture_Glow.Value;
Texture2D textureWalk = AltTexture.Value;
Texture2D glowWalk = AltTexture_Glow.Value;
Texture2D textureAttack = AttackTexture.Value;
Texture2D glowAttack = AttackTexture_Glow.Value;
Color colorToShift = Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan;
Color glowColor = Color.Lerp(Color.White, colorToShift, 0.5f);
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Projectiles.Boss;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -18,9 +19,15 @@ namespace CalamityMod.NPCs.Crags
{
public class SoulSlurper : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
NPCID.Sets.TrailingMode[NPC.type] = 1;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -267,7 +274,7 @@ namespace CalamityMod.NPCs.Crags
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Crags/SoulSlurperGlow").Value;
texture = GlowTexture.Value;
Color redGlow = Color.Lerp(Color.White, Color.Red, 0.5f);
if (CalamityConfig.Instance.Afterimages)
+38 -2
View File
@@ -26,6 +26,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -53,6 +54,12 @@ namespace CalamityMod.NPCs.Cryogen
public static readonly SoundStyle ShieldRegenSound = new("CalamityMod/Sounds/Custom/CryogenShieldRegenerate");
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/CryogenDeath");
public static Asset<Texture2D> Phase2Texture;
public static Asset<Texture2D> Phase3Texture;
public static Asset<Texture2D> Phase4Texture;
public static Asset<Texture2D> Phase5Texture;
public static Asset<Texture2D> Phase6Texture;
public FireParticleSet FireDrawer = null;
public static int cryoIconIndex;
@@ -74,6 +81,14 @@ namespace CalamityMod.NPCs.Cryogen
{
NPCID.Sets.BossBestiaryPriority.Add(Type);
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
Phase2Texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Cryogen/Cryogen_Phase2", AssetRequestMode.AsyncLoad);
Phase3Texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Cryogen/Cryogen_Phase3", AssetRequestMode.AsyncLoad);
Phase4Texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Cryogen/Cryogen_Phase4", AssetRequestMode.AsyncLoad);
Phase5Texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Cryogen/Cryogen_Phase5", AssetRequestMode.AsyncLoad);
Phase6Texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Cryogen/Cryogen_Phase6", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -1230,8 +1245,29 @@ Block:
else
FireDrawer = null;
string phase = "CalamityMod/NPCs/Cryogen/Cryogen_Phase" + currentPhase;
Texture2D texture = ModContent.Request<Texture2D>(phase).Value;
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
switch (currentPhase)
{
case 2:
texture = Phase2Texture.Value;
break;
case 3:
texture = Phase3Texture.Value;
break;
case 4:
texture = Phase4Texture.Value;
break;
case 5:
texture = Phase5Texture.Value;
break;
case 6:
texture = Phase6Texture.Value;
break;
default:
texture = TextureAssets.Npc[NPC.type].Value;
break;
}
SpriteEffects spriteEffects = SpriteEffects.None;
if (NPC.spriteDirection == 1)
+9 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -16,9 +17,16 @@ namespace CalamityMod.NPCs.DevourerofGods
{
public int invinceTime = 180;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.CosmicGuardianHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -173,7 +181,7 @@ namespace CalamityMod.NPCs.DevourerofGods
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/CosmicGuardianBodyGlow").Value;
texture2D15 = GlowTexture.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+11 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -21,6 +22,9 @@ namespace CalamityMod.NPCs.DevourerofGods
private const int maxLength = 11;
private int invinceTime = 180;
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> GlowTexture2;
public override void SetStaticDefaults()
{
NPCID.Sets.BossBestiaryPriority.Add(Type);
@@ -35,6 +39,11 @@ namespace CalamityMod.NPCs.DevourerofGods
value.Position.X += 62f;
value.Position.Y += 35f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -362,12 +371,12 @@ namespace CalamityMod.NPCs.DevourerofGods
distFromHead3 += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, distFromHead3, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/CosmicGuardianHeadGlow").Value;
texture2D15 = GlowTexture.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
spriteBatch.Draw(texture2D15, distFromHead3, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/CosmicGuardianHeadGlow2").Value;
texture2D15 = GlowTexture2.Value;
glowmaskColor = Color.Lerp(Color.White, Color.Cyan, 0.5f);
spriteBatch.Draw(texture2D15, distFromHead3, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+9 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -16,9 +17,16 @@ namespace CalamityMod.NPCs.DevourerofGods
{
public int invinceTime = 180;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.CosmicGuardianHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -170,7 +178,7 @@ namespace CalamityMod.NPCs.DevourerofGods
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/CosmicGuardianTailGlow").Value;
texture2D15 = GlowTexture.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Cyan, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+18 -3
View File
@@ -9,6 +9,7 @@ using CalamityMod.Projectiles.Melee.Yoyos;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -35,10 +36,24 @@ namespace CalamityMod.NPCs.DevourerofGods
private bool setOpacity = false;
private bool phase2Started = false;
public int SegmentIndex;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> Phase2Texture;
public static Asset<Texture2D> Phase2Texture_Glow;
public static Asset<Texture2D> Phase2Texture_Glow2;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.DevourerofGodsHead.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
Phase2Texture = ModContent.Request<Texture2D>(Texture + "S", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow = ModContent.Request<Texture2D>(Texture + "SGlow", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow2 = ModContent.Request<Texture2D>(Texture + "SGlow2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -387,7 +402,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteEffects = SpriteEffects.FlipHorizontally;
bool useOtherTextures = phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60f;
Texture2D texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value;
Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Vector2 drawLocation = NPC.Center - screenPos;
@@ -399,13 +414,13 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (useOtherTextures)
{
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodySGlow").Value;
texture2D15 = Phase2Texture_Glow.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
}
texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodySGlow2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyGlow").Value;
texture2D15 = useOtherTextures ? Phase2Texture_Glow2.Value : Texture_Glow.Value;
Color glowmaskColor2 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor2, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+32 -11
View File
@@ -30,6 +30,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -48,6 +49,12 @@ namespace CalamityMod.NPCs.DevourerofGods
public static int phase1IconIndex;
public static int phase2IconIndex;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> Texture_Glow2;
public static Asset<Texture2D> Phase2Texture;
public static Asset<Texture2D> Phase2Texture_Glow;
public static Asset<Texture2D> Phase2Texture_Glow2;
internal static void LoadHeadIcons()
{
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss";
@@ -168,6 +175,14 @@ namespace CalamityMod.NPCs.DevourerofGods
value.Position.Y += 38f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
Texture_Glow2 = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
Phase2Texture = ModContent.Request<Texture2D>(Texture + "S", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow = ModContent.Request<Texture2D>(Texture + "SGlow", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow2 = ModContent.Request<Texture2D>(Texture + "SGlow2", AssetRequestMode.AsyncLoad);
}
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -551,7 +566,7 @@ namespace CalamityMod.NPCs.DevourerofGods
}
// Dialogue the moment the second phase starts
if (NPC.localAI[2] == 60f)
if (NPC.localAI[2] == 60f && !bossRush)
{
string key = "Mods.CalamityMod.Status.Boss.EdgyBossText5";
Color messageColor = Color.Cyan;
@@ -727,9 +742,12 @@ namespace CalamityMod.NPCs.DevourerofGods
calamityGlobalNPC.newAI[3] = 0f;
// Anger message
string key = "Mods.CalamityMod.Status.Boss.EdgyBossText6";
Color messageColor = Color.Cyan;
CalamityUtils.DisplayLocalizedText(key, messageColor);
if (!bossRush)
{
string key = "Mods.CalamityMod.Status.Boss.EdgyBossText6";
Color messageColor = Color.Cyan;
CalamityUtils.DisplayLocalizedText(key, messageColor);
}
// Summon Cosmic Guardians
SoundEngine.PlaySound(AttackSound with { Pitch = AttackSound.Pitch + extrapitch }, player.Center);
@@ -1578,9 +1596,12 @@ namespace CalamityMod.NPCs.DevourerofGods
if (revenge)
spawnDoGCountdown = 10;
string key = "Mods.CalamityMod.Status.Boss.EdgyBossText";
Color messageColor = Color.Cyan;
CalamityUtils.DisplayLocalizedText(key, messageColor);
if (!bossRush)
{
string key = "Mods.CalamityMod.Status.Boss.EdgyBossText";
Color messageColor = Color.Cyan;
CalamityUtils.DisplayLocalizedText(key, messageColor);
}
NPC.TargetClosest();
spawnedGuardians = true;
@@ -2606,7 +2627,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteEffects = SpriteEffects.FlipHorizontally;
bool useOtherTextures = (Phase2Started && NPC.localAI[2] <= 60f) || NPC.IsABestiaryIconDummy;
Texture2D texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadS").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value;
Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
if (NPC.IsABestiaryIconDummy)
NPC.frame = texture2D15.Frame();
@@ -2618,12 +2639,12 @@ namespace CalamityMod.NPCs.DevourerofGods
if (!NPC.dontTakeDamage)
{
texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadSGlow").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadGlow").Value;
texture2D15 = useOtherTextures ? Phase2Texture_Glow.Value : Texture_Glow.Value;
Color glowmaskLerp = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskLerp, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadSGlow2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadGlow2").Value;
texture2D15 = useOtherTextures ? Phase2Texture_Glow2.Value : Texture_Glow2.Value;
glowmaskLerp = Color.Lerp(Color.White, Color.Cyan, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskLerp, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
@@ -2885,7 +2906,7 @@ namespace CalamityMod.NPCs.DevourerofGods
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 200, true);
target.AddBuff(ModContent.BuffType<WhisperingDeath>(), 600, true);
if (target.Calamity().dogTextCooldown <= 0)
if (target.Calamity().dogTextCooldown <= 0 && !BossRushEvent.BossRushActive)
{
string text = Utils.SelectRandom(Main.rand, new string[]
{
+18 -3
View File
@@ -8,6 +8,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -23,6 +24,12 @@ namespace CalamityMod.NPCs.DevourerofGods
public static int phase1IconIndex;
public static int phase2IconIndex;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> Texture_Glow2;
public static Asset<Texture2D> Phase2Texture;
public static Asset<Texture2D> Phase2Texture_Glow;
public static Asset<Texture2D> Phase2Texture_Glow2;
internal static void LoadHeadIcons()
{
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsTail_Head_Boss";
@@ -42,6 +49,14 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
Texture_Glow2 = ModContent.Request<Texture2D>(Texture + "Glow2", AssetRequestMode.AsyncLoad);
Phase2Texture = ModContent.Request<Texture2D>(Texture + "S", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow = ModContent.Request<Texture2D>(Texture + "SGlow", AssetRequestMode.AsyncLoad);
Phase2Texture_Glow2 = ModContent.Request<Texture2D>(Texture + "SGlow2", AssetRequestMode.AsyncLoad);
}
}
internal void setInvulTime(int time)
@@ -355,7 +370,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteEffects = SpriteEffects.FlipHorizontally;
bool useOtherTextures = phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60f;
Texture2D texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailS").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value;
Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Vector2 drawPosition = NPC.Center - screenPos;
@@ -365,12 +380,12 @@ namespace CalamityMod.NPCs.DevourerofGods
if (!NPC.dontTakeDamage)
{
texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailSGlow").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailGlow").Value;
texture2D15 = useOtherTextures ? Phase2Texture_Glow.Value : Texture_Glow.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
spriteBatch.Draw(texture2D15, drawPosition, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = useOtherTextures ? ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailSGlow2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailGlow2").Value;
texture2D15 = useOtherTextures ? Phase2Texture_Glow2.Value : Texture_Glow2.Value;
glowmaskColor = Color.Lerp(Color.White, Color.Cyan, 0.5f);
spriteBatch.Draw(texture2D15, drawPosition, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+10 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Critters;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -14,7 +15,11 @@ namespace CalamityMod.NPCs.DraedonLabThings
{
public class Androomba : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public SoundStyle HurrySound = new("CalamityMod/Sounds/Custom/WulfrumDroidHurry", 2) { PitchVariance = 0.3f };
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 22;
@@ -25,6 +30,10 @@ namespace CalamityMod.NPCs.DraedonLabThings
value.Position.Y += 18;
value.PortraitPositionYOverride = 38f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "_Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -253,7 +262,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/Androomba_Glow").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
drawPosition.Y += DrawOffsetY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
+8 -1
View File
@@ -2,6 +2,7 @@
using CalamityMod.Items.Critters;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -12,11 +13,17 @@ namespace CalamityMod.NPCs.DraedonLabThings
{
public class Nanodroid : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 8;
NPCID.Sets.CountsAsCritter[NPC.type] = true;
Main.npcCatchable[NPC.type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "_Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -65,7 +72,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/Nanodroid_Glow").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
spriteBatch.Draw(critterTexture, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0f);
@@ -1,6 +1,7 @@
using CalamityMod.Items.Critters;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,6 +12,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
{
public class NanodroidDysfunctional : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.Nanodroid.DisplayName");
public override void SetStaticDefaults()
{
@@ -18,6 +20,10 @@ namespace CalamityMod.NPCs.DraedonLabThings
Main.npcFrameCount[NPC.type] = 8;
NPCID.Sets.CountsAsCritter[NPC.type] = true;
Main.npcCatchable[NPC.type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "_Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -74,7 +80,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/NanodroidDysfunctional_Glow").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
spriteBatch.Draw(critterTexture, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0f);
@@ -1,6 +1,7 @@
using CalamityMod.Items.Critters;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,6 +12,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
{
public class NanodroidPlagueGreen : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.Nanodroid.DisplayName");
public override void SetStaticDefaults()
{
@@ -18,6 +20,10 @@ namespace CalamityMod.NPCs.DraedonLabThings
Main.npcFrameCount[NPC.type] = 8;
NPCID.Sets.CountsAsCritter[NPC.type] = true;
Main.npcCatchable[NPC.type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "_Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -74,7 +80,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/NanodroidPlagueGreen_Glow").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
spriteBatch.Draw(critterTexture, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0f);
+7 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Critters;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
@@ -11,6 +12,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
{
public class NanodroidPlagueRed : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.Nanodroid.DisplayName");
public override void SetStaticDefaults()
{
@@ -18,6 +20,10 @@ namespace CalamityMod.NPCs.DraedonLabThings
Main.npcFrameCount[NPC.type] = 8;
NPCID.Sets.CountsAsCritter[NPC.type] = true;
Main.npcCatchable[NPC.type] = true;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "_Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -74,7 +80,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/NanodroidPlagueRed_Glow").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
spriteBatch.Draw(critterTexture, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0f);
+8 -1
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -50,6 +51,8 @@ namespace CalamityMod.NPCs.DraedonLabThings
public const float Gravity = 0.4f;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 17;
@@ -61,6 +64,10 @@ namespace CalamityMod.NPCs.DraedonLabThings
value.Position.Y += 12;
value.PortraitPositionYOverride = 32f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glowmask", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -367,7 +374,7 @@ namespace CalamityMod.NPCs.DraedonLabThings
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/DraedonLabThings/RepairUnitCritterGlowmask").Value;
Texture2D glowmask = GlowTexture.Value;
Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY;
SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
spriteBatch.Draw(critterTexture, drawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0f);
+8 -1
View File
@@ -13,6 +13,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -29,6 +30,8 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
public static int phase1IconIndex;
public static int phase2IconIndex;
public static Asset<Texture2D> GlowTexture;
internal static void LoadHeadIcons()
{
string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Apollo/ApolloHead";
@@ -135,6 +138,10 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
Rotation = -MathHelper.PiOver4
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -1596,7 +1603,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
}
}
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Apollo/ApolloGlow").Value;
texture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
+63 -15
View File
@@ -28,6 +28,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -155,6 +156,30 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public static readonly SoundStyle LaserLoopSound = new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/AresCircleLaserLoop") with { IsLooped = true };
public static readonly SoundStyle LaserEndSound = new("CalamityMod/Sounds/Custom/ExoMechs/AresCircleLaserEnd");
#region Textures
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> NeuronTexture;
public static Asset<Texture2D> NeuronTexture_Glow;
public static Asset<Texture2D> ArmTopTexture;
public static Asset<Texture2D> ArmTopTexture2;
public static Asset<Texture2D> ArmSegmentTexture;
public static Asset<Texture2D> ArmTopShoulderTexture;
public static Asset<Texture2D> ArmBottomConnectorTexture;
public static Asset<Texture2D> ArmBottomTexture;
public static Asset<Texture2D> ArmBottomTexture2;
public static Asset<Texture2D> ArmBottomShoulderTexture;
public static Asset<Texture2D> ArmTopTexture2_Glow;
public static Asset<Texture2D> ArmSegmentTexture_Glow;
public static Asset<Texture2D> ArmTopShoulderTexture_Glow;
public static Asset<Texture2D> ArmBottomTexture_Glow;
public static Asset<Texture2D> ArmBottomTexture2_Glow;
public static Asset<Texture2D> ArmBottomShoulderTexture_Glow;
#endregion
public override void SetStaticDefaults()
{
NPCID.Sets.TrailingMode[NPC.type] = 3;
@@ -166,6 +191,29 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Scale = 0.4f
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
string AresPath = "CalamityMod/NPCs/ExoMechs/Ares/Ares";
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
NeuronTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/AergiaNeuron", AssetRequestMode.AsyncLoad);
NeuronTexture_Glow = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/AergiaNeuron_Glow", AssetRequestMode.AsyncLoad);
ArmTopTexture = ModContent.Request<Texture2D>(AresPath + "ArmTopPart1", AssetRequestMode.AsyncLoad);
ArmTopTexture2 = ModContent.Request<Texture2D>(AresPath + "ArmTopPart2", AssetRequestMode.AsyncLoad);
ArmSegmentTexture = ModContent.Request<Texture2D>(AresPath + "ArmTopSegment", AssetRequestMode.AsyncLoad);
ArmTopShoulderTexture = ModContent.Request<Texture2D>(AresPath + "ArmTopShoulder", AssetRequestMode.AsyncLoad);
ArmBottomConnectorTexture = ModContent.Request<Texture2D>(AresPath + "BottomArmConnector", AssetRequestMode.AsyncLoad);
ArmBottomTexture = ModContent.Request<Texture2D>(AresPath + "BottomArmPart1", AssetRequestMode.AsyncLoad);
ArmBottomTexture2 = ModContent.Request<Texture2D>(AresPath + "BottomArmPart2", AssetRequestMode.AsyncLoad);
ArmBottomShoulderTexture = ModContent.Request<Texture2D>(AresPath + "BottomArmShoulder", AssetRequestMode.AsyncLoad);
ArmTopTexture2_Glow = ModContent.Request<Texture2D>(AresPath + "ArmTopPart2Glow", AssetRequestMode.AsyncLoad);
ArmSegmentTexture_Glow = ModContent.Request<Texture2D>(AresPath + "ArmTopSegmentGlow", AssetRequestMode.AsyncLoad);
ArmTopShoulderTexture_Glow = ModContent.Request<Texture2D>(AresPath + "ArmTopShoulderGlow", AssetRequestMode.AsyncLoad);
ArmBottomTexture_Glow = ModContent.Request<Texture2D>(AresPath + "BottomArmPart1Glow", AssetRequestMode.AsyncLoad);
ArmBottomTexture2_Glow = ModContent.Request<Texture2D>(AresPath + "BottomArmPart2Glow", AssetRequestMode.AsyncLoad);
ArmBottomShoulderTexture_Glow = ModContent.Request<Texture2D>(AresPath + "BottomArmShoulderGlow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -1211,7 +1259,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Vector2 center = NPC.Center - screenPos;
spriteBatch.Draw(texture, center, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, SpriteEffects.None, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBodyGlow").Value;
texture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages)
{
@@ -1283,14 +1331,14 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Draw back arms.
if (backArm)
{
Texture2D shoulderTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopShoulder").Value;
Texture2D armTexture1 = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopPart1").Value;
Texture2D armSegmentTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopSegment").Value;
Texture2D armTexture2 = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopPart2").Value;
Texture2D shoulderTexture = ArmTopShoulderTexture.Value;
Texture2D armTexture1 = ArmTopTexture.Value;
Texture2D armSegmentTexture = ArmSegmentTexture.Value;
Texture2D armTexture2 = ArmTopTexture2.Value;
Texture2D shoulderGlowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopShoulderGlow").Value;
Texture2D armSegmentGlowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopSegmentGlow").Value;
Texture2D armGlowmask2 = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresArmTopPart2Glow").Value;
Texture2D shoulderGlowmask = ArmTopShoulderTexture_Glow.Value;
Texture2D armSegmentGlowmask = ArmSegmentTexture_Glow.Value;
Texture2D armGlowmask2 = ArmTopTexture2_Glow.Value;
Vector2 shoulderDrawPosition = NPC.Center + NPC.scale * new Vector2(direction * 176f, -100f);
Vector2 arm1DrawPosition = shoulderDrawPosition + NPC.scale * new Vector2(direction * (shoulderTexture.Width + 16f), 10f);
@@ -1352,14 +1400,14 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
}
else
{
Texture2D shoulderTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmShoulder").Value;
Texture2D connectorTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmConnector").Value;
Texture2D armTexture1 = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmPart1").Value;
Texture2D armTexture2 = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmPart2").Value;
Texture2D shoulderTexture = ArmBottomShoulderTexture.Value;
Texture2D connectorTexture = ArmBottomConnectorTexture.Value;
Texture2D armTexture1 = ArmBottomTexture.Value;
Texture2D armTexture2 = ArmBottomTexture2.Value;
Texture2D shoulderGlowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmShoulderGlow").Value;
Texture2D armTexture1Glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmPart1Glow").Value;
Texture2D armTexture2Glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresBottomArmPart2Glow").Value;
Texture2D shoulderGlowmask = ArmBottomShoulderTexture_Glow.Value;
Texture2D armTexture1Glowmask = ArmBottomTexture_Glow.Value;
Texture2D armTexture2Glowmask = ArmBottomTexture2_Glow.Value;
Vector2 shoulderDrawPosition = NPC.Center + NPC.scale * new Vector2(direction * 110f, -54f);
Vector2 connectorDrawPosition = shoulderDrawPosition + NPC.scale * new Vector2(direction * 20f, 32f);
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -70,11 +71,17 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public static readonly SoundStyle NukeExplosionSound = new("CalamityMod/Sounds/Custom/ExoMechs/AresGaussNukeExplosion") { Volume = 1.45f };
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 3;
NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -587,7 +594,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
spriteBatch.Draw(texture, center, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresGaussNukeGlow").Value;
Texture2D glowTexture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages)
{
+8 -1
View File
@@ -9,6 +9,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -73,11 +74,17 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public static readonly SoundStyle LaserbeamShootSound = new("CalamityMod/Sounds/Custom/ExoMechs/AresLaserArmShoot") { Volume = 1.1f };
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 3;
NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -633,7 +640,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
spriteBatch.Draw(texture, center, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresLaserCannonGlow").Value;
Texture2D glowTexture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages)
{
+8 -1
View File
@@ -9,6 +9,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -67,11 +68,17 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Telegraph sound.
public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/ExoMechs/AresPlasmaArmCharge");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 3;
NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -585,7 +592,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
spriteBatch.Draw(texture, center, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresPlasmaFlamethrowerGlow").Value;
Texture2D glowTexture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages)
{
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -68,11 +69,17 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public static readonly SoundStyle TeslaOrbShootSound = new("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot", 2) { Volume = 1.1f };
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 3;
NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -579,7 +586,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
spriteBatch.Draw(texture, center, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Ares/AresTeslaCannonGlow").Value;
Texture2D glowTexture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages)
{
+8 -1
View File
@@ -13,6 +13,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -41,6 +42,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
public static readonly SoundStyle SpinLaserbeamSound = new("CalamityMod/Sounds/Custom/ExoMechs/ArtemisSpinLaserbeam") { Volume = 1.3f };
public static Asset<Texture2D> GlowTexture;
internal static void LoadHeadIcons()
{
string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Artemis/ArtemisHead";
@@ -168,6 +171,10 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
Rotation = MathHelper.Pi - MathHelper.PiOver4
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -1491,7 +1498,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
}
}
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Artemis/ArtemisGlow").Value;
texture = GlowTexture.Value;
if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
+19 -5
View File
@@ -1,12 +1,14 @@
using System;
using System.IO;
using CalamityMod.Events;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.NPCs.ExoMechs.Ares;
using CalamityMod.NPCs.ExoMechs.Thanatos;
using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -80,6 +82,11 @@ namespace CalamityMod.NPCs.ExoMechs
public static readonly SoundStyle TeleportSound = new("CalamityMod/Sounds/Custom/DraedonTeleport");
public static readonly SoundStyle SelectionSound = new("CalamityMod/Sounds/Custom/Codebreaker/ExoMechsIconSelect");
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> HoloTexture;
public static Asset<Texture2D> ProjectorTexture;
public static Asset<Texture2D> ProjectorTexture_Glow;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 12;
@@ -94,6 +101,13 @@ namespace CalamityMod.NPCs.ExoMechs
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.ShouldBeCountedAsBoss[NPC.type] = true;
NPCID.Sets.MustAlwaysDraw[NPC.type] = true;
if (!Main.dedServ)
{
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glowmask", AssetRequestMode.AsyncLoad);
HoloTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/HologramDraedon", AssetRequestMode.AsyncLoad);
ProjectorTexture = ModContent.Request<Texture2D>(Texture + "Projector", AssetRequestMode.AsyncLoad);
ProjectorTexture_Glow = ModContent.Request<Texture2D>(Texture + "ProjectorGlowmask", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -834,11 +848,11 @@ namespace CalamityMod.NPCs.ExoMechs
spriteBatch.EnterShaderRegion();
bool holo = HasBeenKilled && KillReappearDelay <= 0;
bool leaving = HasBeenKilled && DefeatTimer > DelayBeforeDefeatStandup + TalkDelay * 8f + 200f;
Texture2D texture = HasBeenKilled && KillReappearDelay <= 0f ? ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/HologramDraedon").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/DraedonGlowmask").Value;
Texture2D projector = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/DraedonProjector").Value;
Texture2D projectorglow = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/DraedonProjectorGlowmask").Value;
Texture2D gun = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/PulseRifle").Value;
Texture2D texture = HasBeenKilled && KillReappearDelay <= 0f ? HoloTexture.Value : TextureAssets.Npc[NPC.type].Value;
Texture2D glowmask = Texture_Glow.Value;
Texture2D projector = ProjectorTexture.Value;
Texture2D projectorglow = ProjectorTexture_Glow.Value;
Texture2D gun = TextureAssets.Item[ModContent.ItemType<PulseRifle>()].Value;
Rectangle frame = NPC.frame;
Vector2 drawPosition = NPC.Center - screenPos - Vector2.UnitY * 38f;
+8 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -50,10 +51,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.ThanatosHead.DisplayName");
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -625,7 +632,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosBody1Glow").Value;
texture = GlowTexture.Value;
spriteBatch.Draw(texture, center, NPC.frame, Color.White * NPC.Opacity, NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
SmokeDrawer.DrawSet(NPC.Center);
+9 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -47,11 +48,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
private const float timeToOpenAndFireLasers = 36f;
private const float segmentCloseTimerDecrement = 0.2f;
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.ThanatosHead.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -627,7 +635,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosBody2Glow").Value;
texture = GlowTexture.Value;
spriteBatch.Draw(texture, center, NPC.frame, Color.White * NPC.Opacity, NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
SmokeDrawer.DrawSet(NPC.Center);
+29 -8
View File
@@ -11,6 +11,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -36,6 +37,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
public SlotId LaserSoundSlot;
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> AuraTexture;
public static Asset<Texture2D> ReticleLeftTexture;
public static Asset<Texture2D> ReticleRightTexture;
public static Asset<Texture2D> ReticleProngLeftTexture;
public static Asset<Texture2D> ReticleProngRightTexture;
public static Asset<Texture2D> ReticleTopTexture;
public static Asset<Texture2D> ReticleBottomTexture;
internal static void LoadHeadIcons()
{
string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalHead";
@@ -139,6 +149,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
value.Position.X += 52f;
value.Position.Y += 16f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
ReticleLeftTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleLeft", AssetRequestMode.AsyncLoad);
ReticleRightTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleRight", AssetRequestMode.AsyncLoad);
ReticleTopTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleTop", AssetRequestMode.AsyncLoad);
ReticleBottomTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleHead", AssetRequestMode.AsyncLoad);
ReticleProngRightTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleProngLeft", AssetRequestMode.AsyncLoad);
ReticleProngLeftTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleProngRight", AssetRequestMode.AsyncLoad);
AuraTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/THanosAura", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -1103,7 +1124,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosHeadGlow").Value;
texture = GlowTexture.Value;
Color glowmaskColor = vulnerable ? ((AIState == (int)Phase.Deathray && SecondaryAIState != (int)SecondaryPhase.PassiveAndImmune) ? Color.Lerp(new Color(255, 64, 64), Color.CornflowerBlue, NPC.Calamity().newAI[2] / deathrayTelegraphDuration) : new Color(255, 64, 64)) : Color.White;
spriteBatch.Draw(texture, center, NPC.frame, glowmaskColor * NPC.Opacity, NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
@@ -1117,7 +1138,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
spriteBatch.SetBlendState(BlendState.Additive);
// A large, faded circle. Is rescaled to fit the radius of the slowdown area.
Texture2D auraTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/THanosAura").Value;
Texture2D auraTexture = AuraTexture.Value;
float lifeRatio = NPC.life / (float)NPC.lifeMax;
@@ -1152,12 +1173,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
Player target = Main.player[NPC.target];
Texture2D leftReticleTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleLeft").Value;
Texture2D rightReticleTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleRight").Value;
Texture2D topReticleTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleTop").Value;
Texture2D bottomReticleTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleHead").Value;
Texture2D leftReticleProngTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleProngLeft").Value;
Texture2D rightReticleProngTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosReticleProngRight").Value;
Texture2D leftReticleTexture = ReticleLeftTexture.Value;
Texture2D rightReticleTexture = ReticleRightTexture.Value;
Texture2D topReticleTexture = ReticleTopTexture.Value;
Texture2D bottomReticleTexture = ReticleBottomTexture.Value;
Texture2D leftReticleProngTexture = ReticleProngLeftTexture.Value;
Texture2D rightReticleProngTexture = ReticleProngRightTexture.Value;
// The reticle fades away and moves farther away from the target the closer they are to the aura.
// Once far away, the reticle will flash between red and white as an indicator.
+9 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.Sounds;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -47,11 +48,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
private const float timeToOpenAndFireLasers = 36f;
private const float segmentCloseTimerDecrement = 0.2f;
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.ThanatosHead.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -625,7 +633,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosTailGlow").Value;
texture = GlowTexture.Value;
spriteBatch.Draw(texture, center, NPC.frame, Color.White * NPC.Opacity, NPC.rotation, vector, NPC.scale, spriteEffects, 0f);
SmokeDrawer.DrawSet(NPC.Center);
+8 -1
View File
@@ -19,6 +19,7 @@ using CalamityMod.Tiles.Ores;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -87,6 +88,8 @@ namespace CalamityMod.NPCs.HiveMind
public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/HiveMindRoar");
public static readonly SoundStyle FastRoarSound = new("CalamityMod/Sounds/Custom/HiveMindRoarFast");
public static Asset<Texture2D> Phase2Texture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 16;
@@ -101,6 +104,10 @@ namespace CalamityMod.NPCs.HiveMind
value.Position.Y += 3f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
NPCID.Sets.MPAllowedEnemies[Type] = true;
if (!Main.dedServ)
{
Phase2Texture = ModContent.Request<Texture2D>(Texture + "P2", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -287,7 +294,7 @@ namespace CalamityMod.NPCs.HiveMind
if (phase2)
{
SpriteEffects spriteEffects = NPC.direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/HiveMind/HiveMindP2").Value;
Texture2D texture = Phase2Texture.Value;
Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height);
Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2);
Color afterimageBaseColor = Color.White;
+7 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.UI.VanillaBossBars;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -24,6 +25,7 @@ namespace CalamityMod.NPCs.Leviathan
private bool forceChargeFrames = false;
private int frameUsed = 0;
public bool HasBegunSummoningLeviathan = false;
public static Asset<Texture2D> ChargeTexture;
public bool WaitingForLeviathan
{
get
@@ -46,6 +48,10 @@ namespace CalamityMod.NPCs.Leviathan
Scale = 0.5f
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
ChargeTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/AnahitaStabbing", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -885,7 +891,7 @@ namespace CalamityMod.NPCs.Leviathan
texture = TextureAssets.Npc[NPC.type].Value;
break;
case 1:
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/AnahitaStabbing").Value;
texture = ChargeTexture.Value;
break;
}
+3 -3
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Leviathan
private bool gfbAnaSummoned = false;
private int soundDelay = 0;
private float extrapitch = 0;
public static Texture2D AttackTexture = null;
public static Asset<Texture2D> AttackTexture = null;
public static readonly SoundStyle RoarMeteorSound = new("CalamityMod/Sounds/Custom/LeviathanRoarMeteor");
public static readonly SoundStyle RoarChargeSound = new("CalamityMod/Sounds/Custom/LeviathanRoarCharge");
@@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.Leviathan
Main.npcFrameCount[NPC.type] = 3;
NPCID.Sets.BossBestiaryPriority.Add(Type);
if (!Main.dedServ)
AttackTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/LeviathanAttack", AssetRequestMode.ImmediateLoad).Value;
AttackTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/LeviathanAttack", AssetRequestMode.AsyncLoad);
}
public override void SetDefaults()
@@ -919,7 +919,7 @@ namespace CalamityMod.NPCs.Leviathan
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D texture = AttackTexture;
Texture2D texture = AttackTexture.Value;
if (NPC.ai[0] == 1f || NPC.Calamity().newAI[3] < 180f)
{
texture = TextureAssets.Npc[NPC.type].Value;
+10 -2
View File
@@ -3,6 +3,7 @@ using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
@@ -13,6 +14,9 @@ namespace CalamityMod.NPCs.Leviathan
{
public class LeviathanStart : ModNPC
{
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -25,6 +29,10 @@ namespace CalamityMod.NPCs.Leviathan
PortraitScale = 0.75f
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -116,7 +124,7 @@ namespace CalamityMod.NPCs.Leviathan
if (NPC.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D drawTex = Main.zenithWorld ? ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/Leviathan").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D drawTex = Main.zenithWorld ? TextureAssets.Npc[ModContent.NPCType<Leviathan>()].Value : TextureAssets.Npc[NPC.type].Value;
Rectangle frame = Main.zenithWorld ? drawTex.Frame(2, 3, 0, 0) : NPC.frame;
Vector2 origin = new Vector2(drawTex.Width / 2, drawTex.Height / 2);
@@ -136,7 +144,7 @@ namespace CalamityMod.NPCs.Leviathan
if (!Main.zenithWorld)
{
drawTex = ModContent.Request<Texture2D>("CalamityMod/NPCs/Leviathan/LeviathanStartGlow").Value;
drawTex = GlowTexture.Value;
spriteBatch.Draw(drawTex, drawPos, frame, Color.White, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
}
+9 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Dusts;
using CalamityMod.Projectiles.Boss;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
@@ -12,11 +13,18 @@ namespace CalamityMod.NPCs.NormalNPCs
{
public class ProfanedEnergyLantern : ModNPC
{
public static Asset<Texture2D> ChainTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.ProfanedEnergyBody.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 6;
if (!Main.dedServ)
{
ChainTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/NormalNPCs/ProfanedEnergySegment", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -218,7 +226,7 @@ namespace CalamityMod.NPCs.NormalNPCs
drawPositionY = Main.npc[CalamityGlobalNPC.energyFlame].Center.Y - center.Y;
drawPositionY -= 10f;
Color color = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f));
Texture2D chain = ModContent.Request<Texture2D>("CalamityMod/NPCs/NormalNPCs/ProfanedEnergySegment").Value;
Texture2D chain = ChainTexture.Value;
Main.spriteBatch.Draw(chain, new Vector2(center.X - screenPos.X, center.Y - screenPos.Y),
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, chain.Width, chain.Height)), color, rotation,
new Vector2((float)chain.Width * 0.5f, (float)chain.Height * 0.5f), 1f, SpriteEffects.None, 0f);
+8
View File
@@ -6,6 +6,8 @@ using CalamityMod.DataStructures;
using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.Bestiary;
@@ -19,11 +21,17 @@ namespace CalamityMod.NPCs.NormalNPCs
public override string Texture => $"Terraria/Images/NPC_{NPCID.SkeletronPrime}";
public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18";
public static Asset<Texture2D> EyeTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true };
NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData);
if (!Main.dedServ)
{
EyeTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow");
}
}
public override void SetDefaults()
+11 -2
View File
@@ -8,8 +8,10 @@ using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
using Terraria.ModLoader;
@@ -44,6 +46,9 @@ namespace CalamityMod.NPCs.NormalNPCs
}
public bool Phase2 => NPC.life < NPC.lifeMax * 0.5f;
public ref float AttackTimer => ref NPC.ai[1];
public static Asset<Texture2D> AttackTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 8;
@@ -56,6 +61,10 @@ namespace CalamityMod.NPCs.NormalNPCs
PortraitPositionYOverride = 2f
};
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
AttackTexture = ModContent.Request<Texture2D>(Texture + "Attack", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -406,13 +415,13 @@ namespace CalamityMod.NPCs.NormalNPCs
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/NormalNPCs/ThiccWaifuAttack").Value;
Texture2D texture = AttackTexture.Value;
SpriteEffects direction = NPC.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
if (CurrentAttackState != AttackState.Hover)
Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0);
else
{
texture = ModContent.Request<Texture2D>(Texture).Value;
texture = TextureAssets.Npc[NPC.type].Value;
Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0);
}
if (Main.zenithWorld)
+8 -1
View File
@@ -22,6 +22,7 @@ using CalamityMod.NPCs.TownNPCs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
@@ -42,6 +43,8 @@ namespace CalamityMod.NPCs.OldDuke
public SlotId RoarSoundSlot;
public static Asset<Texture2D> GlowTexture;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 7;
@@ -54,6 +57,10 @@ namespace CalamityMod.NPCs.OldDuke
};
value.Position.X += 14f;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -327,7 +334,7 @@ namespace CalamityMod.NPCs.OldDuke
if (NPC.ai[0] >= 4f && NPC.Calamity().newAI[1] != 1f)
{
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/OldDuke/OldDukeGlow").Value;
texture2D15 = GlowTexture.Value;
Color yellowLerpColor = Color.Lerp(Color.White, Color.Yellow, 0.5f);
drawLerpColor = Color.Yellow;
+8 -1
View File
@@ -8,6 +8,7 @@ using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -37,6 +38,8 @@ namespace CalamityMod.NPCs.Other
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/Lordeath");
public static Asset<Texture2D> DeathAnimationTexture;
public override void SetStaticDefaults()
{
NPCID.Sets.MPAllowedEnemies[Type] = true;
@@ -44,6 +47,10 @@ namespace CalamityMod.NPCs.Other
NPCID.Sets.ShouldBeCountedAsBoss[Type] = true;
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 7;
if (!Main.dedServ)
{
DeathAnimationTexture = ModContent.Request<Texture2D>(Texture + "DEATH", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -425,7 +432,7 @@ namespace CalamityMod.NPCs.Other
if (Dying)
{
// death animation
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Other/THELORDEDEATH").Value;
texture = DeathAnimationTexture.Value;
int xFrame = 0;
int yFrame = frameToUse;
if (frameToUse > 13)
+14 -2
View File
@@ -3,6 +3,7 @@ using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -17,10 +18,21 @@ namespace CalamityMod.NPCs.Perforator
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/PerfLargeHit", 3);
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfLargeDeath");
public static Asset<Texture2D> AltTexture;
public static Asset<Texture2D> Texture_Glow;
public static Asset<Texture2D> AltTexture_Glow;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PerforatorHeadLarge.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
AltTexture = ModContent.Request<Texture2D>(Texture + "Alt", AssetRequestMode.AsyncLoad);
AltTexture_Glow = ModContent.Request<Texture2D>(Texture + "AltGlow", AssetRequestMode.AsyncLoad);
Texture_Glow = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -172,7 +184,7 @@ namespace CalamityMod.NPCs.Perforator
if (NPC.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = NPC.localAI[3] == 1f ? ModContent.Request<Texture2D>("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAlt").Value : TextureAssets.Npc[NPC.type].Value;
Texture2D texture2D15 = NPC.localAI[3] == 1f ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value;
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2));
Vector2 drawLocation = NPC.Center - screenPos;
@@ -180,7 +192,7 @@ namespace CalamityMod.NPCs.Perforator
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = NPC.localAI[3] == 1f ? ModContent.Request<Texture2D>("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAltGlow").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/Perforator/PerforatorBodyLargeGlow").Value;
texture2D15 = NPC.localAI[3] == 1f ? AltTexture_Glow.Value : Texture_Glow.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Yellow, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+8 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -19,10 +20,16 @@ namespace CalamityMod.NPCs.Perforator
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/PerfMediumHit", 3);
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfMediumDeath");
public static Asset<Texture2D> GlowTexture;
public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PerforatorHeadMedium.DisplayName");
public override void SetStaticDefaults()
{
this.HideFromBestiary();
if (!Main.dedServ)
{
GlowTexture = ModContent.Request<Texture2D>(Texture + "Glow", AssetRequestMode.AsyncLoad);
}
}
public override void SetDefaults()
@@ -209,7 +216,7 @@ namespace CalamityMod.NPCs.Perforator
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/Perforator/PerforatorBodyMediumGlow").Value;
texture2D15 = GlowTexture.Value;
Color glowmaskColor = Color.Lerp(Color.White, Color.Yellow, 0.5f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
Loaded 100 of 153 files, more files were not shown because too many files have changed in this diff. Show more