merge of bloom stone and mirror blade vars

This commit is contained in:
Ozzatron committed 2025-05-19 22:23:33 -04:00
commit fade753716
689 files changed
+8266 -4291

No files matched your search

+71 -17
View File
@@ -5,11 +5,18 @@ using Microsoft.Xna.Framework.Graphics;
using System;
using ReLogic.Content;
using Terraria.ID;
using CalamityMod.Graphics;
using System.Reflection;
using Terraria.Graphics.Shaders;
namespace CalamityMod.Backgrounds
{
public class SunkenSeaBurrowsBG : ModSystem
{
private static ManagedRenderTarget WaterDistortionTarget;
private static bool CurrentlyRendering { get; set; }
public override void Load()
{
if (Main.dedServ)
@@ -17,7 +24,10 @@ namespace CalamityMod.Backgrounds
return;
}
On_Main.CheckMonoliths += DrawToTarget;
On_Main.DrawBackgroundBlackFill += On_Main_DrawBackgroundBlackFill;
Main.QueueMainThreadAction(() => WaterDistortionTarget = new(true, ManagedRenderTarget.CreateScreenSizedTarget));
}
/// <summary>
@@ -33,33 +43,80 @@ namespace CalamityMod.Backgrounds
{
if (!Main.dedServ && Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
{
for (int i = 0; i < Main.screenWidth / 16; i++)
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < Main.screenWidth / 16; j++)
for (int j = 0; j < drawLimitY; j++)
{
Point pos = (Main.screenPosition / 16).ToPoint() + new Point(i, j);
Point pos = drawPoint + new Point(i, j);
if (Main.tile[pos.X, pos.Y].Slope != SlopeType.Solid)
{
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.1f);
}
}
}
}
}
private void DrawToTarget(On_Main.orig_CheckMonoliths orig)
{
if (Main.gameMenu)
{
orig();
return;
}
CurrentlyRendering = true;
WaterDistortionTarget.SwapTo();
// 13MAY2025: fryzahh: Note that when other Sunken Sea backgrounds are implemented they should use this same system.
// Leaving this here for other programmers, in case I don't get to doing this myself.
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
DrawBurrowsBG();
Main.spriteBatch.End();
Main.graphics.GraphicsDevice.SetRenderTarget(null);
CurrentlyRendering = false;
orig();
}
private void On_Main_DrawBackgroundBlackFill(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
{
orig(self);
return;
}
orig(self);
DrawBurrowsBG();
// This won't render if the Wave Quality setting isn't turned off unfortunately, so don't bother running any of the shader
// rendering code if that setting is on.
if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion)
{
DrawBurrowsBG();
}
else
{
MiscShaderData distortionShader = GameShaders.Misc["CalamityMod:BasicTextureDistortion"];
Asset<Texture2D> distortionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Swirls");
// Apply a distortion shader to the Sunken Sea backgrounds to give them an underwater ripple-like effect.
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, distortionShader.Shader, CalamityUtils.BackgroundMatrix);
distortionShader.Shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
distortionShader.Shader.Parameters["distortionXSpeed"].SetValue(-0.012f);
distortionShader.Shader.Parameters["distortionYSpeed"].SetValue(0.02f);
distortionShader.Shader.Parameters["distortionStrength"].SetValue(0.035f);
distortionShader.Shader.Parameters["noiseScale"].SetValue(0.075f);
distortionShader.SetShaderTexture(distortionTexture);
Main.spriteBatch.Draw(WaterDistortionTarget.Target, new Rectangle(16, 16, Main.screenWidth, Main.screenHeight), Color.White);
}
}
public static float Transparency;
@@ -73,32 +130,29 @@ namespace CalamityMod.Backgrounds
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
//make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has
// Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has.
Transparency -= 1f;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active)
//also do not run any of the background drawing if you have the vanilla background config option turned off
// Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active).
// Also do not run any of the background drawing if you have the vanilla background config option turned off.
if (Transparency > 0f && Main.BackgroundEnabled)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 1.5f;
float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f;
for (int Layers = 4; Layers >= 0; Layers--)
{
//get each background texture
// Get each background texture.
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaBurrowsBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
@@ -148,7 +202,7 @@ namespace CalamityMod.Backgrounds
{
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
{
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var color = Color.White * Transparency;
-9
View File
@@ -158,9 +158,6 @@ namespace CalamityMod.Balancing
// See Aquatic Scourge comment.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
// 50% resist to Aftershock's rocks.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AftershockRock>()))));
// 50% resist to Dormant Brimseeker.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
@@ -340,9 +337,6 @@ namespace CalamityMod.Balancing
// 35% resist to Sulphuric Acid Cannon's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
// 35% resist to Venusian Trident.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<VenusianBolt>()))));
// 25% resist to Corinth Prime's grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
@@ -404,9 +398,6 @@ namespace CalamityMod.Balancing
// 65% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(ResistTrueMelee(0.35f))));
// 65% resist to The Enforcer's projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<EssenceFlame2>()))));
// 65% resist to The Final Dawn's lunge.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<FinalDawnThrow2>()))));
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.BrimstoneCragTiles > 100 && player.ZoneUnderworldHeight;
return BiomeTileCounterSystem.BrimstoneCragTiles > 500 && player.ZoneUnderworldHeight;
}
}
}
-4
View File
@@ -31,10 +31,6 @@ namespace CalamityMod.Buffs
player.GetDamage<MagicDamageClass>() -= 0.02f;
player.GetCritChance<MagicDamageClass>() -= 2;
}
else if (type == BuffID.Panic)
{
player.moveSpeed -= 0.6f;
}
else if (type == BuffID.SugarRush)
{
player.moveSpeed -= 0.1f;
+69 -46
View File
@@ -125,7 +125,7 @@ namespace CalamityMod.CalPlayer
public bool noLifeRegen = false;
public bool reducedDaybrokenDamage = false;
public bool reducedNightwitherDamage = false;
public float rangedAmmoCost = 1f;
public float ammoCost = 1f;
public float healingPotionMultiplier = 1f;
/// <summary>
/// Tracks whether or not the player is currently holding Gael's Greatsword.<br/>
@@ -727,15 +727,13 @@ namespace CalamityMod.CalPlayer
public bool theBee = false;
public bool arcFlashRing = false;
public bool arcFlashRingVisual = false;
public int generalBandCooldown = 0;
public bool bGlassBand = false; // Obsidian band
public bool bGlassBandVisual = false;
public int bGlassbandCooldown = 0;
public bool batholithBangle = false; // Granite band
public bool batholithBangleVisual = false;
public int batholithBangleCooldown = 0;
public bool protolithBangle = false; // Marble band
public bool protolithBangleVisual = false;
public int protolithBangleCooldown = 0;
/// <summary> Used to prevent dodges from triggering The Bee's full health damage reduction cooldown. </summary>
public bool shouldTriggerBeeCooldown = false;
public int theBeeCooldown = 0;
@@ -785,6 +783,7 @@ namespace CalamityMod.CalPlayer
public int gloveLevel = 0;
public bool alreadyHasFrogLeg = false; // Unused, intended to prevent Frog Leg tinker stacking
public bool eTalisman = false;
public bool lastDashWasTabi = false;
public bool statisNinjaBelt = false;
/// <summary> Used to keep track of how many dashes in the same direction you make to prevent dashing away from bosses forever at max efficency. </summary>
public int statisPenaltyTimer = 0;
@@ -806,6 +805,12 @@ namespace CalamityMod.CalPlayer
public int transformerCooldown = 0;
public int transformerDelay = 0;
public int transformerStoredKills = 0;
public bool bloomStone = false;
public bool bloomStoneHookVisuals = false;
public int bloomStoneHealInc = 0;
public int bloomStoneTotalHeal = 0;
public int bloomStoneHealTimer = 0;
public int bloomStoneDR = 0;
public bool hideOfDeus = false;
public bool dAmulet = false;
public bool rampartOfDeities = false;
@@ -850,7 +855,6 @@ namespace CalamityMod.CalPlayer
public bool sGlyph = false;
public bool sRegen = false;
public bool tracersDust = false;
public bool elysianWingsDust = false;
public bool tracersCelestial = false;
public bool tracersElysian = false;
public bool tracersSeraph = false;
@@ -927,6 +931,11 @@ namespace CalamityMod.CalPlayer
public bool spiritOrigin = false;
public bool spiritOriginVanity = false;
public int spiritOriginCritBoost = 0;
/// <summary>
/// The amount of bonus crit damage the player has.
/// At 0f, the player has regular crit damage. At 1f, the player has +100% crit damage.
/// </summary>
public float critDamage = 0;
public bool darkSunRing = false;
public bool crawCarapace = false;
public bool baroclaw = false;
@@ -951,6 +960,7 @@ namespace CalamityMod.CalPlayer
public bool sPauldronVisual = false;
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public Color XykFXColor = Color.Black;
public bool manaOverloader = false;
/// <summary> Used for allowing Calamity slimes to be affected by Royal Gel. </summary>
public bool royalGel = false;
@@ -1028,8 +1038,6 @@ namespace CalamityMod.CalPlayer
/// Life regeneration is increased while between 600 and 720, with a 10 second cooldown afterwards represented by being below 600.
/// </summary>
public int phantomicHeartRegen = 0;
public bool silvaWings = false;
public int silvaWingsLifeRegenTimer = 0;
/// <summary> General cooldown variable for spawning projectiles from wing bonus effects. Used by Soul of Cryogen, Tattered Fairy Wings, and Festive Wings. </summary>
public int wingProjectileCooldown = 0;
public bool RustyMedallionDroplets = false;
@@ -2169,6 +2177,10 @@ namespace CalamityMod.CalPlayer
arcFlashRingVisual = false;
bGlassBand = false;
bGlassBandVisual = false;
batholithBangle = false; // Granite band
batholithBangleVisual = false;
protolithBangle = false; // Marble band
protolithBangleVisual = false;
aFossil = false;
aPowder = false;
fallingBlockProtection = false;
@@ -2180,11 +2192,16 @@ namespace CalamityMod.CalPlayer
bloodyWormTooth = false;
vexation = false;
badgeOfBravery = false;
// Clear the Warbanner "cooldown" if not wearing Warbanner. This has absolutely zero effect for a casual player, but is useful for resetting the cooldown's duration.
if (!WarbanneroftheRighteous)
cooldowns.Remove(WarbanneroftheRighteousBuff.ID);
WarbanneroftheRighteous = false;
warbannerGlow = false;
ilSpark = false;
transformer = false;
transformerVisual = false;
bloomStone = false;
bloomStoneHookVisuals = false;
hideOfDeus = false;
dAmulet = false;
rampartOfDeities = false;
@@ -2220,8 +2237,10 @@ namespace CalamityMod.CalPlayer
eGauntlet = false;
eGauntletVisuals = true;
gloveLevel = 0;
statisNinjaBelt = false;
statisVoidSash = false;
if (Player.dashDelay != -1)
statisNinjaBelt = false;
if (Player.dashDelay != -1)
statisVoidSash = false;
alreadyHasFrogLeg = false;
eTalisman = false;
nucleogenesis = false;
@@ -2283,7 +2302,6 @@ namespace CalamityMod.CalPlayer
hallowedPower = false;
kamiBoost = false;
tracersDust = false;
elysianWingsDust = false;
tracersCelestial = false;
tracersElysian = false;
tracersSeraph = false;
@@ -2299,7 +2317,6 @@ namespace CalamityMod.CalPlayer
starbusterCore = false;
starTaintedGenerator = false;
camper = false;
silvaWings = false;
corrosiveSpine = false;
RustyMedallionDroplets = false;
rottenDogTooth = false;
@@ -2324,7 +2341,7 @@ namespace CalamityMod.CalPlayer
lunicCorpsSet = false;
lunicCorpsLegs = false;
rangedAmmoCost = 1f;
ammoCost = 1f;
healingPotionMultiplier = 1f;
avertorBonus = false;
@@ -2349,6 +2366,7 @@ namespace CalamityMod.CalPlayer
spiritOriginCritBoost = 0;
spiritOrigin = false;
spiritOriginVanity = false;
critDamage = 0;
astralStarRain = false;
@@ -2841,11 +2859,16 @@ namespace CalamityMod.CalPlayer
auralisAurora = 0;
necroReviveCounter = -1;
hideOfDeusTimer = 0;
bloomStoneHealInc = 0;
bloomStoneTotalHeal = 0;
bloomStoneHealTimer = 0;
bloomStoneDR = 0;
murasamaHitCooldown = 0;
RustyMedallionCooldown = 0;
SulphWaterPoisoningLevel = 0f;
holyInfernoFadeIntensity = 0f;
spiritOriginCritBoost = 0;
critDamage = 0f;
rage = 0f;
adrenaline = 0f;
raiderCritLifespan = 0;
@@ -3061,7 +3084,7 @@ namespace CalamityMod.CalPlayer
bloodfinTimer = 0;
healCounter = 300;
danceOfLightCharge = 0;
rangedAmmoCost = 1f;
ammoCost = 1f;
healingPotionMultiplier = 1f;
avertorBonus = false;
divineBless = false;
@@ -3181,7 +3204,6 @@ namespace CalamityMod.CalPlayer
fearmongerRegenFrames = 0;
xerocSet = false;
tracersDust = false;
elysianWingsDust = false;
GemTechState.OnDeathEffects();
shieldOfTheOceanParry = 0;
shieldOfTheOceanEmpoweredParry = false;
@@ -3221,7 +3243,6 @@ namespace CalamityMod.CalPlayer
momentumCapacitorTime = 0;
momentumCapacitorBoost = 0f;
vortexBoosterStealthDelay = 0;
silvaWingsLifeRegenTimer = 0;
LungingDown = false;
chaliceBleedoutBuffer = 0D;
@@ -4037,42 +4058,37 @@ namespace CalamityMod.CalPlayer
// Takes the movement speed bonus and uses it to increase run speed
float accRunSpeedMin = Player.accRunSpeed * 0.5f;
Player.accRunSpeed += Player.accRunSpeed * moveSpeedBonus * 0.2f;
Player.accRunSpeed += Player.accRunSpeed * moveSpeedBonus * 0.16f;
if (Player.accRunSpeed < accRunSpeedMin)
Player.accRunSpeed = accRunSpeedMin;
//Life Jelly regen aura spawn when using a healing potion
// Life Jelly regen aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly && !GrandGelatin)
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType<PinkJellyAura>(), 0, 0, Player.whoAmI);
//Cleansing Jelly cleansing aura spawn when using a healing potion
// Cleansing Jelly cleansing aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly && !GrandGelatin)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType<BlueJellyAura>(), 0, 0, Player.whoAmI);
}
//Grand Gellatin regen and cleansing aura spawn when using a healing potion
// Grand Gellatin regen and cleansing aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && GrandGelatin && !absorber)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType<GreenJellyAura>(), 0, 0, Player.whoAmI);
}
//Absorber's regen, cleansing, and buffing aura spawn when using a healing potion
// Absorber's regen, cleansing, and buffing aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && absorber)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType<AbsorberAura>(), 0, 0, Player.whoAmI);
}
if (snowman)
{
if (Player.whoAmI == Main.myPlayer && !snowmanNoseless)
Player.AddBuff(BuffType<PopoBuff>(), 60, true);
}
if (abyssalDivingSuit)
{
Player.AddBuff(BuffType<AbyssalDivingSuitBuff>(), 60, true);
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(DivingPlatesBroken.ID))
{
Player.AddBuff(BuffType<AbyssalDivingSuitPlates>(), 2);
}
if (Player.whoAmI == Main.myPlayer && Player.active && abyssalDivingSuitPlateHits < 3)
{
@@ -4090,40 +4106,36 @@ namespace CalamityMod.CalPlayer
}
if (aquaticHeart)
{
Player.AddBuff(BuffType<AquaticHeartBuff>(), 60, true);
}
if (aquaticHeart && NPC.downedBoss3)
{
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(AquaticHeartIceShield.ID))
{
Player.AddBuff(BuffType<IceShieldBuff>(), 2);
}
}
if (profanedCrystal)
{
Player.AddBuff(BuffType<ProfanedCrystalBuff>(), 60, true);
}
if (gSabaton)
{
if (Player.whoAmI == Main.myPlayer)
{
// While holding hotkey, but before slam, bring Y velocity closer to 0
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
{
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 2f)) / 60f;
}
// Play sound a bit early so it goes in time with the fall
if (gSabatonHotkeyHoldTime == 15 && !gSabatonFalling)
{
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
}
// 0.5 seconds passed, falling time
if (gSabatonHotkeyHoldTime == 30)
{
gSabatonFalling = true;
Player.velocity.Y = 0.01f;
}
// Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
// Also cancel fall if the player has upwards Y velocity (Goodbye Inner Tube cheese)
if ((Player.gravDir == 1 && Player.velocity.Y < 0f) || (Player.gravDir == -1 && Player.velocity.Y > 1f) || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
@@ -4131,6 +4143,7 @@ namespace CalamityMod.CalPlayer
gSabatonFall = 0;
gSabatonFalling = false;
}
if (gSabatonFalling)
{
SpawnGravistarParticle();
@@ -4141,6 +4154,7 @@ namespace CalamityMod.CalPlayer
Player.maxFallSpeed = 40f;
Player.gravity = 1.3f;
// If the player can fly during the fall, the physics gets a bit funky
Player.controlJump = false;
@@ -4148,13 +4162,14 @@ namespace CalamityMod.CalPlayer
if (0 == Player.velocity.Y)
{
var source = Player.GetSource_Accessory(FindAccessory(ItemType<InterstellarStompers>()));
//Spawn explosion. ai[0] is used for transferring the recorded falling time
// Spawn explosion. ai[0] is used for transferring the recorded falling time
int damage = Player.CalcIntDamage<MeleeDamageClass>(InterstellarStompers.SlamDamage);
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType<StomperSlam>(), damage, 4f, Player.whoAmI, gSabatonFall);
gSabatonFall = 0;
gSabatonFalling = false;
// Temporary jump speed is granted for 40 frames
gSabatonTempJumpSpeed = 40;
}
@@ -4215,7 +4230,7 @@ namespace CalamityMod.CalPlayer
if (Main.myPlayer == Player.whoAmI)
{
mouseRight = PlayerInput.Triggers.Current.MouseRight;
mouseWorld = Main.MouseWorld;
mouseWorld = LockOnHelper.Enabled ? LockOnHelper.PredictedPosition : Main.MouseWorld;
if (rightClickListener && mouseRight != oldMouseRight)
{
@@ -4355,6 +4370,17 @@ namespace CalamityMod.CalPlayer
}
}
//Star in a Bottle gives Mana Regeneration instead of it's usual effect when you don't already have Mana Regeneration
if (!Player.manaRegenBuff && Player.HasBuff(BuffID.StarInBottle))
{
//Cancel out Star In A Bottle's normal effect
Player.manaRegenDelayBonus -= 0.5f;
Player.manaRegenBonus -= 10;
//Apply Mana Regen Potion effect
Player.manaRegenBuff = true;
}
ForceVariousEffects();
}
#endregion
@@ -4521,6 +4547,8 @@ namespace CalamityMod.CalPlayer
public override void GetHealLife(Item item, bool quickHeal, ref int healValue)
{
healValue = (int)(healValue * healingPotionMultiplier);
if (bloomStone)
healValue = 0;
}
#endregion
@@ -4837,12 +4865,7 @@ namespace CalamityMod.CalPlayer
Vector2 mouse = Player.ClampedMouseWorld();
Vector2 startingPosition = mouse - Vector2.UnitY.RotatedByRandom(0.3f) * 1250f;
Vector2 directionToMouse = (mouse - startingPosition).SafeNormalize(Vector2.UnitX);
int drop = Projectile.NewProjectile(MedallionSource, startingPosition, directionToMouse * 15f, ProjectileType<AcidBarrelDrop>(), d, 0f, Player.whoAmI, 3);
if (drop.WithinBounds(Main.maxProjectiles))
{
Main.projectile[drop].penetrate = 2;
Main.projectile[drop].DamageType = DamageClass.Generic;
}
Projectile.NewProjectile(MedallionSource, startingPosition, directionToMouse * 15f, ProjectileType<RustyMedallionDroplet>(), d, 0f, Player.whoAmI, 3);
RustyMedallionCooldown = RustyMedallion.AcidCreationCooldown;
}
}
+15 -15
View File
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.DrawLayers;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
@@ -140,21 +141,6 @@ namespace CalamityMod.CalPlayer
}
}
}
// Elysian Wings, Elysian TRACERS?! and SERAPH TRACERS?!
if (calamityPlayer.elysianWingsDust && drawInfo.shadow == 0f)
{
if (!Player.StandingStill() && !Player.mount.Active)
{
if (Main.rand.NextBool())
{
Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.GoldCoin, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f);
dust.noGravity = true;
dust.velocity *= 0.5f;
drawInfo.DustCache.Add(dust.dustIndex);
}
}
}
#endregion
#region Armor Visuals
@@ -342,6 +328,20 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(Plus);
}
}
if (calamityPlayer.bloomStoneDR > 0 && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(10))
{
MediumMistParticle pollenCloud = new(Player.Center, Main.rand.NextVector2Circular(1f, 1f), Color.Yellow, Color.Gold, 0.85f, 100f);
GeneralParticleHandler.SpawnParticle(pollenCloud);
}
if (Main.rand.NextBool(4))
{
Dust pollenDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, ModContent.DustType<LightDust>(), newColor: Color.Gold, Scale: 0.4f);
pollenDust.noLightEmittence = true;
pollenDust.noGravity = true;
}
}
if (calamityPlayer.bloodfinBoost && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(3))
+18 -8
View File
@@ -32,6 +32,7 @@ using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Typeless;
@@ -510,6 +511,7 @@ namespace CalamityMod.CalPlayer
#region Modify Hit NPC
public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.CritDamage += critDamage;
// All Calamity multipliers are added together to prevent insane exponential stacking
float totalDamageMult = 1f;
@@ -591,6 +593,8 @@ namespace CalamityMod.CalPlayer
{
if (proj.npcProj || proj.trap)
return;
modifiers.CritDamage += critDamage;
// All Calamity multipliers are added together to prevent insane exponential stacking
float totalDamageMult = 1f;
@@ -2605,7 +2609,8 @@ namespace CalamityMod.CalPlayer
Player.immuneTime += iFramesToAdd;
// Similar handle to 1.4 Star Cloak: these hits ie. spikes or lava cannot activate hit effects
if (hurtInfo.CooldownCounter != -1 && hurtInfo.CooldownCounter != 1)
bool canTriggerHitEffects = hurtInfo.CooldownCounter == -1 || hurtInfo.CooldownCounter == 1;
if (!canTriggerHitEffects)
return;
if (aeroSet && hurtInfo.Damage > 25)
@@ -2634,20 +2639,25 @@ namespace CalamityMod.CalPlayer
}
}
// TODO -- Make Deific Amulet and Rampart of Deities' retaliation effects way cooler
// In the meantime, gave them homing astral bombers instead of the lame falling stars
if (dAmulet)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<DeificAmulet>()));
for (int n = 0; n < 3; n++)
int projAmount = (rampartOfDeities ? 12 : 6);
for (int n = 0; n < projAmount; n++)
{
int baseDamage = 130 * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1);
int deificStarDamage = (int)Player.GetBestClassDamage().ApplyTo(baseDamage);
int deificProjDamage = (int)Player.GetBestClassDamage().ApplyTo(baseDamage);
Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.StarVeilStar, deificStarDamage, 4f, Player.whoAmI);
if (star.whoAmI.WithinBounds(Main.maxProjectiles))
Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType<AstralStar>(), deificProjDamage, 4f, Player.whoAmI)];
if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles))
{
star.DamageType = DamageClass.Generic;
star.usesLocalNPCImmunity = true;
star.localNPCHitCooldown = 5;
onHitProj.DamageType = DamageClass.Generic;
onHitProj.usesLocalNPCImmunity = true;
onHitProj.localNPCHitCooldown = 5;
onHitProj.tileCollide = false;
onHitProj.extraUpdates = 1;
onHitProj.Calamity().conditionalHomingRange = 500f;
}
}
}
-18
View File
@@ -685,24 +685,6 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenTime += 4;
}
if (silvaWings)
{
if (Player.velocity.Y == 0f || Player.wingTime == Player.wingTimeMax)
silvaWingsLifeRegenTimer = 0;
else
{
silvaWingsLifeRegenTimer++;
if (silvaWingsLifeRegenTimer > SilvaWings.LifeRegenTimerMax)
silvaWingsLifeRegenTimer = SilvaWings.LifeRegenTimerMax;
}
// Life regen boost scales up to 8 HP/s based on how long you stay in the air without resetting flight time
int lifeRegenBoost = (int)MathHelper.Lerp(0f, 16f, silvaWingsLifeRegenTimer / (float)SilvaWings.LifeRegenTimerMax);
Player.lifeRegen += lifeRegenBoost;
}
else
silvaWingsLifeRegenTimer = 0;
if (pinkCandle && !noLifeRegen)
{
// Every frame, add up 1/60th of the healing value (0.4% max HP per second)
+146 -54
View File
@@ -78,6 +78,7 @@ using Terraria.GameContent.Events;
using Terraria.GameInput;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
@@ -142,9 +143,6 @@ namespace CalamityMod.CalPlayer
// Limits
Limits();
// This is used to increase horizontal velocity based on the player's movement speed stat.
moveSpeedBonus = Player.moveSpeed - 1f;
// Potions (Quick Buff && Potion Sickness)
HandlePotions();
@@ -228,25 +226,82 @@ namespace CalamityMod.CalPlayer
if (WulfrumHat.PowerModeEngaged(Player, out _))
Player.moveSpeed *= 0.8f;
if ((XykVisualsBlue || XykVisualsOrange))
{
bool Orange = XykVisualsOrange;
Color effectColor = Orange ? Color.Gold : Color.DodgerBlue;
float rate = Main.GlobalTimeWrappedHourly * 12;
List<Color> eColors = new List<Color>()
{
Orange ? new Color(248, 117, 52) : Color.DodgerBlue,
Orange ? Color.Gold : Color.Cyan,
Orange ? Color.Orange : Color.RoyalBlue
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
effectColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
bool rageOrAdren = (Player.Calamity().rageModeActive || Player.Calamity().adrenalineModeActive);
bool rageAndAdren = (Player.Calamity().rageModeActive && Player.Calamity().adrenalineModeActive);
Color attemptColor = (rageAndAdren ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Player.Calamity().adrenalineModeActive ? Color.MediumSpringGreen : Player.Calamity().rageModeActive ? Color.Crimson : effectColor);
XykFXColor = Color.Lerp(XykFXColor, attemptColor, rageOrAdren ? 0.05f : 0.25f);
int maxWingPieces = 7;
int numOfActiveWings = 0;
foreach (Projectile p in Main.ActiveProjectiles)
if (p.type == ModContent.ProjectileType<XykWings>() && p.owner == Player.whoAmI && p.ai[1] == 0)
numOfActiveWings++;
bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && !(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0;
if (spawnWings)
{
int wingCount = numOfActiveWings;
Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykWings>(), 0, 0f, Player.whoAmI, wingCount);
}
}
// First Frame dash effects
bool dashStart = (Player.dashDelay == -1 && IsFirstDashFrame);
int dir = MathF.Sign(Player.velocity.X);
if (dashStart)
{
lastDashWasTabi = false;
}
if (((gShell && giantShellPostHit == 0) || (tortShell && tortShellPostHit == 0)) && dashStart)
{
Player.velocity.X *= 0.9f;
}
// Tabi/Master Ninja Gear dash change
if (Player.dashType == 1)
if (lastDashWasTabi)
{
Player.dashType = 1;
}
if (Player.dashType == 1 && !Player.Calamity().statisNinjaBelt && !Player.Calamity().statisVoidSash)
{
if (dashStart)
{
Player.velocity.X *= 3.5f;
lastDashWasTabi = true;
}
if (Player.dashDelay == -1)
{
Player.velocity.X *= 0.9f;
}
}
if (Player.Calamity().statisNinjaBelt)
{
Player.Calamity().DashID = StatisNinjaBeltDash.ID;
}
if (Player.Calamity().statisVoidSash)
{
Player.Calamity().DashID = StatisVoidSashDash.ID;
}
if ((devilsDevastationKillMode || exaltedKillMode) && !Player.mount.Active)
{
@@ -338,27 +393,16 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 0, Player.whoAmI);
}
if (Player.dashDelay == -1)
{
Player.endurance += 0.1f;
Player.noKnockback = true;
}
}
if (XykVisualsBlue || XykVisualsOrange)
{
bool Orange = XykVisualsOrange;
Color effectColor = Orange ? Color.Gold : Color.DodgerBlue;
float rate = Main.GlobalTimeWrappedHourly * 22;
List<Color> eColors = new List<Color>()
{
Orange ? Color.OrangeRed : Color.DodgerBlue,
Orange ? Color.Gold : Color.Cyan,
Orange ? Color.Orange : Color.RoyalBlue
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
effectColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
if (dashStart)
{
@@ -366,18 +410,18 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(dash with { Volume = 0.7f, Pitch = Main.rand.NextFloat(0f, 0.2f) + (Orange ? 0 : 0.2f) }, Player.Center);
if (Orange)
{
Particle spark1 = new CustomPulse(Player.Center, Vector2.Zero, effectColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, MathHelper.PiOver4, 0.45f, 0.25f, 47);
Particle spark1 = new CustomPulse(Player.Center, Vector2.Zero, XykFXColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, MathHelper.PiOver4, 0.45f, 0.25f, 47);
GeneralParticleHandler.SpawnParticle(spark1);
Particle spark2 = new CustomPulse(Player.Center, Vector2.Zero, effectColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, MathHelper.PiOver4, 0, 0.8f, 17);
Particle spark2 = new CustomPulse(Player.Center, Vector2.Zero, XykFXColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, MathHelper.PiOver4, 0, 0.8f, 17);
GeneralParticleHandler.SpawnParticle(spark2);
}
else
{
Particle spark1 = new CustomPulse(Player.Center, Player.velocity * 0.3f, effectColor, "CalamityMod/Particles/BloomRing", new Vector2(0.4f, 1f), Player.velocity.ToRotation(), 0, 1f, 24);
Particle spark1 = new CustomPulse(Player.Center, Player.velocity * 0.3f, XykFXColor, "CalamityMod/Particles/BloomRing", new Vector2(0.4f, 1f), Player.velocity.ToRotation(), 0, 1f, 24);
GeneralParticleHandler.SpawnParticle(spark1);
Particle spark2 = new CustomPulse(Player.Center, Player.velocity * 0.5f, effectColor, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Player.velocity.ToRotation(), 0, 0.75f, 17);
Particle spark2 = new CustomPulse(Player.Center, Player.velocity * 0.5f, XykFXColor, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Player.velocity.ToRotation(), 0, 0.75f, 17);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
@@ -389,33 +433,35 @@ namespace CalamityMod.CalPlayer
if (!Orange)
{
float sine = (float)Math.Sin(Player.miscCounter * 0.875f / MathHelper.Pi);
for (int i = -1; i <= 1; i += 2)
{
Vector2 offset = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 18f * i;
Vector2 offset = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 17f;
Particle spark1 = new GlowSparkParticle(Player.Center + offset + SparkVelocity1, SparkVelocity1 * 2 * sparkscale1, false, 25, 0.04f * sparkscale1, effectColor * 0.9f, new Vector2(0.8f, 0.3f), true, false, 0.4f);
GeneralParticleHandler.SpawnParticle(spark1);
Particle spark2 = new GlowSparkParticle(Player.Center - offset + SparkVelocity1, SparkVelocity1 * 2 * sparkscale1, false, 25, 0.04f * sparkscale1, effectColor * 0.9f, new Vector2(1, 0.3f), true, false, 0.4f);
GeneralParticleHandler.SpawnParticle(spark2);
Particle spark1 = new CustomSpark(Player.Center + offset + SparkVelocity1, SparkVelocity1 * 2 * sparkscale1, "CalamityMod/Particles/BloomCircle", false, 15, 0.3f * sparkscale1, XykFXColor * 0.85f, new Vector2(0.9f, 1.4f), true, true, 0, shrinkSpeed: 0.2f, glowOpacity: 0.85f);
GeneralParticleHandler.SpawnParticle(spark1);
}
}
else
{
float sparkscale2 = MathF.Min(Player.velocity.X * dir * 0.07f, 1.1f);
Vector2 SparkVelocity2 = Player.velocity.RotatedBy(dir * 2.5f, default) * 0.1f - Player.velocity / 2f;
Particle spark = new LineParticle(Player.Center + (Player.velocity.SafeNormalize(Vector2.UnitX) * 15).RotatedBy(2f * dir) * 1.5f, SparkVelocity2, false, 10, sparkscale2, effectColor);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 SparkVelocity3 = Player.velocity.RotatedBy(dir * -2.5f, default) * 0.1f - Player.velocity / 2f;
Particle spark2 = new LineParticle(Player.Center + (Player.velocity.SafeNormalize(Vector2.UnitX) * 15).RotatedBy(-2f * dir) * 1.5f, SparkVelocity3, false, 10, sparkscale2, effectColor);
GeneralParticleHandler.SpawnParticle(spark2);
for (int i = -1; i <= 1; i += 2)
{
Vector2 offset = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * 17f * i;
Particle spark1 = new CustomSpark(Player.Center + offset + SparkVelocity1, SparkVelocity1 * 2 * sparkscale1, "CalamityMod/Particles/BloomCircle", false, 20, 0.4f * sparkscale1, XykFXColor * 0.95f, new Vector2(0.3f, 1.2f), true, true, 0, shrinkSpeed: 0.2f, glowOpacity: 0.95f);
GeneralParticleHandler.SpawnParticle(spark1);
}
}
for (int i = 0; i < 2; i++)
{
Dust dust = Dust.NewDustPerfect(Player.Center + Main.rand.NextVector2Circular(20, 30) + SparkVelocity1, 267, SparkVelocity1 * Main.rand.NextFloat(0.5f, 3f) * sparkscale1, 0, default, Main.rand.NextFloat(0.7f, 1.1f) * sparkscale1);
bool altDust = Main.rand.NextBool(3);
Dust dust = Dust.NewDustPerfect(Player.Center + Main.rand.NextVector2Circular(20, 30) + SparkVelocity1, altDust ? (Orange ? ModContent.DustType<SquareDust>() : ModContent.DustType<SquashDustHollow>()) : ModContent.DustType<SquashDust>(), SparkVelocity1 * Main.rand.NextFloat(0.5f, 3f) * sparkscale1, 0, default, Main.rand.NextFloat(1.5f, 1.9f) * sparkscale1);
dust.noGravity = true;
dust.color = effectColor;
Dust dust2 = Dust.NewDustPerfect(Player.Center + Main.rand.NextVector2Circular(20, 30) + SparkVelocity1, 10, SparkVelocity1 * Main.rand.NextFloat(0.5f, 3f) * sparkscale1, 0, default, Main.rand.NextFloat(0.9f, 1.4f) * sparkscale1);
dust2.noGravity = true;
dust.color = XykFXColor;
dust.fadeIn = altDust ? 0 : 2;
if (altDust)
dust.scale *= 0.5f;
}
}
}
@@ -434,6 +480,17 @@ namespace CalamityMod.CalPlayer
IsFirstDashFrame = false;
else
IsFirstDashFrame = true;
// THIS MUST BE NEAR THE END OF PostUpdateMiscEffects SO ALL OTHER RUN SPEED IS DONE FIRST. DO NOT PUT ANY RUN SPEED AFTER THIS
// Multiplies movement speed by 1.5x so that you don't feel like a snail in the early game.
// This applies to movement speed boosts as well as base speed to ensure they are actually worth their listed value compared to base speed
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.moveSpeed *= BalancingConstants.DefaultMoveSpeedBoost;
// This is used to increase horizontal velocity based on the player's movement speed stat.
moveSpeedBonus = Player.moveSpeed - 1f;
}
#endregion
@@ -737,10 +794,10 @@ namespace CalamityMod.CalPlayer
if (Player.velocity.Length() == 0f)
return;
Dust dust = Dust.NewDustDirect(Player.Center, 16, 16, DustID.Firefly, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f);
Dust dust = Dust.NewDustDirect(Player.Center, 16, 16, DustID.Firefly, 0.2f, 0f, 0, new Color(117, 55, 15), Main.rand.NextFloat(1f, 2f));
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
dust.fadeIn = 2.5f;
}
// Ores below here
@@ -1247,7 +1304,7 @@ namespace CalamityMod.CalPlayer
Player.maxFallSpeed = 20f;
}
if (Player.controlDown && ironBoots)
if (Player.controlDown && !Player.controlJump && ironBoots)
{
Player.maxFallSpeed = 23f; // This is slightly faster than slimy saddle (so it can be viable)
if (Player.gravDir == 1 ? Player.velocity.Y <= 0 : Player.velocity.Y >= 0)
@@ -1285,10 +1342,16 @@ namespace CalamityMod.CalPlayer
}
else
{
if (Player.mount.Type == MountID.Slime || Player.mount.Type == MountID.PogoStick)
if (Player.mount.Type == MountID.Slime)
Player.velocity.X *= 0.91f;
else if (Player.mount.Type == MountID.QueenSlime)
Player.velocity.X *= 0.95f;
else if (Player.mount.Type == MountID.PogoStick)
{
if (Player.velocity.X > 10 || Player.velocity.X < -10)
Player.velocity.X *= 0.99f; //Stops infinite high-speed movement, but allows fun pogo movement tech still
Player.maxFallSpeed *= 0.75f; // 1.5x fall speed instead of 2x to counterbalance
}
}
// Increase Rope climb velocities, if enabled
@@ -1704,7 +1767,7 @@ namespace CalamityMod.CalPlayer
if (ironBoots)
{
if (Player.controlDown)
if (Player.controlDown && !Player.controlJump)
{
if (Player.gravDir == 1 ? Player.velocity.Y > 0 : Player.velocity.Y < 0)
fallingBootVelCheckTimer++;
@@ -1999,12 +2062,8 @@ namespace CalamityMod.CalPlayer
VoidCooldown--;
if (ursaSergeantCooldown > 0)
ursaSergeantCooldown--;
if (bGlassbandCooldown > 0)
bGlassbandCooldown--;
if (batholithBangleCooldown > 0)
batholithBangleCooldown--;
if (protolithBangleCooldown > 0)
protolithBangleCooldown--;
if (generalBandCooldown > 0)
generalBandCooldown--;
if (AlchFlaskCooldown > 0)
AlchFlaskCooldown--;
if (tarraRangedCooldown > 0)
@@ -2023,6 +2082,43 @@ namespace CalamityMod.CalPlayer
jetPackDash--;
if (theBeeCooldown > 0)
theBeeCooldown--;
if (bloomStoneHealTimer > 0)
{
if (bloomStone && bloomStoneHealTimer % 40 == 0)
{
Player.HealPlayer(Math.Min(bloomStoneHealInc, bloomStoneTotalHeal));
// Special specifically programmed interaction with Chalice of the Blood God: Healing over time clears bits of the bleedout buffer.
if (chaliceOfTheBloodGod && chaliceBleedoutBuffer > 0D)
{
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * bloomStoneHealInc;
chaliceBleedoutBuffer -= amountOfBleedToClear;
// Display text indicating that healing was applied to the bleedout buffer.
if (!Main.dedServ)
{
string text = $"(+{amountOfBleedToClear})";
Rectangle location = new Rectangle((int)Player.position.X + 4, (int)Player.position.Y - 3, Player.width - 4, Player.height - 4);
CombatText.NewText(location, ChaliceOfTheBloodGod.BleedoutBufferDamageTextColor, Language.GetTextValue(text), dot: true);
}
}
bloomStoneTotalHeal -= bloomStoneHealInc;
if (bloomStoneTotalHeal < 0)
bloomStoneTotalHeal = 0;
}
bloomStoneHealTimer--;
}
else
{
bloomStoneTotalHeal = 0;
bloomStoneHealInc = 0;
}
if (bloomStoneDR > 0)
{
Player.endurance += bloomStoneHealTimer > 0 ? 0.12f : 0.06f;
bloomStoneDR--;
}
if (summonProjCooldown > 0f)
summonProjCooldown -= 1f;
if (ataxiaDmg > 0f)
@@ -3419,10 +3515,6 @@ namespace CalamityMod.CalPlayer
--bloodflareCoreRemainingHealOverTime;
}
// Multiplies base movement speed by 1.5x so that you don't feel like a snail in the early game
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.maxRunSpeed *= BalancingConstants.DefaultMoveSpeedBoost;
// Reduce how slow Chilled makes the player, because it's cancerous right now
// The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half
+77 -19
View File
@@ -10,7 +10,6 @@ using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Fishing.AstralCatches;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.NPCs;
using CalamityMod.NPCs.NormalNPCs;
@@ -26,12 +25,10 @@ using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using static System.Net.Mime.MediaTypeNames;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.CalPlayer
@@ -72,7 +69,6 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType<VulnerabilityHex>(), VulnerabilityHex.AflameDuration);
target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet;
target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold;
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
target.Calamity().IncreasedElectricityEffects_Unused = false;
@@ -80,7 +76,6 @@ namespace CalamityMod.CalPlayer
target.Calamity().IncreasedHeatEffects_Fireball = fireball;
target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
target.Calamity().IncreasedHeatEffects_FireBoots = bootLevel;
target.Calamity().IncreasedHeatEffects_FlameWings = flameWingsHeat;
target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart;
@@ -148,14 +143,46 @@ namespace CalamityMod.CalPlayer
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
if (bGlassBand && bGlassbandCooldown == 0)
if (generalBandCooldown == 0)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
bGlassbandCooldown = BlackGlassBand.cooldown;
int cooldown = 0;
if (bGlassBand)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && item.DamageType == DamageClass.Ranged)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
band.DamageType = DamageClass.Ranged;
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && item.DamageType == DamageClass.Magic)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
band.DamageType = DamageClass.Magic;
if (cooldown < BatholithBangle.cooldown)
cooldown = BatholithBangle.cooldown;
}
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
}
}
if (luxorsGift)
luxorHit = true;
@@ -209,7 +236,6 @@ namespace CalamityMod.CalPlayer
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
cgn.IncreasedColdEffects_EskimoSet = eskimoSet;
cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold;
cgn.IncreasedColdEffects_CryoStone = CryoStone;
cgn.IncreasedElectricityEffects_Unused = false;
@@ -217,7 +243,6 @@ namespace CalamityMod.CalPlayer
cgn.IncreasedHeatEffects_Fireball = fireball;
cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
cgn.IncreasedHeatEffects_FireBoots = bootLevel;
cgn.IncreasedHeatEffects_FlameWings = flameWingsHeat;
cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart;
@@ -320,14 +345,47 @@ namespace CalamityMod.CalPlayer
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - UrsaSergeant.CooldownReducedPerKill, 0, UrsaSergeant.MaxCooldown);
if (bGlassBand && bGlassbandCooldown == 0)
if (generalBandCooldown == 0)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
bGlassbandCooldown = BlackGlassBand.cooldown;
int cooldown = 0;
// NOTE: Apparently Pulse Pistol/Pulse Rifle projectiles will set spawned projectiles here to inherit the proj ID???
// No clue why this happens or how to fix it, but it just breaks using multiple band types together on these two weapons
if (bGlassBand)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && proj.DamageType == DamageClass.Ranged)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
band.DamageType = DamageClass.Ranged;
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && proj.DamageType == DamageClass.Magic)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
band.DamageType = DamageClass.Magic;
if (cooldown < BatholithBangle.cooldown)
cooldown = BatholithBangle.cooldown;
}
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
}
}
if (luxorsGift && proj.type != ModContent.ProjectileType<LuxorsGiftMelee>() && proj.type != ModContent.ProjectileType<LuxorsGiftRanged>() && proj.type != ModContent.ProjectileType<LuxorsGiftMagic>() && proj.type != ModContent.ProjectileType<LuxorsGiftSummon>() && proj.type != ModContent.ProjectileType<LuxorsGiftRogue>() && proj.type != ModContent.ProjectileType<LuxorsGiftClassless>())
luxorHit = true;
+2 -1
View File
@@ -3,6 +3,7 @@ using System.Security.Policy;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Graphics.Metaballs;
using CalamityMod.Items.Accessories;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
@@ -47,7 +48,7 @@ namespace CalamityMod.CalPlayer.Dashes
if (strongVisuals)
{
SoundStyle sound = new("CalamityMod/Sounds/Item/VoidDash");
SoundStyle sound = StatisVoidSash.VoidDash;
SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, player.Center);
for (int i = 0; i < 40; i++)
{
@@ -1,48 +0,0 @@
using System.Collections.Generic;
using CalamityMod.Items.VanillaArmorChanges;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class AdrenalineTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public int Time = 0;
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawInfo.shadow != 0f || drawPlayer.dead)
return false;
return drawPlayer.Calamity().AdrenalineTrail;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Time++;
Player drawPlayer = drawInfo.drawPlayer;
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
float movementSpeedInterpolant = CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer);
for (float i = 0; i < drawPlayer.Calamity().OldPositions.Length; i += 0.9f)
{
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
float scale = MathHelper.Lerp(1.1f, 0.1f, completionRatio);
float opacity = MathHelper.Lerp(0.5f, 0.3f, completionRatio) * movementSpeedInterpolant;
List<DrawData> afterimages = new List<DrawData>();
for (int j = 0; j < existingDrawData.Count; j++)
{
var drawData = existingDrawData[j];
Vector2 extraPosition = (Time % 6 == 0 ? new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f)) : Vector2.Zero);
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition + extraPosition;
drawData.color = new Color(0, 255, 201) * opacity;
drawData.scale = new Vector2(scale);
afterimages.Add(drawData);
}
drawInfo.DrawDataCache.InsertRange(0, afterimages);
}
}
}
}
@@ -1,46 +0,0 @@
using System.Collections.Generic;
using CalamityMod.Items.VanillaArmorChanges;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class AscendantTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawInfo.shadow != 0f || drawPlayer.dead || drawPlayer.Calamity().AdrenalineTrail)
return false;
return drawPlayer.Calamity().ascendantTrail;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
float movementSpeedInterpolant = CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer);
for (float i = 0f; i < drawPlayer.Calamity().OldPositions.Length; i += 1.2f)
{
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
float scale = MathHelper.Lerp(1f, 0.7f, completionRatio);
float opacity = MathHelper.Lerp(0.18f, 0.06f, completionRatio) * movementSpeedInterpolant;
List<DrawData> afterimages = new List<DrawData>();
for (int j = 0; j < existingDrawData.Count; j++)
{
var drawData = existingDrawData[j];
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition;
drawData.color = Color.Khaki * opacity;
drawData.scale = new Vector2(scale);
afterimages.Add(drawData);
}
drawInfo.DrawDataCache.InsertRange(0, afterimages);
}
}
}
}
@@ -1,46 +0,0 @@
using System.Collections.Generic;
using CalamityMod.Items.VanillaArmorChanges;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class AuricSetTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawInfo.shadow != 0f || drawPlayer.dead || drawPlayer.Calamity().AdrenalineTrail || drawPlayer.Calamity().ascendantTrail)
return false;
return drawPlayer.Calamity().auricSet;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
float movementSpeedInterpolant = CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer);
for (float i = 0f; i < drawPlayer.Calamity().OldPositions.Length; i += 1.7f)
{
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
float scale = MathHelper.Lerp(1f, 0.6f, completionRatio);
float opacity = MathHelper.Lerp(0.12f, 0.03f, completionRatio) * movementSpeedInterpolant;
List<DrawData> afterimages = new List<DrawData>();
for (int j = 0; j < existingDrawData.Count; j++)
{
var drawData = existingDrawData[j];
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition;
drawData.color = new Color(105, 209, 248) * opacity;
drawData.scale = new Vector2(scale);
afterimages.Add(drawData);
}
drawInfo.DrawDataCache.InsertRange(0, afterimages);
}
}
}
}
@@ -1,47 +0,0 @@
using System.Collections.Generic;
using CalamityMod.Items.VanillaArmorChanges;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class CobaltSetTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawInfo.shadow != 0f || drawPlayer.dead || drawPlayer.Calamity().AdrenalineTrail || drawPlayer.Calamity().ascendantTrail)
return false;
return drawPlayer.Calamity().CobaltSet;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
float movementSpeedInterpolant = CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer);
for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++)
{
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
float scale = MathHelper.Lerp(1f, 0.5f, completionRatio);
float opacity = MathHelper.Lerp(0.23f, 0.07f, completionRatio) * movementSpeedInterpolant;
List<DrawData> afterimages = new List<DrawData>();
for (int j = 0; j < existingDrawData.Count; j++)
{
var drawData = existingDrawData[j];
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition;
drawData.color = new Color(100, 164, 219) * opacity;
drawData.color.B = (byte)(drawData.color.B * 1.4);
drawData.scale = new Vector2(scale);
afterimages.Add(drawData);
}
drawInfo.DrawDataCache.InsertRange(0, afterimages);
}
}
}
}
+9 -6
View File
@@ -16,16 +16,19 @@ namespace CalamityMod.CalPlayer.DrawLayers
protected override void Draw(ref PlayerDrawSet drawInfo)
{
//Todo : Make this work even for accessories by somehow checking for the players.head equipslot's item instead of the head item.
Player drawPlayer = drawInfo.drawPlayer;
Item headItem = drawPlayer.armor[0];
if (drawPlayer.armor[10].type > ItemID.None)
headItem = drawPlayer.armor[10];
if (drawPlayer.head == -1)
return;
if (ModContent.GetModItem(headItem.type) is IExtendedHat extendedHatDrawer)
if (EquipLoader.GetEquipTexture(EquipType.Head, drawPlayer.head) == null)
return;
ModItem headItem = EquipLoader.GetEquipTexture(EquipType.Head, drawPlayer.head).Item;
if (headItem is IExtendedHat extendedHatDrawer)
{
string equipSlotName = extendedHatDrawer.EquipSlotName(drawPlayer) != "" ? extendedHatDrawer.EquipSlotName(drawPlayer) : headItem.ModItem.Name;
string equipSlotName = extendedHatDrawer.EquipSlotName(drawPlayer) != "" ? extendedHatDrawer.EquipSlotName(drawPlayer) : headItem.Name;
int equipSlot = EquipLoader.GetEquipSlot(Mod, equipSlotName, EquipType.Head);
if (extendedHatDrawer.PreDrawExtension(drawInfo) && !drawInfo.drawPlayer.dead && equipSlot == drawPlayer.head)
@@ -92,8 +92,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SubsumingVortexSmallGlow").Value;
else if (itemType == ModContent.ItemType<TerrorBlade>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow").Value;
else if (itemType == ModContent.ItemType<TheEnforcer>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow").Value;
else if (itemType == ModContent.ItemType<VernalBolter>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/VernalBolterGlow").Value;
else if (itemType == ModContent.ItemType<VividClarity>())
@@ -1,46 +0,0 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class YanmeiKnifeTrail : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.BackAcc);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawInfo.shadow != 0f || drawPlayer.dead)
return false;
return drawPlayer.Calamity().kamiBoost;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++)
{
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
float scale = MathHelper.Lerp(1f, 0.5f, completionRatio);
float opacity = MathHelper.Lerp(0.25f, 0.08f, completionRatio);
List<DrawData> afterimages = new List<DrawData>();
for (int j = 0; j < existingDrawData.Count; j++)
{
var drawData = existingDrawData[j];
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition;
drawData.color = Color.Cyan * opacity;
drawData.color.G = (byte)(drawData.color.G * 1.6);
drawData.color.B = (byte)(drawData.color.B * 1.2);
drawData.scale = new Vector2(scale);
afterimages.Add(drawData);
}
drawInfo.DrawDataCache.InsertRange(0, afterimages);
}
}
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod
//
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
+4
View File
@@ -76,6 +76,10 @@ namespace CalamityMod
[DefaultValue(true)]
public bool EnableVanillaTextureEdits { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool SunkenSeaBackgroundDistortion { get; set; }
private const int MinParticleLimit = 500;
private const int MaxParticleLimit = 10000;
+19
View File
@@ -0,0 +1,19 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.Localization;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Cooldowns
{
public class GenericBandCooldown : CooldownHandler
{
public static new string ID => "BandCooldown";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/GenericBandCooldown";
public override Color OutlineColor => Color.White;
public override Color CooldownStartColor => Color.SlateGray;
public override Color CooldownEndColor => Color.Gray;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+2 -2
View File
@@ -16,9 +16,9 @@ namespace CalamityMod.Cooldowns
{
public class WarbanneroftheRighteousBuff : CooldownHandler
{
public float CompletionPercentage => Utils.GetLerpValue(80, 0, instance.timeLeft);
public float CompletionPercentage => Utils.GetLerpValue(70, 0, instance.timeLeft);
private bool IsEmpty => CompletionPercentage == 0;
private float TextXOffset => (instance.timeLeft <= 20 ? -11 : -18f);
private float TextXOffset => instance.timeLeft <= 20 ? -11f : -18f;
private Vector2 TextPosition => new(TextXOffset, 15);
private Color TextColor => Color.White;
private Color TextBorderColor => Color.Black;
+26
View File
@@ -0,0 +1,26 @@
sampler baseTexture : register(s0);
sampler distortionTexture : register(s1);
float time;
float distortionXSpeed;
float distortionYSpeed;
float distortionStrength;
float noiseScale;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 distortedCoords = coords + float2(time * distortionXSpeed, time * distortionYSpeed);
distortedCoords *= noiseScale;
float distortion = tex2D(distortionTexture, distortedCoords).r;
float4 returnColor = tex2D(baseTexture, coords + distortion * distortionStrength);
return returnColor * sampleColor.a;
}
technique Technique1
{
pass DistortionPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+13
View File
@@ -210,6 +210,14 @@ namespace CalamityMod.Effects
internal static Effect FlipScreenShader;
#endregion
//
// All below shaders were created by fryzahh
//
#region fryzahh's Shaders
// A simple shader which distorts an image using a provided texture of choice.
internal static Effect BasicTextureDistortionShader;
#endregion
public override void PostSetupContent()
{
AssetRepository calAss = CalamityMod.Instance.Assets;
@@ -417,6 +425,11 @@ namespace CalamityMod.Effects
FlipScreenShader = LoadShader("ScreenShaders/FlipScreen");
RegisterScreenShader(FlipScreenShader, "FlipTheScreen", "FlipScreen",EffectPriority.VeryHigh);
#endregion
#region Loading fryzahh's Shaders
BasicTextureDistortionShader = LoadShader("BasicTextureDistortionShader");
RegisterMiscShader(BasicTextureDistortionShader, "DistortionPass", "BasicTextureDistortion");
#endregion
}
// Shorthand to register a loaded shader in Terraria's graphics engine
+13
View File
@@ -0,0 +1,13 @@
namespace CalamityMod
{
public enum HerbType
{
Daybloom,
Moonglow,
Blinkroot,
Deathweed,
Waterleaf,
Fireblossom,
Shiverthorn
}
}
+14
View File
@@ -0,0 +1,14 @@
namespace CalamityMod
{
public enum PlanterBoxType
{
Daybloom,
Moonglow,
Deathweed,
DeathweedCrimson,
Blinkroot,
Waterleaf,
Shiverthorn,
Fireblossom
}
}
+1 -1
View File
@@ -12,7 +12,7 @@
BoneWings = 8,
FlameWings = 9,
FrozenWings = 10,
SpectreWings = 11,
GhostWings = 11, // Spectre Wings
SteampunkWings = 12,
LeafWings = 13,
BatWings = 14,
+1 -1
View File
@@ -181,7 +181,7 @@ namespace CalamityMod.Events
/// </summary>
public static void TryStartEvent(bool forceRain = false)
{
if (AcidRainEventIsOngoing || (!NPC.downedBoss1 && !Main.hardMode && !DownedBossSystem.downedAquaticScourge) || BossRushEvent.BossRushActive)
if (AcidRainEventIsOngoing || (!NPC.downedBoss1 && !Main.hardMode && !DownedBossSystem.downedAquaticScourge && !DownedBossSystem.downedPolterghast) || BossRushEvent.BossRushActive || Terraria.GameContent.Creative.CreativePowerManager.Instance.GetPower<Terraria.GameContent.Creative.CreativePowers.FreezeRainPower>().Enabled)
return;
int playerCount = Main.CurrentFrameFlags.ActivePlayersCount;
+1 -1
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.ExtraJumps
{
public class StatigelJump : ExtraJump
{
public override Position GetDefaultPosition() => BeforeBottleJumps;
public override Position GetDefaultPosition() => new Before(BlizzardInABottle);
public override float GetDurationMultiplier(Player player) => 1.25f;
// Values equivalent to the Fart in a Jar
Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

@@ -0,0 +1,123 @@
using CalamityMod.NPCs.OldDuke;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.ForegroundDrawing.LoopingTextures
{
public abstract class LoopingTextureForeground : ModSystem
{
public virtual string Texture => "CalamityMod/ExtraTextures/Miscellaneous/NuclearTorrent";
/// <summary>
/// How much the effect has moved. Increments by Speed.
/// </summary>
float Progress = 0f;
/// <summary>
/// The speed at which Progress is incremented every frame.
/// </summary>
public virtual float Speed => 60f;
/// <summary>
/// How opaque the visual is. Caps out at IntensityMaximum.
/// </summary>
public float Intensity = 0f;
/// <summary>
/// How opaque the visual can become before capping out.
/// </summary>
public virtual float IntensityMaximum => 0.15f;
/// <summary>
/// Current parallax.
/// </summary>
Vector2 Parallax = Vector2.Zero;
/// <summary>
/// Current parallax depth.
/// </summary>
public virtual Vector2 ParallaxDepth => Vector2.Zero;
/// <summary>
/// When true, the Intensity will increase until it caps out. If false it will decrease until it hits 0.
/// </summary>
/// <returns>Whether or not the visual is active.</returns>
public virtual bool DoesThisShow()
{
return false;
}
public override void PostDrawTiles()
{
if (DoesThisShow())
{
Intensity = MathHelper.Lerp(Intensity, IntensityMaximum, 0.1f);
}
else
{
Intensity = MathHelper.Lerp(Intensity, 0, 0.1f);
}
Intensity = MathHelper.Clamp(Intensity, 0f, 1f);
Parallax += Main.LocalPlayer.velocity * ParallaxDepth;
Progress += Speed;
Main.spriteBatch.Begin();
Draw();
PostDraw();
Main.spriteBatch.End();
Update();
}
public override void PostUpdateEverything()
{
Update();
}
/// <summary>
/// Extra drawing logic can be placed here.
/// </summary>
public virtual void PostDraw()
{
}
/// <summary>
/// Called every frame. Run behavior such as particle effects here.
/// </summary>
public virtual void Update()
{
}
/// <summary>
/// Override this to replace existing drawing logic. Only recommended if you know what you're doing.
/// </summary>
public virtual void Draw()
{
var tex = ModContent.Request<Texture2D>(Texture);
for (var i = -4; i < 14; i++)
{
float wid = tex.Width();
float hei = tex.Height();
var rect = new Rectangle(0, 0, (int)wid, (int)hei);
var rot = -Main.WindForVisuals;
var col = new Color(Intensity, Intensity, Intensity, 0f);
Main.EntitySpriteDraw(tex.Value, new Vector2(Parallax.X % wid, 0).RotatedBy(rot) + new Vector2(tex.Width() * i, 0).RotatedBy(rot), rect, col, rot, new Vector2(0, (hei - Progress) % hei), 1, SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, new Vector2(Parallax.X % wid, 0).RotatedBy(rot) + new Vector2(tex.Width() * i, -hei).RotatedBy(rot), rect, col, rot, new Vector2(0, (hei - Progress) % hei), 1, SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, new Vector2(Parallax.X % wid, 0).RotatedBy(rot) + new Vector2(tex.Width() * i, -hei * 2).RotatedBy(rot), rect, col, rot, new Vector2(0, (hei - Progress) % hei), 1, SpriteEffects.None);
}
}
}
}
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.NPCs.OldDuke;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.ForegroundDrawing.LoopingTextures
{
public class NuclearTorrentForeground : LoopingTextureForeground
{
public override Vector2 ParallaxDepth => new Vector2(1f, 1f);
public override float IntensityMaximum => 0.045f;
public static List<NuclearRaindrop> Raindrops = new List<NuclearRaindrop>();
public class NuclearRaindrop
{
public Vector2 Position;
public Vector2 Velocity;
public NuclearRaindrop(Vector2 pos, Vector2 vel)
{
Position = pos;
Velocity = vel;
}
public void Update(NuclearRaindrop drop, NuclearTorrentForeground foreground)
{
drop.Position += drop.Velocity;
drop.Position -= Main.LocalPlayer.velocity;
drop.Velocity = new Vector2(0, 20).RotatedBy(-Main.windSpeedCurrent);
if (drop.Position.Y > Main.screenHeight + 200)
{
RemoveDrop(drop);
}
}
public void Draw(NuclearRaindrop drop, NuclearTorrentForeground foreground)
{
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/ForegroundDrawing/LoopingTextures/NuclearTorrentRaindrop");
float intensity = foreground.Intensity / foreground.IntensityMaximum / 4f;
Main.EntitySpriteDraw(tex.Value, drop.Position, tex.Frame(), Color.White.MultiplyRGBA(new Color(intensity, intensity, intensity, intensity)), Vector2.Zero.AngleTo(drop.Velocity) - MathHelper.ToRadians(90f), tex.Size() / 2, new Vector2(1f, 4f), SpriteEffects.None);
}
}
public static void RemoveDrop(NuclearRaindrop drop)
{
Raindrops.Remove(drop);
}
public override bool DoesThisShow() => NPC.CountNPCS(ModContent.NPCType<OldDuke>()) > 0 && Main.LocalPlayer.Calamity().ZoneSulphur && !CalamityServerConfig.Instance.BossesStopWeather;
public override void Update()
{
if (NPC.CountNPCS(ModContent.NPCType<OldDuke>()) > 0)
{
int duke = NPC.FindFirstNPC(ModContent.NPCType<OldDuke>());
Main.windSpeedCurrent = MathHelper.Lerp(Main.windSpeedCurrent, MathHelper.ToRadians(50f), 0.005f);
foreach (Rain rain in Main.rain)
{
rain.velocity = new Vector2(0, 15).RotatedBy(-Main.windSpeedCurrent);
rain.rotation = Vector2.Zero.AngleTo(rain.velocity) + MathHelper.PiOver2;
}
}
NuclearRaindrop dr = new NuclearRaindrop(new Vector2(Main.screenWidth / 2f, -100) + new Vector2(Main.rand.NextFloat(-Main.screenWidth, Main.screenWidth), -Main.screenWidth * 0.65f).RotatedBy(-Main.windSpeedCurrent),
new Vector2(0, 20).RotatedBy(-Main.windSpeedCurrent));
Raindrops.Add(dr);
for (int i = 0; i < Raindrops.Count; i++)
{
NuclearRaindrop drop = Raindrops[i];
drop.Update(drop, this);
}
}
public override void PostDraw()
{
for (int i = 0; i < Raindrops.Count; i++)
{
NuclearRaindrop drop = Raindrops[i];
drop.Draw(drop, this);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

+2 -1
View File
@@ -652,7 +652,8 @@ namespace CalamityMod.ILEditing
if (modPlayer is null)
return;
if (modPlayer.chaliceOfTheBloodGod && modPlayer.chaliceBleedoutBuffer > 0D)
// CIT 17MAY2025: Bleedout clear has a special interaction with Bloom Stone handled elsewhere; do not run this if wearing Bloom Stone
if (modPlayer.chaliceOfTheBloodGod && modPlayer.chaliceBleedoutBuffer > 0D && !modPlayer.bloomStone)
{
// 20FEB2024: Ozzatron: to prevent abuse, buffer clearing is now 50% of the potion instead of 50% of your buffer
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * player.GetHealLife(potion, true);
+1 -1
View File
@@ -67,7 +67,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<AnechoicPlating>().
AddIngredient(ItemID.LunarBar, 5).
AddIngredient<MolluskHusk>(15).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<EffulgentFeather>(5).
AddIngredient<DivineGeode>(5).
AddIngredient(ItemID.SoulofFlight, 10).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

+2 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<YharonSoulFragment>(5).
AddIngredient<Plagueplate>(25).
AddIngredient<ExodiumCluster>(25).
AddTile(TileID.DemonAltar).
AddTile<CosmicAnvil>().
Register();
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient(ItemID.WarriorEmblem).
AddIngredient<UelibloomBar>(2).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+39
View File
@@ -0,0 +1,39 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class BatholithBangle : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 600;
public static int damage = 225;
public override void SetDefaults()
{
Item.width = 36;
Item.height = 28;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.batholithBangle = true;
modPlayer.batholithBangleVisual = !hideVisual;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<BlackGlassBand>().
AddRecipeGroup("Boss2Material", 15).
AddIngredient(ItemID.Granite, 45).
AddIngredient(ItemID.Amber, 3).
AddIngredient(ItemID.FallenStar, 5).
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

+5 -5
View File
@@ -8,8 +8,8 @@ namespace CalamityMod.Items.Accessories
public class BlackGlassBand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 420;
public static int damage = 40;
public static int cooldown = 300;
public static int damage = 32;
public override void SetDefaults()
{
Item.width = 30;
@@ -27,9 +27,9 @@ namespace CalamityMod.Items.Accessories
public override void AddRecipes()
{
CreateRecipe().
AddRecipeGroup("AnyGoldBar", 5).
AddIngredient(ItemID.Diamond, 2).
AddIngredient(ItemID.Obsidian, 25).
AddRecipeGroup("AnyGoldBar", 8).
AddIngredient(ItemID.Diamond, 3).
AddIngredient(ItemID.Obsidian, 35).
AddTile(TileID.Anvils).
Register();
}
+1
View File
@@ -40,6 +40,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().blazingCore = true;
player.noKnockback = true;
}
public static void HandleStars(Player player)
+1
View File
@@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.bloodflareCore = true;
player.noKnockback = true;
}
}
}
+4 -95
View File
@@ -22,101 +22,10 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.25f, 0.4f, 0.2f);
// Provide life benefits if the player is standing on ground and has typical gravity.
int x = (int)player.Center.X / 16;
int y = (int)(player.Bottom.Y - 1f) / 16;
Tile groundTile = CalamityUtils.ParanoidTileRetrieval(x, y + 1);
bool groundTileIsSolid = groundTile.HasUnactuatedTile && (Main.tileSolid[groundTile.TileType] || Main.tileSolidTop[groundTile.TileType]);
if (groundTileIsSolid && player.gravDir == 1f)
modPlayer.BloomStoneRegen = true;
// Flower boots effects.
if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1)
{
Tile walkTile = CalamityUtils.ParanoidTileRetrieval(x, y);
if (!walkTile.HasTile && walkTile.LiquidAmount == 0 && groundTile != null && WorldGen.SolidTile(groundTile))
{
walkTile.TileFrameY = 0;
walkTile.Get<TileWallWireStateData>().Slope = SlopeType.Solid;
walkTile.Get<TileWallWireStateData>().IsHalfBlock = false;
// On dirt blocks, there's a small chance to grow a dye plant.
if (groundTile.TileType == TileID.Dirt)
{
if (Main.rand.NextBool(1000))
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.DyePlants;
walkTile.TileFrameX = (short)(34 * Main.rand.Next(0, 13));
while (walkTile.TileFrameX == 144)
walkTile.TileFrameX = (short)(34 * Main.rand.Next(0, 13));
}
if (Main.netMode == NetmodeID.MultiplayerClient)
NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None);
}
// On grass, grow flowers.
if (groundTile.TileType == TileID.Grass)
{
if (Main.rand.NextBool())
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.Plants;
walkTile.TileFrameX = (short)(18 * Main.rand.Next(6, 11));
while (walkTile.TileFrameX == 144)
walkTile.TileFrameX = (short)(18 * Main.rand.Next(6, 11));
}
else
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.Plants2;
walkTile.TileFrameX = (short)(18 * Main.rand.Next(6, 21));
while (walkTile.TileFrameX == 144)
walkTile.TileFrameX = (short)(18 * Main.rand.Next(6, 21));
}
if (Main.netMode == NetmodeID.MultiplayerClient)
NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None);
}
// On hallowed grass, grow hallowed flowers.
else if (groundTile.TileType == TileID.HallowedGrass)
{
if (Main.rand.NextBool())
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.HallowedPlants;
walkTile.TileFrameX = (short)(18 * Main.rand.Next(4, 7));
while (walkTile.TileFrameX == 90)
walkTile.TileFrameX = (short)(18 * Main.rand.Next(4, 7));
}
else
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.HallowedPlants2;
walkTile.TileFrameX = (short)(18 * Main.rand.Next(2, 8));
while (walkTile.TileFrameX == 90)
walkTile.TileFrameX = (short)(18 * Main.rand.Next(2, 8));
}
if (Main.netMode == NetmodeID.MultiplayerClient)
NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None);
}
// On jungle grass, grow jungle flowers.
else if (groundTile.TileType == TileID.JungleGrass)
{
walkTile.Get<TileWallWireStateData>().HasTile = true;
walkTile.TileType = TileID.JunglePlants2;
walkTile.TileFrameX = (short)(18 * Main.rand.Next(9, 17));
if (Main.netMode == NetmodeID.MultiplayerClient)
NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None);
}
}
}
modPlayer.healingPotionMultiplier += 0.5f;
modPlayer.bloomStone = true;
modPlayer.bloomStoneHookVisuals = true;
}
public override void UpdateVanity(Player player) => player.Calamity().bloomStoneHookVisuals = true;
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<PlaguedFuelPack>().
AddIngredient<EffulgentFeather>(8).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+1 -1
View File
@@ -152,7 +152,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<DubiousPlating>(15).
AddIngredient(ItemID.LunarBar, 10).
AddIngredient<GalacticaSingularity>(4).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+1
View File
@@ -39,6 +39,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.darkSunRing = true;
player.noKnockback = true;
}
public override void AddRecipes()
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().deadshotBrooch = true;
player.Calamity().rangedAmmoCost *= 0.8f;
player.Calamity().ammoCost *= 0.8f;
player.GetDamage<RangedDamageClass>() += 0.12f;
player.GetCritChance<RangedDamageClass>() += 7;
}
+2 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<CosmiliteBar>(5).
AddIngredient<Elumplate>(25).
AddIngredient<ExodiumCluster>(25).
AddTile(TileID.DemonAltar).
AddTile<CosmicAnvil>().
Register();
}
}
+1
View File
@@ -57,6 +57,7 @@ namespace CalamityMod.Items.Accessories
modPlayer.adrenaline = 0f;
modPlayer.draedonsHeart = true;
player.noKnockback = true;
modPlayer.hadNanomachinesLastFrame = true;
modPlayer.AdrenalineDuration = NanomachinesDuration;
modPlayer.contactDamageReduction += ContactDamageReduction;
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<Necroplasm>(5).
AddIngredient<Navyplate>(25).
AddIngredient<ExodiumCluster>(25).
AddTile(TileID.DemonAltar).
AddTile(TileID.MythrilAnvil).
Register();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 724 B

