This commit is contained in:
Storm2103 committed 2023-07-30 20:24:05 -06:00
commit 3d4f174cb2
53 files changed
+353 -294

No files matched your search

+1 -3
View File
@@ -59,9 +59,7 @@ namespace CalamityMod.BiomeManagers
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return !Main.dayTime
? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime
: CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime
return CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer1") ?? MusicID.Desert;
}
}
+14 -2
View File
@@ -81,6 +81,18 @@ namespace CalamityMod.Buffs
{
player.GetDamage<GenericDamageClass>() -= 0.2f;
}
else if (type == BuffID.BeetleMight1)
{
player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
}
else if (type == BuffID.BeetleMight2)
{
player.GetAttackSpeed<MeleeDamageClass>() -= 0.2f;
}
else if (type == BuffID.BeetleMight3)
{
player.GetAttackSpeed<MeleeDamageClass>() -= 0.3f;
}
}
public override void Update(int type, NPC npc, ref int buffIndex)
@@ -157,7 +169,7 @@ namespace CalamityMod.Buffs
tip = "22.5% increased damage";
break;
/*case BuffID.BeetleMight1:
case BuffID.BeetleMight1:
tip = "Melee damage increased by 10%";
break;
@@ -167,7 +179,7 @@ namespace CalamityMod.Buffs
case BuffID.BeetleMight3:
tip = "Melee damage increased by 30%";
break;*/
break;
case BuffID.BeetleEndurance1:
tip = "Damage taken reduced by 10%";
+9 -8
View File
@@ -250,7 +250,8 @@ namespace CalamityMod.CalPlayer
#region Sound
public bool playRogueStealthSound = false;
public bool playFullRageSound = true;
public int fullRageSoundCountdownTimer = 0;
private const int FullRageSoundDelay = 300; // The "Rage full" sound cannot play for 5 seconds after Rage has filled. This stops it from jittering.
public bool playFullAdrenalineSound = true;
public static readonly SoundStyle RageFilledSound = new("CalamityMod/Sounds/Custom/AbilitySounds/FullRage");
@@ -3203,7 +3204,7 @@ namespace CalamityMod.CalPlayer
// Nerfs the effectiveness of Beetle Scale Mail.
if (Player.beetleOffense && Player.beetleOrbs > 0)
meleeSpeedMult -= 0.1f * Player.beetleOrbs;
Player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f * Player.beetleOrbs;
if (GemTechSet && GemTechState.IsYellowGemActive)
meleeSpeedMult += GemTechHeadgear.MeleeSpeedBoost;
@@ -3383,25 +3384,24 @@ namespace CalamityMod.CalPlayer
if (cooldowns.TryGetValue(PotionSickness.ID, out CooldownInstance cd))
{
if (Player.potionDelay != cd.timeLeft && cd.timeLeft > 0)
{
cd.timeLeft = Player.potionDelay;
}
if (cd.timeLeft > cd.duration)
cd.duration = cd.timeLeft; // If the new cooldown is larger than the full duration, update, else keep it the same.
}
// Add a cooldown display for chaos state if the player has the vanilla counter ticking
// This will make the cooldown look like vanilla Rod of Discord, as it wasn't applied by either Normality Relocator or Spectral Veil
if (Player.chaosState && !Player.HasCooldown(ChaosState.ID))
{
for (int l = 0; l < Player.MaxBuffs; l++)
{
if (Player.buffType[l] == BuffID.ChaosState)
{
Player.AddCooldown(ChaosState.ID, Player.buffTime[l], false);
break;
}
}
}
}
@@ -3413,6 +3413,7 @@ namespace CalamityMod.CalPlayer
float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f;
duration /= baseCooldown - lifeStealNerf;
duration *= -1f;
if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration))
Player.AddCooldown(LifeSteal.ID, (int)duration);
}
@@ -4641,7 +4642,7 @@ namespace CalamityMod.CalPlayer
if (auralisAuroraCounter >= 300)
{
modifiers.SourceDamage -= 100;
modifiers.SourceDamage.Flat -= 100;
auralisAuroraCounter = 0;
auralisAuroraCooldown = CalamityUtils.SecondsToFrames(30f);
@@ -5663,7 +5664,7 @@ namespace CalamityMod.CalPlayer
// Resilient Candle makes defense 5% more effective, aka 5% of defense is subtracted from all incoming damage.
if (purpleCandle)
modifiers.SourceDamage -= (int)(Player.statDefense * 0.05);
modifiers.SourceDamage.Flat -= (int)(Player.statDefense * 0.05);
}
#endregion
+6 -6
View File
@@ -425,14 +425,12 @@ namespace CalamityMod.CalPlayer
rage = 2f * rageMax;
// Play a sound when the Rage Meter is full
if (Player.whoAmI == Main.myPlayer && playFullRageSound)
{
playFullRageSound = false;
if (Player.whoAmI == Main.myPlayer && fullRageSoundCountdownTimer <= 0)
SoundEngine.PlaySound(RageFilledSound);
}
// Regardless of whether a sound was played this time Rage reached 100%, set the delay before the sound can be played again.
fullRageSoundCountdownTimer = FullRageSoundDelay;
}
else
playFullRageSound = true;
}
#endregion
@@ -1164,6 +1162,8 @@ namespace CalamityMod.CalPlayer
if (expiredCooldowns.Count > 0)
SyncCooldownRemoval(Main.netMode == NetmodeID.Server, expiredCooldowns);
if (fullRageSoundCountdownTimer > 0)
--fullRageSoundCountdownTimer;
if (plagueTaintedSMGDroneCooldown > 0)
plagueTaintedSMGDroneCooldown--;
if (momentumCapacitorTime > 0)
+13
View File
@@ -1021,6 +1021,19 @@ namespace CalamityMod.Items
player.GetCritChance<MagicDamageClass>() -= 1;
break;
case ItemID.Gi:
player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
player.jumpSpeedBoost += 0.5f;
break;
case ItemID.TitaniumMask:
player.GetAttackSpeed<MeleeDamageClass>() += 0.05f;
break;
case ItemID.BeetleScaleMail:
player.GetAttackSpeed<MeleeDamageClass>() += 0.03f;
break;
case ItemID.SquireGreatHelm:
player.lifeRegen -= 3;
break;
+24 -17
View File
@@ -344,7 +344,7 @@ namespace CalamityMod.Items
// Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed)
if (item.type == ItemID.DD2BetsyBow)
EditTooltipByNum(0, (line) => line.Text = "Shoots splitting arrows");
// Modify item speed tooltips to use a new scale designed to more accurately reflect practical distributions of item speeds.
// Due to the higher complexity of the action, the actual logic is delegated to its own method.
// I think this fits the miscellaneous category? Not seeing anything like this elsewhere. - Tomat
@@ -393,7 +393,7 @@ namespace CalamityMod.Items
{
EditTooltipByNum(0, (line) => line.Text += " to summon the Golem\n");
EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Jungle Temple");
}
if (item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalSkull || item.type == ItemID.MechanicalWorm || item.type == ItemID.SuspiciousLookingEye)
@@ -483,15 +483,6 @@ namespace CalamityMod.Items
if (item.type == ItemID.DeathSickle)
EditTooltipByNum(0, (line) => line.Text += "\nInflicts Whispering Death on hit");
if (item.type == ItemID.StarWrath || item.type == ItemID.NorthPole || item.type == ItemID.PsychoKnife)
EditTooltipByNum(0, (line) => line.Text += "\nReceives 33% benefit from melee speed bonuses");
if (item.type == ItemID.FetidBaghnakhs)
EditTooltipByName("Knockback", (line) => line.Text += "\nReceives 25% benefit from melee speed bonuses");
if (item.type == ItemID.BladedGlove)
EditTooltipByName("Knockback", (line) => line.Text += "\nReceives 50% benefit from melee speed bonuses");
#endregion
// Light pets, accessories, and other items which boost the player's Abyss light stat
@@ -672,24 +663,24 @@ namespace CalamityMod.Items
// Feral Claws line melee speed and true melee damage changes
if (item.type == ItemID.FeralClaws)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%"));
if (item.type == ItemID.TitanGlove)
EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage");
if (item.type == ItemID.PowerGlove)
{
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12%", "10%"));
EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage");
}
if (item.type == ItemID.BerserkerGlove)
{
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased true melee damage"));
}
if (item.type == ItemID.MechanicalGlove)
EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage");
EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage");
if (item.type == ItemID.FireGauntlet)
{
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire damage", "Hellfire"));
@@ -718,6 +709,14 @@ namespace CalamityMod.Items
// Falcon Blade +20% move speed while holding
if (item.type == ItemID.FalconBlade)
EditTooltipByName("Knockback", (line) => line.Text += "\nHolding this item grants +20% increased movement speed");
//Gi 10% melee speed into 10% jump speed replacement
if (item.type == ItemID.Gi)
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee", "jump"));
//Beetle Scale Mail melee speed buff
if (item.type == ItemID.BeetleScaleMail)
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6% increased movement and melee speed", "6% increased movement speed and 9% increased melee speed"));
#endregion
// Pre-Hardmode ore armor tooltip edits
@@ -816,6 +815,10 @@ namespace CalamityMod.Items
// Adamantite
if (item.type == ItemID.AdamantiteHeadgear)
EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {AdamantiteArmorSetChange.MaxManaBoost + 80}");
// Titanium
if (item.type == ItemID.TitaniumMask)
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9", "14"));
#endregion
// DD2 armor tooltip edits
@@ -878,7 +881,7 @@ namespace CalamityMod.Items
if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.BloodMoonStarter || item.type == ItemID.GoblinBattleStandard ||
item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing || item.type == ItemID.QueenSlimeCrystal ||
item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull ||
item.type == ItemID.NaughtyPresent ||item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet ||item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil)
item.type == ItemID.NaughtyPresent || item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet || item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil)
EditTooltipByNum(0, (line) => line.Text += "\nNot consumable");
#endregion
@@ -913,6 +916,10 @@ namespace CalamityMod.Items
if ((item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants)
&& !Main.LocalPlayer.Calamity().forbiddenCirclet)
EditTooltipByName("SetBonus", (line) => line.Text += "\nMinions no longer deal less damage while wielding magic weapons");
//Beetle Armor melee speed removal
if (item.type == ItemID.BeetleHelmet || item.type == ItemID.BeetleScaleMail || item.type == ItemID.BeetleLeggings)
EditTooltipByName("SetBonus", (line) => line.Text = line.Text.Replace("and speed", "by 10% per beetle"));
#endregion
// Provide the full stats of every vanilla set of wings
+3 -3
View File
@@ -328,7 +328,7 @@ namespace CalamityMod.Items
{ ItemID.NettleBurst, Do(ManaExact(10), DamageExact(43)) },
{ ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) },
{ ItemID.NightsEdge, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), DamageExact(76)) },
{ ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed, AttackSpeedExact(0.33f)) },
{ ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) },
{ ItemID.ObsidianShield, Do(DefenseDelta(+5)) },
{ ItemID.ObsidianSkull, Do(DefenseDelta(+1)) },
{ ItemID.ObsidianSkullRose, Do(DefenseExact(4)) },
@@ -391,7 +391,7 @@ namespace CalamityMod.Items
{ ItemID.Plum, Do(Value(Item.buyPrice(silver: 2))) },
{ ItemID.PoisonStaff, Do(DamageExact(57)) },
{ ItemID.Pomegranate, Do(Value(Item.buyPrice(silver: 2))) },
{ ItemID.PsychoKnife, Do(UseTurn, UseExact(11), AttackSpeedExact(0.5f), DamageRatio(3f)) },
{ ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageRatio(3f)) },
{ ItemID.PulseBow, Do(PointBlank, DamageRatio(1.2f)) },
{ ItemID.PumpkinMoonMedallion, nonConsumableBossSummon },
{ ItemID.PurpleClubberfish, Do(UseTurn, ScaleRatio(1.5f), DamageExact(45), KnockbackExact(10f)) },
@@ -491,7 +491,7 @@ namespace CalamityMod.Items
{ ItemID.Starfruit, Do(Value(Item.buyPrice(silver: 2))) },
{ ItemID.Starfury, autoReuse },
{ ItemID.PortableStool, Do(Value(Item.sellPrice(copper: 20))) }, // Step Stool
{ ItemID.StarWrath, Do(DamageRatio(0.9f), AttackSpeedExact(0.33f)) },
{ ItemID.StarWrath, Do(DamageRatio(0.9f)) },
{ ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff
{ ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), DamageExact(33)) },
{ ItemID.SuspiciousLookingEye, nonConsumableBossSummon },
@@ -30,6 +30,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
public override void UpdateSetBonusText(ref string setBonusText)
{
setBonusText = setBonusText.Replace("20% increased melee and movement speed", "15% increased melee speed and 20% increased movement speed");
setBonusText += "\nHalf of your current DR is added to your critical strike chance\n" +
$"Continuously doing damage makes you gradually gain more and more defense, up to a maximum of {DefenseBoostMax}\n" +
"When not doing damage, this bonus gradually decays\n" +
@@ -46,6 +47,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
break;
case ItemID.AdamantiteHelmet:
player.GetCritChance<MeleeDamageClass>() += critBoost;
player.GetAttackSpeed<MeleeDamageClass>() -= 0.05f;
break;
case ItemID.AdamantiteMask:
player.GetCritChance<RangedDamageClass>() += critBoost;
@@ -30,6 +30,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
public override void UpdateSetBonusText(ref string setBonusText)
{
setBonusText = setBonusText.Replace("15", "10");
setBonusText += $"\n{SpeedBoostSetBonusPercentage}% increased max speed and acceleration\n" +
$"You gain a damage and critical strike chance boost relative to your current movement speed, up to {SpeedBoostSetBonusPercentage}%";
}
@@ -51,6 +52,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
public override void ApplyArmorSetBonus(Player player)
{
player.GetAttackSpeed<MeleeDamageClass>() -= 0.05f;
player.Calamity().CobaltSet = true;
}
}
+3 -4
View File
@@ -17,7 +17,6 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
@@ -35,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.shoot = ModContent.ProjectileType<BrimstoneSwordProj>();
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shootSpeed = 20f;
Item.shootSpeed = 10f;
}
public override bool AltFunctionUse(Player player) => true;
@@ -44,11 +43,11 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (player.altFunctionUse == 2)
{
Item.noMelee = true;
Item.DamageType = DamageClass.MeleeNoSpeed;
}
else
{
Item.noMelee = false;
Item.DamageType = DamageClass.Melee;
}
return base.UseItem(player);
-4
View File
@@ -11,10 +11,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class CosmicShiv : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
-1
View File
@@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Melee
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 11));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
-4
View File
@@ -16,10 +16,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class DevilsDevastation : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
-4
View File
@@ -13,10 +13,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class ElementalShiv : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
-4
View File
@@ -15,10 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class GalactusBlade : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class GalaxySmasher : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static int BaseDamage = 1195;
public static int BaseDamage = 1300;
public static float Speed = 30f;
public override void SetDefaults()
-4
View File
@@ -11,10 +11,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class GalileoGladius : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
-4
View File
@@ -12,10 +12,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class Lucrecia : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice;
Item.rare = ItemRarityID.LightPurple;
Item.shoot = ModContent.ProjectileType<PwnagehammerProj>();
Item.shootSpeed = 38.4f;
Item.shootSpeed = 29.4f;
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class StellarContempt : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static int BaseDamage = 678;
public static int BaseDamage = 650;
public static float Speed = 25f;
public override void SetDefaults()
-4
View File
@@ -11,10 +11,6 @@ namespace CalamityMod.Items.Weapons.Melee
public class Swordsplosion : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
}
public override void SetDefaults()
{
-1
View File
@@ -13,7 +13,6 @@ namespace CalamityMod.Items.Weapons.Melee
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetStaticDefaults()
{
ItemID.Sets.BonusAttackSpeedMultiplier[Item.type] = 0.33f;
ItemID.Sets.Spears[Item.type] = true;
}
+20 -10
View File
@@ -1,7 +1,8 @@
using Terraria.DataStructures;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.knockBack = 2f;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.UseSound = SoundID.Item11;
Item.UseSound = SoundID.Item85;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<ArcherfishShot>();
Item.shootSpeed = 11f;
@@ -31,23 +32,32 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-10, -5);
}
public override Vector2? HoldoutOffset() => new Vector2(-10, -5);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
// Reposition to the gun's tip
Vector2 newPos = position + new Vector2(60f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
// Fires a spread of harmless bubbles
for (int i = 0; i < 4; i++)
{
Gore bubble = Gore.NewGorePerfect(source, newPos, velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * 0.5f, 411);
bubble.timeLeft = 6 + Main.rand.Next(4);
bubble.scale = Main.rand.NextFloat(0.6f, 0.8f);
bubble.type = Main.rand.NextBool(3) ? 412 : 411;
}
// Replaces standard bullets with water jets.
if (type == ProjectileID.Bullet)
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ArcherfishShot>(), damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, newPos, velocity, Item.shoot, damage, knockback, player.whoAmI);
else
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, newPos, velocity, type, damage, knockback, player.whoAmI);
// Always fires a close range water blast.
int waterRingDamage = (int)(damage * 0.5f);
float boostedKB = knockback + 5f;
Projectile.NewProjectile(source, position, velocity * 0.5f, ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
Projectile.NewProjectile(source, newPos, velocity * 0.5f, ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
return false;
}
+12 -15
View File
@@ -1,9 +1,10 @@
using Terraria.DataStructures;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -29,33 +30,29 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.rare = ItemRarityID.Lime;
Item.UseSound = SoundID.Item11;
Item.autoReuse = true;
Item.shoot = ProjectileID.PurificationPowder;
Item.shoot = ModContent.ProjectileType<ArcherfishShot>();
Item.shootSpeed = 16f;
Item.useAmmo = AmmoID.Bullet;
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
// Both bullets and water jets have very slight inaccuracy
float SpeedX = velocity.X + Main.rand.Next(-10, 11) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-10, 11) * 0.05f;
// Reposition to the gun's tip + add some inaccuracy
Vector2 newPos = position + new Vector2(64f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f));
// Fire either the bullet or the water jet, depending on cadence.
int projectileToFire = fireWater ? ModContent.ProjectileType<ArcherfishShot>() : type;
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, projectileToFire, damage, knockback, player.whoAmI, 0.0f, 0.0f);
int projectileToFire = fireWater ? Item.shoot : type;
Projectile.NewProjectile(source, newPos, newVel, projectileToFire, damage, knockback, player.whoAmI);
// Always fires a close range water blast.
// It goes in the same direction as the main shot but has a minor velocity variation to be less monotonous.
Vector2 waterRingVec = new Vector2(SpeedX, SpeedY) * Main.rand.NextFloat(0.5f, 0.6f);
int waterRingDamage = (int)(damage * 0.5f);
float boostedKB = knockback + 7f; // Stronger guaranteed KB than Archerfish for mid-late Hardmode
Projectile.NewProjectile(source, position, waterRingVec, ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
Projectile.NewProjectile(source, newPos, newVel * Main.rand.NextFloat(0.5f, 0.6f), ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
// Swap between firing bullets and water jets each shot.
fireWater = !fireWater;
+11 -16
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -34,34 +35,30 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.rare = ModContent.RarityType<Turquoise>();
Item.UseSound = SoundID.Item11;
Item.autoReuse = true;
Item.shoot = ProjectileID.PurificationPowder;
Item.shoot = ModContent.ProjectileType<ArcherfishShot>();
Item.shootSpeed = 16f;
Item.useAmmo = AmmoID.Bullet;
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-10, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
// Both bullets and water jets have very slight inaccuracy
float SpeedX = velocity.X + Main.rand.Next(-10, 11) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-10, 11) * 0.05f;
// Reposition to the gun's tip + add some inaccuracy
Vector2 newPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f));
// Fire either the bullet or the water jet, depending on cadence.
bool fireWater = shotCounter % 2 == 0;
int projectileToFire = fireWater ? ModContent.ProjectileType<ArcherfishShot>() : type;
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, projectileToFire, damage, knockback, player.whoAmI, 0.0f, 0.0f);
int projectileToFire = fireWater ? Item.shoot : type;
Projectile.NewProjectile(source, newPos, newVel, projectileToFire, damage, knockback, player.whoAmI);
// Always fires a close range water blast.
// It goes in the same direction as the main shot but has a minor velocity variation to be less monotonous.
Vector2 waterRingVec = new Vector2(SpeedX, SpeedY) * Main.rand.NextFloat(0.45f, 0.65f);
int waterRingDamage = (int)(damage * 0.5f);
float boostedKB = knockback + 7f; // Same KB bonus as Megalodon. The muzzle blast will annihilate nearby enemies and send their gibs flying.
Projectile.NewProjectile(source, position, waterRingVec, ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
Projectile.NewProjectile(source, newPos, newVel * Main.rand.NextFloat(0.45f, 0.65f), ModContent.ProjectileType<ArcherfishRing>(), waterRingDamage, boostedKB, player.whoAmI);
// Check cadence position to determine which bonus projectile to add, if any.
bool fireRocket = shotCounter == 9;
@@ -70,19 +67,17 @@ namespace CalamityMod.Items.Weapons.Ranged
// Rockets have their own more chaotic spread than bullets.
if (fireRocket)
{
Vector2 rocketVec = velocity.SafeNormalize(Vector2.Zero).RotatedBy(Main.rand.NextFloat(-0.25f, 0.25f)) * 25f;
int rocketDamage = damage * 5;
Projectile.NewProjectile(source, position, rocketVec, ModContent.ProjectileType<SeaDragonRocket>(), rocketDamage, knockback, player.whoAmI);
Projectile.NewProjectile(source, newPos, newVel * 1.2f, ModContent.ProjectileType<SeaDragonRocket>(), rocketDamage, knockback, player.whoAmI);
SoundEngine.PlaySound(SoundID.Item109, player.Center);
}
// Muzzle blasts are always directly in line with the gun's muzzle.
if (muzzleBlast)
{
Vector2 muzzleBlastVec = velocity.SafeNormalize(Vector2.Zero) * 18f;
int muzzleBlastDamage = damage * 25; // This might be too much but it's every 18th shot...
float muzzleBlastKB = knockback + 12f;
Projectile.NewProjectile(source, position+player.DirectionTo(Main.MouseWorld)*48f, muzzleBlastVec, ModContent.ProjectileType<SeaDragonMuzzleBlast>(), muzzleBlastDamage, muzzleBlastKB, player.whoAmI);
Projectile.NewProjectile(source, newPos, velocity, ModContent.ProjectileType<SeaDragonMuzzleBlast>(), muzzleBlastDamage, muzzleBlastKB, player.whoAmI);
// Play additional sound for muzzle blasts
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, position);
@@ -208,7 +208,6 @@ BrimstoneSword: {
'''
Summons brimstone geysers on hit
Press <right> to throw the sword like a javelin that explodes on hit
Receives 33% benefit from melee speed bonuses
'''
}
@@ -289,7 +288,6 @@ CosmicShiv: {
'''
Fires a cosmic beam that homes in on enemies
Upon hitting an enemy, a barrage of offscreen objects home in on the enemy as well as raining stars
Receives 33% benefit from melee speed bonuses
'''
}
@@ -328,11 +326,7 @@ DepthCrusher: {
Devastation: {
DisplayName: Devastation
Tooltip:
'''
Fires galaxy blasts that explode
Receives 33% benefit from melee speed bonuses
'''
Tooltip: Fires galaxy blasts that explode
}
DevilsDevastation: {
@@ -342,7 +336,6 @@ DevilsDevastation: {
Fires a spread of demonic scythes
Pitchforks rise from the underworld to skewer your foes
Critical hits cause shadowflame explosions
Receives 33% benefit from melee speed bonuses
'''
}
@@ -416,11 +409,7 @@ ElementalLance: {
ElementalShiv: {
DisplayName: Elemental Shiv
Tooltip:
'''
Shoots a rainbow shiv that spawns additional shivs on hit
Receives 33% benefit from melee speed bonuses
'''
Tooltip: Shoots a rainbow shiv that spawns additional shivs on hit
}
EmpyreanKnives: {
@@ -574,7 +563,6 @@ GalactusBlade: {
Tooltip:
'''
Launches a barrage of comets from the sky
Receives 33% benefit from melee speed bonuses
Forged with the fury of nuclear chaos
'''
}
@@ -596,7 +584,6 @@ GalileoGladius: {
'''
Shoots a homing crescent moon
Spawns planetoids on enemy hits
Receives 33% benefit from melee speed bonuses
'Don't underestimate the power of small space swords'
'''
}
@@ -728,7 +715,6 @@ Lucrecia: {
'''
Striking an enemy makes you immune for a short time
Fires a DNA chain
Receives 33% benefit from melee speed bonuses
Finesse
'''
}
@@ -1153,7 +1139,6 @@ Swordsplosion: {
Tooltip:
'''
Fires multiple rainbow beam swords that rain from the sky
Receives 33% benefit from melee speed bonuses
Sword swarm
'''
}
@@ -1169,7 +1154,6 @@ TenebreusTides: {
'''
Shoots a water spear that pierces enemies and terrain
Striking enemies summon liquid blades and spears to assault the struck foe
Receives 33% benefit from melee speed bonuses
'Inundatio ex Laminis'
'''
}
@@ -63,6 +63,7 @@ FlareDust.DisplayName: Flare Dust
FlareDust2.DisplayName: Flare Bomb
Flarenado.DisplayName: Flarenado
FrostMist.DisplayName: Frost Mist
GooglyEye.DisplayName: Googly Eye
GreatSandBlast.DisplayName: Great Sand Blast
HealOrbProv.DisplayName: Heal
HellfireExplosion.DisplayName: Brimstone Hellfire Explosion
+4 -1
View File
@@ -63,10 +63,13 @@ namespace CalamityMod.NPCs.NormalNPCs
{
NPC.TargetClosest();
// Emit light
Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.2f, 0.4f, 0.1f);
// Spore dust
if (Main.rand.NextBool(10))
{
Dust dust = Dust.NewDustDirect(NPC.position, NPC.width, NPC.height, 44, 0f, 0f, 250, default, 0.2f);
Dust dust = Dust.NewDustDirect(NPC.position, NPC.width, NPC.height, 44, 0f, 0f, 250, default, 0.4f);
dust.fadeIn = 0.7f;
}
+13
View File
@@ -16,6 +16,7 @@ using CalamityMod.Balancing;
namespace CalamityMod.NPCs.Other
{
[AutoloadBossHead]
// I would like to say first and foremost, that 95% of this is directly ported from his code when he got removed in early 2018
public class THELORDE : ModNPC
{
@@ -555,6 +556,18 @@ namespace CalamityMod.NPCs.Other
return false;
}
public override void OnKill()
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
for (int i = 0; i < 2; i++)
{
Vector2 speed = new Vector2(Main.rand.NextFloat(-10, 10), Main.rand.NextFloat(-10, 10));
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, speed, ModContent.ProjectileType<GooglyEye>(), 0, 0f, Main.myPlayer);
}
}
}
public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float bossLifeScale, float anotherthing)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.5f * bossLifeScale);
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+21 -16
View File
@@ -64,9 +64,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas
public const int FourthBulletHellEndValue = BulletHellDuration * 4;
public const int FifthBulletHellEndValue = BulletHellDuration * 5;
public const int CirrusPhotonRipperDamage = 3725;
private const float CirrusPhotonRipperDashVelocity = 8f;
private const float CirrusPhotonRipperDashVelocity = 6f;
private const float CirrusPhotonRipperMinDistanceFromTarget = 64f;
private const float CirrusPhotonRipperDashAcceleration = 0.4f;
private const float CirrusPhotonRipperDashAcceleration = 0.3f;
public float bossLife;
public float uDieLul = 1f;
@@ -1237,7 +1237,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
if (!bossRush)
{
if (DownedBossSystem.downedCalamitas)
if (DownedBossSystem.downedCalamitas && !cirrus)
key += "Rematch";
CalamityUtils.DisplayLocalizedText(key, cirrus ? cirrusTextColor : textColor);
@@ -1261,9 +1261,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Vector2 circleOffset = player.Center + (Vector2.UnitY * 640f).RotatedBy(MathHelper.ToRadians(blasterTimer * 3f));
NPC.Center = circleOffset;
int blasterDivisor = (int)Math.Floor(5 / uDieLul);
int blasterDivisor = 5;
if (blasterTimer % blasterDivisor == 0)
Projectile.NewProjectile(NPC.GetSource_FromAI(), circleOffset, player.Center, ModContent.ProjectileType<CirrusBlaster>(), 500, 0f, Main.myPlayer);
{
if (Main.netMode != NetmodeID.MultiplayerClient)
Projectile.NewProjectile(NPC.GetSource_FromAI(), circleOffset, player.Center, ModContent.ProjectileType<CirrusBlaster>(), 500, 0f, Main.myPlayer, 0f, 1f);
}
int beamDivisor = 60;
if (blasterTimer % beamDivisor == 0)
@@ -1272,15 +1275,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
float radians = MathHelper.TwoPi / totalProjectiles;
float velocity = 12f * uDieLul;
Vector2 spinningPoint = new Vector2(0f, -velocity);
for (int k = 0; k < totalProjectiles; k++)
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 rayVelocity = spinningPoint.RotatedBy(radians * k);
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(rayVelocity) * 16f, rayVelocity, ModContent.ProjectileType<Projectiles.Magic.FabRay>(), 350, 0f, Main.myPlayer);
if (proj.WithinBounds(Main.maxProjectiles))
for (int k = 0; k < totalProjectiles; k++)
{
Main.projectile[proj].DamageType = DamageClass.Default;
Main.projectile[proj].friendly = false;
Main.projectile[proj].hostile = true;
Vector2 rayVelocity = spinningPoint.RotatedBy(radians * k);
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(rayVelocity) * 16f, rayVelocity, ModContent.ProjectileType<Projectiles.Magic.FabRay>(), 350, 0f, Main.myPlayer);
if (proj.WithinBounds(Main.maxProjectiles))
{
Main.projectile[proj].DamageType = DamageClass.Default;
Main.projectile[proj].friendly = false;
Main.projectile[proj].hostile = true;
}
}
}
}
@@ -1297,6 +1303,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.CirrusGiveUpText", cirrusTextColor);
Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, Color.Pink);
NPC.Center = initialRitualPosition;
giveUpCounter--;
}
else
{
@@ -3146,11 +3153,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Texture2D texture2D15 = DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive ? TextureAssets.Npc[NPC.type].Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasHooded").Value;
Texture2D pony = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/AlicornMount_Front").Value;
bool inPhase2 = NPC.ai[0] >= 3f && (NPC.life > NPC.lifeMax * 0.01 || cirrus);
if (cirrus)
{
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCirrus").Value;
}
texture2D15 = inPhase2 ? ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCirrus_Shimmered").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCirrus").Value;
Vector2 vector11 = new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type] / 2f);
Vector2 ponyOrigin = new Vector2(pony.Width / 2f, pony.Height / 30f);
@@ -3179,7 +3185,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
}
}
bool inPhase2 = NPC.ai[0] >= 3f && NPC.life > NPC.lifeMax * 0.01;
Vector2 vector43 = NPC.Center - screenPos;
vector43 -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
+25 -2
View File
@@ -327,14 +327,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Emit spore gas in phase 3
else if (npc.ai[3] <= BeginChargeGateValue)
{
float sporeGasDashGateValue = death ? 6f : 8f;
float sporeGasDashGateValue = death ? 4f : 6f;
if (phase3 && npc.ai[3] % sporeGasDashGateValue == 0f)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int projectileType = ModContent.ProjectileType<SporeGasPlantera>();
int damage = npc.GetProjectileDamage(projectileType);
Vector2 projectileVelocity = npc.velocity * Main.rand.NextVector2CircularEdge(0.05f, 0.05f);
Vector2 projectileVelocity = npc.velocity * Main.rand.NextVector2CircularEdge(0.2f, 0.2f);
float ai0 = Main.rand.Next(3);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * 30f, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, ai0);
}
@@ -380,6 +380,23 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Dust dust = Dust.NewDustDirect(npc.Center, npc.width, npc.height, 44, dustVelocity.X, dustVelocity.Y, 250, default, 0.8f);
dust.fadeIn = 0.7f;
}
// Vomit spread of spore gas
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int totalProjectiles = 12;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ModContent.ProjectileType<SporeGasPlantera>();
int damage = npc.GetProjectileDamage(type);
float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f;
Vector2 spinningPoint = new Vector2(0f, -velocity2);
for (int k = 0; k < totalProjectiles; k++)
{
Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k);
float ai0 = Main.rand.Next(3);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * 50f, projectileVelocity * Main.rand.NextFloat(0.8f, 1.2f), type, damage, 0f, Main.myPlayer, ai0);
}
}
}
// Rotation
@@ -500,6 +517,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Phase 2
else
{
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.4f, 0.8f, 0.2f);
// Spore dust
if (Main.rand.NextBool(10))
{
@@ -847,6 +867,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Percent life remaining
float lifeRatio = npc.life / (float)npc.lifeMax;
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.4f, 0.1f);
// Spore dust
if (Main.rand.NextBool(10))
{
+1 -1
View File
@@ -204,7 +204,7 @@ namespace CalamityMod.Projectiles.Boss
for (int l = 0; l < Player.MaxBuffs; l++)
{
int buffType = target.buffType[l];
if (!CalamityLists.debuffList.Contains(buffType))
if (target.buffTime[l] > 0 && CalamityLists.amalgamBuffList.Contains(buffType))
{
target.DelBuff(l);
l--;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss
// Die if Cirrus shouldn't be using it.
int cirrusBulletHellCounter = Cirrus.ModNPC<SupremeCalamitas>().bulletHellCounter2;
if (!(cirrusBulletHellCounter > SupremeCalamitas.SecondBulletHellEndValue && cirrusBulletHellCounter < SupremeCalamitas.SecondBulletHellEndValue) &&
if (!(cirrusBulletHellCounter > SupremeCalamitas.SecondBulletHellEndValue && cirrusBulletHellCounter < SupremeCalamitas.ThirdBulletHellEndValue) &&
!(cirrusBulletHellCounter > SupremeCalamitas.FourthBulletHellEndValue && cirrusBulletHellCounter < SupremeCalamitas.FifthBulletHellEndValue))
{
Projectile.Kill();
+54
View File
@@ -0,0 +1,54 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class GooglyEye : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public ref float Time => ref Projectile.ai[0];
public override void SetDefaults()
{
Projectile.width = Projectile.height = 26;
Projectile.ignoreWater = true;
Projectile.tileCollide = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 480;
}
public override void AI()
{
if (Time < 5f)
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
else
Projectile.rotation += (Projectile.velocity.X > 0f).ToDirectionInt() * Projectile.velocity.Length() * 0.018f;
if (Projectile.timeLeft < 90)
Projectile.Opacity = Projectile.timeLeft / 90f;
Projectile.velocity.Y = MathHelper.Clamp(Projectile.velocity.Y + 0.325f, -25f, 25f);
Time++;
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
// Stop bouncing after a certain degree of slowness has been reached.
if (Projectile.velocity.Length() < 3f)
{
Projectile.velocity = Vector2.Zero;
return false;
}
if (Projectile.velocity.X != oldVelocity.X)
Projectile.velocity.X = -oldVelocity.X;
if (Projectile.velocity.Y != oldVelocity.Y)
Projectile.velocity.Y = -oldVelocity.Y * 0.75f;
Projectile.velocity *= 0.8f;
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

+2
View File
@@ -74,6 +74,8 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override Color? GetAlpha(Color lightColor) => new Color(255, 255, 255, Projectile.alpha);
public override void Kill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.NPCDeath1, Projectile.Center);
+5 -5
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.height = 14;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.Opacity = 0f;
Projectile.Opacity = 0.25f;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.aiStyle = ProjAIStyleID.Arrow;
@@ -34,10 +34,10 @@ namespace CalamityMod.Projectiles.Boss
{
if (Projectile.velocity.Y > 0f)
{
if (Projectile.Opacity == 0f)
if (Projectile.Opacity < 1f)
{
Projectile.Opacity = 1f;
SoundEngine.PlaySound(SoundID.Item44, Projectile.Center);
SoundEngine.PlaySound(SoundID.Item21, Projectile.Center);
int dustAmount = 36;
for (int i = 0; i < dustAmount; i++)
{
@@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss
int height = texture.Height / Main.projFrames[Projectile.type];
int drawStart = height * Projectile.frame;
Vector2 origin = Projectile.Size / 2;
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MushBombGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MushBombGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0);
}
public override void Kill(int timeLeft)
+5 -5
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.height = 14;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.Opacity = 0f;
Projectile.Opacity = 0.25f;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
}
@@ -34,10 +34,10 @@ namespace CalamityMod.Projectiles.Boss
{
if (Projectile.velocity.Y > 0f)
{
if (Projectile.Opacity == 0f)
if (Projectile.Opacity < 1f)
{
Projectile.Opacity = 1f;
SoundEngine.PlaySound(SoundID.Item44, Projectile.Center);
SoundEngine.PlaySound(SoundID.Item21, Projectile.Center);
int dustAmount = 36;
for (int i = 0; i < dustAmount; i++)
{
@@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0);
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0);
return false;
}
@@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss
int height = texture.Height / Main.projFrames[Projectile.type];
int drawStart = height * Projectile.frame;
Vector2 origin = Projectile.Size / 2;
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MushBombGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MushBombGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
}
public override void Kill(int timeLeft)
+1
View File
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.DamageType = DamageClass.Melee;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.extraUpdates = 1;
}
public override void AI()
@@ -14,6 +14,7 @@ namespace CalamityMod.Projectiles.Melee
public new string LocalizationCategory => "Projectiles.Melee";
public static readonly SoundStyle SlamHamSound = new("CalamityMod/Sounds/Item/FallenPaladinsHammerBigImpact") { Volume = 1f};
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public float speed = 0f;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
@@ -40,7 +41,12 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
speed = Projectile.velocity.Length();
Projectile.ai[0] += 1f;
if (Projectile.ai[0] > 55f)
{
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
}
if (Projectile.ai[0] < 42f)
{
Projectile.velocity *= 0.9575f;
+6
View File
@@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Melee
public static readonly SoundStyle SlamHamSound = new("CalamityMod/Sounds/Item/StellarContemptImpact") { Volume = 1f };
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public float rotatehammer = 35f;
public float speed = 0f;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
@@ -44,6 +45,11 @@ namespace CalamityMod.Projectiles.Melee
rotatehammer *= 1.2f;
Projectile.rotation += MathHelper.ToRadians(rotatehammer) * Projectile.direction;
Projectile.ai[0] += 1f;
speed = Projectile.velocity.Length();
if (Projectile.ai[0] > 55f)
{
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
}
if (Projectile.ai[0] < 42f)
{
Projectile.velocity *= 0.9575f;
+1 -1
View File
@@ -178,7 +178,7 @@ namespace CalamityMod.Projectiles.Melee
else
{
SoundEngine.PlaySound(RedHamSound, Projectile.Center);
int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType<GalaxySmasherEcho>(), Projectile.damage * 9, Projectile.knockBack * 2.5f, Projectile.owner, 0f, Projectile.ai[1]);
int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType<GalaxySmasherEcho>(), Projectile.damage * 10, Projectile.knockBack * 2.5f, Projectile.owner, 0f, Projectile.ai[1]);
Main.projectile[hammer].localAI[0] = Math.Sign(Projectile.velocity.X);
Main.projectile[hammer].netUpdate = true;
Projectile.Kill();
+6
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Melee
public static readonly SoundStyle BigSound = new("CalamityMod/Sounds/Item/PwnagehammerBigImpact");
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public int Explodamage = 0;
public float speed = 0f;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7;
@@ -41,7 +42,12 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
speed = Projectile.velocity.Length();
Projectile.ai[0] += 1f;
if (Projectile.ai[0] > 55f)
{
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
}
if (Projectile.ai[0] < 42f)
{
Projectile.velocity.Y *= 0.9575f;
+6
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Melee
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public float rotatehammer = 35f;
public int ColorAlpha = 225;
public float speed = 0f;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
@@ -47,6 +48,11 @@ namespace CalamityMod.Projectiles.Melee
rotatehammer--;
Projectile.rotation += MathHelper.ToRadians(rotatehammer) * Projectile.direction;
Projectile.ai[0] += 1f;
speed = Projectile.velocity.Length();
if (Projectile.ai[0] > 55f)
{
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
}
if (Projectile.ai[0] < 42f)
{
Projectile.velocity *= 0.9575f;
+44 -25
View File
@@ -3,16 +3,17 @@ using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Ranged
{
public class ArcherfishRing : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Particles/HollowCircleHardEdge";
public static readonly SoundStyle PopSound = new("CalamityMod/Sounds/Custom/BubblyPop") { PitchVariance = 0.5f, Volume = 0.66f };
public override void SetDefaults()
{
@@ -23,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.ignoreWater = true;
Projectile.penetrate = 2;
Projectile.tileCollide = false;
Projectile.alpha = 115;
Projectile.alpha = 15;
Projectile.timeLeft = 300;
Projectile.MaxUpdates = 3;
Projectile.usesLocalNPCImmunity = true;
@@ -31,44 +32,62 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size(), scale: Projectile.scale);
public override void AI()
{
//The ring expanding slowing while increasing opacity until it disappears at max size
if (Projectile.ai[0] == 0)
if (Projectile.ai[0] == 0f)
{
Projectile.scale = 0.2f;
Projectile.ai[0]++;
Projectile.scale = 0.5f;
Projectile.ai[0]++;
}
if (Projectile.scale <= 1.5f)
{
Projectile.scale *= 1.035f;
}
if (Projectile.velocity.X > -0.8f && Projectile.velocity.X < 0.8f &
Projectile.velocity.Y > -0.8f && Projectile.velocity.Y < 0.8f)
{
Projectile.alpha += 10;
}
if (Projectile.alpha >= 255)
{
Projectile.Kill();
}
Projectile.scale *= 1.015f;
else
{
Projectile.velocity *= 0.95f;
}
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.scale = 1.5f;
if (Projectile.velocity.Length() < 0.08f)
Projectile.alpha += 15;
if (Projectile.alpha >= 255)
Projectile.Kill();
else
Projectile.velocity *= 0.95f;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
//Audio feedback for hitting the ring
Player user = Main.player[Projectile.owner];
SoundEngine.PlaySound(SoundID.Item21, Projectile.position);
SoundEngine.PlaySound(PopSound, Projectile.Center);
target.AddBuff(BuffID.Wet, 240);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Vector2 ringScale = Projectile.Size / tex.Size() * Projectile.scale;
Color ringColor = Color.Lerp(Color.DodgerBlue, Color.Blue, Projectile.Opacity) * Projectile.Opacity * 1.2f;
Main.spriteBatch.EnterShaderRegion(BlendState.Additive);
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, ringColor, Projectile.rotation, tex.Size() / 2f, ringScale, SpriteEffects.None);
Main.spriteBatch.ExitShaderRegion();
return false;
}
public override void Kill(int timeLeft)
{
float totalDusts = 18f;
for (float i = 0f; i < totalDusts; i++)
{
Vector2 ringSpeed = new Vector2((float)Math.Cos(i / totalDusts * MathHelper.TwoPi), (float)Math.Sin(i / totalDusts * MathHelper.TwoPi) * 0.5f).RotatedBy(Projectile.rotation) * 4f * Projectile.scale;
Dust droplets = Dust.NewDustPerfect(Projectile.Center, 211, ringSpeed, 100);
droplets.noGravity = true;
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

+20 -96
View File
@@ -29,112 +29,36 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
if (Projectile.localAI[0] < 5f)
// Bubbles
if (Main.rand.NextBool(2))
{
Projectile.localAI[0] += 1f;
return;
Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411);
bubble.timeLeft = 9 + Main.rand.Next(7);
bubble.scale = Main.rand.NextFloat(0.6f, 1f);
bubble.type = Main.rand.NextBool(3) ? 412 : 411;
}
int num3;
for (int num586 = 0; num586 < 1; num586 = num3 + 1)
// Water trail
for (int i = 0; i < 6; i++)
{
for (int num587 = 0; num587 < 6; num587 = num3 + 1)
{
float num588 = Projectile.velocity.X / 6f * (float)num587;
float num589 = Projectile.velocity.Y / 6f * (float)num587;
int num590 = 6;
int num591 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num590, Projectile.position.Y + (float)num590), Projectile.width - num590 * 2, Projectile.height - num590 * 2, 211, 0f, 0f, (int)CalamityDusts.SulfurousSeaAcid, default, 1.2f);
Dust dust;
if (Main.rand.NextBool(2))
{
dust = Main.dust[num591];
dust.alpha += 25;
}
if (Main.rand.NextBool(2))
{
dust = Main.dust[num591];
dust.alpha += 25;
}
if (Main.rand.NextBool(2))
{
dust = Main.dust[num591];
dust.alpha += 25;
}
Main.dust[num591].noGravity = true;
dust = Main.dust[num591];
dust.velocity *= 0.3f;
dust = Main.dust[num591];
dust.velocity += Projectile.velocity * 0.5f;
Main.dust[num591].position = Projectile.Center;
Dust var_2_18F52_cp_0_cp_0 = Main.dust[num591];
var_2_18F52_cp_0_cp_0.position.X -= num588;
Dust var_2_18F74_cp_0_cp_0 = Main.dust[num591];
var_2_18F74_cp_0_cp_0.position.Y -= num589;
dust = Main.dust[num591];
dust.velocity *= 0.2f;
num3 = num587;
}
if (Main.rand.NextBool(4))
{
int num592 = 6;
int num593 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num592, Projectile.position.Y + (float)num592), Projectile.width - num592 * 2, Projectile.height - num592 * 2, 211, 0f, 0f, (int)CalamityDusts.SulfurousSeaAcid, default, 0.65f);
Dust dust = Main.dust[num593];
dust.velocity *= 0.5f;
dust = Main.dust[num593];
dust.velocity += Projectile.velocity * 0.5f;
}
num3 = num586;
Dust water = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 211, 0f, 0f, 100);
water.noGravity = true;
water.velocity = Projectile.velocity * 0.5f;
}
}
public override void Kill(int timeLeft)
{
Projectile.velocity = Projectile.oldVelocity * 0.2f;
int num3;
for (int num362 = 0; num362 < 100; num362 = num3 + 1)
// Bubbles
for (int i = 0; i < 10; i++)
{
int num363 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 211, 0f, 0f, (int)CalamityDusts.SulfurousSeaAcid, default, 1.2f);
Dust dust;
if (Main.rand.NextBool(2))
{
dust = Main.dust[num363];
dust.alpha += 25;
}
if (Main.rand.NextBool(2))
{
dust = Main.dust[num363];
dust.alpha += 25;
}
if (Main.rand.NextBool(2))
{
dust = Main.dust[num363];
dust.alpha += 25;
}
if (Main.rand.NextBool(2))
{
Main.dust[num363].scale = 0.6f;
}
else
{
Main.dust[num363].noGravity = true;
}
dust = Main.dust[num363];
dust.velocity *= 0.3f;
dust = Main.dust[num363];
dust.velocity += Projectile.velocity;
dust = Main.dust[num363];
dust.velocity *= 1f + (float)Main.rand.Next(-100, 101) * 0.01f;
Dust expr_C6F7_cp_0_cp_0 = Main.dust[num363];
expr_C6F7_cp_0_cp_0.velocity.X += (float)Main.rand.Next(-50, 51) * 0.015f;
Dust expr_C726_cp_0_cp_0 = Main.dust[num363];
expr_C726_cp_0_cp_0.velocity.Y += (float)Main.rand.Next(-50, 51) * 0.015f;
Main.dust[num363].position = Projectile.Center;
num3 = num362;
Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(60f)) * 0.3f, 411);
bubble.timeLeft = 9 + Main.rand.Next(7);
bubble.scale = Main.rand.NextFloat(0.6f, 1f);
bubble.type = Main.rand.NextBool(3) ? 412 : 411;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Wet, 240);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Wet, 240);
}
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.45f;
// Activate shot behavior if the owner stops channeling or otherwise cannot use the weapon.
bool activatingShoot = ShootDelay <= 0 && Main.mouseLeft && !Main.mapFullscreen && !Main.blockMouse;
bool activatingShoot = ShootDelay <= 0 && Main.mouseLeft && !Main.mapFullscreen && !Owner.mouseInterface;
if (Main.myPlayer == Projectile.owner && OwnerCanShoot && activatingShoot)
{
SoundEngine.PlaySound(HeavenlyGale.FireSound, Projectile.Center);
@@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Summon
// Determine whether the cannon is being fired based on the left mouse state.
bool wasFiring = IsFiring;
IsFiring = Main.mouseLeft && !Main.blockMouse;
IsFiring = Main.mouseLeft && !Owner.mouseInterface;
// Notify other clients and the server if the cannon's firing state has changed. This sync cannot be blocked by the net spam threshold.
if (wasFiring != IsFiring)
Binary file not shown.
+4 -4
View File
@@ -12,17 +12,17 @@ namespace CalamityMod
/// <param name="targetTopLeft">The top left coordinates of the target to check.</param>
/// <param name="targetHitboxDimensions">The hitbox size of the target to check.</param>
/// <param name="directionOverride">An optional direction override</param>
public static bool RotatingHitboxCollision(this Entity entity, Vector2 targetTopLeft, Vector2 targetHitboxDimensions, Vector2? directionOverride = null)
public static bool RotatingHitboxCollision(this Entity entity, Vector2 targetTopLeft, Vector2 targetHitboxDimensions, Vector2? directionOverride = null, float scale = 1f)
{
Vector2 lineDirection = directionOverride ?? entity.velocity;
// Ensure that the line direction is a unit vector.
lineDirection = lineDirection.SafeNormalize(Vector2.UnitY);
Vector2 start = entity.Center - lineDirection * entity.height * 0.5f;
Vector2 end = entity.Center + lineDirection * entity.height * 0.5f;
Vector2 start = entity.Center - lineDirection * entity.height * 0.5f * scale;
Vector2 end = entity.Center + lineDirection * entity.height * 0.5f * scale;
float _ = 0f;
return Collision.CheckAABBvLineCollision(targetTopLeft, targetHitboxDimensions, start, end, entity.width, ref _);
return Collision.CheckAABBvLineCollision(targetTopLeft, targetHitboxDimensions, start, end, entity.width * scale, ref _);
}
/// <summary>