+ Merge 1.4.4 for real

This commit is contained in:
Big E committed 2026-01-20 18:01:30 -05:00
commit 45cd57066f
312 files changed
+2982 -1915

No files matched your search

+1
View File
@@ -305,3 +305,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
*.slnx
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().cinnamonRoll = true;
player.Calamity().HeatDebuffMultiplier += 0.5f;
}
}
}
+3 -1
View File
@@ -29,6 +29,8 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -76,7 +78,7 @@ namespace CalamityMod.Buffs.DamageOverTime
for (int i = 0; i < 2; i++)
{
Vector2 sparkVel = new Vector2(Main.rand.NextFloat(-npc.width / 6, npc.width / 6), Main.rand.NextFloat(-npc.height / 20, -npc.height / 17));
Particle sparks = new VelChangingSpark(npc.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2) + sparkVel * 0.5f, sparkVel + npc.velocity, new Vector2(-sparkVel.X * 0.5f, sparkVel.Y * 2) * 3.5f, "CalamityMod/Particles/SmallBloom", Main.rand.Next(13, 20 + 1), Main.rand.NextFloat(0.1f, 0.25f) * MathHelper.Lerp(Math.Max(npc.height, npc.width) / 120, 0.5f, 0.7f), (Main.rand.NextBool() ? Color.MediumOrchid : Color.BlueViolet) * 0.75f, new Vector2(0.7f, 1), true, false, 0, false, 0.3f, 0.055f);
Particle sparks = new VelChangingSpark(npc.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2) + sparkVel * 0.5f, sparkVel + npc.velocity, new Vector2(-sparkVel.X * 0.5f, sparkVel.Y * 2) * 3.5f, "CalamityMod/Particles/SmallBloom", Main.rand.Next(13, 20 + 1), Main.rand.NextFloat(0.1f, 0.25f) * MathHelper.Lerp(Math.Max(npc.height, npc.width) / 120, 0.5f, 0.7f), (Main.rand.NextBool() ? Color.MediumOrchid : Color.BlueViolet) * 0.75f, new Vector2(0.7f, 1), true, false, 0, false, 0.3f, 0.055f);
GeneralParticleHandler.SpawnParticle(sparks);
}
}
+1 -2
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class HallowedRuneDefense : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(HallowedRune.DefenseBoost, HallowedRune.DamageReductionBoost.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(HallowedRune.DefenseBoost);
public override void SetStaticDefaults()
{
@@ -20,7 +20,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.statDefense += HallowedRune.DefenseBoost;
player.endurance += HallowedRune.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap?
}
}
}
+1 -2
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class PhantomicShield : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(PhantomicArtifact.DefenseBoost, PhantomicArtifact.DamageReductionBoost.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(PhantomicArtifact.DefenseBoost);
public override void SetStaticDefaults()
{
@@ -19,7 +19,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.endurance += PhantomicArtifact.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap?
player.statDefense += PhantomicArtifact.DefenseBoost;
}
}
+9 -9
View File
@@ -935,7 +935,6 @@ namespace CalamityMod.CalPlayer
public bool seraphTracers = false;
public bool frostFlare = false;
public bool evolution = false;
public int evolutionLifeRegenCounter = 0;
public bool nanotech = false;
public bool deadshotBrooch = false;
public bool shadowMinions = false;
@@ -3448,8 +3447,9 @@ namespace CalamityMod.CalPlayer
if (Player.armor[i].type == itemID)
return Player.armor[i];
}
return new Item();
return ContentSamples.ItemsByType[itemID];
}
public Item FindAccessory<T>() where T : ModItem => FindAccessory(ItemType<T>());
public override void ProcessTriggers(TriggersSet triggersSet)
{
@@ -3459,7 +3459,7 @@ namespace CalamityMod.CalPlayer
if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0)
{
var source = Player.GetSource_Accessory(FindAccessory(ItemType<AscendantInsignia>()));
var source = Player.GetSource_Accessory(FindAccessory<AscendantInsignia>());
Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType<AscendantAura>(), 0, 0f);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/AscendantActivate"));
ascendantInsigniaCooldown = AscendantInsignia.AbilityCooldown;
@@ -3557,7 +3557,7 @@ namespace CalamityMod.CalPlayer
angelAmt += 1f;
}
var source = Player.GetSource_Accessory(FindAccessory(ItemType<AngelicAlliance>()));
var source = Player.GetSource_Accessory(FindAccessory<AngelicAlliance>());
for (int projIndex = 0; projIndex < angelAmt; projIndex++)
{
Projectile proj = Main.projectile[projIndex];
@@ -4100,7 +4100,7 @@ namespace CalamityMod.CalPlayer
}
if (Player.statMana >= stormMana && !Player.silence)
{
var source = Player.GetSource_ItemUse(ContentSamples.ItemsByType[ItemType<ForbiddenCirclet>()]);
var source = Player.GetSource_ItemUse(FindAccessory<ForbiddenCirclet>());
Player.manaRegenDelay = (int)Player.maxRegenDelay;
Player.statMana -= stormMana;
@@ -4371,7 +4371,7 @@ namespace CalamityMod.CalPlayer
// Check if player hit some form of solid resistance (the ground)
if (0 == Player.velocity.Y)
{
var source = Player.GetSource_Accessory(FindAccessory(ItemType<InterstellarStompers>()));
var source = Player.GetSource_Accessory(FindAccessory<InterstellarStompers>());
// Spawn explosion. ai[0] is used for transferring the recorded falling time
int damage = Player.CalcIntDamage<MeleeDamageClass>(InterstellarStompers.SlamDamage);
@@ -4956,7 +4956,7 @@ namespace CalamityMod.CalPlayer
//Flashlight
//Due to being in postUpdate we need to adjust the mousepos for the player's movement that will have happened
var mouseworld = Main.MouseWorld + Player.position - Player.oldPosition;
EnhancedDarknessSystem.lights.Add(new(center: Player.Center + Player.DirectionTo(mouseworld) * 750f, rotation: Player.DirectionTo(mouseworld).ToRotation() - MathHelper.PiOver2, vectorScale: new Vector2(0.75f * abyssFlashlightWidthMultiplier, 0.75f), texture: Request<Texture2D>("CalamityMod/Particles/BloomLineFade")));
EnhancedDarknessSystem.lights.Add(new(center: Player.Center + Player.DirectionTo(mouseworld) * 750f, rotation: Player.DirectionTo(mouseworld).ToRotation() - MathHelper.PiOver2, vectorScale: new Vector2(0.85f * abyssFlashlightWidthMultiplier, 0.75f), texture: Request<Texture2D>("CalamityMod/Particles/BloomLineFade").Value));
}
if (lastDeerclopsPosition.HasValue)
@@ -4969,7 +4969,7 @@ namespace CalamityMod.CalPlayer
//Add the main light circle for the arena
DeerclopsAI.ArenaTex ??= ModContent.Request<Texture2D>(DeerclopsAI.ArenaTexPath);
EnhancedDarknessSystem.lights.Add(new(lastDeerclopsPosition.Value, scale: DeerclopsAI.borderScale, texture: DeerclopsAI.ArenaTex));
EnhancedDarknessSystem.lights.Add(new(lastDeerclopsPosition.Value, scale: DeerclopsAI.borderScale, texture: DeerclopsAI.ArenaTex.Value));
//we draw light around the player when far away so they have some visibility, although very small. This is especially nice in multiplayer. we scale opacity with distance bc it looks better
EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / (409600 /*640^2*/), 0, 1)));
@@ -5357,7 +5357,7 @@ namespace CalamityMod.CalPlayer
}
if (veneratedLocket)
{
var LocketSource = Player.GetSource_Accessory(FindAccessory(ItemType<VeneratedLocket>()));
var LocketSource = Player.GetSource_Accessory(FindAccessory<VeneratedLocket>());
if (item.CountsAsClass<RogueDamageClass>())
{
if (!CalamityItemSets.DisablesVeneratedLocketEffect[item.type])
+2 -2
View File
@@ -130,8 +130,8 @@ namespace CalamityMod.CalPlayer
dashDelayToApply = BalancingConstants.UniversalShieldSlamCooldown;
else if (UsedDash.CollisionType == DashCollisionType.ShieldBonk)
dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown;
if (DashID == DeepDiverDash.ID)
dashDelayToApply = 23;
if (DashID == DeepDiverDash.ID || (evasionScarf && DashID == CounterScarfDash.ID))
dashDelayToApply = (int)(dashDelayToApply * 0.75f);
if (DashID == StatisNinjaBeltDash.ID || DashID == StatisVoidSashDash.ID || Player.dashType == 1)
dashDelayToApply = BalancingConstants.UniversalSashDashCooldown;
+74 -19
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.CalPlayer
if (Starshield > 0 && drawInfo.shadow == 0)
{
var color = Color.Lerp(Color.DeepSkyBlue, Color.LightSkyBlue, (StratusStarburst / (float)MaxStratusStarburst));
var opacity = MathHelper.Min(MathHelper.Min(Starshield / 30f, 1f), (3600 - Starshield) / 30f);
var opacity = MathHelper.Min(MathHelper.Min(Starshield / 30f, 1f), (CalamityUtils.MinutesToFrames(10) - Starshield) / 30f);
float size = 80 + 32 * (StratusStarburst / (float)MaxStratusStarburst);
Vector2 drawPosition = Player.Center + new Vector2(0, Player.gfxOffY) - Main.screenPosition;
@@ -95,7 +95,7 @@ namespace CalamityMod.CalPlayer
GameShaders.Misc["CalamityMod:OtherworldBarrierDistortion"].UseSaturation(0.2f);
GameShaders.Misc["CalamityMod:OtherworldBarrierDistortion"].SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoiseHighContrast"), 1);
GameShaders.Misc["CalamityMod:OtherworldBarrierDistortion"].Apply();
Main.EntitySpriteDraw(telegraphBase, drawPosition, null, Color.DarkSlateBlue * opacity, 0, telegraphBase.Size() / 2f, size * 2f * opacity / telegraphBase.Width, 0, 0);
Main.EntitySpriteDraw(telegraphBase, drawPosition, null, Color.DarkSlateBlue * opacity, 0, telegraphBase.Size() / 2f, size * 1.5f * opacity / telegraphBase.Width, 0, 0);
//Draw the outer particles
Main.spriteBatch.EnterShaderRegion(matrix: matrix);
@@ -120,27 +120,82 @@ namespace CalamityMod.CalPlayer
}
if (DoG != null && Main.mapStyle != 2)
{
Rectangle screen = new((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight);
var rift = DoG.GetRiftLocation();
if (rift != Vector2.Zero && !Main.zenithWorld)
int drawCount = calamityPlayer.trippy ? 4 : 1;
for (int i = 0; i < drawCount; i++)
{
var dist = Player.Distance(rift);
var tex = ModContent.Request<Texture2D>("Terraria/Images/Extra_173").Value;
float scale = 1f;
Main.spriteBatch.Draw(tex, Player.Center + Player.DirectionTo(rift) * 196 * Math.Min(dist / 2400f, 2) - Main.screenPosition, null, Color.White * 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dist - 300) / 600), 0, 1), 0, tex.Size() / 2f, scale * 0.9f, SpriteEffects.FlipHorizontally, 0);
}
else
{
var dis = Player.Distance(DoG.NPC.Center);
if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying)
var rift = DoG.GetRiftLocation();
bool drawingRift = rift != Vector2.Zero && !Main.zenithWorld;
Vector2 targetCenter = drawingRift ? rift : DoG.NPC.Center;
float diffX = targetCenter.X - Player.Center.X;
float diffY = targetCenter.Y - Player.Center.Y;
// Mirror the offset based on i's index
if (calamityPlayer.trippy)
{
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss";
string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_P2_Head_Boss";
var tex = ModContent.Request<Texture2D>((DoG.Phase2Started && DoG.NPC.localAI[2] < 300) ? phase2IconPath : phase1IconPath).Value;
Main.spriteBatch.Draw(tex, Player.Center + Player.DirectionTo(DoG.NPC.Center) * 196 * Math.Min(dis / 2400f, 2) - Main.screenPosition, null, Color.White * 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dis - 600) / 300), 0, 1), DoG.NPC.rotation, tex.Size() / 2f, 1, SpriteEffects.None, 0);
switch (i)
{
case 0: diffX = -Math.Abs(diffX); diffY = -Math.Abs(diffY); break; // Top Left
case 1: diffX = Math.Abs(diffX); diffY = -Math.Abs(diffY); break; // Top Right
case 2: diffX = Math.Abs(diffX); diffY = Math.Abs(diffY); break; // Bottom Right
case 3: diffX = -Math.Abs(diffX); diffY = Math.Abs(diffY); break; // Bottom Left
}
}
Vector2 virtualTargetPos = Player.Center + new Vector2(diffX, diffY);
float dist = Player.Distance(virtualTargetPos);
Vector2 directionToTarget = Player.DirectionTo(virtualTargetPos);
if (drawingRift)
{
var tex = ModContent.Request<Texture2D>("Terraria/Images/Extra_173").Value;
float opacity = 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dist - 300) / 600), 0, 1);
Color drawColor = calamityPlayer.trippy ? Main.DiscoColor : Color.White * 0.9f;
Main.spriteBatch.Draw(tex, Player.Center + directionToTarget * 196 * Math.Min(dist / 2400f, 2) - Main.screenPosition,
null, drawColor * opacity, 0, tex.Size() / 2f, 0.9f, SpriteEffects.FlipHorizontally, 0);
}
else
{
var dis = Player.Distance(virtualTargetPos);
if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying && !drawInfo.drawPlayer.isDisplayDollOrInanimate)
{
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss";
string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_P2_Head_Boss";
var tex = ModContent.Request<Texture2D>((DoG.Phase2Started && DoG.NPC.localAI[2] < 300) ? phase2IconPath : phase1IconPath).Value;
float baseRotation = DoG.NPC.rotation;
if (calamityPlayer.trippy)
{
Vector2 rotVec = baseRotation.ToRotationVector2();
switch (i)
{
case 0:
rotVec.X *= -1;
rotVec.Y *= -1;
break;
case 1:
rotVec.Y *= -1;
break;
case 2:
break;
case 3:
rotVec.X *= -1;
break;
}
baseRotation = rotVec.ToRotation();
}
float opacity = 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dis - 600) / 300), 0, 1);
Color drawColor = calamityPlayer.trippy ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int)(255 * 0.9f)) : Color.White * 0.9f;
Main.spriteBatch.Draw(tex, Player.Center + directionToTarget * 196 * Math.Min(dis / 2400f, 2) - Main.screenPosition, null, drawColor * opacity, baseRotation, tex.Size() / 2f, 1, SpriteEffects.None, 0);
}
}
}
}
//Charge animation for Thread of Eradication
+41 -2
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using CalamityMod.Events;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Fishing.AstralCatches;
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
@@ -28,6 +29,7 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.UI;
namespace CalamityMod.CalPlayer
{
@@ -191,6 +193,23 @@ namespace CalamityMod.CalPlayer
itemDrop = ModContent.ItemType<EnergyCore>();
return;
}
if (Main.rand.NextBool(50))
{
switch (Main.rand.Next(3))
{
case 0:
itemDrop = ModContent.ItemType<RoverDrive>();
return;
case 1:
itemDrop = ModContent.ItemType<WulfrumBattery>();
return;
case 2:
itemDrop = ModContent.ItemType<AbandonedWulfrumHelmet>();
return;
}
return;
}
}
// Ignore catches if it's junk
@@ -430,8 +449,8 @@ namespace CalamityMod.CalPlayer
if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1)
fishingLevel = -1;
// If your bait is the Bloodworm, set the Fisherman's Pocket Guide to display Warning!
// This only happens when a fishing bobber projectile exists
// Set Fisherman's Pocket Guide to display "Warning!" with Bloodworm as bait
// This runs only while there is a fishing bobber; logic with no fishing bobber is handled in the ModifyDisplayParameters hook in the separate class below
Player.displayedFishingInfo = Language.GetTextValue("GameUI.FishingWarning");
}
}
@@ -474,4 +493,24 @@ namespace CalamityMod.CalPlayer
}
#endregion
}
public class BloodwormFishPowerWarning : GlobalInfoDisplay
{
// Set Fisherman's Pocket Guide to display "Warning!" with Bloodworm as bait
// This runs only while there is no fishing bobber; logic with a fishing bobber is handled in the GetFishingLevel hook above
public override void ModifyDisplayParameters(InfoDisplay currentDisplay, ref string displayValue, ref string displayName, ref Color displayColor, ref Color displayShadowColor)
{
if (currentDisplay == InfoDisplay.FishFinder)
{
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.owner == Main.myPlayer && p.bobber)
return;
}
if (Main.LocalPlayer.GetFishingConditions().BaitItemType == ModContent.ItemType<BloodwormItem>())
displayValue = Language.GetTextValue("GameUI.FishingWarning");
}
}
}
}
+41 -38
View File
@@ -56,6 +56,7 @@ using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Melee;
namespace CalamityMod.CalPlayer
{
@@ -142,7 +143,7 @@ namespace CalamityMod.CalPlayer
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
public void AbyssMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage)
public void AbyssMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage, Player.HurtInfo info)
{
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
@@ -165,7 +166,7 @@ namespace CalamityMod.CalPlayer
rogueStealth += 0.5f;
SoundEngine.PlaySound(SilvaArmor.ActivationSound, Player.Center);
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<AbyssalMirror>()));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<AbyssalMirror>(), info.DamageSource);
for (int i = 0; i < 10; i++)
{
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(55);
@@ -185,7 +186,7 @@ namespace CalamityMod.CalPlayer
}
}
public void EclipseMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage)
public void EclipseMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage, Player.HurtInfo info)
{
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
@@ -208,7 +209,7 @@ namespace CalamityMod.CalPlayer
rogueStealth += 0.5f;
SoundEngine.PlaySound(SoundID.Item68, Player.Center);
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<EclipseMirror>()));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<EclipseMirror>(), info.DamageSource);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(2000);
int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<EclipseMirrorBurst>(), damage, 0, Player.whoAmI);
@@ -882,7 +883,7 @@ namespace CalamityMod.CalPlayer
return;
}
}
if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && proj.damage > 0 && !modifiers.PvP)
if (proj.active && proj.hostile && modifiers.Dodgeable && proj.damage > 0)
{
double dodgeDamageGateValuePercent = 0.05;
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
@@ -923,19 +924,21 @@ namespace CalamityMod.CalPlayer
// The Evolution
if (evolution)
{
proj.hostile = false;
proj.friendly = true;
proj.damage = 10 * actualProjDamage;
proj.velocity *= -2f;
proj.extraUpdates += 1;
proj.penetrate = 1;
if (Player.whoAmI == Main.myPlayer)
{
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<TheEvolution>(), modifiers.DamageSource);
int mirrorDamage = (int)MathHelper.Min(actualProjDamage, 1000) * 50;
for (var i = 0; i < 5; i++)
{
Projectile.NewProjectile(source, Player.Center + Vector2.UnitX.RotatedBy(MathHelper.TwoPi * (i / 10f)), Vector2.Zero, ModContent.ProjectileType<MirrorBlast>(), mirrorDamage, 5, Main.myPlayer, 1);
}
}
// 17APR2024: Ozzatron: The Evolution is a reflect which also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
int evolutionIFrames = Player.ComputeReflectIFrames();
//Doze - This gives the same iframes as vanilla dodges, including accounting for cross necklace.
int evolutionIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(evolutionIFrames, true);
modifiers.Cancel();
evolutionLifeRegenCounter = 600;
projTypeJustHitBy = proj.type;
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.EvolutionReflectCooldownMin, BalancingConstants.EvolutionReflectCooldownMax, cooldownDurationScalar);
@@ -943,7 +946,7 @@ namespace CalamityMod.CalPlayer
return;
}
else if (daedalusReflect)
else if (daedalusReflect && !CalamityProjectileSets.ShouldNotBeReflected[proj.type] && !modifiers.PvP && !proj.friendly)
{
proj.hostile = false;
proj.friendly = true;
@@ -1131,7 +1134,7 @@ namespace CalamityMod.CalPlayer
if (!npc.dontTakeDamage)
{
int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(CrawCarapace.ThornsDamage);
Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<CrawCarapace>(), npc), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
}
SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center);
@@ -1156,8 +1159,8 @@ namespace CalamityMod.CalPlayer
if (!npc.dontTakeDamage)
{
int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(Baroclaw.ThornsDamage);
Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<Baroclaw>(), npc), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
npc.AddBuff(ModContent.BuffType<ArmorCrunch>(), 900);
npc.AddBuff(ModContent.BuffType<CrushDepth>(), 900);
}
@@ -1191,8 +1194,8 @@ namespace CalamityMod.CalPlayer
if (!npc.dontTakeDamage)
{
int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(TheAbsorber.ThornsDamage);
Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<TheAbsorber>(), npc), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y);
npc.AddBuff(ModContent.BuffType<AbsorberAffliction>(), 900);
}
SoundEngine.PlaySound(AbsorberHit, Player.Center);
@@ -1392,7 +1395,7 @@ namespace CalamityMod.CalPlayer
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_Accessory_OnHurt(FindAccessory<AlchemicalDecanter>(), hurtInfo.DamageSource), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 35;
bee.penetrate = 6;
bee.extraUpdates = 2;
@@ -1423,7 +1426,7 @@ namespace CalamityMod.CalPlayer
{
float speed = 2f;
int damage = 40;
int cloud = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, ModContent.ProjectileType<ScourgeVenomCloud>(), damage, 0f, Player.whoAmI);
int cloud = Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<CorrosiveSpine>(), hurtInfo.DamageSource), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, ModContent.ProjectileType<ScourgeVenomCloud>(), damage, 0f, Player.whoAmI);
if (cloud.WithinBounds(Main.maxProjectiles))
Main.projectile[cloud].DamageType = DamageClass.Generic;
}
@@ -1470,7 +1473,7 @@ namespace CalamityMod.CalPlayer
{
int damage = Player.CalcIntDamage<MeleeDamageClass>(InterstellarStompers.PassthroughDamage);
Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), damage, 0, Main.myPlayer);
Projectile.NewProjectile(Player.GetSource_Accessory(FindAccessory<InterstellarStompers>()), n.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), damage, 0, Main.myPlayer);
// 17APR2024: Ozzatron: Gravistar Sabaton gives iframes when passing through enemies for projectile safety.
// This is a fixed and intentionally very low number of iframes, and is not boosted by Cross Necklace.
@@ -1576,12 +1579,12 @@ namespace CalamityMod.CalPlayer
{
if (eclipseMirror)
{
EclipseMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken);
EclipseMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken, info);
return true;
}
else if (abyssalMirror)
{
AbyssMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken);
AbyssMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken, info);
return true;
}
}
@@ -2156,7 +2159,7 @@ namespace CalamityMod.CalPlayer
rageCombatFrames = BalancingConstants.RageCombatDelayTime;
// Regenerator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later)
if (regenerator && false)
/*if (regenerator)
{
// Projectile damage and count is based on source damage of the hit
float hitPower = (hurtInfo.SourceDamage / (Player.statLifeMax2 * 0.5f));
@@ -2166,9 +2169,9 @@ namespace CalamityMod.CalPlayer
for (int i = 0; i < projCount; i++)
{
Vector2 vel = (MathHelper.TwoPi * i / projCount).ToRotationVector2() * (i % 2 == 0 ? 0.75f : 1f) * 10;
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, vel.RotatedBy(-0.2f * (i % 2 == 0 ? -1 : 1)), ModContent.ProjectileType<RetaliationProjectile>(), projDamage, 0f, Player.whoAmI, 0, (i % 2 == 0 ? -1 : 1), -5);
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<Regenerator>(), hurtInfo.DamageSource), Player.Center, vel.RotatedBy(-0.2f * (i % 2 == 0 ? -1 : 1)), ModContent.ProjectileType<RetaliationProjectile>(), projDamage, 0f, Player.whoAmI, 0, (i % 2 == 0 ? -1 : 1), -5);
}
}
}*/
// Hide of Astrum Deus' melee boost
if (hideOfDeus)
@@ -2374,7 +2377,7 @@ namespace CalamityMod.CalPlayer
}
// Spawn the harmless brain images that are actually projectiles
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<TheAmalgam>()));
var source = Player.GetSource_Accessory_OnHurt(amalgam ? FindAccessory<TheAmalgam>() : FindAccessory<AmalgamatedBrain>(), hurtInfo.DamageSource);
Projectile.NewProjectile(source, Player.Center.X + Main.rand.Next(-40, 40), Player.Center.Y - Main.rand.Next(20, 60), Player.velocity.X * 0.3f, Player.velocity.Y * 0.3f, ProjectileID.BrainOfConfusion, 0, 0f, Player.whoAmI);
}
}
@@ -2400,7 +2403,7 @@ namespace CalamityMod.CalPlayer
// Drop some bones for visual effects
if (!Main.dedServ && Player.wingTime > 0)
{
var source = Player.GetSource_Accessory(FindAccessory(ItemID.BoneWings));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory(ItemID.BoneWings), hurtInfo.DamageSource);
for (int i = 0; i < 6; i++)
{
Vector2 boneVelocity = Vector2.UnitY.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(1.5f, 2.5f);
@@ -2455,7 +2458,7 @@ namespace CalamityMod.CalPlayer
}
if (hideOfDeus)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<HideofAstrumDeus>()));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<HideofAstrumDeus>(), hurtInfo.DamageSource);
SoundEngine.PlaySound(SoundID.Item74, Player.Center);
int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(HideofAstrumDeus.BlazeDamage);
@@ -2466,7 +2469,7 @@ namespace CalamityMod.CalPlayer
// This also serves to make the Honeycomb in Sweetheart Necklace make sense
if (dAmulet)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<DeificAmulet>()));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<DeificAmulet>(), hurtInfo.DamageSource);
int projAmount = (rampartOfDeities ? 12 : 6);
for (int n = 0; n < projAmount; n++)
{
@@ -2507,7 +2510,7 @@ namespace CalamityMod.CalPlayer
{
if (!(CalamityUtils.AnyProjectiles(ModContent.ProjectileType<ShadeNimbus>()) || CalamityUtils.AnyProjectiles(ModContent.ProjectileType<ShadeNimbusSpawner>())))
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<RottenBrain>()));
var source = Player.GetSource_Accessory_OnHurt(amalgam ? FindAccessory<TheAmalgam>() : aBrain ? FindAccessory<AmalgamatedBrain>() : FindAccessory<RottenBrain>(), hurtInfo.DamageSource);
int effectStrength = amalgam ? 3 : aBrain ? 2 : 1;
int effectDamage = amalgam ? TheAmalgam.NimbusDamage : aBrain ? AmalgamatedBrain.NimbusDamage : RottenBrain.NimbusDamage;
effectDamage = (int)Player.GetBestClassDamage().ApplyTo(effectDamage);
@@ -2527,11 +2530,11 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 2f }, Player.Center);
}
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<Items.Accessories.InkBomb>(), hurtInfo.DamageSource);
SoundEngine.PlaySound(SoundID.Item1, Player.Center);
for (int i = 0; i < 3; i++)
{
int ink = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
int ink = Projectile.NewProjectile(source, Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
if (ink.WithinBounds(Main.maxProjectiles))
Main.projectile[ink].DamageType = DamageClass.Generic;
}
@@ -2539,7 +2542,7 @@ namespace CalamityMod.CalPlayer
}
if (ataxiaBlaze)
{
var fuckYouBitch = Player.GetSource_Misc("21");
var fuckYouBitch = Player.GetSource_OnHurt(hurtInfo.DamageSource);
if (hurtInfo.Damage > 0)
{
SoundEngine.PlaySound(SoundID.Item74, Player.Center);
@@ -2557,7 +2560,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
{
var source = Player.GetSource_Misc("22");
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource);
float offset = Main.rand.NextFloat(MathHelper.TwoPi);
int sDamage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(DaedalusHeadRanged.ShardDamage);
for (int i = 0; i < 10; i++)
@@ -2572,7 +2575,7 @@ namespace CalamityMod.CalPlayer
}
else if (godSlayerDamage) //god slayer melee helm
{
var source = Player.GetSource_Misc("24");
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource);
if (hurtInfo.Damage > GodSlayerHeadMelee.SetBonusHurtDamageThreshold)
{
SoundEngine.PlaySound(SoundID.Item73, Player.Center);
+1 -7
View File
@@ -116,7 +116,7 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalFlask.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(searingLava, 30);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
@@ -567,12 +567,6 @@ namespace CalamityMod.CalPlayer
if (trinketOfChi || chiRegen)
Player.lifeRegen += 2;
if (evolutionLifeRegenCounter > 0)
{
if (Player.lifeRegenTime < 3600f)
Player.lifeRegenTime = 3600f;
}
if (darkSunRing)
{
if (Main.eclipse || Main.dayTime)
+12 -11
View File
@@ -203,12 +203,12 @@ namespace CalamityMod.CalPlayer
if (Player.HeldItem.type != ModContent.ItemType<SaharaSlicers>())
saharaSlicersBolts = 0;
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starfleet>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarfleetHoldout>()] == 0) && !Player.dead)
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starfleet>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarfleetHoldout>()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface)
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarfleetHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starmada>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarmadaHoldout>()] == 0) && !Player.dead)
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starmada>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarmadaHoldout>()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface)
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarmadaHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
@@ -1297,6 +1297,9 @@ namespace CalamityMod.CalPlayer
}
}
if (brittleStar && brittleStarBuffMode)
Player.statDefense += 4 * Player.ownedProjectileCounts[ModContent.ProjectileType<BrittleStarMinion>()];
// Reduce the rate of recovery of the Lifesteal variable
// Classic Mode: 36 HP/s to 12 HP/s
// Expert Mode: 30 HP/s to 9 HP/s
@@ -1708,7 +1711,7 @@ namespace CalamityMod.CalPlayer
}
if (rOfResilienceEffect > 0)
{
if (Player.Calamity().mouseRight && rOfResilienceCooldown == 0)
if (Player.Calamity().mouseRight && !Player.mouseInterface && rOfResilienceCooldown == 0)
{
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
rOfResilienceCooldown = cooldownTime;
@@ -1784,9 +1787,10 @@ namespace CalamityMod.CalPlayer
if (p.type == ModContent.ProjectileType<TransformerBlob>() && p.owner == Player.whoAmI)
{
float insanityValue = ((p.ai[1] % 10) + 1);
int blobNum = Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] + 1;
float insanityValue = (p.ai[1] % 10);
if (p.ai[0] == layer)
p.ai[2] = insanityValue / Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] * (angleMax) - (angleMax) / 2f;
p.ai[2] = (insanityValue / blobNum) * angleMax - angleMax / 2f;
p.netUpdate = true;
}
@@ -1835,9 +1839,10 @@ namespace CalamityMod.CalPlayer
if (p.type == ModContent.ProjectileType<TransformerBlob>() && p.owner == Player.whoAmI)
{
float insanityValue = (p.ai[1] % 10) + 1;
int blobNum = Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] + 1;
float insanityValue = (p.ai[1] % 10);
if (p.ai[0] == layer)
p.ai[2] = insanityValue / Player.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()] * angleMax - angleMax / 2f;
p.ai[2] = (insanityValue / blobNum) * angleMax - angleMax / 2f;
p.netUpdate = true;
index++;
@@ -2237,8 +2242,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
@@ -2318,8 +2321,6 @@ namespace CalamityMod.CalPlayer
xerocDmg = 0f;
if (hideOfDeusMeleeBoostTimer > 0)
hideOfDeusMeleeBoostTimer--;
if (evolutionLifeRegenCounter > 0)
evolutionLifeRegenCounter--;
if (hurtSoundTimer > 0)
hurtSoundTimer--;
if (wingProjectileCooldown > 0)
+57 -55
View File
@@ -67,6 +67,10 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI != Main.myPlayer)
return;
// Apply this to player equippable sources ie. Orichalcum set bonus petal spawns
// Do not apply if this effect is an extension of a weapon ie. Pearl God round effect as it will mess up Old Fashioned
var source = Player.GetSource_OnHit(target);
// Handle on-hit melee effects for the gem tech armor set.
if (item.CountsAsClass<MeleeDamageClass>())
GemTechState.MeleeOnHitEffects(target);
@@ -145,7 +149,7 @@ namespace CalamityMod.CalPlayer
bool targetIsDummy = target.type == NPCID.TargetDummy || target.type == NPCType<SuperDummyNPC>();
ItemLifesteal(target, item, damageDone);
ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy);
ItemOnHit(item, damageDone, target, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy);
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit);
// Ursa Sergeant slash cooldown is reset on kill
@@ -157,16 +161,14 @@ namespace CalamityMod.CalPlayer
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);
Projectile.NewProjectile(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;
@@ -175,7 +177,6 @@ namespace CalamityMod.CalPlayer
}
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;
@@ -186,7 +187,7 @@ namespace CalamityMod.CalPlayer
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
Player.AddCooldown(GenericBandCooldown.ID, cooldown);
}
}
@@ -204,8 +205,7 @@ namespace CalamityMod.CalPlayer
bool spawnChance = (Main.rand.Next(100) < ArcFlashRing.LightningSpawnPercent);
if (arcFlashRing && spawnChance)
{
var source = item.GetSource_FromThis();
int damage = (int)(((hit.Damage * ArcFlashRing.LightningDamageMult) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
int damage = (int)(hit.Damage * ArcFlashRing.LightningDamageMult * (hit.Crit ? 0.5f : 1) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
bolt.DamageType = hit.DamageType;
@@ -226,6 +226,9 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI != Main.myPlayer)
return;
// Apply this to player equippable sources ie. Orichalcum set bonus petal spawns
// Do not apply if this effect is an extension of a weapon ie. Pearl God round effect as it will mess up Old Fashioned
var source = Player.GetSource_OnHit(target);
CalamityGlobalNPC cgn = target.Calamity();
// Handle on-hit melee effects for the gem tech armor set.
@@ -362,16 +365,14 @@ namespace CalamityMod.CalPlayer
// 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);
Projectile.NewProjectile(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;
@@ -380,7 +381,6 @@ namespace CalamityMod.CalPlayer
}
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;
@@ -391,11 +391,11 @@ namespace CalamityMod.CalPlayer
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
Player.AddCooldown(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>())
if (luxorsGift && proj.type != ProjectileType<LuxorsGiftMelee>() && proj.type != ProjectileType<LuxorsGiftRanged>() && proj.type != ProjectileType<LuxorsGiftMagic>() && proj.type != ProjectileType<LuxorsGiftSummon>() && proj.type != ProjectileType<LuxorsGiftRogue>() && proj.type != ProjectileType<LuxorsGiftClassless>())
luxorHit = true;
// Transformer gives +2 blobs on kill, which are stored then given to you one by one (so it can't spawn more than one on a single frame)
@@ -406,13 +406,12 @@ namespace CalamityMod.CalPlayer
CalamityGlobalProjectile globalProj = proj.Calamity();
// Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!)
bool spawnChance = (Main.rand.Next(0, 100) < 6);
bool spawnChance = (Main.rand.Next(0, 100) < ArcFlashRing.LightningSpawnPercent);
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>())
{
proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active
var source = proj.GetSource_FromThis();
int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
int damage = (int)(hit.Damage * ArcFlashRing.LightningDamageMult * (hit.Crit ? 0.5f : 1) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI, (globalProj.showArcFlash ? 0 : 1));
bolt.DamageType = hit.DamageType;
@@ -424,7 +423,7 @@ namespace CalamityMod.CalPlayer
if (forbiddenCirclet && globalProj.stealthStrike)
{
target.AddBuff(ModContent.BuffType<ForbiddenStealthSummonTagBuff>(), ForbiddenCirclet.TagDuration);
target.AddBuff(BuffType<ForbiddenStealthSummonTagBuff>(), ForbiddenCirclet.TagDuration);
}
if (!proj.npcProj && !proj.trap && proj.friendly)
@@ -520,7 +519,7 @@ namespace CalamityMod.CalPlayer
}
int onHitDamage = Player.CalcIntDamage<RangedDamageClass>(0.2f * proj.damage);
Projectile shock = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, target.whoAmI);
Projectile shock = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, target.whoAmI);
shock.DamageType = proj.DamageType;
SoundStyle hitSound = new("CalamityMod/Sounds/Item/ElectricHit");
SoundEngine.PlaySound(hitSound with { Volume = 0.2f, Pitch = 0.7f, PitchVariance = 0.2f }, proj.Center);
@@ -552,14 +551,14 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(subTrail);
}
int pearls = (int)(MathHelper.Clamp(7 - (int)(proj.numHits * 0.5f), 2, 7));
int pearls = (int)MathHelper.Clamp(7 - (int)(proj.numHits * 0.5f), 2, 7);
for (int k = 0; k < pearls; k++)
{
Vector2 velocity = new Vector2(1, 1).RotatedByRandom(100) * Main.rand.NextFloat(0.7f, 1.2f);
PearlParticle subTrail = new PearlParticle(Position + velocity * 11f, velocity * 10, true, 50, 0.85f, color, 0.95f, Main.rand.NextFloat(2, -2), true);
GeneralParticleHandler.SpawnParticle(subTrail);
}
int dusts = (int)(MathHelper.Clamp(10 - (int)(proj.numHits * 0.5f), 2, 10));
int dusts = (int)MathHelper.Clamp(10 - (int)(proj.numHits * 0.5f), 2, 10);
for (int i = 0; i <= dusts; i++)
{
Dust dust2 = Dust.NewDustPerfect(Position, DustID.FireworksRGB, new Vector2(5, 5).RotatedByRandom(100f) * Main.rand.NextFloat(0.1f, 2.9f));
@@ -569,7 +568,7 @@ namespace CalamityMod.CalPlayer
}
int onHitDamage = Player.CalcIntDamage<RangedDamageClass>(0.2f * proj.damage);
Projectile blast = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, target.whoAmI);
Projectile blast = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType<DirectStrike>(), onHitDamage, 0f, Player.whoAmI, target.whoAmI);
blast.DamageType = proj.DamageType;
SoundStyle hitSound = new("CalamityMod/Sounds/Item/HadalUrnClose");
@@ -612,7 +611,7 @@ namespace CalamityMod.CalPlayer
bool targetIsDummy = target.type == NPCID.TargetDummy || target.type == NPCType<SuperDummyNPC>();
ProjLifesteal(target, proj, damageDone, hit.Crit);
ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy);
ProjOnHit(proj, target, hit.Crit, target.IsAnEnemy(false), targetIsDummy);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit, true, proj.noEnchantments);
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
@@ -626,9 +625,10 @@ namespace CalamityMod.CalPlayer
#endregion
#region Item
public void ItemOnHit(Item item, int damage, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy)
public void ItemOnHit(Item item, int damage, NPC target, bool crit, bool npcCheck, bool targetIsDummy)
{
var source = Player.GetSource_ItemUse(item);
Vector2 position = target.Center;
var source = Player.GetSource_OnHit(target);
if (!item.CountsAsClass<MeleeDamageClass>() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, Player.velocity, ProjectileID.ConfettiMelee, 0, 0f, Player.whoAmI);
@@ -682,10 +682,11 @@ namespace CalamityMod.CalPlayer
#endregion
#region Proj On Hit
public void ProjOnHit(Projectile proj, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy)
public void ProjOnHit(Projectile proj, NPC target, bool crit, bool npcCheck, bool targetIsDummy)
{
CalamityGlobalProjectile modProj = proj.Calamity();
var source = proj.GetSource_FromThis();
Vector2 position = target.Center;
var source = Player.GetSource_OnHit(target);
bool hasClass = proj.CountsAsClass<MeleeDamageClass>() || proj.CountsAsClass<RangedDamageClass>() || proj.CountsAsClass<MagicDamageClass>() || proj.CountsAsClass<SummonDamageClass>() || proj.CountsAsClass<ThrowingDamageClass>();
//flask of party affects all types of weapons, !proj.CountsAsClass<MeleeDamageClass>() is to prevent double flask effects
@@ -749,29 +750,26 @@ namespace CalamityMod.CalPlayer
if (ursaSergeant && ursaSergeantCooldown <= 0)
{
ursaSergeantCooldown = UrsaSergeant.MaxCooldown;
int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(UrsaSergeant.BaseSwipeDamage);
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<UrsaSlash>(), ursaSlashdamage, 0f, Player.whoAmI);
}
if (proj.CountsAsClass<MeleeDamageClass>())
MeleeOnHit(proj, modProj, position, crit, npcCheck, targetIsDummy);
MeleeOnHit(proj, modProj, target, crit, npcCheck, targetIsDummy);
if (proj.CountsAsClass<RangedDamageClass>())
RangedOnHit(proj, modProj, position, crit, npcCheck);
RangedOnHit(proj, modProj, target, crit, npcCheck);
if (proj.CountsAsClass<MagicDamageClass>())
MagicOnHit(proj, modProj, position, crit, npcCheck);
MagicOnHit(proj, modProj, target, crit, npcCheck);
if (proj.CountsAsClass<SummonDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>())
SummonOnHit(proj, modProj, position, crit, npcCheck);
SummonOnHit(proj, modProj, target, crit, npcCheck);
if (proj.CountsAsClass<ThrowingDamageClass>())
RogueOnHit(proj, modProj, position, crit, npcCheck);
RogueOnHit(proj, modProj, target, crit, npcCheck);
}
#region Melee
private void MeleeOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy)
private void MeleeOnHit(Projectile proj, CalamityGlobalProjectile modProj, NPC target, bool crit, bool npcCheck, bool targetIsDummy)
{
var source = proj.GetSource_FromThis();
Item heldItem = Player.HeldItem;
var source = Player.GetSource_OnHit(target);
if (proj.IsTrueMelee())
{
@@ -801,9 +799,10 @@ namespace CalamityMod.CalPlayer
#endregion
#region Ranged
private void RangedOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
private void RangedOnHit(Projectile proj, CalamityGlobalProjectile modProj, NPC target, bool crit, bool npcCheck)
{
var source = proj.GetSource_FromThis();
Vector2 position = target.Center;
var source = Player.GetSource_OnHit(target);
if (npcCheck)
{
@@ -845,14 +844,15 @@ namespace CalamityMod.CalPlayer
#endregion
#region Magic
private void MagicOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
private void MagicOnHit(Projectile proj, CalamityGlobalProjectile modProj, NPC target, bool crit, bool npcCheck)
{
var source = proj.GetSource_FromThis();
Vector2 position = target.Center;
var source = Player.GetSource_OnHit(target);
if (ataxiaMage && ataxiaDmg <= 0)
{
int orbDamage = (int)(proj.damage * HydrothermicHeadMagic.OrbDamageRatio);
CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType<HydrothermicSphere>(), 800f, 20f);
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 20f, 20f, 1f);
Projectile.NewProjectile(source, proj.Center, velocity, ProjectileType<HydrothermicSphere>(), orbDamage, 0f, proj.owner);
int cooldown = (int)(orbDamage * HydrothermicHeadMagic.OrbDamageCooldownMult);
ataxiaDmg += cooldown;
}
@@ -886,9 +886,10 @@ namespace CalamityMod.CalPlayer
#endregion
#region Summon
private void SummonOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
private void SummonOnHit(Projectile proj, CalamityGlobalProjectile modProj, NPC target, bool crit, bool npcCheck)
{
var source = proj.GetSource_FromThis();
Vector2 position = target.Center;
var source = Player.GetSource_OnHit(target);
if (phantomicArtifact)
{
@@ -906,10 +907,10 @@ namespace CalamityMod.CalPlayer
{
if (phantomicHeartRegen == 1000 && Player.ownedProjectileCounts[ProjectileType<PhantomicHeart>()] == 0)
{
Vector2 target = proj.Center;
target.Y += Main.rand.Next(-50, 50);
target.X += Main.rand.Next(-50, 50);
Projectile.NewProjectile(source, target, Vector2.Zero, ProjectileType<PhantomicHeart>(), 0, 0f, Player.whoAmI);
Vector2 spawnPos = proj.Center;
spawnPos.Y += Main.rand.Next(-50, 50);
spawnPos.X += Main.rand.Next(-50, 50);
Projectile.NewProjectile(source, spawnPos, Vector2.Zero, ProjectileType<PhantomicHeart>(), 0, 0f, Player.whoAmI);
}
}
else if (buffType == empowerBuff)
@@ -1014,9 +1015,10 @@ namespace CalamityMod.CalPlayer
#endregion
#region Rogue
private void RogueOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
private void RogueOnHit(Projectile proj, CalamityGlobalProjectile modProj, NPC target, bool crit, bool npcCheck)
{
var spawnSource = proj.GetSource_FromThis();
Vector2 position = target.Center;
var spawnSource = Player.GetSource_OnHit(target);
int Type = ProjectileType<DragonScalesInfernado>();
if (modProj.stealthStrike && dragonScales && Main.projectile.Count(proj => proj.type == Type && proj.active) < 1)
{
@@ -1235,7 +1237,7 @@ namespace CalamityMod.CalPlayer
}
if (summon && !whip)
{
if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
if (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)
target.AddBuff(BuffType<HolyFlames>(), 600);
else if (pSoulArtifact)
target.AddBuff(BuffType<HolyFlames>(), 300);
@@ -1321,7 +1323,7 @@ namespace CalamityMod.CalPlayer
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
Projectile.NewProjectile(Player.GetSource_OnHit(target), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
@@ -1340,7 +1342,7 @@ namespace CalamityMod.CalPlayer
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f);
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<BloodstoneHealOrb>(), 4, 0f, proj.owner);
Projectile.NewProjectile(Player.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(proj.velocity.Length() * proj.MaxUpdates / 4f, 4f) * Main.rand.NextFloat(0.75f, 1.25f), ProjectileType<BloodstoneHealOrb>(), 4, 0f, proj.owner);
if (proj.CountsAsClass<MagicDamageClass>() && Player.HeldItem.CountsAsClass<MagicDamageClass>())
{
@@ -1378,7 +1380,7 @@ namespace CalamityMod.CalPlayer
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
Projectile.NewProjectile(Player.GetSource_OnHit(target), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.CalPlayer.Dashes
ID = DashID;
}
public override float CalculateDashSpeed(Player player) => player.Calamity().evasionScarf ? 16.3f : 15f;
public override float CalculateDashSpeed(Player player) => player.Calamity().evasionScarf ? 19f : 15f;
public override void OnDashEffects(Player player)
{
+2 -2
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
return;
Texture2D texture = yharwingTexture.Value;
Vector2 Position = drawInfo.Position;
Vector2 pos = new Vector2((int)(Position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (2 * drawPlayer.direction)), (int)(Position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) - 2f * drawPlayer.gravDir));
Vector2 pos = new Vector2((int)(Position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (2 * drawPlayer.direction)), (int)(Position.Y - Main.screenPosition.Y + (drawPlayer.height / 2 + drawPlayer.HeightOffsetVisual / 2f) - 2f * drawPlayer.gravDir));
Color lightColor = Lighting.GetColor((int)drawPlayer.Center.X / 16, (int)drawPlayer.Center.Y / 16, Color.White);
Color color = lightColor * (1 - drawInfo.shadow);
DrawData d = new DrawData(texture, pos, texture.Frame(1, 9, 0, drawInfo.drawPlayer.wingFrame), color, 0f, new Vector2(texture.Width / 2, texture.Height / 18), 1f, drawInfo.playerEffect, 0);
@@ -36,4 +36,4 @@ namespace CalamityMod.CalPlayer.DrawLayers
drawInfo.DrawDataCache.Add(d);
}
}
}
}
+25 -99
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using CalamityMod.Packets;
using Microsoft.Xna.Framework;
@@ -11,39 +12,45 @@ namespace CalamityMod
{
public class CalamityNetcode : ModSystem
{
private static CalamityPacket[] _PacketRegistry = new CalamityPacket[256]; // This should allow to use 0-255 range (full byte range)
private static List<CalamityPacket> _PacketHandlers = [];
internal static void RegisterHandler(CalamityPacket handler)
internal static ushort RegisterHandler(CalamityPacket handler)
{
var msgType = handler.MessageType;
var existingHandler = _PacketRegistry[msgType];
var id = (ushort)_PacketHandlers.Count;
_PacketHandlers.Add(handler);
return id;
}
if (existingHandler != null)
{
CalamityMod.Log.Error($"Packet instance has already registered by other type!" +
$" [Failed On: '{handler.GetType().FullName}'" +
$" Current Owner: '{existingHandler.GetType().FullName}'," +
$" msgTypeToRegister: '{msgType}']");
return;
}
internal static void WriteHandlerNetID(BinaryWriter packet, ushort netID)
{
if (_PacketHandlers.Count > 256)
packet.Write(netID);
else
packet.Write((byte)netID);
}
_PacketRegistry[msgType] = handler;
internal static ushort ReadHandlerNetID(BinaryReader packet)
{
if (_PacketHandlers.Count > 256)
return packet.ReadUInt16();
else
return packet.ReadByte();
}
public override void OnModUnload()
{
_PacketRegistry = null;
_PacketHandlers = null;
}
public static void HandlePacket(Mod mod, BinaryReader reader, int whoAmI)
{
try
{
CalamityModMessageType msgType = (CalamityModMessageType)reader.ReadByte();
var packetHandler = _PacketRegistry[(byte)msgType];
var netID = ReadHandlerNetID(reader);
var packetHandler = _PacketHandlers[netID];
if (packetHandler is not null)
{
packetHandler.HandlePacket(in reader, whoAmI);
packetHandler.HandlePacket(reader, whoAmI);
}
else
{
@@ -52,7 +59,7 @@ namespace CalamityMod
// Throw an exception now instead of allowing the network stream to corrupt.
//
CalamityMod.Log.Error($"Failed to parse Calamity packet: No Calamity packet exists with ID {msgType}.");
CalamityMod.Log.Error($"Failed to parse Calamity packet: No Calamity packet exists with ID {netID}.");
throw new Exception("Failed to parse Calamity packet: Invalid Calamity packet ID.");
}
}
@@ -132,85 +139,4 @@ namespace CalamityMod
}
}
}
public enum CalamityModMessageType : byte
{
// Player mechanic syncs
DefenseDamageSync, // TODO -- this can't be synced every 60 frames, it needs to be synced when the player gets hit, or every time it heals up
RageSync, // TODO -- this can't be synced every 60 frames, it needs to be synced every time the player is
AdrenalineSync, // TODO -- this can't be synced every 60 frames, it needs to be synced every time the player is
CooldownAddition,
CooldownRemoval,
SyncCooldownDictionary,
ExaltationDirection,
// Syncs for specific bosses or entities
SyncCalamityNPCAIArray,
SyncVanillaNPCLocalAIArray,
SpawnSuperDummy,
DeleteAllSuperDummies,
SyncAndroombaSolution,
SyncAndroombaAI,
SyncSlabCrabAI,
PlaceAltCritter,
ProvidenceDyeConditionSync, // TODO -- this packetstorms if you hit Provi with spam weapons. It should ONLY send a packet if the status changes.
PSCChallengeSync, // TODO -- once you've failed the PSC challenge this packetstorms
// General things for entities
SpawnNPCOnPlayer,
SpawnBossOnPosition,
SyncNPCMotionDataToServer,
SyncNPCPosAndRotOnly,
SyncNPCDemonicFlamesDamage,
SyncNPCDemonSwordImpales,
// Tile Entities
PowerCellFactory,
ChargingStationStandard,
ChargingStationItemChange,
Turret,
LabHologramProjector,
UpdateCodebreakerConstituents,
UpdateCodebreakerContainedStuff,
UpdateCodebreakerDecryptCountdown,
UnlockAbyssChests,
UpdateCanvasPainting,
// Draedon Summoner
CodebreakerSummonStuff,
ExoMechSelection,
// Boss Rush
BossRushStage,
BossRushStartTimer,
BossRushEndTimer,
EndBossRush,
BRHostileProjKillSync, // TODO -- Simplify this. Only one packet needs be sent: "kill all hostile projectiles for N frames".
// Acid Rain
AcidRainSync,
AcidRainOldDukeSummonSync,
EncounteredOldDukeSync,
// Mouse Controls syncs
RightClickSync,
MouseRotationSync,
MousePositionSync,
// World state sync
SwitchToDifficulty,
// Music events
MusicEventSyncRequest,
MusicEventSyncResponse,
// Bandit Reforge Refund
BanditStolenMoneySync,
WantToRefundReforges,
// Player Draw Effect Parameters
SyncPlayerDrawParameter,
DialogueDisplayStart,
}
}
+2 -2
View File
@@ -151,7 +151,7 @@ namespace CalamityMod.DataStructures
for (int i = 0; i < 14; i++)
{
Vector2 shootVelocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(0.5f, 3.25f);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), target.Center, shootVelocity, ModContent.ProjectileType<GemTechYellowShard>(), damage, 0f, OwnerIndex);
Projectile.NewProjectile(Owner.GetSource_OnHit(target), target.Center, shootVelocity, ModContent.ProjectileType<GemTechYellowShard>(), damage, 0f, OwnerIndex);
}
MeleeCrystalCountdown = GemTechHeadgear.MeleeShardDelay;
@@ -171,7 +171,7 @@ namespace CalamityMod.DataStructures
shootVelocity = shootVelocity.SafeNormalize(Vector2.UnitY) * 6f;
spawnPosition -= shootVelocity.SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(15f, 50f);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), spawnPosition, shootVelocity, ModContent.ProjectileType<GemTechGreenFlechette>(), damage, 0f, OwnerIndex);
Projectile.NewProjectile(Owner.GetSource_OnHit(target), spawnPosition, shootVelocity, ModContent.ProjectileType<GemTechGreenFlechette>(), damage, 0f, OwnerIndex);
}
public void OnItemUseEffects(Item item)
@@ -1,4 +1,4 @@
{
{
"Revision": 1,
"DefaultColor": "6383FF",
"DefaultSpeaker": "DevourerOfGods",
@@ -82,7 +82,7 @@
{
"TextDelay": 0,
"Lines": [
"[Shaking:[Scale(1.5):[Colors(2, 0.5, 00FFFF, FF00FF):BEGON!]]]"
"[Shaking:[Scale(1.5):[Colors(2, 0.5, 00FFFF, FF00FF):BEGONE!]]]"
]
},
{
+2 -10
View File
@@ -17,7 +17,7 @@ float4 uShaderSpecificData;
float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Drift to offset the noisemap. X multiplier is a prime number to ensure the "loop time" of this is very high, it takes 100 uTime to return to the original state
float2 drift = float2(uTime * uRotation, uTime * uSaturation);
float2 drift = float2(0.23 * uTime * uSaturation, uTime * uSaturation);
//This is the uv distance from the center of the texture
float2 uvOffsetFromCenter = (coords - 0.5);
@@ -38,16 +38,8 @@ float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD
// I would like to be able to draw directly additive, but I have been unable to make that work and this has worked well.
float4 distortedColor = tex2D(uImage0, modifiedCoords);
distortedColor.a = distortedColor.x;
distortedColor *= uDirection;
float4 drawColor = sampleColor;
float4 borderColor = sampleColor;
borderColor.rgb = uSecondaryColor;
if(dist > 0.4)
drawColor = lerp(sampleColor, borderColor, (dist - 0.4) / 0.1);
return distortedColor * drawColor * mask;
return distortedColor * sampleColor * mask;
}
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

+27 -10
View File
@@ -14,20 +14,26 @@ namespace CalamityMod.Graphics
{
public class EnhancedDarknessSystem : ModSystem
{
private static Asset<Texture2D> _defaultTexture;
public class LightSource
{
public Asset<Texture2D> texture;
public Texture2D texture = _defaultTexture.Value;
public float scale = 1;
public Vector2 vectorScale = Vector2.One;
public Vector2 center = Main.LocalPlayer.Center;
public float rotation = 0;
public float opacity = 1;
public Color color = Color.White;
public int lifetime = 1;
public Rectangle? frame = null;
public LightSource() { }
public LightSource(Vector2? center = null, Asset<Texture2D> texture = null, float scale = 1, float rotation = 0, Vector2? vectorScale = null, float opacity = 1)
// This constructor only gives the most common arguments. Frame, Color, lifetime, etc. must be set in curly braces afterwards to prevent this constructor getting too unwieldy.
public LightSource(Vector2? center = null, Texture2D texture = null, float scale = 1, float rotation = 0, Vector2? vectorScale = null, float opacity = 1)
{
this.texture = texture ?? ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
this.texture = texture ?? ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
this.scale = scale;
this.vectorScale = vectorScale ?? Vector2.One;
this.center = center ?? Main.LocalPlayer.Center;
@@ -37,10 +43,11 @@ namespace CalamityMod.Graphics
}
public static List<LightSource> lights = new();
public override void OnModLoad()
public override void Load()
{
On_OverlayManager.Draw += DrawShadowOverlay;
On_LightingEngine.UpdateLightDecay += AdjustTransmissiveness;
_defaultTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
private void DrawShadowOverlay(On_OverlayManager.orig_Draw orig, OverlayManager self, SpriteBatch spriteBatch, RenderLayers layer, bool beginSpriteBatch)
@@ -58,8 +65,8 @@ namespace CalamityMod.Graphics
var device = Main.instance.GraphicsDevice;
using var lease = RenderTargetPool.Shared.Rent(
device,
Main.screenWidth / 2,
Main.screenHeight / 2,
Main.screenWidth,
Main.screenHeight,
RenderTargetDescriptor.Default
);
@@ -68,7 +75,7 @@ namespace CalamityMod.Graphics
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.Default, Main.Rasterizer, null, Matrix.Identity);
foreach (var item in lights)
{
Main.spriteBatch.Draw(item.texture.Value, (item.center - Main.screenPosition) * 0.5f, null, Color.White * item.opacity, item.rotation, item.texture.Size() * 0.5f, item.vectorScale * item.scale * 0.5f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(item.texture, (item.center - Main.screenPosition), item.frame, item.color * item.opacity, item.rotation, item.frame is null ? item.texture.Size() * 0.5f : item.frame.Value.Size(), item.vectorScale * item.scale, SpriteEffects.None, 0);
}
Main.spriteBatch.End();
}
@@ -79,7 +86,7 @@ namespace CalamityMod.Graphics
var shader = GameShaders.Misc["CalamityMod:DozeLightingShader"];
shader.UseOpacity(mp.darknessIntensity);
shader.Apply();
Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0, Vector2.Zero, 2, 0, 0);
Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0, Vector2.Zero, 1, 0, 0);
spriteBatch.End();
}
}
@@ -109,7 +116,17 @@ namespace CalamityMod.Graphics
public override void PreUpdateEntities()
{
//Every frame, the light sources are determined by what was added on that frame only. Therefore, we reset the light list every frame.
lights.Clear();
//Lifetime is provided to smooth out things that don't run every frame consistently to prevent flickering, such as the abyss torches.
for (var i = 0; i < lights.Count; i++)
{
var item = lights[i];
item.lifetime--;
if (item.lifetime <= 0)
{
lights.Remove(item);
i--;
}
}
}
}
+13
View File
@@ -1,6 +1,7 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Enums;
using CalamityMod.Projectiles.Boss;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
using MonoMod.Cil;
@@ -673,5 +674,17 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.And);
}
#endregion
#region Make GFB Nurse Meteor Undodgeable
private static bool GFBNurseMeteorUndodgeable(On_Projectile.orig_IsDamageDodgable orig, Projectile self)
{
// Make the Leviathan meteor that spawns when talking to the Nurse in GFB undodgeable
// Unfortunately the Dodgeable value in HurtModifiers cannot be set in the hook, thus On editing a vanilla function
if (self.type == ModContent.ProjectileType<LeviathanBomb>() && self.damage == 9999)
return false;
else
return orig(self);
}
#endregion
}
}
+1 -1
View File
@@ -109,6 +109,7 @@ namespace CalamityMod.ILEditing
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs;
On_Player.ConsumeSolarFlare += SolarWingsDashChange;
On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable;
IL_Player.UpdateBuffs += UpdateBuffsBalancingChanges;
IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR;
@@ -145,7 +146,6 @@ namespace CalamityMod.ILEditing
IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable;
IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable;
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
IL_Player.ItemCheck_Shoot += RemoveForcedInaccuracyFromChainGunAndGatligator;
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements;
@@ -125,33 +125,6 @@ namespace CalamityMod.ILEditing
}
#endregion Reforge Requirement Relaxation
#region Remove Forced Inaccuracy from Chain Gun and Gatligator
private static void RemoveForcedInaccuracyFromChainGunAndGatligator(ILContext il)
{
var cursor = new ILCursor(il);
// Go to the load of the Chain Gun's item ID (1929).
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(1929)))
{
LogFailure("Remove Chain Gun and Gatligator Inaccuracy", "Could not locate the ID of the Chain Gun.");
return;
}
// Change this item ID check to check for -1048576. This will never occur.
cursor.Next.Operand = -1048576;
// Go to the load of the Gatligator's item ID (2270).
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(2270)))
{
LogFailure("Remove Chain Gun and Gatligator Inaccuracy", "Could not locate the ID of the Gatligator.");
return;
}
// Change this item ID check to check for -1048576. This will never occur.
cursor.Next.Operand = -1048576;
}
#endregion
#region Prevention of Slime Rain Spawns When Near Bosses
private static void PreventBossSlimeRainSpawns(On_NPC.orig_SlimeRainSpawns orig, int plr)
{
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class AlchemicalFlask : ModItem, ILocalizedModType
public class AlchemicalDecanter : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
File renamed without changes.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 489 B

+2 -2
View File
@@ -13,8 +13,8 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int LightningSpawnPercent = 6;
public static float LightningDamageMult = 4f;
public static int LightningSpawnPercent = 5;
public static float LightningDamageMult = 3f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(LightningSpawnPercent, LightningDamageMult);
public override void SetDefaults()
-4
View File
@@ -18,12 +18,8 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().dodgeScarf;
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetDamage<TrueMeleeDamageClass>() += 0.1f;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.dodgeScarf = true;
modPlayer.DashID = CounterScarfDash.ID;
-3
View File
@@ -20,11 +20,8 @@ namespace CalamityMod.Items.Accessories
Item.Calamity().donorItem = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().dodgeScarf;
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetDamage<TrueMeleeDamageClass>() += 0.15f;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.dodgeScarf = true;
modPlayer.evasionScarf = true;
+1 -2
View File
@@ -9,8 +9,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 3;
public static int DefenseBoost = 4;
public static float DamageReductionBoost = 0.04f;
public static int DefenseBoost = 5;
public static float SummonDamageBoost = 0.1f;
public override void SetDefaults()
+2 -2
View File
@@ -32,8 +32,8 @@ namespace CalamityMod.Items.Accessories
Item.width = 82;
Item.height = 62;
Item.defense = 5;
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.accessory = true;
Item.SetRevExclusive();
}
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Items.Accessories
public static int RegenBoost = 2;
public static int DefenseBoost = 10;
public static float DamageReductionBoost = 0.05f;
public static float SummonDamageBoost = 0.1f;
public override void SetStaticDefaults()
+1 -1
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 2;
public static int DefenseBoost = 4;
public static int DefenseBoost = 3;
public static float SummonDamageBoost = 0.1f;
public override void SetDefaults()
-1
View File
@@ -39,7 +39,6 @@ namespace CalamityMod.Items.Accessories
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
modPlayer.amalgam = true;
player.brainOfConfusionItem = Item;
player.GetDamage<GenericDamageClass>() += 0.1f;
modPlayer.HeatDebuffMultiplier += 2f;
modPlayer.ColdDebuffMultiplier += 2f;
modPlayer.SicknessDebuffMultiplier += 2f;
@@ -5,7 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class CorruptFlask : ModItem, ILocalizedModType
public class UnholyTonic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 850 B