+1
View File
@@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.flameLickedShell = true;
player.noKnockback = true;
}
public static void handleParry(Player player)
+2 -6
View File
@@ -1,8 +1,4 @@
using System;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,8 +10,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 42;
Item.height = 36;
Item.width = 48;
Item.height = 54;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 1.4 KiB

+1
View File
@@ -183,6 +183,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<PearlofEnthrallment>().
AddIngredient<EyeoftheStorm>().
AddIngredient<RoseStone>().
AddIngredient(ItemID.FragmentStardust, 6).
AddTile(TileID.LunarCraftingStation).
Register();
}
+1 -1
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<Laudanum>().
AddIngredient<StressPills>().
AddIngredient<TwistingNether>(3).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+1
View File
@@ -29,6 +29,7 @@ namespace CalamityMod.Items.Accessories
{
OldDukeScalesPlayer modPlayer = player.GetModPlayer<OldDukeScalesPlayer>();
modPlayer.OldDukeScalesOn = true;
player.noKnockback = true;
}
}
+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<RuinousSoul>(5).
AddIngredient<Onyxplate>(25).
AddIngredient<ExodiumCluster>(20).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories
player.magicQuiver = true;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.deadshotBrooch = true;
modPlayer.rangedAmmoCost *= 0.8f;
modPlayer.ammoCost *= 0.8f;
}
public override void ModifyTooltips(List<TooltipLine> tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey);
+1 -1
View File
@@ -106,7 +106,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<DivineGeode>(5).
AddIngredient<Havocplate>(25).
AddIngredient<ExodiumCluster>(25).
AddTile(TileID.DemonAltar).
AddTile(TileID.MythrilAnvil).
Register();
}
+40
View File
@@ -0,0 +1,40 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Weapons.Ranged;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class ProtolithBangle : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 420;
public static int damage = 68;
public override void SetDefaults()
{
Item.width = 34;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.protolithBangle = true;
modPlayer.protolithBangleVisual = !hideVisual;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<BlackGlassBand>().
AddRecipeGroup("Boss2Material", 15).
AddIngredient(ItemID.Marble, 45).
AddIngredient(ItemID.Ruby, 3).
AddIngredient(ItemID.Lens, 5).
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+1 -1
View File
@@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories
AddRecipeGroup("AnyQuiver").
AddIngredient<GalacticaSingularity>(5).
AddIngredient<DarkPlasma>(3).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
+12
View File
@@ -30,6 +30,18 @@ namespace CalamityMod.Items.Accessories
r.AddIngredient(ItemID.SoulofFright, 5);
r.AddTile(TileID.TinkerersWorkbench);
r.Register();
// Sort after recipe with Summoner Emblem as ingredient
// There is no sort after last of X so this process needs to be manual
for (int i = 0; i < Recipe.maxRecipes; i++)
{
Recipe s = Main.recipe[i];
if (s.createItem.type == ItemID.AvengerEmblem && s.HasIngredient(ItemID.SummonerEmblem))
{
r.SortAfter(s);
break;
}
}
}
}
}
+9 -9
View File
@@ -153,13 +153,13 @@ namespace CalamityMod.Items.Accessories
}
}
// If ranged, or any direct subclass thereof, display ranged ammo consumption
if (dc == DamageClass.Ranged || dc.GetModifierInheritance(DamageClass.Ranged).Equals(StatInheritanceData.Full))
stats2 += "\n" + this.GetLocalization("RangedStats").Format(TwoPlaces(100f * player.GetRangedAmmoCostReduction()));
// If held item uses ammo, display ammo consumption
if (heldItem.useAmmo > 0)
stats2 += "\n" + this.GetLocalization("AmmoStats").Format(OnePlace(100f * player.GetAmmoCostReduction()));
// If magic, or any direct subclass thereof, display mana stats
if (dc == DamageClass.Magic || dc == DamageClass.MagicSummonHybrid || dc.GetModifierInheritance(DamageClass.Magic).Equals(StatInheritanceData.Full))
stats2 += "\n" + this.GetLocalization("MagicStats").Format(TwoPlaces(100f * player.manaCost), player.manaRegen);
// If held item uses mana, display mana stats
if (heldItem.mana > 0)
stats2 += "\n" + this.GetLocalization("ManaStats").Format(OnePlace(100f * player.manaCost), player.manaRegen);
// If summon, or any direct subclass thereof, AND NOT A WHIP, display minion/sentry slots
if (dc != DamageClass.SummonMeleeSpeed && (dc == DamageClass.Summon || dc.GetModifierInheritance(DamageClass.Summon).Equals(StatInheritanceData.Full)))
@@ -168,7 +168,7 @@ namespace CalamityMod.Items.Accessories
// If whip, show whip range
float whipRange = player.whipRangeMultiplier - 1f;
if (dc == DamageClass.SummonMeleeSpeed || dc.GetModifierInheritance(DamageClass.SummonMeleeSpeed).Equals(StatInheritanceData.Full))
stats2 += "\n" + this.GetLocalization("WhipStats").Format(Sign(whipRange) + TwoPlaces(100f * whipRange));
stats2 += "\n" + this.GetLocalization("WhipStats").Format(Sign(whipRange) + OnePlace(100f * whipRange));
// If throwing or rogue, display rogue stats.
float rogueVelocity = modPlayer.rogueVelocity - 1f;
@@ -178,7 +178,7 @@ namespace CalamityMod.Items.Accessories
(int)(100f * modPlayer.rogueStealthMax),
TwoPlaces(60f * player.GetStandingStealthRegen()),
TwoPlaces(60f * player.GetMovingStealthRegen()),
Sign(rogueVelocity) + TwoPlaces(100f * rogueVelocity));
Sign(rogueVelocity) + OnePlace(100f * rogueVelocity));
}
// If tool, add tool range
@@ -199,7 +199,7 @@ namespace CalamityMod.Items.Accessories
}
list.FindAndReplace("[ITEMS]", stats2);
float moveSpeedBoost = player.moveSpeed - 1f;
float moveSpeedBoost = CalamityServerConfig.Instance.FasterBaseSpeed ? (player.moveSpeed / BalancingConstants.DefaultMoveSpeedBoost) - 1f : player.moveSpeed - 1f;
float wingFlightTime = player.wingTimeMax;
// Does not use NormalizedLuck. Presents the player's luck exactly as it is used by the game engine.
// NormalizedLuck is only used in one place: the Wizard's luck report. Which is entirely obsoleted by this Meter.
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<StatisBlessing>().
AddIngredient<TheFirstShadowflame>().
AddIngredient(ItemID.FragmentStardust, 10).
AddIngredient(ItemID.FragmentStardust, 6).
AddTile(TileID.LunarCraftingStation).
Register();
}
+2 -2
View File
@@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient(ItemID.FrogFlipper).
AddIngredient<PurifiedGel>(25).
AddIngredient<Necroplasm>(5).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
CreateRecipe().
@@ -60,7 +60,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient(ItemID.FrogGear).
AddIngredient<PurifiedGel>(25).
AddIngredient<Necroplasm>(5).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
+4
View File
@@ -6,6 +6,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
@@ -17,6 +18,9 @@ namespace CalamityMod.Items.Accessories
public class StatisVoidSash : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
public new string LocalizationCategory => "Items.Accessories";
public static SoundStyle VoidDash = new ("CalamityMod/Sounds/Item/VoidDash");
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 3));
+1 -1
View File
@@ -62,7 +62,7 @@ namespace CalamityMod.Items.Accessories
{
if (npc.IsAnEnemy() && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= range)
{
int campingFireDamage = (int)player.GetBestClassDamage().ApplyTo(Main.rand.Next(20, 41));
int campingFireDamage = (int)player.GetBestClassDamage().ApplyTo(Main.rand.Next(100, 121));
Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), campingFireDamage, 0f, player.whoAmI, npc.whoAmI);
}
}
+1
View File
@@ -87,6 +87,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.sponge = true;
player.noKnockback = true;
modPlayer.spongeShieldVisible = !hideVisual;
if (modPlayer.SpongeShieldDurability > 0)
+1 -1
View File
@@ -20,8 +20,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> list)
{
list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey);
list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")));
list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey);
}
public override void SetStaticDefaults()
{
+2 -2
View File
@@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories
public override void SetDefaults()
{
Item.width = 40;
Item.height = 44;
Item.width = 46;
Item.height = 48;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories.Vanity
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Head", EquipType.Head, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Body", EquipType.Body, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Legs", EquipType.Legs, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this);
}
}
@@ -89,6 +90,7 @@ namespace CalamityMod.Items.Accessories.Vanity
Player.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Head);
Player.wings = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Wings);
}
}
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories.Vanity
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Head2", EquipType.Head, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Body2", EquipType.Body, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Legs2", EquipType.Legs, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this);
}
}
@@ -89,6 +90,7 @@ namespace CalamityMod.Items.Accessories.Vanity
Player.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Head);
Player.wings = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Wings);
}
}
+7 -11
View File
@@ -26,8 +26,8 @@ namespace CalamityMod.Items.Accessories
public class WarbanneroftheRighteous : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
internal const float MaxBonus = 0.6f;
internal const float MaxDistance = 350f;
internal const float MaxBonus = 0.5f;
internal const float MaxDistance = 700f;
public override void SetStaticDefaults()
{
@@ -57,17 +57,13 @@ namespace CalamityMod.Items.Accessories
}
int maxValue = (int)(MaxBonus * 100);
float bonus = CalculateBonus(player) - 0.4f;
float displayBonus = (int)((bonus + 0.4f) * 100); // Should range from 0 to the maxValue
float bonus = CalculateBonus(player) - 0.3f;
float displayBonus = (int)((bonus + 0.3f) * 100); // Should range from 0 to the maxValue
if (player.Calamity().cooldowns.TryGetValue(WarbanneroftheRighteousBuff.ID, out var cooldown))
{
cooldown.timeLeft = maxValue - (int)displayBonus;
}
else
{
player.AddCooldown(WarbanneroftheRighteousBuff.ID, maxValue);
}
if (bonus > 0)
player.GetDamage<GenericDamageClass>() += bonus;
@@ -83,7 +79,7 @@ namespace CalamityMod.Items.Accessories
for (int index = 0; index < Main.npc.Length; index++)
{
NPC nPC = Main.npc[index];
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + (100 + 80 * Utils.GetLerpValue(0, 200, Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f))); // Adds some room so max bonus isnt when you're ON the hitbox
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox
float intensity = Utils.Remap(Utils.Distance(player.Center, nPC.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 1, 3, true); // We have to have this seperate from bonus, otherwise all effected enemies take damage based on the closest enemy
if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType<SuperDummyNPC>()) && nPC.CanBeChasedBy())
@@ -104,7 +100,7 @@ namespace CalamityMod.Items.Accessories
{
modNPC.warbannerBurnIntensity = intensity;
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(47 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(45 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
modNPC.warbannerBurnDamage = burnDamage;
modNPC.warbannerBurnStacks++;
modNPC.warbannerBurnTimer = 180;
@@ -121,7 +117,7 @@ namespace CalamityMod.Items.Accessories
NPC closestTarget = player.Center.ClosestNPCAt(MaxDistance * 7); // extra range is to account for bonus range from massive targets
if (closestTarget != null)
{
float generousHitboxWidth = Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f) + (100 + 80 * Utils.GetLerpValue(0, 200, Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f))); // Adds some room so max bonus isnt when you're ON the hitbox
float generousHitboxWidth = Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox
bonus = Utils.Remap(Utils.Distance(player.Center, closestTarget.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 0, MaxBonus, true);
}
else
+17 -1
View File
@@ -19,6 +19,10 @@ namespace CalamityMod.Items.Accessories.Wings
public override float MaxAscentSpeed => 2.5f;
public override float BaseAscent => 0.125f;
// How powerful the acceleration increase is while pressing UP
// This also affects the flight time tick rate
public static float BoostPower = 1.5f;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 8f, 1.5f);
public override void SetDefaults()
@@ -81,7 +85,19 @@ namespace CalamityMod.Items.Accessories.Wings
}
}
}
player.noFallDmg = true;
}
public override void AdditionalFlightMovement(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
if (player.TryingToHoverUp)
{
ascentWhenFalling *= BoostPower;
ascentWhenRising *= BoostPower;
maxCanAscendMultiplier *= BoostPower;
maxAscentMultiplier *= BoostPower;
constantAscend *= BoostPower;
player.wingTime -= BoostPower - 1f;
}
}
public override void AddRecipes()
+9 -1
View File
@@ -56,8 +56,16 @@ namespace CalamityMod.Items.Accessories.Wings
maxCanAscendMultiplier = RisingSpeedThreshold;
maxAscentMultiplier = MaxAscentSpeed;
constantAscend = BaseAscent;
AdditionalFlightMovement(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
}
/// <summary>
/// Addition for any deviations in regular wing movement.<br/>
/// This is typically for UP boost or hovers.
/// </summary>
public virtual void AdditionalFlightMovement(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { }
public override void ModifyTooltips(List<TooltipLine> list)
{
WingStats stats = ArmorIDs.Wing.Sets.Stats[Item.wingSlot];
@@ -76,7 +84,7 @@ namespace CalamityMod.Items.Accessories.Wings
{
sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), BaseAscent.ToMphps(),
(BaseAscent + BonusAscentWhileRising).ToMphps(), (RisingSpeedThreshold * baseJumpSpeed).ToMph(),
(BaseAscent + BonusAscentWhileRising + BonusAscentWhileFalling).ToMphps()));
(BaseAscent + BonusAscentWhileFalling).ToMphps()));
if (hover)
{
sb.Append('\n');
-1
View File
@@ -46,7 +46,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
}
}
+5 -11
View File
@@ -14,13 +14,13 @@ namespace CalamityMod.Items.Accessories.Wings
[AutoloadEquip(EquipType.Wings)]
public class ElysianWings : BaseWings
{
public override float BonusAscentWhileFalling => 0.85f;
public override float BonusAscentWhileRising => 0.15f;
public override float RisingSpeedThreshold => 1f;
public override float BonusAscentWhileFalling => 1f;
public override float BonusAscentWhileRising => 0.17f;
public override float RisingSpeedThreshold => 1.2f;
public override float MaxAscentSpeed => 3f;
public override float BaseAscent => 0.135f;
public override float BaseAscent => 0.15f;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(240, 9.5f, 2.7f);
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(240, 10f, 3f);
public override void SetDefaults()
{
@@ -35,12 +35,6 @@ namespace CalamityMod.Items.Accessories.Wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
player.moveSpeed += 0.1f;
player.lavaImmune = true;
player.noFallDmg = true;
modPlayer.elysianWingsDust = false;
if (!hideVisual)
DrawWingEffects(player);
}
-1
View File
@@ -72,7 +72,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
player.wingTimeMax = 180;
player.noFallDmg = true;
}
public override void AddRecipes()
+6 -7
View File
@@ -13,13 +13,13 @@ namespace CalamityMod.Items.Accessories.Wings
[LegacyName("DiscordianWings")]
public class HadalMantle : BaseWings
{
public override float BonusAscentWhileFalling => 0.6f;
public override float BonusAscentWhileRising => 0.12f;
public override float RisingSpeedThreshold => 0.7f;
public override float MaxAscentSpeed => 1.75f;
public override float BaseAscent => 0.11f;
public override float BonusAscentWhileFalling => 0.75f;
public override float BonusAscentWhileRising => 0.15f;
public override float RisingSpeedThreshold => 1f;
public override float MaxAscentSpeed => 1.805f;
public override float BaseAscent => 0.125f;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 7.75f, 1.5f);
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(150, 8f, 2f);
public override void SetDefaults()
{
@@ -48,7 +48,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
public override void AddRecipes()
+21 -19
View File
@@ -14,12 +14,12 @@ namespace CalamityMod.Items.Accessories.Wings
public class HadarianWings : BaseWings
{
public override float BonusAscentWhileFalling => 0.8f;
public override float BonusAscentWhileRising => 0.155f;
public override float RisingSpeedThreshold => 1.05f;
public override float MaxAscentSpeed => 2.55f;
public override float BaseAscent => 0.13f;
public override float BonusAscentWhileRising => 0.15f;
public override float RisingSpeedThreshold => 1f;
public override float MaxAscentSpeed => 2f;
public override float BaseAscent => 0.135f;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(90, 9f, 1.75f, true, 11.6f, 11.6f);
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(108, 9f, 2f, true, 11.6f, 11.6f);
public override void SetDefaults()
{
@@ -34,18 +34,6 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (player.controlJump && player.wingTime > 0f && player.jump == 0)
{
bool hovering = player.TryingToHoverDown && !player.merman;
if (hovering)
{
player.velocity.Y *= 0.2f;
if (player.velocity.Y > -2f && player.velocity.Y < 2f)
{
// I can't get the player to have zero y velocity (setting it to 0 doesn't work and I tried a lot of numbers)
player.velocity.Y = 0.105f;
}
player.wingTime += 0.75f;
}
if (player.velocity.Y != 0f && !hideVisual)
{
float xOffset = 4f;
@@ -53,7 +41,7 @@ namespace CalamityMod.Items.Accessories.Wings
{
xOffset = -40f;
}
if (!hovering || Main.rand.NextBool(3))
if (!player.TryingToHoverDown || Main.rand.NextBool(3))
{
int idx = Dust.NewDust(new Vector2(player.Center.X + xOffset, player.Center.Y - 15f), 30, 30, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 1.75f);
Main.dust[idx].noGravity = true;
@@ -66,7 +54,21 @@ namespace CalamityMod.Items.Accessories.Wings
}
}
}
player.noFallDmg = 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;
}
}
}
}
-1
View File
@@ -90,7 +90,6 @@ namespace CalamityMod.Items.Accessories.Wings
player.GetJumpState(ExtraJump.BlizzardInABottle).Enable();
player.jumpBoost = true;
player.autoJump = true;
player.noFallDmg = true;
player.jumpSpeedBoost += 1.6f;
// Mirrors the +5% luck from Lucky Horseshoe (vanilla behavior).
-5
View File
@@ -21,8 +21,6 @@ namespace CalamityMod.Items.Accessories.Wings
public override float MaxAscentSpeed => 3.2f;
public override float BaseAscent => 0.145f;
public const int LifeRegenTimerMax = 900;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(270, 10.5f, 2.8f);
public override void SetDefaults()
@@ -36,8 +34,6 @@ namespace CalamityMod.Items.Accessories.Wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().silvaWings = true;
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int dustXOffset = 4;
@@ -54,7 +50,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
public override void AddRecipes()
-5
View File
@@ -20,11 +20,6 @@ namespace CalamityMod.Items.Accessories.Wings
Item.rare = ItemRarityID.Orange;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.noFallDmg = true;
}
public override void AddRecipes()
{
CreateRecipe().
-1
View File
@@ -42,7 +42,6 @@ namespace CalamityMod.Items.Accessories.Wings
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.cryogenSoul = true;
player.noFallDmg = true;
if (modPlayer.wingProjectileCooldown <= 0)
{
if (player.controlJump && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart)
@@ -41,7 +41,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
public override void AddRecipes()
+2 -6
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories.Wings
public override float MaxAscentSpeed => 3f;
public override float BaseAscent => 0.135f;
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(250, 9.5f, 2.5f);
public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(270, 9.5f, 2.5f);
public override void SetDefaults()
{
@@ -33,9 +33,6 @@ namespace CalamityMod.Items.Accessories.Wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statDefense += 15;
player.lifeRegen += 2;
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
int dustXOffset = 4;
@@ -52,7 +49,6 @@ namespace CalamityMod.Items.Accessories.Wings
}
Main.dust[flightDust].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player);
}
player.noFallDmg = true;
}
public override void AddRecipes()
@@ -60,7 +56,7 @@ namespace CalamityMod.Items.Accessories.Wings
CreateRecipe().
AddIngredient(ItemID.SoulofFlight, 20).
AddIngredient<UelibloomBar>(5).
AddTile(TileID.LunarCraftingStation).
AddTile(TileID.MythrilAnvil).
Register();
}
}
@@ -57,7 +57,6 @@ namespace CalamityMod.Items.Accessories.Wings
player.fireWalk = true;
player.lavaImmune = true;
player.buffImmune[BuffID.OnFire] = true;
player.noFallDmg = true;
modPlayer.tracersDust = !hideVisual;
modPlayer.tracersCelestial = true;
}
Loaded 100 of 689 files, more files were not shown because too many files have changed in this diff. Show more