Merge branch '1.4.4' into MegalodonLine
This commit is contained in:
commit
4d8b8191ff
19 files changed
+104
-50
No files matched your search
@@ -68,6 +68,9 @@ namespace CalamityMod.Balancing
|
||||
|
||||
// 25% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
|
||||
|
||||
// 40% resist to Lemon 'nade
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.60f, ProjectileType<LemonNadeProjectile>()))));
|
||||
#endregion
|
||||
|
||||
#region Brain of Cthulhu: Creepers
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int cooldown = 420;
|
||||
public static int damage = 60;
|
||||
public static int damage = 30;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 34;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Armor
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent());
|
||||
|
||||
// Set Bonus
|
||||
public static float SetBonusRogueStealth = 0.4f;
|
||||
public static float SetBonusRogueStealth = 1.05f;
|
||||
public static int TagDuration = CalamityUtils.SecondsToFrames(10);
|
||||
public static int StormManaCost = 60;
|
||||
public static int StormCooldown = 45;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Victide
|
||||
public new string LocalizationCategory => "Items.Armor.PreHardmode";
|
||||
public string BulkTexture => "CalamityMod/Items/Armor/Victide/VictideBreastplate_Bulk";
|
||||
|
||||
public static int RegenBoost = 2;
|
||||
public static int RegenBoost = 1;
|
||||
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond());
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@ namespace CalamityMod.Items.Armor.Victide
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Armor.PreHardmode";
|
||||
|
||||
public static int RegenBoost = 2;
|
||||
public static float RunAccelerationMult = 1.75f;
|
||||
public static int RegenBoost = 1;
|
||||
public static float RunAccelerationMult = 1.25f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), RunAccelerationMult.Round());
|
||||
|
||||
// Set Bonus
|
||||
public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8);
|
||||
public static int BarrierDefenseBoost = 6;
|
||||
public static int BarrierDefenseBoost = 4;
|
||||
public static float BarrierDamageAbsorptionPercent = 0.1f;
|
||||
public static int BarrierFramesPerHeal = 15;
|
||||
public static int BarrierFramesPerHeal = 30;
|
||||
public static int BarrierDamage = 50;
|
||||
public static float BarrierExplosionKB = 8f;
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ namespace CalamityMod.Items.Armor.Victide
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedAccelerationBoost.ToPercent());
|
||||
|
||||
// Set Bonus
|
||||
public static float BaseBurrowSpeed = 9f; // 46 mph
|
||||
public static float SubmergedBurrowSpeed = 12f; // 61 mph
|
||||
public static float BaseBurrowSpeed = 8f; // 41 mph
|
||||
public static float SubmergedBurrowSpeed = 10f; // 51 mph
|
||||
public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08
|
||||
public static int BurrowDuration = CalamityUtils.SecondsToFrames(7);
|
||||
public static int BurrowDuration = CalamityUtils.SecondsToFrames(5);
|
||||
public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30);
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -16,10 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 42;
|
||||
Item.height = 28;
|
||||
Item.damage = 28;
|
||||
Item.damage = 18;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 9;
|
||||
Item.useAnimation = Item.useTime = 45;
|
||||
Item.mana = 12;
|
||||
Item.useAnimation = Item.useTime = 20;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 1.5f;
|
||||
|
||||
@@ -14,19 +14,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Melee";
|
||||
// Weapon attribute constants
|
||||
public static readonly int BaseDamage = 690;
|
||||
public static readonly float GiantSkullDamageMultiplier = 1.7f;
|
||||
|
||||
public static int BaseDamage => 850;
|
||||
public static float GiantSkullDamageMultiplier => 2.0f;
|
||||
|
||||
// Weapon projectile attribute constants
|
||||
public static readonly int SearchDistance = 1450;
|
||||
public static readonly int ImmunityFrames = 10;
|
||||
public static int SearchDistance => 1450;
|
||||
public static int ImmunityFrames => 10;
|
||||
|
||||
// Skull ring attribute constants
|
||||
public static readonly float SkullsplosionDamageMultiplier = 1.5f;
|
||||
public static float SkullsplosionDamageMultiplier => 1.5f;
|
||||
internal static string SkullsplosionEntitySourceContext => "GaelsGreatswordRageSkullsplosion";
|
||||
|
||||
// Rage gain attribute constant
|
||||
public static readonly float RagePerSecond = 0.025f; // 2.5% rage per second
|
||||
public static float RagePerSecond => 0.025f; // 2.5% rage per second
|
||||
|
||||
//NOTE: GetWeaponDamage is in the CalamityPlayer file
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.width = 86;
|
||||
Item.height = 72;
|
||||
Item.DamageType = DamageClass.MeleeNoSpeed;
|
||||
Item.damage = 1180;
|
||||
Item.damage = 1100;
|
||||
Item.knockBack = 14f;
|
||||
Item.useTime = Item.useAnimation = 48;
|
||||
Item.autoReuse = true;
|
||||
|
||||
@@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.width = 74;
|
||||
Item.height = 74;
|
||||
Item.DamageType = DamageClass.MeleeNoSpeed;
|
||||
Item.damage = 650;
|
||||
Item.damage = 525;
|
||||
Item.knockBack = 28f;
|
||||
Item.useTime = 45;
|
||||
Item.useAnimation = 45;
|
||||
Item.useTime = Item.useAnimation = 48;
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
|
||||
@@ -12,11 +12,17 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class SealedSingularity : RogueWeapon
|
||||
{
|
||||
/// <summary>
|
||||
/// Falloff per target hit simultaneously by the aura. Resets every hit interval
|
||||
/// </summary>
|
||||
public static float FalloffPerTargetHitByAura => 0.5f;
|
||||
public static float FallofPerTargetHitByBomb => 0.2f;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.damage = 425;
|
||||
Item.damage = 260;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
|
||||
@@ -14,6 +14,7 @@ AddedTooltip: {
|
||||
// Also used by Sniper Scope
|
||||
EyeoftheGolem: 15% increased critical strike damage
|
||||
RifleScope: The scope effect can be toggled with visibility
|
||||
ReconScope2: 5% increased ranged critical strike chance
|
||||
ArcaneFlower: 5% increased magic damage
|
||||
HellfireTreads:
|
||||
'''
|
||||
@@ -174,7 +175,6 @@ EditedTooltip: {
|
||||
RifleScope1: Increase view range for guns (<right> to zoom out)
|
||||
RifleScope2: The scope effect can be toggled with visibility
|
||||
ReconScope1: 15% increased ranged damage
|
||||
ReconScope2: 5% increased ranged critical strike chance
|
||||
SniperScope: 12% increased ranged critical strike chance
|
||||
Magiluminescence:
|
||||
'''
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace CalamityMod.Prefixes
|
||||
|
||||
// MELEE (includes tools and whips)
|
||||
// Melee-ranged hybrid weapons prioritize Legendary if available, otherwise go for Unreal
|
||||
if ((item.CountsAsClass<MeleeDamageClass>() || item.CountsAsClass<SummonMeleeSpeedDamageClass>()) && !(item.CountsAsClass<MeleeRangedHybridDamageClass>() && !supportsLegendary) && !(item.type == ItemType<TheBurningSky>()))
|
||||
if ((item.CountsAsClass<MeleeDamageClass>() || item.CountsAsClass<SummonMeleeSpeedDamageClass>() || item.type == ItemType<EvilSmasher>()) && !(item.CountsAsClass<MeleeRangedHybridDamageClass>() && !supportsLegendary) && !(item.type == ItemType<TheBurningSky>()))
|
||||
{
|
||||
// Terrarian (has its own special "Legendary" for marketing reasons)
|
||||
// Other items that want to use Legendary2 are also compatible
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = DamageClass.Magic;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.penetrate = 3;
|
||||
Projectile.penetrate = 2;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.usesIDStaticNPCImmunity = true;
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override bool useAttackSpeed => false;
|
||||
public override SoundStyle? UseSound => SoundID.DD2_MonkStaffSwing with {Volume = 1f};
|
||||
|
||||
public ref float CurrentChargeMult => ref Projectile.ai[0];
|
||||
|
||||
bool hasSmashedTile = false;
|
||||
bool playedChargeSound = false;
|
||||
bool firstEnemyHit = true;
|
||||
@@ -52,14 +54,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
modplayer.swingNum = 0;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.scale *= 1.25f;
|
||||
Projectile.originalDamage = Projectile.damage;
|
||||
}
|
||||
|
||||
public override void AdditionalAI()
|
||||
{
|
||||
if (inStartup)
|
||||
{
|
||||
Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1)));
|
||||
CurrentChargeMult = timer / (float)(StartupTime-1);
|
||||
Owner.velocity.X *= 0.97f;
|
||||
}
|
||||
if (inStartup && !Owner.channel && timer > 30)
|
||||
@@ -98,27 +99,27 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
|
||||
Owner.velocity *= 0.15f;
|
||||
Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f,Projectile.damage / (float)Projectile.originalDamage);
|
||||
Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult);
|
||||
float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2;
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + Projectile.damage / (float)Projectile.originalDamage), 15));
|
||||
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30));
|
||||
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30));
|
||||
int radius = (int)(4 * Projectile.damage / (float)Projectile.originalDamage);
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + CurrentChargeMult), 15));
|
||||
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + CurrentChargeMult), 30));
|
||||
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + CurrentChargeMult), 30));
|
||||
int radius = (int)(4 * CurrentChargeMult);
|
||||
Point scanAreaStart = HammerFrontPos.ToTileCoordinates() + new Point(-radius, -radius);
|
||||
Point scanAreaEnd = HammerFrontPos.ToTileCoordinates() + new Point(radius, radius);
|
||||
Projectile.CreateImpactExplosion((int)(10 * Projectile.damage / (float)Projectile.originalDamage), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves);
|
||||
Projectile.CreateImpactExplosion((int)(10 * CurrentChargeMult), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves);
|
||||
|
||||
hasSmashedTile = true;
|
||||
timer = StartupTime + swingTime;
|
||||
angle = adjustedAngle;
|
||||
var pos = Projectile.Center;
|
||||
Projectile.Size *= 2 + Projectile.damage / (float)Projectile.originalDamage;
|
||||
Projectile.Size *= 2 + CurrentChargeMult;
|
||||
Projectile.Center = HammerFrontPos;
|
||||
Projectile.Damage();
|
||||
Projectile.Size /= 2 + Projectile.damage / (float)Projectile.originalDamage;
|
||||
Projectile.Size /= 2 + CurrentChargeMult;
|
||||
Projectile.Center = pos;
|
||||
|
||||
if ((Projectile.damage / (float)Projectile.originalDamage) >= 1)
|
||||
if (CurrentChargeMult >= 1)
|
||||
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with {VariantsWeights = new ReadOnlySpan<float>(new float[] { 1, 0, 0 })});
|
||||
SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact);
|
||||
}
|
||||
@@ -137,9 +138,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * .66f, (swingWidth * 0.33f), SwingCompletion));
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SourceDamage *= CurrentChargeMult;
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (firstEnemyHit && Main.rand.NextFloat() < (Projectile.damage / (float)Projectile.originalDamage))
|
||||
if (firstEnemyHit && Main.rand.NextFloat() < CurrentChargeMult)
|
||||
{
|
||||
string text = "";
|
||||
if (target.life > 0)
|
||||
@@ -157,7 +162,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
CombatText.NewText(Projectile.Hitbox, Color.Lerp(Color.DarkGray,Color.Gold, intense ? 0.25f: 0.1f), text, intense);
|
||||
firstEnemyHit = false;
|
||||
}
|
||||
if (!hasSmashedTile && (Projectile.damage / (float)Projectile.originalDamage) >= 1)
|
||||
if (!hasSmashedTile && CurrentChargeMult >= 1)
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
@@ -180,8 +185,9 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 });
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage));
|
||||
Owner.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage));
|
||||
|
||||
target.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult));
|
||||
Owner.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult));
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -189,7 +195,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if (!inCooldown)
|
||||
{
|
||||
var tex = ModContent.Request<Texture2D>(Texture + "Glow").Value;
|
||||
float outlineWidth = (int)(4 * (Projectile.damage / (float)Projectile.originalDamage)) * 0.5f;
|
||||
float outlineWidth = (int)(4 * CurrentChargeMult) * 0.5f;
|
||||
if (inSwing)
|
||||
{
|
||||
outlineWidth *= 1 - SwingCompletion;
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.netUpdate = true;
|
||||
|
||||
int numFlares = EmpoweredHammer + 1;
|
||||
int flareDamage = (int)(0.1f * Projectile.damage);
|
||||
int flareDamage = (int)(0.05f * Projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Systems.Graphic.PixelationSystem;
|
||||
@@ -15,6 +17,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
[PierceResistException]
|
||||
public class SealedSingularityProjectile : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
@@ -98,6 +101,11 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
}
|
||||
if (AIState == 1)
|
||||
{
|
||||
if (Timer % 30 == 0) //reset hit immunity every 30 frames & reset the pierce falloff too
|
||||
{
|
||||
Projectile.ResetLocalNPCHitImmunity();
|
||||
Projectile.numHits = 0;
|
||||
}
|
||||
Projectile.timeLeft++;
|
||||
Projectile.rotation += 0.175f * Projectile.direction;
|
||||
Projectile.velocity = new Vector2(
|
||||
@@ -136,8 +144,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (Timer > TimerMax && AIState == 0)
|
||||
{
|
||||
var sizee = Stealth ? 900 : 600;
|
||||
Projectile.localNPCHitCooldown = 30;
|
||||
Projectile.ResetLocalNPCHitImmunity();
|
||||
Projectile.tileCollide = false;
|
||||
Timer = 0;
|
||||
TimerMax = Stealth ? 600 : 300;
|
||||
@@ -150,6 +156,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Timer = 0;
|
||||
TimerMax = 300;
|
||||
Projectile.ResetLocalNPCHitImmunity();
|
||||
Projectile.numHits = 0;
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
for (int index = 0; index < 3; ++index)
|
||||
{
|
||||
@@ -164,6 +171,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (Timer >= TimerMax && AIState == 2)
|
||||
{
|
||||
Projectile.Resize(300, 300);
|
||||
Projectile.numHits = 0;
|
||||
Projectile.ResetLocalNPCHitImmunity();
|
||||
Projectile.Damage();
|
||||
|
||||
@@ -334,10 +342,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
switch (AIState)
|
||||
{
|
||||
case 1:
|
||||
modifiers.SourceDamage /= 20;
|
||||
modifiers.SourceDamage /= Stealth ? 15 : 25;
|
||||
modifiers.SourceDamage *= MathF.Pow(1 - SealedSingularity.FalloffPerTargetHitByAura, Projectile.numHits);
|
||||
return;
|
||||
case 2:
|
||||
modifiers.SourceDamage *= 2;
|
||||
modifiers.SourceDamage *= Stealth ? 5 : 2;
|
||||
modifiers.SourceDamage *= MathF.Pow(1 - SealedSingularity.FallofPerTargetHitByBomb, Projectile.numHits);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Projectiles/Summon/CnidarianJellyfishOnTheString";
|
||||
|
||||
public static int ReelChancePerFrame = 100;
|
||||
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public ref float ParentProjectile => ref Projectile.ai[2];
|
||||
public Projectile Parent => Main.projectile[(int)ParentProjectile];
|
||||
@@ -40,7 +42,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public override void AI()
|
||||
{
|
||||
// Automatic reeling
|
||||
if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(40))
|
||||
if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(ReelChancePerFrame))
|
||||
{
|
||||
Projectile.ai[0] = 1f;
|
||||
Projectile.localAI[0] = 1f;
|
||||
|
||||
@@ -158,6 +158,34 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
else
|
||||
Projectile.velocity.Y *= 0.92f;
|
||||
|
||||
// Interrupt movement if burrowing into a solid tile unable to be broken by the player by any means
|
||||
int LeftRange = Utils.Clamp((int)(Projectile.position.X + Projectile.velocity.X) / 16, 2, Main.maxTilesX - 2);
|
||||
int RightRange = Utils.Clamp((int)(Projectile.position.X + Projectile.velocity.X) / 16 + 1, 2, Main.maxTilesX - 2);
|
||||
int TopRange = Utils.Clamp((int)(Projectile.position.Y + Projectile.velocity.Y) / 16, 2, Main.maxTilesY - 2);
|
||||
int BottomRange = Utils.Clamp((int)(Projectile.position.Y + Projectile.velocity.Y) / 16 + 2, 2, Main.maxTilesY - 2);
|
||||
bool stop = false;
|
||||
for (int i = LeftRange; i <= RightRange; i++)
|
||||
{
|
||||
if (stop)
|
||||
break;
|
||||
|
||||
for (int j = TopRange; j <= BottomRange; j++)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
if (!tile.HasTile || !Main.tileSolid[tile.TileType])
|
||||
continue;
|
||||
|
||||
bool breakable = WorldGen.CanKillTile(i, j) && tile.ShouldBeMined();
|
||||
if (breakable && Owner.GetBestPickPower() >= tile.GetRequiredPickPower(i, j))
|
||||
continue;
|
||||
|
||||
stop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (stop)
|
||||
Projectile.velocity *= 0.1f;
|
||||
|
||||
// Rotation is less sudden so that the visuals are smoother -- velocity is not affected so that it also plays natural
|
||||
float idealRotation = (Projectile.velocity.Length() == 0f ? MathHelper.PiOver2 : Projectile.velocity.ToRotation());
|
||||
if (MathF.Abs(idealRotation - Projectile.rotation) < MathHelper.ToRadians(1f) || MathF.Abs(idealRotation - Projectile.rotation) > MathHelper.ToRadians(90f))
|
||||
|
||||
Reference in new issue
Block a user