@@ -2,7 +2,9 @@
using CalamityMod.Items.BaseItems;
using CalamityMod.Rarities;
using Terraria;
using Terraria.GameContent.NetModules;
using Terraria.ModLoader;
using Terraria.Net;
namespace CalamityMod.Items.Accessories.Vanity
{
@@ -47,5 +49,22 @@ namespace CalamityMod.Items.Accessories.Vanity
modPlayer.XykVisualsBlue = true;
}
}
// Also research the other variant
public override void OnResearched(bool fullyResearched)
{
if (fullyResearched)
{
if (!Main.ServerSideCharacter)
{
Main.LocalPlayerCreativeTracker.ItemSacrifices.RegisterItemSacrifice(ModContent.ItemType<XyksBlessingOrange>(), 1);
}
else
{
NetPacket packet = NetCreativeUnlocksPlayerReportModule.SerializeSacrificeRequest(ModContent.ItemType<XyksBlessingOrange>(), 1);
NetManager.Instance.SendToServerOrLoopback(packet);
}
}
}
}
}
@@ -2,7 +2,9 @@
using CalamityMod.Items.BaseItems;
using CalamityMod.Rarities;
using Terraria;
using Terraria.GameContent.NetModules;
using Terraria.ModLoader;
using Terraria.Net;
namespace CalamityMod.Items.Accessories.Vanity
{
@@ -47,5 +49,22 @@ namespace CalamityMod.Items.Accessories.Vanity
modPlayer.XykVisualsOrange = true;
}
}
// Also research the other variant
public override void OnResearched(bool fullyResearched)
{
if (fullyResearched)
{
if (!Main.ServerSideCharacter)
{
Main.LocalPlayerCreativeTracker.ItemSacrifices.RegisterItemSacrifice(ModContent.ItemType<XyksBlessingBlue>(), 1);
}
else
{
NetPacket packet = NetCreativeUnlocksPlayerReportModule.SerializeSacrificeRequest(ModContent.ItemType<XyksBlessingBlue>(), 1);
NetManager.Instance.SendToServerOrLoopback(packet);
}
}
}
}
}
@@ -5,7 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class CrimsonFlask : ModItem, ILocalizedModType
public class ViciousTonic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 892 B

