Merge branch 1.4.4 into staging
No files matched your search
@@ -305,3 +305,4 @@ $RECYCLE.BIN/
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
*.slnx
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -3429,8 +3428,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)
|
||||
{
|
||||
@@ -3440,7 +3440,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;
|
||||
@@ -3538,7 +3538,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];
|
||||
@@ -4045,7 +4045,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;
|
||||
|
||||
@@ -4316,7 +4316,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);
|
||||
@@ -5294,7 +5294,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])
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -143,7 +144,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));
|
||||
@@ -166,7 +167,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);
|
||||
@@ -186,7 +187,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));
|
||||
@@ -209,7 +210,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);
|
||||
@@ -883,7 +884,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);
|
||||
@@ -924,19 +925,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);
|
||||
@@ -944,7 +947,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;
|
||||
@@ -1132,7 +1135,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);
|
||||
|
||||
@@ -1157,8 +1160,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);
|
||||
}
|
||||
@@ -1192,8 +1195,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);
|
||||
@@ -1391,7 +1394,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;
|
||||
@@ -1422,7 +1425,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;
|
||||
}
|
||||
@@ -1469,7 +1472,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.
|
||||
@@ -1575,12 +1578,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;
|
||||
}
|
||||
}
|
||||
@@ -2138,7 +2141,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));
|
||||
@@ -2148,9 +2151,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)
|
||||
@@ -2350,7 +2353,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);
|
||||
}
|
||||
}
|
||||
@@ -2376,7 +2379,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);
|
||||
@@ -2431,7 +2434,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);
|
||||
@@ -2442,7 +2445,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++)
|
||||
{
|
||||
@@ -2502,7 +2505,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);
|
||||
@@ -2522,11 +2525,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;
|
||||
}
|
||||
@@ -2534,7 +2537,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);
|
||||
@@ -2552,7 +2555,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++)
|
||||
@@ -2567,7 +2570,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);
|
||||
|
||||
@@ -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
|
||||
@@ -564,12 +564,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
@@ -1316,7 +1318,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;
|
||||
}
|
||||
}
|
||||
@@ -1335,7 +1337,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>())
|
||||
{
|
||||
@@ -1373,7 +1375,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -212,5 +212,9 @@ namespace CalamityMod
|
||||
SyncPlayerDrawParameter,
|
||||
|
||||
DialogueDisplayStart,
|
||||
|
||||
WulfrumAcrobaticsSync,
|
||||
WulfrumAcrobaticsJumpSync,
|
||||
WulfrumAcrobaticsLengthSync,
|
||||
}
|
||||
}
|
||||
@@ -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!]]]"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,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;
|
||||
|
||||
@@ -144,7 +145,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";
|
||||
|
||||
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
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()
|
||||
|
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 892 B |
@@ -1,13 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Packets;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.World;
|
||||
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 +28,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 +37,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 +82,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 +90,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
projectile.active = false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public class WulfrumPackPlayer : ModPlayer
|
||||
@@ -226,6 +236,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;
|
||||
@@ -529,7 +637,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 +669,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 +689,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 +703,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 +748,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 +786,185 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class WulfrumAcrobaticsSync : CalamityPacket
|
||||
{
|
||||
public static WulfrumAcrobaticsSync Instance { get; private set; }
|
||||
|
||||
public override byte MessageType => (byte)CalamityModMessageType.WulfrumAcrobaticsSync;
|
||||
|
||||
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(in 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 override byte MessageType => (byte)CalamityModMessageType.WulfrumAcrobaticsJumpSync;
|
||||
|
||||
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(in 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 override byte MessageType => (byte)CalamityModMessageType.WulfrumAcrobaticsLengthSync;
|
||||
|
||||
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(in 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).
|
||||
|
||||
@@ -498,76 +498,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
|
||||
|
||||
@@ -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)) },
|
||||
|
||||
@@ -12,7 +12,7 @@ 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()
|
||||
|
||||
@@ -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] {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>(), damage * 3, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
var mousePos = player.Calamity().mouseWorld;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -14,16 +15,30 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class HalleysInferno : ModItem, ILocalizedModType
|
||||
{
|
||||
public class HalleyZoom : ModSystem
|
||||
{
|
||||
public static float halleyZoomAmount = 0;
|
||||
public override void ModifyTransformMatrix(ref SpriteViewMatrix Transform)
|
||||
{
|
||||
if (Main.LocalPlayer.HeldItem.type == ModContent.ItemType<HalleysInferno>())
|
||||
halleyZoomAmount += 0.05f;
|
||||
else
|
||||
halleyZoomAmount -= 0.05f;
|
||||
halleyZoomAmount = MathHelper.Clamp(halleyZoomAmount, 0, 1);
|
||||
Transform.Zoom *= 1 - 0.25f*halleyZoomAmount;
|
||||
}
|
||||
}
|
||||
|
||||
public new string LocalizationCategory => "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()
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: {
|
||||
@@ -825,7 +825,7 @@ GreenJellyRegen: {
|
||||
|
||||
HallowedRuneDefense: {
|
||||
DisplayName: Hallowed Defense
|
||||
Description: Increased defense by {0} and damage reduction by {1}%
|
||||
Description: Increased defense by {0}
|
||||
}
|
||||
|
||||
HallowedRunePower: {
|
||||
@@ -868,7 +868,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}%
|
||||
@@ -440,8 +440,8 @@ CorrosiveSpine: {
|
||||
'''
|
||||
}
|
||||
|
||||
CorruptFlask: {
|
||||
DisplayName: Corrupt Flask
|
||||
UnholyTonic: {
|
||||
DisplayName: Unholy Tonic
|
||||
Tooltip:
|
||||
'''
|
||||
Increases damage reduction by 4% and defense by 6 while in the corruption
|
||||
@@ -453,7 +453,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
|
||||
'''
|
||||
@@ -468,8 +467,8 @@ CrawCarapace: {
|
||||
'''
|
||||
}
|
||||
|
||||
CrimsonFlask: {
|
||||
DisplayName: Crimson Flask
|
||||
ViciousTonic: {
|
||||
DisplayName: Vicious Tonic
|
||||
Tooltip:
|
||||
'''
|
||||
Increases damage reduction by 4% and defense by 6 while in the crimson
|
||||
@@ -761,9 +760,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
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -925,7 +924,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]
|
||||
'''
|
||||
}
|
||||
@@ -1304,7 +1303,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]
|
||||
'''
|
||||
}
|
||||
@@ -1683,7 +1682,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]
|
||||
'''
|
||||
}
|
||||
@@ -1876,7 +1875,6 @@ TheAmalgam: {
|
||||
DisplayName: The Amalgam
|
||||
Tooltip:
|
||||
'''
|
||||
10% increased damage
|
||||
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
|
||||
@@ -1933,9 +1931,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%
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ HadalStew: {
|
||||
Tooltip:
|
||||
'''
|
||||
Only gives [S] seconds of {$BuffName.PotionSickness}
|
||||
{$CommonItemTooltip.MediumStats}
|
||||
{$CommonItemTooltip.MajorStats}
|
||||
{$CommonItemTooltip.MinuteDuration}
|
||||
'''
|
||||
}
|
||||
@@ -241,7 +241,6 @@ GrapeBeer: {
|
||||
Tooltip:
|
||||
'''
|
||||
Bullets, Arrows, Darts, and Rockets gain homing
|
||||
If many are fired at the same time, this only applies to five of them
|
||||
{0}% reduced critical strike damage
|
||||
{$Common.AlcoholWarning}
|
||||
'''
|
||||
|
||||
@@ -175,7 +175,6 @@ DisgustingMeat: {
|
||||
DisplayName: Disgusting Meat
|
||||
Tooltip:
|
||||
'''
|
||||
Debug item, spawn and use to remove permanent upgrades
|
||||
<left> will remove health and mana upgrades, use with no Calamity upgrades to remove vanilla upgrades
|
||||
<right> will remove rage and adrenaline upgrades, plus other miscellaneous boosters
|
||||
Removed boosters will be vomited out of you as items
|
||||
|
||||
@@ -40,6 +40,7 @@ AlphaDraconis: {
|
||||
Successful hits sometimes create Starbursts that can be picked up
|
||||
<right> with enough Starbursts to summon Draco to protect you
|
||||
Draco burns Starbursts over time, and can be disspelled with <right>
|
||||
Draco inflicts [cbuff:CalamityMod/Voidfrost]
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ CrescentMoon: {
|
||||
Throws a lunar flail that releases homing moons at the apex of its path
|
||||
Holding <left> spins the flail around you, generating Starbursts
|
||||
With 20 Starbursts, hold <left> again after throwing the flail to cause it to explode
|
||||
Instead of releasing moons, this explosion summons Scorpius to do immense damage
|
||||
Instead of releasing moons, this explosion summons Scorpius to do immense damage and inflict [cbuff:CalamityMod/Voidfrost]
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ DevilsDevastation: {
|
||||
'''
|
||||
[c/d13ca2:The perfect blade of the Underworld, wielding the power of Brimstone directly.]
|
||||
[c/d13ca2:Humans understand this force as Havoc, the inevitable sundering of all order in fire.]
|
||||
[c/d13ca2:Perhaps this is why the Brimstone Elemental had strength unrivaled by her sisters.]
|
||||
[c/d13ca2:Perhaps this is why the Brimstone Elemental had strength unrivaled by her sisters.]
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ GalileoGladius: {
|
||||
Tooltip:
|
||||
'''
|
||||
Rapidly stabs in front of the player, generating Starbursts on hit
|
||||
<right> to throw the gladius on a constellation chain, impaling foes
|
||||
<right> to throw the gladius on a constellation chain, impaling foes and inflicting [cbuff:CalamityMod/Voidfrost]
|
||||
When the blade is impaled, use <left> or <right> to free it
|
||||
<left> pulls it free and deals high damage, consuming 10 Starbursts
|
||||
<right> pulls youself to the blade, allowing you to jump off the foe
|
||||
|
||||
@@ -543,8 +543,9 @@ HalleysInferno: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a burst of intensely concentrated lunar fire jets
|
||||
Generates Starbursts over time when hitting enemies
|
||||
<right> to rapid-fire Starbursts
|
||||
<right> to rapid-fire Starbursts that inflict [cbuff:CalamityMod/Voidfrost]
|
||||
Generates Starbursts when hitting enemies, depending on your accuracy
|
||||
Increases view range by 33% while held
|
||||
Uses gel for ammo
|
||||
'Halley arrived sooner than expected'
|
||||
'''
|
||||
@@ -970,7 +971,7 @@ PristineFury: {
|
||||
'''
|
||||
'I and many others lost everything in this world's darkest hour.
|
||||
I saw a beast descend from the heavens. A hulking cosmic monstrosity that heralded countless angels of death.
|
||||
My family was torn from me by them, and my people forsake me. Even our supposed protectors did nothing to aid us.
|
||||
My family was torn from me, my people forsake me. Even our supposed protectors did nothing to aid us.
|
||||
And thus I swore to those I lost that I would do what is right, that my blaze's light would dwarf even that of Zeratros' Sun;
|
||||
That one day, this cruel world would know nothing less than My perfect fury.'
|
||||
'''
|
||||
|
||||
@@ -1327,7 +1327,7 @@ Vega: {
|
||||
Throws a spear that shatters into star fragments on impact and generates Starbursts
|
||||
Stealth strikes conjure an image of Lyra to deal immense damage in an area
|
||||
<right> to consume 20 Starbursts and immediately perform a stealth strike, regardless of your current Stealth
|
||||
This strike calls all star fragments to attack the damaged foe
|
||||
This strike calls all star fragments to attack the damaged foe and inflicts [cbuff:CalamityMod/Voidfrost]
|
||||
'The final song of a misunderstood genius... or just a madman'
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -704,8 +704,8 @@ Sirius: {
|
||||
Summons the brightest star in the sky, Sirius, to protect you
|
||||
Continue summoning to complete Canis Major
|
||||
Repeated summons increase its power greatly, even after the constellation is complete
|
||||
Sirius passively generates Starbursts when near enemies
|
||||
When Starbursts are full, Sirius consumes them to launch a powerful piercing quasar
|
||||
Sirius passively generates Starbursts when targeting enemies
|
||||
When Starbursts are full, Sirius consumes them to launch a powerful piercing quasar that inflicts [cbuff:CalamityMod/Voidfrost]
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ CosmicShivBlade.DisplayName: Cosmic Beam
|
||||
CosmicShivTrail.DisplayName: Cosmic Shiv Trail
|
||||
CosmicSpiritBomb.DisplayName: Cosmic Bomb
|
||||
CrescentMoonFlail.DisplayName: Crescent Moon
|
||||
CrescentMoonProj.DisplayName: Crescent Moon
|
||||
CrescentMoonProj.DisplayName: Seeking Moon
|
||||
CrystylCrusherRay.DisplayName: Crystyl Crusher Ray
|
||||
Cyclone.DisplayName: Cyclone
|
||||
DarkBall.DisplayName: Dark Ball
|
||||
@@ -133,6 +133,7 @@ GalaxySmasherHammer.DisplayName: Galaxy Smasher
|
||||
GalaxySmasherMini.DisplayName: Cosmic Shard
|
||||
GalileosMoon.DisplayName: Crescent Moon
|
||||
GalileosPlanet.DisplayName: Planet
|
||||
GalileoGladiusThrown.DisplayName: Galileo Gladius (Thrown)
|
||||
GayBeam.DisplayName: Iridescent Beam
|
||||
GelWave.DisplayName: Gelitic Wave
|
||||
GemTechYellowShard.DisplayName: Trireme's Yellow Gem
|
||||
|
||||
@@ -1272,7 +1272,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// GFB Lavaproof Bug Net and Alchemical Flask drop
|
||||
GFB.Add(DropHelper.PerPlayer(ItemID.FireproofBugNet), hideLootReport: true);
|
||||
GFB.Add(DropHelper.PerPlayer(ModContent.ItemType<AlchemicalFlask>()), hideLootReport: true);
|
||||
GFB.Add(DropHelper.PerPlayer(ModContent.ItemType<AlchemicalDecanter>()), hideLootReport: true);
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !NPC.downedQueenBee, ModContent.ItemType<LoreQueenBee>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -22,13 +22,18 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
|
||||
// Don't do damage for 42 frames after spawning in
|
||||
if (npc.type == NPCID.Sharkron || npc.type == NPCID.Sharkron2)
|
||||
{
|
||||
npc.damage = npc.alpha > 0 ? 0 : npc.defDamage;
|
||||
}
|
||||
|
||||
// Servant of Cthulhu light
|
||||
if (npc.type == NPCID.ServantofCthulhu)
|
||||
else if (npc.type == NPCID.ServantofCthulhu)
|
||||
{
|
||||
Lighting.AddLight(npc.Center, 0.2f, 0.2f, 0.2f);
|
||||
}
|
||||
|
||||
if (npc.type == NPCID.CultistBoss)
|
||||
// Cultist Boss light and hitbox changes
|
||||
else if (npc.type == NPCID.CultistBoss)
|
||||
{
|
||||
// Emit light
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
@@ -45,7 +50,9 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
if (npc.Size != hitboxSize)
|
||||
npc.Size = hitboxSize;
|
||||
}
|
||||
if (npc.type == NPCID.CultistBossClone)
|
||||
|
||||
// Cultist Clone Light
|
||||
else if (npc.type == NPCID.CultistBossClone)
|
||||
{
|
||||
if (Main.npc[(int)npc.ai[3]].active)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,18 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
/// </summary>
|
||||
public static bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Blacklist for non difficulty specific AI changes. External mods can add NPC type to opt-out global changes.
|
||||
/// <para>Example: Destroyer Probe's Telegraph Drawing</para>
|
||||
/// </summary>
|
||||
public static HashSet<int> GlobalChangeBlacklist { get; private set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Hook to Modify AI Overrides on External mods demand.<br/>
|
||||
/// Modifying <see cref="VanillaAIOverrideContext.OverrideToApply"/> will result in NPCs to use that specific AI.
|
||||
/// </summary>
|
||||
public static event Action<VanillaAIOverrideContext> ModifyAIOverride;
|
||||
|
||||
/// <summary>
|
||||
/// Specify the AI Override to work with. This handles AI, SendExtraAI and ReceiveExtraAI in instaned manner.
|
||||
/// </summary>
|
||||
@@ -874,6 +886,8 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
}
|
||||
#endregion
|
||||
|
||||
internal static bool IsGlobalChangeBlacklisted(NPC npc) => GlobalChangeBlacklist.Contains(npc.type);
|
||||
|
||||
internal static void RegisterNetID(VanillaAIOverride aiOverride)
|
||||
{
|
||||
var id = NetIDLookup.Count + 1;
|
||||
@@ -883,6 +897,8 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
public override void Unload()
|
||||
{
|
||||
NetIDLookup.Clear();
|
||||
GlobalChangeBlacklist.Clear();
|
||||
ModifyAIOverride = null;
|
||||
}
|
||||
|
||||
public override void SetDefaults(NPC npc)
|
||||
@@ -895,6 +911,21 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
return;
|
||||
|
||||
AIOverride = GetVanillaAIOverrideToApply(npc);
|
||||
if (ModifyAIOverride != null)
|
||||
{
|
||||
var context = new VanillaAIOverrideContext()
|
||||
{
|
||||
NPC = npc,
|
||||
NPCType = npc.type,
|
||||
InRevengeanceWorld = CalamityWorld.revenge,
|
||||
InDeathWorld = CalamityWorld.death,
|
||||
InBossRush = BossRushEvent.BossRushActive,
|
||||
OverrideToApply = AIOverride
|
||||
};
|
||||
ModifyAIOverride.Invoke(context);
|
||||
AIOverride = context.OverrideToApply;
|
||||
}
|
||||
|
||||
if (AIOverride != null)
|
||||
{
|
||||
AIOverride.NPC = npc;
|
||||
@@ -918,7 +949,7 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
return base.PreAI(npc);
|
||||
|
||||
bool result = true;
|
||||
result &= GlobalPreAI(npc);
|
||||
if (!IsGlobalChangeBlacklisted(npc)) result &= GlobalPreAI(npc);
|
||||
if (AIOverride != null)
|
||||
{
|
||||
result &= AIOverride.AI(Mod);
|
||||
@@ -938,7 +969,7 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
GlobalAI(npc);
|
||||
if (!IsGlobalChangeBlacklisted(npc)) GlobalAI(npc);
|
||||
}
|
||||
|
||||
public override void PostAI(NPC npc)
|
||||
@@ -1019,7 +1050,7 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
base.PreDraw(npc, spriteBatch, screenPos, drawColor);
|
||||
|
||||
bool result = true;
|
||||
result &= GlobalPreDraw(npc, spriteBatch, screenPos, drawColor);
|
||||
if (!IsGlobalChangeBlacklisted(npc)) result &= GlobalPreDraw(npc, spriteBatch, screenPos, drawColor);
|
||||
result &= AIOverride?.PreDraw(Mod, spriteBatch, screenPos, drawColor) ?? true;
|
||||
return result;
|
||||
}
|
||||
@@ -1029,7 +1060,7 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
GlobalPostDraw(npc, spriteBatch, screenPos, drawColor);
|
||||
if (!IsGlobalChangeBlacklisted(npc)) GlobalPostDraw(npc, spriteBatch, screenPos, drawColor);
|
||||
AIOverride?.PostDraw(Mod, spriteBatch, screenPos, drawColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.damage = 50;
|
||||
NPC.damage = 0;
|
||||
NPC.width = 88;
|
||||
NPC.height = 88;
|
||||
NPC.lifeMax = 100;
|
||||
NPC.value = Item.buyPrice(0, 2, 0, 0);
|
||||
NPC.value = 0;
|
||||
|
||||
NPC.HitSound = ThanatosHead.ThanatosHitSoundClosed;
|
||||
NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound;
|
||||
@@ -115,8 +115,8 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
NPC.damage = 0;
|
||||
NPC.width = 38;
|
||||
NPC.height = 38;
|
||||
NPC.lifeMax = 1000;
|
||||
NPC.value = Item.buyPrice(1, 0, 0, 0);
|
||||
NPC.lifeMax = 500;
|
||||
NPC.value = Item.buyPrice(0, 0, 50, 0);
|
||||
NPC.rarity = 3;
|
||||
NPC.HitSound = ThanatosHead.ThanatosHitSoundClosed;
|
||||
NPC.DeathSound = SoundID.NPCDeath44;
|
||||
|
||||
@@ -15,6 +15,7 @@ using Terraria.ModLoader.Utilities;
|
||||
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
[LegacyName("Horse")]
|
||||
public class EarthElemental : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using Terraria;
|
||||
|
||||
namespace CalamityMod.NPCs.VanillaNPCAIOverrides;
|
||||
|
||||
public class VanillaAIOverrideContext
|
||||
{
|
||||
public NPC NPC { get; init; }
|
||||
public int NPCType { get; init; }
|
||||
public bool InRevengeanceWorld { get; init; }
|
||||
public bool InDeathWorld { get; init; }
|
||||
public bool InBossRush { get; init; }
|
||||
public VanillaAIOverride OverrideToApply { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CalamityMod.Graphics.Primitives;
|
||||
using CalamityMod.NPCs;
|
||||
@@ -6,14 +8,11 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent.Prefixes;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
{
|
||||
@@ -57,19 +56,19 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
}
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.itemTime > 0)
|
||||
if (player.itemTime > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
var proj = Main.projectile[i];
|
||||
if (proj.type == ProjectileType && proj.owner == player.whoAmI && proj.active)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
var proj = Main.projectile[i];
|
||||
if (proj.type == ProjectileType && proj.owner == player.whoAmI && proj.active)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
}
|
||||
@@ -172,7 +171,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// <summary>
|
||||
/// What sound to use when the sword begins the actual swing (after startup frames)
|
||||
/// </summary>
|
||||
public virtual SoundStyle? UseSound {get; set;} = null;
|
||||
public virtual SoundStyle? UseSound { get; set; } = null;
|
||||
/// <summary>
|
||||
/// The length (from the player) of the projectile's line collision.
|
||||
/// This helps to prevent blindspots.
|
||||
@@ -230,6 +229,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
public float SwingCompletion => swingTimer / (float)swingTime;
|
||||
public float CooldownCompletion => CooldownTimer / (float)CooldownTime;
|
||||
|
||||
private bool hasFakedOnSpawn = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overridable Methods
|
||||
@@ -238,10 +239,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// </summary>
|
||||
public virtual void AdditionalAI() { }
|
||||
/// <summary>
|
||||
/// happens after OnSpawn. Use as not to cancel the default OnSpawn behavior.
|
||||
/// happens at the beginning of AI the first frame.
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
public virtual void Spawn(IEntitySource source) { }
|
||||
public virtual void Spawn() { }
|
||||
/// <summary>
|
||||
/// happens after SetDefaults. Use as not to cancel default SetDefaults behavior.
|
||||
/// </summary>
|
||||
@@ -287,7 +288,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
Projectile.timeLeft = swingTime * 2;
|
||||
if (UsesBaseItem)
|
||||
{
|
||||
Projectile.width = Projectile.height = Math.Max(BaseItem.height,BaseItem.width);
|
||||
Projectile.width = Projectile.height = Math.Max(BaseItem.height, BaseItem.width);
|
||||
}
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
@@ -302,14 +303,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
Defaults();
|
||||
}
|
||||
/// <summary>
|
||||
/// DO NOT OVERRIDE IN MOST SITUATIONS
|
||||
/// use Spawn(IEntitySource) instead
|
||||
/// That will run spawn code in the proper timing.
|
||||
/// This hook runs at the beginning of AI the first time through.
|
||||
/// </summary>
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
private void FakeOnSpawn()
|
||||
{
|
||||
var player = Main.player[Projectile.owner];
|
||||
angle = (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One);
|
||||
angle = (player.Center - player.Calamity().mouseWorld).SafeNormalize(Vector2.One);
|
||||
Projectile.velocity = Vector2.Zero;
|
||||
if (angle.X < 0)
|
||||
{
|
||||
@@ -330,7 +329,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
player.GetModPlayer<BaseSwordHoldoutPlayer>().swingNum++;
|
||||
}
|
||||
swingTime = Main.player[Projectile.owner].HeldItem.useTime;
|
||||
Spawn(source);
|
||||
Spawn();
|
||||
StartupTime *= Projectile.MaxUpdates;
|
||||
CooldownTime *= Projectile.MaxUpdates;
|
||||
swingTime *= Projectile.MaxUpdates;
|
||||
@@ -369,16 +368,22 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// </summary>
|
||||
public override void AI()
|
||||
{
|
||||
if (!hasFakedOnSpawn)
|
||||
{
|
||||
FakeOnSpawn();
|
||||
hasFakedOnSpawn = true;
|
||||
}
|
||||
var player = Main.player[Projectile.owner];
|
||||
Projectile.gfxOffY = player.gfxOffY;
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
float adust = MathHelper.ToRadians(225);
|
||||
if (timer < StartupTime || timer > StartupTime + swingTime)
|
||||
{
|
||||
if (inStartup)
|
||||
angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup);
|
||||
angle = Vector2.Lerp(angle, (player.Center - player.Calamity().mouseWorld).SafeNormalize(Vector2.One), RotateInStartup);
|
||||
if (inCooldown)
|
||||
angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInCooldown);
|
||||
angle = Vector2.Lerp(angle, (player.Center - player.Calamity().mouseWorld).SafeNormalize(Vector2.One), RotateInCooldown);
|
||||
if (angle.X < 0)
|
||||
{
|
||||
player.direction = 1;
|
||||
@@ -409,9 +414,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
oldProjectilePos.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
if (inSwing && swingTimer == 1 && UseSound != null)
|
||||
if (inSwing && swingTimer == 1 && UseSound != null)
|
||||
{
|
||||
SoundEngine.PlaySound((SoundStyle)UseSound,player.Center);
|
||||
SoundEngine.PlaySound((SoundStyle)UseSound, player.Center);
|
||||
}
|
||||
var angle2 = (AlternateSwings && modplayer.swingNum % 2 == 1 ? SwingFunction() : SwingFunction());
|
||||
Projectile.Center = armCenter - (angle * OffsetDistance * (1 + (Projectile.scale - 1) * 0.75f)).RotatedBy(Projectile.spriteDirection * angle2);
|
||||
@@ -478,13 +483,13 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
GameShaders.Misc["CalamityMod:ExobladeSlash"].Shader.Parameters["flipped"].SetValue(Projectile.spriteDirection == -1 ? false : true);
|
||||
GameShaders.Misc["CalamityMod:ExobladeSlash"].Apply();
|
||||
|
||||
var positionsToUse = Projectile.oldPos.Take((int)MathHelper.Min(trailLength,swingTimer)).ToArray();
|
||||
var positionsToUse = Projectile.oldPos.Take((int)MathHelper.Min(trailLength, swingTimer)).ToArray();
|
||||
for (var i = 0; i < positionsToUse.Length; i++)
|
||||
{
|
||||
if (i >= timer) break;
|
||||
positionsToUse[i] += (Projectile.oldRot[i] - MathHelper.PiOver4 * (Projectile.spriteDirection == -1 ? 3 : 1)).ToRotationVector2() * this.trailOffset * oldScale[i];
|
||||
}
|
||||
PrimitiveRenderer.RenderTrail(positionsToUse, new(trailWidth, trailColor, (_,_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 25);
|
||||
PrimitiveRenderer.RenderTrail(positionsToUse, new(trailWidth, trailColor, (_, _) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 25);
|
||||
Main.spriteBatch.ExitShaderRegion();
|
||||
|
||||
Main.player[Projectile.owner].heldProj = Projectile.whoAmI;
|
||||
@@ -508,7 +513,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
var player = Main.player[Projectile.owner];
|
||||
var armcenter = player.Center - new Vector2(5 * player.direction, 2);
|
||||
var swordDir = armcenter.DirectionTo(Projectile.Center);
|
||||
var collisionline = new Vector2(lineCollisionLength / 2f, 0).RotatedBy(swordDir.ToRotation())*Projectile.scale;
|
||||
var collisionline = new Vector2(lineCollisionLength / 2f, 0).RotatedBy(swordDir.ToRotation()) * Projectile.scale;
|
||||
bool c = Collision.CheckAABBvLineCollision(targetHitbox.Location.ToVector2(), targetHitbox.Size(), Projectile.Center, Projectile.Center + collisionline);
|
||||
if (c && !float.IsNaN(collisionline.X) && !float.IsNaN(collisionline.Y))
|
||||
return true;
|
||||
@@ -528,27 +533,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.WriteVector2(angle);
|
||||
writer.Write(swingTime);
|
||||
writer.Write(StartupTime);
|
||||
writer.Write(CooldownTime);
|
||||
writer.Write(timer);
|
||||
writer.Write(swingTimer);
|
||||
writer.Write(ExistsTime);
|
||||
writer.Write(baseScale);
|
||||
writer.Write(Projectile.scale);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
angle = reader.ReadVector2();
|
||||
swingTime = reader.Read();
|
||||
StartupTime = reader.Read();
|
||||
CooldownTime = reader.Read();
|
||||
timer = reader.Read();
|
||||
swingTimer = reader.Read();
|
||||
ExistsTime = reader.Read();
|
||||
baseScale = reader.ReadSingle();
|
||||
Projectile.scale = reader.ReadSingle();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -327,14 +327,12 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
void ApplyGrapeBeer()
|
||||
{
|
||||
|
||||
conditionalHomingRange = 600;
|
||||
if (projectile.timeLeft > 300 * projectile.MaxUpdates)
|
||||
projectile.timeLeft = 300 * projectile.MaxUpdates;
|
||||
hybridIframes = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
Main.player[projectile.owner].Calamity().grapeBeerTimer++;
|
||||
}
|
||||
if (source is EntitySource_ItemUse_WithAmmo {Item: Item item})
|
||||
{
|
||||
@@ -3068,9 +3066,12 @@ namespace CalamityMod.Projectiles
|
||||
var totalTime = 60 - speedup;
|
||||
if (TimerToCatch + 90 >= 160 - owner.HeldItem.fishingPole && CatchTime >= 0)
|
||||
{
|
||||
// TODO: Implications of rand here?
|
||||
if (PersistentFishingData == 0)
|
||||
PersistentFishingData = Main.rand.NextBool() ? 1 : -1;
|
||||
var timer = TimerToCatch - 160 - owner.HeldItem.fishingPole;
|
||||
|
||||
// TODO: Fine for others to see?
|
||||
SmallSplashAtOffset(new Vector2(200 * PersistentFishingData * (timer / 90f), 0));
|
||||
}
|
||||
if (TimerToCatch >= 160 - owner.HeldItem.fishingPole && CatchTime >= 0)
|
||||
@@ -3086,10 +3087,16 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
if (CatchTime < 0 && CatchTime % totalTime == 0)
|
||||
{
|
||||
// TODO: Fine for others to see?
|
||||
Splash();
|
||||
// TODO: Implications of rand here?
|
||||
PersistentFishingData = Main.rand.Next(0, 4);
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(PersistentFishingData * MathHelper.PiOver2) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 45 - speedup, 0.04f, Color.Blue, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
|
||||
if (owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(PersistentFishingData * MathHelper.PiOver2) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 45 - speedup, 0.04f, Color.Blue, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
}
|
||||
if (CatchTime < 0 && CatchTime % totalTime == -15)
|
||||
{
|
||||
@@ -3116,16 +3123,18 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (playerDir >= 0)
|
||||
if (owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(playerDir * MathHelper.PiOver2) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 15, 0.04f, Color.Red, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
else
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 15, 0.06f, Color.Red, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
if (playerDir >= 0)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(playerDir * MathHelper.PiOver2) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 15, 0.04f, Color.Red, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
else
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 15, 0.06f, Color.Red, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
}
|
||||
TimerToCatch = 0;
|
||||
CatchTime = 0;
|
||||
@@ -3147,8 +3156,6 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
if (projectile.ai[0] == 0)
|
||||
{
|
||||
|
||||
|
||||
projectile.ai[1] = CatchTime;
|
||||
projectile.localAI[1] = TimerToCatch;
|
||||
if (CaughtItemID != -1 && isReelingIn == 0)
|
||||
@@ -3179,13 +3186,28 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
owner.Calamity().ShouldHideControls = true;
|
||||
if (owner.Calamity().pressedUp)
|
||||
{
|
||||
projectile.velocity.Y -= 0.125f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedDown)
|
||||
{
|
||||
projectile.velocity.Y += 0.125f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedLeft)
|
||||
{
|
||||
projectile.velocity.X -= 0.125f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedRight)
|
||||
{
|
||||
projectile.velocity.X += 0.125f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
projectile.velocity *= 0.975f;
|
||||
|
||||
@@ -3197,32 +3219,35 @@ namespace CalamityMod.Projectiles
|
||||
projectile.FishingCheck();
|
||||
if (projectile.ai[1] < 0)
|
||||
{
|
||||
|
||||
CaughtItemID = (int)projectile.localAI[1];
|
||||
projectile.ai[1] = 0;
|
||||
projectile.localAI[1] = 0;
|
||||
for (var i = 0; i < 1000; i++)
|
||||
|
||||
if (owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var vectorToCheck = projectile.Center + new Vector2(Main.rand.Next(-200, 201), Main.rand.Next(-200, 201));
|
||||
var tileCoordsToCheck = vectorToCheck.ToSafeTileCoordinates();
|
||||
if (new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight).Contains((int)vectorToCheck.X, (int)vectorToCheck.Y) && !Main.tile[tileCoordsToCheck.X, tileCoordsToCheck.Y].IsTileSolid() && Main.tile[tileCoordsToCheck.X, tileCoordsToCheck.Y].LiquidAmount > 0)
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
if (projectile.localAI[2] >= 1)
|
||||
var vectorToCheck = projectile.Center + new Vector2(Main.rand.Next(-200, 201), Main.rand.Next(-200, 201));
|
||||
var tileCoordsToCheck = vectorToCheck.ToSafeTileCoordinates();
|
||||
if (new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight).Contains((int)vectorToCheck.X, (int)vectorToCheck.Y) && !Main.tile[tileCoordsToCheck.X, tileCoordsToCheck.Y].IsTileSolid() && Main.tile[tileCoordsToCheck.X, tileCoordsToCheck.Y].LiquidAmount > 0)
|
||||
{
|
||||
int customSonarText = (int)(projectile.localAI[2] - 1);
|
||||
if (Main.popupText[customSonarText].sonar)
|
||||
if (projectile.localAI[2] >= 1)
|
||||
{
|
||||
Main.popupText[customSonarText].position = vectorToCheck - FontAssets.MouseText.Value.MeasureString(Main.popupText[customSonarText].name) / 2f;
|
||||
int customSonarText = (int)(projectile.localAI[2] - 1);
|
||||
if (Main.popupText[customSonarText].sonar)
|
||||
{
|
||||
Main.popupText[customSonarText].position = vectorToCheck - FontAssets.MouseText.Value.MeasureString(Main.popupText[customSonarText].name) / 2f;
|
||||
}
|
||||
}
|
||||
PersistentFishingDataVector2 = vectorToCheck;
|
||||
TimerToCatch = 600;
|
||||
break;
|
||||
}
|
||||
PersistentFishingDataVector2 = vectorToCheck;
|
||||
TimerToCatch = 600;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (PersistentFishingDataVector2 != Vector2.Zero)
|
||||
if (PersistentFishingDataVector2 != Vector2.Zero && owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Dust.NewDustPerfect(PersistentFishingDataVector2, DustID.Smoke);
|
||||
if (Main.rand.NextBool(3))
|
||||
@@ -3234,7 +3259,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
|
||||
//When in lava, give the bobber a particle over it to show its location
|
||||
if (projectile.lavaWet)
|
||||
if (projectile.lavaWet && owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 2, 0.01f, Color.DarkGray, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
@@ -3361,10 +3386,13 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
if (PersistentFishingData == 0)
|
||||
PersistentFishingData = Main.rand.NextBool() ? 1 : -1;
|
||||
var timer = TimerToCatch - 300;
|
||||
SmallSplashAtOffset(new Vector2(200 * PersistentFishingData * (timer / 90f), 0));
|
||||
|
||||
SmallDustAtOffset(new Vector2(200 * PersistentFishingData * (timer / 90f), 0), DustID.BlueCrystalShard);
|
||||
if (owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var timer = TimerToCatch - 300;
|
||||
SmallSplashAtOffset(new Vector2(200 * PersistentFishingData * (timer / 90f), 0));
|
||||
SmallDustAtOffset(new Vector2(200 * PersistentFishingData * (timer / 90f), 0), DustID.BlueCrystalShard);
|
||||
}
|
||||
}
|
||||
if (TimerToCatch >= 300 && CatchTime >= 0)
|
||||
{
|
||||
@@ -3377,7 +3405,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
TimerToCatch = 0;
|
||||
}
|
||||
if (CatchTime < 0 && CatchTime % totalTime == 0)
|
||||
if (CatchTime < 0 && CatchTime % totalTime == 0 && owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Splash();
|
||||
PersistentFishingData = Main.rand.Next(0, 2);
|
||||
@@ -3401,16 +3429,18 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (playerDir >= 0)
|
||||
if (owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(playerDir * MathHelper.Pi) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 15, 0.04f, Color.Red, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
else
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 15, 0.06f, Color.Red, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
if (playerDir >= 0)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.UnitX.RotatedBy(playerDir * MathHelper.Pi) * 10, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 15, 0.04f, Color.Red, new(1, 2), shrinkSpeed: -0.2f);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
else
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 15, 0.06f, Color.Red, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
}
|
||||
}
|
||||
TimerToCatch = 0;
|
||||
CatchTime = 0;
|
||||
@@ -3524,7 +3554,7 @@ namespace CalamityMod.Projectiles
|
||||
projectile.velocity *= 0.99f;
|
||||
|
||||
//When in lava, give the bobber a particle over it to show its location
|
||||
if (projectile.lavaWet)
|
||||
if (projectile.lavaWet && owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var particle = new CustomSpark(projectile.Center, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 2, 0.01f, Color.DarkGray, Vector2.One);
|
||||
GeneralParticleHandler.SpawnParticle(particle);
|
||||
@@ -3533,15 +3563,35 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
|
||||
if (owner.Calamity().pressedUp && projectile.velocity.Y < 0)
|
||||
{
|
||||
projectile.velocity.Y -= 0.3f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedUp && Waterline.Y < projectile.Center.Y)
|
||||
{
|
||||
projectile.velocity.Y -= 0.3f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedDown)
|
||||
{
|
||||
projectile.velocity.Y += 0.25f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedLeft)
|
||||
{
|
||||
projectile.velocity.X -= 0.25f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (owner.Calamity().pressedRight)
|
||||
{
|
||||
projectile.velocity.X += 0.25f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
if (Waterline.Y <= projectile.Center.Y - 8)
|
||||
TimerToCatch -= Main.rand.Next(1, 5);
|
||||
if (TimerToCatch <= 0)
|
||||
@@ -3574,7 +3624,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
}
|
||||
}
|
||||
if (PersistentFishingDataVector2 != Vector2.Zero && owner.miscCounter % 15 == 0)
|
||||
if (PersistentFishingDataVector2 != Vector2.Zero && owner.miscCounter % 15 == 0 && owner.whoAmI == Main.myPlayer)
|
||||
{
|
||||
|
||||
var particle = new CustomSpark(PersistentFishingDataVector2, Vector2.Zero, "CalamityMod/Particles/HighResHollowCircleHardEdge", false, 25, 0.02f, Color.Green, Vector2.One);
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.BlueCounterweight, counterweightTweaks },
|
||||
{ ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) },
|
||||
{ ProjectileID.Bullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.BulletHighVelocity, Do(LocalIFrames(-1)) },
|
||||
{ ProjectileID.BulletHighVelocity, Do(ExtraUpdatesDelta(+2), LocalIFrames(-1)) },
|
||||
{ ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) },
|
||||
{ ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks },
|
||||
{ ProjectileID.ChlorophyteDrill, standardDrillTweaks },
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
// Both checks to make sure sounds/hitboxes only happen once per swing
|
||||
public bool makeSound = true;
|
||||
public bool makeHitbox = true;
|
||||
public int cooldownGiven => (int)(400 / Owner.GetAttackSpeed<MeleeDamageClass>()); // Cooldown is effected by melee speed, lines up perfectly so you do 10 swings and end in time for a big swing
|
||||
public int cooldownGiven => (int)(800 / Owner.GetAttackSpeed<MeleeDamageClass>()); // Cooldown is effected by melee speed, lines up perfectly so you do 22 swings and end in time for a big swing
|
||||
public float pullFx = 1; // Scaling on the effects of the blade when it's buffed
|
||||
public bool pressedRight = false;
|
||||
// Spawns a hitbox to do damage, rather than dealing damage itself
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650)
|
||||
{
|
||||
Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX);
|
||||
target.velocity = moveDir * 20;
|
||||
target.velocity = moveDir;
|
||||
target.Center += moveDir * 3f;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 300)
|
||||
{
|
||||
Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX);
|
||||
target.velocity = Vector2.Lerp(target.velocity, moveDir * 18, 0.12f);
|
||||
target.velocity = Vector2.Lerp(target.velocity, moveDir * 5, 0.12f);
|
||||
target.Center += moveDir * 2f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
Player owner = Main.player[Projectile.owner];
|
||||
|
||||
if (!Collision.CanHitLine(
|
||||
owner.Center, 1, 1,
|
||||
target.Center, 1, 1))
|
||||
return false;
|
||||
return base.CanHitNPC(target);
|
||||
}
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
if (Projectile.timeLeft <= 10)
|
||||
|
||||
@@ -72,11 +72,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
// Update the damage of the holdout projectile constantly so that it decreases as charge decreases, even while in use.
|
||||
Projectile.damage = Owner.GetWeaponDamage(heldItem);
|
||||
|
||||
// Check if the player's held item still has sufficient charge. If so, and they're still using it, take a tiny bit of charge from it.
|
||||
CalamityGlobalItem modItem = heldItem.Calamity();
|
||||
if ((Owner.channel || Owner.Calamity().mouseRight) && modItem.Charge >= HydraulicVoltCrasher.HoldoutChargeUse)
|
||||
if ((Owner.channel || Owner.Calamity().mouseRight))
|
||||
{
|
||||
modItem.Charge -= HydraulicVoltCrasher.HoldoutChargeUse;
|
||||
|
||||
float speed = Owner.inventory[Owner.selectedItem].shootSpeed * Projectile.scale;
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
|
||||
@@ -37,14 +37,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
private const float MaximumMouseRange = 360f;
|
||||
private const float ProjCenterOffset = 36f;
|
||||
|
||||
public bool IsSmall
|
||||
{
|
||||
get
|
||||
{
|
||||
CalamityGlobalItem swordItem = Main.player[Projectile.owner].HeldItem.Calamity();
|
||||
return swordItem.ChargeRatio < Phaseslayer.SizeChargeThreshold;
|
||||
}
|
||||
}
|
||||
public bool IsSmall => false; //Phaseslayer no longer uses charge so no longer gets small. I don't care to redo the code to remove this entirely so it's just being set to false.
|
||||
|
||||
// ai[0] wrapper. Stores a rolling lerped average of angular momentum which is used as the swing speed damage multiplier.
|
||||
public float AngularDamageFactor
|
||||
@@ -116,12 +109,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
AdjustCurrentDamage(player, deltaAngle);
|
||||
ManipulateFrames();
|
||||
HandleSwordBeams(player, modItem, deltaAngle);
|
||||
|
||||
// Because sword beams (or just holding the sword while it's fizzling) can take energy even when the sword's at zero energy,
|
||||
// this is here to ensure the sword item's charge never goes below zero.
|
||||
if (modItem.Charge < 0f)
|
||||
modItem.Charge = 0f;
|
||||
|
||||
HandleFadeout();
|
||||
}
|
||||
|
||||
@@ -131,7 +118,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
{
|
||||
// In addition to typical channel cancellation criteria, the sword fizzles out if it runs out of charge.
|
||||
Item playerItem = player.HeldItem;
|
||||
bool hasCharge = modItem.Charge > 0f;
|
||||
bool hasCharge = true; // Phaseslayer no longer uses charge so always true.
|
||||
if (!player.CantUseHoldout() && playerItem.type == ModContent.ItemType<Phaseslayer>() && hasCharge)
|
||||
{
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, the effect is capped separately
|
||||
@@ -251,9 +238,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
{
|
||||
Vector2 velocity = Projectile.rotation.ToRotationVector2() * 20f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<PhaseslayerBeam>(), (int)(Projectile.damage * SwordBeamDamageMultiplier), 0f, player.whoAmI);
|
||||
|
||||
// Actually consume energy to fire the sword beam.
|
||||
modItem.Charge -= Phaseslayer.SwordBeamChargeUse;
|
||||
}
|
||||
|
||||
// The sound delay doubles as the sword beam's cooldown.
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.width = 22;
|
||||
Projectile.height = 24;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.penetrate = 5;
|
||||
Projectile.DamageType = DamageClass.Magic;
|
||||
Projectile.extraUpdates = 4;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
@@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.scale = 0.5f;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = Projectile.MaxUpdates * 300;
|
||||
Projectile.stopsDealingDamageAfterPenetrateHits = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 70))
|
||||
if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && time > 70)
|
||||
{
|
||||
hasSetPlatSpawn = true;
|
||||
spawnPlat = true;
|
||||
|
||||
@@ -58,6 +58,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 12f, 20f, true);
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
if (target.CanBeChasedBy(Projectile, false) && target.Calamity().IsArmored())
|
||||
return false;
|
||||
return base.CanHitNPC(target);
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -10,7 +9,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
|
||||
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/GeliticBladeWave");
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -34,11 +32,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(UseSound with { Volume = 3f, PitchVariance = 0.25f }, Projectile.position);
|
||||
Projectile.localAI[0] += 1f;
|
||||
}
|
||||
Lighting.AddLight(Projectile.Center, Color.Blue.ToVector3());
|
||||
Projectile.rotation = Projectile.velocity.ToRotation();
|
||||
if (Main.rand.NextBool(10))
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.width = Projectile.height = 54;
|
||||
}
|
||||
|
||||
public override void Spawn(IEntitySource source)
|
||||
public override void Spawn()
|
||||
{
|
||||
var player = Main.player[Projectile.owner];
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
@@ -179,12 +179,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(0.9f, 1.4f, eased);
|
||||
|
||||
// VFX vars
|
||||
Vector2 mousePosition = Main.MouseWorld;
|
||||
Vector2 mousePosition = player.Calamity().mouseWorld;
|
||||
Vector2 fireDirection = Vector2.Normalize(mousePosition - player.Center);
|
||||
|
||||
if (!trailFXTriggered)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, fireDirection * 5, ModContent.ProjectileType<LucreciaDNATrailCreator>(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, fireDirection * 5, ModContent.ProjectileType<LucreciaDNATrailCreator>(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
|
||||
SoundStyle swish = new("CalamityMod/Sounds/Custom/MeatySlash");
|
||||
SoundEngine.PlaySound(swish with { Volume = 0.3f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center);
|
||||
|
||||
@@ -37,14 +37,16 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.extraUpdates = 5; //ExtraUpdates help make collision more accurate
|
||||
Projectile.noEnchantmentVisuals = true;
|
||||
}
|
||||
public override void Spawn(IEntitySource source)
|
||||
public override void Spawn()
|
||||
{
|
||||
var player = Main.player[Projectile.owner];
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
StartupTime = 10;
|
||||
CooldownTime = 10;
|
||||
swingTime -= StartupTime + CooldownTime;
|
||||
modplayer.swingNum = modplayer.swingNum++ % 3;
|
||||
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
modplayer.swingNum = modplayer.swingNum++ % 3;
|
||||
OffsetDistance = 70;
|
||||
RotateInStartup = 0.2f;
|
||||
RotateInCooldown = 0f;
|
||||
@@ -91,6 +93,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Main.projectile[p].friendly = true;
|
||||
Main.projectile[p].DamageType = DamageClass.Melee;
|
||||
Main.projectile[p].timeLeft = 120;
|
||||
Main.projectile[p].netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,8 +119,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
case 0:
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, -angle * 3, ModContent.ProjectileType<MawOfInfinityJaws>(), Projectile.damage * 2, Projectile.knockBack, player.whoAmI);
|
||||
player.itemAnimation = BaseItem.useAnimation;
|
||||
player.itemTime = BaseItem.useTime;
|
||||
player.itemAnimation = BaseItem.useAnimation;
|
||||
player.itemTime = BaseItem.useTime;
|
||||
Projectile.Kill();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -30,6 +31,18 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.WriteVector2(GoalPos);
|
||||
writer.WriteVector2(StartPos);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
GoalPos = reader.ReadVector2();
|
||||
StartPos = reader.ReadVector2();
|
||||
}
|
||||
|
||||
Vector2 GoalPos = Vector2.Zero;
|
||||
Vector2 StartPos = Vector2.Zero;
|
||||
float offset = 0;
|
||||
@@ -41,6 +54,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
GoalPos = player.Calamity().mouseWorld;
|
||||
StartPos = Projectile.Center;
|
||||
Projectile.netUpdate = true;
|
||||
}
|
||||
Projectile.Center = Vector2.Lerp(StartPos, GoalPos, MathHelper.Min(1,MathF.Pow(1 - (Projectile.timeLeft - 5) / 30f,0.5f)));
|
||||
Projectile.rotation = StartPos.DirectionTo(GoalPos).ToRotation();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override bool drawSwordTrail => false;
|
||||
public override Color[] trailColors => new Color[] { Color.Red, Color.MediumPurple, Color.Purple }; public override int StartupTime { get; set; }
|
||||
public override int CooldownTime { get; set; }
|
||||
public override bool AlternateSwings => true;
|
||||
public override bool AlternateSwings => false;
|
||||
public bool SpawnShards = true;
|
||||
|
||||
public override bool useMeleeSpeed => true;
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void Spawn(IEntitySource source)
|
||||
public override void Spawn()
|
||||
{
|
||||
var player = Main.player[Projectile.owner];
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
isShard = reader.ReadBoolean();
|
||||
hasSpawned = reader.ReadBoolean();
|
||||
shardNum = reader.Read();
|
||||
shardShield = reader.Read();
|
||||
shardNum = reader.ReadInt32();
|
||||
shardShield = reader.ReadInt32();
|
||||
}
|
||||
public override bool? CanDamage()
|
||||
{
|
||||
@@ -73,8 +73,24 @@ namespace CalamityMod.Projectiles.Melee
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
if (!hasSpawned)
|
||||
{
|
||||
Projectile.netUpdate = true;
|
||||
if (Projectile.ai[0] != 0)
|
||||
{
|
||||
//This is used when spawned by Evolution.
|
||||
//Setting AP so high guarantees we get the full dmg of the projectile.
|
||||
Projectile.ArmorPenetration = 1000;
|
||||
hasSpawned = true;
|
||||
shardShield = 0;
|
||||
isShard = false;
|
||||
Projectile.timeLeft = 1200;
|
||||
Projectile.velocity = Projectile.DirectionTo(player.Center) * -20f;
|
||||
Projectile.DamageType = DamageClass.Generic;
|
||||
Projectile.CritChance = 0;
|
||||
return;
|
||||
}
|
||||
shardNum = player.ownedProjectileCounts[Projectile.type];
|
||||
hasSpawned = true;
|
||||
shardNum = 0;
|
||||
@@ -83,6 +99,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if (proj.active && proj.type == ModContent.ProjectileType<MirrorBlast>() && proj.owner == Projectile.owner)
|
||||
{
|
||||
(proj.ModProjectile as MirrorBlast).shardNum++;
|
||||
proj.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,6 +111,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
isShard = false;
|
||||
Projectile.timeLeft = 1200;
|
||||
Projectile.velocity = Projectile.DirectionTo(player.Center) * -20f;
|
||||
Projectile.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
List<Vector2> positions = new List<Vector2>() //Hardcoded positions for the mirror shield shards so we can make it look nice
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
Projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void Spawn(IEntitySource source)
|
||||
public override void Spawn()
|
||||
{
|
||||
angle = angle.RotatedByRandom(0.25f);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
using (Main.spriteBatch.Scope())
|
||||
{
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.Draw(tex, Projectile.Center + sparkAngle * -10 - Main.screenPosition, null, Color.SkyBlue * 0.75f, sparkAngle.ToRotation() + MathHelper.PiOver2, new Vector2(tex.Width * 0.5f,tex.Height), new Vector2(0.85f, MathHelper.Lerp(0.1f, 1.4f, SwingCompletion)) * Projectile.scale * 0.04f, SpriteEffects.None, 1);
|
||||
Main.spriteBatch.Draw(tex, Projectile.Center + sparkAngle * -10 - Main.screenPosition, null, Color.SkyBlue * 0.75f, sparkAngle.ToRotation() + MathHelper.PiOver2, new Vector2(tex.Width * 0.5f,tex.Height), new Vector2(0.85f, MathHelper.Lerp(0.1f, 1.55f, SwingCompletion)) * Projectile.scale * 0.04f, SpriteEffects.None, 1);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
}
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
var lineCollisionLength = 160;
|
||||
var lineCollisionLength = 192;
|
||||
var player = Main.player[Projectile.owner];
|
||||
var armcenter = player.Center - new Vector2(5 * player.direction, 2);
|
||||
var swordDir = armcenter.DirectionTo(Projectile.Center);
|
||||
|
||||
@@ -21,9 +21,9 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
{
|
||||
public class GalileoGladiusThrown : ModProjectile
|
||||
public class GalileoGladiusThrown : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<GalileoGladius>();
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/GalileoGladius";
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
else
|
||||
{
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
||||
if (Projectile.Distance(Owner.Center) > 900)
|
||||
if (Projectile.Distance(Owner.Center) > 1000)
|
||||
{
|
||||
Projectile.ai[1] = 1;
|
||||
}
|
||||
@@ -143,8 +143,21 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
Projectile.damage *= 20;
|
||||
Projectile.Damage();
|
||||
Owner.Calamity().StratusStarburst -= 10;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
float moveDuration = Main.rand.Next(5, 15);
|
||||
var proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation + MathHelper.PiOver4*3).ToRotationVector2().RotatedByRandom(0.4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<VegaStar>(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner, 0f, moveDuration);
|
||||
if (Main.projectile.IndexInRange(proj))
|
||||
{
|
||||
Main.projectile[proj].DamageType = DamageClass.Melee;
|
||||
Main.projectile[proj].usesIDStaticNPCImmunity = false;
|
||||
Main.projectile[proj].usesLocalNPCImmunity = true;
|
||||
Main.projectile[proj].localNPCHitCooldown = 20;
|
||||
}
|
||||
}
|
||||
Projectile.velocity = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * -15;
|
||||
SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact, Owner.Center);
|
||||
|
||||
}
|
||||
stabbedNPC = null;
|
||||
}
|
||||
@@ -219,7 +232,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
stabbedNPC = target;
|
||||
NPCOffset = Projectile.Center - target.Center;
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<Voidfrost>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<Voidfrost>(), 600);
|
||||
}
|
||||
|
||||
List<(float, float)> offsets = new()
|
||||
|
||||