Merge branch '1.4.4' into MageAccessories

This commit is contained in:
sunny-raindrops committed 2026-02-19 08:53:56 -08:00
commit 12be49b19d
77 files changed
+621 -169

No files matched your search

+17 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.DataStructures;
using System;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
@@ -10,8 +11,22 @@ namespace CalamityMod.Buffs.DamageOverTime
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
HeatDebuffScaling = 2
HeatDebuffScaling = 2,
NPCLifeRegenMethod = CragsLavaScaling
};
public static void CragsLavaScaling(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
//Applies the double Heat scaling but completely ignores NPC weakness/resistance to heat.
//We need to apply slimed as that isn't included in HeatDebuffMultiplier due to needing to dynamically update if slimed is applied
StatModifier multiplier = npc.Calamity().HeatDebuffMultiplier;
if (npc.drippingSlime || npc.drippingSparkleSlime)
multiplier += 1f;
int dotValue = (int)DebuffData.ApplyScalingToStatModifer(multiplier, debuffData.HeatDebuffScaling).ApplyTo(debuffData.EnemyLostRegen);
npc.Calamity().ApplyDPSDebuff(dotValue, (int)Math.Max(dotValue * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
+2 -2
View File
@@ -37,8 +37,8 @@ namespace CalamityMod.Buffs.Summon
public override void Update(Player player, ref int buffIndex)
{
BuffOwner ??= player;
BuffModdedOwner ??= player.Calamity();
BuffOwner = player;
BuffModdedOwner = player.Calamity();
if (player.ownedProjectileCounts[MinionProjectileType] > 0)
MinionBool = true;
+8 -3
View File
@@ -1463,7 +1463,6 @@ namespace CalamityMod.CalPlayer
public bool redWine = false;
public float redWineStoredY = 0;
public bool grapeBeer = false;
public int grapeBeerTimer = 0;
public bool moonshine = false;
public bool rum = false;
public bool whiskey = false;
@@ -2753,8 +2752,6 @@ namespace CalamityMod.CalPlayer
vodka = false;
redWine = false;
grapeBeer = false;
if (grapeBeerTimer > 0)
grapeBeerTimer--;
moonshine = false;
rum = false;
whiskey = false;
@@ -3819,6 +3816,14 @@ namespace CalamityMod.CalPlayer
if (godSlayer && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && !Player.HasCooldown(GodSlayerDash.ID) && Player.dashDelay == 0)
{
godSlayerDashHotKeyPressed = true;
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == ProjectileType<RelicOfDeliveranceSpear>() && Player.whoAmI == p.owner)
{
(p.ModProjectile as RelicOfDeliveranceSpear).KillProj();
return;
}
}
}
}
+16 -7
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Events;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
@@ -30,7 +31,6 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.UI;
namespace CalamityMod.CalPlayer
{
@@ -49,15 +49,15 @@ namespace CalamityMod.CalPlayer
// If the player does get a crate (can be from the reroll above), give it increased chances of being rarer
if (attempt.crate)
{
int uncommonRate = Math.Clamp(240 / attempt.fishingLevel, 3, 240); // Iron/Mythril (originally 300)
int uncommonRate = Math.Clamp(240 / attempt.fishingLevel, 3, 240); // Iron/Mythril (originally 300)
attempt.uncommon = Main.rand.NextBool(uncommonRate);
// These roll result bools are individually stored for the rarifying visuals
int rareRate = Math.Clamp(840 / attempt.fishingLevel, 4, 840); // Biome (originally 1050)
int rareRate = Math.Clamp(840 / attempt.fishingLevel, 4, 840); // Biome (originally 1050)
bool rareRoll = Main.rand.NextBool(rareRate);
attempt.rare = rareRoll;
int veryRareRate = Math.Clamp(1800 / attempt.fishingLevel, 5, 1800); // Golden/Titanium (originally 2250)
int veryRareRate = Math.Clamp(1800 / attempt.fishingLevel, 5, 1800); // Golden/Titanium (originally 2250)
bool veryRareRoll = Main.rand.NextBool(veryRareRate);
attempt.veryrare = veryRareRoll;
@@ -86,6 +86,13 @@ namespace CalamityMod.CalPlayer
}
#endregion
public override bool? CanConsumeBait(Item bait)
{
if (bait.type == ModContent.ItemType<BloodwormItem>())
return true;
return null;
}
#region Catch Fish
public override void CatchFish(FishingAttempt attempt, ref int itemDrop, ref int npcSpawn, ref AdvancedPopupRequest sonar, ref Vector2 sonarPosition)
{
@@ -128,7 +135,7 @@ namespace CalamityMod.CalPlayer
// Fishing in lava overrides the rest of logic
if (lava)
{
// Don't do anything if you can't fish in lava
// Don't do anything if you can't fish in lava
if (!attempt.CanFishInLava)
return;
@@ -177,8 +184,10 @@ namespace CalamityMod.CalPlayer
// Old Duke spawn
if (canSulphurFish && bait == ModContent.ItemType<BloodwormItem>() && !BossRushEvent.BossRushActive)
{
CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType<OldDuke>(), bait);
if (!Main.projectile.Any(x => x.active && x.aiStyle == ProjAIStyleID.Bobber && x.ai[1] != 0 && x.localAI[1] == ModContent.NPCType<OldDuke>() * -1))
npcSpawn = ModContent.NPCType<OldDuke>();
itemDrop = -1;
sonar.Text = "";
return;
}
@@ -246,7 +255,7 @@ namespace CalamityMod.CalPlayer
return;
// Add top priorities of our own
if (DownedBossSystem.downedLeviathan && attempt.legendary && poolSize > 1000)
if (DownedBossSystem.downedLeviathan && attempt.legendary && poolSize > 1000 && !Main.rand.NextBool(3))
{
itemDrop = ModContent.ItemType<Floodtide>();
return;
+4 -1
View File
@@ -1400,6 +1400,9 @@ namespace CalamityMod.CalPlayer
Player.lavaTime++;
}
}
// Extra DoT in the lava of the crags. Negated by Flame-licked Shell.
else if (ZoneCalamity && !flameLickedShell)
Player.AddBuff(ModContent.BuffType<SearingLava>(), 2, false);
// Release irradiated slimes from the sky during the Acid Rain event.
if (Player.whoAmI == Main.myPlayer)
@@ -1890,7 +1893,7 @@ namespace CalamityMod.CalPlayer
{
if (numOfEnergy < energyCap)
{
int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(22);
int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(8);
Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType<AmuletEnergy>(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy);
if (numOfEnergy + 1 == energyCap && Player.Calamity().sSpiritAmuletVisual)
{
+1 -1
View File
@@ -1315,7 +1315,7 @@ namespace CalamityMod.CalPlayer
if (manaOverloader)
{
double healMult = 0.1D - proj.numHits * 0.025D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.5f);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.75f);
}
if (ataxiaMage)
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 600;
public static int damage = 225;
public static int damage = 100;
public override void SetDefaults()
{
Item.width = 36;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 300;
public static int damage = 32;
public static int damage = 20;
public override void SetDefaults()
{
Item.width = 30;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public class ChaosStone : ModItem, ILocalizedModType
{
public static float LostRegenPer100Mana => 8;
public static float DamageMultPer100Mana => 0.03f;
public static float DamageMultPer100Mana => 0.04f;
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 420;
public static int damage = 68;
public static int damage = 60;
public override void SetDefaults()
{
Item.width = 34;
+5 -5
View File
@@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
modPlayer.amalgam = true;
player.brainOfConfusionItem = Item;
modPlayer.HeatDebuffMultiplier += 3f;
modPlayer.ColdDebuffMultiplier += 3f;
modPlayer.SicknessDebuffMultiplier += 3f;
modPlayer.WaterDebuffMultiplier += 3f;
modPlayer.ElectricDebuffMultiplier += 3f;
modPlayer.HeatDebuffMultiplier += 2f;
modPlayer.ColdDebuffMultiplier += 2f;
modPlayer.SicknessDebuffMultiplier += 2f;
modPlayer.WaterDebuffMultiplier += 2f;
modPlayer.ElectricDebuffMultiplier += 2f;
}
public override void AddRecipes()
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Critters
Item.DefaultToCapturedCritter(ModContent.NPCType<BabyCannonballJellyfish>());
Item.value = Item.sellPrice(silver: 10);
Item.rare = ItemRarityID.Green;
Item.damage = 400;
Item.damage = 300;
}
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.PermanentBoosters
Item.useAnimation = Item.useTime = 30;
Item.UseSound = UseSound;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.value = Item.sellPrice(gold: 30);
Item.value = Item.sellPrice(gold: 24);
Item.rare = ItemRarityID.Yellow;
}
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.PermanentBoosters
Item.useAnimation = Item.useTime = 30;
Item.UseSound = UseSound;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.value = Item.sellPrice(gold: 48);
Item.value = Item.sellPrice(gold: 36);
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.PermanentBoosters
Item.useAnimation = Item.useTime = 30;
Item.UseSound = UseSound;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.value = Item.sellPrice(gold: 24);
Item.value = Item.sellPrice(gold: 16);
Item.rare = ItemRarityID.LightPurple;
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.PermanentBoosters
Item.useAnimation = Item.useTime = 30;
Item.UseSound = UseSound;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.value = Item.sellPrice(gold: 36);
Item.value = Item.sellPrice(gold: 28);
Item.rare = ModContent.RarityType<Turquoise>();
}
+16 -2
View File
@@ -1,7 +1,10 @@
using CalamityMod.NPCs.AcidRain;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.Rarities;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.SummonItems
@@ -9,6 +12,8 @@ namespace CalamityMod.Items.SummonItems
public class BloodwormItem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.SummonItems";
private const int SpoofBaitNumber = 4444;
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
@@ -20,7 +25,10 @@ namespace CalamityMod.Items.SummonItems
Item.width = 28;
Item.height = 28;
Item.maxStack = Item.CommonMaxStack;
Item.bait = 4444;
// Why spoof this in the tooltip?
// To fix bugs related to how bait power affects hooking fish.
// Vanilla gets around this for Truffle Worm with a hundred hardcoded checks but we don't have the full luxury to do that.
Item.bait = 50;
Item.useStyle = ItemUseStyleID.Swing;
Item.autoReuse = true;
Item.useTurn = true;
@@ -38,5 +46,11 @@ namespace CalamityMod.Items.SummonItems
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
TooltipLine bait = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "BaitPower");
bait?.Text = Language.GetTextValue("GameUI.BaitPower", SpoofBaitNumber);
}
}
}
+65 -12
View File
@@ -13,8 +13,8 @@ namespace CalamityMod.Items.SummonItems
public new string LocalizationCategory => "Items.SummonItems";
public override void SetDefaults()
{
Item.width = Main.zenithWorld ? 54 : 28;
Item.height = Main.zenithWorld ? 78 : 28;
Item.width = Main.zenithWorld ? 54 : 70;
Item.height = Main.zenithWorld ? 78 : 80;
Item.rare = ItemRarityID.Blue;
Item.useAnimation = 45;
Item.useTime = 45;
@@ -31,17 +31,67 @@ namespace CalamityMod.Items.SummonItems
Item.SetNameOverride(this.GetLocalizedValue("GFBName"));
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
// The wiki classifies Boss Rush as an event
itemGroup = ContentSamples.CreativeHelper.ItemGroup.EventItem;
}
#region Sprite Drawing
public static void DrawTerminusGlow(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float rotation, float baseScale)
{
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/TerminusGlow").Value;
Vector2 origin = frame.Size() * 0.5f;
float pulseRate = Main.GlobalTimeWrappedHourly % 5f;
float slowingRate = Main.GlobalTimeWrappedHourly * 0.4f;
float orbitRadius = baseScale != 1f ? 4f : 7f;
float glowCount = 3f;
pulseRate /= 2.5f;
if (pulseRate >= 1f)
pulseRate = 2f - pulseRate;
pulseRate *= 0.6f;
for (int i = 0; i < glowCount; i++)
{
float progress = i / glowCount;
float pulseRotation = (progress + slowingRate) * MathHelper.TwoPi;
Vector2 offset = Vector2.UnitY * orbitRadius;
offset = offset.RotatedBy(pulseRotation) * pulseRate;
spriteBatch.Draw(glowTexture, baseDrawPosition + offset, frame, new Color(56, 12, 115, 33), rotation, origin, baseScale, 0, 0);
}
spriteBatch.Draw(glowTexture, baseDrawPosition, frame, Color.White, rotation, origin, baseScale, 0, 0);
}
public static void DrawGlowInWorld(SpriteBatch spriteBatch, Vector2 baseDrawPosition, float rotation, float baseScale)
{
Texture2D glowTexture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/TerminusGlow").Value;
Rectangle frame = glowTexture.Bounds;
DrawTerminusGlow(spriteBatch, baseDrawPosition + new Vector2(0, -1), frame, rotation, baseScale);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture;
float invScale = scale * 1.4f;
if (Main.zenithWorld)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus_GFB").Value;
Color overlay = Color.White;
spriteBatch.Draw(texture, position, null, overlay, 0f, origin, scale, 0, 0);
return false;
texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus_GFB").Value;
spriteBatch.Draw(texture, position - new Vector2(-4, -1), null, Color.White, 0f, origin, invScale - 0.04f, 0, 0);
}
else
return true;
{
texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus").Value;
spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, invScale, 0, 0);
DrawTerminusGlow(spriteBatch, position, frame, 0f, invScale);
}
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
@@ -49,17 +99,20 @@ namespace CalamityMod.Items.SummonItems
if (Main.zenithWorld)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/Terminus_GFB").Value;
spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, 0, 0);
spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, rotation, Vector2.Zero, scale, 0, 0);
return false;
}
else
return true;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
// The wiki classifies Boss Rush as an event
itemGroup = ContentSamples.CreativeHelper.ItemGroup.EventItem;
if (!Main.zenithWorld)
{
DrawGlowInWorld(spriteBatch, Item.Center - Main.screenPosition, rotation, scale);
}
}
#endregion
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 70;
Item.height = 70;
Item.damage = 900;
Item.damage = 700;
Item.knockBack = 9f;
Item.useAnimation = Item.useTime = 24;
Item.DamageType = DamageClass.Melee;
+1 -1
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
if (player.Calamity().demonSwordKillMode && player.ownedProjectileCounts[ModContent.ProjectileType<ExaltedOathbladeHoldout>()] <= 0 && player.Calamity().killModeCooldown == KillMode.cooldownMax + KillMode.buffMax)
{
Projectile.NewProjectile(player.GetSource_FromThis(), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<ExaltedOathbladeHoldout>(), Item.damage * 14, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 23x damage.
Projectile.NewProjectile(player.GetSource_FromThis(), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<ExaltedOathbladeHoldout>(), Item.damage * 16, Item.knockBack, player.whoAmI, 0, throwCount);
}
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -1
View File
@@ -72,7 +72,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
if (player.Calamity().demonSwordKillMode && player.ownedProjectileCounts[ModContent.ProjectileType<ForbiddenOathbladeHoldout>()] <= 0 && player.Calamity().killModeCooldown == KillMode.cooldownMax + KillMode.buffMax)
{
Projectile blade = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.MountedCenter,Vector2.Zero, ModContent.ProjectileType<ForbiddenOathbladeHoldout>(), Item.damage * 10, Item.knockBack, player.whoAmI, 0, throwCount); // This used to be 12x damage.
Projectile blade = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.MountedCenter,Vector2.Zero, ModContent.ProjectileType<ForbiddenOathbladeHoldout>(), Item.damage * 12, Item.knockBack, player.whoAmI, 0, throwCount);
}
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 114;
Item.height = 146;
Item.damage = 3140;
Item.damage = 2900;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = 45;
Item.useStyle = ItemUseStyleID.Swing;
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 54;
Item.height = 54;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 170;
Item.damage = 150;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 34;
Item.shootSpeed = 10f;
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 18;
Item.height = 20;
Item.damage = 9;
Item.damage = 8;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.noMelee = true;
Item.noUseGraphic = true;
+3
View File
@@ -6,6 +6,7 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent.Prefixes;
using Terraria.ID;
using Terraria.ModLoader;
@@ -44,6 +45,8 @@ namespace CalamityMod.Items.Weapons.Melee
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
public override bool RangedPrefix() => true; //class identity is fake
public override bool MeleePrefix() => false;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Item.width = 56;
Item.height = 28;
Item.damage = 17;
Item.damage = 15;
Item.DamageType = DamageClass.Ranged;
Item.useTime = Item.useAnimation = 11;
Item.knockBack = 1.5f;
+3 -3
View File
@@ -20,13 +20,13 @@ namespace CalamityMod.Items.Weapons.Ranged
public static readonly SoundStyle ShootSound = new("CalamityMod/Sounds/Item/HalleysInfernoShoot") { Volume = 0.68f };
public static readonly SoundStyle Hit = new("CalamityMod/Sounds/Item/HalleysInfernoHit") { Volume = 0.75f };
public static float MaxStarburstPerComet => 1;
public static float MaxStarburstPerStar => 0.25f;
public static float MaxStarburstPerStar => 0.5f;
public static float LostAccuracyPerMiss => 4;
public static float MaxAccuracy => 50;
public static float StarburstDmgMult => 1.25f;
public static float StarburstDmgMult => 2.5f;
public static float StarburstVelMult = 0.75f;
public static float StarburstVelMult => 0.75f;
public override void SetDefaults()
{
Item.width = 84;
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Bullet;
Item.noUseGraphic = true;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.value = Item.buyPrice(gold: 20); // Sold by Arms Dealer
Item.rare = ItemRarityID.Orange;
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 30;
Item.height = 30;
Item.damage = 20;
Item.damage = 16;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = 16;
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 30;
Item.height = 30;
Item.damage = 20;
Item.damage = 16;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = 16;
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon
Item.UseSound = SoundID.DD2_DarkMageHealImpact;
Item.DamageType = DamageClass.Summon;
Item.mana = 10;
Item.damage = 43;
Item.damage = 35;
Item.knockBack = 2f;
Item.autoReuse = true;
Item.useAnimation = Item.useTime = 24;
+3 -3
View File
@@ -14,8 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon
{
public class IgneousExaltation : ModItem, ILocalizedModType
{
public static int ChargeDuration = 30;
public static int ChargeCooldown = 120;
public static int ChargeDuration => 25;
public static int ChargeCooldown => 120;
public new string LocalizationCategory => "Items.Weapons.Summon";
private static Texture2D BladeOutline = null;
public static Texture2D GetBladeOutlineTex()
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 52;
Item.height = 50;
Item.damage = 34;
Item.damage = 30;
Item.mana = 10;
Item.useAnimation = Item.useTime = 36;
Item.useStyle = ItemUseStyleID.Shoot;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 66;
Item.height = 68;
Item.damage = 128;
Item.damage = 100;
Item.DamageType = DamageClass.Summon;
Item.sentry = true;
Item.mana = 100;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon
public override void SetDefaults()
{
Item.width = Item.height = 62;
Item.damage = 150;
Item.damage = 90;
Item.useAnimation = Item.useTime = 24;
Item.mana = 10;
Item.knockBack = 10f;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
Item.width = 72;
Item.height = 72;
Item.damage = 40;
Item.damage = 35;
Item.mana = 10;
Item.useAnimation = Item.useTime = 36;
Item.useStyle = ItemUseStyleID.Swing;
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Typeless;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Projectiles.Typeless;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -40,6 +41,6 @@ namespace CalamityMod.Items.Weapons.Typeless
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 55;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.Calamity().DashID != GodslayerArmorDash.ID;
}
}
@@ -252,12 +252,22 @@ Plague: {
SagePoison: {
DisplayName: Sage Poison
Description: Poisoned
ItemTooltip: Sickness - DPS scales with summoned Viral Sprout amount
ItemTooltip:
'''
Sickness - 25 DPS per Viral Sprout / 50 DPS per Virid Vanguard
Ignores 75% of enemy sickness weaknesses and resistances
'''
}
SearingLava: {
DisplayName: Searing Lava
Description: The brimstone lava sears your flesh
ItemTooltip:
'''
Heat - 20 DPS
Ignores enemy heat weaknesses and resistances
Gains double effect from Heat debuff amplifiers
'''
}
ShellfishClaps: {
@@ -13,7 +13,6 @@ AbyssalDivingGear: {
Tooltip:
'''
Reduces the damage caused by the pressure of the abyss while out of breath
Removes the bleed effect caused by the abyss
Grants the ability to swim and greatly extends underwater breathing
Provides light underwater and extra mobility on ice
Provides a moderate amount of light and reduces breath loss in the abyss
@@ -627,7 +626,7 @@ DynamoStemCells: {
'''
10% increased ranged damage and movement speed
Ranged weapons fire a powerful mini swarmer every 3 seconds
Reduces damage taken from Dragonfire and Electrified
Reduces damage taken from Dragonfire
'''
}
@@ -1096,7 +1095,7 @@ ManaPolarizer: {
Increases maximum mana by 50
Provides life regeneration and magic damage that scales based on how much mana you have
Lower mana means more life regeneration, but less magic damage
These scale from -2 to 2 HP/sec, and 15% to 5% damage
These scale from -2 to +2 HP/s, and 15% to 5% damage
The provided regeneration is halved when under Mana Sickness
Magic projectiles steal enemy life while holding a magic weapon
'''
@@ -1865,7 +1864,7 @@ TheAmalgam: {
DisplayName: The Amalgam
Tooltip:
'''
All attacks inflict a variety of debuffs, 300% increased elemental debuff 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
The dank creeper flies above you, exploding into several shaderain clouds
@@ -286,7 +286,7 @@ Teratoma: {
Terminus: {
DisplayName: Terminus
GFBName: Ogscule
Tooltip: Activates Boss Rush Mode, using it again will deactivate Boss Rush Mode
Tooltip: Hold <left> to start or end the Boss Rush
}
YharonEgg: {
@@ -1135,8 +1135,8 @@ SlagfireDouser: {
DisplayName: Slagfire Douser
Tooltip:
'''
Lobs armor-penetrating lava in bursts
Armor-penetrating lava ignores 10 points of enemy defense
Sprays bursts of molten pollen
Molten pollen ignores 10 points of enemy defense and inflicts [cbuff:CalamityMod/SearingLava]
[c/FF9900:Capable of dousing townsfolk in lava too...]
'''
}
@@ -865,7 +865,7 @@ ViralSprout: {
Tooltip:
'''
Summons a sage spirit to fight for you
Inflicts Sage Poison, a debuff that becomes stronger the more spirits you own
Inflicts [cbuff:CalamityMod/SagePoison], a debuff that becomes stronger the more spirits you own
'''
}
@@ -876,7 +876,7 @@ ViridVanguard: {
Alternates between summoning axes and swords, both laced with a powerful poison
Axes orbit the player, dealing high damage at a close range
Swords chase down enemies with extreme precision, tearing them to shreds
All weapons inflict Sage Poison, which becomes more powerful the more weapons are summoned
All weapons inflict [cbuff:CalamityMod/Sage Poison], which becomes more powerful the more weapons are summoned
When all minion slots are full, <left> again to spin up a flurry of slashes aimed at your cursor
This ability has a five-second cooldown that requires holding this item
Shift-<right> this item in your inventory to change the rotation direction
@@ -567,3 +567,4 @@ Dragonfolly.DisplayName: Dragonfolly
Shoreskipper.DisplayName: Shoreskipper
BrainIllusion.DisplayName: Brain Illusion
FalseBrain.DisplayName: False Brain
BloodBomb.DisplayName: Blood Bomb
@@ -23,6 +23,7 @@ BigFlare.DisplayName: Big Flare
BigFlare2.DisplayName: Big Flare
BirbAura.DisplayName: Draconic Aura
BirbAuraFlare.DisplayName: Draconic Aura Flare
BloodBombRTS.DisplayName: Blood Bomb
BloodGeyser.DisplayName: Blood Geyser
BloodScythe.DisplayName: Blood Scythe
BrimstoneBall.DisplayName: Brimstone Fireball
+7 -4
View File
@@ -180,9 +180,13 @@ namespace CalamityMod
// { "Xeroc", 26f },
};
public override void PostSetupContent()
public override void Load()
{
LavaStyleToBiomeLava();
}
public override void PostSetupContent()
{
BossChecklistSupport();
FargosSupport();
DialogueTweakSupport();
@@ -214,7 +218,7 @@ namespace CalamityMod
Func<int, int, float, float, float, Vector3> ModifyLightFunc = ModifyLight;
Func<bool> IsLavaActive = lavaStyle.IsLavaActive;
Func<bool> lavafallGlowmask = lavaStyle.LavafallGlowmask;
Func<Player, NPC, int, Action> InflictDebuffFunc = InflictDebuff;
Action<Player, NPC, int> InflictDebuffFunc = InflictDebuff;
Func<bool> yes = InflictsOnFire;
Vector3 ModifyLight(int x, int y, float r, float g, float b)
@@ -223,13 +227,12 @@ namespace CalamityMod
return new Vector3(r, g, b);
}
Action InflictDebuff(Player player, NPC npc, int onfireDuration)
void InflictDebuff(Player player, NPC npc, int onfireDuration)
{
if (player != null && npc == null)
{
lavaStyle.InflictDebuff(player, onfireDuration);
}
return null;
}
bool InflictsOnFire()
-5
View File
@@ -891,11 +891,6 @@ namespace CalamityMod.NPCs
{
ActiveWaterDebuffMultiplier += 1;
}
if (npc.HasBuff<SearingLava>()) //Searing Lava is so hot it makes cold less strong
{
ActiveColdDebuffMultiplier -= 0.5f;
}
if (VulnerableToHeat.HasValue)
{
if (VulnerableToHeat.Value)
+1 -1
View File
@@ -1253,7 +1253,7 @@ namespace CalamityMod.NPCs
if (type == NPCID.ArmsDealer)
{
shop.AddWithCustomValue(ItemType<M1Garand>(), Item.buyPrice(gold: 20), Condition.DownedSkeletron)
shop.Add<M1Garand>(Condition.DownedSkeletron)
.Add<P90>(Condition.Hardmode)
.AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee)
.AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera);
+2
View File
@@ -617,6 +617,8 @@ namespace CalamityMod.NPCs.OldDuke
CalamityUtils.AddScreenshakeAt(NPC.Center, 14);
SoundEngine.PlaySound(SoundID.DD2_BetsyFlameBreath.WithPitchOffset(-0.5f), NPC.Center);
SoundEngine.PlaySound(DashSoundP3, NPC.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
CalamityUtils.BossAwakenMessage(NPC.whoAmI);
}
if (NPC.ai[2] >= 75f)
@@ -41,6 +41,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride
private static SoundStyle Growl = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Growl", 2) with { PauseBehavior = PauseBehavior.PauseWithGame };
private static SoundStyle Death = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Death_Roar") with { PauseBehavior = PauseBehavior.PauseWithGame };
private static SoundStyle BloodShot = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_BloodShot");
private static SoundStyle BloodBomb = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_BloodBomb");
private static SoundStyle BloodExplosion = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Explosion", 2);
@@ -153,7 +154,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride
internal static int BloodlettingDuration => 675;
internal static Vector2 HoverDistance => new (420f, 300f);
internal static float HoverEndHeight => 300f;
internal static int IchorRate => CalamityWorld.death ? 9 : 10;
internal static int IchorRate => CalamityWorld.death ? 10 : 12;
internal static float IchorSpread => 1.5f;
internal static float IchorVelocity => 3f;
internal static int BloodshotRate => 90;
@@ -1887,20 +1888,29 @@ public class BrainOfCthulhuAI : VanillaAIOverride
{
if (Time % IchorRate == 0)
{
if (Time % (IchorRate * 2) == 0)
SoundEngine.PlaySound(SoundID.Item17, NPC.Center);
if(Main.netMode == NetmodeID.SinglePlayer)
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + NPC.velocity + Main.rand.NextVector2Circular(72, 72), new Vector2(Main.rand.NextFloat(-IchorSpread, IchorSpread), -IchorVelocity), ModContent.ProjectileType<IchorShower>(), IchorShotDamage, 0.5f);
else if(Main.dedServ)
if (Time > BloodshotRate + 30 && Time % (IchorRate * 10) == 0)
{
Player furthestLeft = Main.player[AttackList[0]];
Player furthestRight = Main.player[AttackList[1]];
float xDist = furthestRight.Center.X - furthestLeft.Center.X;
int projCount = 1 + (int)(xDist / 360);
SoundEngine.PlaySound(BloodBomb, NPC.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.NewNPC(NPC.GetSource_FromThis(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<BloodBomb>(), NPC.whoAmI);
}
else
{
if (Time % (IchorRate * 2) == 0)
SoundEngine.PlaySound(SoundID.Item17, NPC.Center);
for(int i = 0; i < projCount; i++)
if (Main.netMode == NetmodeID.SinglePlayer)
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + NPC.velocity + Main.rand.NextVector2Circular(72, 72), new Vector2(Main.rand.NextFloat(-IchorSpread, IchorSpread), -IchorVelocity), ModContent.ProjectileType<IchorShower>(), IchorShotDamage, 0.5f);
else if (Main.dedServ)
{
Player furthestLeft = Main.player[AttackList[0]];
Player furthestRight = Main.player[AttackList[1]];
float xDist = furthestRight.Center.X - furthestLeft.Center.X;
int projCount = 1 + (int)(xDist / 360);
for (int i = 0; i < projCount; i++)
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + NPC.velocity + Main.rand.NextVector2Circular(72, 72), new Vector2(Main.rand.NextFloat(-IchorSpread, IchorSpread), -IchorVelocity), ModContent.ProjectileType<IchorShower>(), IchorShotDamage, 0.5f);
}
}
}
@@ -2479,13 +2489,15 @@ public class BrainOfCthulhuAI : VanillaAIOverride
NPC.velocity *= 0.9f;
if (startTime % 15 == 5 && startTime > 60 + IllusionDashSpinDuration + 30 + IllusionDashFakeoutTeleportDuration)
{
Vector2 dir = NPC.DirectionTo(Target.Center);
for (int i = 0; i < (CalamityWorld.death ? 2 : 1); i++)
{
Vector2 dir = NPC.DirectionTo(Target.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 initialDir = dir.RotatedBy(MathHelper.Pi + Main.rand.NextFloat(-0.01f, 0.01f));
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.width), initialDir * Main.rand.NextFloat(6f, 8f), ProjectileID.BloodNautilusShot, BloodShotDamage, 0.5f, ai0: dir.ToRotation() + MathHelper.TwoPi, ai1: initialDir.ToRotation());
Vector2 spawnPos = NPC.Center + (dir.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-NPC.width, NPC.width) - (dir * 48));
Projectile.NewProjectile(NPC.GetSource_FromThis(), spawnPos, initialDir * Main.rand.NextFloat(6f, 8f), ProjectileID.BloodNautilusShot, BloodShotDamage, 0.5f, ai0: dir.ToRotation() + MathHelper.TwoPi, ai1: initialDir.ToRotation());
}
NPC.velocity -= dir;
}
+4 -3
View File
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Packets;
using CalamityMod.World;
@@ -193,7 +194,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))
if ((item.CountsAsClass<MeleeDamageClass>() || item.CountsAsClass<SummonMeleeSpeedDamageClass>()) && !(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
@@ -218,8 +219,8 @@ namespace CalamityMod.Prefixes
}
}
// RANGED
else if (item.CountsAsClass<RangedDamageClass>())
// RANGED (and also Burning Sky)
else if (item.CountsAsClass<RangedDamageClass>() || item.type == ItemType<TheBurningSky>())
{
prefix = IteratePrefix(rand, RangedPrefixTiers, currentPrefix);
}
@@ -0,0 +1,267 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss.BrainOfCthulhu;
public class BloodBomb : ModNPC, ILocalizedModType
{
public new string LocalizationCategory => "NPCs";
internal static Asset<Texture2D> BloodBombYellow;
internal static Texture2D BloodBombGlow;
public override void SetStaticDefaults()
{
NPCID.Sets.ProjectileNPC[Type] = true;
BloodBombYellow = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/BrainOfCthulhu/BloodBomb2");
}
internal static Texture2D GetBombGlow()
{
if (BloodBombGlow == null)
{
var tex = new Texture2D(Main.graphics.GraphicsDevice, BloodBombYellow.Value.Width, BloodBombYellow.Value.Height);
var BaseArray = new Color[tex.Width * tex.Height];
var ColorArray = new Color[tex.Width * tex.Height];
BloodBombYellow.Value.GetData(BaseArray);
for (var i = 0; i < BaseArray.Length; i++)
{
ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f);
}
tex.SetData(ColorArray);
BloodBombGlow = tex;
}
return BloodBombGlow;
}
public override void SetDefaults()
{
NPC.width = 30;
NPC.height = 30;
NPC.noGravity = true;
NPC.damage = 10;
NPC.defense = 5;
NPC.lifeMax = 60;
NPC.Calamity().canBreakPlayerDefense = true;
NPC.lavaImmune = true;
NPC.aiStyle = -1;
AIType = -1;
NPC.value = 0;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCHit1 with { Pitch = 0.5f };
NPC.knockBackResist = 0f;
NPC.chaseable = false;
NPC.noTileCollide = true;
NPC.ShowNameOnHover = false;
}
public override void OnSpawn(IEntitySource source)
{
if (source is EntitySource_Parent { Entity: NPC n })
NPC.ai[1] = n.whoAmI;
else
NPC.ai[1] = -1;
Vector2 goal = Main.player[0].Center - NPC.Center;
float vyi = 6;
float vyisq = 36;
float g = 0.2f;
float vyf = -MathF.Sqrt(vyisq + 2 * g * goal.Y);
float t = Math.Abs((vyf - vyi) / g);
float vxi = goal.X / t;
NPC.velocity = new Vector2(float.IsNaN(vxi) ? (goal.X > 0 ? 10 : -10) : vxi, -vyi);
for (int i = 0; i < 3; i++)
{
BloodParticle p = new(NPC.Center, NPC.velocity.RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 6f, MathHelper.Pi / 6f)) * Main.rand.NextFloat(2f, 3f), 32, 1f, Color.Red);
GeneralParticleHandler.SpawnParticle(p);
}
BloodParticle2 p2 = new(NPC.Center, NPC.velocity * 2.5f, 16, 0.5f, Color.Red);
GeneralParticleHandler.SpawnParticle(p2);
}
public override void AI()
{
if (NPC.ai[0] > 1200)
NPC.active = false;
NPC.velocity.Y += 0.2f;
NPC.rotation += Math.Sign(NPC.velocity.X) * (NPC.velocity.Length()) * 0.01f;
if (NPC.ai[0] % 3 == 0)
{
float deathRatio = 1 - (NPC.life / NPC.lifeMax);
float time = Main.GlobalTimeWrappedHourly * (10f + (10f * deathRatio));
float lerp = MathF.Sin(time) / 2f + 0.5f;
Color color = Color.Lerp(Color.Red, Color.Yellow, lerp);
BloodParticle p = new(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height), (-NPC.velocity).RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 6f, MathHelper.Pi / 6f)) * Main.rand.NextFloat(0.25f, 0.75f), Main.rand.Next(10, 17), Main.rand.NextFloat(0.5f, 1f), color);
GeneralParticleHandler.SpawnParticle(p);
}
NPC.ai[0]++;
}
public override void ModifyHitByItem(Player player, Item item, ref NPC.HitModifiers modifiers)
{
if (modifiers.DamageType == TrueMeleeDamageClass.Instance)
{
modifiers.FinalDamage *= 1.5f;
return;
}
float dist = player.DistanceSQ(NPC.Center);
dist = MathHelper.Clamp(dist - 10000, 0, 160000);
if (dist > 160000)
modifiers.FinalDamage *= 0;
else
modifiers.FinalDamage *= MathHelper.Lerp(1f, 0f, dist / 160000f);
}
public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers)
{
if (modifiers.DamageType == TrueMeleeDamageClass.Instance)
{
modifiers.FinalDamage *= 1.5f;
return;
}
if (projectile.owner == -1)
{
modifiers.FinalDamage *= 0;
return;
}
float dist = Main.player[projectile.owner].DistanceSQ(NPC.Center);
dist = MathHelper.Clamp(dist - 10000, 0, 160000);
if (dist > 160000f)
modifiers.FinalDamage *= 0;
else
modifiers.FinalDamage *= MathHelper.Lerp(1f, 0f, dist / 160000f);
}
public override void HitEffect(NPC.HitInfo hit)
{
if(NPC.life <= 0)
{
if (NPC.ai[1] == -1)
NPC.ai[1] = NPC.Center.ClosestNPCAt(1200, true, true).whoAmI;
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, NPC.DirectionTo(Main.npc[(int)NPC.ai[1]].Center) * 16f, ModContent.ProjectileType<BloodBombRTS>(), 40, 1f, -1, NPC.ai[1]);
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
float deathRatio = 1 - (NPC.life / NPC.lifeMax);
float time = Main.GlobalTimeWrappedHourly * (10f + (10f * deathRatio));
float lerp = MathF.Sin(time) / 2f + 0.5f;
Texture2D baseTex = TextureAssets.Npc[Type].Value;
Texture2D overlayTex = BloodBombYellow.Value;
Vector2 drawPos = NPC.Center - Main.screenPosition + Main.rand.NextVector2CircularEdge((2 * deathRatio), (2 * deathRatio));
float scale = 1.5f + (MathF.Sin(time) * 0.25f);
if (Main.LocalPlayer.HasBuff(BuffID.Hunter))
spriteBatch.Draw(GetBombGlow(), drawPos, null, Color.OrangeRed, NPC.rotation, BloodBombGlow.Size() * 0.5f, scale + 0.15f, 0, 0);
spriteBatch.Draw(baseTex, drawPos, null, Color.White, NPC.rotation, baseTex.Size() * 0.5f, scale, 0, 0);
spriteBatch.Draw(overlayTex, drawPos, null, Color.White * lerp, NPC.rotation, overlayTex.Size() * 0.5f, scale, 0, 0);
return false;
}
}
public class BloodBombRTS : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override string Texture => "CalamityMod/Projectiles/Boss/BrainOfCthulhu/BloodBomb";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 8;
ProjectileID.Sets.TrailingMode[Type] = 2;
}
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 30;
Projectile.penetrate = 1;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.damage = 10;
Projectile.friendly = true;
Projectile.hostile = false;
Projectile.tileCollide = false;
Projectile.timeLeft = 360;
}
public override void AI()
{
NPC npc = Main.npc[(int)Projectile.ai[0]];
if(npc.active && !npc.dontTakeDamage)
Projectile.velocity = Projectile.DirectionTo(npc.Center) * 16f;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SetCrit();
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, Projectile.Center);
CustomPulse explosion1 = new(Projectile.Center, Vector2.Zero, Color.OrangeRed, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(0f, MathHelper.Pi), 0f, 0.1f, 24);
GeneralParticleHandler.SpawnParticle(explosion1);
CustomPulse explosion2 = new(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(0f, MathHelper.Pi), 0f, 0.075f, 24);
GeneralParticleHandler.SpawnParticle(explosion2);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = TextureAssets.Projectile[Type].Value;
Texture2D overlayTex = BloodBomb.BloodBombYellow.Value;
for (int i = 0; i < (CalamityClientConfig.Instance.Afterimages ? Projectile.oldPos.Length : 1); ++i)
{
float time = (Main.GlobalTimeWrappedHourly * 30) - (i / 2f);
float lerp = MathF.Sin(time) / 2f + 0.5f;
Color color = Color.White;
float afterimageRot = Projectile.oldRot[i];
Vector2 drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
if (i != 0)
color *= 0.75f;
// DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES.
float interpolant = ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length);
Main.spriteBatch.Draw(tex, drawPos, null, color * (1 - lerp), afterimageRot, tex.Size() * 0.5f, (Projectile.scale + MathF.Sin(time) / 2f + 0.5f) * interpolant, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(overlayTex, drawPos, null, color * lerp, afterimageRot, overlayTex.Size() * 0.5f, (Projectile.scale + MathF.Sin(time) / 2f + 0.5f) * interpolant, SpriteEffects.None, 0f);
}
return false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

+32 -4
View File
@@ -18,8 +18,10 @@ using CalamityMod.Items.Armor.Daedalus;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.SummonItems;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.NPCs;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.PlagueEnemies;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Packets.Entities;
@@ -336,7 +338,7 @@ namespace CalamityMod.Projectiles
{
if (player.Calamity().grapeBeer && (item.useAmmo == AmmoID.Bullet || item.useAmmo == AmmoID.Arrow || item.useAmmo == AmmoID.Dart || item.useAmmo == AmmoID.Rocket))
{
if (player.heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && player.Calamity().grapeBeerTimer < 5 && !CalamityProjectileSets.DoesNotGetHomingWithGrapeBeer[projectile.type])
if (player.heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && !CalamityProjectileSets.DoesNotGetHomingWithGrapeBeer[projectile.type])
ApplyGrapeBeer();
else
grapeBeer = true;
@@ -357,7 +359,7 @@ namespace CalamityMod.Projectiles
//Grape Beer homing
if (parent.Calamity().grapeBeer)
{
if (Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && Main.player[projectile.owner].Calamity().grapeBeerTimer < 5 && !CalamityProjectileSets.DoesNotGetHomingWithGrapeBeer[projectile.type])
if (Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && !CalamityProjectileSets.DoesNotGetHomingWithGrapeBeer[projectile.type])
ApplyGrapeBeer();
else
grapeBeer = true;
@@ -2967,6 +2969,10 @@ namespace CalamityMod.Projectiles
{
NPC.SpawnOnPlayer(owner.whoAmI, 370);
}
else
{
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, -1, -1, null, owner.whoAmI, 370f);
}
projectile.ai[0] = 2f;
}
else if (projectile.localAI[1] < 1)
@@ -3313,7 +3319,29 @@ namespace CalamityMod.Projectiles
if (cplayer.mouseRight && projectile.ai[1] == 0 && owner.miscCounter % 10 == 0)
{
owner.lifeRegenCount -= 600; // -5 health per 10 ticks
var projID = Projectile.NewProjectile(projectile.GetSource_FromThis(), Main.npc[(int)PersistentFishingData].Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), (int)owner.GetBestClassDamage().ApplyTo(owner.HeldItem.fishingPole + owner.fishingSkill + owner.ChooseAmmo(owner.HeldItem).bait), 0f, owner.whoAmI, Main.npc[(int)PersistentFishingData].whoAmI);
owner.Fishing_GetBait(out Item baitItem);
// Diminishing returns on bait power beyond 75
int baitPower = baitItem?.bait ?? 0;
if (baitItem?.type == ItemID.TruffleWorm)
{
projectile.ai[0] = 1;
projectile.localAI[1] = 1;
ReelTheBobberChecks();
}
else if (baitItem?.type == ItemType<BloodwormItem>())
{
projectile.ai[0] = 1;
projectile.localAI[1] = NPCType<OldDuke>() * -1;
baitPower = 4444; // Manually set the power to the displayed value
ReelTheBobberChecks();
}
else if (baitPower > 75)
{
baitPower = (int)Math.Pow((baitPower - 75), 0.5f) + 75;
}
var projID = Projectile.NewProjectile(projectile.GetSource_FromThis(), Main.npc[(int)PersistentFishingData].Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), (int)owner.GetBestClassDamage().ApplyTo(owner.HeldItem.fishingPole + owner.fishingSkill + baitPower), 0f, owner.whoAmI, Main.npc[(int)PersistentFishingData].whoAmI);
if (Main.projectile.IndexInRange(projID))
{
Main.projectile[projID].ArmorPenetration = 100; //This should ignore almost all armor
@@ -4687,7 +4715,7 @@ namespace CalamityMod.Projectiles
{
var player = Main.player[projectile.owner];
float burnRatio = (-player.statMana / 100) * ChaosStone.DamageMultPer100Mana;
target.Calamity().manaBurn += damageDone * burnRatio * (player.Calamity().oldFashioned ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().ivDrip ? IVDripOnTheRocks.DamageBoostMultiplier : 1);
target.Calamity().manaBurn += damageDone * burnRatio * (player.Calamity().oldFashioned ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().ivDrip ? IVDripOnTheRocks.DamageBoostMultiplier : 1) * (player.Calamity().vodka ? 1+Vodka.DebuffBoost : 1);
target.Calamity().playerManaBurnIntensity = -player.statMana / (float)player.statManaMax2;
if (Main.netMode != NetmodeID.SinglePlayer)
ManaBurnSyncPacket.Send(target);
+7 -15
View File
@@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.ClusterFragmentsII, Do(IDStaticIFrames(15)) },
{ ProjectileID.ClusterSnowmanRocketI, Do(LocalIFrames(15)) },
{ ProjectileID.ClusterSnowmanRocketII, Do(LocalIFrames(15)) },
{ ProjectileID.DangerousSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.DangerousSpider, Do( ExtraUpdatesExact(2), LocalIFrames(90)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3), DefaultIDStaticIFrames) }, // Flying Dragon
{ ProjectileID.DeadlySphere, Do(LocalIFrames(30)) },
{ ProjectileID.EmeraldBolt, Do(NoPiercing) },
@@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.InfernoFriendlyBolt, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.InfernoFriendlyBlast, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) },
{ ProjectileID.JumperSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.JumperSpider, Do( ExtraUpdatesExact(2), LocalIFrames(90)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.LaserDrill, Do(ArmorPenetrationDelta(+25), LocalIFrames(5)) },
{ ProjectileID.LightDisc, Do(MaxUpdatesExact(3), DefaultIDStaticIFrames) },
{ ProjectileID.LostSoulHostile, Do(TileCollide) }, // Ragged Caster
@@ -209,7 +209,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.TrueNightsEdge, Do(PiercingExact(4)) },
{ ProjectileID.VenomBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
{ ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(90)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
{ ProjectileID.VortexDrill, standardDrillTweaks },
{ ProjectileID.Wasp, Do(PiercingExact(2)) },
{ ProjectileID.WeatherPainShot, Do(ExtraUpdatesExact(3), TimeLeftExact(1920)) },
@@ -328,7 +328,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.CrimsandBallGun, defaultIFrames },
{ ProjectileID.CrimsonHeart, defaultIFrames },
{ ProjectileID.CrimsonSpray, defaultIFrames },
{ ProjectileID.CrystalDart, Do( ExtraUpdatesExact(2), LocalIFrames(-1)) },
{ ProjectileID.CrystalDart, Do(ExtraUpdatesExact(2), LocalIFrames(-1)) },
{ ProjectileID.CrystalLeaf, defaultIFrames },
{ ProjectileID.CrystalLeafShot, defaultIFrames },
{ ProjectileID.CrystalPulse, defaultIFrames },
@@ -338,7 +338,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.CrystalVileShardHead, defaultIFrames },
{ ProjectileID.CrystalVileShardShaft, defaultIFrames },
{ ProjectileID.CursedArrow, defaultIFrames },
{ ProjectileID.CursedDart, Do( ExtraUpdatesExact(1), LocalIFrames(20)) },
{ ProjectileID.CursedDart, Do(ExtraUpdatesExact(1), LocalIFrames(20)) },
{ ProjectileID.CursedDartFlame, defaultIFrames },
{ ProjectileID.CursedFlameFriendly, defaultIFrames },
{ ProjectileID.CursedFlare, defaultIFrames },
@@ -397,7 +397,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.IceBlock, defaultIFrames },
{ ProjectileID.IceBolt, defaultIFrames },
{ ProjectileID.IchorArrow, defaultIFrames },
{ ProjectileID.IchorDart, Do( ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.IchorDart, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.JackOLantern, defaultIFrames },
{ ProjectileID.JavelinFriendly, defaultIFrames },
{ ProjectileID.JestersArrow, defaultIFrames },
@@ -412,13 +412,9 @@ namespace CalamityMod.Projectiles
{ ProjectileID.LavaSnowmanRocket, defaultIFrames },
{ ProjectileID.Leaf, defaultIFrames },
{ ProjectileID.LifeCrystalBoulder, defaultIFrames },
{ ProjectileID.MagicMissile, Do(IDStaticIFrames(8)) }, // Has an exception in Vanilla iframe code, uses 8 iframes
{ ProjectileID.MagnetSphereBolt, defaultIFrames },
{ ProjectileID.MedusaHead, defaultIFrames },
{ ProjectileID.MedusaHeadRay, defaultIFrames },
{ ProjectileID.Meteor1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
{ ProjectileID.Meteor2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
{ ProjectileID.Meteor3, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
{ ProjectileID.MinecartMechLaser, defaultIFrames },
{ ProjectileID.MiniBoulder, defaultIFrames },
{ ProjectileID.MiniMinotaur, defaultIFrames },
@@ -441,8 +437,6 @@ namespace CalamityMod.Projectiles
{ ProjectileID.NailFriendly, Do(IDStaticIFrames(1)) }, // Has an exception in Vanilla iframe code, uses 1 iframe
{ ProjectileID.NebulaArcanumExplosionShot, defaultIFrames },
{ ProjectileID.NebulaArcanumExplosionShotShard, defaultIFrames },
{ ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
{ ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
{ ProjectileID.NettleBurstEnd, defaultIFrames },
{ ProjectileID.NettleBurstLeft, defaultIFrames },
{ ProjectileID.NettleBurstRight, defaultIFrames },
@@ -466,7 +460,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.PhantasmArrow, defaultIFrames },
{ ProjectileID.PineNeedleFriendly, defaultIFrames },
{ ProjectileID.PlatinumCoin, defaultIFrames },
{ ProjectileID.PoisonDart, Do( ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.PoisonDart, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
{ ProjectileID.PoisonDartBlowgun, defaultIFrames },
{ ProjectileID.PoisonDartTrap, defaultIFrames },
{ ProjectileID.PoisonedKnife, defaultIFrames },
@@ -549,7 +543,6 @@ namespace CalamityMod.Projectiles
{ ProjectileID.StickyDynamite, defaultIFrames },
{ ProjectileID.StickyGrenade, defaultIFrames },
{ ProjectileID.StormTigerGem, defaultIFrames },
{ ProjectileID.Stynger, Do(IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes
{ ProjectileID.StyngerShrapnel, defaultIFrames },
{ ProjectileID.TentacleSpike, defaultIFrames },
{ ProjectileID.ThornChakram, defaultIFrames },
@@ -566,7 +559,6 @@ namespace CalamityMod.Projectiles
{ ProjectileID.ToxicFlask, defaultIFrames },
{ ProjectileID.Truffle, defaultIFrames },
{ ProjectileID.TruffleSpore, defaultIFrames },
{ ProjectileID.Typhoon, Do(IDStaticIFrames(6)) }, // Has an exception in Vanilla iframe code, uses 6 iframes
{ ProjectileID.UFOLaser, defaultIFrames },
{ ProjectileID.UFOMinion, defaultIFrames },
{ ProjectileID.UnholyArrow, defaultIFrames },
@@ -45,6 +45,7 @@ namespace CalamityMod.Projectiles.Magic
Projectile.scale = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.DamageType = DamageClass.Magic;
}
public override void AI()
{
@@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 2;
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, vel.RotatedBy(MathHelper.ToRadians(45)), ModContent.ProjectileType<DevilsStrike>(), 0, 0f, Owner.whoAmI, 1, 0);
}
Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), (int)(Projectile.damage * 1.5f), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0);
Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), (int)(Projectile.damage * 1.666f), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0);
strike.DamageType = DamageClass.Melee;
SoundStyle dieSound = new("CalamityMod/Sounds/Item/LanceofDestinyStrong");
SoundEngine.PlaySound(dieSound with { Volume = 0.9f, Pitch = 0.3f }, lastHitTarget.Center);
+1 -1
View File
@@ -45,6 +45,6 @@ namespace CalamityMod.Projectiles.Melee
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 3f);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 4f); //4x cooldown = 23.3 HP bank, 2.25 hp/s refill
}
}
@@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
{
for (var i = 0; i < 10; i++)
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center, (Projectile.rotation-MathHelper.PiOver4).ToRotationVector2().RotatedByRandom(0.4f) * -Main.rand.Next(10,20), false, 30, 2, new Color(69, 69, 200)));
Projectile.damage = (int)(Projectile.damage*15f);
Projectile.damage = (int)(Projectile.damage*10f);
Projectile.Damage();
Owner.Calamity().StratusStarburst -= 10;
for (int i = 0; i < 3; i++)
@@ -153,6 +153,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
Main.projectile[proj].usesIDStaticNPCImmunity = false;
Main.projectile[proj].usesLocalNPCImmunity = true;
Main.projectile[proj].localNPCHitCooldown = 20;
Main.projectile[proj].timeLeft = Main.projectile[proj].MaxUpdates * 600;
}
}
Projectile.velocity = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * -15;
@@ -184,7 +185,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
Projectile.damage = Projectile.originalDamage;
if (Owner.Calamity().AvaliableStarburst >= 20)
{
Projectile.damage = (int)(Projectile.damage* 30f);
Projectile.damage = (int)(Projectile.damage*20f);
Owner.SetImmuneTimeForAllTypes(Owner.longInvince ? 40 : 20);
Owner.Calamity().StratusStarburst -= 20;
SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact, Owner.Center);
@@ -201,6 +202,8 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
Main.projectile[proj].usesIDStaticNPCImmunity = false;
Main.projectile[proj].usesLocalNPCImmunity = true;
Main.projectile[proj].localNPCHitCooldown = 20;
Main.projectile[proj].timeLeft = Main.projectile[proj].MaxUpdates * 600;
}
}
}
+3 -3
View File
@@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged
}
else if (Owner.controlUseTile)
{
if (ShotTimer <= 0 && Owner.Calamity().AvaliableStarburst > 0)
if (ShotTimer <= 0 && Owner.Calamity().AvaliableStarburst > 1)
{
ShotTimer = 4;
var spawnpos = Projectile.Center;
@@ -97,8 +97,8 @@ namespace CalamityMod.Projectiles.Ranged
for (var i = 0; i < 5; i++)
GeneralParticleHandler.SpawnParticle(new GlowSparkParticle(spawnpos + dir * 36, (dir * Halley.shootSpeed).RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f, 1.5f), false, 7, 0.02f, drawColor, new Vector2(0.5f, 1f)));
if (Projectile.owner == Main.myPlayer)
Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * 0.75f, ModContent.ProjectileType<HalleysStarburst>(), (int)Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage), Halley.knockBack, Projectile.owner, color);
Owner.Calamity().StratusStarburst--;
Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * HalleysInferno.StarburstVelMult, ModContent.ProjectileType<HalleysStarburst>(), (int)(Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage) * HalleysInferno.StarburstDmgMult), Halley.knockBack, Projectile.owner, color);
Owner.Calamity().StratusStarburst -= 2;
SoundEngine.PlaySound(HalleysInferno.ShootSound);
RecoilAmount = 4;
}
+2 -2
View File
@@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue
public override void SetDefaults()
{
Projectile.width = 12;
Projectile.height = 12;
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = 3;
Projectile.aiStyle = ProjAIStyleID.ThrownProjectile;
+11 -7
View File
@@ -118,11 +118,12 @@ namespace CalamityMod.Projectiles.Summon
CircleOwner();
break;
case AIState.TransitionToLaunch:
ChargeTargetPos = Owner.Calamity().mouseWorld;
Owner.Calamity().mouseWorldListener = true;
ChargeTargetPos = Owner.Calamity().mouseWorldDeltaFromPlayer;
ChargeStartPos = Owner.Center;
CurrentState = AIState.LaunchAtPos;
AITimer = 0;
Projectile.penetrate = 50;
Projectile.penetrate = 15;
LaunchAtTargetPos();
break;
case AIState.LaunchAtPos:
@@ -161,13 +162,11 @@ namespace CalamityMod.Projectiles.Summon
public void LaunchAtTargetPos()
{
Projectile.damage = Projectile.originalDamage;
if (Projectile.penetrate > 40) //First 10 hits do 2x damage
Projectile.damage *= 2;
int chargeTime = IgneousExaltation.ChargeDuration * 2;
int chargeLength = 2000;
float circleWidth = Math.Min(75, Owner.ownedProjectileCounts[Type] * 4);
var CurrentPlace = Vector2.Lerp(ChargeStartPos, ChargeStartPos + ChargeStartPos.DirectionTo(ChargeTargetPos) * chargeLength, MathF.Pow(AITimer / chargeTime, 3));
var CurrentPlace = Vector2.Lerp(ChargeStartPos, ChargeStartPos + ChargeTargetPos.SafeNormalize(Vector2.UnitX) * chargeLength, MathF.Pow(AITimer / chargeTime, 3));
Projectile.Center = CurrentPlace + BladeHoverOffsetAngle.ToRotationVector2() * Math.Max(MathHelper.Lerp(100f, 25f, AITimer / 10f), circleWidth);
Projectile.rotation = Projectile.AngleFrom(CurrentPlace) + MathHelper.PiOver2;
if (AITimer >= chargeTime)
@@ -193,9 +192,14 @@ namespace CalamityMod.Projectiles.Summon
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.penetrate >= 10) // First 5 hits deal 2x dmg
modifiers.SourceDamage *= 2;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.penetrate >= 40 && CurrentState != AIState.CircleOwner) //The first 10 hits per launch can spawn blades
if (Projectile.penetrate >= 10 && CurrentState != AIState.CircleOwner) //The first 5 hits per launch can spawn blades
if (Main.myPlayer == Projectile.owner)
{
for (int i = 0; i < 1; i++)
+1 -1
View File
@@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon
if (healShots != 0 && attackCooldown != maxRechargeTime && (attackCooldown % (maxRechargeTime / (healShots + 1)) == 0))
{
Vector2 vel = ((Projectile.Center - player.Center) - player.velocity * 10).SafeNormalize(Vector2.UnitX) * -10;
Projectile healStar = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel, ModContent.ProjectileType<HolyLight>(), 0, Projectile.knockBack, Projectile.owner, 0, 10, 5);
Projectile healStar = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel, ModContent.ProjectileType<HolyLight>(), 0, Projectile.knockBack, Projectile.owner, 0, 5, 5);
healStar.extraUpdates = 2;
SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash");
SoundEngine.PlaySound(fireHeal with { Volume = 0.7f, Pitch = 0.3f }, Projectile.Center);
+9 -4
View File
@@ -89,11 +89,16 @@ namespace CalamityMod.Projectiles.Summon
SpawnEffect(); // Does a dust spawn effect.
ShootTarget(target); // If there's a target, shoot at the target.
if (target is not null && Owner.miscCounter % 30 == 0) {
if (moddedOwner.StratusStarburst <= CalamityPlayer.MaxStratusStarburst)
if (target is not null)
{
moddedOwner.StarburstSpawnFrameCounter += Projectile.minionSlots / (float)CalamityUtils.SecondsToFrames(3f); //0.33 starbursts per seconds per minion slot
while (moddedOwner.StarburstSpawnFrameCounter >= 1 && moddedOwner.StratusStarburst <= CalamityPlayer.MaxStratusStarburst)
{
moddedOwner.StratusStarburst++;
moddedOwner.StarburstEntities.Add(new StarburstEntity(Projectile.Center));
moddedOwner.StratusStarburst++;
moddedOwner.StarburstSpawnFrameCounter--;
}
}
Lighting.AddLight(Projectile.Center, 0.5f, 0.5f, 1f); // Passively makes blue light.
+3 -1
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Projectiles.Summon
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
bool hasExploded = false;
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
@@ -75,8 +76,9 @@ namespace CalamityMod.Projectiles.Summon
//Due to Sirius's high Starburst consumption, it inflicts long amounts of Voidfrost on hit
target.AddBuff(ModContent.BuffType<Voidfrost>(), 600);
float x4 = Main.rgbToHsl(new Color(103, 203, Main.DiscoB)).X;
if (Projectile.numHits == 0)
if (!hasExploded && !target.Calamity().IsArmored())
{
hasExploded = true;
SoundStyle fire = new("CalamityMod/Sounds/Item/ScorpioNukeHit");
SoundEngine.PlaySound(fire with { Volume = 0.75f, Pitch = 0.6f, PitchVariance = 0.2f }, Projectile.Center);
float numberOfDusts = 156f;
@@ -147,7 +147,6 @@ namespace CalamityMod.Projectiles.Summon
public static Asset<Texture2D> circle;
public override bool PreDraw(ref Color lightColor)
{
AllWhiteVersion = null;
var spTex = TextureAssets.Projectile[Type].Value;
var whiteTex = GetWhiteTex();
var ciTex = CalamityUtils.GetTextureEfficient(ref circle, "CalamityMod/ExtraTextures/GreyscaleOpenCircleButBigger").Value;
+1 -1
View File
@@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Typeless
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
target.AddBuff(ModContent.BuffType<RiptideDebuff>(), 540);
target.AddBuff(ModContent.BuffType<RiptideDebuff>(), 180);
Projectile.netUpdate = true;
}
public override void OnKill(int timeLeft)
@@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Ranged
SoundEngine.PlaySound(SoundID.Item88, Projectile.Center);
if (Projectile.owner == Main.myPlayer)
{
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SulphuricAcidCannonExplosion>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SulphuricAcidCannonExplosion>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner);
Main.projectile[p].DamageType = DamageClass.Default;
}
// Circular spread of clouds and bubbles for impact
+2 -2
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Typeless
}
foreach (var player in Main.ActivePlayers)
{
if (player.Distance(Projectile.Center) <= 600)
if (player.Distance(Projectile.Center) <= 600 && !player.dead)
{
if (player.miscCounter % 30 == 15)
{
@@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Typeless
player.Calamity().StarburstEntities.Add(new StarburstEntity(Projectile.Center));
player.Calamity().StratusStarburstResetTimer = (int)MathHelper.Max(player.Calamity().StratusStarburstResetTimer, 180);
}
if (player.wingsLogic > 0)
if (player.wingsLogic > 0 && player.wingTimeMax > 0)
{
if (player.wingTime <= 0 && player.Calamity().AvaliableStarburst > 0)
{
+33 -6
View File
@@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Typeless
public override void SetDefaults()
{
Projectile.width = 50;
Projectile.height = 50;
Projectile.width = 70;
Projectile.height = 80;
Projectile.aiStyle = -1;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
@@ -130,6 +130,8 @@ namespace CalamityMod.Projectiles.Typeless
int dustCount = (int)Math.Round(MathHelper.SmoothStep(1f, 5f, Time / Lifetime));
float outwardness = MathHelper.SmoothStep(40f, 150f, Time / Lifetime);
float dustScale = MathHelper.Lerp(1.15f, 1.725f, Time / Lifetime);
float colorTime = Time / Lifetime * Main.rand.NextFloat(0.65f, 1f);
for (int i = 0; i < dustCount; i++)
{
Vector2 spawnPosition = Projectile.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f);
@@ -138,7 +140,7 @@ namespace CalamityMod.Projectiles.Typeless
Dust paleMagic = Dust.NewDustPerfect(spawnPosition, DustID.PortalBoltTrail);
paleMagic.velocity = dustVelocity;
paleMagic.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f);
paleMagic.color = Color.Lerp(Color.LightCoral, Color.White, Time / Lifetime * Main.rand.NextFloat(0.65f, 1f));
paleMagic.color = Main.zenithWorld ? Color.Lerp(Color.LightCoral, Color.White, colorTime) : Color.Lerp(Color.Violet, Color.Goldenrod, colorTime);
paleMagic.noGravity = true;
paleMagic.noLight = true;
}
@@ -169,8 +171,8 @@ namespace CalamityMod.Projectiles.Typeless
SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
if (Time >= 150f)
{
float outwardness = MathHelper.SmoothStep(1f, 15f, Utils.GetLerpValue(150f, Lifetime - 30f, Time, true));
Color afterimageColor = Color.Lerp(baseColor, Color.LightCoral, Utils.GetLerpValue(150f, 195f, Time, true)) * 0.225f;
float outwardness = MathHelper.SmoothStep(0f, 12f, Utils.GetLerpValue(150f, Lifetime - 30f, Time, true));
Color afterimageColor = Color.Lerp(baseColor, Color.PaleGoldenrod, Utils.GetLerpValue(150f, 195f, Time, true)) * 0.225f;
afterimageColor.A = 0;
for (int i = 0; i < 10; i++)
@@ -179,9 +181,34 @@ namespace CalamityMod.Projectiles.Typeless
Main.EntitySpriteDraw(texture, baseDrawPosition + drawOffset, null, afterimageColor, 0f, origin, Projectile.scale, direction, 0);
}
}
Main.EntitySpriteDraw(texture, baseDrawPosition, null, baseColor, 0f, origin, Projectile.scale, direction, 0);
Main.EntitySpriteDraw(texture, baseDrawPosition, null, baseColor, 0f, origin, Projectile.scale, direction, 0);
return false;
}
public override void PostDraw(Color lightColor)
{
if (Main.zenithWorld)
return;
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/TerminusGlow").Value;
Vector2 baseDrawPosition = Projectile.Center - Main.screenPosition;
Vector2 origin = texture.Size() * 0.5f;
SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
if (Time >= 75f)
{
float outwardness = MathHelper.SmoothStep(0f, 4f, Utils.GetLerpValue(75f, Lifetime - 30f, Time, true));
for (int i = 0; i < 3; i++)
{
Vector2 drawOffset = (MathHelper.TwoPi * i / 4f + Main.GlobalTimeWrappedHourly * 4.4f).ToRotationVector2() * outwardness;
Main.EntitySpriteDraw(texture, baseDrawPosition + drawOffset, null, new Color(56, 12, 115, 0), 0f, origin, Projectile.scale, direction, 0);
}
}
Main.EntitySpriteDraw(texture, baseDrawPosition, null, Color.White, 0f, origin, Projectile.scale, direction, 0);
}
}
}
Binary file not shown.
+1 -1
View File
@@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.Abyss
{
return;
}
if (!WorldGen.EmptyTileCheck(i - 1, i + 1, trueStartingPositionY - 20, trueStartingPositionY, Type))
if (!WorldGen.EmptyTileCheck(i - 1, i + 1, trueStartingPositionY - 20, trueStartingPositionY-1, Type))
{
return;
}
-5
View File
@@ -29,11 +29,6 @@ namespace CalamityMod.Tiles.FurnitureExo
num = fail ? 1 : 3;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 16, ModContent.ItemType<ExoWorkBench>());
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
if (Main.tile[i, j].IsTileActuallyInvisible())
@@ -358,7 +358,8 @@ namespace CalamityMod.UI.DraedonSummoning
// Draw and update the text scroller if there is some cut off text.
Vector2 textTopLeft = selectionArea.TopLeft() + new Vector2(20f, 12f) * panelScale + Vector2.UnitY * OptionsTextVerticalOffset;
float cutoffDistance = OptionsTextHeight / GeneralScale - selectionOutline.Height;
float bottomPadding = panelScale.Y * 24f;
float cutoffDistance = OptionsTextHeight - selectionOutline.Height * panelScale.Y + bottomPadding;
if (cutoffDistance > 0f && OptionsTextOpacity > 0f)
{
if (MouseScreenArea.Intersects(selectionArea))
@@ -476,7 +477,9 @@ namespace CalamityMod.UI.DraedonSummoning
// Ensure that the player starts at the bottom of the scoller, now that new text is generating there.
Texture2D dialogOutline = ModContent.Request<Texture2D>("CalamityMod/UI/DraedonSummoning/DraedonDialogOutline").Value;
Rectangle dialogArea = Utils.CenteredRectangle(selectionCenter, dialogOutline.Size() * panelScale);
DialogVerticalOffset = -DialogHeight * GeneralScale;
float scaledLineSpacing = FontAssetSystem.CodebreakerDialog.Value.LineSpacing * panelScale.Y;
bottomPadding = scaledLineSpacing * 3f;
DialogVerticalOffset = -(DialogHeight - dialogOutline.Height * panelScale.Y + bottomPadding);
DialogScroller.PositionYInterpolant = 1f;
if (DialogVerticalOffset > 0f)
DialogVerticalOffset = 0f;
@@ -579,7 +582,9 @@ namespace CalamityMod.UI.DraedonSummoning
// Draw and update the text scroller if there is some cut off text.
Vector2 textTopLeft = dialogArea.TopLeft() + new Vector2(20f, 14f) * panelScale;
float cutoffDistance = DialogHeight - dialogOutline.Height;
float scaledLineSpacing = FontAssetSystem.CodebreakerDialog.Value.LineSpacing * panelScale.Y;
float bottomPadding = scaledLineSpacing * 3f;
float cutoffDistance = DialogHeight - (dialogOutline.Height * panelScale.Y - bottomPadding);
if (cutoffDistance > 0f && OptionsTextOpacity > 0f)
{
if (MouseScreenArea.Intersects(dialogArea))
-3
View File
@@ -26,9 +26,6 @@ namespace CalamityMod.Waters
public override void InflictDebuff(Player player, int onfireDuration)
{
// Extra DoT in the lava of the crags. Negated by Flame-licked Shell.
if (!player.Calamity().flameLickedShell)
player.AddBuff(ModContent.BuffType<SearingLava>(), 2, false);
}
}
}
+2 -2
View File
@@ -245,7 +245,7 @@ namespace CalamityMod.World
else
{
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
tile.WallType = (ushort)ModContent.WallType<SafeAbyssGravelWall>();
tile.WallType = (ushort)ModContent.WallType<UnsafeAbyssGravelWall>();
}
}
//basically places smaller clusters everywhere else?
@@ -301,7 +301,7 @@ namespace CalamityMod.World
else
{
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
tile.WallType = (ushort)ModContent.WallType<SafeAbyssGravelWall>();
tile.WallType = (ushort)ModContent.WallType<UnsafeAbyssGravelWall>();
}
}
}