After

Width:  |  Height:  |  Size: 892 B

+1 -1
View File
@@ -93,7 +93,7 @@ namespace CalamityMod.Items.Accessories
{
modNPC.warbannerBurnIntensity = intensity;
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(37 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(15 * 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;
+321 -9
View File
@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CalamityMod.DataStructures;
using CalamityMod.Items.Materials;
using CalamityMod.Packets;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent.UI;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,7 +25,6 @@ namespace CalamityMod.Items.Accessories
public static readonly SoundStyle GrabSound = new("CalamityMod/Sounds/Custom/WulfrumHookGrapple") { Volume = 0.7f, MaxInstances = 1, SoundLimitBehavior = SoundLimitBehavior.ReplaceOldest };
public static readonly SoundStyle ReleaseSound = new("CalamityMod/Sounds/Custom/WulfrumHookDisengage") { Volume = 0.7f, MaxInstances = 1, SoundLimitBehavior = SoundLimitBehavior.ReplaceOldest };
public override void SetDefaults()
{
Item.width = 20;
@@ -33,6 +34,11 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Blue;
}
public override bool CanUseItem(Player player)
{
return player.TryGetModPlayer<WulfrumPackPlayer>(out var mp) && mp.hookCooldown <= 0;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.moveSpeed += 0.08f;
@@ -73,6 +79,7 @@ namespace CalamityMod.Items.Accessories
}
//Prevent players with a wulfrum pack to spawn any non-wulfrum hooks.
/*
public override void OnSpawn(Projectile projectile, IEntitySource source)
{
Player owner = Main.player[projectile.owner];
@@ -80,7 +87,7 @@ namespace CalamityMod.Items.Accessories
{
projectile.active = false;
}
}
}*/
}
public class WulfrumPackPlayer : ModPlayer
@@ -226,6 +233,104 @@ namespace CalamityMod.Items.Accessories
public bool PlayerOnGround => Collision.SolidCollision(Player.position + Vector2.UnitY * 2f * Player.gravDir, Player.width, Player.height, false);
public override void Load()
{
base.Load();
// On_Player.QuickGrapple_GetItemToUse += QuickGrapple_GetItemToUse_PrioritizeAcrobaticsPack;
On_Player.QuickGrapple += QuickGrapple_UseCustomGrapple;
}
private static void QuickGrapple_UseCustomGrapple(On_Player.orig_QuickGrapple orig, Player self)
{
if (!self.TryGetModPlayer<WulfrumPackPlayer>(out var mp) || !mp.WulfrumPackEquipped)
{
orig(self);
return;
}
if (mp.hookCooldown > 0)
{
return;
}
if (self.frozen || self.tongued || self.webbed || self.stoned || self.dead)
{
return;
}
if (PlayerInput.GrappleAndInteractAreShared)
{
if (Main.HoveringOverAnNPC || Main.SmartInteractShowingGenuine || Main.SmartInteractShowingFake || (WiresUI.Settings.DrawToolModeUI && PlayerInput.UsingGamepad))
{
return;
}
var ctrlTile = self.controlUseTile;
var ctrlItem = self.controlUseItem;
if (!ctrlTile && !ctrlItem)
{
return;
}
var tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY);
if ((tile.HasTile && (tile.TileType is 4 or 33 or 372 or 174 or 646 or 49)) || (self.HeldItem.type == ItemID.PortalGun && PlayerInput.UsingGamepad))
{
return;
}
}
if (self.noItems)
{
return;
}
if (self.mount.Active)
{
self.mount.Dismount(self);
}
self.UpdateBlacklistedTilesForGrappling();
foreach (var proj in Main.ActiveProjectiles)
{
if (proj.owner != self.whoAmI || proj.aiStyle != ProjAIStyleID.Hook || proj.type == ProjectileType<WulfrumHook>())
{
continue;
}
proj.Kill();
}
if (Main.projectile.Count(n => n.active && n.owner == self.whoAmI && n.type == ProjectileType<WulfrumHook>()) <= 1)
{
SoundEngine.PlaySound(WulfrumAcrobaticsPack.ShootSound, self.Center);
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
Vector2 velocity = (Main.MouseWorld - self.Center).SafeNormalize(Vector2.One) * mp.ActualLaunchVelocity;
Projectile.NewProjectile(self.GetSource_ItemUse(mp.PackItem), self.Center, velocity, ProjectileType<WulfrumHook>(), 0, 0, self.whoAmI);
float angleToRightBelow = velocity.AngleBetween(Vector2.UnitY);
if (angleToRightBelow < MathHelper.PiOver2) //Put a cooldown on hooking down below.
{
int extraCooldown = (int)(Utils.GetLerpValue(MathHelper.PiOver2, 0f, angleToRightBelow) * 15); //Get more cooldown the straightest down youre aiming
mp.hookCooldown = 15 + extraCooldown;
}
}
}
/*
private static Item QuickGrapple_GetItemToUse_PrioritizeAcrobaticsPack(On_Player.orig_QuickGrapple_GetItemToUse orig, Player self)
{
if (self.TryGetModPlayer<WulfrumPackPlayer>(out var mPlayer) && mPlayer.WulfrumPackEquipped && mPlayer.PackItem is not null)
{
return mPlayer.PackItem;
}
return orig(self);
}
*/
public override void ResetEffects()
{
WulfrumPackEquipped = false;
@@ -281,7 +386,7 @@ namespace CalamityMod.Items.Accessories
}
hookCache = -1;
if (!obeyGravity)
if (!obeyGravity)
{
Player.gravity = -1f; //Disable player gravity with Anti-Grav hook
}
@@ -355,7 +460,7 @@ namespace CalamityMod.Items.Accessories
Player.velocity.X = Player.velocity.X == 0 ? 1.5f : 1.5f * Math.Sign(Player.velocity.X);
}
}
else
{
if (Player.grappling[0] > -1)
@@ -363,7 +468,7 @@ namespace CalamityMod.Items.Accessories
var Hook = Main.projectile[Player.grappling[0]];
if (Hook != null)
{
if (Player.controlRight)
Player.velocity.X += 0.3f;
else if (Player.controlLeft)
@@ -380,7 +485,7 @@ namespace CalamityMod.Items.Accessories
var dis = Hook.Center.Distance(estimatedPos);
if (dis > SwingLength && dis < 1000f)
{
var dis2 = Math.Min(Player.Center.Distance(goalPos), SwingLength*3f);
var dis2 = Math.Min(Player.Center.Distance(goalPos), SwingLength * 3f);
if (dis2 > 0)
{
Player.velocity = Player.Center.DirectionTo(goalPos) * dis2;
@@ -529,7 +634,8 @@ namespace CalamityMod.Items.Accessories
if (!WulfrumPackEquipped)
return;
//Shoot a new hook
//Shoot a new hook
/*
if (triggersSet.Grapple && Player.releaseHook)
{
//Clear any previous non-wulfrum hooks / Any hooks that just got shot (should already be handled by the global proj
@@ -560,11 +666,16 @@ namespace CalamityMod.Items.Accessories
}
}
}
*/
bool setControlUpFalse = false;
if (Grappled && triggersSet.Up)
{
SwingLength -= (strongerReel ? StaticHookReelSpeed : ReelSpeed);
Player.controlUp = false; //This is required to stop the player from bouncing off platforms when falling down and reeling in. Also prevents gravity swapping while hooked.
setControlUpFalse = true;
}
if (triggersSet.Down) //Static Hook doesn't effect this speed because it would be faster than your fall speed and feel janky.
{
float length = ActualMaxLength;
@@ -575,9 +686,12 @@ namespace CalamityMod.Items.Accessories
SwingLength = length;
}
}
//Jumping out of the hook
if (triggersSet.Jump && Player.releaseJump)
{
var syncData = new WulfrumAcrobaticsJumpSync.Data();
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.owner != Player.whoAmI || p.type != ProjectileType<WulfrumHook>())
@@ -586,10 +700,11 @@ namespace CalamityMod.Items.Accessories
//Only clear hooks that are attached to stuff
if (p.ModProjectile is WulfrumHook claw && claw.State == WulfrumHook.HookState.Grappling)
{
float angleToUpright = (Player.Center - p.Center).AngleBetween(-Vector2.UnitY);
bool canJumpOffHook = angleToUpright > MathHelper.PiOver2 || Player.Distance(p.Center) < 38;// Don't do any jump stuff if the player is jumping from above the hook.
syncData = syncData with { CanJumpOffHook = canJumpOffHook };
if (canJumpOffHook)
{
Vector2 velocityBoost = Vector2.Zero;
@@ -630,6 +745,28 @@ namespace CalamityMod.Items.Accessories
}
}
if (Main.netMode == NetmodeID.MultiplayerClient)
{
WulfrumAcrobaticsJumpSync.Send(
syncData with
{
PlayerWhoAmI = (byte)Player.whoAmI,
SwingLength = SwingLength,
PlayerVelocity = Player.velocity,
PlayerJump = Player.jump,
SetControlUpFalse = setControlUpFalse,
}
);
}
}
else
{
if (Main.netMode == NetmodeID.MultiplayerClient)
{
WulfrumAcrobaticsLengthSync.Send(
new WulfrumAcrobaticsLengthSync.Data((byte)Player.whoAmI, SwingLength, setControlUpFalse)
);
}
}
}
@@ -646,4 +783,179 @@ namespace CalamityMod.Items.Accessories
}
}
}
internal sealed class WulfrumAcrobaticsSync : CalamityPacket
{
public static WulfrumAcrobaticsSync Instance { get; private set; }
public static void Send(Player player, WulfrumPackPlayer mPlayer, Projectile proj, int toClient = -1, int ignoreClient = -1)
{
Send(
(byte)player.whoAmI,
mPlayer.SwingLength,
mPlayer.OldPosition,
proj.Center,
(byte)proj.whoAmI
);
}
private static void Send(
byte playerWhoAmI,
float swingLength,
Vector2 playerOldPos,
Vector2 projCenter,
byte projWhoAmI,
int toClient = -1,
int ignoreClient = -1
)
{
var packet = Instance.CreateBasePacket();
packet.Write(playerWhoAmI);
packet.Write(swingLength);
packet.WriteVector2(playerOldPos);
packet.WriteVector2(projCenter);
packet.Write(projWhoAmI);
packet.Send(toClient, ignoreClient);
}
public override void HandlePacket(BinaryReader packet, int sender)
{
var playerWhoAmI = packet.ReadByte();
var swingLength = packet.ReadSingle();
var playerOldPos = packet.ReadVector2();
var projCenter = packet.ReadVector2();
var projWhoAmI = packet.ReadByte();
if (Main.player[playerWhoAmI].TryGetModPlayer<WulfrumPackPlayer>(out var mPlayer))
{
mPlayer.SwingLength = swingLength;
mPlayer.OldPosition = playerOldPos;
mPlayer.SetSegments(projCenter);
mPlayer.Grapple = projWhoAmI;
}
if (Main.netMode == NetmodeID.Server)
{
Send(
playerWhoAmI,
swingLength,
playerOldPos,
projCenter,
projWhoAmI,
ignoreClient: sender
);
}
}
}
internal sealed class WulfrumAcrobaticsJumpSync : CalamityPacket
{
public readonly record struct Data(
byte PlayerWhoAmI,
float SwingLength,
bool CanJumpOffHook,
Vector2 PlayerVelocity,
int PlayerJump,
bool SetControlUpFalse
);
public static WulfrumAcrobaticsJumpSync Instance { get; private set; }
public static void Send(Data data, int toClient = -1, int ignoreClient = -1)
{
var packet = Instance.CreateBasePacket();
packet.Write(data.PlayerWhoAmI);
packet.Write(data.SwingLength);
packet.Write(data.CanJumpOffHook);
packet.WriteVector2(data.PlayerVelocity);
packet.Write(data.PlayerJump);
packet.Write(data.SetControlUpFalse);
packet.Send(toClient, ignoreClient);
}
public override void HandlePacket(BinaryReader packet, int sender)
{
var playerWhoAmI = packet.ReadByte();
var swingLength = packet.ReadSingle();
var canJumpOffHook = packet.ReadBoolean();
var playerVelocity = packet.ReadVector2();
var playerJump = packet.ReadInt32();
var setControlUpFalse = packet.ReadBoolean();
var player = Main.player[playerWhoAmI];
if (player.TryGetModPlayer<WulfrumPackPlayer>(out var mPlayer))
{
mPlayer.SwingLength = swingLength;
}
if (canJumpOffHook)
{
player.jump = playerJump;
player.velocity = playerVelocity;
}
else
{
player.releaseJump = false;
}
if (setControlUpFalse)
{
player.controlUp = false;
}
if (Main.netMode == NetmodeID.Server)
{
Send(
new Data(playerWhoAmI, swingLength, canJumpOffHook, playerVelocity, playerJump, setControlUpFalse),
ignoreClient: sender
);
}
}
}
internal sealed class WulfrumAcrobaticsLengthSync : CalamityPacket
{
public readonly record struct Data(
byte PlayerWhoAmI,
float SwingLength,
bool SetControlUpFalse
);
public static WulfrumAcrobaticsLengthSync Instance { get; private set; }
public static void Send(Data data, int toClient = -1, int ignoreClient = -1)
{
var packet = Instance.CreateBasePacket();
packet.Write(data.PlayerWhoAmI);
packet.Write(data.SwingLength);
packet.Write(data.SetControlUpFalse);
packet.Send(toClient, ignoreClient);
}
public override void HandlePacket(BinaryReader packet, int sender)
{
var playerWhoAmI = packet.ReadByte();
var swingLength = packet.ReadSingle();
var setControlUpFalse = packet.ReadBoolean();
var player = Main.player[playerWhoAmI];
if (player.TryGetModPlayer<WulfrumPackPlayer>(out var mPlayer))
{
mPlayer.SwingLength = swingLength;
}
if (setControlUpFalse)
{
player.controlUp = false;
}
if (Main.netMode == NetmodeID.Server)
{
Send(
new Data(playerWhoAmI, swingLength, setControlUpFalse),
ignoreClient: sender
);
}
}
}
}
@@ -50,7 +50,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer
{
CreateRecipe().
AddIngredient(ItemID.BeeBreastplate).
AddIngredient<AlchemicalFlask>(2).
AddIngredient<AlchemicalDecanter>(2).
AddIngredient<InfectedArmorPlating>(7).
AddIngredient<PlagueCellCanister>(7).
AddTile(TileID.MythrilAnvil).
+1 -71
View File
@@ -483,76 +483,6 @@ namespace CalamityMod.Items
}
}
// 23APR2025: Ozzatron: make late game vanilla guns significantly more accurate
// Currently applies to Gatligator, Tactical Shotgun and Chain Gun
#region Vanilla Item Shoot Overrides
if (item.type == ItemID.Gatligator)
{
// Vanilla Gatligator: X/Y velocity += -2 to 2 in steps of 0.05 (-40 to 40 x 0.05)
// Calamity Gatligator: Velocity gets randomly rotated by up to 0.05 radians and multiplied by 0.87 to 1.13
// This logic is lifted from Onyxia
//
// Gatligator has an additional inaccuracy effect where bullets have a 1 in 3 chance to have their velocity totally fucked
// When this happens, the X and Y components of the velocity are multiplied by 0.4 to 1.6, with separate random calls for each
// This has been replicated by giving bullets a 1 in 3 chance to go much faster, but be more inaccurate
//
// Vanilla Gatligator gets additional hardcoded inaccuracy to produce the gun jittering visual
// Extra inaccuracy: X/Y velocity += -1.5 to 1.5 in steps of 0.03 (-50 to 50 x 0.03)
// This is IL edited out
Vector2 spreadVel;
if (Main.rand.NextBool(3)) // Xtra Inaccurate
{
float radianInaccuracy = 0.09f;
float randAngle = Main.rand.NextFloat(-radianInaccuracy, radianInaccuracy);
float randVelMultiplier = Main.rand.NextFloat(1.3f, 1.63f);
spreadVel = velocity.RotatedBy(randAngle) * randVelMultiplier;
}
else
{
float radianInaccuracy = 0.05f;
float randAngle = Main.rand.NextFloat(-radianInaccuracy, radianInaccuracy);
float randVelMultiplier = Main.rand.NextFloat(0.87f, 1.13f);
spreadVel = velocity.RotatedBy(randAngle) * randVelMultiplier;
}
Projectile.NewProjectile(source, position, spreadVel, type, damage, knockBack, player.whoAmI);
return false;
}
if (item.type == ItemID.TacticalShotgun)
{
// Vanilla Tactical Shotgun: X/Y velocity += -2 to 2 in steps of 0.05 (-40 to 40 x 0.05)
// Calamity Tactical Shotgun: Velocity gets a random vector of magnitude 0-1 added to it, anywhere on the unit circle
int tacticalShotgunNumBullets = 6;
for (int i = 0; i < tacticalShotgunNumBullets; i++)
{
Vector2 spreadVel = velocity + Main.rand.NextVector2Circular(0.5f, 0.5f);
Projectile.NewProjectile(source, position, spreadVel, type, damage, knockBack, player.whoAmI);
}
return false;
}
if (item.type == ItemID.ChainGun)
{
// Vanilla Chain Gun: X/Y velocity += -1.2 to 1.2 in steps of 0.03 (-40 to 40 x 0.03)
// Calamity Chain Gun: Velocity gets randomly rotated by up to 0.035 radians and multiplied by 0.92 to 1.08
// This logic is lifted from Onyxia
//
// Vanilla Chain Gun gets additional hardcoded accuracy to produce the gun jittering visual
// Extra inaccuracy: X/Y velocity += -1.5 to 1.5 in steps of 0.03 (-50 to 50 x 0.03)
// This is IL edited out
float radianInaccuracy = 0.035f;
float randAngle = Main.rand.NextFloat(-radianInaccuracy, radianInaccuracy);
float randVelMultiplier = Main.rand.NextFloat(0.92f, 1.08f);
Vector2 spreadVel = velocity.RotatedBy(randAngle) * randVelMultiplier;
Projectile.NewProjectile(source, position, spreadVel, type, damage, knockBack, player.whoAmI);
return false;
}
#endregion
return true;
}
#endregion
@@ -1056,7 +986,7 @@ namespace CalamityMod.Items
player.endurance -= 0.12f;
// Solar Flare armor dash overrides modded dashes by default
if (player.solarShields > 0 || player.wingsLogic == (int)VanillaWingID.WingsSolar)
if (player.solarShields > 0)
modPlayer.DashID = string.Empty;
}
}
+31 -2
View File
@@ -28,6 +28,7 @@ using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.UI.Chat;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Items
{
@@ -151,8 +152,8 @@ namespace CalamityMod.Items
WhipAutomaticTooltips(item, tooltips, ref lastTooltipIndex);
// In GFB, replace all instances of "rogue" with "rouge".
string[] rogueKey = new string[] { CalamityUtils.GetTextValue($"Misc.GFBRogueUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRogueLowercase") };
string[] rougeKey = new string[] { CalamityUtils.GetTextValue($"Misc.GFBRougeUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRougeLowercase") };
string[] rogueKey = [CalamityUtils.GetTextValue($"Misc.GFBRogueUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRogueLowercase")];
string[] rougeKey = [CalamityUtils.GetTextValue($"Misc.GFBRougeUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRougeLowercase")];
for (int n = 0; n < rogueKey.Length; n++)
{
if (Main.zenithWorld && rogueKey[n] != "")
@@ -1635,7 +1636,35 @@ namespace CalamityMod.Items
return false;
}
// IV Drip tooltip FX
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<IVDripOnTheRocks>() && line.Name == "Tooltip4")
{
Vector2 basePosition = new Vector2(line.X, line.Y);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix);
for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement.
{
float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f;
float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f);
float radius = timer * (3f + i * 6f);
Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern
Vector2 pos = basePosition + offset;
Color color = MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White);
float opacity = 1f - (i * 0.2f);
float rotation = line.Rotation + (timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, pos, color * opacity, rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
}
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
return false;
}
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<OntologicalDespoiler>() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7"))
{
Color rarityColor = Color.Black;
+1 -1
View File
@@ -156,7 +156,7 @@ namespace CalamityMod.Items
{ ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) },
{ ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) },
{ ItemID.Marrow, Do(DamageExact(60)) },
{ ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) },
{ ItemID.MedusaHead, Do(ManaExact(6), DamageExact(75)) },
{ ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) },
{ ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) },
{ ItemID.MiniNukeI, Do(DamageExact(90)) },
+4
View File
@@ -13,6 +13,10 @@ namespace CalamityMod.Items.Dyes
{
public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(Mod.Assets.Request<Effect>("Effects/Dyes/TarragonDyeShader"), "DyePass").
UseColor(new Color(20, 117, 70)).UseSecondaryColor(new Color(28, 255, 55)).UseImage(Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Bark"));
public override void SafeSetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
}
public override void SafeSetDefaults()
{
+2 -2
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Fishing
public virtual LocalizedText Location => LocalizedText.Empty;
public new string LocalizationCategory => "Items.Fishing";
public override LocalizedText Tooltip => Location;
public override LocalizedText Tooltip => CalamityUtils.GetText($"Items.Fishing.LocationTooltip").WithFormatArgs(Location);
public override void SetStaticDefaults()
{
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Fishing
public override void AnglerQuestChat(ref string description, ref string catchLocation)
{
description = this.GetLocalizedValue("QuestDescription");
catchLocation = Location.ToString().Replace("'", string.Empty);
catchLocation = Location.ToString();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Tiles.Crags;
using Terraria;
using Terraria.ID;
@@ -49,6 +50,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
// This is our equivalent to Souls of Light/Night
itemLoot.Add(ModContent.ItemType<EssenceofHavoc>(), 2, 2, 5);
// Slagfire Douser @ 10%
itemLoot.Add(ModContent.ItemType<SlagfireDouser>(), 10, 1, 1);
itemLoot.AddBiomeCrateLootRules();
}
}
@@ -1,4 +1,6 @@
using CalamityMod.Tiles.Crags;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Tiles.Crags;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,6 +36,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
// This is our equivalent to Bamboo
itemLoot.Add(ModContent.ItemType<Placeables.Crags.ScorchedBone>(), 3, 20, 50);
// Slagfire Douser @ 10%
itemLoot.Add(ModContent.ItemType<SlagfireDouser>(), 10, 1, 1);
itemLoot.AddBiomeCrateLootRules(false);
}
}
+2 -2
View File
@@ -12,12 +12,12 @@ namespace CalamityMod.Items.Potions.Alcohol
{
public new string LocalizationCategory => "Items.Potions";
public static float CritLoss = 10;
public static float CritLoss = 75;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss);
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
Item.ResearchUnlockCount = 20;
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
new Color(36, 2, 41),
new Color(56, 0, 64),
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
Item.ResearchUnlockCount = 20;
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
new Color(219, 227, 191),
new Color(186, 189, 147),
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
Item.ResearchUnlockCount = 20;
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
new Color(54, 5, 21),
new Color(82, 9, 36),
+2 -2
View File
@@ -36,8 +36,8 @@ namespace CalamityMod.Items.Potions.Alcohol
}
public override void AddRecipes()
{
CreateRecipe(6).
AddIngredient(ItemID.BottledWater, 6).
CreateRecipe(10).
AddIngredient(ItemID.Bottle, 10).
AddIngredient<PurifiedGel>(10).
AddIngredient<StarblightSoot>(10).
AddTile(TileID.Kegs).
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions.Alcohol
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
Item.ResearchUnlockCount = 20;
// Clear, yellow-green
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
new Color(242, 252, 177, 180),
+3 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Items.Tools;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -11,6 +12,7 @@ namespace CalamityMod.Items.Potions.Food
public new string LocalizationCategory => "Items.Potions";
public override void SetStaticDefaults()
{
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<DisgustingMeat>();
Item.ResearchUnlockCount = 5;
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(int.MaxValue, 3));
ItemID.Sets.FoodParticleColors[Type] = new Color[2] {
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.PermanentBoosters;
using CalamityMod.Items.Potions.Food;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,9 +10,13 @@ namespace CalamityMod.Items.Tools
{
public new string LocalizationCategory => "Items.Tools";
public override void SetStaticDefaults()
{
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<DeliciousMeat>();
}
public override void SetDefaults()
{
Item.DefaultToFood(32, 30, 0, 0);
Item.DefaultToFood(26, 36, 0, 0);
Item.value = 0;
Item.UseSound = SoundID.NPCDeath13;
Item.maxStack = 1;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -54,7 +54,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.3, FlareDamageSoftcap);
Vector2 flareSpawnPosition = victim.Center + Main.rand.NextVector2Circular(10f, 10f);
Projectile.NewProjectile(owner.GetSource_ItemUse(owner.HeldItem), flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType<MythrilFlare>(), flareDamage, 0f, owner.whoAmI);
Projectile.NewProjectile(owner.GetSource_OnHit(victim), flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType<MythrilFlare>(), flareDamage, 0f, owner.whoAmI);
}
}
}
@@ -41,10 +41,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<GalvanizingGlaiveProjectile>();
Item.shootSpeed = 21f;
modItem.UsesCharge = true;
modItem.MaxCharge = 135f;
modItem.ChargePerUse = 0.075f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
@@ -46,9 +46,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<HolofibreImmolatorHoldout>();
Item.shootSpeed = 12f;
}
public override bool AltFunctionUse(Player player) => true;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
public override void HoldItem(Player player)
{
if (Main.myPlayer == player.whoAmI)
player.Calamity().rightClickListener = true;
player.Calamity().mouseWorldListener = true;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow").Value);
@@ -12,8 +12,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public class HydraulicVoltCrasher : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
// This is the amount of charge consumed every frame the holdout projectile is summoned, i.e. the weapon is in use.
public const float HoldoutChargeUse = 0.002f;
public override void SetStaticDefaults()
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
@@ -43,10 +41,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.noUseGraphic = true;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.channel = true;
modItem.UsesCharge = true;
modItem.MaxCharge = 85f;
modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile.
}
public override bool AltFunctionUse(Player player) => true;
@@ -62,7 +56,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
Item.hammer = 100;
}
return player.ownedProjectileCounts[Item.shoot] <= 0 && Item.Calamity().Charge > 0;
return player.ownedProjectileCounts[Item.shoot] <= 0;
}
public override void HoldItem(Player player)
{
@@ -36,11 +36,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<MountedScannerSummon>();
Item.shootSpeed = 1f;
modItem.UsesCharge = true;
modItem.MaxCharge = 85f;
modItem.ChargePerUse = 0.85f;
modItem.ChargePerAltUse = 0f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -9
View File
@@ -20,10 +20,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public const float SizeChargeThreshold = 0.25f;
// The small sword barely affects damage on its own because damage is already dropping significantly at low charge.
public const float SmallDamageMultiplier = 0.9f;
// This is the amount of charge consumed every frame the holdout projectile is summoned, i.e. the weapon is in use.
public const float HoldoutChargeUse = 0.005f;
// This is the amount of charge consumed every time a sword beam is fired.
public const float SwordBeamChargeUse = 0.1f;
public override void SetDefaults()
{
@@ -50,13 +46,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<PhaseslayerProjectile>();
Item.channel = true;
modItem.UsesCharge = true;
modItem.MaxCharge = 250f;
modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile.
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && Item.Calamity().Charge > 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
@@ -47,11 +47,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<PlasmaCasterShot>();
Item.shootSpeed = 5f;
modItem.UsesCharge = true;
modItem.MaxCharge = 190f;
modItem.ChargePerUse = 0.32f;
modItem.ChargePerAltUse = 0.12f; // turbo mode is more energy inefficient
}
public override bool AltFunctionUse(Player player) => true;
@@ -42,10 +42,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<PlasmaGrenadeProjectile>();
Item.shootSpeed = 11f;
Item.DamageType = RogueDamageClass.Instance;
modItem.UsesCharge = true;
modItem.MaxCharge = 250f;
modItem.ChargePerUse = 0.2f;
}
public override float StealthVelocityMultiplier => 1.2f;
@@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<PoleWarperSummon>();
Item.shootSpeed = 10f;
Item.DamageType = DamageClass.Summon;
modItem.UsesCharge = true;
modItem.MaxCharge = 250f;
modItem.ChargePerUse = 1f;
modItem.ChargePerAltUse = 0f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack)
@@ -36,10 +36,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.channel = true;
Item.shoot = ModContent.ProjectileType<PulseDragonProjectile>();
Item.shootSpeed = 20f;
modItem.UsesCharge = true;
modItem.MaxCharge = 190f;
modItem.ChargePerUse = 0.32f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack)
@@ -36,11 +36,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
Item.rare = ItemRarityID.Yellow;
modItem.UsesCharge = true;
modItem.MaxCharge = 135f;
modItem.ChargePerUse = 1f;
modItem.ChargePerAltUse = 0f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
@@ -40,12 +40,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<SnakeEyesSummon>();
Item.DamageType = DamageClass.Summon;
CalamityGlobalItem modItem = Item.Calamity();
modItem.UsesCharge = true;
modItem.MaxCharge = 190f;
modItem.ChargePerUse = 1f;
modItem.ChargePerAltUse = 0f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
@@ -19,8 +19,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 42;
Item.height = 36;
Item.damage = 45;
@@ -38,10 +36,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shootSpeed = 16f;
Item.shoot = ModContent.ProjectileType<SystemBaneProjectile>();
modItem.UsesCharge = true;
modItem.MaxCharge = 135f;
modItem.ChargePerUse = 0.085f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < MaxDeployedProjectiles;
@@ -21,8 +21,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 78;
Item.height = 28;
Item.DamageType = DamageClass.Magic;
@@ -41,10 +39,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<TeslaCannonShot>();
Item.shootSpeed = 5f;
modItem.UsesCharge = true;
modItem.MaxCharge = 250f;
modItem.ChargePerUse = 0.7f;
}
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
@@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<CosmicPurple>();
modItem.donorItem = true;
modItem.UsesCharge = true;
modItem.MaxCharge = 250f;
modItem.ChargePerUse = 0.3f;
modItem.ChargePerAltUse = 0.15f;
}
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4);
@@ -18,8 +18,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 26;
Item.height = 44;
Item.damage = 75;
@@ -37,10 +35,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
modItem.UsesCharge = true;
modItem.MaxCharge = 190f;
modItem.ChargePerUse = 0.5f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+3 -3
View File
@@ -26,9 +26,9 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 52;
Item.height = 74;
Item.damage = 270;
Item.damage = 125;
Item.DamageType = DamageClass.Magic;
Item.mana = 6;
Item.mana = 12;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Magic
var p = Main.projectile.First(x => x.type == ModContent.ProjectileType<DracoConstellation>() && x.active && x.owner == player.whoAmI);
p.timeLeft = (int)MathHelper.Min(p.timeLeft, 60);
} else
Projectile.NewProjectile(source, player.Center + new Vector2(-125,-100), -Vector2.Zero, ModContent.ProjectileType<DracoConstellation>(), damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, player.Center + new Vector2(-125,-100), -Vector2.Zero, ModContent.ProjectileType<DracoConstellation>(), (int)(damage * 3.5f), knockback, player.whoAmI);
return false;
}
var mousePos = player.Calamity().mouseWorld;
+1 -1
View File
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.Calamity().mouseRight && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
SoundEngine.PlaySound(buff with { Volume = 0.95f }, player.Center);
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.Calamity().mouseRight && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
SoundEngine.PlaySound(buff with { Volume = 0.95f }, player.Center);
+1 -1
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.Calamity().mouseRight && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
SoundEngine.PlaySound(buff with { Volume = 0.95f }, player.Center);
+2 -2
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 44;
Item.height = 44;
Item.useStyle = ItemUseStyleID.Rapier;
Item.damage = 202;
Item.damage = 600;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 8;
Item.knockBack = 10f;
@@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
if (player.altFunctionUse == 2)
{
Projectile.NewProjectile(source,position,velocity,ModContent.ProjectileType<GalileoGladiusThrown>(),damage,knockback,player.whoAmI);
Projectile.NewProjectile(source,position,velocity*2,ModContent.ProjectileType<GalileoGladiusThrown>(),damage,knockback,player.whoAmI);
return false;
}
return base.Shoot(player, source, position, velocity, type, damage, knockback);
+5 -1
View File
@@ -2,6 +2,7 @@
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee
public class GeliticBlade : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/GeliticBladeSwing", 2);
public override void SetDefaults()
{
Item.width = 44;
@@ -21,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 5.25f;
Item.UseSound = SoundID.Item1;
Item.UseSound = UseSound;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
+3 -5
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 74;
Item.height = 94;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 196;
Item.damage = 234;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 20;
Item.shootSpeed = 10f;
@@ -36,10 +36,8 @@ namespace CalamityMod.Items.Weapons.Melee
base.SetDefaults();
}
public override bool AltFunctionUse(Player player)
{
return true;
}
// You can only use the right-click if you have sufficient Elemental Mastery
public override bool AltFunctionUse(Player player) => player.Calamity().elementalMastery >= 100;
public override void HoldItem(Player player)
{
-8
View File
@@ -12,11 +12,6 @@ namespace CalamityMod.Items.Weapons.Ranged
public class FreedomStar : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
// This is the amount of charge consumed every time the holdout projectile fires various projectiles.
public const float HoldoutChargeUse_Orb = 0.004f;
public const float HoldoutChargeUse_OrbLarge = 0.005f;
public const float HoldoutChargeUse_Laser = 0.006f;
public const float HoldoutChargeUse_LaserLarge = 0.01f;
public override void SetDefaults()
{
@@ -38,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.UseSound = SoundID.Item75;
Item.shoot = ModContent.ProjectileType<FreedomStarHoldout>();
Item.shootSpeed = 12f;
modItem.UsesCharge = true;
modItem.MaxCharge = 150f;
modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile.
}
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
+4 -3
View File
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.Graphics;
using Terraria.ID;
using Terraria.ModLoader;
@@ -19,11 +20,11 @@ namespace CalamityMod.Items.Weapons.Ranged
public static readonly SoundStyle ShootSound = new("CalamityMod/Sounds/Item/HalleysInfernoShoot") { Volume = 0.68f };
public static readonly SoundStyle Hit = new("CalamityMod/Sounds/Item/HalleysInfernoHit") { Volume = 0.75f };
public static float MaxStarburstPerComet => 1;
public static float MaxStarburstPerStar => 0.5f;
public static float LostAccuracyPerMiss => 5;
public static float MaxStarburstPerStar => 0.25f;
public static float LostAccuracyPerMiss => 4;
public static float MaxAccuracy => 50;
public static float StarburstDmgMult => 1f;
public static float StarburstDmgMult => 1.25f;
public static float StarburstVelMult = 0.75f;
public override void SetDefaults()
+2 -1
View File
@@ -77,7 +77,8 @@ namespace CalamityMod.Items.Weapons.Ranged
holdout2.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
SoundStyle fire = new("CalamityMod/Sounds/Item/DudFire");
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = aiType == 20 ? -0.7f : (-0.5f + (shotType ? 0.5f : 0)) }, player.Center);
shotType = !shotType;
if (aiType != 20)
shotType = !shotType;
}
else
{
+50
View File
@@ -0,0 +1,50 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Weapons.Ranged
{
public class SlagfireDouser : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.width = 104;
Item.height = 34;
Item.damage = 10;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 30;
Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2f;
Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.95f, PitchVariance = 0.1f };
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.autoReuse = false; // Because holdout
Item.shoot = ModContent.ProjectileType<SlagfireDouserHoldout>();
Item.ArmorPenetration = 10;
Item.shootSpeed = 13f;
Item.reuseDelay = 0; // Because holdout
Item.channel = true; // Because holdout
Item.noUseGraphic = true;
}
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
public override Vector2? HoldoutOffset() => new Vector2(102, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ProjectileType<SlagfireDouserHoldout>(), damage, knockback, player.whoAmI);
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); // Aim toward mouse
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

