Merge branch 'master' into fixes-and-balancing
This commit is contained in:
commit
8942f997b1
17 files changed
+715
-182
No files matched your search
+578
-14
@@ -17,16 +17,24 @@ using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Abyss;
|
||||
using CalamityMod.NPCs.AcidRain;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using CalamityMod.NPCs.Calamitas;
|
||||
using CalamityMod.NPCs.Crags;
|
||||
using CalamityMod.NPCs.DevourerofGods;
|
||||
using CalamityMod.NPCs.GreatSandShark;
|
||||
using CalamityMod.NPCs.Leviathan;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.NPCs.PlaguebringerGoliath;
|
||||
using CalamityMod.NPCs.Polterghast;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.StormWeaver;
|
||||
using CalamityMod.NPCs.SulphurousSea;
|
||||
using CalamityMod.NPCs.SunkenSea;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -5752,17 +5760,17 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Modify Hit By NPC
|
||||
public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit)
|
||||
{
|
||||
int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2);
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
if (damage < bossRushDamage)
|
||||
damage = bossRushDamage;
|
||||
}
|
||||
#region Modify Hit By NPC
|
||||
public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit)
|
||||
{
|
||||
int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2);
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
if (damage < bossRushDamage)
|
||||
damage = bossRushDamage;
|
||||
}
|
||||
|
||||
if (areThereAnyDamnBosses && CalamityMod.bossVelocityDamageScaleValues.ContainsKey(npc.type))
|
||||
{
|
||||
@@ -5805,25 +5813,38 @@ namespace CalamityMod.CalPlayer
|
||||
player.AddBuff(ModContent.BuffType<FleshTotemCooldown>(), 1200, false); //20 seconds
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
if (tarragonCloak && !tarragonCloakCooldown && tarraMelee)
|
||||
{
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
if (bloodflareMelee && bloodflareFrenzy && !bloodFrenzyCooldown)
|
||||
{
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
if (silvaMelee && silvaCountdown <= 0 && hasSilvaEffect)
|
||||
{
|
||||
damage = (int)(damage * 0.8);
|
||||
}
|
||||
|
||||
if (aBulwarkRare)
|
||||
{
|
||||
aBulwarkRareMeleeBoostTimer += 3 * damage;
|
||||
if (aBulwarkRareMeleeBoostTimer > 900)
|
||||
aBulwarkRareMeleeBoostTimer = 900;
|
||||
}
|
||||
if (player.whoAmI == Main.myPlayer && gainRageCooldown <= 0)
|
||||
|
||||
if (Main.hardMode && Main.expertMode)
|
||||
{
|
||||
bool reduceChaosBallDamage = npc.type == NPCID.ChaosBall && !NPC.AnyNPCs(NPCID.GoblinSummoner);
|
||||
|
||||
if (reduceChaosBallDamage || npc.type == NPCID.BurningSphere || npc.type == NPCID.WaterSphere)
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
|
||||
if (player.whoAmI == Main.myPlayer && gainRageCooldown <= 0)
|
||||
{
|
||||
if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers && !npc.SpawnedFromStatue)
|
||||
{
|
||||
@@ -5873,37 +5894,90 @@ namespace CalamityMod.CalPlayer
|
||||
damage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Reduce projectile damage based on banner type
|
||||
// IMPORTANT NOTE: Rework this in 1.4!
|
||||
Point point = player.Center.ToTileCoordinates();
|
||||
int buffScanAreaWidth = (Main.maxScreenW + 800) / 16 - 1;
|
||||
int buffScanAreaHeight = (Main.maxScreenH + 800) / 16 - 1;
|
||||
Rectangle rectangle = CalamityUtils.ClampToWorld(tileRectangle: new Rectangle(point.X - buffScanAreaWidth / 2, point.Y - buffScanAreaHeight / 2, buffScanAreaWidth, buffScanAreaHeight));
|
||||
bool[] NPCBannerBuff = new bool[Main.MaxBannerTypes];
|
||||
bool hasBanner = false;
|
||||
|
||||
// Scan area around the player for banners
|
||||
for (int i = rectangle.Left; i < rectangle.Right; i++)
|
||||
{
|
||||
for (int j = rectangle.Top; j < rectangle.Bottom; j++)
|
||||
{
|
||||
if (!rectangle.Contains(i, j))
|
||||
continue;
|
||||
|
||||
Tile tile = Main.tile[i, j];
|
||||
if (tile == null || !tile.active())
|
||||
continue;
|
||||
|
||||
if (tile.type == TileID.Banners && (tile.frameX >= 396 || tile.frameY >= 54))
|
||||
{
|
||||
int bannerType = tile.frameX / 18 - 21;
|
||||
for (int k = tile.frameY; k >= 54; k -= 54)
|
||||
{
|
||||
bannerType += 90;
|
||||
bannerType += 21;
|
||||
}
|
||||
|
||||
int bannerItemType = Item.BannerToItem(bannerType);
|
||||
if (ItemID.Sets.BannerStrength[bannerItemType].Enabled)
|
||||
{
|
||||
NPCBannerBuff[bannerType] = true;
|
||||
hasBanner = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reduce damage
|
||||
if (hasBanner)
|
||||
{
|
||||
BannerProjectileDamageReduction(proj, ref damage, NPCBannerBuff);
|
||||
}
|
||||
|
||||
int bossRushDamage = (Main.expertMode ? 125 : 150) + (CalamityWorld.bossRushStage / 2);
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
if (damage < bossRushDamage)
|
||||
damage = bossRushDamage;
|
||||
}
|
||||
|
||||
if (projRefRare)
|
||||
{
|
||||
if (proj.type == projTypeJustHitBy)
|
||||
damage = (int)(damage * 0.85);
|
||||
}
|
||||
|
||||
if (aSparkRare)
|
||||
{
|
||||
if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType<LightningMark>() ||
|
||||
proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet)
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
if (proj.type == ProjectileID.Nail)
|
||||
{
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
|
||||
if (beeResist)
|
||||
{
|
||||
if (CalamityMod.beeProjectileList.Contains(proj.type))
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
|
||||
if (Main.hardMode && Main.expertMode && !CalamityWorld.spawnedHardBoss && proj.active && !proj.friendly && proj.hostile && damage > 0)
|
||||
{
|
||||
if (CalamityMod.hardModeNerfList.Contains(proj.type))
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
|
||||
if (CalamityWorld.revenge)
|
||||
{
|
||||
double damageMultiplier = 1D;
|
||||
@@ -5971,10 +6045,500 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region On Hit
|
||||
public override void OnHitByNPC(NPC npc, int damage, bool crit)
|
||||
#region Banner Projectile Damage Reduction
|
||||
private void BannerProjectileDamageReduction(Projectile proj, ref int damage, bool[] NPCBannerBuffs)
|
||||
{
|
||||
bool? reduceDamage = null;
|
||||
double bannerDamageMultiplier = Main.expertMode ? 0.5 : 0.75;
|
||||
|
||||
for (int l = 0; l < Main.MaxBannerTypes; l++)
|
||||
{
|
||||
int bannerNPCType = Item.BannerToNPC(l);
|
||||
if (bannerNPCType != 0 && NPCBannerBuffs[l])
|
||||
{
|
||||
if (proj.type == ModContent.ProjectileType<BelchingCoralSpike>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<BelchingCoral>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<CrabBoulder>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<AnthozoanCrab>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<EarthRockBig>() || proj.type == ModContent.ProjectileType<EarthRockSmall>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Horse>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<FlakAcid>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<FlakCrab>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<FlameBurstHostile>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ImpiousImmolator>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<GammaAcid>() || proj.type == ModContent.ProjectileType<GammaBeam>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<GammaSlime>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<HorsWaterBlast>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Cnidrion>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<Projectiles.Enemy.InkBomb>() || proj.type == ModContent.ProjectileType<InkPoisonCloud>() || proj.type == ModContent.ProjectileType<InkPoisonCloud2>() || proj.type == ModContent.ProjectileType<InkPoisonCloud3>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ColossalSquid>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<MantisRing>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Mantis>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<NuclearToadGoo>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<NuclearToad>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<OrthoceraStream>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Orthocera>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<PearlBurst>() || proj.type == ModContent.ProjectileType<PearlRain>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<GiantClam>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<PufferExplosion>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ChaoticPuffer>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<StormMarkHostile>() || proj.type == ModContent.ProjectileType<TornadoHostile>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ThiccWaifu>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<SulphuricAcidBubble>() || proj.type == ModContent.ProjectileType<SulphuricAcidMist>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Mauler>() || (bannerNPCType == ModContent.NPCType<Flounder>() && proj.type == ModContent.ProjectileType<SulphuricAcidMist>()))
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<ToxicMinnowCloud>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ToxicMinnow>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<TrilobiteSpike>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Trilobite>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<BrimstoneLaser>() || proj.type == ModContent.ProjectileType<BrimstoneLaserSplit>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<SoulSlurper>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<Calamitas>()) && !NPC.AnyNPCs(ModContent.NPCType<CalamitasRun3>());
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<GreatSandBlast>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<GreatSandShark>())
|
||||
reduceDamage = true;
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<PhantomGhostShot>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<PhantomSpiritL>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<Polterghast>());
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<PlagueStingerGoliathV2>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<PlaguedJungleSlime>() || bannerNPCType == ModContent.NPCType<PlaguebringerShade>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<PlaguebringerGoliath>());
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<HiveBombGoliath>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<PlaguebringerShade>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<PlaguebringerGoliath>());
|
||||
}
|
||||
else if (proj.type == ModContent.ProjectileType<HolyBomb>() || proj.type == ModContent.ProjectileType<HolyFlare>())
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ProfanedEnergyBody>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<Providence>());
|
||||
}
|
||||
else if (proj.type == ProjectileID.EyeBeam)
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<Laserfish>())
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.Golem);
|
||||
}
|
||||
else if (proj.type == ProjectileID.CultistBossIceMist || proj.type == ProjectileID.CultistBossLightningOrbArc)
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<EidolonWyrmHead>() || bannerNPCType == ModContent.NPCType<Eidolist>())
|
||||
reduceDamage = !NPC.AnyNPCs(ModContent.NPCType<StormWeaverHead>()) && !NPC.AnyNPCs(ModContent.NPCType<StormWeaverHeadNaked>()) && !NPC.AnyNPCs(NPCID.CultistBoss);
|
||||
}
|
||||
else if (proj.type == ProjectileID.SaucerScrap)
|
||||
{
|
||||
if (bannerNPCType == ModContent.NPCType<ArmoredDiggerHead>())
|
||||
reduceDamage = Main.invasionType != InvasionID.MartianMadness;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (proj.type)
|
||||
{
|
||||
case ProjectileID.Stinger:
|
||||
if (CalamityMod.hornetList.Contains(bannerNPCType) || CalamityMod.mossHornetList.Contains(bannerNPCType))
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.QueenBee);
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.PinkLaser:
|
||||
if (bannerNPCType == NPCID.Gastropod || bannerNPCType == ModContent.NPCType<AstralProbe>())
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.TheDestroyer) && !NPC.AnyNPCs(ModContent.NPCType<LifeSeeker>()) && !NPC.AnyNPCs(ModContent.NPCType<StormWeaverHead>()) && !NPC.AnyNPCs(ModContent.NPCType<StormWeaverHeadNaked>());
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.SandBallFalling:
|
||||
if (bannerNPCType == NPCID.Antlion)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.DemonSickle:
|
||||
if (bannerNPCType == NPCID.Demon || bannerNPCType == NPCID.VoodooDemon)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.HarpyFeather:
|
||||
if (bannerNPCType == NPCID.Harpy)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.JavelinHostile:
|
||||
if (bannerNPCType == NPCID.GreekSkeleton)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.IceSpike:
|
||||
if (bannerNPCType == NPCID.SpikedIceSlime)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.JungleSpike:
|
||||
if (bannerNPCType == NPCID.SpikedJungleSlime)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.WebSpit:
|
||||
if (bannerNPCType == NPCID.BlackRecluse || bannerNPCType == NPCID.BlackRecluseWall)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.CursedFlameHostile:
|
||||
if (bannerNPCType == NPCID.Clinger)
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.Spazmatism);
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.DesertDjinnCurse:
|
||||
if (bannerNPCType == NPCID.DesertDjinn)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.InfernoHostileBlast:
|
||||
case ProjectileID.InfernoHostileBolt:
|
||||
if (bannerNPCType == NPCID.DiabolistRed || bannerNPCType == NPCID.DiabolistWhite)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.Shadowflames:
|
||||
if (bannerNPCType == NPCID.GiantCursedSkull)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.FrostBlastHostile:
|
||||
if (bannerNPCType == NPCID.IceElemental || bannerNPCType == ModContent.NPCType<IceClasper>())
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.IcewaterSpit:
|
||||
if (bannerNPCType == NPCID.IcyMerman)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.GoldenShowerHostile:
|
||||
if (bannerNPCType == NPCID.IchorSticker)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.ShadowBeamHostile:
|
||||
if (bannerNPCType == NPCID.Necromancer || bannerNPCType == NPCID.NecromancerArmored)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.PaladinsHammerHostile:
|
||||
if (bannerNPCType == NPCID.Paladin)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.LostSoulHostile:
|
||||
if (bannerNPCType == NPCID.RaggedCaster || bannerNPCType == NPCID.RaggedCasterOpenCoat)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.UnholyTridentHostile:
|
||||
if (bannerNPCType == NPCID.RedDevil)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.RuneBlast:
|
||||
if (bannerNPCType == NPCID.RuneWizard)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.FlamingArrow:
|
||||
if (bannerNPCType == NPCID.SkeletonArcher || bannerNPCType == NPCID.PirateCrossbower || bannerNPCType == NPCID.GoblinArcher || bannerNPCType == NPCID.ElfArcher)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.RocketSkeleton:
|
||||
if (bannerNPCType == NPCID.SkeletonCommando)
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.SkeletronPrime) || !CalamityWorld.revenge;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.SniperBullet:
|
||||
if (bannerNPCType == NPCID.SkeletonSniper)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.BulletDeadeye:
|
||||
if (bannerNPCType == NPCID.TacticalSkeleton || bannerNPCType == NPCID.SnowmanGangsta || bannerNPCType == NPCID.PirateCaptain || bannerNPCType == NPCID.PirateDeadeye || bannerNPCType == NPCID.ElfCopter)
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.SantaNK1);
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.RainNimbus:
|
||||
if (bannerNPCType == NPCID.AngryNimbus)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.FrostBeam:
|
||||
if (bannerNPCType == NPCID.IceGolem)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.SandnadoHostile:
|
||||
case ProjectileID.SandnadoHostileMark:
|
||||
if (bannerNPCType == NPCID.SandElemental)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.SnowBallHostile:
|
||||
if (bannerNPCType == NPCID.SnowBalla)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.CannonballHostile:
|
||||
if (bannerNPCType == NPCID.PirateCaptain)
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.PirateShip);
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.DrManFlyFlask:
|
||||
if (bannerNPCType == NPCID.DrManFly)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.EyeLaser:
|
||||
if (bannerNPCType == NPCID.Eyezor)
|
||||
{
|
||||
reduceDamage = !NPC.AnyNPCs(NPCID.Retinazer);
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.Nail:
|
||||
if (bannerNPCType == NPCID.Nailhead)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.NebulaSphere:
|
||||
if (bannerNPCType == NPCID.NebulaBeast)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.NebulaLaser:
|
||||
if (bannerNPCType == NPCID.NebulaBrain)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.NebulaBolt:
|
||||
if (bannerNPCType == NPCID.NebulaSoldier)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.StardustJellyfishSmall:
|
||||
if (bannerNPCType == NPCID.StardustJellyfishBig)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.StardustSoldierLaser:
|
||||
if (bannerNPCType == NPCID.StardustSoldier)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.VortexAcid:
|
||||
if (bannerNPCType == NPCID.VortexHornetQueen)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.VortexLaser:
|
||||
if (bannerNPCType == NPCID.VortexRifleman)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.VortexLightning:
|
||||
if (bannerNPCType == NPCID.VortexSoldier)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.RayGunnerLaser:
|
||||
if (bannerNPCType == NPCID.RayGunner)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.BrainScramblerBolt:
|
||||
if (bannerNPCType == NPCID.BrainScrambler)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.MartianWalkerLaser:
|
||||
if (bannerNPCType == NPCID.MartianWalker)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.ScutlixLaser:
|
||||
if (bannerNPCType == NPCID.Scutlix)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.MartianTurretBolt:
|
||||
if ((bannerNPCType == NPCID.MartianTurret && Main.invasionType == InvasionID.MartianMadness) || (bannerNPCType == ModContent.NPCType<ShockstormShuttle>() && Main.invasionType != InvasionID.MartianMadness))
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ProjectileID.SaucerLaser:
|
||||
if (bannerNPCType == ModContent.NPCType<ShockstormShuttle>() && Main.invasionType != InvasionID.MartianMadness)
|
||||
{
|
||||
reduceDamage = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (reduceDamage.HasValue)
|
||||
{
|
||||
if (reduceDamage.Value)
|
||||
damage = (int)(damage * bannerDamageMultiplier);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region On Hit
|
||||
public override void OnHitByNPC(NPC npc, int damage, bool crit)
|
||||
{
|
||||
if (sulfurSet)
|
||||
npc.AddBuff(BuffID.Poisoned, 120);
|
||||
|
||||
@@ -155,9 +155,10 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Life Steal nerf
|
||||
if (player.lifeSteal > (CalamityWorld.death ? 50f : 60f))
|
||||
player.lifeSteal = CalamityWorld.death ? 50f : 60f;
|
||||
// Adjusts the life steal cap in rev/death
|
||||
float lifeStealCap = CalamityWorld.death ? 50f : 60f;
|
||||
if (player.lifeSteal > lifeStealCap)
|
||||
player.lifeSteal = lifeStealCap;
|
||||
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
@@ -367,6 +368,14 @@ namespace CalamityMod.CalPlayer
|
||||
(modPlayer.cShard ? 50 : 0) +
|
||||
(modPlayer.starBeamRye ? 50 : 0);
|
||||
|
||||
// Life Steal nerf
|
||||
// Reduces normal mode life steal recovery rate from 0.6/s to 0.5/s
|
||||
// Reduces expert mode life steal recovery rate from 0.5/s to 0.35/s
|
||||
// Revengeance mode recovery rate is 0.3/s
|
||||
// Death mode recovery rate is 0.25/s
|
||||
float lifeStealCooldown = CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f;
|
||||
player.lifeSteal -= lifeStealCooldown;
|
||||
|
||||
// Nebula Armor nerf
|
||||
if (player.nebulaLevelMana > 0 && player.statMana < player.statManaMax2)
|
||||
{
|
||||
|
||||
+16
-4
@@ -2423,7 +2423,19 @@ namespace CalamityMod
|
||||
|
||||
hornetList = new List<int>()
|
||||
{
|
||||
NPCID.Hornet,
|
||||
NPCID.BigHornetStingy,
|
||||
NPCID.LittleHornetStingy,
|
||||
NPCID.BigHornetSpikey,
|
||||
NPCID.LittleHornetSpikey,
|
||||
NPCID.BigHornetLeafy,
|
||||
NPCID.LittleHornetLeafy,
|
||||
NPCID.BigHornetHoney,
|
||||
NPCID.LittleHornetHoney,
|
||||
NPCID.BigHornetFatty,
|
||||
NPCID.LittleHornetFatty,
|
||||
NPCID.BigStinger,
|
||||
NPCID.LittleStinger,
|
||||
NPCID.Hornet,
|
||||
NPCID.HornetFatty,
|
||||
NPCID.HornetHoney,
|
||||
NPCID.HornetLeafy,
|
||||
@@ -2777,9 +2789,9 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<Leviathan>(), 10800 },
|
||||
{ ModContent.NPCType<Siren>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumAureus>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), 5400 },
|
||||
{ ModContent.NPCType<AstrumDeusBodySpectral>(), 5400 },
|
||||
{ ModContent.NPCType<AstrumDeusTailSpectral>(), 5400 },
|
||||
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusBodySpectral>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusTailSpectral>(), 7200 },
|
||||
{ ModContent.NPCType<PlaguebringerGoliath>(), 10800 },
|
||||
{ ModContent.NPCType<RavagerBody>(), 10800 },
|
||||
{ ModContent.NPCType<ProfanedGuardianBoss>(), 5400 },
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
position = Main.MouseWorld;
|
||||
speedX = 0;
|
||||
speedY = 0;
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 120f, 0f);
|
||||
player.UpdateMaxTurrets();
|
||||
}
|
||||
return false;
|
||||
|
||||
+23
-22
@@ -2734,6 +2734,12 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool enraged = calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive);
|
||||
|
||||
// Deus cannot hit for 3 seconds
|
||||
if (calamityGlobalNPC.newAI[1] < 180f)
|
||||
npc.damage = 0;
|
||||
else
|
||||
npc.damage = npc.defDamage;
|
||||
|
||||
// 8 seconds of reistance to prevent spawn killing
|
||||
if (calamityGlobalNPC.newAI[1] < 480f)
|
||||
calamityGlobalNPC.newAI[1] += 1f;
|
||||
@@ -2756,6 +2762,13 @@ namespace CalamityMod.NPCs
|
||||
bool phase4 = lifeRatio < 0.5f && doubleWormPhase && expertMode;
|
||||
bool phase5 = lifeRatio < 0.2f && doubleWormPhase && expertMode;
|
||||
|
||||
// Set timed DR
|
||||
if (!doubleWormPhase)
|
||||
{
|
||||
if (calamityGlobalNPC.AITimer < 3600)
|
||||
calamityGlobalNPC.AITimer = 3600;
|
||||
}
|
||||
|
||||
// Flight timer
|
||||
float aiSwitchTimer = doubleWormPhase ? 1200f : 1800f;
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
@@ -3024,22 +3037,21 @@ namespace CalamityMod.NPCs
|
||||
fallSpeed += fallSpeedBoost;
|
||||
|
||||
// Speed and movement
|
||||
float speedBoost = death ? (targetFloatingUp ? 0.2f : 0.1f) : ((targetFloatingUp ? 0.2f : 0.1f) * (1f - lifeRatio));
|
||||
float turnSpeedBoost = death ? (targetFloatingUp ? 0.3f : 0.15f) : ((targetFloatingUp ? 0.3f : 0.15f) * (1f - lifeRatio));
|
||||
float speed = 0.1f + speedBoost;
|
||||
float turnSpeed = 0.15f + turnSpeedBoost;
|
||||
float speedBoost = death ? (targetFloatingUp ? 0.26f : 0.13f) : ((targetFloatingUp ? 0.26f : 0.13f) * (1f - lifeRatio));
|
||||
float turnSpeedBoost = death ? (targetFloatingUp ? 0.4f : 0.2f) : ((targetFloatingUp ? 0.4f : 0.2f) * (1f - lifeRatio));
|
||||
float speed = 0.13f + speedBoost;
|
||||
float turnSpeed = 0.2f + turnSpeedBoost;
|
||||
|
||||
if (flyAtTarget)
|
||||
{
|
||||
float speedMultiplier = phase5 ? 1.3f : phase4 ? 1.15f : 1f;
|
||||
float speedMultiplier = phase5 ? 2f : phase4 ? 1.75f : 1.5f;
|
||||
speed *= speedMultiplier;
|
||||
turnSpeed *= speedMultiplier;
|
||||
}
|
||||
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
speed *= 1.5f;
|
||||
turnSpeed *= 1.5f;
|
||||
speed *= 1.25f;
|
||||
turnSpeed *= 1.25f;
|
||||
}
|
||||
|
||||
Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
@@ -3085,18 +3097,6 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.soundDelay == 0)
|
||||
{
|
||||
float num24 = num22 / 40f;
|
||||
if (num24 < 10f)
|
||||
num24 = 10f;
|
||||
if (num24 > 20f)
|
||||
num24 = 20f;
|
||||
|
||||
npc.soundDelay = (int)num24;
|
||||
Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f);
|
||||
}
|
||||
|
||||
num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21);
|
||||
float num25 = Math.Abs(num20);
|
||||
float num26 = Math.Abs(num21);
|
||||
@@ -3249,8 +3249,9 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Vector2.Distance(player.Center, npc.Center) > 80f)
|
||||
if (Vector2.Distance(player.Center, npc.Center) > 80f)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item12, npc.Center);
|
||||
float num941 = revenge ? 14f : 13f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -3275,7 +3276,7 @@ namespace CalamityMod.NPCs
|
||||
int num946 = ModContent.ProjectileType<AstralShot2>();
|
||||
vector104.X += num942 * 5f;
|
||||
vector104.Y += num943 * 5f;
|
||||
Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, player.Center.X, player.Center.Y);
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4710,16 +4710,14 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (flyAtTarget)
|
||||
{
|
||||
float speedMultiplier = phase5 ? 1.3f : phase4 ? 1.15f : 1f;
|
||||
float speedMultiplier = phase5 ? 2f : phase4 ? 1.75f : 1.5f;
|
||||
speed *= speedMultiplier;
|
||||
turnSpeed *= speedMultiplier;
|
||||
fallSpeed *= speedMultiplier;
|
||||
}
|
||||
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
speed *= 1.5f;
|
||||
turnSpeed *= 1.5f;
|
||||
speed *= 1.25f;
|
||||
turnSpeed *= 1.25f;
|
||||
}
|
||||
|
||||
Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
|
||||
@@ -3554,7 +3554,8 @@ namespace CalamityMod.NPCs
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
/*if (projectile.type == ProjectileType<PlaguenadeBee>() || projectile.type == ProjectileType<PlaguenadeProj>() || projectile.type == ProjectileType<RainbowBoom>() || projectile.type == ProjectileType<RainBolt>() || projectile.type == ProjectileType<AtlantisSpear2>() || ProjectileID.Sets.StardustDragon[projectile.type])
|
||||
// Old resists
|
||||
/*if (projectile.type == ProjectileType<AtlantisSpear2>())
|
||||
{
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
@@ -3562,22 +3563,28 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType<MalachiteBolt>() || projectile.type == ProjectileType<SakuraBullet>() || projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileID.DD2BetsyArrow)
|
||||
else if (projectile.type == player.beeType() || projectile.type == ProjectileType<MalachiteBolt>())
|
||||
{
|
||||
damage = (int)(damage * 0.4);
|
||||
}*/
|
||||
|
||||
// New resists
|
||||
if (projectile.type == ProjectileType<RainbowBoom>() || projectile.type == ProjectileType<RainBolt>())
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType<PlaguenadeBee>() || projectile.type == ProjectileType<PlaguenadeProj>() || projectile.type == ProjectileID.Electrosphere)
|
||||
{
|
||||
damage = (int)(damage * 0.4);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SpikecragSpike>() || projectile.type == ProjectileType<SolarBeam2>())
|
||||
else if (projectile.type == ProjectileType<SpikecragSpike>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<CosmicTentacle>() || projectile.type == ProjectileType<BrimstoneTentacle>())
|
||||
else if (projectile.type == ProjectileType<SolarBeam2>() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType<SakuraBullet>() || projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileType<ForbiddenSunburst>() || projectile.type == ProjectileType<IceCluster>() || projectile.type == ProjectileID.ChargedBlasterLaser)
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<BigNuke>())
|
||||
{
|
||||
damage = (int)(damage * 0.85);
|
||||
}*/
|
||||
}
|
||||
else if (StormWeaverIDs.Contains(npc.type))
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
num6 *= num8;
|
||||
num7 *= num8;
|
||||
int num9 = 30;
|
||||
int num10 = 450;
|
||||
int num10 = ProjectileID.SaucerScrap;
|
||||
vector.X += num6 * 5f;
|
||||
vector.Y += num7 * 5f;
|
||||
Projectile.NewProjectile(vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f);
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
num8 = 25;
|
||||
}
|
||||
int num9 = 128;
|
||||
int num9 = ProjectileID.FrostBlastHostile;
|
||||
int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[beam].timeLeft = 300;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
npc.height = 198;
|
||||
npc.defense = 40;
|
||||
npc.DR_NERD(0.4f);
|
||||
npc.LifeMaxNERB(67500, 88800, 3700000);
|
||||
npc.LifeMaxNERB(81000, 106500, 3700000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.height = 10;
|
||||
projectile.hostile = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 600;
|
||||
@@ -30,6 +31,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]);
|
||||
if (Vector2.Distance(targetLocation, projectile.Center) < 80f)
|
||||
projectile.tileCollide = true;
|
||||
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 4)
|
||||
{
|
||||
@@ -40,11 +45,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.frame = 0;
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12);
|
||||
}
|
||||
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 25;
|
||||
@@ -53,7 +54,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
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) + 1.57f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
|
||||
@@ -44,12 +44,38 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.ai[1] = 1f;
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33);
|
||||
}
|
||||
int num8 = Main.expertMode ? 45 : 60;
|
||||
if (projectile.timeLeft == 935)
|
||||
projectile.damage = num8;
|
||||
|
||||
if (projectile.timeLeft < 85)
|
||||
projectile.damage = 0;
|
||||
}
|
||||
|
||||
if (projectile.timeLeft < 930)
|
||||
return;
|
||||
|
||||
float velocity = 0.1f;
|
||||
for (int i = 0; i < Main.maxProjectiles; i++)
|
||||
{
|
||||
if (Main.projectile[i].active)
|
||||
{
|
||||
if (i != projectile.whoAmI && Main.projectile[i].type == projectile.type)
|
||||
{
|
||||
if (Vector2.Distance(projectile.Center, Main.projectile[i].Center) < 48f)
|
||||
{
|
||||
if (projectile.position.X < Main.projectile[i].position.X)
|
||||
projectile.velocity.X -= velocity;
|
||||
else
|
||||
projectile.velocity.X += velocity;
|
||||
|
||||
if (projectile.position.Y < Main.projectile[i].position.Y)
|
||||
projectile.velocity.Y -= velocity;
|
||||
else
|
||||
projectile.velocity.Y += velocity;
|
||||
}
|
||||
else
|
||||
projectile.velocity = Vector2.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target)
|
||||
{
|
||||
|
||||
@@ -1149,6 +1149,8 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType<SuperDummyNPC>() && !player.moonLeech)
|
||||
{
|
||||
// Commented out for now to test the global life steal nerf
|
||||
/*
|
||||
// Increases the degree to which Spectre Healing set contributes to the lifesteal cap
|
||||
if (player.ghostHeal)
|
||||
{
|
||||
@@ -1170,6 +1172,7 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
Main.player[Main.myPlayer].lifeSteal -= num;
|
||||
}
|
||||
*/
|
||||
|
||||
if (modPlayer.vampiricTalisman && rogue && crit)
|
||||
{
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Projectiles.Enemy
|
||||
{
|
||||
public class AstralShot : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Laser");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 5;
|
||||
projectile.height = 5;
|
||||
projectile.hostile = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = 90;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.2f / 255f);
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12);
|
||||
}
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 25;
|
||||
}
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
float num55 = 30f;
|
||||
float num56 = 1f;
|
||||
if (projectile.ai[1] == 0f)
|
||||
{
|
||||
projectile.localAI[0] += num56;
|
||||
if (projectile.localAI[0] > num55)
|
||||
{
|
||||
projectile.localAI[0] = num55;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.localAI[0] -= num56;
|
||||
if (projectile.localAI[0] <= 0f)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(255, 100, 255, 0);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0));
|
||||
int num147 = 0;
|
||||
int num148 = 0;
|
||||
float num149 = (float)(Main.projectileTexture[projectile.type].Width - projectile.width) * 0.5f + (float)projectile.width * 0.5f;
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (projectile.spriteDirection == -1)
|
||||
{
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Rectangle value6 = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 500, Main.screenWidth + 1000, Main.screenHeight + 1000);
|
||||
if (projectile.getRect().Intersects(value6))
|
||||
{
|
||||
Vector2 value7 = new Vector2(projectile.position.X - Main.screenPosition.X + num149 + (float)num148, projectile.position.Y - Main.screenPosition.Y + (float)(projectile.height / 2) + projectile.gfxOffY);
|
||||
float num162 = 30f;
|
||||
float scaleFactor = 1f;
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
num162 = (float)(int)projectile.localAI[0];
|
||||
}
|
||||
for (int num163 = 1; num163 <= (int)projectile.localAI[0]; num163++)
|
||||
{
|
||||
Vector2 value8 = Vector2.Normalize(projectile.velocity) * (float)num163 * scaleFactor;
|
||||
Color color29 = projectile.GetAlpha(color25);
|
||||
color29 *= (num162 - (float)num163) / num162;
|
||||
color29.A = 0;
|
||||
Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], value7 - value8, null, color29, projectile.rotation, new Vector2(num149, (float)(projectile.height / 2 + num147)), projectile.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 153 B |
@@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage();
|
||||
@@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue)
|
||||
{
|
||||
int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
int damage2 = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue *
|
||||
player.MinionDamage());
|
||||
projectile.damage = damage2;
|
||||
@@ -52,13 +53,19 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
projectile.frame = 0;
|
||||
}
|
||||
projectile.velocity.Y += 0.5f;
|
||||
|
||||
projectile.velocity.Y += 0.5f;
|
||||
if (projectile.velocity.Y > 10f)
|
||||
{
|
||||
projectile.velocity.Y = 10f;
|
||||
}
|
||||
|
||||
if (projectile.ai[0] > 0f)
|
||||
{
|
||||
projectile.ai[0] -= 1f;
|
||||
return;
|
||||
}
|
||||
|
||||
float maxDistance = 1000f;
|
||||
bool homeIn = false;
|
||||
|
||||
@@ -74,13 +81,9 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
}
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer && homeIn)
|
||||
|
||||
if (projectile.owner == Main.myPlayer && homeIn)
|
||||
{
|
||||
if (projectile.ai[0] != 0f)
|
||||
{
|
||||
projectile.ai[0] -= 1f;
|
||||
return;
|
||||
}
|
||||
projectile.ai[1] += 1f;
|
||||
if ((projectile.ai[1] % 10f) == 0f)
|
||||
{
|
||||
@@ -89,7 +92,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
float velocityX = Main.rand.NextFloat(-10f, 10f);
|
||||
float velocityY = Main.rand.NextFloat(-15f, -8f);
|
||||
Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocityX, velocityY, ModContent.ProjectileType<SpikecragSpike>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), velocityX, velocityY, ModContent.ProjectileType<SpikecragSpike>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3135,6 +3135,16 @@ namespace CalamityMod
|
||||
}
|
||||
return (t - from) / (to - from);
|
||||
}
|
||||
|
||||
// REMOVE THIS IN CALAMITY 1.4, it's a 1.4 World.cs function
|
||||
public static Rectangle ClampToWorld(Rectangle tileRectangle)
|
||||
{
|
||||
int num = Math.Max(0, Math.Min(tileRectangle.Left, Main.maxTilesX));
|
||||
int num2 = Math.Max(0, Math.Min(tileRectangle.Top, Main.maxTilesY));
|
||||
int num3 = Math.Max(0, Math.Min(tileRectangle.Right, Main.maxTilesX));
|
||||
int num4 = Math.Max(0, Math.Min(tileRectangle.Bottom, Main.maxTilesY));
|
||||
return new Rectangle(num, num2, num3 - num, num4 - num2);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user