Merge branch 'master' into fixes-and-balancing

This commit is contained in:
DominicKarma42 committed 2020-06-23 20:55:12 -05:00
commit 4cbcfaeb61
34 files changed
+237 -192

No files matched your search

+27 -11
View File
@@ -4015,7 +4015,7 @@ namespace CalamityMod.CalPlayer
{
DeathPacket(false);
}
if (CalamityWorld.ironHeart && areThereAnyDamnBosses)
if (CalamityWorld.ironHeart)
{
KillPlayer();
return false;
@@ -4054,6 +4054,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)
{
@@ -5811,7 +5819,7 @@ namespace CalamityMod.CalPlayer
}
else
{
float amount = npc.velocity.Length() / npc.Calamity().maxVelocity;
float amount = npc.velocity.Length() / (npc.Calamity().maxVelocity * 0.5f);
if (amount > 1f)
amount = 1f;
@@ -6947,7 +6955,6 @@ namespace CalamityMod.CalPlayer
#endregion
#region Frame Effects
public override void FrameEffects()
{
if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot ||
@@ -7161,6 +7168,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)
{
@@ -7877,7 +7898,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)
{
@@ -7891,13 +7912,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++)
{
@@ -10388,6 +10403,7 @@ namespace CalamityMod.CalPlayer
chatText = "Now is not the time!";
return false;
}
return true;
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -132,7 +132,7 @@ namespace CalamityMod
// Boss velocity scaling data structure
public static SortedDictionary<int, float> bossVelocityDamageScaleValues;
public const float velocityScaleMin = 0.66f;
public const float velocityScaleMin = 0.75f;
public const float bitingEnemeyVelocityScale = 0.9f;
// Lists
+15 -19
View File
@@ -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";
+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee
target.AddBuff(BuffID.Ichor, 120);
if (target.damage > 0 && crit && !CalamityPlayer.areThereAnyDamnBosses)
{
target.damage = target.defDamage - 10;
target.damage = target.defDamage - 5;
if (target.damage < 1)
target.damage = 1;
}
+2 -2
View File
@@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee
item.width = 26;
item.damage = 120;
item.melee = true;
item.useAnimation = 6;
item.useAnimation = 8;
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTime = 6;
item.useTime = 8;
item.useTurn = true;
item.knockBack = 7f;
item.UseSound = SoundID.Item1;
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
+1 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+18
View File
@@ -2872,7 +2872,11 @@ namespace CalamityMod.NPCs
{
var netMessage = mod.GetPacket();
netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray);
netMessage.Write((byte)npc2);
netMessage.Write(Main.npc[npc2].Calamity().newAI[0]);
netMessage.Write(Main.npc[npc2].Calamity().newAI[1]);
netMessage.Write(Main.npc[npc2].Calamity().newAI[2]);
netMessage.Write(Main.npc[npc2].Calamity().newAI[3]);
netMessage.Send();
}
@@ -2886,7 +2890,10 @@ namespace CalamityMod.NPCs
{
var netMessage = mod.GetPacket();
netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray);
netMessage.Write((byte)npc3);
netMessage.Write(Main.npc[npc3].Calamity().newAI[0]);
netMessage.Write(Main.npc[npc3].Calamity().newAI[1]);
netMessage.Write(Main.npc[npc3].Calamity().newAI[2]);
netMessage.Write(Main.npc[npc3].Calamity().newAI[3]);
netMessage.Send();
}
@@ -2993,6 +3000,17 @@ namespace CalamityMod.NPCs
Main.npc[lol].realLife = npc.whoAmI;
Main.npc[lol].Calamity().newAI[0] = calamityGlobalNPC.newAI[0];
Main.npc[lol].Calamity().newAI[3] = calamityGlobalNPC.newAI[3];
if (Main.netMode == NetmodeID.Server)
{
var netMessage = mod.GetPacket();
netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray);
netMessage.Write((byte)lol);
netMessage.Write(Main.npc[lol].Calamity().newAI[0]);
netMessage.Write(Main.npc[lol].Calamity().newAI[1]);
netMessage.Write(Main.npc[lol].Calamity().newAI[2]);
netMessage.Write(Main.npc[lol].Calamity().newAI[3]);
netMessage.Send();
}
Main.npc[lol].ai[2] = npc.whoAmI;
Main.npc[lol].ai[1] = Previous;
Main.npc[Previous].ai[0] = lol;
+6 -4
View File
@@ -4490,11 +4490,13 @@ namespace CalamityMod.NPCs
if (npc.type == NPCID.TheDestroyerBody && Vector2.Distance(player.Center, npc.Center) > 80f && !flyAtTarget)
{
// Laser rate of fire
int shootTime = 2 + (int)Math.Ceiling(((enraged || configBossRushBoost) ? 5D : 2D) * (1f - lifeRatio));
int shootTime = 4 + (death ? 2 : (int)Math.Ceiling(2f * (1f - lifeRatio)));
if (CalamityWorld.bossRushActive)
shootTime += 1;
if (enraged || configBossRushBoost)
shootTime += 2;
calamityGlobalNPC.newAI[0] += Main.rand.Next(shootTime);
calamityGlobalNPC.newAI[0] += Main.rand.Next(shootTime);
int randomCount = death ? Main.rand.Next(1470, 27300) : Main.rand.Next(1330, 24700);
if (calamityGlobalNPC.newAI[0] >= randomCount)
@@ -4696,7 +4698,7 @@ namespace CalamityMod.NPCs
if (flyAtTarget)
{
float speedMultiplier = phase5 ? 1.5f : phase4 ? 1.3f : 1.2f;
float speedMultiplier = phase5 ? 2f : phase4 ? 1.7f : 1.5f;
speed *= speedMultiplier;
}
@@ -12714,7 +12716,7 @@ namespace CalamityMod.NPCs
if (flag86 && WorldGen.SolidTile(point5.X, point5.Y))
flag86 = false;
float num1163 = (float)Main.rand.Next(6, 19);
float num1163 = Main.rand.Next(6, 19);
float num1164 = MathHelper.TwoPi / num1163;
float num1165 = MathHelper.TwoPi * Main.rand.NextFloat();
float scaleFactor8 = 1f + Main.rand.NextFloat() * 2f;
+4 -23
View File
@@ -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)
{
@@ -1417,14 +1400,12 @@ namespace CalamityMod.NPCs
public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
{
// Damage reduction on spawn
if (CalamityWorld.revenge || CalamityWorld.bossRushActive)
bool destroyerResist = DestroyerIDs.Contains(npc.type) && (CalamityWorld.revenge || CalamityWorld.bossRushActive);
if (destroyerResist || AstrumDeusIDs.Contains(npc.type))
{
if (DestroyerIDs.Contains(npc.type) || AstrumDeusIDs.Contains(npc.type))
if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type)))
{
if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type)))
{
damage *= 0.01;
}
damage *= 0.01;
}
}
+2 -2
View File
@@ -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)
{
+11 -12
View File
@@ -129,9 +129,9 @@ namespace CalamityMod.NPCs.DevourerofGods
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool speedBoost = lifeRatio < 0.6 || (death && lifeRatio < 0.9);
bool speedBoost2 = lifeRatio < 0.2;
bool breathFireMore = lifeRatio < 0.15 || death;
bool speedBoost = lifeRatio < 0.75f || (death && lifeRatio < 0.9f);
bool speedBoost2 = lifeRatio < 0.3f;
bool breathFireMore = lifeRatio < 0.15f || death;
// Light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f);
@@ -306,9 +306,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
calamityGlobalNPC.newAI[1] += 1f;
float speed = 10.5f;
float spawnOffsetX = 1900f;
float spawnOffsetY = 1000f;
float speed = 12f;
float spawnOffset = 1500f;
float divisor = 120f;
if (calamityGlobalNPC.newAI[1] % divisor == 0f)
@@ -320,8 +319,8 @@ namespace CalamityMod.NPCs.DevourerofGods
// Side walls
for (int x = 0; x < totalShots; x++)
{
Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
shotSpacing[0] -= spacingVar;
}
@@ -329,8 +328,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
for (int x = 0; x < 10; x++)
{
Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + shotSpacing[3], -speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + shotSpacing[3], speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[3], -speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[3], speed, 0f, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
shotSpacing[3] -= Main.rand.NextBool(2) ? 180 : 200;
}
shotSpacing[3] = 1050;
@@ -340,7 +339,7 @@ namespace CalamityMod.NPCs.DevourerofGods
// Lower wall
for (int x = 0; x < totalShots; x++)
{
Projectile.NewProjectile(player.position.X + shotSpacing[1], player.position.Y + spawnOffsetY, 0f, -speed, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + shotSpacing[1], player.position.Y + spawnOffset, 0f, -speed, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
shotSpacing[1] -= spacingVar;
}
shotSpacing[1] = 1050;
@@ -348,7 +347,7 @@ namespace CalamityMod.NPCs.DevourerofGods
// Upper wall
for (int x = 0; x < totalShots; x++)
{
Projectile.NewProjectile(player.position.X + shotSpacing[2], player.position.Y - spawnOffsetY, 0f, speed, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + shotSpacing[2], player.position.Y - spawnOffset, 0f, speed, ModContent.ProjectileType<DoGDeath>(), projectileDamage, 0f, Main.myPlayer, 0f, 0f);
shotSpacing[2] -= spacingVar;
}
shotSpacing[2] = 1050;
+1 -1
View File
@@ -577,7 +577,7 @@ namespace CalamityMod.NPCs.Ravager
}
}
float maxOffset = death ? 160f : 160f * (1f - lifeRatio);
float maxOffset = 160f + (death ? 160f : 160f * (1f - lifeRatio));
float offset = npc.ai[0] == 2f ? maxOffset * npc.Calamity().newAI[2] : 0f;
// Set offset to 0 if the target stops moving
+60 -50
View File
@@ -28,6 +28,7 @@ namespace CalamityMod.NPCs.Signus
npc.knockBackResist = 0f;
npc.noGravity = true;
npc.noTileCollide = true;
npc.dontTakeDamage = true;
npc.HitSound = SoundID.NPCHit53;
npc.DeathSound = SoundID.NPCDeath44;
}
@@ -51,50 +52,58 @@ namespace CalamityMod.NPCs.Signus
return;
}
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.7f, 0.2f, 1.1f);
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.7f, 0.2f, 1.1f);
npc.rotation = npc.velocity.X * 0.04f;
if (npc.ai[1] == 0f)
{
npc.scale -= 0.02f;
npc.alpha += 30;
if (npc.alpha >= 250)
{
npc.alpha = 255;
npc.ai[1] = 1f;
}
}
else if (npc.ai[1] == 1f)
{
npc.scale += 0.02f;
npc.alpha -= 30;
if (npc.alpha <= 0)
{
npc.alpha = 0;
npc.ai[1] = 0f;
}
}
npc.TargetClosest(true);
Player player = Main.player[npc.target];
Vector2 vector = player.Center - npc.Center;
if (vector.Length() < 90f || npc.ai[3] >= 300f)
Vector2 vector = player.Center - npc.Center;
npc.ai[2] = vector.Length();
npc.ai[3] += 1f;
if (npc.ai[2] < 90f || npc.ai[3] >= 300f || npc.Calamity().newAI[0] > 0f)
{
npc.dontTakeDamage = false;
CheckDead();
npc.life = 0;
return;
npc.Calamity().newAI[0] += 1f;
npc.velocity *= 0.98f;
npc.dontTakeDamage = false;
npc.scale = MathHelper.Lerp(1f, 3f, npc.Calamity().newAI[0] / 85f);
if (npc.Calamity().newAI[0] >= 85f)
{
CheckDead();
npc.life = 0;
}
return;
}
npc.ai[3] += 1f;
npc.dontTakeDamage = npc.ai[3] >= 240f ? false : true;
if (npc.ai[3] >= 180f)
{
npc.velocity *= 0.985f;
return;
}
float num1372 = 14f;
Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f);
float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X;
if (npc.ai[1] == 0f)
{
npc.scale -= 0.02f;
npc.alpha += 30;
if (npc.alpha >= 250)
{
npc.alpha = 255;
npc.ai[1] = 1f;
}
}
else if (npc.ai[1] == 1f)
{
npc.scale += 0.02f;
npc.alpha -= 30;
if (npc.alpha <= 0)
{
npc.alpha = 0;
npc.ai[1] = 0f;
}
}
float num1372 = 14f;
Vector2 vector167 = new Vector2(npc.Center.X + (npc.direction * 20), npc.Center.Y + 6f);
float num1373 = player.position.X + player.width * 0.5f - vector167.X;
float num1374 = player.Center.Y - vector167.Y;
float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374));
float num1375 = (float)Math.Sqrt(num1373 * num1373 + num1374 * num1374);
float num1376 = num1372 / num1375;
num1373 *= num1376;
num1374 *= num1376;
@@ -115,6 +124,7 @@ namespace CalamityMod.NPCs.Signus
}
return;
}
npc.velocity.X = (npc.velocity.X * 50f + num1373) / 51f;
npc.velocity.Y = (npc.velocity.Y * 50f + num1374) / 51f;
if (num1375 < 350f)
@@ -141,7 +151,7 @@ namespace CalamityMod.NPCs.Signus
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
@@ -153,16 +163,16 @@ namespace CalamityMod.NPCs.Signus
Color color38 = lightColor;
color38 = Color.Lerp(color38, color36, amount9);
color38 = npc.GetAlpha(color38);
color38 *= (float)(num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
color38 *= (num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
}
}
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
@@ -172,24 +182,24 @@ namespace CalamityMod.NPCs.Signus
public override bool CheckDead()
{
Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14);
npc.position.X = npc.position.X + (float)(npc.width / 2);
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
npc.position.X = npc.position.X + (npc.width / 2);
npc.position.Y = npc.position.Y + (npc.height / 2);
npc.damage = 300;
npc.width = npc.height = 256;
npc.position.X = npc.position.X - (float)(npc.width / 2);
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 15; num621++)
npc.position.X = npc.position.X - (npc.width / 2);
npc.position.Y = npc.position.Y - (npc.height / 2);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
Main.dust[num622].noGravity = true;
}
for (int num623 = 0; num623 < 30; num623++)
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
+4 -2
View File
@@ -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)
{
+2 -3
View File
@@ -1,7 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ModLoader;
@@ -73,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
OldVelocity = Vector2.Zero;
projectile.netUpdate = true;
}
projectile.rotation = projectile.velocity.ToRotation() + 1.57f;
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
}
// Otherwise, be sure to save the velocity the projectile started with. It will be set again when the telegraph is over.
else if (OldVelocity == Vector2.Zero)
@@ -81,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss
OldVelocity = projectile.velocity;
projectile.velocity = Vector2.Zero;
projectile.netUpdate = true;
projectile.rotation = OldVelocity.ToRotation() + 1.57f;
projectile.rotation = OldVelocity.ToRotation() + MathHelper.PiOver2;
}
TelegraphDelay++;
}
+11 -11
View File
@@ -45,16 +45,6 @@ namespace CalamityMod.Projectiles.Boss
Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f);
float num953 = revenge ? 110f : 100f;
float scaleFactor12 = revenge ? 50f : 40f;
if (projectile.ai[1] == 1f)
{
num953 *= 0.7f;
scaleFactor12 *= 0.7f;
}
float num954 = 40f;
if (projectile.timeLeft > 30 && projectile.alpha > 0)
{
projectile.alpha -= 25;
@@ -68,9 +58,19 @@ namespace CalamityMod.Projectiles.Boss
projectile.alpha = 0;
}
if (projectile.timeLeft > 120 && projectile.ai[1] == 1f)
if (projectile.timeLeft > 135 && projectile.ai[1] == 1f)
return;
float num953 = revenge ? 110f : 100f;
float num954 = 40f;
float scaleFactor12 = revenge ? 50f : 40f;
if (projectile.ai[1] == 1f)
{
num953 *= 0.7f;
scaleFactor12 *= 0.7f;
}
int num959 = (int)projectile.ai[0];
if (num959 >= 0 && Main.player[num959].active && !Main.player[num959].dead)
{
+48 -5
View File
@@ -52,9 +52,10 @@ namespace CalamityMod.Projectiles
public float spawnedPlayerMinionDamageValue = 1f;
public int spawnedPlayerMinionProjectileDamageValue = 0;
public int defDamage = 0;
public int defCrit = 0;
// Rogue Stuff
public bool stealthStrike = false; //Update all existing rogue weapons with this
// Rogue Stuff
public bool stealthStrike = false; //Update all existing rogue weapons with this
public bool momentumCapacitatorBoost = false; //Constant acceleration
// Iron Heart
@@ -76,6 +77,18 @@ namespace CalamityMod.Projectiles
switch (projectile.type)
{
case ProjectileID.ShadowBeamHostile:
projectile.timeLeft = 60;
break;
case ProjectileID.LostSoulHostile:
projectile.tileCollide = true;
break;
case ProjectileID.NebulaLaser:
projectile.extraUpdates = 1;
break;
case ProjectileID.StarWrath:
projectile.penetrate = projectile.maxPenetrate = 1;
break;
@@ -988,7 +1001,23 @@ namespace CalamityMod.Projectiles
#region PostAI
public override void PostAI(Projectile projectile)
{
int x = (int)(projectile.Center.X / 16f);
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
// Set crit here to avoid issues with projectiles that change class types in PreAI and AI
if (defCrit == 0 && !projectile.npcProj && !projectile.trap)
{
if (projectile.melee)
defCrit = player.meleeCrit;
else if (projectile.ranged)
defCrit = player.rangedCrit;
else if (projectile.magic)
defCrit = player.magicCrit;
else if (rogue)
defCrit = modPlayer.throwingCrit;
}
int x = (int)(projectile.Center.X / 16f);
int y = (int)(projectile.Center.Y / 16f);
for (int i = x - 1; i <= x + 1; i++)
{
@@ -1022,8 +1051,22 @@ namespace CalamityMod.Projectiles
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (projectile.owner == Main.myPlayer && !projectile.npcProj && !projectile.trap && rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits)
crit = true;
if (projectile.owner == Main.myPlayer && !projectile.npcProj && !projectile.trap)
{
int critChance = (int)MathHelper.Clamp(1, 100, 100 - defCrit);
crit = Main.rand.NextBool(critChance + 1);
if ((uint)(projectile.type - ProjectileID.DD2LightningAuraT1) <= 2u)
{
if (player.setMonkT3)
crit = Main.rand.NextBool(4);
else if (player.setMonkT2)
crit = Main.rand.NextBool(6);
}
if (rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits)
crit = true;
}
}
#endregion
+1 -1
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -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);