1 - Iron Heart adjustments.
2 - Astral enemies no longer spawn if an event is going on. 3 - Butterfly nerf.
This commit is contained in:
1 parent
0317ddc49a
commit
21bdfe65d0
23 files changed
+71
-95
No files matched your search
+26
-10
@@ -4008,7 +4008,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
DeathPacket(false);
|
||||
}
|
||||
if (CalamityWorld.ironHeart && areThereAnyDamnBosses)
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
KillPlayer();
|
||||
return false;
|
||||
@@ -4047,6 +4047,14 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Get Heal Life
|
||||
public override void GetHealLife(Item item, bool quickHeal, ref int healValue)
|
||||
{
|
||||
if (CalamityWorld.ironHeart)
|
||||
healValue = 0;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Get Weapon Damage And KB
|
||||
public override void ModifyWeaponDamage(Item item, ref float add, ref float mult, ref float flat)
|
||||
{
|
||||
@@ -6940,7 +6948,6 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Frame Effects
|
||||
|
||||
public override void FrameEffects()
|
||||
{
|
||||
if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot ||
|
||||
@@ -7154,6 +7161,20 @@ namespace CalamityMod.CalPlayer
|
||||
damage = (int)newDamage;
|
||||
}
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
int damageMin = player.statLifeMax2 / 4;
|
||||
playSound = false;
|
||||
hurtSoundTimer = 20;
|
||||
if (damage < damageMin)
|
||||
{
|
||||
damage = damageMin;
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/IronHeartHurt"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
else
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/IronHeartBigHurt"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
|
||||
#region MultiplicativeReductions
|
||||
if (trinketOfChiBuff)
|
||||
{
|
||||
@@ -7870,7 +7891,7 @@ namespace CalamityMod.CalPlayer
|
||||
player.lastDeathPostion = player.Center;
|
||||
player.lastDeathTime = DateTime.Now;
|
||||
player.showLastDeath = true;
|
||||
bool specialDeath = CalamityWorld.ironHeart && areThereAnyDamnBosses;
|
||||
bool specialDeath = CalamityWorld.ironHeart;
|
||||
int coinsOwned = (int)Utils.CoinsCount(out bool flag, player.inventory, new int[0]);
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
@@ -7884,13 +7905,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.trashItem.SetDefaults(0, false);
|
||||
if (specialDeath)
|
||||
{
|
||||
player.difficulty = 2;
|
||||
player.DropItems();
|
||||
player.KillMeForGood();
|
||||
}
|
||||
else if (player.difficulty == 0)
|
||||
if (player.difficulty == 0)
|
||||
{
|
||||
for (int i = 0; i < 59; i++)
|
||||
{
|
||||
@@ -10381,6 +10396,7 @@ namespace CalamityMod.CalPlayer
|
||||
chatText = "Now is not the time!";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace CalamityMod.CalPlayer
|
||||
player.lifeRegen /= 2;
|
||||
}
|
||||
|
||||
if (modPlayer.omegaBlueChestplate || modPlayer.godSlayerCooldown || player.ownedProjectileCounts[ModContent.ProjectileType<BloodBoilerFire>()] > 0)
|
||||
if (CalamityWorld.ironHeart || modPlayer.omegaBlueChestplate || modPlayer.godSlayerCooldown || player.ownedProjectileCounts[ModContent.ProjectileType<BloodBoilerFire>()] > 0)
|
||||
{
|
||||
if (player.lifeRegen > 0)
|
||||
player.lifeRegen = 0;
|
||||
|
||||
@@ -2,6 +2,7 @@ using CalamityMod.NPCs.SlimeGod;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
@@ -13,10 +14,10 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Iron Heart");
|
||||
Tooltip.SetDefault("Makes dying while a boss is alive permanently kill you.\n" +
|
||||
Tooltip.SetDefault("Healing with potions and all life regen is disabled.\n" +
|
||||
"Enemy damage scales with your max health.\n" +
|
||||
"Can be toggled on and off.\n" +
|
||||
"Using this while a boss is alive will permanently kill you.\n" +
|
||||
"Cannot be activated if any boss has been killed.");
|
||||
"Using this while a boss is alive will instantly kill you and despawn the boss.");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -32,24 +33,19 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
item.consumable = false;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return !CalamityWorld.downedBossAny;
|
||||
}
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
{
|
||||
for (int doom = 0; doom < 200; doom++)
|
||||
{
|
||||
if ((Main.npc[doom].active && (Main.npc[doom].boss || Main.npc[doom].type == NPCID.EaterofWorldsHead || Main.npc[doom].type == NPCID.EaterofWorldsTail || Main.npc[doom].type == ModContent.NPCType<SlimeGodRun>() ||
|
||||
Main.npc[doom].type == ModContent.NPCType<SlimeGodRunSplit>() || Main.npc[doom].type == ModContent.NPCType<SlimeGod>() || Main.npc[doom].type == ModContent.NPCType<SlimeGodSplit>())) || CalamityWorld.DoGSecondStageCountdown > 0)
|
||||
{
|
||||
player.KillMeForGood();
|
||||
Main.npc[doom].active = Main.npc[doom].friendly;
|
||||
Main.npc[doom].netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (!CalamityWorld.ironHeart)
|
||||
for (int doom = 0; doom < Main.npc.Length; doom++)
|
||||
{
|
||||
if ((Main.npc[doom].active && (Main.npc[doom].boss || Main.npc[doom].type == NPCID.EaterofWorldsHead || Main.npc[doom].type == NPCID.EaterofWorldsTail || Main.npc[doom].type == ModContent.NPCType<SlimeGodRun>() ||
|
||||
Main.npc[doom].type == ModContent.NPCType<SlimeGodRunSplit>() || Main.npc[doom].type == ModContent.NPCType<SlimeGod>() || Main.npc[doom].type == ModContent.NPCType<SlimeGodSplit>())) || CalamityWorld.DoGSecondStageCountdown > 0)
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(player.name + " tried to change the rules."), 1000.0, 0, false);
|
||||
Main.npc[doom].active = Main.npc[doom].friendly;
|
||||
Main.npc[doom].netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (!CalamityWorld.ironHeart)
|
||||
{
|
||||
CalamityWorld.ironHeart = true;
|
||||
string key = "Mods.CalamityMod.IronHeartText";
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -610,7 +610,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -147,8 +147,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
+1
-7
@@ -121,13 +121,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
//only 1 hive possible.
|
||||
bool anyHives = NPC.CountNPCS(npc.type) > 0;
|
||||
if (anyHives)
|
||||
return 0f;
|
||||
|
||||
Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player) || NPC.AnyNPCs(npc.type))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
+7
-20
@@ -64,39 +64,31 @@ namespace CalamityMod.NPCs.Astral
|
||||
{
|
||||
npc.velocity.X -= acceleration;
|
||||
if (npc.velocity.X > 0)
|
||||
{
|
||||
npc.velocity.X -= acceleration;
|
||||
}
|
||||
if (npc.velocity.X < -maxSpeed)
|
||||
{
|
||||
npc.velocity.X = -maxSpeed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.velocity.X += acceleration;
|
||||
if (npc.velocity.X < 0)
|
||||
{
|
||||
npc.velocity.X += acceleration;
|
||||
}
|
||||
if (npc.velocity.X > maxSpeed)
|
||||
{
|
||||
npc.velocity.X = maxSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
//if need to jump
|
||||
if (npc.velocity.Y == 0f && (HoleBelow() || (npc.collideX && npc.position.X == npc.oldPosition.X)))
|
||||
{
|
||||
npc.velocity.Y = (CalamityWorld.death ? -7f : -5f);
|
||||
npc.velocity.Y = CalamityWorld.death ? -7f : -5f;
|
||||
}
|
||||
|
||||
//check if we can shoot at target.
|
||||
Vector2 vector = npc.Center - target.Center;
|
||||
if (Math.Abs(vector.Y) < 64f && Math.Abs(vector.X) < 540f && Collision.CanHit(npc.position, npc.width, npc.height, target.position, target.width, target.height))
|
||||
if (vector.Length() < 480f && Collision.CanHit(npc.position, npc.width, npc.height, target.position, target.width, target.height))
|
||||
{
|
||||
npc.ai[1]++;
|
||||
if (npc.ai[1] > (CalamityWorld.death ? 60f : 120f))
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= (CalamityWorld.death ? 60f : 120f))
|
||||
{
|
||||
//fire projectile
|
||||
npc.ai[0] = 1f;
|
||||
@@ -106,24 +98,19 @@ namespace CalamityMod.NPCs.Astral
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[1] -= 0.5f;
|
||||
}
|
||||
|
||||
if (npc.justHit)
|
||||
{
|
||||
npc.ai[1] -= 60f;
|
||||
}
|
||||
|
||||
|
||||
if (npc.ai[1] < 0f)
|
||||
npc.ai[1] = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[2]++;
|
||||
npc.ai[2] += 1f;
|
||||
npc.velocity.X *= 0.95f;
|
||||
if (npc.ai[2] == 25f)
|
||||
if (npc.ai[2] >= 20f)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item71, npc.position);
|
||||
Vector2 vector = Main.player[npc.target].Center - npc.Center;
|
||||
@@ -230,7 +217,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
+1
-1
@@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -114,8 +114,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.PillarZone())
|
||||
if (CalamityGlobalNPC.AnyEvents(spawnInfo.player))
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -90,9 +90,6 @@ namespace CalamityMod.NPCs
|
||||
public Dictionary<int, float> flatDRReductions = new Dictionary<int, float>();
|
||||
public Dictionary<int, float> multDRReductions = new Dictionary<int, float>();
|
||||
|
||||
// Iron Heart (currently unimplemented)
|
||||
// private int ironHeartDamage = 0;
|
||||
|
||||
// Max velocity used in contact damage scaling
|
||||
public float maxVelocity = 0f;
|
||||
|
||||
@@ -778,11 +775,6 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
OtherStatChanges(npc);
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
IronHeartChanges(npc);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1225,15 +1217,6 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
#endregion
|
||||
|
||||
// TODO -- Change Iron Heart damage in here for Iron Heart mode
|
||||
#region Iron Heart Changes
|
||||
private void IronHeartChanges(NPC npc)
|
||||
{
|
||||
// Iron Heart damage variable will scale with npc.damage
|
||||
// ironHeartDamage = 0;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Scale Expert Multiplayer Stats
|
||||
public override void ScaleExpertStats(NPC npc, int numPlayers, float bossLifeScale)
|
||||
{
|
||||
|
||||
@@ -135,10 +135,10 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
if (player.dead || CalamityGlobalNPC.DoGHead < 0 || !Main.npc[CalamityGlobalNPC.DoGHead].active)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
npc.velocity.Y = npc.velocity.Y - 3f;
|
||||
npc.velocity.Y -= 3f;
|
||||
if ((double)npc.position.Y < Main.topWorld + 16f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - 3f;
|
||||
npc.velocity.Y -= 3f;
|
||||
}
|
||||
if ((double)npc.position.Y < Main.topWorld + 16f)
|
||||
{
|
||||
|
||||
@@ -63,12 +63,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.localAI[0]);
|
||||
}
|
||||
writer.Write(npc.alpha);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.localAI[0] = reader.ReadSingle();
|
||||
}
|
||||
npc.alpha = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.immune[projectile.owner] = 6;
|
||||
target.immune[projectile.owner] = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC npc = Main.npc[i];
|
||||
if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active)
|
||||
if ((npc.CanBeChasedBy(projectile, false) || (npc.type == NPCID.DukeFishron && (!npc.dontTakeDamage || npc.ai[0] > 9f))) && npc.active)
|
||||
{
|
||||
float extraDistance = (npc.width / 2) + (npc.height / 2);
|
||||
|
||||
|
||||
Reference in new issue
Block a user