Merge branch '1.4.4' into cit-miscell

This commit is contained in:
CongratsIsTrash committed 2026-07-07 15:32:02 -04:00
commit ef274091c2
144 files changed
+2210 -923

No files matched your search

-1
View File
@@ -3,7 +3,6 @@ using CalamityMod.Projectiles.Summon;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
+1
View File
@@ -72,6 +72,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), bleedTickDamage, 0f, applicator.whoAmI, target.whoAmI);
tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit.
tick.CritChance = (int)applicator.GetTotalCritChance(DamageClass.Ranged);
// All ticks of Shred have a 3x base crit multiplier and have supercrits enabled.
CalamityGlobalProjectile cgp = tick.Calamity();
@@ -8,7 +8,6 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-2
View File
@@ -1,12 +1,10 @@
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-1
View File
@@ -8,7 +8,6 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-2
View File
@@ -1,10 +1,8 @@
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
-2
View File
@@ -5,8 +5,6 @@ namespace CalamityMod.Buffs.StatDebuffs
{
public class MarkedforDeath : ModBuff
{
public static int DefenseReduction = 5;
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+1
View File
@@ -327,6 +327,7 @@ namespace CalamityMod.CalPlayer
public int arsenalCooldown = 0;
public int killModeCooldown = 0;
public bool demonSwordKillMode = false;
public int oblivionCooldown = 0;
public bool exaltedKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<ExaltedOathblade>());
public bool devilsDevastationKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<DevilsDevastation>());
/// <summary>
+2
View File
@@ -2334,6 +2334,8 @@ namespace CalamityMod.CalPlayer
arsenalCooldown--;
if (killModeCooldown > 0)
killModeCooldown--;
if (oblivionCooldown > 0)
oblivionCooldown--;
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
if (transformerCooldown > 0)
+3
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Items.Accessories.Wings;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.Rarities;
using CalamityMod.Utilities.Daybreak;
@@ -35,6 +36,8 @@ namespace CalamityMod.ChatTags
return new CalamityRed.CustomTextSnippet(text);
if (options.Equals("exo", StringComparison.OrdinalIgnoreCase))
return new ExoticRainbow.CustomTextSnippet(text);
if (options.Equals("doze", StringComparison.OrdinalIgnoreCase))
return new TiredTailTextEffects(text);
return new TextSnippet(text);
}
}
+17
View File
@@ -0,0 +1,17 @@
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
{
public class OblivionCooldown : CooldownHandler
{
public static new string ID => "OblivionCooldown";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Projectiles/Melee/Yoyos/OblivionYoyo";
public override string OutlineTexture => "CalamityMod/Cooldowns/OblivionCooldownOutline";
public override Color OutlineColor => Color.MediumVioletRed;
public override Color CooldownStartColor => Color.DarkRed;
public override Color CooldownEndColor => Color.Red;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+10
View File
@@ -266,6 +266,9 @@ namespace CalamityMod.Effects
// The swirling aura effect seen around Horrible Hog while its idling.
internal static Asset<Effect> HorribleHogAuraShader;
// The shader effect for the primitive trails drawn for Providence's HolyBurnOrb/HolyLight projectiles.
internal static Asset<Effect> ProvidenceHolyOrbTrailShader;
#endregion
#region Big E's Shaders
@@ -273,6 +276,7 @@ namespace CalamityMod.Effects
internal static Asset<Effect> SeaPrismColorBlendingShader;
internal static Asset<Effect> Dissolve;
internal static Asset<Effect> PaletteSwap;
internal static Asset<Effect> BrainOfCthulhuForcefield;
#endregion
@@ -537,6 +541,9 @@ namespace CalamityMod.Effects
HorribleHogAuraShader = LoadShader("HorribleHogAuraShader");
RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura");
ProvidenceHolyOrbTrailShader = LoadShader("ProvidenceHolyOrbTrailShader");
RegisterMiscShader(ProvidenceHolyOrbTrailShader, "TrailPass", "ProvidenceHolyOrbTrail");
#endregion
#region Loading Big E's Shaders
@@ -549,6 +556,9 @@ namespace CalamityMod.Effects
Dissolve = LoadShader("Dissolve");
RegisterMiscShader(Dissolve, "DissolvePass", "Dissolve");
PaletteSwap = LoadShader("PaletteSwap");
RegisterMiscShader(PaletteSwap, "PaletteSwapPass", "PaletteSwap");
BrainOfCthulhuForcefield = LoadShader("ScreenShaders/BrainOfCthulhuForcefield");
RegisterScreenShader(BrainOfCthulhuForcefield, "BoCShieldPass", "BrainOfCthulhuForcefield");
#endregion
+35
View File
@@ -0,0 +1,35 @@
sampler baseTexture : register(s0);
float4 sourcePalette[16];
float4 targetPalette[16];
float matchThreshold = 0.01;
int paletteSize;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR
{
float4 color = tex2D(baseTexture, coords) * sampleColor;
// Check each color in the source palette
for (int i = 0; i < paletteSize; i++)
{
float3 diff = color.rgb - sourcePalette[i].rgb;
float distance = sqrt(dot(diff, diff));
// If color is close enough to this palette color, swap it
if (distance <= matchThreshold)
{
color.rgb = targetPalette[i].rgb;
break; // Stop checking once we find a match
}
}
return color;
}
technique Technique1
{
pass PaletteSwapPass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+68
View File
@@ -0,0 +1,68 @@
// 29JUN2026: fryzahh
// Programmed to work under the use of SanePrimitiveRenderer.
// Never use this shader with PrimitveRenderer.
sampler baseStreakTexture : register(s0);
sampler distortionTexture : register(s1);
matrix uTransformMatrix;
float time;
float glowPower;
float pixelationFactor;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output;
output.Position = mul(input.Position, uTransformMatrix);
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = input.Color;
float2 coords = input.TextureCoordinates;
// Fade out at the horizontal and vertical ends of the streak.
float horizonatalDistanceFromCenter = distance(0.5, coords.y);
float opacity = smoothstep(0.5, 0.5 - 0.486, horizonatalDistanceFromCenter);
// Glow from the center go out.
float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower);
float2 distortionCoords = coords + float2(time * -3.12, 0);
distortionCoords *= float2(0.25, 1);
float distortion = tex2D(distortionTexture, distortionCoords).r * 0.43;
float2 streakCoords = coords + float2(time * -2.34, 0);
streakCoords *= float2(1.25, 1);
float4 streakMapColor = tex2D(baseStreakTexture, streakCoords + distortion);
float4 returnColor = (streakMapColor * color * glow) * opacity;
returnColor = round(returnColor * 7) / 7;
return returnColor;
}
technique Technique1
{
pass TrailPass
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+17 -3
View File
@@ -586,12 +586,14 @@ namespace CalamityMod.Events
// Cooldown and boss spawn.
if (BossRushSpawnCountdown <= 0 && BossRushStage < Bosses.Count)
{
// Cooldown before next boss spawns.
// Cooldown before next boss spawns. Defaults to 1 second.
BossRushSpawnCountdown = 60;
// Increase cooldown post-Moon Lord.
// Cooldown increases to 3 seconds in tier 4 and 4 seconds in tier 5.
if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.MoonLordCore))
BossRushSpawnCountdown += 180;
BossRushSpawnCountdown += 120;
if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType<DevourerofGodsHead>()))
BossRushSpawnCountdown += 60;
// Override the spawn countdown if specified.
if (BossRushStage < Bosses.Count - 1 && Bosses[BossRushStage + 1].SpecialSpawnCountdown != -1)
@@ -691,6 +693,18 @@ namespace CalamityMod.Events
}
}
// Both Twins must be killed to progress.
else if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer)
{
int bossType = npc.type == NPCID.Spazmatism ? NPCID.Retinazer : NPCID.Spazmatism;
if (!NPC.AnyNPCs(bossType))
{
BossRushStage++;
CalamityUtils.KillAllHostileProjectiles();
HostileProjectileKillCounter = 3;
}
}
// Anahita and Leviathan manually check for each other (this probably isn't necessary).
else if (npc.type == ModContent.NPCType<Anahita>() || npc.type == ModContent.NPCType<Leviathan>())
{
+1
View File
@@ -63,6 +63,7 @@ namespace CalamityMod.ILEditing
// Mechanics / features
On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand;
On_NPC.RerollVariation += AllowPatronNameRerollsOnLicenseUse;
IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom;
IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments;
On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown;
+104 -9
View File
@@ -30,6 +30,7 @@ using CalamityMod.Tiles;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Walls;
using CalamityMod.Walls.UnsafeWalls;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Mono.Cecil.Cil;
@@ -326,6 +327,27 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Allow Patron Name Rerolls on License Use
private static bool AllowPatronNameRerollsOnLicenseUse(On_NPC.orig_RerollVariation orig, NPC self)
{
bool success = orig(self);
if (success)
{
if (self.type == NPCID.TownBunny)
CalamityWorld.bunnyName = false;
if (self.type == NPCID.TownCat)
CalamityWorld.catName = false;
if (self.type == NPCID.TownDog)
CalamityWorld.dogName = false;
if (!self.TryGetGlobalNPC<CalamityGlobalTownNPC>(out var calGlobalTownNPC))
return success;
calGlobalTownNPC.setNewName = true;
}
return success;
}
#endregion
#region Prevent Diabolists from Dropping Stuff in GFB Before Plantera
private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self)
{
@@ -1118,19 +1140,92 @@ namespace CalamityMod.ILEditing
{
// If an Abyss wall is detected, try to find another teleportation location
bool canSpawn = false;
int teleportStartX = 100;
int halfWorldWidth = Main.maxTilesX / 2;
int teleportStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 175) + 35 : halfWorldWidth + (halfWorldWidth - 175) - 35;
int teleportRangeX = Main.maxTilesX - 200;
int teleportStartY = 100;
int underworldLayer = Main.UnderworldLayer;
Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings
int teleportRangeY = Main.UnderworldLayer;
int attempts = 0;
int maxAttempts = 1000;
int teleportPositionX = 0;
int teleportPositionY = 0;
Vector2 teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
while (!canSpawn && attempts < maxAttempts)
{
avoidLava = true,
avoidHurtTiles = true,
maximumFallDistanceFromOrignalPoint = 100,
attemptsBeforeGivingUp = 1000
});
attempts++;
if (Abyss.AtLeftSideOfWorld)
teleportPositionX = teleportStartX + Main.rand.Next(teleportRangeX);
else
teleportPositionX = teleportStartX - Main.rand.Next(teleportRangeX);
teleportPositionY = teleportStartY + Main.rand.Next(teleportRangeY);
teleportPositionX = MathHelper.Clamp(teleportPositionX, 5, Main.maxTilesX - 5);
teleportPositionY = MathHelper.Clamp(teleportPositionY, 5, Main.maxTilesY - 5);
teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
if (Collision.SolidCollision(teleportPosition, self.width, self.height))
continue;
Tile tile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY));
bool behindTempleWalls = tile.WallType == WallID.LihzahrdBrickUnsafe && teleportPositionY > Main.worldSurface && !NPC.downedPlantBoss;
bool behindDungeonWalls = Main.wallDungeon[tile.WallType] && teleportPositionY > Main.worldSurface && !NPC.downedBoss3;
if (behindTempleWalls || behindDungeonWalls)
continue;
int distanceToGround = 0;
int maxFallDistance = 100;
while (distanceToGround < maxFallDistance)
{
Tile groundTile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY + distanceToGround));
teleportPosition = new Vector2(teleportPositionX, teleportPositionY + distanceToGround) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
Collision.SlopeCollision(teleportPosition, self.velocity, self.width, self.height, self.gravDir);
if (!Collision.SolidCollision(teleportPosition, self.width, self.height))
{
distanceToGround++;
continue;
}
if (groundTile.HasUnactuatedTile && Main.tileSolid[groundTile.TileType])
break;
distanceToGround++;
}
teleportPosition.Y -= 16f;
bool inLava = Collision.LavaCollision(teleportPosition, self.width, self.height);
bool onHurtingTile = Collision.AnyHurtingTiles(teleportPosition, self.width, self.height);
bool insideBlocks = Collision.SolidCollision(teleportPosition, self.width, self.height);
bool reachedMaxFallDistance = distanceToGround >= maxFallDistance;
if (inLava || onHurtingTile || insideBlocks || reachedMaxFallDistance)
continue;
Vector2 checkDirection = Vector2.UnitX * 16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection)
continue;
checkDirection = Vector2.UnitX * -16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection)
continue;
checkDirection = Vector2.UnitY * 16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection)
{
checkDirection = Vector2.UnitY * -16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection)
{
canSpawn = true;
teleportPositionY += distanceToGround;
teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
break;
}
}
}
// Attempt teleporting again with the new location
orig(self, newerPos, Style, extraInfo);
orig(self, teleportPosition, Style, extraInfo);
}
else
{
+3
View File
@@ -3,6 +3,7 @@ using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -63,5 +64,7 @@ namespace CalamityMod.Items.Accessories
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, [ new Color(255, 196, 55), new Color(255, 231, 107), new Color(255, 254, 243) ]);
}
}
+2
View File
@@ -637,5 +637,7 @@ namespace CalamityMod.Items.Accessories
AddDecraftCondition(CalamityConditions.DownedSupremeCalamitas, CalamityConditions.DownedExoMechs).
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh)
}
}
+483
View File
@@ -0,0 +1,483 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Items.Armor.Auric;
using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Demonshade;
using CalamityMod.Items.Armor.Empyrean;
using CalamityMod.Items.Armor.Fearmonger;
using CalamityMod.Items.Armor.GemTech;
using CalamityMod.Items.Armor.GodSlayer;
using CalamityMod.Items.Armor.Hydrothermic;
using CalamityMod.Items.Armor.OmegaBlue;
using CalamityMod.Items.Armor.Prismatic;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Tarragon;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Utilities.Daybreak.Buffers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.UI.Chat;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Accessories.Wings
{
// The equip sprite is actually blank as a custom draw layer is used to draw the real sprites without any base sprites conflicting
[AutoloadEquip(EquipType.Wings)]
public class TiredTail : BaseWings
{
public override float BonusAscentWhileFalling => 0.95f;
public override float BonusAscentWhileRising => 0.15f;
public override float RisingSpeedThreshold => 1f;
public override float MaxAscentSpeed => 4.5f;
public override float BaseAscent => 0.1f;
float BoostPower => 3f;
public override void SetStaticDefaults()
{
ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 8.5f, 2.88f, true, 16, 10f);
}
public override void SetDefaults()
{
base.SetDefaults();
Item.width = 22;
Item.height = 20;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<HotPink>();
Item.Calamity().devItem = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
if (!hideVisual)
player.GetModPlayer<TiredTailPlayer>().tiredTailDraw = true;
if (player.velocity.Y != 0)
{
if (player.dashDelay != -1) //This differs from Starboard - Starboard checks for 1 full second passing after a dash begun, while this happens as soon as the dash ends
player.runSlowdown *= 6;
}
}
public override void UpdateVanity(Player player)
{
player.GetModPlayer<TiredTailPlayer>().tiredTailDraw = true;
}
public override bool WingUpdate(Player player, bool inUse) => true;
public override void AdditionalFlightMovement(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
if (player.TryingToHoverDown && player.controlJump && player.wingTime > 0f && !player.merman)
{
player.wingTime += 0.5f;
player.velocity.Y *= 0.8f;
if (player.velocity.Y > -2f && player.velocity.Y < 1f)
player.velocity.Y = 1E-05f;
ascentWhenFalling *= 0f;
ascentWhenRising *= 0f;
constantAscend *= 0f;
}
if (player.TryingToHoverUp)
{
ascentWhenFalling *= BoostPower;
ascentWhenRising *= BoostPower;
maxCanAscendMultiplier /= 1.5f;
maxAscentMultiplier /= 1.5f;
constantAscend *= BoostPower;
player.wingTime -= 1;
}
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ArmoredShell>(3).
AddIngredient(ItemID.Sapphire).
AddTile(TileID.DemonAltar).
Register();
}
}
public class TiredTailPlayer : ModPlayer
{
public bool tiredTailDraw = false;
public List<(Vector2 pos, float rot)> tailPos;
public override void ResetEffects()
{
//Handled here to prevent issues with instancing of chat tags
if (TiredTailTextEffects.displayTimer > 0)
{
TiredTailTextEffects.expansionFactor += 0.033f;
TiredTailTextEffects.displayTimer -= 1;
}
else
{
TiredTailTextEffects.expansionFactor = 0f;
}
tiredTailDraw = false;
}
public override void PostUpdate()
{
if (tiredTailDraw)
{
if (tailPos == null)
{
tailPos = new();
for (var i = 0; i < 3; i++)
{
tailPos.Add(new(Player.Center, 0));
}
}
for (var i = 0; i < tailPos.Count; i++)
{
Vector2 nextCent = Vector2.Zero;
float nextRot = 0;
if (i == 0)
{
nextCent = Player.Center + new Vector2(0, 6);
nextRot = new Vector2(Player.direction, -0.325f).ToRotation();
}
else
{
nextCent = tailPos[i - 1].Item1;
nextRot = tailPos[i - 1].Item2;
}
Vector2 destinationOffset = nextCent - tailPos[i].Item1;
if (nextRot != tailPos[i].Item2)
{
float angle = MathHelper.WrapAngle(nextRot - tailPos[i].Item2);
destinationOffset = destinationOffset.RotatedBy(angle * 0.1f);
}
var rotation = destinationOffset.ToRotation();
var center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (14 * 1);
if (i == tailPos.Count - 1)
{
center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (21 * 1);
}
tailPos[i] = new(center, rotation);
}
}
else
{
tailPos = null;
}
}
}
public class TailDraw : PlayerDrawLayer
{
List<Vector4[]> ColorPallettes = new();
public override void SetStaticDefaults()
{
Main.QueueMainThreadAction(() =>
{
//Load palettes automatically
var texture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Wings/TiredTailPallette", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value;
var BaseArray = new Color[texture.Width * texture.Height];
texture.GetData(BaseArray);
List<Vector4> pal = new();
for (var i = 0; i < BaseArray.Length; i++)
{
if (i % texture.Width == 0)
{
if (pal.Count > 0)
ColorPallettes.Add(pal.ToArray());
pal = new();
}
pal.Add(BaseArray[i].ToVector4());
}
ColorPallettes.Add(pal.ToArray());
ArmorPallettes =
[
//silva
([ItemType<SilvaHeadMagic>(),ItemType<SilvaHeadSummon>()],
[ItemType<SilvaArmor>()],
[ItemType<SilvaLeggings>()],
ColorPallettes[2]),
//god slayer
([ItemType<GodSlayerHeadMelee>(),ItemType<GodSlayerHeadRanged>(),ItemType<GodSlayerHeadRogue>()],
[ItemType<GodSlayerChestplate>()],
[ItemType<GodSlayerLeggings>()],
ColorPallettes[3]),
//hydro
([ItemType<HydrothermicHeadMelee>(),ItemType<HydrothermicHeadRanged>(),ItemType<HydrothermicHeadMagic>(),ItemType<HydrothermicHeadSummon>(),ItemType<HydrothermicHeadRogue>()],
[ItemType<HydrothermicArmor>()],
[ItemType<HydrothermicSubligar>()],
ColorPallettes[4]),
//auric
([ItemType<AuricTeslaHeadMelee>(),ItemType<AuricTeslaHeadRanged>(),ItemType<AuricTeslaHeadMagic>(),ItemType<AuricTeslaHeadSummon>(),ItemType<AuricTeslaHeadRogue>()],
[ItemType<AuricTeslaBodyArmor>()],
[ItemType<AuricTeslaCuisses>()],
ColorPallettes[5]),
//fearmonger
([ItemType<FearmongerGreathelm>()],
[ItemType<FearmongerPlateMail>()],
[ItemType<FearmongerGreaves>()],
ColorPallettes[6]),
//Bloodlfare
([ItemType<BloodflareHeadMelee>(),ItemType<BloodflareHeadRanged>(),ItemType<BloodflareHeadMagic>(),ItemType<BloodflareHeadSummon>(),ItemType<BloodflareHeadRogue>()],
[ItemType<BloodflareBodyArmor>()],
[ItemType<BloodflareCuisses>()],
ColorPallettes[7]),
//Tarragon
([ItemType<TarragonHeadMelee>(),ItemType<TarragonHeadRanged>(),ItemType<TarragonHeadMagic>(),ItemType<TarragonHeadSummon>(),ItemType<TarragonHeadRogue>()],
[ItemType<TarragonBreastplate>()],
[ItemType<TarragonLeggings>()],
ColorPallettes[8]),
//Omega Blue
([ItemType<OmegaBlueHelmet>()],
[ItemType<OmegaBlueChestplate>()],
[ItemType<OmegaBlueTentacles>()],
ColorPallettes[9]),
//Gem Tech
([ItemType<GemTechHeadgear>()],
[ItemType<GemTechBodyArmor>()],
[ItemType<GemTechSchynbaulds>()],
ColorPallettes[10]),
//Demonshade
([ItemType<DemonshadeHelm>()],
[ItemType<DemonshadeBreastplate>()],
[ItemType<DemonshadeGreaves>()],
ColorPallettes[11]),
//Prismatic
([ItemType<PrismaticHelmet>()],
[ItemType<PrismaticRegalia>()],
[ItemType<PrismaticGreaves>()],
ColorPallettes[12]),
//Empyrean
([ItemType<EmpyreanMask>()],
[ItemType<EmpyreanCloak>()],
[ItemType<EmpyreanCuisses>()],
ColorPallettes[13]),
//Solar
([ItemID.SolarFlareHelmet],
[ItemID.SolarFlareBreastplate],
[ItemID.SolarFlareLeggings],
ColorPallettes[14]),
//Vortex
([ItemID.VortexHelmet],
[ItemID.VortexBreastplate],
[ItemID.VortexLeggings],
ColorPallettes[15]),
//Nebula
([ItemID.NebulaHelmet],
[ItemID.NebulaBreastplate],
[ItemID.NebulaLeggings],
ColorPallettes[16]),
//Stardust
([ItemID.StardustHelmet],
[ItemID.StardustBreastplate],
[ItemID.StardustLeggings],
ColorPallettes[17]),
];
});
}
List<(List<int> heads, List<int> bodies, List<int> legs, Vector4[] pallette)> ArmorPallettes = [];
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => true;
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Wings);
protected override void Draw(ref PlayerDrawSet drawInfo)
{
var player = drawInfo.drawPlayer;
var modplayer = drawInfo.drawPlayer.GetModPlayer<TiredTailPlayer>();
var tex1 = Request<Texture2D>("CalamityMod/Items/Accessories/Wings/TiredTailSegment").Value;
var tex2 = Request<Texture2D>("CalamityMod/Items/Accessories/Wings/TiredTailTail").Value;
if (modplayer.tailPos != null)
{
var TargetPallette = ColorPallettes[1];
foreach (var item in ArmorPallettes)
{
if ((item.heads.Count == 0 || item.heads.Any(x => ContentSamples.ItemsByType[x].headSlot == player.head))
&& (item.bodies.Count == 0 || item.bodies.Any(x => ContentSamples.ItemsByType[x].bodySlot == player.body))
&& (item.legs.Count == 0 || item.legs.Any(x => ContentSamples.ItemsByType[x].legSlot == player.legs)))
{
TargetPallette = item.pallette;
break;
}
}
//manual override for Empyrean's transform to work
if (player.Calamity().meldTransformationPower || player.Calamity().meldTransformationForce)
{
TargetPallette = ArmorPallettes.First(x => x.heads.Contains(ItemType<EmpyreanMask>())).pallette;
}
using var SegmentLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex1.Width, tex1.Height);
using var TailLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex2.Width, tex2.Height);
using (Main.spriteBatch.Scope())
{
using (SegmentLease.Scope(clearColor: Color.Transparent))
{
var shaderSnap = new SpriteBatchSnapshot();
shaderSnap.SortMode = SpriteSortMode.Immediate;
shaderSnap.SamplerState = SamplerState.PointClamp;
shaderSnap.TransformMatrix = Matrix.identity;
Main.spriteBatch.Begin(shaderSnap);
MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"];
paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]);
paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length);
paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette);
paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.0001f);
paletteSwap.Apply();
Main.spriteBatch.Draw(tex1, Vector2.Zero, Color.White);
Main.spriteBatch.End();
}
using (TailLease.Scope(clearColor: Color.Transparent))
{
var shaderSnap = new SpriteBatchSnapshot();
shaderSnap.SortMode = SpriteSortMode.Immediate;
shaderSnap.SamplerState = SamplerState.PointClamp;
shaderSnap.TransformMatrix = Matrix.identity;
Main.spriteBatch.Begin(shaderSnap);
MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"];
paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]);
paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length);
paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette);
paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.01f);
paletteSwap.Apply();
Main.spriteBatch.Draw(tex2, Vector2.Zero, Color.White);
Main.spriteBatch.End();
}
}
var calamityPlayer = drawInfo.drawPlayer.Calamity();
//Copied from the rogue steallth visuals
// TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework
float r = 1;
float g = 1;
float b = 1;
float a = 1;
if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && drawInfo.drawPlayer.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility)
{
// A translucent orchid color, the rogue class color
float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9
r = 1f - (colorValue * 0.89f); //255 to 50
g = 1f - colorValue; //255 to 25
b = 1f - (colorValue * 0.89f); //255 to 50
a = 1f - colorValue; //255 to 25
}
for (var i = modplayer.tailPos.Count - 1; i >= 0; i--)
{
var color2 = Lighting.GetColor(modplayer.tailPos[i].pos.ToTileCoordinates());
var color = new Color((int)(color2.R * r), (int)(color2.G * g), (int)(color2.B * b), (int)(color2.A * a));
if (i == modplayer.tailPos.Count - 1)
{
drawInfo.DrawDataCache.Add(new(TailLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex2.Size() / 2f, 1f, SpriteEffects.None, 0));
}
else
{
drawInfo.DrawDataCache.Add(new(SegmentLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex1.Size() / 2f, 1f, SpriteEffects.None, 0));
}
}
}
}
}
public sealed class TiredTailTextEffects(string text) : TextSnippet
{
//Handled by TiredTailPlayer as this effect is for TiredTail
public static float expansionFactor = 0;
public static int displayTimer = 0;
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1)
{
//size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale);
if (color == default || color == Main.MouseTextColorReal)
{
color = Colors.AlphaDarken(HotPink.TextColor);
}
var textarray = text.ToArray();
for (var i = 0; i < textarray.Length; i++)
{
if (expansionFactor - 10 > i)
{
textarray[i] = (i == 0 ? 'ɔ' : '»');
}
}
var textToDraw = new string(textarray);
size = FontAssets.MouseText.Value.MeasureString(textToDraw) * scale;
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0))
{
var pos = position;
using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice);
string txt = "";
var matrix = spriteBatch.transformMatrix;
using (spriteBatch.Scope())
{
using (lease.Scope(clearColor: Color.Transparent))
{
var max = FontAssets.MouseText.Value.MeasureString(text) * Math.Min(1f, expansionFactor);
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix);
foreach (var item in textarray)
{//new(92,83,117)
pos = position;
pos.X += Math.Min(FontAssets.MouseText.Value.MeasureString(txt).X, max.X + 9999);
float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f;
float sin2 = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -0.9f) + 1) * 0.5f;
float sin3 = MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f + MathHelper.PiOver2);
var c = new Color(171, 153, 204);
if (txt.Length == 0 || txt.Length == text.Length - 1)
c = Color.Cyan;
else if (txt.Length % 4 == 3)
{
c = Color.HotPink;
}
c = Color.Lerp(Colors.AlphaDarken(new Color(0, 255, 200)), c, MathHelper.Clamp(expansionFactor - 2, 0, 1));
float posMult = Math.Max(MathHelper.Clamp((expansionFactor - 10) * 0.5f, 0, 3), MathHelper.Clamp((expansionFactor - 2) * 0.5f, 0, 1));
var origin = FontAssets.MouseText.Value.MeasureString(item.ToString()) * 0.5f;
ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), origin + pos + new Vector2(0, item == 'ɔ' ? -1 : 0) + new Vector2((-2f + 4 * sin2) * posMult, (-2 + sin * 4) * posMult), c, sin3 * posMult * 0.1f, origin, new Vector2(scale));
txt += item;
}
spriteBatch.End();
}
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity);
foreach (var item in ChatManager.ShadowDirections)
{
spriteBatch.Draw(lease.Target, Vector2.Zero + Vector2.TransformNormal(item * 2, matrix), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
}
spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
spriteBatch.End();
}
}
return true;
}
public override void Update()
{
displayTimer = 10;
}
public override float GetStringLength(DynamicSpriteFont font)
{
float size = font.MeasureString(text).X;
return size * Scale;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

+2
View File
@@ -80,5 +80,7 @@ namespace CalamityMod.Items.Armor.Demonshade
public string ExtensionTexture => "CalamityMod/Items/Armor/Demonshade/DemonshadeHelm_Extension";
public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => new Vector2(0, -4f);
public static Color DemonshadeRarityColor() => CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f);
}
}
-104
View File
@@ -415,110 +415,6 @@ namespace CalamityMod.Items
{
if (item.type == ModContent.ItemType<TheCommunity>())
nameLine.OverrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
// Developer items
if (item.type == ModContent.ItemType<Sylvestaff>())
nameLine.OverrideColor = new Color(249, 197, 255);
if (item.type == ModContent.ItemType<StaffofBlushie>())
nameLine.OverrideColor = new Color(0, 0, 255);
if (item.type == ModContent.ItemType<TheDanceofLight>())
nameLine.OverrideColor = TheDanceofLight.GetSyncedLightColor();
if (item.type == ModContent.ItemType<NanoblackReaper>())
nameLine.OverrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f);
if (item.type == ModContent.ItemType<ShatteredCommunity>())
nameLine.OverrideColor = ShatteredCommunity.GetRarityColor();
if (item.type == ModContent.ItemType<Ozzathoth>())
nameLine.OverrideColor = ShatteredCommunity.GetRarityColor();
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh)
if (item.type == ModContent.ItemType<TemporalUmbrella>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f);
if (item.type == ModContent.ItemType<Endogenesis>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f);
if (item.type == ModContent.ItemType<DraconicDestruction>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f);
if (item.type == ModContent.ItemType<ScarletDevil>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f);
if (item.type == ModContent.ItemType<RedSun>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f);
if (item.type == ModContent.ItemType<CrystylCrusher>())
nameLine.OverrideColor = new Color(129, 29, 149);
if (item.type == ModContent.ItemType<SomaPrime>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f);
if (item.type == ModContent.ItemType<Svantechnical>())
nameLine.OverrideColor = new Color(220, 20, 60);
if (item.type == ModContent.ItemType<Contagion>())
nameLine.OverrideColor = new Color(207, 17, 117);
if (item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>())
nameLine.OverrideColor = new Color(227, 226, 180);
if (item.type == ModContent.ItemType<IllustriousKnives>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f);
if (item.type == ModContent.ItemType<DemonshadeHelm>() || item.type == ModContent.ItemType<DemonshadeBreastplate>() || item.type == ModContent.ItemType<DemonshadeGreaves>())
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f);
if (item.type == ModContent.ItemType<AngelicAlliance>())
{
nameLine.OverrideColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, new Color[]
{
new Color(255, 196, 55),
new Color(255, 231, 107),
new Color(255, 254, 243)
});
}
// TODO -- for cleanliness, ALL color math should either be a one-line color swap or inside the item's own file
// The items that currently violate this are all below:
// Eternity, Flamsteed Ring, Earth
if (item.type == ModContent.ItemType<Eternity>())
{
List<Color> colorSet = new List<Color>()
{
new Color(188, 192, 193), // white
new Color(157, 100, 183), // purple
new Color(249, 166, 77), // honey-ish orange
new Color(255, 105, 234), // pink
new Color(67, 204, 219), // sky blue
new Color(249, 245, 99), // bright yellow
new Color(236, 168, 247), // purplish pink
};
if (nameLine != null)
{
int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count);
Color currentColor = colorSet[colorIndex];
Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count];
nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
}
}
if (item.type == ModContent.ItemType<FlamsteedRing>())
{
if (Main.GlobalTimeWrappedHourly % 1f < 0.6f)
{
nameLine.OverrideColor = new Color(89, 229, 255);
}
else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f)
{
nameLine.OverrideColor = Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f);
}
else
{
nameLine.OverrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f);
}
}
if (item.type == ModContent.ItemType<Earth>())
{
List<Color> earthColors = new List<Color>()
{
Color.OrangeRed,
Color.MediumTurquoise,
Color.LimeGreen
};
if (nameLine != null)
{
int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count);
Color currentColor = earthColors[colorIndex];
Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count];
nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
}
}
}
#endregion
+2
View File
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Dyes
{
@@ -14,6 +15,7 @@ namespace CalamityMod.Items.Dyes
public override void SafeSetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<ProfanedMoonlightDye>();
}
public override void SafeSetDefaults()
+2
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Dyes
@@ -12,6 +13,7 @@ namespace CalamityMod.Items.Dyes
public override void SafeSetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<ProfanedFlameDye>();
}
public override void SafeSetDefaults()
-2
View File
@@ -290,8 +290,6 @@ namespace CalamityMod.Items.Fishing
bool reset = false;
float oldSpin = 0;
int digDir = 0;
float spinSin => MathF.Sin(spin);
public override void SetDefaults()
+16 -15
View File
@@ -1,4 +1,6 @@
using CalamityMod.Events;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Events;
using CalamityMod.NPCs;
using CalamityMod.NPCs.Providence;
using CalamityMod.Projectiles.Boss;
@@ -36,28 +38,27 @@ namespace CalamityMod.Items.SummonItems
public override bool CanUseItem(Player player)
{
var Prov = CalamityGlobalNPC.holyBoss;
bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged;
return ((!NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive;
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
{
var Prov = CalamityGlobalNPC.holyBoss;
bool usingToMakeProviPissedOff = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged;
if (usingToMakeProviPissedOff)
int posX = (int)player.position.X;
int posY = (int)(player.position.Y - 100f);
int bossToSpawn = ModContent.NPCType<Providence>();
NPC prov = CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound);
if (Main.getGoodWorld)
{
(Main.npc[Prov].ModNPC as Providence).hasBeenGivenFullPower = true;
(prov.ModNPC as Providence).hasBeenGivenFullPower = true;
Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType<HolyProfanedCore>(), 0, 0);
}
else
{
int posX = (int)player.position.X;
int posY = (int)(player.position.Y - 100f);
int bossToSpawn = ModContent.NPCType<Providence>();
CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound);
}
return true;
}
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
string enrageTooltip = Main.getGoodWorld ? "\n" + this.GetLocalizedValue("EnrageText") : "";
tooltips.FindAndReplace("[ENRAGE]", enrageTooltip);
}
}
}
+2
View File
@@ -144,5 +144,7 @@ namespace CalamityMod.Items.Tools
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => new Color(129, 29, 149);
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
Item.width = 38;
Item.height = 24;
Item.damage = 200;
Item.damage = 160;
Item.mana = 12;
Item.useAnimation = Item.useTime = 24;
Item.useStyle = ItemUseStyleID.HoldUp;
+17
View File
@@ -60,5 +60,22 @@ namespace CalamityMod.Items.Weapons.Magic
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor()
{
List<Color> colorSet = [
new Color(188, 192, 193), // white
new Color(157, 100, 183), // purple
new Color(249, 166, 77), // honey-ish orange
new Color(255, 105, 234), // pink
new Color(67, 204, 219), // sky blue
new Color(249, 245, 99), // bright yellow
new Color(236, 168, 247), // purplish pink
];
int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count);
Color currentColor = colorSet[colorIndex];
Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count];
return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
}
}
}
+8 -4
View File
@@ -1,11 +1,11 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic
public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts
public int ProjectilesFired = 0;
public static readonly SoundStyle FireSound = new SoundStyle("CalamityMod/Sounds/Custom/CalamitasClone/CalClone_BigFireballBit", 4) with { Volume = 0.6f, MaxInstances = 4 };
public override void SetStaticDefaults()
{
CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType<BrimstoneFlames>()];
@@ -32,13 +33,14 @@ namespace CalamityMod.Items.Weapons.Magic
Item.mana = 28;
Item.useAnimation = Item.useTime = 46;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = FireSound;
Item.noMelee = true;
Item.knockBack = 7.5f;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<BrimstoneHellfireballFriendly>();
Item.shootSpeed = 14f;
Item.shoot = ModContent.ProjectileType<CalamitousFireballFriendly>();
Item.shootSpeed = 22f;
}
// Shoots twice as fast (and uses half as much mana to compensate) during hellblasts
@@ -52,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
ProjectilesFired++;
type = FiringMode == 1 ? ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>() : Item.shoot;
type = FiringMode == 1 ? ModContent.ProjectileType<CalamitousDartFriendly>() : Item.shoot;
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, Main.myPlayer);
// DUST
@@ -86,11 +88,13 @@ namespace CalamityMod.Items.Weapons.Magic
{
FiringMode = 1;
ProjectilesFired = 0;
SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center);
}
if (FiringMode == 1 && ProjectilesFired >= 10)
{
FiringMode = 0;
ProjectilesFired = 0;
SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center);
}
return false;
}
+3
View File
@@ -2,6 +2,7 @@
using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria.ID;
using Terraria.ModLoader;
@@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => Color.Blue;
}
}
+2
View File
@@ -111,5 +111,7 @@ namespace CalamityMod.Items.Weapons.Magic
spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);
return false;
}
public static Color RarityColor() => new Color(249, 197, 255);
}
}
-1
View File
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Systems.Collections;
using CalamityMod.Rarities;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f);
}
}
+9
View File
@@ -76,5 +76,14 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor()
{
List<Color> earthColors = [ Color.OrangeRed, Color.MediumTurquoise, Color.LimeGreen ];
int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count);
Color currentColor = earthColors[colorIndex];
Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count];
return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
}
}
}
+2
View File
@@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f);
}
}
+14 -3
View File
@@ -1,7 +1,8 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Melee.Yoyos;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -13,9 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static float Lifetime => 15; //Technically has infinite lifetime, but manually sets 15 seconds. See projectile file for details
public static float Reach = 512f;
public static float Speed = 36f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed, Lifetime);
public override void SetStaticDefaults()
{
@@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 28;
Item.height = 38;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.damage = 50;
Item.damage = 35;
Item.knockBack = 4f;
Item.useTime = 22;
Item.useAnimation = 22;
@@ -48,5 +50,14 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ItemRarityID.Lime;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
}
public override bool CanUseItem(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.oblivionCooldown == 0)
return true;
else
return false;
}
}
}
+2
View File
@@ -117,5 +117,7 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f);
}
}
@@ -2,6 +2,7 @@
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => new Color(227, 226, 180);
}
}
+2
View File
@@ -53,5 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ContagionBow>(), damage, knockback, player.whoAmI);
return false;
}
public static Color RarityColor() => new Color(207, 17, 117);
}
}
+3 -3
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 1.5f;
Item.UseSound = SoundID.Item34;
Item.UseSound = SoundID.DD2_BetsyFireballShot;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.autoReuse = true;
@@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
for (int i = 0; i <= 2; i++)
for (int i = 0; i <= 3; i++)
{
Projectile.NewProjectile(source, position + velocity * 4f, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI);
}
return false;
}
+2
View File
@@ -76,5 +76,7 @@ namespace CalamityMod.Items.Weapons.Ranged
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f);
}
}
+2
View File
@@ -82,5 +82,7 @@ namespace CalamityMod.Items.Weapons.Ranged
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => new Color(220, 20, 60);
}
}
+5 -5
View File
@@ -24,13 +24,13 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 26;
Item.height = 48;
Item.damage = 92;
Item.damage = 110;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useTime = 2;
Item.useAnimation = 10;
Item.useTime = 3;
Item.useAnimation = 12;
Item.reuseDelay = 1;
Item.useLimitPerAnimation = 5;
Item.useLimitPerAnimation = 4;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 5f;
Item.UseSound = SoundID.Item109;
@@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Rogue
for (float i = 0; i < 9; i++)
{
float angle = MathHelper.TwoPi / 9f * i;
Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<CosmicScythe>(), damage * 3, knockback, player.whoAmI, angle);
Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<CosmicScythe>(), (int)(damage * 1.5f), knockback, player.whoAmI, angle);
}
}
else if (stealthSalvo)
-1
View File
@@ -495,7 +495,6 @@ namespace CalamityMod.Projectiles.Rogue
{
public new string LocalizationCategory => "Projectiles.Rogue";
public static int lifetime => 1200;
Color? color = null;
public override void SetStaticDefaults()
{
ProjectileID.Sets.CultistIsResistantTo[Type] = true;
+2 -2
View File
@@ -52,8 +52,6 @@ namespace CalamityMod.Items.Weapons.Rogue
public static float TesselationDamageRatio = 0.25f;
public static float TesselationKnockback = 1.5f;
public override float StealthDamageMultiplier => 1.0f;
public override void SetDefaults()
{
Item.width = 78;
@@ -176,5 +174,7 @@ namespace CalamityMod.Items.Weapons.Rogue
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f);
}
}
-2
View File
@@ -42,8 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue
}
}
public override float StealthDamageMultiplier => 1f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
+2
View File
@@ -53,5 +53,7 @@ namespace CalamityMod.Items.Weapons.Rogue
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f);
}
}
-2
View File
@@ -33,8 +33,6 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.DamageType = RogueDamageClass.Instance;
}
public override float StealthDamageMultiplier => 1.0f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
-1
View File
@@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.DamageType = RogueDamageClass.Instance;
}
public override float StealthDamageMultiplier => 1f;
public override void HoldItem(Player player)
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 88;
Item.height = 108;
Item.damage = 110;
Item.damage = 120;
Item.DamageType = DamageClass.Summon;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon
Item.width = 26;
Item.height = 28;
Item.mana = 10;
Item.damage = 15;
Item.damage = 18;
Item.useStyle = ItemUseStyleID.Swing;
Item.buffType = ModContent.BuffType<CausticStaffBuff>();
Item.shoot = ModContent.ProjectileType<CausticStaffSummon>();
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 42;
Item.height = 60;
Item.damage = 97;
Item.damage = 95;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
Item.useStyle = ItemUseStyleID.Swing;
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 56;
Item.height = 60;
Item.damage = 75;
Item.damage = 69;
Item.useAnimation = Item.useTime = 24;
Item.mana = 10;
Item.knockBack = 2f;
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 64;
Item.height = 62;
Item.damage = 215;
Item.damage = 222;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
Item.useStyle = ItemUseStyleID.Swing;
+4 -4
View File
@@ -9,11 +9,11 @@ namespace CalamityMod.Items.Weapons.Summon
{
public class EnchantedKnifeStaff : ModItem, ILocalizedModType
{
public static float SwingTime = 20f;
public static float SwingWait = 10f;
public static float SwingTime = 18f;
public static float SwingWait = 6f;
public static float ProjectileSpeed = 15f;
public static float DashCooldown = 30f;
public static float DashSpeed = 16f;
public static float ChaseSpeed = 10f;
public static float RecoilSpeed = -4f;
public new string LocalizationCategory => "Items.Weapons.Summon";
+2
View File
@@ -101,5 +101,7 @@ namespace CalamityMod.Items.Weapons.Summon
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f);
}
}
+10
View File
@@ -204,5 +204,15 @@ namespace CalamityMod.Items.Weapons.Summon
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor()
{
if (Main.GlobalTimeWrappedHourly % 1f < 0.6f)
return new Color(89, 229, 255);
else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f)
return Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f);
else
return Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f);
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 36;
Item.height = 36;
Item.damage = 72;
Item.damage = 70;
Item.DamageType = DamageClass.Summon;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 34;
Item.height = 24;
Item.damage = 10;
Item.damage = 15;
Item.mana = 10;
Item.useAnimation = Item.useTime = 36;
Item.useStyle = ItemUseStyleID.Swing;
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 100;
Item.height = 128;
Item.damage = 57;
Item.damage = 50;
Item.DamageType = DamageClass.Summon;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 34;
Item.height = 34;
Item.damage = 53;
Item.damage = 42;
Item.mana = 10;
Item.useAnimation = Item.useTime = 30;
Item.useStyle = ItemUseStyleID.HoldUp;
-1
View File
@@ -90,7 +90,6 @@ namespace CalamityMod.Items.Weapons.Summon
float barScale = 1/(32f/TextureAssets.Item[Type].Width()) * 0.9f;
Vector2 barOrigin = barBG.Size() * 0.5f;
float yOffset = 0f;
Vector2 drawPos = position + new Vector2(0, (float)TextureAssets.Item[Type].Height() * 0.5f) * scale;
Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height);
Color colorBG = Color.Black;
+2 -2
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon
public new string LocalizationCategory => "Items.Weapons.Summon";
public static float EnemyDetectionDistance = 1200f;
public static int IFrames = 10;
public static int IFrames = 8;
// In frames.
public static float TimeBeforeCharging = 45f;
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 42;
Item.height = 42;
Item.damage = 142;
Item.damage = 132;
Item.useAnimation = Item.useTime = 24;
Item.knockBack = 4f;
Item.mana = 10;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 44;
Item.height = 48;
Item.damage = 25;
Item.damage = 22;
Item.mana = 10;
Item.useAnimation = Item.useTime = 36;
Item.useStyle = ItemUseStyleID.Swing;
+2 -2
View File
@@ -13,13 +13,13 @@ namespace CalamityMod.Items.Weapons.Summon
public class TacticalPlagueEngine : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public const int BulletShootRate = 125;
public const int BulletShootRate = 120;
public override void SetDefaults()
{
Item.width = 28;
Item.height = 20;
Item.damage = 140;
Item.damage = 110;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
Item.useStyle = ItemUseStyleID.HoldUp;
+2
View File
@@ -65,5 +65,7 @@ namespace CalamityMod.Items.Weapons.Summon
AddTile<DraedonsForge>().
Register();
}
public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f);
}
}
+3 -3
View File
@@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Summon
#region Damage Balancing Properties
//Sage Poison's damage is kept in the Sage Poison file
public static float ActiveAttackSlashDmgMult => 5f;
//Sage Poison's damage is kept in the Sage Poison file
public static float ActiveAttackSlashDmgMult => 4f;
//Note: the following two only apply when not using the active attack
public static float AxeDmgMult => 1.25f;
@@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 26;
Item.height = 36;
Item.damage = 60;
Item.damage = 55;
Item.DamageType = DamageClass.Summon;
Item.mana = 10;
Item.useAnimation = Item.useTime = 24;
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon
public new string LocalizationCategory => "Items.Weapons.Summon";
public static SummonTag summonTag = new SummonTag()
{
MultiplicativeTagDamage = 0.3f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots.
MultiplicativeTagDamage = 0.25f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. <-- (nvm)
AllowsWhipStacking = true,
TagOnHit = tagOnHit,
TagModifyHitEffects = SummonTag.BlankTagModifyHit,
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon
public new string LocalizationCategory => "Items.Weapons.Summon";
public const int SlotCount = 4;
public const int PunchCooldownTime = 36;
public const int PunchCooldownTime = 30;
public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f;
@@ -42,7 +42,6 @@ Drops: {
DownedT2AR: After defeating the second tier of Acid Rain
FirstKill: Drops only on the first kill
MechBoss: Drops on the first kill of the final Mechanical Boss
ProvidenceEnraged: Drops if Providence has been enraged
ProvidenceChallenge:
'''
Drops if Providence was defeated only with the [i:CalamityMod/ProfanedSoulArtifact] Profaned Soul Artifact
@@ -150,3 +150,13 @@ WingsofRebirth: {
'Resplendent to the very end'
'''
}
TiredTail: {
DisplayName: Tired Tail
Tooltip:
'''
{$CommonItemTooltip.FlightAndSlowfall}
{$CommonItemTooltip.PressDownToHover}
{$CommonItemTooltip.PressUpToBooster}
'''
}
@@ -226,11 +226,11 @@ ProfanedCore: {
DisplayName: Profaned Core
Tooltip:
'''
Summons Providence when used in the Hallow or Underworld
Use again while Providence is at high health to unleash Her perfect fury
Summons Providence when used in the Hallow or Underworld[ENRAGE]
{$Common.NotConsumable}
'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.'
'''
EnrageText: "[c/64c8fa:The nature of this world will unleash Her perfect fury, beware!]"
}
ProfanedShard: {
@@ -493,7 +493,7 @@ LashesofChaos: {
DisplayName: Lashes of Chaos
Tooltip:
'''
Alternates between exploding hellfireballs and piercing hellblasts
Alternates between exploding hellfire bursts and piercing brimstone darts
'Watch the world burn...'
'''
}
@@ -918,8 +918,13 @@ Oblivion: {
DisplayName: Oblivion
Tooltip:
'''
{$Common.YoyoStatsInfinite}
Fires brimstone darts when enemies are near
{$Common.YoyoStats}
A hightly unstable yoyo that slowly releases homing brimstone hellblasts
Enemy hits with the yoyo charge its power, greatly increasing the fire rate of the hellblasts
At maximum charge, the yoyo bursts into brimstone darts and resets its flight duration
Striking an enemy at maximum charge will overload the yoyo, causing it to release all stored up power and shatter
Shattering the yoyo deals immense damage but leaves it unable to be used for several seconds
[c/C61B40:'I have memories from eyes that are not my own']
'''
}
@@ -152,10 +152,10 @@ CausticStaff: {
'''
HoldShiftTooltip:
'''
Always inflicts [cbuff:OnFire3]
Always inflicts [cbuff:OnFire3] and [cbuff:Venom]
Inflicts [cbuff:CursedInferno] with 2 dragons summoned
Inflicts [cbuff:Venom] with 3 dragons summoned
Inflicts [cbuff:Ichor] and [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned
Inflicts [cbuff:Ichor] with 3 dragons summoned
Inflicts [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned
'''
}
@@ -43,7 +43,6 @@ BloodRay.DisplayName: Blood Ray
BlueBubble.DisplayName: Bubble
BlushieStaffProj.DisplayName: Staff of Blushie
BrimroseBeam.DisplayName: Brimrose Beam
BrimstoneHellfireballFriendly.DisplayName: Hellfireball
CauldronProj.DisplayName: Smauldron
CauldronProjSmall.DisplayName: Smaullerdron
ChronoIcicleLarge.DisplayName: Chrono Icicle
@@ -96,7 +95,6 @@ HadalUrnLamprey.DisplayName: Sea Lamprey
HadalUrnStarfish.DisplayName: Marianan Starfish
HadalUrnStarfishShard.DisplayName: Starfish Shard
HeliumFlashBlast.DisplayName: Helium Flash
HellfireExplosionFriendly.DisplayName: Explosion
HellwingBat.DisplayName: Ashen Hellwing
HolyFlame.DisplayName: Holy Flame
HolyLaser.DisplayName: Holy Laser
@@ -292,3 +290,6 @@ FleshTotemMinion.DisplayName: Flesh Totem Minion
FleshTotemSoul.DisplayName: Flesh Totem Soul
SpectralFeather.DisplayName: Spectral Feather
MoonSigil.DisplayName: Moon Sigil
CalamitousDartFriendly.DisplayName: Calamitous Dart Friendly
CalamitousExplosionFriendly.DisplayName: Calamitous Explosion Friendly
CalamitousFireballFriendly.DisplayName: Calamitous Fireball Friendly
@@ -312,3 +312,5 @@ WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver
YinYoDark.DisplayName: Dark Shard
YinYoLight.DisplayName: Light Shard
EvilSmasherProjectile.DisplayName: Evil Smasher
OblivionFire.DisplayName: Oblivion Fire
OblivionBolt.DisplayName: Oblivion Bolt
@@ -46,7 +46,7 @@ BrimstoneElementalMinion.DisplayName: Brimstone Elemental
BrimstoneExplosionMinion.DisplayName: Explosion
BrimstoneFireballMinion.DisplayName: Brimstone Fireball
BrimstoneFireSummon.DisplayName: Brimstone Fire
BrimstoneLaserSummon.DisplayName: Brimstone Laser
BrimstoneLaserSummon.DisplayName: Vigil Mini Fireball
BrittleStarMinion.DisplayName: Brittle Star
CalamarisLamentMinion.DisplayName: Calamari
CalamarisLamentProjectile.DisplayName: Calamari Ink
@@ -129,6 +129,7 @@ Cooldowns: {
MasterChefShieldDurability: MJOLNIR Shield Level
MasterChefShieldRecharge: MJOLNIR Shield Recharge
NebulousCore: Nebulous Core Cooldown
OblivionCooldown: Oblivion Cooldown
OldDukeScalesFatigue: Stamina
OmegaBlueActive: Abyssal Madness
OmegaBlueCooldown: Abyssal Madness Cooldown
+1
View File
@@ -652,6 +652,7 @@ namespace CalamityMod.NPCs
NPC.lifeMax = 10000;
NPC.knockBackResist = 0;
NPC.noTileCollide = true;
NPC.dontCountMe = true;
NPC.aiStyle = -1;
}
+2 -2
View File
@@ -444,12 +444,12 @@ namespace CalamityMod.NPCs
break;
// Chaos Elemental
// Rod of Discord @ 1% Normal, 2% Expert+
// Rod of Discord @ 0.8% Normal, 1% Expert+
case NPCID.ChaosElemental:
// Remove the vanilla loot rule for Rod of Discord.
npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord);
// Define a replacement rule which has an increased chance.
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 100, 50));
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 125, 100));
break;
// Illuminant Bat
-2
View File
@@ -110,8 +110,6 @@ namespace CalamityMod.NPCs.Deconstructors
}
public override void SetDefaults()
{
NPC.Calamity().canBreakPlayerDefense = true;
NPC.damage = 0;
NPC.width = 38;
NPC.height = 38;
+4 -1
View File
@@ -306,10 +306,13 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void OnSpawn(IEntitySource source)
{
// Don't display the dialogue in Boss Rush
if (BossRushEvent.BossRushActive)
return;
string key = "Mods.CalamityMod.Status.Boss.DoGSpawn";
Color messageColor = Color.Cyan;
CalamityUtils.BroadcastLocalizedText(key, messageColor);
DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 0, 120, false, new BossText());
}
+17 -11
View File
@@ -112,7 +112,9 @@ namespace CalamityMod.NPCs.NormalNPCs
Main.npcFrameCount[Type] = 14;
NPCID.Sets.CountsAsCritter[Type] = true;
NPCID.Sets.CantTakeLunchMoney[Type] = true;
NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 3, Type);
NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 1, Type);
NPCID.Sets.ImmuneToAllBuffs[Type] = true;
NPCID.Sets.ShimmerImmunity[Type] = true;
}
public override void SetDefaults()
@@ -129,9 +131,12 @@ namespace CalamityMod.NPCs.NormalNPCs
NPC.DeathSound = SoundID.NPCDeath1;
NPC.immortal = true;
NPC.noGravity = true;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToCold = false;
NPC.Calamity().VulnerableToElectricity = false;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToSickness = false;
NPC.Calamity().VulnerableToWater = false;
}
public override void OnSpawn(IEntitySource source)
@@ -290,14 +295,10 @@ namespace CalamityMod.NPCs.NormalNPCs
SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center);
SoundEngine.PlaySound(IdleSound, NPC.Center);
if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out var activeSound))
activeSound.Stop();
if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance))
swineSpeakInstance.Stop();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.Transform(ModContent.NPCType<Piggy>());
NPC.netUpdate = true;
}
NPC.Transform(ModContent.NPCType<Piggy>());
}
}
@@ -432,6 +433,9 @@ namespace CalamityMod.NPCs.NormalNPCs
GeneralParticleHandler.SpawnParticle(Main.rand.NextBool() ? meatSparkle : meatLight, true, Enums.GeneralDrawLayer.AfterNPCs);
}
if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance))
swineSpeakInstance.Stop();
// Despawn immediately afterwards.
NPC.checkDead();
NPC.active = false;
@@ -465,6 +469,8 @@ namespace CalamityMod.NPCs.NormalNPCs
SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center);
SoundEngine.PlaySound(IdleSound, NPC.Center);
if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance))
swineSpeakInstance.Stop();
NPC.checkDead();
NPC.active = false;
@@ -104,11 +104,7 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog
if (SoundEngine.TryGetActiveSound(DevilsTongueSlot, out var activeSound))
activeSound.Stop();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.Transform(ModContent.NPCType<Piggy>());
NPC.netUpdate = true;
}
NPC.Transform(ModContent.NPCType<Piggy>());
}
Animate(IdleFrame, IdleFrame, 0, false, dynamicChanges: true);
+4 -9
View File
@@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
NPC.velocity.X *= 0.9f;
NPC.rotation = 0f;
if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _))
if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _))
NearbySoundSlot = SoundEngine.PlaySound(DivineSwine_SwineSpeakLoopingSound, NPC.Center, NearbySoundCallbackMethod);
float lightSpawnDistance = MathHelper.Lerp(52f, 84f, Timer / 180f);
@@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.NormalNPCs
GeneralParticleHandler.SpawnParticle(feather, manualDrawLayerOverride: Enums.GeneralDrawLayer.BeforeNPCs);
}
if (Timer >= 180f && Main.netMode != NetmodeID.MultiplayerClient)
if (Timer >= 180f)
{
CustomPulse lightRing = new(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", Vector2.One, 0f, 0f, 2f, 75);
GeneralParticleHandler.SpawnParticle(lightRing);
@@ -232,7 +232,6 @@ namespace CalamityMod.NPCs.NormalNPCs
activeSound.Stop();
NPC.Transform(ModContent.NPCType<DivineSwine>());
NPC.netUpdate = true;
}
}
@@ -240,7 +239,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
NPC.velocity.X *= 0.9f;
NPC.rotation = 0f;
if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _))
if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _))
NearbySoundSlot = SoundEngine.PlaySound(HorribleHog_DevilsTongueLoopingSound, NPC.Center, NearbySoundCallbackMethod);
float smokeOpacity = Utils.GetLerpValue(0f, 45f, Timer, true);
@@ -264,11 +263,7 @@ namespace CalamityMod.NPCs.NormalNPCs
if (SoundEngine.TryGetActiveSound(NearbySoundSlot, out var activeSound))
activeSound.Stop();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.Transform(ModContent.NPCType<HorribleHog.HorribleHog>());
NPC.netUpdate = true;
}
NPC.Transform(ModContent.NPCType<HorribleHog.HorribleHog>());
}
}
+7 -2
View File
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using CalamityMod.Items.Critters;
using CalamityMod.Items.Placeables.Banners;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
using Terraria.ModLoader;
@@ -16,9 +17,13 @@ namespace CalamityMod.NPCs.NormalNPCs
{
public override void SetStaticDefaults()
{
Main.npcFrameCount[Type] = 8;
Main.npcCatchable[Type] = true;
NPCID.Sets.CountsAsCritter[Type] = true;
NPCID.Sets.CantTakeLunchMoney[Type] = true;
NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[Type] = true;
NPCID.Sets.GoldCrittersCollection.Add(Type);
NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 2, Type);
base.SetStaticDefaults();
NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(ModContent.NPCType<Piggy>()) + 1, Type);
}
public override void SetDefaults()
+14 -80
View File
@@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.Providence
NPC.Calamity().VulnerableToSickness = false;
NPC.Calamity().VulnerableToWater = true;
if (Main.getGoodWorld)
if (Main.zenithWorld)
NPC.scale *= 0.25f;
}
@@ -400,8 +400,7 @@ namespace CalamityMod.NPCs.Providence
Player player = Main.player[NPC.target];
// Enraged bool and Color shifting
bool getFuckedAI = Main.zenithWorld;
if (getFuckedAI)
if (Main.zenithWorld)
NPC.localAI[1] = (float)BossMode.Rainbow;
else if (hasBeenGivenFullPower) // Enraged behavior
NPC.localAI[1] = (float)BossMode.Enraged;
@@ -426,29 +425,15 @@ namespace CalamityMod.NPCs.Providence
// Is in spawning animation
float spawnAnimationTime = 180f;
bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime;
if (!spawnAnimation)
{
NPC.Opacity = 1f;
}
// Percent life remaining
float lifeRatio = NPC.life / (float)NPC.lifeMax;
// Play enrage animation if she gets angy
if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime)
// Sync "enrage" status in FTW
if (NPC.localAI[1] == (float)BossMode.Enraged && calamityGlobalNPC.newAI[3] == 0f)
{
AIState = (int)Phase.HolyBlast;
NPC.ai[1] = 0f;
NPC.ai[2] = 0f;
NPC.ai[3] = 0f;
calamityGlobalNPC.newAI[1] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
calamityGlobalNPC.newAI[3] = 0f;
// Despawn existing projectiles and summon the aura again
DespawnSpecificProjectiles(true);
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<HolyAura>(), 0, 0f, -1);
if (Main.netMode != NetmodeID.SinglePlayer)
ProvidenceDyeConditionSyncPacket.Send(this);
NPC.ForceNetUpdate(false);
@@ -811,7 +796,7 @@ namespace CalamityMod.NPCs.Providence
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation;
// Movement
if (getFuckedAI || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon))
if (Main.zenithWorld || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon))
{
// Slowly drift down when spawning
if (spawnAnimation)
@@ -878,14 +863,8 @@ namespace CalamityMod.NPCs.Providence
}
if (laserPhaseSlow)
{
acceleration *= getFuckedAI ? 0.6f : 0.2f;
velocity *= getFuckedAI ? 0.6f : 0.2f;
}
if (Main.getGoodWorld)
{
velocity *= 1.2f;
acceleration *= 1.2f;
acceleration *= Main.zenithWorld ? 0.6f : 0.2f;
velocity *= Main.zenithWorld ? 0.6f : 0.2f;
}
if (!targetDead)
@@ -898,14 +877,11 @@ namespace CalamityMod.NPCs.Providence
float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height);
if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150
NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f;
NPC.velocity.Y -= fullPowerAI ? 0.4f : 0.2f;
if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200
NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f;
NPC.velocity.Y += fullPowerAI ? 0.4f : 0.2f;
float speedCap = laserPhaseSlow ? 2f : 6f;
if (Main.getGoodWorld)
speedCap *= 1.5f;
if (NPC.velocity.Y > speedCap)
NPC.velocity.Y = speedCap;
if (NPC.velocity.Y < -speedCap)
@@ -1121,29 +1097,7 @@ namespace CalamityMod.NPCs.Providence
GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor));
}
// Used to heal her back to full HP during enrage animation
if (fullPowerAI && calamityGlobalNPC.newAI[3] % 9f == 0f)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int healAmt = NPC.lifeMax / 400;
if (healAmt > NPC.lifeMax - NPC.life)
healAmt = NPC.lifeMax - NPC.life;
if (healAmt > 0)
{
NPC.life += healAmt;
NPC.HealEffect(healAmt, true);
NPC.ForceNetUpdate(false);
}
}
}
calamityGlobalNPC.newAI[3] += 1f;
if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime)
calamityGlobalNPC.newAI[3] += 1f;
return;
}
@@ -1238,7 +1192,7 @@ namespace CalamityMod.NPCs.Providence
borderPosition ??= NPC.Center;
borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f);
Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30);
if (!targetDead && !getFuckedAI)
if (!targetDead && !Main.zenithWorld)
{
if (NPC.velocity.Length() <= 2f)
NPC.velocity = Vector2.Zero;
@@ -1509,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence
borderPosition ??= NPC.Center;
borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f);
if (!targetDead && !getFuckedAI)
if (!targetDead && !Main.zenithWorld)
{
if (NPC.velocity.Length() <= 2f)
NPC.velocity = Vector2.Zero;
@@ -1554,9 +1508,6 @@ namespace CalamityMod.NPCs.Providence
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer);
if (Main.getGoodWorld)
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer);
}
}
@@ -1581,9 +1532,6 @@ namespace CalamityMod.NPCs.Providence
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f);
if (Main.getGoodWorld)
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f);
}
}
@@ -1601,7 +1549,7 @@ namespace CalamityMod.NPCs.Providence
case (int)Phase.Crystal:
if (!targetDead && !getFuckedAI)
if (!targetDead && !Main.zenithWorld)
NPC.velocity *= 0.9f;
NPC.ai[1] += 1f;
@@ -1673,7 +1621,7 @@ namespace CalamityMod.NPCs.Providence
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f;
float timeLeft = fullPowerAI ? (float)(Main.zenithWorld ? gfbCrystalTime : enragedCrystalTime) : 0f;
Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType<ProvidenceCrystal>(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft);
}
}
@@ -2029,12 +1977,6 @@ namespace CalamityMod.NPCs.Providence
return prov.challenge;
}, () => Main.expertMode, DropHelper.ProvidenceChallengeText)).Add(ModContent.ItemType<ProfanedSoulCrystal>());
npcLoot.AddIf(info =>
{
Providence prov = info.npc.ModNPC<Providence>();
return prov.hasBeenGivenFullPower;
}, ModContent.ItemType<ProfanedMoonlightDye>(), 1, 4, 4, desc: DropHelper.ProvidenceEnragedText);
npcLoot.AddIf(info =>
{
Providence prov = info.npc.ModNPC<Providence>();
@@ -2094,7 +2036,7 @@ namespace CalamityMod.NPCs.Providence
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld);
bool offColor = NPC.localAI[1] != (float)BossMode.Normal;
Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value;
Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value;
@@ -2861,14 +2803,6 @@ namespace CalamityMod.NPCs.Providence
// These will be used for almost every single one of her projectiles, so it's useful to have.
public static class ProvUtils
{
/// <summary>
/// This lease should be used to draw all of a projectile's effects onto directly, then be drawn onto the screen as one. This is for opacity reasons
/// </summary>
public static RenderTargetLease PrimaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; }
/// <summary>
/// This should be used for secondary effects like trails, then drawn to PrimaryLease. This is for opacity reasons.
/// </summary>
public static RenderTargetLease SecondaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; }
public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld;
public static int CalculateProvidenceDamage(this int damage)
-3
View File
@@ -161,9 +161,6 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.owner == Main.myPlayer)
{
int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6;
if (Main.getGoodWorld)
totalProjectiles *= 2;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ModContent.ProjectileType<HolyBlastFrags>();
float velocity = 5f;
+158 -219
View File
@@ -1,18 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Dusts;
using CalamityMod.Effects;
using CalamityMod.Graphics.Primitives;
using CalamityMod.NPCs.Providence;
using CalamityMod.Particles;
using CalamityMod.Systems.Graphic;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Utilities.Daybreak.Buffers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json.Serialization;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
@@ -20,14 +20,29 @@ namespace CalamityMod.Projectiles.Boss
{
public class HolyBurnOrb : ModProjectile, ILocalizedModType
{
private static Asset<Texture2D> TrailNoiseTexture;
private static Asset<Texture2D> TrailDistortionTexture;
private static Asset<Texture2D> GlowOrbTexture;
bool started = false;
public new string LocalizationCategory => "Projectiles.Boss";
public override string Texture => "CalamityMod/Projectiles/StarProj";
public override void Load()
{
if (!Main.dedServ)
{
TrailNoiseTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
TrailDistortionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2");
GlowOrbTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowOrbParticle");
}
}
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 32;
ProjectileID.Sets.TrailingMode[Type] = 2;
ProjectileID.Sets.TrailCacheLength[Type] = 12;
ProjectileID.Sets.TrailingMode[Type] = 0;
}
public override void SetDefaults()
{
@@ -66,7 +81,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.timeLeft = 160;
}
if (Main.getGoodWorld)
if (!ProvUtils.StandardAI())
{
if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f)
{
@@ -74,8 +89,8 @@ namespace CalamityMod.Projectiles.Boss
}
else
{
Projectile.ai[1] += 0.05f;
Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1])));
Projectile.ai[1] += 0.075f;
Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, MathF.Abs(MathF.Sin(Projectile.ai[1])));
}
}
else if (Projectile.velocity.Length() < 16f)
@@ -87,59 +102,6 @@ namespace CalamityMod.Projectiles.Boss
Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1);
}
public override bool PreDraw(ref Color lightColor)
{
//drawn by the HolyBurnOrbDrawer system
return false;
}
public float FireWidthFunction(float completion, Vector2 pos)
{
float width;
float maxBodyWidth = 32f * Projectile.scale;
float curveRatio = 0.2f;
var positions = Projectile.oldPos.ToList();
positions.RemoveAll(x => x == Vector2.Zero);
// Crop the tip of the trail into a conic shape.
if (completion < curveRatio)
width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth;
else
width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f);
// Pulse inwards and outwards over time.
float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f;
float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant);
return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type];
}
public Color FireColorFunction(float completion, Vector2 pos)
{
Color mainColor = ProvUtils.GetProjectileColor(255) * 1.3f;
Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true));
return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity;
}
public float FireCoreWidthFunction(float completion, Vector2 pos)
{
float width;
float maxBodyWidth = Projectile.scale * 24;
float curveRatio = 0.25f;
var positions = Projectile.oldPos.ToList();
positions.RemoveAll(x => x == Vector2.Zero);
if (completion < curveRatio)
width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio;
else
width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f);
return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type];
}
public Color FireCoreColorFunction(float completion, Vector2 pos)
{
Color mainColor = ProvUtils.GetProjectileColor(255);
Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true));
Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion);
return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity;
}
public override void OnKill(int timeLeft)
{
@@ -173,191 +135,168 @@ namespace CalamityMod.Projectiles.Boss
ProvUtils.ApplyDebuffs(target, 120);
}
}
public class HolyBurnOrbDrawer : ModSystem
{
public override void Load()
public float FireWidthFunction(float completion)
{
On_Main.DrawProjectiles += DrawAll;
float width;
float maxBodyWidth = 36f * Projectile.scale;
float curveRatio = 0.2f;
// Crop the tip of the trail into a conic shape.
if (completion < curveRatio)
width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth;
else
width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f);
// Pulse inwards and outwards over time.
float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 12f) * 0.5f + 0.5f;
float additionalPulseWidth = MathHelper.Lerp(0f, 6f, pulseInterpolant);
return (width + additionalPulseWidth);
}
private void DrawAll(On_Main.orig_DrawProjectiles orig, Main self)
public Color FireColorFunction(float completion)
{
orig(self);
var device = Main.instance.GraphicsDevice;
List<Projectile> burnToDraw = [];
List<Projectile> healToDraw = [];
foreach (var item in Main.ActiveProjectiles)
{
if (item.type == ModContent.ProjectileType<HolyBurnOrb>())
burnToDraw.Add(item);
if (item.type == ModContent.ProjectileType<HolyLight>())
healToDraw.Add(item);
}
if ((healToDraw.Count() + burnToDraw.Count()) < 1)
return;
using (Main.spriteBatch.Scope())
{
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
//Burn trails
using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent))
{
foreach (var item in burnToDraw)
DrawBurnOrbTrail(item);
}
Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
//Heal trail
using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent))
{
foreach (var item in healToDraw)
DrawHealOrbTrail(item);
}
Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
//Main orb
foreach (var item in burnToDraw)
DrawBurnOrb(item);
foreach (var item in healToDraw)
DrawHealOrb(item);
//Additive orb
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
foreach (var item in burnToDraw)
DrawBurnOrbAdditive(item);
foreach (var item in healToDraw)
DrawHealOrbAdditive(item);
Main.spriteBatch.End();
}
Color mainColor = Color.Lerp(ProvUtils.GetProjectileColor(255, true) * 2f, ProvUtils.GetProjectileColor(255), 0.75f);
Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true));
return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity;
}
void DrawBurnOrbTrail(Projectile Projectile)
public void DrawTrail()
{
if (Projectile.ModProjectile is HolyBurnOrb M)
Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f);
Vector2 basePosition = Projectile.Center - Main.screenPosition;
Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40);
if (screenBounds.Contains(basePosition.ToPoint()))
{
var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]);
var len = Math.Min(Projectile.oldPos.Length, 32);
for (var i = 0; i < len; i++)
List<Vector3> path = [];
for (var i = 0; i < Projectile.oldPos.Length; i++)
{
Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color color = M.FireColorFunction(i / (float)len, Projectile.oldPos[i]);
var color2 = ProvUtils.GetProjectileColor(255, true);
float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]);
Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f);
Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition;
path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f));
}
if (path.Count > 2 && Projectile.ai[0] > 6)
{
Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value;
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
shader.Parameters["glowPower"].SetValue(1.48f);
Main.graphics.GraphicsDevice.Textures[0] = TrailNoiseTexture.Value;
Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap;
Main.graphics.GraphicsDevice.Textures[1] = TrailDistortionTexture.Value;
Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection);
using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => FireWidthFunction(progress), progress => FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true);
shaderScope.Draw(trailMesh.View);
}
}
}
void DrawBurnOrb(Projectile Projectile)
public override bool PreDraw(ref Color lightColor)
{
float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f)));
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4;
Color baseColor2 = ProvUtils.GetProjectileColor(255);
baseColor.A = 0;
baseColor *= lerpMult;
baseColor2 *= lerpMult;
Vector2 origin = texture.Size() / 2f;
Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f);
SpriteEffects spriteEffects = SpriteEffects.None;
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f);
float upRight = MathHelper.PiOver4;
float up = MathHelper.PiOver2;
float upLeft = 3f * MathHelper.PiOver4;
float left = MathHelper.Pi;
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0);
// Trail drawn by the HolyBurnOrbDrawer system.
DrawBurnOrb();
DrawBurnOrbAdditive();
return false;
}
void DrawBurnOrbAdditive(Projectile Projectile)
private void DrawBurnOrb()
{
var texture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowOrbParticle").Value;
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255), 0, texture.Size() * 0.5f, 1f, 0, 0f);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f);
}
void DrawHealOrbTrail(Projectile Projectile)
{
if (Projectile.ModProjectile is HolyLight M)
{
var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]);
var len = Math.Min(Projectile.oldPos.Length, 32);
for (var i = 0; i < len; i++)
{
Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color color = M.FireCoreColorFunction(i / (float)len, Projectile.oldPos[i]);
var color2 = new Color(0, 25, 0);
float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]);
Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f);
}
}
}
void DrawHealOrb(Projectile Projectile)
{
float vel = Projectile.velocity.Length() / 8;
Projectile.localAI[1] += vel;
float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f)));
Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Color brightGreen = new Color(54, 209, 54, 0);
Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Vector2 halfTextureSize = drawTexture.Size() / 2f;
Color halfBrightGreen = brightGreen * 0.5f;
float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f)));
Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f);
Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale;
Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale;
brightGreen *= timeLeftColorScale;
halfBrightGreen *= timeLeftColorScale;
Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0;
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4;
Color baseColor2 = ProvUtils.GetProjectileColor(255);
baseColor.A = 0;
baseColor *= lerpMult;
baseColor2 *= lerpMult;
Vector2 origin = texture.Size() * 0.5f;
Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f);
SpriteEffects spriteEffects = SpriteEffects.None;
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0);
Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f);
Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0);
float upRight = MathHelper.PiOver4;
float up = MathHelper.PiOver2;
float upLeft = 3f * MathHelper.PiOver4;
float left = MathHelper.Pi;
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0);
}
void DrawHealOrbAdditive(Projectile Projectile)
private void DrawBurnOrbAdditive()
{
var texture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowOrbParticle").Value;
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54), 0, texture.Size() * 0.5f, 1f, 0, 0f);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f);
Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255) with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 1f, 0, 0f);
Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 0.5f, 0, 0f);
}
}
public class HolyBurnOrbDrawer : ModSystem
{
public static RenderTargetLease TrailPixelationLease { get; private set; }
private List<Projectile> HolyBurnOrbs = [];
private List<Projectile> HolyLights = [];
public override void Load()
{
GeneralDrawLayerSystem.OnBeforeProjectiles += DrawOrbTrails;
if (!Main.dedServ)
{
Main.QueueMainThreadAction(() => TrailPixelationLease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (w, h) => (w / 2, h / 2)));
}
}
public override void PostUpdateProjectiles()
{
foreach (var item in Main.ActiveProjectiles)
{
if (item.type == ModContent.ProjectileType<HolyBurnOrb>() && !HolyBurnOrbs.Contains(item))
HolyBurnOrbs.Add(item);
if (item.type == ModContent.ProjectileType<HolyLight>() && !HolyLights.Contains(item))
HolyLights.Add(item);
}
HolyBurnOrbs.RemoveAll(p => !p.active || p.timeLeft <= 1);
HolyLights.RemoveAll(p => !p.active || p.timeLeft <= 1);
}
private void DrawOrbTrails()
{
if ((HolyBurnOrbs.Count + HolyLights.Count) > 0)
{
using (Main.spriteBatch.Scope())
{
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity);
using (TrailPixelationLease.Scope(clearColor: Color.Transparent))
{
foreach (var item in HolyBurnOrbs)
item.ModProjectile<HolyBurnOrb>().DrawTrail();
foreach (var item in HolyLights)
item.ModProjectile<HolyLight>().DrawTrail();
}
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
// Redraw at double scale to pixelate the trails.
Main.spriteBatch.Draw(TrailPixelationLease.Target, Vector2.Zero, null, Color.White with { A = 0 }, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f);
Main.spriteBatch.End();
}
}
}
}
}
+4 -4
View File
@@ -90,12 +90,12 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.owner == Main.myPlayer)
{
Vector2 velocity = new Vector2(0.01f, 0f);
if (Main.getGoodWorld)
if (!ProvUtils.StandardAI())
velocity *= Main.rand.NextFloat(1f, 2f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
if (Main.getGoodWorld)
if (!ProvUtils.StandardAI())
velocity *= Main.rand.NextFloat(1f, 2f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
@@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.owner == Main.myPlayer)
{
Vector2 velocity = new Vector2(0.05f, 0f);
if (Main.getGoodWorld)
if (!ProvUtils.StandardAI())
velocity *= Main.rand.NextFloat(1f, 2f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
if (Main.getGoodWorld)
if (!ProvUtils.StandardAI())
velocity *= Main.rand.NextFloat(1f, 2f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
Loaded 100 of 144 files, more files were not shown because too many files have changed in this diff. Show more