+1 -6
View File
@@ -13,8 +13,6 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.damage = 620;
Item.DamageType = DamageClass.Ranged;
Item.useTime = Item.useAnimation = 180;
@@ -30,12 +28,9 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.useStyle = ItemUseStyleID.Shoot;
modItem.UsesCharge = true;
modItem.MaxCharge = 200f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0 && Item.Calamity().Charge > 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0;
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
-6
View File
@@ -15,8 +15,6 @@ namespace CalamityMod.Items.Weapons.Rogue
{
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 30;
Item.height = 34;
Item.damage = 2850;
@@ -38,10 +36,6 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.shoot = ModContent.ProjectileType<DynamicPursuerProjectile>();
Item.shootSpeed = 17f;
modItem.UsesCharge = true;
modItem.MaxCharge = 300f; // Tesla Cannon = 250f
modItem.ChargePerUse = 0.4f; // Tesla Cannon = 0.9f
}
public static float StealthDmgMult = 0.3f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers
public override float StealthDamageMultiplier => StealthDmgMult;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 20;
Item.height = 20;
Item.damage = 60;
Item.damage = 50;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.autoReuse = true;
+23 -7
View File
@@ -39,27 +39,43 @@ namespace CalamityMod.Items.Weapons.Summon
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float usedMinionSlots = 0;
foreach (var minions in Main.ActiveProjectiles)
{
if (minions.owner == player.whoAmI)
usedMinionSlots += minions.minionSlots;
}
bool hasSlotsForSummon = true;
if (usedMinionSlots + 1 > player.maxMinions)
hasSlotsForSummon = false;
player.AddBuff(Item.buffType, 2);
for (int i = 0; i < 3; i++)
int projCount = player.ownedProjectileCounts[type] + (hasSlotsForSummon ? 3 : 0);
if (hasSlotsForSummon)
{
var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1);
minion.originalDamage = Item.damage;
for (int i = 0; i < 3; i++)
{
var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1);
minion.originalDamage = Item.damage;
}
}
float angleMax = MathHelper.ToRadians(360f);
if (player.ownedProjectileCounts[type] == 1)
if (projCount == 100)
angleMax = 0f;
float index = 1f;
if (player.ownedProjectileCounts[Item.shoot] > 30)
if (projCount > 30)
{
angleMax += MathHelper.ToRadians((player.ownedProjectileCounts[Item.shoot] - 30) * 2.5f);
angleMax += MathHelper.ToRadians((projCount - 30) * 2.5f);
}
angleMax = angleMax > MathHelper.ToRadians(360f) ? MathHelper.ToRadians(360f) : angleMax; // More intuitive than using a min function
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == type && p.owner == player.whoAmI)
{
p.ai[1] = index / player.ownedProjectileCounts[type] * angleMax - angleMax / 2f;
int adjustedProjCount = (int)(projCount);
Main.NewText("index: " + index.ToString() + " | projCount: " + adjustedProjCount.ToString() + " | angleMax: " + angleMax.ToString());
p.ai[1] = index / adjustedProjCount * angleMax - angleMax / 2f;
p.netUpdate = true;
index++;
}
+15 -2
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon
// There's a long cooldown on commanding blades
// This is so you don't just hold down right click, since now it's optimal to only command blades when all are ready
if (player.altFunctionUse == 2)
return 0.1f;
return 0.37f;
else
return 1f;
}
@@ -57,6 +57,17 @@ namespace CalamityMod.Items.Weapons.Summon
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float usedMinionSlots = 0;
foreach (var minions in Main.ActiveProjectiles)
{
if (minions.owner == player.whoAmI)
usedMinionSlots += minions.minionSlots;
}
bool hasSlotsForSummon = true;
if (usedMinionSlots + 1 > player.maxMinions)
hasSlotsForSummon = false;
// Call all active blades to attack if they are charged
// The check to see if a blade is charged is done in the blade itself
if (player.altFunctionUse == 2)
@@ -89,7 +100,7 @@ namespace CalamityMod.Items.Weapons.Summon
SoundEngine.PlaySound(SoundID.Item101 with { Volume = 0.9f, Pitch = Main.rand.NextFloat(0.3f, 0.5f) }, player.Center);
}
}
else // Toss out the summon
else if (hasSlotsForSummon) // Toss out the summon
{
player.AddBuff(Item.buffType, 2);
SoundEngine.PlaySound(SoundID.Item1, player.Center);
@@ -117,6 +128,8 @@ namespace CalamityMod.Items.Weapons.Summon
}
}
}
return false;
}
public override void UseItemFrame(Player player) // Player hand animation when you command the blades
+7 -3
View File
@@ -11,6 +11,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
@@ -23,11 +24,14 @@ namespace CalamityMod.Items.Weapons.Typeless
public class StratusSphere : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Typeless";
public static readonly SoundStyle CastSound = new("CalamityMod/Sounds/Item/StratusSphereCast");
public static readonly SoundStyle LoopSound = new("CalamityMod/Sounds/Item/StratusSphereLoop");
public override void SetDefaults()
{
Item.width = 48;
Item.height = 30;
Item.damage = 500;
Item.damage = 400;
Item.DamageType = AverageDamageClass.Instance;
Item.useTime = 30;
Item.useAnimation = 30;
@@ -37,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Typeless
Item.knockBack = 5.5f;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.UseSound = SoundID.Item40;
Item.UseSound = CastSound;
Item.autoReuse = true;
Item.shootSpeed = 20f;
Item.shoot = ModContent.ProjectileType<StratusBlackHole>();
@@ -81,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Typeless
player.Calamity().Starshield = 30;
}
else
player.Calamity().Starshield = 3600;
player.Calamity().Starshield = CalamityUtils.MinutesToFrames(10);
}
else
{
@@ -1,6 +1,6 @@
// Put their internal name here
NPCName: {
Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, mentoring adventurers with his sharp intuition.
Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, offering useful advice and crafting recipes.
Dryad: The Dryad practices the art of Life Magic, pioneered by Silva. She is connected with nature and can analyze its purity worldwide. She sells seeds, too!
Mechanic: The Mechanic was imprisoned for sticking her nose where she shouldn't. She sells wiring and tools for putting together anything imaginable.
EmpressButterfly: These familiars conjured by the Empress draw power from their surroundings and later bring it to their master. They remind her of a lost loved one, and should one perish in the chaos of night, she shall unleash her full fury upon the attacker.
@@ -62,7 +62,6 @@ NPCName: {
RedDevil: Conjuring potent spears of dark magic, these elite demons hunt after the adventurer that destroyed their perceived deity.
WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land.
Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit the sky archipelago after the ruin of its old civilization. They defend their new territory fiercely against invaders with their razor-sharp feathers.
Scutlix: One of the few creatures left in the Martian homeworld, these creatures function similarly to horses. That is, if horses could fire lasers from their eyes.
MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources.
SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms.
DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility.
@@ -82,7 +81,7 @@ NPCName: {
Spazmatism: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Spazmatism chases at high speed, exhaling cursed flames.
TheDestroyer: Despite being made with repurposed mining equipment, the Destroyer was built for fighting other deities in single combat, decorated in laser-armed probes, which detach from its body when damaged.
SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons.
Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters.
Plantera: A dormant, yet powerful floral guardian grown by the elders of the Vernal Pass, using volatile animal souls as nourishment. Unshackled in a fit of herbage carnage, its reach now spans the entire jungle.
HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae.
Golem: A remarkable display of ingenuity constructed by the Lihzahrd race. Seeking light after they hid away in their temple out of shame for driving their goddess away, they built this construct. Powered by solar energy cells, it is ready to guard the Temple.
DukeFishron: An aquatic-evolved species which lives in isolation in the depths of the ocean. Despite their shortcomings, they still share blood with the dragons of old, claiming near complete dominion over the oceans. Legends claim it only surfaces in search of a rare, savory type of worm.
@@ -79,7 +79,7 @@ CryoSlime: Slimes enchanted by the Archmage, as a host to crystallize the frozen
Eidolist: Once members of the dragon cult, they now beg the favor of a new master. They are able to live in the abyss indefinitely thanks to their wyrm-like form, allowing them to serve a new purpose.
FearlessGoldfishWarrior: Though Goldfish thrive in their ponds and lakes, many take to land during storms to feed on the worms that have also surfaced. There are even accounts of aquatic warriors who carry daggers of shimmering gold, though most consider these tales far too fishy to be credible.
Frogfish: Well-camouflaged and prepared to strike at any moment, Frogfish show that the ocean is rarely as serene as it seems. There are few places where one can find true peace here in the heart of what once was an empire unrivaled.
Horse: After the Brimstone Elemental became dormant, the forgemasters of Azafure used clockwork and crystal to bind the powers of an elemental to a mechanical body. While formidable, it seems the dream of creating a true replacement for an elemental died unfulfilled with Azafure itself.
EarthElemental: After the Brimstone Elemental became dormant, the forgemasters of Azafure used clockwork and crystal to bind the powers of an elemental to a mechanical body. While formidable, it seems the dream of creating a true replacement for an elemental died unfulfilled with Azafure itself.
IceClasper: Though their exact origins are an enigma, what is known is that these ethereal beings seek to stamp out any and all sources of warmth that exist in their home. Due to this fact, and taking into account the fossil record, many speculate that ice claspers may have played a vital role in the tundra's creation.
ImpiousImmolator: An idol carved in the image of Her, it is lit ablaze with the crafter's lifeforce. After all, what weight does one's life hold when one wishes to see the world wreathed in Her holy flames?
MantisShrimp: Though a variety of answers are given when one asks adventurers about dangerous creatures, few aside from sailors will mention the small yet mighty Mantis Shrimp. Their strikes are so swift that the energy generated from them heats the water to temperatures rivaling the magma of Azafure.
@@ -314,7 +314,7 @@ VermillionFlux: {
Voidfrost: {
DisplayName: Voidfrost
Description: The emptiness of space devours all warmth and life
ItemTooltip: Cold - 100 DPS
ItemTooltip: Cold - 200 DPS
}
VulnerabilityHex: {
@@ -830,7 +830,7 @@ GreenJellyRegen: {
HallowedRuneDefense: {
DisplayName: Hallowed Defense
Description: Increased defense by {0} and damage reduction by {1}%
Description: Increased defense by {0}
}
HallowedRunePower: {
@@ -873,7 +873,7 @@ PhantomicShield: {
DisplayName: Phantomic Shield
Description:
'''
Defense increased by {0} and damage reduction increased by {1}%
Increased defense by {0}
An ephemeral bulwark protects you
'''
}
@@ -65,8 +65,8 @@ Affliction: {
Tooltip: Gives all teammates +{0} HP/s life regen, +{1}% max life, {2}% damage reduction, {3} defense and {4}% increased damage
}
AlchemicalFlask: {
DisplayName: Alchemical Flask
AlchemicalDecanter: {
DisplayName: Alchemical Decanter
Tooltip:
'''
All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuff:CalamityMod/Plague] by {0}%
@@ -429,14 +429,14 @@ CorrosiveSpine: {
Tooltip:
'''
5% increased movement speed
Multiplies all sickness and water-related debuff damage by 1.25x
25% increased Sickness and Water debuff damage
All attacks irradiate enemies and reduces the severity of the sulphuric waters
You burst into radioactive clouds when struck
'''
}
CorruptFlask: {
DisplayName: Corrupt Flask
UnholyTonic: {
DisplayName: Unholy Tonic
Tooltip:
'''
Increases damage reduction by 4% and defense by 6 while in the corruption
@@ -448,7 +448,6 @@ CounterScarf: {
DisplayName: Counter Scarf
Tooltip:
'''
10% increased true melee damage
Grants the ability to dash; dashing into an attack will cause you to dodge it
After a successful dodge you must wait 30 seconds before you can dodge again
'''
@@ -463,8 +462,8 @@ CrawCarapace: {
'''
}
CrimsonFlask: {
DisplayName: Crimson Flask
ViciousTonic: {
DisplayName: Vicious Tonic
Tooltip:
'''
Increases damage reduction by 4% and defense by 6 while in the crimson
@@ -485,7 +484,7 @@ CryoStone: {
DisplayName: Cryo Stone
Tooltip:
'''
Multiplies all cold-based debuff damage by 1.5x
50% increased Cold debuff damage
Creates a rotating ice shield around you that damages and slows down enemies on contact
'One of the ancient relics'
'''
@@ -588,7 +587,7 @@ DiamondOfTheDeep: {
DisplayName: Diamond of the Deep
Tooltip:
'''
Multiplies all water debuff damage by 1.6x
60% increased Water debuff damage
Slowly accrue up to three different abyssal spirits
Dash to disperse the spirits and have them attack enemies
When dispersed [c/CB7AD7:below 50% life], the spirits support you instead
@@ -756,9 +755,9 @@ EvasionScarf: {
DisplayName: Evasion Scarf
Tooltip:
'''
15% increased true melee damage
Grants the ability to dash; dashing into an attack will cause you to dodge it
After a successful dodge you must wait 30 seconds before you can dodge again
Has a shorter dash cooldown than most dashes
'''
}
@@ -921,7 +920,7 @@ HallowedRune: {
HoldShiftTooltip:
'''
[c/8ce0ff: Hallowed Power] [c/ccf1ff: grants 10% increased summon damage and rains stars on enemies]
[c/d08aff: Hallowed Defense] [c/eed4ff: grants 4 defense and 4% damage reduction]
[c/d08aff: Hallowed Defense] [c/eed4ff: grants 5 defense]
[c/ff8cb5: Hallowed Regen] [c/ffccde: grants +1.5 HP/s life regen]
'''
}
@@ -1199,7 +1198,7 @@ Nucleogenesis: {
DisplayName: Nucleogenesis
Tooltip:
'''
Increases your max number of mininons by 4
Increases your max number of minions by 4
Grants immunity to Shadowflame and Irradiated
15% increased summon damage, and increased minion knockback
Minions inflict a variety of debuffs
@@ -1305,7 +1304,7 @@ PhantomicArtifact: {
HoldShiftTooltip:
'''
[c/8ce0ff: Phantomic Empowerment] [c/ccf1ff: grants 10% increased summon damage and throws knives at enemies]
[c/d08aff: Phantomic Shield] [c/eed4ff: grants 10 defense, 5% damage reduction and a 20% damage reduction bulwark]
[c/d08aff: Phantomic Shield] [c/eed4ff: grants 10 defense and a 20% damage reduction bulwark]
[c/ff8cb5: Phantomic Regen] [c/ffccde: grants 1 HP/s life regen and occasionally drops phantom hearts which grant an additional 1 HP/s life regen]
'''
}
@@ -1576,7 +1575,7 @@ SeaSpiritAmulet: {
Slowly accumulate up to eight spirit orbs that follow you
Spirits disperse when dashing
If below 50% life, they will heal you, otherwise they will attack nearby enemies
Multiplies all water debuff damage by 1.35x
35% increased Water debuff damage
Spirit orbs are transparent and silent if visibility is disabled
'''
}
@@ -1688,7 +1687,7 @@ SpiritGlyph: {
HoldShiftTooltip:
'''
[c/8ce0ff: Spirit Power] [c/ccf1ff:grants 10% increased summon damage]
[c/d08aff: Spirit Defense] [c/eed4ff:grants 4 defense]
[c/d08aff: Spirit Defense] [c/eed4ff:grants 3 defense]
[c/ff8cb5: Spirit Regen] [c/ffccde:grants +1 HP/s life regeneration]
'''
}
@@ -1881,8 +1880,7 @@ TheAmalgam: {
DisplayName: The Amalgam
Tooltip:
'''
10% increased damage
All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3x
All attacks inflict a variety of debuffs, 200% increased elemental debuff damage
Most buffs last twice as long, and persist after dying
Taking damage confuses nearby enemies and spawns a dank creeper
The dank creeper flies above you, exploding into several shaderain clouds
@@ -1938,9 +1936,8 @@ TheEvolution: {
DisplayName: The Evolution
Tooltip:
'''
Reflects projectiles that hit you, negating their damage and dealing 10x damage to enemies
{$Common.ReflectInformation}
Reflecting a projectile grants maximum natural life regen for 10 seconds
Allows you to dodge projectiles, reflecting highly damaging mirror shards back at enemies
{$Common.DodgeInformation}
Getting hit by the same enemy projectile type during cooldown will resist its damage by 25%
'''
}
@@ -1995,7 +1992,7 @@ ToxicHeart: {
'''
Your heart beats with the plague, pulsing outside of your body
Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you
Multiplies all sickness debuff damage by 1.5x
50% increased Sickness debuff damage
Effects are transparent and silent if visibility is disabled
'''
}
@@ -1,9 +1,10 @@
// Quest fish tooltips
CaughtInAstral: "'Caught in the Astral Infection'"
CaughtInBrimstoneCrag: "'Caught in the Brimstone Crag'"
CaughtInSnow: "'Caught in Tundra'"
CaughtInSpace: "'Caught in Sky Lakes'"
CaughtInSunkenSea: "'Caught in the Sunken Sea'"
// Quest fish tooltips
CaughtInAstral: Caught in the Astral Infection
CaughtInBrimstoneCrag: Caught in the Brimstone Crag
CaughtInSnow: Caught in Tundra
CaughtInSpace: Caught in Sky Lakes
CaughtInSunkenSea: Caught in the Sunken Sea
LocationTooltip: "'{0}'"
// Astral Infection Catches
AldebaranAlewife: {
Loaded 100 of 312 files, more files were not shown because too many files have changed in this diff. Show more