Merge branch '1.4.4' into boss-hp-config-compatibility-fix

This commit is contained in:
Storm2103 committed 2024-06-08 22:56:30 -06:00
commit 58dfdaf794
55 files changed
+184 -185

No files matched your search

+4 -1
View File
@@ -155,8 +155,11 @@ namespace CalamityMod.Events
new Boss(ModContent.NPCType<DesertScourgeHead>(), spawnContext: type =>
{
Player player = Main.player[ClosestPlayerToWorldCenter];
SoundEngine.PlaySound(DesertMedallion.SummonSound, player.Center);
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<DesertScourgeHead>());
}, permittedNPCs: new int[] { ModContent.NPCType<DesertScourgeBody>(), ModContent.NPCType<DesertScourgeTail>(), ModContent.NPCType<DesertNuisanceHead>(),
}, usesSpecialSound: true, permittedNPCs: new int[] { ModContent.NPCType<DesertScourgeBody>(), ModContent.NPCType<DesertScourgeTail>(), ModContent.NPCType<DesertNuisanceHead>(),
ModContent.NPCType<DesertNuisanceBody>(), ModContent.NPCType<DesertNuisanceTail>(), ModContent.NPCType<DesertNuisanceHeadYoung>(),
ModContent.NPCType<DesertNuisanceBodyYoung>(), ModContent.NPCType<DesertNuisanceTailYoung>() }),
+10 -7
View File
@@ -13,6 +13,7 @@ using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Prefixes;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -71,12 +72,14 @@ namespace CalamityMod.Items
{
"Expert",
"SetBonus",
RogueAccessoryPrefix.StealthTooltipID,
"PrefixAccMeleeSpeed",
"PrefixAccMoveSpeed",
"PrefixAccDamage",
"PrefixAccCritChance",
"PrefixAccMaxMana",
"PrefixAccDefense",
RogueWeaponPrefix.StealthTooltipID,
"PrefixKnockback",
"PrefixShootSpeed",
"PrefixSize",
@@ -232,27 +235,27 @@ namespace CalamityMod.Items
//
// The best possible position is identified using a separate backwards search.
int difficultyTooltipIdx = -1;
int difficultyTooltipIndex = -1;
foreach (string lineName in RevTooltipInsertionPositions)
{
int idx = tooltips.FindIndex((line) => line.Name == lineName);
if (idx != -1)
{
difficultyTooltipIdx = idx + 1;
difficultyTooltipIndex = idx;
break;
}
}
// If the backwards search fails, it defaults to the last known tooltip index from the previous search.
if (difficultyTooltipIdx == -1)
difficultyTooltipIdx = lastTooltipIndex;
if (difficultyTooltipIndex == -1)
difficultyTooltipIndex = lastTooltipIndex;
// Adds "Revengeance" to all items which are Revengeance exclusive, like how vanilla does it for Expert and Master items.
if (revengeanceItem)
{
LocalizedText revText = CalamityUtils.GetText("UI.Revengeance");
TooltipLine revLine = new TooltipLine(Mod, "CalamityMod:RevengeanceItem", revText.Value);
tooltips.Insert(++difficultyTooltipIdx, revLine);
tooltips.Insert(++difficultyTooltipIndex, revLine);
}
// Adds "Donor Item" and "Developer Item" to donor items and developer items respectively.
@@ -262,14 +265,14 @@ namespace CalamityMod.Items
LocalizedText devText = CalamityUtils.GetText("UI.DevItemTooltip");
string coloredText = CalamityUtils.ColorMessage(devText.Value, CalamityUtils.DevItemColor);
TooltipLine devLine = new TooltipLine(Mod, "CalamityMod:DevItem", coloredText);
tooltips.Insert(++difficultyTooltipIdx, devLine);
tooltips.Insert(++difficultyTooltipIndex, devLine);
}
else if (donorItem)
{
LocalizedText donorText = CalamityUtils.GetText("UI.DonorItemTooltip");
string coloredText = CalamityUtils.ColorMessage(donorText.Value, CalamityUtils.DonatorItemColor);
TooltipLine donorLine = new TooltipLine(Mod, "CalamityMod:DonorItem", coloredText);
tooltips.Insert(++difficultyTooltipIdx, donorLine);
tooltips.Insert(++difficultyTooltipIndex, donorLine);
}
}
#endregion
+3 -1
View File
@@ -13,6 +13,8 @@ namespace CalamityMod.Items.SummonItems
public class DesertMedallion : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.SummonItems";
public static readonly SoundStyle SummonSound = new("CalamityMod/Sounds/Custom/DesertScourge/DesertScourgeSummon");
public override void SetStaticDefaults()
{
ItemID.Sets.SortingPriorityBossSpawns[Type] = 1; // Suspicious Looking Eye
@@ -41,7 +43,7 @@ namespace CalamityMod.Items.SummonItems
public override bool? UseItem(Player player)
{
SoundEngine.PlaySound(SoundID.Roar, player.Center);
SoundEngine.PlaySound(SummonSound, player.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<DesertScourgeHead>());
else
+69 -5
View File
@@ -1,5 +1,9 @@
using CalamityMod.Projectiles.Magic;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,15 +13,19 @@ namespace CalamityMod.Items.Weapons.Magic
public class LashesofChaos : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts
public int ProjectilesFired = 0;
public override void SetDefaults()
{
Item.width = 28;
Item.height = 30;
Item.damage = 65;
Item.damage = 111;
Item.DamageType = DamageClass.Magic;
Item.mana = 20;
Item.useTime = 38;
Item.useAnimation = 38;
Item.useTime = 46;
Item.useAnimation = 46;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 7.5f;
@@ -25,7 +33,63 @@ namespace CalamityMod.Items.Weapons.Magic
Item.rare = ItemRarityID.Lime;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<BrimstoneHellfireballFriendly>();
Item.shootSpeed = 3f;
Item.shootSpeed = 11f;
}
// Shoots twice as fast (and uses half as much mana to compensate) during hellblasts
public override float UseSpeedMultiplier(Player player) => (FiringMode == 1 && ProjectilesFired < 9) ? 2f : 1f;
public override void ModifyManaCost(Player player, ref float reduce, ref float mult)
{
if (FiringMode == 1)
mult = 0.5f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
ProjectilesFired++;
type = FiringMode == 1 ? ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>() : Item.shoot;
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, Main.myPlayer);
// DUST
int circleDustAmt = FiringMode == 1 ? 8 : 5 + ProjectilesFired;
for (int d = 0; d < circleDustAmt; d++)
{
Dust hellblastDust = Dust.NewDustPerfect(player.Center, (int)CalamityDusts.Brimstone, velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.8f, 1.1f), 150, default, FiringMode == 1 ? 1.7f : 0.8f + (ProjectilesFired * 0.15f));
hellblastDust.noGravity = true;
}
// Extra DUST and smoke while firing hellblasts
if (FiringMode == 1)
{
for (int d2 = 0; d2 < 8; d2++)
{
Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f);
dustVel.SafeNormalize(Vector2.Zero);
dustVel *= Main.rand.NextFloat(4f, 7f);
int hellfireballDust = Dust.NewDust(player.position, player.width, player.height, (int)CalamityDusts.Brimstone, dustVel.X, dustVel.Y, 150, default, 1.6f);
Main.dust[hellfireballDust].noGravity = true;
}
for (int p = 0; p < 3; p++)
{
HeavySmokeParticle hellblastSmoke = new(position + velocity, velocity.RotatedByRandom(MathHelper.ToRadians(15f)), Color.LightGray, 30, 0.6f, 0.5f, 0f, true);
GeneralParticleHandler.SpawnParticle(hellblastSmoke);
}
}
if (FiringMode == 0 && ProjectilesFired >= 5)
{
FiringMode = 1;
ProjectilesFired = 0;
}
if (FiringMode == 1 && ProjectilesFired >= 10)
{
FiringMode = 0;
ProjectilesFired = 0;
}
return false;
}
// This weapon intentionally does not reset its variables when swapping to a different item
}
}
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetStaticDefaults()
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
flaskIDs = new int[]
{
ModContent.ProjectileType<MadAlchemistsCocktailRed>(),
+2 -2
View File
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(Main.rand.NextBool() ? BuffID.Frostburn2 : BuffID.OnFire3, 240);
target.AddBuff(Main.rand.NextBool() ? BuffID.Frostburn2 : BuffID.ShadowFlame, 240);
int slashCreatorID = ModContent.ProjectileType<DarklightGreatswordSlashCreator>();
int slashDamage = (int)(player.CalcIntDamage<MeleeDamageClass>(Item.damage) * TrueMeleeSlashProjectileDamageMultiplier);
float slashKnockback = Item.knockBack * TrueMeleeSlashProjectileDamageMultiplier;
@@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) => target.AddBuff(Main.rand.NextBool() ? BuffID.Frostburn2 : BuffID.OnFire3, 240);
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) => target.AddBuff(Main.rand.NextBool() ? BuffID.Frostburn2 : BuffID.ShadowFlame, 240);
public override void AddRecipes()
{
+3 -3
View File
@@ -108,11 +108,11 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.ShadowFlame, 150);
target.AddBuff(BuffID.OnFire3, 300);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
if (hit.Crit)
{
target.AddBuff(BuffID.ShadowFlame, 450);
target.AddBuff(BuffID.OnFire3, 900);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 900);
player.ApplyDamageToNPC(target, Item.damage * 4, 0f, 0, false);
float firstDustScale = 1.7f;
float secondDustScale = 0.8f;
@@ -154,7 +154,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<Shadowflame>(), 450);
target.AddBuff(BuffID.OnFire3, 900);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 900);
SoundEngine.PlaySound(SoundID.Item14, target.Center);
}
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 92;
Item.height = 104;
Item.damage = 170;
Item.damage = 210;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 16;
Item.useStyle = ItemUseStyleID.Swing;
+3 -3
View File
@@ -57,11 +57,11 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.ShadowFlame, 150);
target.AddBuff(BuffID.OnFire3, 300);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
if (hit.Crit)
{
target.AddBuff(BuffID.ShadowFlame, 450);
target.AddBuff(BuffID.OnFire3, 900);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 900);
player.ApplyDamageToNPC(target, player.GetWeaponDamage(player.ActiveItem()) * 2, 0f, 0, false);
float firstDustScale = 1.7f;
float secondDustScale = 0.8f;
@@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<Shadowflame>(), 450);
target.AddBuff(BuffID.OnFire3, 900);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 900);
SoundEngine.PlaySound(SoundID.Item14, target.Center);
}
+3 -3
View File
@@ -38,11 +38,11 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.ShadowFlame, 120);
target.AddBuff(BuffID.OnFire3, 240);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 240);
if (hit.Crit)
{
target.AddBuff(BuffID.ShadowFlame, 360);
target.AddBuff(BuffID.OnFire3, 720);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 720);
int onHitDamage = player.CalcIntDamage<MeleeDamageClass>(2 * Item.damage);
player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false);
float firstDustScale = 1.7f;
@@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<Shadowflame>(), 360);
target.AddBuff(BuffID.OnFire3, 720);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 720);
SoundEngine.PlaySound(SoundID.Item14, target.Center);
}
+1 -1
View File
@@ -94,7 +94,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 300);
target.AddBuff(BuffID.Daybreak, 300);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
@@ -481,7 +481,11 @@ Keelhaul: {
LashesofChaos: {
DisplayName: Lashes of Chaos
Tooltip: "'Watch the world burn...'"
Tooltip:
'''
Alternates between exploding hellfireballs and piercing hellblasts
'Watch the world burn...'
'''
}
Lazhar: {
@@ -499,7 +503,7 @@ MadAlchemistsCocktailGlove: {
Tooltip:
'''
Fires a variety of high-velocity flasks
Press <right> to throw a prismatic flask that inflicts many debuffs
Press <right> to throw a prismatic flask that inflicts Elemental Mix
Red flasks explode violently
Blue flasks contain poison gas
Green flasks summon lunar flares
@@ -835,7 +835,7 @@ Oblivion: {
DisplayName: Oblivion
Tooltip:
'''
Fires brimstone lasers when enemies are near
Fires brimstone darts when enemies are near
A very agile yoyo
'''
}
@@ -50,7 +50,6 @@ BrimlanceStandingFire.DisplayName: Brimlance Flame
Brimlash2.DisplayName: Brimlash
BrimlashProj.DisplayName: Brimlash
BrimstoneBoom.DisplayName: Boom
BrimstoneLaserFriendly.DisplayName: Brimstone Laser
BrimstoneSwordExplosion.DisplayName: Brimstone Sword Explosion
BrimstoneSwordProj.DisplayName: Brimstone Sword
BrinySpout.DisplayName: Briny Spout
+2 -2
View File
@@ -951,14 +951,14 @@ namespace CalamityMod.NPCs
// Holy Flames
if (hFlames > 0)
{
int baseHolyFlamesDoTValue = (int)(200 * heatDamageMult);
int baseHolyFlamesDoTValue = (int)(300 * heatDamageMult);
ApplyDPSDebuff(baseHolyFlamesDoTValue, baseHolyFlamesDoTValue / 5, ref npc.lifeRegen, ref damage);
}
// God Slayer Inferno
if (gsInferno > 0)
{
int baseGodSlayerInfernoDoTValue = (int)(250 * heatDamageMult);
int baseGodSlayerInfernoDoTValue = (int)(500 * heatDamageMult);
ApplyDPSDebuff(baseGodSlayerInfernoDoTValue, baseGodSlayerInfernoDoTValue / 5, ref npc.lifeRegen, ref damage);
}
+2 -2
View File
@@ -61,8 +61,8 @@ namespace CalamityMod.NPCs.DesertScourge
NPC.behindTiles = true;
NPC.noGravity = true;
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.HitSound = DesertScourgeHead.HitSound;
NPC.DeathSound = DesertScourgeHead.DeathSound;
NPC.netAlways = true;
NPC.dontCountMe = true;
+7 -4
View File
@@ -59,7 +59,10 @@ namespace CalamityMod.NPCs.DesertScourge
private const int OpenMouthStopFrame = 4;
public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/DesertScourgeRoar");
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/DesertScourgeHit", 3);
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/DesertScourgeDeath");
public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/DesertScourge/DesertScourgeRoar");
public static readonly SoundStyle SandBlastSound = new("CalamityMod/Sounds/Custom/DesertScourge/DesertScourgeSandBlast");
public override void SetStaticDefaults()
{
@@ -104,8 +107,8 @@ namespace CalamityMod.NPCs.DesertScourge
NPC.behindTiles = true;
NPC.noGravity = true;
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.HitSound = HitSound;
NPC.DeathSound = DeathSound;
NPC.netAlways = true;
if (Main.getGoodWorld)
@@ -565,7 +568,7 @@ namespace CalamityMod.NPCs.DesertScourge
if (lungeUpward && NPC.Center.Y <= NPC.Calamity().newAI[3] + LungeUpwardDistanceOffset - LungeUpwardCutoffDistance && Math.Abs(NPC.Center.X - player.Center.X) < 480f && !quickFall)
{
// Spit a huge spread of sand upwards that falls down
SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center);
SoundEngine.PlaySound(SandBlastSound, NPC.Center);
float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 16f : bossRush ? 10f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f;
int type = ModContent.ProjectileType<DesertScourgeSpit>();
int damage = NPC.GetProjectileDamage(type);
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.NPCs.DesertScourge
NPC.behindTiles = true;
NPC.noGravity = true;
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.HitSound = DesertScourgeHead.HitSound;
NPC.DeathSound = DesertScourgeHead.DeathSound;
NPC.netAlways = true;
NPC.dontCountMe = true;
@@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
Vector2 npcCenterAccountingForHooks = new Vector2(hookPositionX, hookPositionY);
float maxVelocityX = Main.player[npc.target].Center.X - npcCenterAccountingForHooks.X;
float maxVelocityY = Main.player[npc.target].Center.Y - npcCenterAccountingForHooks.Y;
bool phase1MoveAway = !phase2 && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 480f && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
bool phase1MoveAway = !phase2 && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 240f && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
bool adjustProjectileShootLocation = Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 80f;
if (despawn)
{
@@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
maxVelocityY *= -1f;
maxVelocityX *= -1f;
velocity *= 1.5f;
acceleration *= 2f;
acceleration *= 1.5f;
}
float distanceFromTarget = (float)Math.Sqrt(maxVelocityX * maxVelocityX + maxVelocityY * maxVelocityY);
+2 -1
View File
@@ -44,10 +44,11 @@ namespace CalamityMod.Prefixes
}
// Extra tooltip for new modifier stats
internal const string StealthTooltipID = "CalamityMod:PrefixAccStealthGen";
public LocalizedText StealthGenTooltip => CalamityUtils.GetText($"{LocalizationCategory}.StealthGenTooltip");
public override IEnumerable<TooltipLine> GetTooltipLines(Item item)
{
yield return new TooltipLine(Mod, "PrefixStealthGenBoost", StealthGenTooltip.Format((stealthGenBonus * 100).ToString("N0")))
yield return new TooltipLine(Mod, StealthTooltipID, StealthGenTooltip.Format((stealthGenBonus * 100).ToString("N0")))
{
IsModifier = true
};
+3 -2
View File
@@ -165,9 +165,10 @@ namespace CalamityMod.Prefixes
float stealthDamageValueMultiplier = 1f;
float extraValue = 1f + stealthDamageValueMultiplier * extraStealthDamage;
valueMult *= extraValue;
}
}
// Extra tooltip for new modifier stats
internal const string StealthTooltipID = "CalamityMod:PrefixStealthDamage";
public LocalizedText StealthDamageTooltip => CalamityUtils.GetText($"{LocalizationCategory}.StealthDamageTooltip");
public override IEnumerable<TooltipLine> GetTooltipLines(Item item)
{
@@ -175,7 +176,7 @@ namespace CalamityMod.Prefixes
if (stealthDmgMult == 1f)
yield break;
yield return new TooltipLine(Mod, "PrefixStealthDamageBoost", StealthDamageTooltip.Format((stealthDmgMult >= 1f ? "+" : string.Empty) + ((stealthDmgMult * 100) - 100).ToString("N0")))
yield return new TooltipLine(Mod, StealthTooltipID, StealthDamageTooltip.Format((stealthDmgMult >= 1f ? "+" : string.Empty) + ((stealthDmgMult * 100) - 100).ToString("N0")))
{
IsModifier = true,
IsModifierBad = stealthDmgMult < 1f
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.NPCs.BrimstoneElemental;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -63,19 +64,19 @@ namespace CalamityMod.Projectiles.Magic
if (Projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center);
Projectile.localAI[0] += 1f;
}
// Speed up as time goes on
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * (Projectile.velocity.Length() + 1.2f);
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * (Projectile.velocity.Length() + 0.25f);
}
public override void OnKill(int timeLeft)
{
if (Projectile.owner == Main.myPlayer)
{
int fire = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<HellfireExplosionFriendly>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
int fire = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<HellfireExplosionFriendly>(), (int)(Projectile.damage * 0.66f), Projectile.knockBack, Projectile.owner);
}
}
@@ -21,10 +21,10 @@ namespace CalamityMod.Projectiles.Magic
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 180;
Projectile.timeLeft = 120;
Projectile.DamageType = DamageClass.Magic;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = 20;
}
public override void AI()
@@ -37,12 +37,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
int duration = 240;
target.AddBuff(ModContent.BuffType<CrushDepth>(), duration);
target.AddBuff(ModContent.BuffType<HolyFlames>(), duration);
target.AddBuff(ModContent.BuffType<Nightwither>(), duration);
target.AddBuff(BuffID.Electrified, duration);
target.AddBuff(BuffID.Venom, duration);
target.AddBuff(ModContent.BuffType<ElementalMix>(), 360);
}
public override void OnKill(int timeLeft)
@@ -1,7 +1,9 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.NPCs.BrimstoneElemental;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic
public override void AI()
{
if (Projectile.ai[0] == 0f)
{
SoundEngine.PlaySound(BrimstoneElemental.DartSound, Projectile.Center);
Projectile.ai[0] = 1f;
}
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < (Projectile.ai[1] == 1f ? 12f : 16f))
{
Projectile.velocity *= 1.01f;
@@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Magic
Projectile.penetrate = 4;
Projectile.timeLeft = 255;
Projectile.alpha = 0;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override void AI()
@@ -41,7 +43,6 @@ namespace CalamityMod.Projectiles.Magic
{
if (Projectile.npcProj)
{
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 5;
Projectile.penetrate = 10;
}
@@ -64,8 +65,8 @@ namespace CalamityMod.Projectiles.Magic
Projectile.ai[1] = 1f;
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
}
Projectile.velocity.X *= 1.03f;
Projectile.velocity.Y *= 1.03f;
Projectile.velocity.X *= 1.045f;
Projectile.velocity.Y *= 1.045f;
if (Projectile.velocity.X < 0f)
{
Projectile.spriteDirection = -1;
@@ -1,64 +0,0 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class BrimstoneLaserFriendly : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/Melee/BrimstoneLaser";
public override void SetDefaults()
{
Projectile.width = 2;
Projectile.height = 2;
Projectile.aiStyle = ProjAIStyleID.Arrow;
AIType = ProjectileID.DeathLaser;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.scale = 2f;
Projectile.ignoreWater = true;
Projectile.penetrate = 1;
Projectile.alpha = 120;
Projectile.timeLeft = 600;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.05f / 255f, (255 - Projectile.alpha) * 0.05f / 255f);
Projectile.velocity.X *= 1.05f;
Projectile.velocity.Y *= 1.05f;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity.Y += Projectile.ai[0];
if (Main.rand.NextBool())
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 60);
}
}
}
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -107,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.ShadowFlame, 90);
target.AddBuff(BuffID.OnFire3, 180);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
}
}
}
+1 -5
View File
@@ -78,13 +78,9 @@ namespace CalamityMod.Projectiles.Melee
}
}
// Debuff applied depends on spark color.
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.ai[0] == 0f)
target.AddBuff(BuffID.Daybreak, 180);
else if (Projectile.ai[0] == 2f)
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
target.AddBuff(ModContent.BuffType<Dragonfire>(), 180);
}
// Pure dust projectile, but dust used depends on AI variables
+2 -3
View File
@@ -139,9 +139,8 @@ namespace CalamityMod.Projectiles.Melee
if (Main.player[Projectile.owner].WithinRange(target.Center, 345f))
return;
// Inflicts Daybroken, Abyssal Flames and Holy Flames for 3 seconds on-hit
target.AddBuff(BuffID.Daybreak, 180);
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
// Inflicts Dragonfire for 3 seconds on-hit
target.AddBuff(ModContent.BuffType<Dragonfire>(), 180);
Projectile.ai[0] = 1f;
Projectile.netUpdate = true;
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -92,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 120);
}
}
}
+1 -1
View File
@@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 240);
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 120);
}
}
}
+1 -3
View File
@@ -143,9 +143,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 300);
target.AddBuff(BuffID.Frostburn2, 240);
target.AddBuff(BuffID.CursedInferno, 180);
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 600);
}
}
}
+5
View File
@@ -1,5 +1,6 @@
using System;
using System.IO;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -41,6 +42,10 @@ namespace CalamityMod.Projectiles.Melee
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -77,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 180);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
target.AddBuff(BuffID.ShadowFlame, 90);
}
-2
View File
@@ -74,8 +74,6 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
int heal = (int)Math.Round(hit.Damage * 0.015);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
+4 -3
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -97,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 120);
target.AddBuff(BuffID.ShadowFlame, 120);
if (Projectile.numHits >= 2) // Fades out after the third hit
Projectile.timeLeft = FadeOutTime;
@@ -111,7 +112,7 @@ namespace CalamityMod.Projectiles.Melee
}
}
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Shadowflame>(), 120);
public override bool? CanDamage() => Projectile.timeLeft < FadeOutTime ? false : null;
}
+3 -2
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 180);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
target.AddBuff(BuffID.ShadowFlame, 90);
}
+1 -1
View File
@@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 240);
target.AddBuff(BuffID.Daybreak, 240);
}
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
target.AddBuff(BuffID.Daybreak, 120);
}
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 30f, 5, ModContent.ProjectileType<SlimeStream>(), 0.75);
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 30f, 5, ModContent.ProjectileType<SlimeStream>(), 0.75, damageType: Projectile.DamageType);
if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks
Projectile.Kill();
}
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 48f, 5, ModContent.ProjectileType<BrimstoneLaserFriendly>(), 0.5);
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 9f, 48f, 5, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), 0.5, damageType: Projectile.DamageType);
if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks
Projectile.Kill();
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 120f, 5, ProjectileID.HallowStar);
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 120f, 5, ProjectileID.HallowStar, damageType: Projectile.DamageType);
if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks
Projectile.Kill();
}
+1 -1
View File
@@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue
// Stealth strike lasers have an intentionally lower ratio of 12%.
double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.15D : 0.4D;
float laserFrames = Projectile.MaxUpdates * 8f;
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType<NebulaShot>(), laserDamageRatio, true);
CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType<NebulaShot>(), laserDamageRatio, true, Projectile.DamageType);
}
}
-18
View File
@@ -39,24 +39,6 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.Kill();
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.dayTime || Main.rand.NextBool(3)) //100% during day, 33.33% chance at night
target.AddBuff(BuffID.Daybreak, 30);
if (!Main.dayTime || Main.rand.NextBool(3)) //100% at night, 33.33% chance during day
target.AddBuff(ModContent.BuffType<Nightwither>(), 30);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (Main.dayTime || Main.rand.NextBool(3)) //100% during day, 33.33% chance at night
target.AddBuff(BuffID.Daybreak, 30);
if (!Main.dayTime || Main.rand.NextBool(3)) //100% at night, 33.33% chance during day
target.AddBuff(ModContent.BuffType<Nightwither>(), 30);
}
public override void PostDraw(Color lightColor)
{
Texture2D glow = ModContent.Request<Texture2D>(Texture + "Glow").Value;
@@ -8,7 +8,6 @@ namespace CalamityMod.Projectiles.Summon
public class BrimstoneLaserSummon : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/Melee/BrimstoneLaser";
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -12
View File
@@ -292,8 +292,8 @@ namespace CalamityMod
return orb;
}
// TODO -- This overused method should NOT have hardcoded projectile type checks in it.
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false)
// TODO -- This method is very overused.
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false, DamageClass damageType = null)
{
// Only shoot once every N frames.
projectile.localAI[1] += 1f;
@@ -351,28 +351,22 @@ namespace CalamityMod
{
int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ProjectileType<EradicatorProjectile>())
if (damageType != null)
if (projectile2.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile2].DamageType = RogueDamageClass.Instance;
Main.projectile[projectile2].DamageType = damageType;
}
}
return;
}
if (projectile.type == ProjectileType<GodsGambitYoyo>())
{
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
velocity.X += Main.rand.Next(-30, 31) * 0.05f;
}
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ProjectileType<GodsGambitYoyo>() || projectile.type == ProjectileType<ShimmersparkYoyo>())
if (damageType != null)
if (projectile2.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile2].DamageType = DamageClass.MeleeNoSpeed;
Main.projectile[projectile2].DamageType = damageType;
}
}
}