Merge branch 'master' into lore-item-favoriting-toggles
This commit is contained in:
commit
9ac8dca188
44 files changed
+296
-231
No files matched your search
+35
-16
@@ -4012,16 +4012,19 @@ namespace CalamityMod.CalPlayer
|
||||
sCalDeathCount++;
|
||||
}
|
||||
}
|
||||
deathCount++;
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
KillPlayer();
|
||||
return false;
|
||||
}
|
||||
|
||||
deathCount++;
|
||||
if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
DeathPacket(false);
|
||||
}
|
||||
if (CalamityWorld.ironHeart && areThereAnyDamnBosses)
|
||||
{
|
||||
KillPlayer();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
@@ -4056,6 +4059,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)
|
||||
{
|
||||
@@ -5813,7 +5824,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
{
|
||||
float amount = npc.velocity.Length() / npc.Calamity().maxVelocity;
|
||||
float amount = npc.velocity.Length() / (npc.Calamity().maxVelocity * 0.4f);
|
||||
if (amount > 1f)
|
||||
amount = 1f;
|
||||
|
||||
@@ -6949,7 +6960,6 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Frame Effects
|
||||
|
||||
public override void FrameEffects()
|
||||
{
|
||||
if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot ||
|
||||
@@ -7163,6 +7173,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)
|
||||
{
|
||||
@@ -7879,7 +7903,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)
|
||||
{
|
||||
@@ -7893,13 +7917,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++)
|
||||
{
|
||||
@@ -10390,6 +10408,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;
|
||||
|
||||
@@ -3305,7 +3305,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Brimstone Elemental lore inferno potion boost
|
||||
if (modPlayer.brimstoneElementalLore && player.inferno)
|
||||
if ((modPlayer.brimstoneElementalLore || modPlayer.ataxiaBlaze) && player.inferno)
|
||||
{
|
||||
const int FramesPerHit = 30;
|
||||
|
||||
@@ -3799,7 +3799,7 @@ namespace CalamityMod.CalPlayer
|
||||
modPlayer.critStats[0] = player.meleeCrit;
|
||||
modPlayer.critStats[1] = player.rangedCrit;
|
||||
modPlayer.critStats[2] = player.magicCrit;
|
||||
modPlayer.critStats[3] = modPlayer.throwingCrit;
|
||||
modPlayer.critStats[3] = player.thrownCrit + modPlayer.throwingCrit;
|
||||
modPlayer.ammoReductionRanged = (int)(100f *
|
||||
(player.ammoBox ? 0.8f : 1f) *
|
||||
(player.ammoPotion ? 0.8f : 1f) *
|
||||
|
||||
+1
-1
@@ -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.6f;
|
||||
public const float bitingEnemeyVelocityScale = 0.9f;
|
||||
|
||||
// Lists
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1389,7 +1389,7 @@ namespace CalamityMod.NPCs
|
||||
float totalSegments = GetEaterOfWorldsSegmentsCountRevDeath();
|
||||
|
||||
// Count segments remaining
|
||||
float segmentCount = NPC.CountNPCS(NPCID.EaterofWorldsHead) + NPC.CountNPCS(NPCID.EaterofWorldsBody) + NPC.CountNPCS(NPCID.EaterofWorldsTail); // 2f to 65f
|
||||
float segmentCount = NPC.CountNPCS(NPCID.EaterofWorldsHead) + NPC.CountNPCS(NPCID.EaterofWorldsBody) + NPC.CountNPCS(NPCID.EaterofWorldsTail);
|
||||
|
||||
// Percent segments remaining, add two to total for head and tail
|
||||
float lifeRatio = segmentCount / (totalSegments + 2);
|
||||
@@ -1866,7 +1866,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
public static int GetEaterOfWorldsSegmentsCountRevDeath()
|
||||
{
|
||||
return CalamityWorld.death ? 80 : 75;
|
||||
return (CalamityWorld.death || CalamityWorld.bossRushActive) ? 80 : 75;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -2522,7 +2522,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
public static int GetBrainOfCthuluCreepersCountRevDeath()
|
||||
{
|
||||
return CalamityWorld.death ? 30 : 25;
|
||||
return (CalamityWorld.death || CalamityWorld.bossRushActive) ? 30 : 25;
|
||||
}
|
||||
|
||||
private static float GetCrimsonBossKnockBack(NPC npc, int numPlayers, float lifeScale, float baseKnockBackResist)
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -801,7 +793,7 @@ namespace CalamityMod.NPCs
|
||||
npc.buffImmune[BuffID.Slow] = true;
|
||||
}
|
||||
|
||||
if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC)
|
||||
if (DestroyerIDs.Contains(npc.type) || (EaterofWorldsIDs.Contains(npc.type) && CalamityWorld.bossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC)
|
||||
{
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -751,7 +751,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
public override void NPCLoot()
|
||||
{
|
||||
// Skip the sentinel phase entirely if DoG has already been killed
|
||||
CalamityWorld.DoGSecondStageCountdown = CalamityWorld.downedDoG ? 600 : 21600;
|
||||
CalamityWorld.DoGSecondStageCountdown = (CalamityWorld.downedDoG || CalamityWorld.downedSecondSentinels) ? 600 : 21600;
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -782,7 +782,11 @@ namespace CalamityMod.NPCs.Signus
|
||||
netMessage.Write(CalamityWorld.DoGSecondStageCountdown);
|
||||
netMessage.Send();
|
||||
}
|
||||
}
|
||||
|
||||
// Mark DoG fight sentinels as dead
|
||||
CalamityWorld.downedSecondSentinels = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
// Mark Signus as dead
|
||||
CalamityWorld.downedSentinel3 = true;
|
||||
|
||||
+60
-50
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.chaseable = false;
|
||||
npc.HitSound = SoundID.NPCHit52;
|
||||
npc.DeathSound = SoundID.NPCDeath55;
|
||||
npc.alpha = 255;
|
||||
|
||||
@@ -31,7 +31,8 @@ namespace CalamityMod.NPCs.Yharon
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit52;
|
||||
npc.chaseable = false;
|
||||
npc.HitSound = SoundID.NPCHit52;
|
||||
npc.DeathSound = SoundID.NPCDeath55;
|
||||
npc.alpha = 255;
|
||||
}
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.hostile = true;
|
||||
projectile.scale = 1.5f;
|
||||
projectile.hostile = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
@@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.01f / 255f, (255 - projectile.alpha) * 0.15f / 255f, (255 - projectile.alpha) * 0.05f / 255f);
|
||||
Lighting.AddLight(projectile.Center, 0f, 0.15f, 0f);
|
||||
bool flag15 = false;
|
||||
bool flag16 = false;
|
||||
if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0])
|
||||
@@ -61,12 +62,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
num461 *= 0.7f;
|
||||
projectile.ai[0] += 4f;
|
||||
int num462 = 0;
|
||||
while ((float)num462 < num461)
|
||||
while (num462 < num461)
|
||||
{
|
||||
float num463 = (float)Main.rand.Next(-10, 11);
|
||||
float num464 = (float)Main.rand.Next(-10, 11);
|
||||
float num465 = (float)Main.rand.Next(3, 9);
|
||||
float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464));
|
||||
float num463 = Main.rand.Next(-10, 11);
|
||||
float num464 = Main.rand.Next(-10, 11);
|
||||
float num465 = Main.rand.Next(3, 9);
|
||||
float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464);
|
||||
num466 = num465 / num466;
|
||||
num463 *= num466;
|
||||
num464 *= num466;
|
||||
@@ -75,9 +76,9 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Main.dust[num467].position.X = projectile.Center.X;
|
||||
Main.dust[num467].position.Y = projectile.Center.Y;
|
||||
Dust expr_149DF_cp_0 = Main.dust[num467];
|
||||
expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11);
|
||||
expr_149DF_cp_0.position.X += Main.rand.Next(-10, 11);
|
||||
Dust expr_14A09_cp_0 = Main.dust[num467];
|
||||
expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11);
|
||||
expr_14A09_cp_0.position.Y += Main.rand.Next(-10, 11);
|
||||
Main.dust[num467].velocity.X = num463;
|
||||
Main.dust[num467].velocity.Y = num464;
|
||||
num462++;
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.hostile = true;
|
||||
projectile.scale = 1.5f;
|
||||
projectile.hostile = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft = 300;
|
||||
@@ -28,9 +29,9 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (projectile.position.Y > projectile.ai[1])
|
||||
projectile.tileCollide = true;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
int num123 = (int)Player.FindClosest(projectile.Center, 1, 1);
|
||||
int num123 = Player.FindClosest(projectile.Center, 1, 1);
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] < 110f && projectile.ai[0] > 30f)
|
||||
{
|
||||
@@ -61,13 +62,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Vector2 center = new Vector2(projectile.Center.X, projectile.Center.Y);
|
||||
Vector2 vector11 = new Vector2((float)(Main.projectileTexture[projectile.type].Width / 2), (float)(Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type] / 2));
|
||||
Vector2 vector11 = new Vector2(Main.projectileTexture[projectile.type].Width / 2, Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type] / 2);
|
||||
Vector2 vector = center - Main.screenPosition;
|
||||
vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Width, (float)(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Height / Main.projFrames[projectile.type])) * 1f / 2f;
|
||||
vector -= new Vector2(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Width, ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Height / Main.projFrames[projectile.type]) * 1f / 2f;
|
||||
vector += vector11 * 1f + new Vector2(0f, 0f + 4f + projectile.gfxOffY);
|
||||
Color color = new Color(127 - projectile.alpha, 127 - projectile.alpha, 127 - projectile.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red);
|
||||
Color color = new Color(127 - projectile.alpha, 127 - projectile.alpha, 127 - projectile.alpha, 0).MultiplyRGBA(Color.Red);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow"), vector,
|
||||
null, color, projectile.rotation, vector11, 1f, spriteEffects, 0f);
|
||||
null, color, projectile.rotation, vector11, projectile.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 282 B |
@@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.scale = 1.5f;
|
||||
projectile.hostile = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 2;
|
||||
@@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (projectile.position.Y > projectile.ai[1])
|
||||
projectile.tileCollide = true;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
@@ -46,13 +47,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Vector2 center = new Vector2(projectile.Center.X, projectile.Center.Y);
|
||||
Vector2 vector11 = new Vector2((float)(Main.projectileTexture[projectile.type].Width / 2), (float)(Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type] / 2));
|
||||
Vector2 vector11 = new Vector2(Main.projectileTexture[projectile.type].Width / 2, Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type] / 2);
|
||||
Vector2 vector = center - Main.screenPosition;
|
||||
vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathV2Glow").Width, (float)(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathV2Glow").Height / Main.projFrames[projectile.type])) * 1f / 2f;
|
||||
vector -= new Vector2(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathV2Glow").Width, ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathV2Glow").Height / Main.projFrames[projectile.type]) * 1f / 2f;
|
||||
vector += vector11 * 1f + new Vector2(0f, 0f + 4f + projectile.gfxOffY);
|
||||
Color color = new Color(127 - projectile.alpha, 127 - projectile.alpha, 127 - projectile.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red);
|
||||
Color color = new Color(127 - projectile.alpha, 127 - projectile.alpha, 127 - projectile.alpha, 0).MultiplyRGBA(Color.Red);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Boss/PlagueStingerGoliathV2Glow"), vector,
|
||||
null, color, projectile.rotation, vector11, 1f, spriteEffects, 0f);
|
||||
null, color, projectile.rotation, vector11, projectile.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
|
||||
@@ -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,25 @@ 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 = modPlayer.critStats[0];
|
||||
else if (projectile.ranged)
|
||||
defCrit = modPlayer.critStats[1];
|
||||
else if (projectile.magic)
|
||||
defCrit = modPlayer.critStats[2];
|
||||
else if (rogue)
|
||||
defCrit = modPlayer.critStats[3];
|
||||
else if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type])
|
||||
defCrit = 4;
|
||||
}
|
||||
|
||||
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 +1053,23 @@ 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 critMax = 100;
|
||||
int critChance = (int)MathHelper.Clamp(defCrit, 1, critMax);
|
||||
crit = Main.rand.Next(1, critMax + 1) <= critChance;
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -160,7 +160,8 @@ namespace CalamityMod.World
|
||||
public static bool downedSentinel1 = false; // Ceaseless Void
|
||||
public static bool downedSentinel2 = false; // Storm Weaver
|
||||
public static bool downedSentinel3 = false; // Signus, Envoy of the Devourer
|
||||
public static bool downedPolterghast = false;
|
||||
public static bool downedSecondSentinels = false;
|
||||
public static bool downedPolterghast = false;
|
||||
public static bool downedDoG = false;
|
||||
public static bool downedBumble = false;
|
||||
public static bool buffedEclipse = false;
|
||||
@@ -250,6 +251,7 @@ namespace CalamityMod.World
|
||||
downedGSS = false;
|
||||
downedBuffedMothron = false;
|
||||
downedBoomerDuke = false;
|
||||
downedSecondSentinels = false;
|
||||
death = false;
|
||||
defiled = false;
|
||||
armageddon = false;
|
||||
@@ -298,6 +300,8 @@ namespace CalamityMod.World
|
||||
downed.Add("stormWeaver");
|
||||
if (downedSentinel3)
|
||||
downed.Add("signus");
|
||||
if (downedSecondSentinels)
|
||||
downed.Add("secondSentinels");
|
||||
if (downedYharon)
|
||||
downed.Add("yharon");
|
||||
if (buffedEclipse)
|
||||
@@ -404,6 +408,7 @@ namespace CalamityMod.World
|
||||
downedSentinel1 = downed.Contains("ceaselessVoid");
|
||||
downedSentinel2 = downed.Contains("stormWeaver");
|
||||
downedSentinel3 = downed.Contains("signus");
|
||||
downedSecondSentinels = downed.Contains("secondSentinels");
|
||||
downedYharon = downed.Contains("yharon");
|
||||
buffedEclipse = downed.Contains("eclipse");
|
||||
downedSCal = downed.Contains("supremeCalamitas");
|
||||
@@ -528,7 +533,7 @@ namespace CalamityMod.World
|
||||
BitsByte flags8 = reader.ReadByte();
|
||||
forcedRainAlready = flags8[0];
|
||||
forcedDownpourWithTear = flags8[1];
|
||||
_ = flags8[2];
|
||||
downedSecondSentinels = flags8[2];
|
||||
_ = flags8[3];
|
||||
_ = flags8[4];
|
||||
_ = flags8[5];
|
||||
@@ -619,7 +624,7 @@ namespace CalamityMod.World
|
||||
BitsByte flags8 = new BitsByte();
|
||||
flags8[0] = forcedRainAlready;
|
||||
flags8[1] = forcedDownpourWithTear;
|
||||
flags8[2] = false;
|
||||
flags8[2] = downedSecondSentinels;
|
||||
flags8[3] = false;
|
||||
flags8[4] = false;
|
||||
flags8[5] = false;
|
||||
@@ -716,7 +721,7 @@ namespace CalamityMod.World
|
||||
BitsByte flags8 = reader.ReadByte();
|
||||
forcedRainAlready = flags8[0];
|
||||
forcedDownpourWithTear = flags8[1];
|
||||
_ = flags8[2];
|
||||
downedSecondSentinels = flags8[2];
|
||||
_ = flags8[3];
|
||||
_ = flags8[4];
|
||||
_ = flags8[5];
|
||||
|
||||
Reference in new issue
Block a user