Merge branch 'master' into balancing-7
No files matched your search
@@ -113,7 +113,19 @@ namespace CalamityMod.Buffs
|
||||
tip = "22.5% increased damage";
|
||||
break;
|
||||
|
||||
case BuffID.BeetleEndurance1:
|
||||
case BuffID.BeetleMight1:
|
||||
tip = "Melee damage and speed increase by 5%";
|
||||
break;
|
||||
|
||||
case BuffID.BeetleMight2:
|
||||
tip = "Melee damage and speed increase by 10%";
|
||||
break;
|
||||
|
||||
case BuffID.BeetleMight3:
|
||||
tip = "Melee damage and speed increase by 15%";
|
||||
break;
|
||||
|
||||
case BuffID.BeetleEndurance1:
|
||||
tip = "Damage taken reduced by 10%";
|
||||
break;
|
||||
|
||||
|
||||
@@ -345,8 +345,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool rageModeActive = false;
|
||||
public float rage = 0f;
|
||||
public float rageMax = 100f; // 0 to 100% by default
|
||||
public static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(10);
|
||||
public static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(2);
|
||||
public static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default.
|
||||
public static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12.
|
||||
public int RageDuration = DefaultRageDuration;
|
||||
public int rageGainCooldown = 0;
|
||||
public static readonly int DefaultRageGainCooldown = 10; // It is pretty hard to have less than 10 iframes for any reason
|
||||
@@ -419,7 +419,10 @@ namespace CalamityMod.CalPlayer
|
||||
public bool evasionScarf = false;
|
||||
public bool badgeOfBravery = false;
|
||||
public bool badgeOfBraveryRare = false;
|
||||
public bool scarfCooldown = false;
|
||||
public float warBannerBonus = 0f;
|
||||
private const float maxWarBannerBonus = 0.2f;
|
||||
private const float maxWarBannerDistance = 480f;
|
||||
public bool scarfCooldown = false;
|
||||
public bool eScarfCooldown = false;
|
||||
public bool cryogenSoul = false;
|
||||
public bool yInsignia = false;
|
||||
@@ -1440,6 +1443,7 @@ namespace CalamityMod.CalPlayer
|
||||
accStealthGenBoost = 0f;
|
||||
|
||||
trueMeleeDamage = 0D;
|
||||
warBannerBonus = 0f;
|
||||
|
||||
dashMod = 0;
|
||||
externalAbyssLight = 0;
|
||||
@@ -3675,31 +3679,51 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (badgeOfBraveryRare)
|
||||
{
|
||||
float maxDistance = 480f; // 30 tile distance
|
||||
float meleeSpeedBoost = 0f;
|
||||
for (int l = 0; l < Main.maxNPCs; l++)
|
||||
{
|
||||
NPC nPC = Main.npc[l];
|
||||
int closestNPC = -1;
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC nPC = Main.npc[i];
|
||||
if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage)
|
||||
{
|
||||
closestNPC = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
float distance = -1f;
|
||||
for (int j = 0; j < Main.maxNPCs; j++)
|
||||
{
|
||||
NPC nPC = Main.npc[j];
|
||||
if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage)
|
||||
{
|
||||
float distance2 = Math.Abs(nPC.position.X + (float)(nPC.width / 2) - (player.position.X + (float)(player.width / 2))) + Math.Abs(nPC.position.Y + (float)(nPC.height / 2) - (player.position.Y + (float)(player.height / 2)));
|
||||
if (distance == -1f || distance2 < distance)
|
||||
{
|
||||
distance = distance2;
|
||||
closestNPC = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Take the longer of the two directions for the NPC's hitbox to be generous.
|
||||
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth;
|
||||
if (closestNPC != -1)
|
||||
{
|
||||
NPC actualClosestNPC = Main.npc[closestNPC];
|
||||
|
||||
float generousHitboxWidth = Math.Max(actualClosestNPC.Hitbox.Width / 2f, actualClosestNPC.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = actualClosestNPC.Distance(player.Center) - generousHitboxWidth;
|
||||
|
||||
if (hitboxEdgeDist < 0)
|
||||
hitboxEdgeDist = 0;
|
||||
|
||||
if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance)
|
||||
{
|
||||
meleeSpeedBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance));
|
||||
if (hitboxEdgeDist < maxWarBannerDistance)
|
||||
{
|
||||
warBannerBonus = MathHelper.Lerp(0f, maxWarBannerBonus, 1f - (hitboxEdgeDist / maxWarBannerDistance));
|
||||
|
||||
if (meleeSpeedBoost >= 0.3f)
|
||||
{
|
||||
meleeSpeedBoost = 0.3f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
meleeSpeedMult += meleeSpeedBoost;
|
||||
if (warBannerBonus > maxWarBannerBonus)
|
||||
warBannerBonus = maxWarBannerBonus;
|
||||
}
|
||||
|
||||
meleeSpeedMult += warBannerBonus;
|
||||
}
|
||||
}
|
||||
if (eGauntlet)
|
||||
{
|
||||
@@ -3712,9 +3736,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (bloodyMary)
|
||||
{
|
||||
if (Main.bloodMoon)
|
||||
{
|
||||
meleeSpeedMult += 0.15f;
|
||||
}
|
||||
}
|
||||
if (community)
|
||||
{
|
||||
@@ -3747,6 +3769,11 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
meleeSpeedMult += 0.05f;
|
||||
}
|
||||
if (player.beetleOffense && player.beetleOrbs > 0)
|
||||
{
|
||||
player.meleeDamage -= 0.05f * player.beetleOrbs;
|
||||
meleeSpeedMult -= 0.05f * player.beetleOrbs;
|
||||
}
|
||||
if (CalamityConfig.Instance.Proficiency)
|
||||
{
|
||||
meleeSpeedMult += GetMeleeSpeedBonus();
|
||||
@@ -5345,7 +5372,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
// Add more true melee damage to the true melee projectile that scales with melee speed
|
||||
// This is done because melee speed does nothing to melee weapons that are purely projectiles
|
||||
damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f);
|
||||
damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f * 0.25f);
|
||||
}
|
||||
|
||||
if (screwdriver)
|
||||
@@ -6798,15 +6825,11 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2)
|
||||
{
|
||||
player.AddBuff(BuffID.Poisoned, 180);
|
||||
player.AddBuff(BuffID.Venom, 180);
|
||||
player.AddBuff(BuffID.Bleeding, 300);
|
||||
player.AddBuff(BuffID.Poisoned, 300);
|
||||
}
|
||||
else if (npc.type == NPCID.PlanterasTentacle)
|
||||
{
|
||||
player.AddBuff(BuffID.Poisoned, 120);
|
||||
player.AddBuff(BuffID.Venom, 120);
|
||||
player.AddBuff(BuffID.Bleeding, 180);
|
||||
player.AddBuff(BuffID.Poisoned, 180);
|
||||
}
|
||||
else if (npc.type == NPCID.AncientDoom)
|
||||
{
|
||||
@@ -6860,7 +6883,6 @@ namespace CalamityMod.CalPlayer
|
||||
else if (proj.type == ProjectileID.ThornBall)
|
||||
{
|
||||
player.AddBuff(BuffID.Poisoned, 240);
|
||||
player.AddBuff(BuffID.Venom, 120);
|
||||
}
|
||||
else if (proj.type == ProjectileID.CultistBossIceMist)
|
||||
{
|
||||
@@ -7390,7 +7412,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
evilSmasherBoost = 0;
|
||||
if (evilSmasherBoost > 0)
|
||||
evilSmasherBoost -= 1;
|
||||
|
||||
hellbornBoost = 0;
|
||||
|
||||
if (amidiasBlessing)
|
||||
|
||||
@@ -297,8 +297,8 @@ namespace CalamityMod.CalPlayer
|
||||
if (modPlayer.rageGainCooldown > 0)
|
||||
--modPlayer.rageGainCooldown;
|
||||
|
||||
// This is how much Rage will be changed by this frame.
|
||||
float rageDiff = 0;
|
||||
// This is how much Rage will be changed by this frame.
|
||||
float rageDiff = 0;
|
||||
|
||||
// If the player equips multiple rage generation accessories they get the max possible effect without stacking any of them.
|
||||
{
|
||||
@@ -407,42 +407,47 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
bool rageFading = modPlayer.rageCombatFrames <= 0 && !modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity;
|
||||
|
||||
// If Rage Mode is currently active, you smoothly lose all rage over the duration.
|
||||
if (modPlayer.rageModeActive)
|
||||
// If Rage Mode is currently active, you smoothly lose all rage over the duration.
|
||||
if (modPlayer.rageModeActive)
|
||||
rageDiff -= modPlayer.rageMax / modPlayer.RageDuration;
|
||||
|
||||
// If out of combat and NOT using Heart of Darkness or Shattered Community, Rage fades away.
|
||||
else if (!modPlayer.rageModeActive && rageFading)
|
||||
rageDiff -= modPlayer.rageMax / CalamityPlayer.RageFadeTime;
|
||||
|
||||
// Apply the rage change and cap rage in both directions.
|
||||
modPlayer.rage += rageDiff;
|
||||
if (modPlayer.rage < 0)
|
||||
modPlayer.rage = 0;
|
||||
// Apply the rage change and cap rage in both directions.
|
||||
modPlayer.rage += rageDiff;
|
||||
if (modPlayer.rage < 0)
|
||||
modPlayer.rage = 0;
|
||||
|
||||
if (modPlayer.rage >= modPlayer.rageMax)
|
||||
{
|
||||
// Rage IS NOT capped while active. It can go above 100%.
|
||||
if (modPlayer.rage >= modPlayer.rageMax)
|
||||
{
|
||||
// If Rage is not active, it is capped at 100%.
|
||||
if (!modPlayer.rageModeActive)
|
||||
modPlayer.rage = modPlayer.rageMax;
|
||||
modPlayer.rage = modPlayer.rageMax;
|
||||
|
||||
// Play a sound when the Rage Meter is full
|
||||
if (modPlayer.playFullRageSound)
|
||||
{
|
||||
modPlayer.playFullRageSound = false;
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
}
|
||||
else
|
||||
modPlayer.playFullRageSound = true;
|
||||
// If using the Shattered Community, Rage is capped at 200% while it's active.
|
||||
// This prevents infinitely stacking rage before a fight by standing on spikes/lava with a regen build or the Nurse handy.
|
||||
else if (modPlayer.shatteredCommunity && modPlayer.rage >= 2f * modPlayer.rageMax)
|
||||
modPlayer.rage = 2f * modPlayer.rageMax;
|
||||
|
||||
// This is how much Adrenaline will be changed by this frame.
|
||||
float adrenalineDiff = 0;
|
||||
bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>());
|
||||
bool wofAndNotHell = Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16);
|
||||
// Play a sound when the Rage Meter is full
|
||||
if (modPlayer.playFullRageSound)
|
||||
{
|
||||
modPlayer.playFullRageSound = false;
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
}
|
||||
else
|
||||
modPlayer.playFullRageSound = true;
|
||||
|
||||
// If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration.
|
||||
if (modPlayer.adrenalineModeActive)
|
||||
// This is how much Adrenaline will be changed by this frame.
|
||||
float adrenalineDiff = 0;
|
||||
bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>());
|
||||
bool wofAndNotHell = Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16);
|
||||
|
||||
// If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration.
|
||||
if (modPlayer.adrenalineModeActive)
|
||||
adrenalineDiff = -modPlayer.adrenalineMax / modPlayer.AdrenalineDuration;
|
||||
|
||||
else
|
||||
@@ -3049,33 +3054,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (modPlayer.badgeOfBraveryRare)
|
||||
{
|
||||
float maxDistance = 480f; // 30 tile distance
|
||||
float damageBoost = 0f;
|
||||
for (int l = 0; l < Main.maxNPCs; l++)
|
||||
{
|
||||
NPC nPC = Main.npc[l];
|
||||
|
||||
// Take the longer of the two directions for the NPC's hitbox to be generous.
|
||||
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth;
|
||||
|
||||
if (hitboxEdgeDist < 0)
|
||||
hitboxEdgeDist = 0;
|
||||
|
||||
if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance)
|
||||
{
|
||||
damageBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance));
|
||||
|
||||
if (damageBoost >= 0.3f)
|
||||
{
|
||||
damageBoost = 0.3f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
player.meleeDamage += damageBoost;
|
||||
}
|
||||
player.meleeDamage += modPlayer.warBannerBonus;
|
||||
|
||||
// The player's true max life value with Calamity adjustments
|
||||
modPlayer.actualMaxLife = player.statLifeMax2;
|
||||
@@ -3751,35 +3730,8 @@ namespace CalamityMod.CalPlayer
|
||||
((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) +
|
||||
(player.kbGlove ? 0.1 : 0) +
|
||||
(modPlayer.eGauntlet ? 0.1 : 0) +
|
||||
(modPlayer.yInsignia ? 0.1 : 0);
|
||||
if (modPlayer.badgeOfBraveryRare)
|
||||
{
|
||||
float maxDistance = 480f; // 30 tile distance
|
||||
float damageBoost = 0f;
|
||||
for (int l = 0; l < Main.maxNPCs; l++)
|
||||
{
|
||||
NPC nPC = Main.npc[l];
|
||||
|
||||
// Take the longer of the two directions for the NPC's hitbox to be generous.
|
||||
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth;
|
||||
|
||||
if (hitboxEdgeDist < 0)
|
||||
hitboxEdgeDist = 0;
|
||||
|
||||
if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance)
|
||||
{
|
||||
damageBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance));
|
||||
|
||||
if (damageBoost >= 0.3f)
|
||||
{
|
||||
damageBoost = 0.3f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
damageAdd += damageBoost;
|
||||
}
|
||||
(modPlayer.yInsignia ? 0.1 : 0) +
|
||||
(modPlayer.badgeOfBraveryRare ? modPlayer.warBannerBonus : 0);
|
||||
modPlayer.trueMeleeDamage += damageAdd;
|
||||
|
||||
// Amalgam boosts
|
||||
|
||||
@@ -410,14 +410,14 @@ namespace CalamityMod
|
||||
{ NPCID.Crab, 0.05f },
|
||||
{ NPCID.Crawdad, 0.2f },
|
||||
{ NPCID.Crawdad2, 0.2f },
|
||||
{ NPCID.CultistBoss, 0.1f },
|
||||
{ NPCID.CultistBoss, 0.15f },
|
||||
{ NPCID.DD2Betsy, 0.1f },
|
||||
{ NPCID.DD2OgreT2, 0.1f },
|
||||
{ NPCID.DD2OgreT3, 0.15f },
|
||||
{ NPCID.DeadlySphere, 0.4f },
|
||||
{ NPCID.DiabolistRed, 0.2f },
|
||||
{ NPCID.DiabolistWhite, 0.2f },
|
||||
{ NPCID.DukeFishron, 0.1f },
|
||||
{ NPCID.DukeFishron, 0.15f },
|
||||
{ NPCID.DungeonGuardian, 0.999999f },
|
||||
{ NPCID.DungeonSpirit, 0.2f },
|
||||
{ NPCID.ElfCopter, 0.15f },
|
||||
@@ -451,9 +451,9 @@ namespace CalamityMod
|
||||
{ NPCID.MartianTurret, 0.2f },
|
||||
{ NPCID.MartianWalker, 0.35f },
|
||||
{ NPCID.Mimic, 0.3f },
|
||||
{ NPCID.MoonLordCore, 0.05f },
|
||||
{ NPCID.MoonLordHand, 0.05f },
|
||||
{ NPCID.MoonLordHead, 0.05f },
|
||||
{ NPCID.MoonLordCore, 0.15f },
|
||||
{ NPCID.MoonLordHand, 0.15f },
|
||||
{ NPCID.MoonLordHead, 0.15f },
|
||||
{ NPCID.Mothron, 0.2f },
|
||||
{ NPCID.MothronEgg, 0.5f },
|
||||
{ NPCID.MourningWood, 0.1f },
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
DisplayName.SetDefault("Warbanner of the Sun");
|
||||
Tooltip.SetDefault("Increases melee damage, true melee damage and melee speed the closer you are to enemies\n" +
|
||||
"Max boost is 30% increased melee damage, true melee damage and melee speed");
|
||||
"Max boost is 20% increased melee damage, true melee damage and melee speed");
|
||||
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 5));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ namespace CalamityMod.Items.Accessories
|
||||
private static readonly Color rarityColorOne = new Color(128, 62, 128);
|
||||
private static readonly Color rarityColorTwo = new Color(245, 105, 245);
|
||||
|
||||
private bool everInInventory = false;
|
||||
|
||||
// Base level cost is 400,000 damage dealt while Rage is active.
|
||||
// Each successive level costs (400,000 * level) MORE damage, so the total required goes up quadratically.
|
||||
// Total required to reach level 60 is 732,000,000 damage dealt.
|
||||
@@ -61,7 +59,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public override ModItem Clone()
|
||||
{
|
||||
var clone = (ShatteredCommunity)base.Clone();
|
||||
clone.everInInventory = everInInventory;
|
||||
clone.level = level;
|
||||
clone.totalRageDamage = totalRageDamage;
|
||||
return clone;
|
||||
@@ -69,7 +66,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public override ModItem Clone(Item item)
|
||||
{
|
||||
var clone = (ShatteredCommunity)base.Clone();
|
||||
clone.everInInventory = everInInventory;
|
||||
clone.level = level;
|
||||
clone.totalRageDamage = totalRageDamage;
|
||||
return clone;
|
||||
@@ -99,8 +95,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().community;
|
||||
public override bool CanUseItem(Player player) => false;
|
||||
|
||||
public override void UpdateInventory(Player player) => everInInventory = true;
|
||||
|
||||
// Produces purple light while in the world.
|
||||
public override void PostUpdate()
|
||||
{
|
||||
@@ -164,16 +158,6 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
// Shattered Community hides its full tooltip when viewed via Recipe Browser or similar.
|
||||
// Instead, it notifies the player that it must be crafted with a full-power Community.
|
||||
// Once it has entered a player's inventory, it permanently behaves normally.
|
||||
if (!everInInventory)
|
||||
{
|
||||
tooltips.RemoveAll(line => line.Name != "Tooltip0" && line.Name != "Tooltip1" && line.Name != "Tooltip2" && line.Name.StartsWith("Tooltip"));
|
||||
tooltips.Find(line => line.Name == "Tooltip2").text = "Must be crafted with a fully powered Community";
|
||||
return;
|
||||
}
|
||||
|
||||
// Stat tooltips are added dynamically.
|
||||
StringBuilder sb = new StringBuilder(256);
|
||||
|
||||
@@ -211,7 +195,6 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
TagCompound tag = new TagCompound
|
||||
{
|
||||
{ "real", everInInventory },
|
||||
{ "level", level },
|
||||
{ "totalDamage", totalRageDamage }
|
||||
};
|
||||
@@ -220,21 +203,18 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void Load(TagCompound tag)
|
||||
{
|
||||
everInInventory = tag.GetBool("real");
|
||||
level = tag.GetInt("level");
|
||||
totalRageDamage = tag.GetLong("totalDamage");
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(everInInventory);
|
||||
writer.Write(level);
|
||||
writer.Write(totalRageDamage);
|
||||
}
|
||||
|
||||
public override void NetRecieve(BinaryReader reader)
|
||||
{
|
||||
everInInventory = reader.ReadBoolean();
|
||||
level = reader.ReadInt32();
|
||||
totalRageDamage = reader.ReadInt64();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
public class AshenHorns : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults() => DisplayName.SetDefault("Ashen Horns");
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 28;
|
||||
item.height = 20;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
item.vanity = true;
|
||||
}
|
||||
|
||||
public override void DrawHair(ref bool drawHair, ref bool drawAltHair)
|
||||
{
|
||||
drawHair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 323 B |
|
After Width: | Height: | Size: 726 B |
@@ -0,0 +1,19 @@
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Legs)]
|
||||
public class SCalBoots : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Boots");
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 28;
|
||||
item.height = 20;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
item.vanity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,21 @@
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
public class SCalMask : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Hood");
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 28;
|
||||
item.height = 20;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
item.vanity = true;
|
||||
}
|
||||
|
||||
public override bool DrawHead() => false;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 281 B |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,19 @@
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Body)]
|
||||
public class SCalRobes : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Robes");
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 28;
|
||||
item.height = 20;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
item.vanity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 710 B |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
@@ -506,7 +506,7 @@ namespace CalamityMod.Items
|
||||
#region SavingAndLoading
|
||||
public override bool NeedsSaving(Item item)
|
||||
{
|
||||
return true;
|
||||
return rogue || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0;
|
||||
}
|
||||
|
||||
public override TagCompound Save(Item item)
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
public class EnchantedMetal : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Enchanted Metal");
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 26;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 15, 0, 0);
|
||||
item.rare = ItemRarityID.Pink;
|
||||
item.maxStack = 99;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(item.type, 3);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(ItemID.MechanicalEye);
|
||||
recipe.AddRecipe();
|
||||
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(item.type, 3);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(ItemID.MechanicalSkull);
|
||||
recipe.AddRecipe();
|
||||
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(item.type, 3);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(ItemID.MechanicalWorm);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 332 B |
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.PermanentBoosters
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Infernal Blood");
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" +
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" +
|
||||
"Revengeance drop");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.PermanentBoosters
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Mushroom Plasma Root");
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" +
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" +
|
||||
"Revengeance drop");
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.PermanentBoosters
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Red Lightning Container");
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" +
|
||||
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" +
|
||||
"Revengeance drop");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas;
|
||||
|
||||
namespace CalamityMod.Items.TreasureBags
|
||||
{
|
||||
public class SCalBag : ModItem
|
||||
{
|
||||
public override int BossBagNPC => ModContent.NPCType<SCalBoss>();
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Treasure Coffer");
|
||||
Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.maxStack = 999;
|
||||
item.consumable = true;
|
||||
item.width = 24;
|
||||
item.height = 24;
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.expert = true;
|
||||
}
|
||||
|
||||
public override bool CanRightClick() => true;
|
||||
|
||||
public override void OpenBossBag(Player player)
|
||||
{
|
||||
player.TryGettingDevArmor();
|
||||
|
||||
// Weapons
|
||||
float w = DropHelper.BagWeaponDropRateFloat;
|
||||
DropHelper.DropEntireWeightedSet(player,
|
||||
DropHelper.WeightStack<Vehemenc>(w),
|
||||
DropHelper.WeightStack<Heresy>(w),
|
||||
DropHelper.WeightStack<Perdition>(w),
|
||||
DropHelper.WeightStack<Vigilance>(w),
|
||||
DropHelper.WeightStack<Sacrifice>(w),
|
||||
DropHelper.WeightStack<Violence>(w)
|
||||
);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<Calamity>());
|
||||
|
||||
// Vanity
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
DropHelper.DropItem(player, ModContent.ItemType<AshenHorns>());
|
||||
DropHelper.DropItem(player, ModContent.ItemType<SCalMask>());
|
||||
DropHelper.DropItem(player, ModContent.ItemType<SCalRobes>());
|
||||
DropHelper.DropItem(player, ModContent.ItemType<SCalBoots>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 605 B |
@@ -66,26 +66,24 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<AegisBeam>(), (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<AegisBeam>(), (int)(damage * 0.6), knockBack, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246, 0f, 0f, 0, new Color(255, Main.DiscoG, 53));
|
||||
}
|
||||
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246, 0f, 0f, 0, new Color(255, Main.DiscoG, 53));
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<AegisBlast>(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer);
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<AegisBlast>(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<AegisBlast>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer);
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<AegisBlast>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,12 +78,12 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<BrinyTyphoonBubble>(), (int)(item.damage * player.MeleeDamage() * 0.5f), knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<BrinyTyphoonBubble>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<BrinyTyphoonBubble>(), (int)(item.damage * player.MeleeDamage() * 0.5f), item.knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<BrinyTyphoonBubble>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,8 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
num80 = num72 / num80;
|
||||
}
|
||||
|
||||
int num112 = 3;
|
||||
for (int num113 = 0; num113 < num112; num113++)
|
||||
for (int num113 = 0; num113 < 2; num113++)
|
||||
{
|
||||
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
|
||||
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Tooltip.SetDefault("EViL! sMaSH eVIl! SmAsh...ER!\n" +
|
||||
"For every enemy you kill this hammer gains stat bonuses\n" +
|
||||
"These bonuses stack until a cap is reached\n" +
|
||||
"The bonuses will reset if you get hit or select a different item\n" +
|
||||
"The bonus stacks will reset if you select a different item\n" +
|
||||
"The bonus stacks will be reduced by 1 every time you get hit\n" +
|
||||
"Summons fossil spikes on enemy hits");
|
||||
}
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.width = 64;
|
||||
item.height = 66;
|
||||
item.scale = 2f;
|
||||
item.damage = 50;
|
||||
item.damage = 80;
|
||||
item.melee = true;
|
||||
item.useAnimation = item.useTime = 38;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
@@ -44,20 +45,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
OnHitEffect(target.Center, player, knockback);
|
||||
|
||||
if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10)
|
||||
player.Calamity().evilSmasherBoost += 1;
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
OnHitEffect(target.Center, player, item.knockBack);
|
||||
}
|
||||
|
||||
private void OnHitEffect(Vector2 targetPos, Player player, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType<FossilSpike>(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,20 +51,16 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
|
||||
for (int x = 0; x < 2; x++)
|
||||
Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
for (int x = 0; x < 2; x++)
|
||||
Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
|
||||
for (int x = 0; x < 2; x++)
|
||||
Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
for (int x = 0; x < 2; x++)
|
||||
Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType<ThornBase>(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,8 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
num80 = num72 / num80;
|
||||
}
|
||||
|
||||
int num107 = 4;
|
||||
for (int num108 = 0; num108 < num107; num108++)
|
||||
for (int num108 = 0; num108 < 3; num108++)
|
||||
{
|
||||
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
|
||||
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Perdition");
|
||||
Tooltip.SetDefault("Summons a beacon at the position of the mouse\n" +
|
||||
"When a target is manually selected via right click it releases torrents of souls from below onto the target\n" +
|
||||
"The beacon does not move");
|
||||
"When a target is manually selected via right click it releases torrents of souls from below onto the target");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -577,7 +577,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("SupremeCalamitas", out float order);
|
||||
int type = NPCType<SupremeCalamitas>();
|
||||
int summon = ItemType<EyeofExtinction>();
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Animus>(), ItemType<Azathoth>(), ItemType<Contagion>(), ItemType<CrystylCrusher>(), ItemType<Judgement>(), ItemType<DraconicDestruction>(), ItemType<Earth>(), ItemType<Endogenesis>(), ItemType<Fabstaff>(), ItemType<RoyalKnivesMelee>(), ItemType<NanoblackReaperRogue>(), ItemType<RedSun>(), ItemType<ScarletDevil>(), ItemType<SomaPrime>(), ItemType<BlushieStaff>(), ItemType<Svantechnical>(), ItemType<BensUmbrella>(), ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ItemType<Megafleet>(), ItemType<PrototypeAndromechaRing>(), ItemType<Vehemenc>(), ItemType<AngelicAlliance>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Vehemenc>(), ItemType<Heresy>(), ItemType<Perdition>(), ItemType<Vigilance>(), ItemType<Sacrifice>(), ItemType<Violence>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> collection = new List<int>() { ItemType<SupremeCalamitasTrophy>(), ItemType<KnowledgeCalamitas>(), ItemType<BrimstoneJewel>(), ItemType<Levi>() };
|
||||
string instructions = $"Use an [i:{summon}]";
|
||||
string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00));
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 900, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
|
||||
@@ -232,7 +232,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 300, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
|
||||
|
||||
if (puffedUp)
|
||||
{
|
||||
|
||||
@@ -544,8 +544,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 600, true);
|
||||
player.AddBuff(BuffID.Darkness, 600, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
|
||||
@@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 1200, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,12 +214,14 @@ namespace CalamityMod.NPCs.Abyss
|
||||
}
|
||||
|
||||
// Despawn if target is dead
|
||||
bool targetDead = false;
|
||||
if (player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (player.dead)
|
||||
{
|
||||
targetDead = true;
|
||||
npc.ai[3] = 0f;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[1] = 0f;
|
||||
@@ -397,7 +399,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
Vector2 lightningChargeVectorFlipped = lightningChargeVector * -1f;
|
||||
float lightningSpawnY = 540f;
|
||||
Vector2 lightningSpawnLocation = new Vector2(lightningChargeVector.X, -lightningSpawnY);
|
||||
int numLightningBolts = 10;
|
||||
int numLightningBolts = 8;
|
||||
float distanceBetweenBolts = lightningSpawnY * 2f / numLightningBolts;
|
||||
|
||||
// Velocity and turn speed values
|
||||
@@ -1087,16 +1089,21 @@ namespace CalamityMod.NPCs.Abyss
|
||||
// Lightning barrage
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[3] == 0f)
|
||||
{
|
||||
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < soundDistance)
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), Main.player[Main.myPlayer].Center);
|
||||
|
||||
npc.localAI[3] = 1f;
|
||||
int type = ProjectileID.CultistBossLightningOrbArc;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
for (int i = 0; i < numLightningBolts; i++)
|
||||
{
|
||||
lightningSpawnLocation.Y += distanceBetweenBolts * i;
|
||||
Vector2 projectileDestination = player.Center - lightningSpawnLocation;
|
||||
float ai = Main.rand.Next(100);
|
||||
int proj = Projectile.NewProjectile(lightningSpawnLocation, npc.velocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
lightningSpawnLocation.Y += distanceBetweenBolts;
|
||||
if (i == numLightningBolts / 2)
|
||||
lightningSpawnLocation.Y += distanceBetweenBolts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1303,16 +1310,19 @@ namespace CalamityMod.NPCs.Abyss
|
||||
}
|
||||
}
|
||||
|
||||
// Increase velocity if velocity is ever zero
|
||||
if (npc.velocity == Vector2.Zero)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity;
|
||||
|
||||
// Acceleration
|
||||
if (!((destination - npc.Center).Length() < turnDistance))
|
||||
if (!targetDead)
|
||||
{
|
||||
float targetAngle = npc.AngleTo(destination);
|
||||
float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed);
|
||||
npc.velocity = f.ToRotationVector2() * baseVelocity;
|
||||
// Increase velocity if velocity is ever zero
|
||||
if (npc.velocity == Vector2.Zero)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity;
|
||||
|
||||
// Acceleration
|
||||
if (!((destination - npc.Center).Length() < turnDistance))
|
||||
{
|
||||
float targetAngle = npc.AngleTo(destination);
|
||||
float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed);
|
||||
npc.velocity = f.ToRotationVector2() * baseVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
// Velocity upper limit
|
||||
|
||||
@@ -162,7 +162,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 120, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 120, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 300, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 60, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 60, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 180, true);
|
||||
player.AddBuff(BuffID.Venom, 90, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -348,7 +347,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 180, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -627,9 +627,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Darkness, 300, true);
|
||||
player.AddBuff(BuffID.Bleeding, 300, true);
|
||||
player.AddBuff(BuffID.Rabies, 300, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 120, true);
|
||||
player.AddBuff(BuffID.Poisoned, 120, true);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
|
||||
@@ -96,7 +96,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<CrushDepth>(), 120, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,6 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
|
||||
}
|
||||
}
|
||||
@@ -189,6 +189,6 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
|
||||
public override void NPCLoot() => DropHelper.DropItemChance(npc, ModContent.ItemType<LeadCore>(), 30);
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) => CalamityGlobalNPC.DrawGlowmask(npc, spriteBatch, ModContent.GetTexture(Texture + "Glow"), true);
|
||||
}
|
||||
|
||||
@@ -244,6 +244,6 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -193,7 +194,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Venom, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -139,8 +140,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 180, true);
|
||||
player.AddBuff(BuffID.Venom, 180, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -137,8 +138,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 180, true);
|
||||
player.AddBuff(BuffID.Venom, 180, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
@@ -260,8 +261,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 360, true);
|
||||
player.AddBuff(BuffID.Venom, 360, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 360, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -136,8 +137,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
player.AddBuff(BuffID.Venom, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,8 +300,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
player.AddBuff(BuffID.Venom, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -40,7 +39,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Venom, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
|
||||
@@ -627,7 +627,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180, true);
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300, true);
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,11 +108,6 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
|
||||
@@ -1218,7 +1218,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.Golem)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 3.5);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 4.0);
|
||||
npc.npcSlots = 64f;
|
||||
}
|
||||
else if (npc.type == NPCID.GolemHead)
|
||||
@@ -1232,7 +1232,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.Plantera)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 2.35);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 2.6);
|
||||
npc.npcSlots = 32f;
|
||||
}
|
||||
else if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye)
|
||||
|
||||
@@ -116,7 +116,6 @@ namespace CalamityMod.NPCs.Crags
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Weak, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
@@ -54,7 +54,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
return spawnInfo.player.Calamity().ZoneCalamity ? 0.08f : 0f;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
@@ -45,7 +45,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
return (spawnInfo.player.Calamity().ZoneCalamity || spawnInfo.player.ZoneDungeon) && Main.hardMode ? 0.04f : 0f;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
@@ -57,7 +57,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
namespace CalamityMod.NPCs.Crags
|
||||
{
|
||||
public class HeatSpirit : ModNPC
|
||||
{
|
||||
@@ -32,16 +32,12 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
bannerItem = ModContent.ItemType<HeatSpiritBanner>();
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.playerSafe || !Main.hardMode)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
return SpawnCondition.Underworld.Chance * 0.065f;
|
||||
}
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
return spawnInfo.player.Calamity().ZoneCalamity ? 0.125f : 0f;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
{
|
||||
@@ -73,7 +69,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.OnFire, 120, true);
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
@@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<EssenceofChaos>(), 0.25f);
|
||||
}
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 4, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,8 +1,7 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -257,7 +256,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -257,7 +256,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
@@ -280,7 +280,12 @@ namespace CalamityMod.NPCs.Crags
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<SlurperPole>(), (Main.hardMode ? 30 : 10));
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
|
||||
@@ -257,7 +257,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 240, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 300, true);
|
||||
player.AddBuff(BuffID.Frostburn, 240, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120, true);
|
||||
player.AddBuff(BuffID.Frostburn, 120, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 240, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 300, true);
|
||||
player.AddBuff(BuffID.Frostburn, 240, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -988,7 +988,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 420, true);
|
||||
player.AddBuff(BuffID.Frostburn, 300, true);
|
||||
/*if (CalamityWorld.death && !player.Calamity().lol)
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(player.name + "'s essence was consumed by the devourer."), 1000.0, 0, false);
|
||||
|
||||
@@ -393,7 +393,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180, true);
|
||||
player.AddBuff(BuffID.Frostburn, 180, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1366,7 +1366,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 420, true);
|
||||
player.AddBuff(BuffID.Frostburn, 300, true);
|
||||
/*if ((CalamityWorld.death || BossRushEvent.BossRushActive) && (npc.alpha <= 0 || postTeleportTimer > 0) && !player.Calamity().lol && preventBullshitHitsAtStartofFinalPhaseTimer <= 0)
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(player.name + "'s essence was consumed by the devourer."), 1000.0, 0, false);
|
||||
|
||||
@@ -247,7 +247,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 240, true);
|
||||
player.AddBuff(BuffID.Frostburn, 180, true);
|
||||
|
||||
if (player.Calamity().dogTextCooldown <= 0)
|
||||
{
|
||||
|
||||
@@ -217,7 +217,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 90, true);
|
||||
player.AddBuff(BuffID.Frostburn, 90, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,7 +319,6 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180, true);
|
||||
player.AddBuff(ModContent.BuffType<WhisperingDeath>(), 240, true);
|
||||
player.AddBuff(BuffID.Frostburn, 180, true);
|
||||
|
||||
if (player.Calamity().dogTextCooldown <= 0)
|
||||
{
|
||||
|
||||
@@ -139,8 +139,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.localAI[2] == 0f)
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootTrackingLasers)
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -191,6 +191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
}
|
||||
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center);
|
||||
for (int i = 0; i < numProjectiles; i++)
|
||||
{
|
||||
// Normal laser
|
||||
@@ -332,17 +333,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (vulnerable)
|
||||
{
|
||||
// Noise
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f;
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f;
|
||||
if (npc.localAI[0] == 0f)
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center);
|
||||
|
||||
// Steam
|
||||
float maxSteamTime = 180f;
|
||||
npc.localAI[0] += 1f;
|
||||
if (npc.localAI[0] < maxSteamTime)
|
||||
if (npc.localAI[0] < ThanatosHead.ventDuration)
|
||||
{
|
||||
SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2;
|
||||
SmokeDrawer.ParticleSpawnRate = 3;
|
||||
SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -423,9 +423,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
{
|
||||
// Swap between venting and non-venting frames
|
||||
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune;
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
npc.frameCounter += 1D;
|
||||
if (shootTrackingLasers)
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
|
||||
@@ -139,8 +139,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.localAI[2] == 0f)
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootTrackingLasers)
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -191,6 +191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
}
|
||||
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center);
|
||||
for (int i = 0; i < numProjectiles; i++)
|
||||
{
|
||||
// Normal laser
|
||||
@@ -332,17 +333,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (vulnerable)
|
||||
{
|
||||
// Noise
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f;
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f;
|
||||
if (npc.localAI[0] == 0f)
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center);
|
||||
|
||||
// Steam
|
||||
float maxSteamTime = 180f;
|
||||
npc.localAI[0] += 1f;
|
||||
if (npc.localAI[0] < maxSteamTime)
|
||||
if (npc.localAI[0] < ThanatosHead.ventDuration)
|
||||
{
|
||||
SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2;
|
||||
SmokeDrawer.ParticleSpawnRate = 3;
|
||||
SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -423,9 +423,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
{
|
||||
// Swap between venting and non-venting frames
|
||||
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune;
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
npc.frameCounter += 1D;
|
||||
if (shootTrackingLasers)
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Whether the head is venting heat or not, it is vulnerable to damage during venting
|
||||
private bool vulnerable = false;
|
||||
|
||||
// Max time in vent phase
|
||||
public const float ventDuration = 180f;
|
||||
|
||||
// Spawn rate for vent clouds
|
||||
public const int ventCloudSpawnRate = 5;
|
||||
|
||||
// Default life ratio for the other mechs
|
||||
private const float defaultLifeRatio = 5f;
|
||||
|
||||
@@ -268,20 +274,31 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
|
||||
// Despawn if target is dead
|
||||
if (player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
|
||||
npc.velocity.Y += 2f;
|
||||
if (npc.position.Y > Main.worldSurface * 16.0)
|
||||
npc.velocity.Y += 2f;
|
||||
|
||||
if (npc.position.Y > Main.rockLayer * 16.0)
|
||||
bool targetDead = false;
|
||||
if (player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (player.dead)
|
||||
{
|
||||
for (int a = 0; a < Main.maxNPCs; a++)
|
||||
targetDead = true;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
|
||||
npc.velocity.Y += 2f;
|
||||
if (npc.position.Y > Main.worldSurface * 16.0)
|
||||
npc.velocity.Y += 2f;
|
||||
|
||||
if (npc.position.Y > Main.rockLayer * 16.0)
|
||||
{
|
||||
if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType<ThanatosBody1>() || Main.npc[a].type == ModContent.NPCType<ThanatosBody2>() || Main.npc[a].type == ModContent.NPCType<ThanatosTail>())
|
||||
Main.npc[a].active = false;
|
||||
for (int a = 0; a < Main.maxNPCs; a++)
|
||||
{
|
||||
if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType<ThanatosBody1>() || Main.npc[a].type == ModContent.NPCType<ThanatosBody2>() || Main.npc[a].type == ModContent.NPCType<ThanatosTail>())
|
||||
Main.npc[a].active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,11 +332,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
|
||||
// Phase gate values
|
||||
float velocityAdjustTime = 20f;
|
||||
float speedUpTime = 480f;
|
||||
float slowDownTime = 120f;
|
||||
float speedUpTime = berserk ? 360f : 480f;
|
||||
float slowDownTime = berserk ? 90f : 120f;
|
||||
float chargePhaseGateValue = speedUpTime + slowDownTime;
|
||||
|
||||
float laserBarrageDuration = 420f;
|
||||
float laserBarrageDuration = berserk ? 330f : 420f;
|
||||
|
||||
// Adjust opacity
|
||||
bool invisiblePhase = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune;
|
||||
@@ -361,8 +378,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
float turnDegrees = baseVelocity * 0.11f;
|
||||
if (berserk)
|
||||
{
|
||||
baseVelocity *= 1.2f;
|
||||
turnDegrees *= 1.2f;
|
||||
baseVelocity *= 1.25f;
|
||||
turnDegrees *= 1.25f;
|
||||
}
|
||||
float turnSpeed = MathHelper.ToRadians(turnDegrees);
|
||||
float chargeVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar);
|
||||
@@ -380,7 +397,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
float deathrayVelocityScalarIncrement = 1f / deathrayDuration;
|
||||
|
||||
// Scalar to use during laser barrage, passive and immune phases
|
||||
float laserBarrageVelocityScalarIncrement = 0.01f;
|
||||
float laserBarrageVelocityScalarIncrement = berserk ? 0.02f : 0.01f;
|
||||
float laserBarrageVelocityScalarDecrement = 1f / velocityAdjustTime;
|
||||
|
||||
// Distance from target
|
||||
@@ -396,7 +413,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
{
|
||||
if (phase2 && !berserk)
|
||||
{
|
||||
// Reset everything
|
||||
SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
// Spawn code here
|
||||
@@ -410,14 +435,29 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Do not run this if any exo mech is dead
|
||||
if ((anyOtherExoMechPassive || lessThan70PercentLife) && !berserk && totalOtherExoMechLifeRatio < 5f)
|
||||
{
|
||||
// Tells Thanatos to return to the battle in passive state
|
||||
// Tells Thanatos to return to the battle in passive state and reset everything
|
||||
SecondaryAIState = (float)SecondaryPhase.Passive;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
// Go passive and immune if one of the other mechs is berserk
|
||||
// This is only called if two exo mechs are alive
|
||||
if (otherMechIsBerserk)
|
||||
{
|
||||
// Reset everything
|
||||
SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -430,13 +470,28 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
|
||||
// Enter passive and invincible phase if one of the other exo mechs is berserk
|
||||
if (otherMechIsBerserk)
|
||||
{
|
||||
// Reset everything
|
||||
SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
// If Thanatos is the first mech to go berserk
|
||||
if (berserk)
|
||||
{
|
||||
// Reset
|
||||
// Reset everything
|
||||
AIState = (float)Phase.Charge;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
|
||||
// Never be passive if berserk
|
||||
SecondaryAIState = (float)SecondaryPhase.Nothing;
|
||||
@@ -453,15 +508,27 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Enter the fight again if any of the other exo mechs is below 70% and the other mechs aren't berserk
|
||||
if ((exoPrimeLifeRatio < 0.7f || exoSpazLifeRatio < 0.7f || exoRetLifeRatio < 0.7f) && !otherMechIsBerserk)
|
||||
{
|
||||
// Tells Thanatos to return to the battle in passive state
|
||||
// Tells Thanatos to return to the battle in passive state and reset everything
|
||||
// Return to normal phases if one or more mechs have been downed
|
||||
SecondaryAIState = totalOtherExoMechLifeRatio > 5f ? (float)SecondaryPhase.Nothing : (float)SecondaryPhase.Passive;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
if (berserk)
|
||||
{
|
||||
// Reset
|
||||
// Reset everything
|
||||
AIState = (float)Phase.Charge;
|
||||
npc.localAI[0] = 0f;
|
||||
npc.localAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
chargeVelocityScalar = 0f;
|
||||
npc.TargetClosest();
|
||||
|
||||
// Never be passive if berserk
|
||||
SecondaryAIState = (float)SecondaryPhase.Nothing;
|
||||
@@ -547,7 +614,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
if (calamityGlobalNPC.newAI[3] >= velocityAdjustTime)
|
||||
{
|
||||
npc.localAI[0] = /*berserk ? 1f : 0f*/ 1f;
|
||||
npc.localAI[0] = (berserk || otherExoMechsAlive == 0) ? 1f : 0f;
|
||||
AIState = (float)Phase.Charge;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
@@ -567,7 +634,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
vulnerable = true;
|
||||
|
||||
// If close enough to the target, prepare to fire deathray
|
||||
bool readyToFireDeathray = distanceFromTarget < 800f;
|
||||
float slowDownDistance = 800f;
|
||||
bool readyToFireDeathray = distanceFromTarget < slowDownDistance;
|
||||
if (readyToFireDeathray)
|
||||
npc.localAI[2] = 1f;
|
||||
|
||||
@@ -599,8 +667,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Gradually turn and move slower if within 50 tiles of the target
|
||||
if (npc.localAI[2] == 1f)
|
||||
{
|
||||
baseVelocity *= distanceFromTarget / 800f;
|
||||
turnSpeed *= distanceFromTarget / 800f;
|
||||
// Exponentially scale down velocity if close to the target
|
||||
float velocityScale = distanceFromTarget / slowDownDistance;
|
||||
if (velocityScale < 1f)
|
||||
velocityScale *= velocityScale;
|
||||
|
||||
baseVelocity *= velocityScale;
|
||||
turnSpeed *= velocityScale;
|
||||
|
||||
if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration)
|
||||
{
|
||||
@@ -638,7 +711,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
{
|
||||
int type = ModContent.ProjectileType<ExoDestroyerBeamStart>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI);
|
||||
int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, npc.whoAmI);
|
||||
if (Main.projectile.IndexInRange(laser))
|
||||
Main.projectile[laser].ai[0] = npc.whoAmI;
|
||||
}
|
||||
@@ -680,12 +753,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center);
|
||||
|
||||
// Steam
|
||||
float maxSteamTime = 180f;
|
||||
npc.localAI[1] += 1f;
|
||||
if (npc.localAI[1] < maxSteamTime)
|
||||
if (npc.localAI[1] < ventDuration)
|
||||
{
|
||||
SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2;
|
||||
SmokeDrawer.ParticleSpawnRate = 3;
|
||||
SmokeDrawer.ParticleSpawnRate = ventCloudSpawnRate;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -693,16 +765,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
|
||||
SmokeDrawer.Update();
|
||||
|
||||
// Increase velocity if velocity is ever zero
|
||||
if (npc.velocity == Vector2.Zero)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity;
|
||||
|
||||
// Acceleration
|
||||
if (!((destination - npc.Center).Length() < turnDistance))
|
||||
if (!targetDead)
|
||||
{
|
||||
float targetAngle = npc.AngleTo(destination);
|
||||
float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed);
|
||||
npc.velocity = f.ToRotationVector2() * baseVelocity;
|
||||
// Increase velocity if velocity is ever zero
|
||||
if (npc.velocity == Vector2.Zero)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity;
|
||||
|
||||
// Acceleration
|
||||
if (!((destination - npc.Center).Length() < turnDistance))
|
||||
{
|
||||
float targetAngle = npc.AngleTo(destination);
|
||||
float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed);
|
||||
npc.velocity = f.ToRotationVector2() * baseVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
// Velocity upper limit
|
||||
|
||||
@@ -138,8 +138,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.localAI[2] == 0f)
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootTrackingLasers)
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -190,6 +190,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
}
|
||||
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center);
|
||||
for (int i = 0; i < numProjectiles; i++)
|
||||
{
|
||||
// Normal laser
|
||||
@@ -331,17 +332,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (vulnerable)
|
||||
{
|
||||
// Noise
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f;
|
||||
float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f;
|
||||
if (npc.localAI[0] == 0f)
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center);
|
||||
|
||||
// Steam
|
||||
float maxSteamTime = 180f;
|
||||
npc.localAI[0] += 1f;
|
||||
if (npc.localAI[0] < maxSteamTime)
|
||||
if (npc.localAI[0] < ThanatosHead.ventDuration)
|
||||
{
|
||||
SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2;
|
||||
SmokeDrawer.ParticleSpawnRate = 3;
|
||||
SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -422,9 +422,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
{
|
||||
// Swap between venting and non-venting frames
|
||||
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
|
||||
bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune;
|
||||
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
|
||||
npc.frameCounter += 1D;
|
||||
if (shootTrackingLasers)
|
||||
if (shootLasers && !invisiblePhase)
|
||||
{
|
||||
if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
|
||||
@@ -613,8 +613,7 @@ namespace CalamityMod.NPCs.GreatSandShark
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Rabies, 240, true);
|
||||
player.AddBuff(BuffID.Bleeding, 240, true);
|
||||
player.AddBuff(BuffID.Bleeding, 300, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Wet, 120, true);
|
||||
player.AddBuff(BuffID.Bleeding, 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -769,7 +769,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Wet, 240, true);
|
||||
target.AddBuff(BuffID.Bleeding, 240, true);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Wet, 60, true);
|
||||
player.AddBuff(BuffID.Bleeding, 60, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -781,11 +781,6 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
Leviathan.DropSirenLeviLoot(npc);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Wet, 120, true);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Bleeding, 180, true);
|
||||
player.AddBuff(BuffID.Frostburn, 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -141,12 +141,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Chilled, 180, true);
|
||||
player.AddBuff(BuffID.Electrified, 120, true);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -386,12 +386,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Chilled, 240, true);
|
||||
player.AddBuff(BuffID.Electrified, 180, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 3; k++)
|
||||
|
||||
@@ -99,12 +99,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Chilled, 120, true);
|
||||
player.AddBuff(BuffID.Electrified, 90, true);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||