Replaced every instance of Main.player[Main.myPlayer] with Main.LocalPlayer

This commit is contained in:
CongratsIsTrash committed 2025-01-26 22:17:36 -05:00
1 parent 467be11f34
commit 69e4f473b0
92 files changed
+216 -216

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
tip = base.Description.Format((AbyssalDivingSuit.PlatesAllDamageReduction - Main.player[Main.myPlayer].Calamity().abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay).ToPercent());
tip = base.Description.Format((AbyssalDivingSuit.PlatesAllDamageReduction - Main.LocalPlayer.Calamity().abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay).ToPercent());
}
public override void Update(Player player, ref int buffIndex)
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
tip = base.Description.Format((1f + Main.player[Main.myPlayer].Calamity().GetAdrenalineDamage()).Round());
tip = base.Description.Format((1f + Main.LocalPlayer.Calamity().GetAdrenalineDamage()).Round());
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player.Calamity().profanedCrystalBuffs)
{
bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered;
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Buffs.Summon
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player.Calamity().profanedCrystal && !player.Calamity().profanedCrystalBuffs)
tip = this.GetLocalizedValue("VanityDescription");
}
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon.Whips
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered;
if (empowered)
{
+2 -2
View File
@@ -533,7 +533,7 @@ namespace CalamityMod.CalPlayer
if (frostSet)
{
// 0f = point blank, 1f = max range or further
float DistanceInterpolant = Utils.GetLerpValue(FrostArmorSetChange.MinDistance, FrostArmorSetChange.MaxDistance, target.Distance(Main.player[Main.myPlayer].Center), true);
float DistanceInterpolant = Utils.GetLerpValue(FrostArmorSetChange.MinDistance, FrostArmorSetChange.MaxDistance, target.Distance(Main.LocalPlayer.Center), true);
if (item.CountsAsClass<MeleeDamageClass>())
{
@@ -632,7 +632,7 @@ namespace CalamityMod.CalPlayer
if (frostSet)
{
// 0f = point blank, 1f = max range or further
float DistanceInterpolant = Utils.GetLerpValue(FrostArmorSetChange.MinDistance, FrostArmorSetChange.MaxDistance, target.Distance(Main.player[Main.myPlayer].Center), true);
float DistanceInterpolant = Utils.GetLerpValue(FrostArmorSetChange.MinDistance, FrostArmorSetChange.MaxDistance, target.Distance(Main.LocalPlayer.Center), true);
if (proj.CountsAsClass<MeleeDamageClass>())
{
+10 -10
View File
@@ -460,7 +460,7 @@ namespace CalamityMod.CalPlayer
}
int heal = (int)Math.Round(hit.Damage * 0.035);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
@@ -480,7 +480,7 @@ namespace CalamityMod.CalPlayer
}
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
for (int i = 0; i <= 2; i++)
@@ -1228,7 +1228,7 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType<GladiatorHealOrb>(), 0, 0f);
}
if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
// Increases the degree to which Spectre Healing set contributes to the lifesteal cap
if (Player.ghostHeal && proj.CountsAsClass<MagicDamageClass>())
@@ -1240,7 +1240,7 @@ namespace CalamityMod.CalPlayer
cooldownMult = 0f;
float cooldown = damage * cooldownMult;
Main.player[Main.myPlayer].lifeSteal -= cooldown;
Main.LocalPlayer.lifeSteal -= cooldown;
}
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit)
@@ -1359,12 +1359,12 @@ namespace CalamityMod.CalPlayer
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>() && target.lifeMax > 5)
{
if (target.IsAnEnemy(false) && Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech)
if (target.IsAnEnemy(false) && Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech)
{
int heal = 4;
if (!Main.player[Main.myPlayer].moonLeech)
if (!Main.LocalPlayer.moonLeech)
{
Main.player[Main.myPlayer].lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier;
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
@@ -1396,16 +1396,16 @@ namespace CalamityMod.CalPlayer
if (reaverDefense)
{
if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
double healMult = 0.1;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (heal > 0 && !Main.player[Main.myPlayer].moonLeech)
if (heal > 0 && !Main.LocalPlayer.moonLeech)
{
Main.player[Main.myPlayer].lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier;
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
@@ -45,7 +45,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
if (!npc.HasValidTarget)
return;
var target = Main.player[Main.myPlayer];
var target = Main.LocalPlayer;
var holyInfernoIntensity = target.Calamity().holyInfernoFadeIntensity;
var prov = Provi;
if (prov == null)
+1 -1
View File
@@ -92,7 +92,7 @@ namespace CalamityMod.ILEditing
}
// Allow only one pick up of the card this way per player (also don't give it to dead people)
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player.Calamity().spawnedPunchCard || player.dead || !player.active)
{
orig();
+1 -1
View File
@@ -229,7 +229,7 @@ namespace CalamityMod.Items.Accessories
}
else
{
string manaCost = (100 * Main.player[Main.myPlayer].manaCost).ToString("N0");
string manaCost = (100 * Main.LocalPlayer.manaCost).ToString("N0");
string full = this.GetLocalization("FullTooltip").Format(maxMinionRequirement, manaCost);
tooltips.FindAndReplace("[STATUS]", full);
}
+1 -1
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories
public override void ModifyTooltips(List<TooltipLine> list)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
CalamityPlayer modPlayer = player.Calamity();
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.DraedonMisc
if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.HasTile && tile.TileType == ModContent.TileType<CodebreakerTile>())
{
SoundEngine.PlaySound(InstallSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(InstallSound, Main.LocalPlayer.Center);
TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity<TECodebreaker>(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare);
if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsAdvancedDisplay)
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Items.DraedonMisc
if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.HasTile && tile.TileType == ModContent.TileType<CodebreakerTile>())
{
SoundEngine.PlaySound(InstallSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(InstallSound, Main.LocalPlayer.Center);
TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity<TECodebreaker>(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare);
if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsCoolingCell || codebreakerTileEntity.DecryptionCountdown > 0)
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.DraedonMisc
if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.HasTile && tile.TileType == ModContent.TileType<CodebreakerTile>())
{
SoundEngine.PlaySound(InstallSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(InstallSound, Main.LocalPlayer.Center);
TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity<TECodebreaker>(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare);
if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsDecryptionComputer)
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.DraedonMisc
if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.HasTile && tile.TileType == ModContent.TileType<CodebreakerTile>())
{
SoundEngine.PlaySound(InstallSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(InstallSound, Main.LocalPlayer.Center);
TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity<TECodebreaker>(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare);
if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsSensorArray)
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.DraedonMisc
if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.HasTile && tile.TileType == ModContent.TileType<CodebreakerTile>())
{
SoundEngine.PlaySound(InstallSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(InstallSound, Main.LocalPlayer.Center);
TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity<TECodebreaker>(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare);
if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsVoltageRegulationSystem)
+1 -1
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Melee
if (tooltips == null)
return;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee
if (tooltips == null)
return;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
+2 -2
View File
@@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee
SafeCheckAttunements();
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
@@ -128,7 +128,7 @@ namespace CalamityMod.Items.Weapons.Melee
var clone = base.Clone(item);
if (Main.mouseItem.type == ItemType<BrokenBiomeBlade>())
item.ModItem?.HoldItem(Main.player[Main.myPlayer]);
item.ModItem?.HoldItem(Main.LocalPlayer);
if (clone is BrokenBiomeBlade a && item.ModItem is BrokenBiomeBlade a2)
{
+2 -2
View File
@@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Melee
SafeCheckAttunements();
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
@@ -129,7 +129,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
var clone = base.Clone(item);
if (Main.mouseItem.type == ItemType<FourSeasonsGalaxia>())
item.ModItem?.HoldItem(Main.player[Main.myPlayer]);
item.ModItem?.HoldItem(Main.LocalPlayer);
if (clone is FourSeasonsGalaxia a && item.ModItem is FourSeasonsGalaxia a2)
a.mainAttunement = a2.mainAttunement;
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee
if (tooltips == null)
return;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
+2 -2
View File
@@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons.Melee
SafeCheckAttunements();
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
@@ -194,7 +194,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
var clone = base.Clone(item);
if (Main.mouseItem.type == ItemType<OmegaBiomeBlade>())
item.ModItem?.HoldItem(Main.player[Main.myPlayer]);
item.ModItem?.HoldItem(Main.LocalPlayer);
if (clone is OmegaBiomeBlade a && item.ModItem is OmegaBiomeBlade a2)
{
a.mainAttunement = a2.mainAttunement;
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee
if (tooltips == null)
return;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
+2 -2
View File
@@ -81,7 +81,7 @@ namespace CalamityMod.Items.Weapons.Melee
SafeCheckAttunements();
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
@@ -155,7 +155,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
var clone = base.Clone(item);
if (Main.mouseItem.type == ItemType<TrueBiomeBlade>())
item.ModItem?.HoldItem(Main.player[Main.myPlayer]);
item.ModItem?.HoldItem(Main.LocalPlayer);
if (clone is TrueBiomeBlade a && item.ModItem is TrueBiomeBlade a2)
{
a.mainAttunement = a2.mainAttunement;
+1 -1
View File
@@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Ranged
}
public override void ModifyTooltips(List<TooltipLine> list)
{
Player Owner = Main.player[Main.myPlayer];
Player Owner = Main.LocalPlayer;
if (Owner is null)
return;
float rate = (Main.GlobalTimeWrappedHourly * 3);
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged
if (tooltips == null)
return;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (player is null)
return;
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
CalamityPlayer p = Main.player[Main.myPlayer].Calamity();
CalamityPlayer p = Main.LocalPlayer.Calamity();
//If stealth is full, shoot a spread of 3 shurikens
if (p.StealthStrikeAvailable())
{
+1 -1
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.AcidRain
if (!Main.dedServ)
{
int auraSize = 200; //roughly 12 blocks (half the size of Wither Beast aura)
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (!player.dead && player.active && (player.Center - NPC.Center).Length() < auraSize && !player.creativeGodMode)
{
player.AddBuff(ModContent.BuffType<Irradiated>(), 3, false);
+2 -2
View File
@@ -282,8 +282,8 @@ namespace CalamityMod.NPCs.AquaticScourge
// If Aquatic Scourge has not yet been killed, notify players of buffed Acid Rain
if (!DownedBossSystem.downedAquaticScourge)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(Mauler.RoarSound, Main.player[Main.myPlayer].Center);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
SoundEngine.PlaySound(Mauler.RoarSound, Main.LocalPlayer.Center);
string sulfSeaBoostKey = "Mods.CalamityMod.Status.Progression.WetWormBossText";
Color sulfSeaBoostColor = AcidRainEvent.TextColor;
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.CalClone
float x = 0f;
if (this.CalIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.CalIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[this.CalIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x));
}
@@ -72,8 +72,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
}
}
@@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
npc.Calamity().canBreakPlayerDefense = false;
// Play exhausted sound
if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 2800f)
if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < 2800f)
SoundEngine.PlaySound(OldDuke.OldDuke.HuffSound with { Volume = OldDuke.OldDuke.HuffSound.Volume * 1.25f }, Main.LocalPlayer.Center);
if (Main.zenithWorld)
+44 -44
View File
@@ -3852,8 +3852,8 @@ namespace CalamityMod.NPCs
// Apply Boss Effects while any boss NPC is active
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < BossZenDistance)
Main.player[Main.myPlayer].AddBuff(BuffType<BossEffects>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance)
Main.LocalPlayer.AddBuff(BuffType<BossEffects>(), 2);
}
if (npc.type != NPCType<Draedon>())
@@ -8015,8 +8015,8 @@ namespace CalamityMod.NPCs
currentColor.A = (byte)((float)(int)currentColor.A * opacity);
Vector2 position = npc.position;
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y);
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y);
if (i > 3)
{
currentColor *= 0.5f;
@@ -8030,46 +8030,46 @@ namespace CalamityMod.NPCs
{
case 0:
case 4:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y;
break;
case 1:
case 5:
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.player[Main.myPlayer].Center.X;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X;
break;
case 2:
case 6:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y;
break;
case 3:
case 7:
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.player[Main.myPlayer].Center.X;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X;
break;
case 8:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 9:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 10:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
case 11:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
default:
@@ -8121,18 +8121,18 @@ namespace CalamityMod.NPCs
for (int i = 0; i < totalAfterimages; i++)
{
Vector2 position = npc.position;
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y);
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y);
if (i == 0 || i == 2)
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
else
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.X -= npc.width / 2;
if (i == 0 || i == 1)
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
else
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
position.Y -= npc.height / 2;
@@ -8157,8 +8157,8 @@ namespace CalamityMod.NPCs
for (int i = 0; i < totalAfterimages; i++)
{
Vector2 position = npc.position;
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y);
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y);
if (i > 3)
{
currentColor *= 0.5f;
@@ -8170,46 +8170,46 @@ namespace CalamityMod.NPCs
{
case 0:
case 4:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromBrain.Y;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromBrain.Y;
break;
case 1:
case 5:
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.player[Main.myPlayer].Center.X + distanceFromBrain.X;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromBrain.X;
break;
case 2:
case 6:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromBrain.Y;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromBrain.Y;
break;
case 3:
case 7:
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.player[Main.myPlayer].Center.X + distanceFromBrain.X;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromBrain.X;
break;
case 8:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 9:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 10:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
case 11:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
default:
+2 -2
View File
@@ -1965,8 +1965,8 @@ DukeEditFailed:
// If Golem has never been killed, send a message about the Plague.
if (!NPC.downedGolemBoss && !BossRushEvent.BossRushActive)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(PlagueSound, Main.player[Main.myPlayer].Center);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
SoundEngine.PlaySound(PlagueSound, Main.LocalPlayer.Center);
string key3 = "Mods.CalamityMod.Status.Progression.BabyBossText";
Color messageColor3 = Color.Lime;
+2 -2
View File
@@ -130,9 +130,9 @@ namespace CalamityMod.NPCs
}
if (sharkKillCount >= 10 && Main.netMode != NetmodeID.MultiplayerClient)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
{
SoundEngine.PlaySound(Mauler.RoarSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(Mauler.RoarSound, Main.LocalPlayer.Center);
}
int lastPlayer = slainedNPC.lastInteraction;
+10 -10
View File
@@ -1031,8 +1031,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].Calamity().infiniteFlight = true;
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.Calamity().infiniteFlight = true;
}
}
@@ -1061,8 +1061,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<Warped>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(ModContent.BuffType<Warped>(), 2);
}
// Charge in a direction for a second until the timer is back at 0
@@ -1276,8 +1276,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
}
// Charge in a direction for a second until the timer is back at 0
@@ -1866,8 +1866,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<Warped>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(ModContent.BuffType<Warped>(), 2);
}
// Flying movement
@@ -2063,8 +2063,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(ModContent.BuffType<DoGExtremeGravity>(), 2);
}
calamityGlobalNPC.newAI[2] += 1f;
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.DevourerofGods
{
float x = 0f;
if (DoGIndex != -1)
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[DoGIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[DoGIndex].Center);
float intensityScalar = 0.5f;
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * intensityScalar;
+4 -4
View File
@@ -855,9 +855,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Set flight time to max during Deathray Spiral
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < DeathrayEnrageDistance)
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < DeathrayEnrageDistance)
{
Main.player[Main.myPlayer].Calamity().infiniteFlight = true;
Main.LocalPlayer.Calamity().infiniteFlight = true;
}
}
@@ -872,9 +872,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode && revenge)) && EnragedState == (float)Enraged.No)
{
// Play enrage sound
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
{
SoundEngine.PlaySound(EnragedSound, Main.player[Main.myPlayer].Center);
SoundEngine.PlaySound(EnragedSound, Main.LocalPlayer.Center);
}
// Draedon comments on how foolish it is to run
+1 -1
View File
@@ -887,7 +887,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (calamityGlobalNPC.newAI[2] == 1f)
{
//Commented out in case we decide its better for it to simply play from anywhere in range
//if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
//if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
LaserSoundSlot = SoundEngine.PlaySound(LaserSound, NPC.Center);
// Create a bunch of lightning bolts in the sky
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Leviathan
float x = 0f;
if (LevIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[LevIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[LevIndex].Center);
}
float spawnAnimationTimer = 180f;
+2 -2
View File
@@ -831,8 +831,8 @@ namespace CalamityMod.NPCs.Leviathan
if (!DownedBossSystem.downedLeviathan)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, Main.player[Main.myPlayer].Center);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, Main.LocalPlayer.Center);
CalamityUtils.DisplayLocalizedText(key, messageColor);
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
float x = 0f;
if (this.PbGIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.PbGIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[this.PbGIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x));
}
+2 -2
View File
@@ -970,8 +970,8 @@ namespace CalamityMod.NPCs.Polterghast
// If Polterghast has not been killed, notify players about the Abyss minibosses now dropping items
if (!DownedBossSystem.downedPolterghast)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(ReaperShark.SearchRoarSound, Main.player[Main.myPlayer].Center);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
SoundEngine.PlaySound(ReaperShark.SearchRoarSound, Main.LocalPlayer.Center);
string key = "Mods.CalamityMod.Status.Progression.GhostBossText";
Color messageColor = Color.RoyalBlue;
+16 -16
View File
@@ -220,8 +220,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
// Play spawn sound
if (!TailSpawned && NPC.ai[0] == 0f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(SpawnSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(SpawnSound, Main.LocalPlayer.Center);
}
// Spawn segments
@@ -537,8 +537,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.LocalPlayer.Center);
}
// Lock into the charge phase and use this for a charge time check
@@ -597,8 +597,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (calamityGlobalNPC.newAI[2] % 30f == 0f && calamityGlobalNPC.newAI[2] < lightningRainDuration)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.LocalPlayer.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
@@ -725,8 +725,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.LocalPlayer.Center);
}
// Lock into the charge phase and use this for a charge time check
@@ -837,8 +837,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.LocalPlayer.Center);
}
// Lock into the charge phase and use this for a charge time check
@@ -1117,8 +1117,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (calamityGlobalNPC.newAI[2] == lightningChargePhaseGateValue + 1f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(ChargeSound, Main.LocalPlayer.Center);
}
// Lock into the charge phase and use this for a charge time check
@@ -1130,8 +1130,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
// Lightning barrage
if (NPC.localAI[3] == 0f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.LocalPlayer.Center);
NPC.localAI[3] = 1f;
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -1186,8 +1186,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm
{
if (!NPC.AnyNPCs(ModContent.NPCType<Eidolist>()))
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(Eidolist.DeathSound, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance)
SoundEngine.PlaySound(Eidolist.DeathSound, Main.LocalPlayer.Center);
// Spawn Eidolists randomly around the target
for (int i = 0; i < maxEidolists; i++)
@@ -961,7 +961,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f;
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < 2800f)
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f)
SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
+2 -2
View File
@@ -1417,7 +1417,7 @@ namespace CalamityMod.NPCs.Providence
{
if (!Main.dedServ)
{
Player player2 = Main.player[Main.myPlayer];
Player player2 = Main.LocalPlayer;
bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet;
if (!player2.dead && player2.active && Vector2.Distance(player2.Center, NPC.Center) < 2800f && !inLiquid)
@@ -1760,7 +1760,7 @@ namespace CalamityMod.NPCs.Providence
{
if (NPC.ai[2] == 120f)
{
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < 2800f)
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f)
{
SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center);
}
+4 -4
View File
@@ -231,8 +231,8 @@ namespace CalamityMod.NPCs.Ravager
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && revenge)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<WeakPetrification>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge)
Main.LocalPlayer.AddBuff(ModContent.BuffType<WeakPetrification>(), 2);
}
}
}
@@ -241,8 +241,8 @@ namespace CalamityMod.NPCs.Ravager
NPC.dontTakeDamage = false;
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && revenge)
Main.player[Main.myPlayer].AddBuff(ModContent.BuffType<WeakPetrification>(), 2);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge)
Main.LocalPlayer.AddBuff(ModContent.BuffType<WeakPetrification>(), 2);
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Signus
float x = 0f;
if (this.SignusIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.SignusIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[this.SignusIndex].Center);
}
float maxIntensity = 0.1f;
+1 -1
View File
@@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.TownNPCs
dialogue.Add(this.GetLocalizedValue("Chat.Normal2"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal3"));
if (Main.dayTime && !Main.player[Main.myPlayer].ZoneSnow)
if (Main.dayTime && !Main.LocalPlayer.ZoneSnow)
{
dialogue.Add(this.GetLocalizedValue("Chat.Day1"));
dialogue.Add(this.GetLocalizedValue("Chat.Day2"));
+2 -2
View File
@@ -673,7 +673,7 @@ namespace CalamityMod.NPCs.TownNPCs
public override string GetChat()
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (Main.zenithWorld)
{
player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CirrusSlap" + Main.rand.Next(1, 2 + 1)).Format(player.name)), player.statLife / 2, -player.direction, false, false, -1, false);
@@ -823,7 +823,7 @@ namespace CalamityMod.NPCs.TownNPCs
public string Death()
{
int deaths = Main.player[Main.myPlayer].numberOfDeathsPVE;
int deaths = Main.LocalPlayer.numberOfDeathsPVE;
string text = this.GetLocalization("DeathCount").Format(deaths);
+2 -2
View File
@@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.TownNPCs
public override string GetChat()
{
WeightedRandom<string> dialogue = new WeightedRandom<string>();
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (NPC.homeless)
return this.GetLocalizedValue("Chat.Homeless" + Main.rand.Next(1, 2 + 1));
@@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.TownNPCs
{
Main.npcChatText = Lore();
NPC.Calamity().newAI[0]++;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
player.AddBuff(ModContent.BuffType<AmidiasBlessing>(), 36000);
}
}
@@ -318,8 +318,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
if (!Main.dedServ)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.player[Main.myPlayer].AddBuff(BuffID.Confused, 90);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles)
Main.LocalPlayer.AddBuff(BuffID.Confused, 90);
}
}
}
@@ -371,48 +371,48 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
for (int i = startingIndex; i < totalProjectileSpreads; i++)
{
Vector2 position = npc.Center;
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y);
float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y);
switch (i)
{
case 0:
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
if (diagonalShots)
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
else
position.Y = Main.player[Main.myPlayer].Center.Y;
position.Y = Main.LocalPlayer.Center.Y;
break;
case 1:
position.Y = Main.player[Main.myPlayer].Center.Y - distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
if (diagonalShots)
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
else
position.X = Main.player[Main.myPlayer].Center.X;
position.X = Main.LocalPlayer.Center.X;
break;
case 2:
position.X = Main.player[Main.myPlayer].Center.X + distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
if (diagonalShots)
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
else
position.Y = Main.player[Main.myPlayer].Center.Y;
position.Y = Main.LocalPlayer.Center.Y;
break;
case 3:
position.Y = Main.player[Main.myPlayer].Center.Y + distanceFromTargetY;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
if (diagonalShots)
position.X = Main.player[Main.myPlayer].Center.X - distanceFromTargetX;
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
else
position.X = Main.player[Main.myPlayer].Center.X;
position.X = Main.LocalPlayer.Center.X;
break;
@@ -272,8 +272,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ai[3] = 1f;
// Play roar sound on players nearby
if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 2800f)
SoundEngine.PlaySound(SoundID.NPCDeath10 with { Pitch = SoundID.NPCDeath10.Pitch - 0.25f }, Main.player[Main.myPlayer].Center);
if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < 2800f)
SoundEngine.PlaySound(SoundID.NPCDeath10 with { Pitch = SoundID.NPCDeath10.Pitch - 0.25f }, Main.LocalPlayer.Center);
}
}
else if (distanceFromTarget < distanceBeforeSlowingDown)
@@ -579,7 +579,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies
}
if (!Main.dedServ)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (!player.dead && player.active && player.FindBuffIndex(BuffID.Stoned) == -1)
{
if (npc.Distance(player.Center) < medusaEffectDistance)
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Yharon
float x = 0f;
if (this.YIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.YIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[this.YIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * intensity * 0.66f;
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Particles
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public Player player = Main.player[Main.myPlayer];
public Player player = Main.LocalPlayer;
private float OriginalScale;
private float FinalScale;
private float opacity;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Particles
public override bool UseAdditiveBlend => true;
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
public Player player = Main.player[Main.myPlayer];
public Player player = Main.LocalPlayer;
public Color InitialColor;
public bool PlayerCentered;
public bool RotateToVelocity;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Particles
public override bool UseAdditiveBlend => true;
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
public Player player = Main.player[Main.myPlayer];
public Player player = Main.LocalPlayer;
public bool PlayerCentered;
public Vector2 Squish;
+1 -1
View File
@@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss
color = new Color((int)red, (int)green, (int)blue, (int)alpha);
break;
}
if (Main.player[Main.myPlayer].gravDir != 1f)
if (Main.LocalPlayer.gravDir != 1f)
{
float finalYPos = Projectile.position.Y - Main.screenPosition.Y;
finalYPos = (float)Main.screenHeight - finalYPos;
+3 -3
View File
@@ -4271,7 +4271,7 @@ namespace CalamityMod.Projectiles
#region Drawing
public override Color? GetAlpha(Projectile projectile, Color lightColor)
{
if (Main.player[Main.myPlayer].Calamity().trippy)
if (Main.LocalPlayer.Calamity().trippy)
return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR);
if (Main.LocalPlayer.Calamity().omniscience && projectile.hostile && projectile.damage > 0 && projectile.alpha < 255)
@@ -4853,10 +4853,10 @@ namespace CalamityMod.Projectiles
public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier = 1f)
{
if (Main.player[Main.myPlayer].moonLeech)
if (Main.LocalPlayer.moonLeech)
return;
Main.player[Main.myPlayer].lifeSteal -= healAmount * cooldownMultiplier;
Main.LocalPlayer.lifeSteal -= healAmount * cooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = projectile.owner;
@@ -311,7 +311,7 @@ namespace CalamityMod.Projectiles.Damageable
if (!Main.mouseText)
{
Rectangle mouseRectangle = new Rectangle((int)(Main.mouseX + Main.screenPosition.X), (int)(Main.mouseY + Main.screenPosition.Y), 1, 1);
if (Main.player[Main.myPlayer].gravDir == -1f)
if (Main.LocalPlayer.gravDir == -1f)
{
mouseRectangle.Y = (int)Main.screenPosition.Y + Main.screenHeight - Main.mouseY;
}
+1 -1
View File
@@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Magic
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+2 -2
View File
@@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
@@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+2 -2
View File
@@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<RoyalHeal>(), BalancingConstants.LifeStealRange);
@@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<RoyalHeal>(), BalancingConstants.LifeStealRange);
@@ -230,7 +230,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<IridescentExcaliburHeal>(), BalancingConstants.LifeStealRange);
@@ -245,7 +245,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<IridescentExcaliburHeal>(), BalancingConstants.LifeStealRange);
+2 -2
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
@@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -284,7 +284,7 @@ namespace CalamityMod.Projectiles.Melee
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange);
+2 -2
View File
@@ -200,13 +200,13 @@ namespace CalamityMod.Projectiles.Ranged
int bonusHeal = Main.rand.NextBool(3) ? 5 : 3;
int heal = improvedHeal ? bonusHeal : 2;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
if (Main.LocalPlayer.lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
Main.player[Main.myPlayer].lifeSteal -= heal;
Main.LocalPlayer.lifeSteal -= heal;
player.HealPlayer(heal);
}
+1 -1
View File
@@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<TransfusionTrail>(), BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+3 -3
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (Projectile.Calamity().stealthStrike)
player.AddBuff(BuffID.Honey, 600);
SpawnProjectiles();
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
if (Projectile.Calamity().stealthStrike)
player.AddBuff(BuffID.Honey, 600);
SpawnProjectiles();
@@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue
return;
Projectile.ai[1] = 1f;
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
int fragAmt = 2;
for (int i = 0; i < fragAmt; i++)
{
+2 -2
View File
@@ -57,13 +57,13 @@ namespace CalamityMod.Projectiles.Rogue
{
int heal = Projectile.Calamity().stealthStrike ? 40 : 3;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
if (Main.LocalPlayer.lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
Main.player[Main.myPlayer].lifeSteal -= heal;
Main.LocalPlayer.lifeSteal -= heal;
Owner.HealPlayer(heal);
}
+2 -2
View File
@@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Rogue
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
@@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Rogue
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Summon
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center, Projectile.velocity, ModContent.ProjectileType<DraedonLaser>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center, Projectile.velocity, ModContent.ProjectileType<FireShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center, Projectile.velocity, ModContent.ProjectileType<IceShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center + new Vector2(3f, 0f), Projectile.velocity, ModContent.ProjectileType<LaserShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Turret
}
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
for (int i = -1; i < 2; i++)
Projectile.NewProjectile(source, Projectile.Center + new Vector2(3f, 0f), Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.035f, 0.11f) * i), ModContent.ProjectileType<OnyxShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center, Projectile.velocity, ModContent.ProjectileType<PlagueShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Turret
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
var source = Main.player[Main.myPlayer].GetSource_FromThis();
var source = Main.LocalPlayer.GetSource_FromThis();
Projectile.NewProjectile(source, Projectile.Center + new Vector2(3f, 0f), Projectile.velocity, ModContent.ProjectileType<WaterShot>(), Projectile.damage, Projectile.knockBack, Main.myPlayer);
Projectile.Kill();
}
+1 -1
View File
@@ -238,7 +238,7 @@ namespace CalamityMod.Projectiles.Typeless
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<FungalHeal>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
+1 -1
View File
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Typeless
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<RoyalHeal>(), BalancingConstants.LifeStealRange);
+1 -1
View File
@@ -215,7 +215,7 @@ namespace CalamityMod.Skies
{
float x = 0f;
if (SCalIndex != -1)
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.SCalIndex].Center);
x = Vector2.Distance(Main.LocalPlayer.Center, Main.npc[this.SCalIndex].Center);
float intensityFactor = BossRushEvent.BossRushActive ? -0.2f : 1f;
return (1f - Utils.SmoothStep(4500f, 9000f, x)) * intensityFactor;
+1 -1
View File
@@ -361,7 +361,7 @@ namespace CalamityMod
float playerDist = playerVector.Length();
if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y)
{
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
if (projectile.owner == Main.myPlayer && !Main.LocalPlayer.moonLeech)
{
int healAmt = healing;
player.HealPlayer(healAmt, HealTextType.Local);
+1 -1
View File
@@ -435,7 +435,7 @@ namespace CalamityMod
public static Rectangle FixSwingHitbox(float hitboxWidth, float hitboxHeight)
{
Player player = Main.player[Main.myPlayer];
Player player = Main.LocalPlayer;
Item item = player.ActiveItem();
float hitbox_X, hitbox_Y;
float mountOffsetY = player.mount.PlayerOffsetHitbox;
+2 -2
View File
@@ -443,8 +443,8 @@ namespace CalamityMod.World
NetMessage.SendTileSquare(-1, i, j, 40, TileChangeType.None);
if (CanAstralBiomeSpawn())
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(MeteorSound, Main.player[Main.myPlayer].position);
if (!Main.LocalPlayer.dead && Main.LocalPlayer.active)
SoundEngine.PlaySound(MeteorSound, Main.LocalPlayer.position);
// Immediately prior to mass-converting blocks to Astral, write down the Y position of this event.
YStart = j;