This commit is contained in:
termigator1359 committed 2019-11-18 20:41:51 -05:00
commit 697930b1b4
24 files changed
+1439 -533

No files matched your search

+224 -207
View File
@@ -75,9 +75,25 @@ namespace CalamityMod.CalPlayer
public int sCalDeathCount = 0;
public int sCalKillCount = 0;
public int deathCount = 0;
public double radiation = 0;
public int actualMaxLife = 0;
public bool killSpikyBalls = false;
// Stat Meter
public int[] damageStats = new int[5];
public int[] critStats = new int[4];
public int defenseStat = 0;
public int DRStat = 0;
public int meleeSpeedStat = 0;
public int manaCostStat = 0;
public int rogueVelocityStat = 0;
public int minionSlotStat = 0;
public int lifeRegenStat = 0;
public int manaRegenStat = 0;
public int armorPenetrationStat = 0;
public int wingFlightTimeStat = 0;
public int adrenalineChargeStat = 0;
public int rageDamageStat = 0;
// Timer and Counter
public int bossRushImmunityFrameCurseTimer = 0;
public int aBulwarkRareMeleeBoostTimer = 0;
@@ -709,7 +725,6 @@ namespace CalamityMod.CalPlayer
{ "rogueLevel", rogueLevel },
{ "exactRogueLevel", exactRogueLevel },
{ "deathCount", deathCount },
{ "radiation", radiation },
{ "moneyStolenByBandit", moneyStolenByBandit },
{ "reforges", reforges }
};
@@ -743,7 +758,6 @@ namespace CalamityMod.CalPlayer
deathCount = tag.GetInt("deathCount");
moneyStolenByBandit = tag.GetInt("moneyStolenByBandit");
reforges = tag.GetInt("reforges");
radiation = tag.GetDouble("radiation");
meleeLevel = tag.GetInt("meleeLevel");
rangedLevel = tag.GetInt("rangedLevel");
@@ -767,7 +781,6 @@ namespace CalamityMod.CalPlayer
deathCount = reader.ReadInt32();
moneyStolenByBandit = reader.ReadInt32();
reforges = reader.ReadInt32();
radiation = reader.ReadDouble();
meleeLevel = reader.ReadInt32();
rangedLevel = reader.ReadInt32();
@@ -2602,9 +2615,9 @@ namespace CalamityMod.CalPlayer
}*/
if (CalamityWorld.revenge)
{
if (player.lifeSteal > (CalamityWorld.death ? 30f : 40f))
if (player.lifeSteal > (CalamityWorld.death ? 50f : 60f))
{
player.lifeSteal = CalamityWorld.death ? 30f : 40f;
player.lifeSteal = CalamityWorld.death ? 50f : 60f;
}
if (player.whoAmI == Main.myPlayer)
{
@@ -2799,14 +2812,13 @@ namespace CalamityMod.CalPlayer
packetTimer = 0;
StressPacket(false);
AdrenalinePacket(false);
RadiationPacket(false);
/*if (areThereAnyDamnBosses)
DistanceFromBossPacket(false);*/
}
}
#endregion
#region StressTiedEffects
#region STRESSNOLONGEREXISTSYOUSEXUALDINOSAUR
if (stressPills)
{
player.statDefense += 8;
@@ -2837,7 +2849,6 @@ namespace CalamityMod.CalPlayer
}
if (affliction || afflicted)
{
player.lifeRegen += 1;
player.endurance += 0.07f;
player.statDefense += 20;
player.allDamage += 0.12f;
@@ -3101,18 +3112,6 @@ namespace CalamityMod.CalPlayer
if (player.breath > 0)
player.breath -= 3;
}
if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
{
if (player.statLife > 100)
{
if (player.lifeRegen > 0)
{
player.lifeRegen = 0;
}
player.lifeRegenTime = 0;
player.lifeRegen -= 160;
}
}
if (abyssBreathCD >= tick)
{
abyssBreathCD = 0;
@@ -3454,7 +3453,6 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.05f;
if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0)
{
player.lifeRegen += 2;
player.manaRegenBonus += 2;
}
if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
@@ -3491,16 +3489,6 @@ namespace CalamityMod.CalPlayer
player.buffImmune[46] = true;
player.buffImmune[44] = true;
player.buffImmune[20] = true;
if (!player.honey && player.lifeRegen < 0)
{
player.lifeRegen += 2;
if (player.lifeRegen > 0)
{
player.lifeRegen = 0;
}
}
player.lifeRegenTime += 1;
player.lifeRegen += 2;
}
else if (cFreeze)
{
@@ -3541,24 +3529,6 @@ namespace CalamityMod.CalPlayer
}
}
}
if (ursaSergeant)
{
if (player.statLife <= (int)((double)player.statLifeMax2 * 0.15))
{
player.lifeRegen += 3;
player.lifeRegenTime += 3;
}
else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.25))
{
player.lifeRegen += 2;
player.lifeRegenTime += 2;
}
else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5))
{
player.lifeRegen += 1;
player.lifeRegenTime += 1;
}
}
if (invincible || lol)
{
player.thorns = 0f;
@@ -3571,8 +3541,6 @@ namespace CalamityMod.CalPlayer
}
if (polarisBoost)
{
player.lifeRegen += 1;
player.lifeRegenTime += 1;
player.endurance += 0.01f;
player.statDefense += 2;
}
@@ -3597,8 +3565,6 @@ namespace CalamityMod.CalPlayer
if (projRefRareLifeRegenCounter > 0)
{
projRefRareLifeRegenCounter--;
player.lifeRegenTime += 2;
player.lifeRegen += 2;
}
if (desertScourgeLore)
{
@@ -4180,11 +4146,7 @@ namespace CalamityMod.CalPlayer
player.allDamage += 0.12f;
player.minionKB += 1.2f;
player.pickSpeed -= 0.15f;
if (Main.dayTime)
{
player.lifeRegen += 3;
}
else
if (!Main.dayTime)
{
player.statDefense += 30;
}
@@ -4199,66 +4161,43 @@ namespace CalamityMod.CalPlayer
}
if (fabsolVodka)
{
alcoholPoisonLevel++;
player.allDamage += 0.08f;
player.statDefense -= 20;
}
if (vodka)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.statDefense -= 4;
player.allDamage += 0.06f;
AllCritBoost(2);
}
if (redWine)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (grapeBeer)
{
alcoholPoisonLevel++;
player.statDefense -= 2;
player.moveSpeed -= 0.05f;
}
if (moonshine)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.statDefense += 10;
player.endurance += 0.05f;
}
if (rum)
{
alcoholPoisonLevel++;
player.lifeRegen += 2;
player.moveSpeed += 0.1f;
player.statDefense -= 8;
}
if (fireball)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (whiskey)
{
alcoholPoisonLevel++;
player.statDefense -= 8;
player.allDamage += 0.04f;
AllCritBoost(2);
}
if (everclear)
{
alcoholPoisonLevel += 2;
player.lifeRegen -= 10;
player.statDefense -= 40;
player.allDamage += 0.25f;
}
if (bloodyMary)
{
alcoholPoisonLevel++;
player.lifeRegen -= 2;
if (Main.bloodMoon)
{
player.statDefense -= 6;
@@ -4269,8 +4208,6 @@ namespace CalamityMod.CalPlayer
}
if (tequila)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
if (Main.dayTime)
{
player.statDefense += 5;
@@ -4281,8 +4218,6 @@ namespace CalamityMod.CalPlayer
}
if (tequilaSunrise)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
if (Main.dayTime)
{
player.statDefense += 15;
@@ -4291,71 +4226,41 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.07f;
}
}
if (screwdriver)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (caribbeanRum)
{
alcoholPoisonLevel++;
player.lifeRegen += 2;
player.moveSpeed += 0.2f;
player.statDefense -= 12;
}
if (cinnamonRoll)
{
alcoholPoisonLevel++;
player.statDefense -= 12;
player.manaRegenDelay--;
player.manaRegenBonus += 10;
}
if (margarita)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.statDefense -= 6;
}
if (starBeamRye)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.statDefense -= 6;
player.magicDamage += 0.08f;
player.manaCost *= 0.9f;
}
if (moscowMule)
{
alcoholPoisonLevel++;
player.lifeRegen -= 2;
player.allDamage += 0.09f;
AllCritBoost(3);
}
if (whiteWine)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.statDefense -= 6;
player.magicDamage += 0.1f;
}
if (evergreenGin)
{
alcoholPoisonLevel++;
player.lifeRegen -= 1;
player.endurance += 0.05f;
}
if (alcoholPoisonLevel > 3)
{
if (player.whoAmI == Main.myPlayer)
player.AddBuff(ModContent.BuffType<AlcoholPoisoning>(), 2, false);
if (player.lifeRegen > 0)
{
player.lifeRegen = 0;
}
player.lifeRegenTime = 0;
player.lifeRegen -= 3 * alcoholPoisonLevel;
}
if (giantPearl)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -4428,7 +4333,52 @@ namespace CalamityMod.CalPlayer
Player.jumpHeight += 10;
player.extraFall += 25;
}
if (community)
if (mushy)
player.statDefense += 5;
if (omniscience)
{
player.detectCreature = true;
player.dangerSense = true;
player.findTreasure = true;
}
if (aWeapon)
player.moveSpeed += 0.15f;
if (molten)
player.resistCold = true;
if (shellBoost)
player.moveSpeed += 0.9f;
if (tarraSet)
{
player.calmed = tarraMelee ? false : true;
player.lifeMagnet = true;
}
if (aChicken)
{
player.statDefense += 5;
player.moveSpeed += 0.1f;
}
if (cadence)
{
if (player.FindBuffIndex(BuffID.Regeneration) > -1)
{ player.ClearBuff(BuffID.Regeneration); }
if (player.FindBuffIndex(BuffID.Lifeforce) > -1)
{ player.ClearBuff(BuffID.Lifeforce); }
player.discount = true;
player.lifeMagnet = true;
player.calmed = true;
player.loveStruck = true;
player.statLifeMax2 += player.statLifeMax / 5 / 20 * 25;
}
if (community)
{
float floatTypeBoost = 0.01f +
(NPC.downedSlimeKing ? 0.01f : 0f) +
@@ -4448,7 +4398,6 @@ namespace CalamityMod.CalPlayer
(CalamityWorld.downedYharon ? 0.03f : 0f); //0.2
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int critBoost = integerTypeBoost / 2;
int regenBoost = 1 + (integerTypeBoost / 5);
float damageBoost = floatTypeBoost * 0.5f;
player.endurance += floatTypeBoost * 0.25f;
player.statDefense += integerTypeBoost;
@@ -4457,56 +4406,145 @@ namespace CalamityMod.CalPlayer
player.minionKB += floatTypeBoost;
player.moveSpeed += floatTypeBoost;
player.statLifeMax2 += player.statLifeMax / 5 / 20 * integerTypeBoost;
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff);
if (shouldAffect)
lesserEffect = true;
}
if (player.lifeRegen < 0)
player.lifeRegen += lesserEffect ? 1 : regenBoost;
if (player.wingTimeMax > 0)
player.wingTimeMax = (int)((double)player.wingTimeMax * 1.15);
}
if (ravagerLore)
{
if (player.wingTimeMax > 0)
player.wingTimeMax = (int)((double)player.wingTimeMax * 0.5);
player.allDamage += 0.1f;
}
if (corrEffigy)
if (wDeath)
{
player.statDefense -= WhisperingDeath.DefenseReduction;
player.allDamage -= 0.1f;
}
if (aFlames)
player.statDefense -= AbyssalFlames.DefenseReduction;
if (gsInferno)
player.statDefense -= GodSlayerInferno.DefenseReduction;
if (astralInfection)
player.statDefense -= AstralInfectionDebuff.DefenseReduction;
if (pFlames)
{
player.blind = true;
player.statDefense -= Plague.DefenseReduction;
player.moveSpeed -= 0.15f;
}
if (bBlood)
{
player.blind = true;
player.statDefense -= 3;
player.moveSpeed += 0.2f;
player.meleeDamage += 0.05f;
player.rangedDamage -= 0.1f;
player.magicDamage -= 0.1f;
}
if (horror)
{
player.blind = true;
player.statDefense -= 15;
player.moveSpeed -= 0.15f;
}
if (aCrunch)
{
player.statDefense -= ArmorCrunch.DefenseReduction;
player.endurance *= 0.33f;
}
if (vHex)
{
player.blind = true;
player.statDefense -= 30;
player.moveSpeed -= 0.1f;
if (player.wingTimeMax <= 0)
player.wingTimeMax = 0;
player.wingTimeMax /= 2;
}
if (gState)
{
player.statDefense -= GlacialState.DefenseReduction;
player.velocity.Y = 0f;
player.velocity.X = 0f;
}
if (eGravity)
{
if (player.wingTimeMax < 0)
player.wingTimeMax = 0;
if (player.wingTimeMax > 400)
player.wingTimeMax = 400;
player.wingTimeMax /= 4;
}
if (eGrav)
{
if (player.wingTimeMax < 0)
player.wingTimeMax = 0;
if (player.wingTimeMax > 400)
player.wingTimeMax = 400;
player.wingTimeMax /= 2;
}
if (molluskSet)
player.velocity.X *= 0.985f;
if ((warped || caribbeanRum) && !player.slowFall && !player.mount.Active)
player.velocity.Y *= 1.01f;
if (corrEffigy)
{
player.moveSpeed += 0.15f;
AllCritBoost(10);
}
if (crimEffigy)
{
player.allDamage += 0.15f;
player.statDefense += 10;
player.statLifeMax2 = (int)((double)player.statLifeMax2 * 0.8);
}
if (badgeOfBraveryRare)
{
player.meleeDamage += 0.2f;
player.statLifeMax2 = (int)((double)player.statLifeMax2 * 0.75);
}
if (regenator)
{
player.statLifeMax2 = (int)((double)player.statLifeMax2 * 0.5);
player.lifeRegenTime += 8;
player.lifeRegen += 16;
}
if (calamitasLore)
{
player.statLifeMax2 = (int)((double)player.statLifeMax2 * 0.75);
player.maxMinions += 2;
}
// The player's true max life value with Calamity adjustments
actualMaxLife = player.statLifeMax2;
if (thirdSageH && !player.dead && player.HasBuff(ModContent.BuffType<ThirdSageBuff>()))
{
player.statLife = player.statLifeMax2;
}
if (pinkCandle)
{
// every frame, add up 1/60th of the healing value (0.4% max HP per second)
@@ -4524,11 +4562,10 @@ namespace CalamityMod.CalPlayer
if (manaOverloader)
{
player.magicDamage += 0.06f;
if (player.statMana > (int)((double)player.statManaMax2 * 0.5))
player.lifeRegen -= 3;
if (player.statMana < (int)((double)player.statManaMax2 * 0.1))
player.ghostHeal = true;
}
if (rBrain)
{
if (player.statLife <= (int)((double)player.statLifeMax2 * 0.75))
@@ -4536,6 +4573,7 @@ namespace CalamityMod.CalPlayer
if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5))
player.moveSpeed -= 0.05f;
}
if (bloodyWormTooth)
{
if (player.statLife < (int)((double)player.statLifeMax2 * 0.5))
@@ -4551,6 +4589,7 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.05f;
}
}
if (dAmulet)
{
player.panic = true;
@@ -4561,6 +4600,7 @@ namespace CalamityMod.CalPlayer
Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 1.35f, 0.3f, 0.9f);
}
}
if (rampartOfDeities)
{
player.armorPenetration += 10;
@@ -4620,6 +4660,7 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.05f;
}
}
if (frostFlare)
{
player.resistCold = true;
@@ -4635,6 +4676,7 @@ namespace CalamityMod.CalPlayer
player.statDefense += 10;
}
}
if (vexation)
{
if (player.statLife < (int)((double)player.statLifeMax2 * 0.5))
@@ -4642,6 +4684,7 @@ namespace CalamityMod.CalPlayer
player.allDamage += 0.15f;
}
}
if (ataxiaBlaze)
{
if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5))
@@ -4649,6 +4692,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(BuffID.Inferno, 2);
}
}
if (bloodflareThrowing)
{
if (player.statLife > (int)((double)player.statLifeMax2 * 0.8))
@@ -4661,6 +4705,7 @@ namespace CalamityMod.CalPlayer
player.Calamity().throwingDamage += 0.1f;
}
}
if (bloodflareSummon)
{
if (player.statLife >= (int)((double)player.statLifeMax2 * 0.9))
@@ -4670,7 +4715,6 @@ namespace CalamityMod.CalPlayer
else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5))
{
player.statDefense += 20;
player.lifeRegen += 2;
}
if (bloodflareSummonTimer > 0)
{ bloodflareSummonTimer--; }
@@ -4685,6 +4729,7 @@ namespace CalamityMod.CalPlayer
}
}
}
if (yInsignia)
{
player.longInvince = true;
@@ -4696,17 +4741,20 @@ namespace CalamityMod.CalPlayer
player.allDamage += 0.1f;
}
}
if (reaperToothNecklace)
{
player.allDamage += 0.25f;
player.statDefense /= 2;
}
if (deepDiver)
{
player.allDamage += 0.15f;
player.statDefense += (int)((double)player.statDefense * 0.15);
player.moveSpeed += 0.15f;
}
if (coreOfTheBloodGod)
{
player.endurance += 0.05f;
@@ -4733,6 +4781,7 @@ namespace CalamityMod.CalPlayer
player.allDamage += 0.1f;
}
}
if (godSlayerThrowing)
{
if (player.statLife >= player.statLifeMax2)
@@ -4742,6 +4791,7 @@ namespace CalamityMod.CalPlayer
player.Calamity().throwingVelocity += 0.1f;
}
}
if (tarraSummon)
{
int lifeCounter = 0;
@@ -4771,6 +4821,7 @@ namespace CalamityMod.CalPlayer
{
}
}
if (player.inventory[player.selectedItem].type == ModContent.ItemType<NavyFishingRod>() && player.ownedProjectileCounts[ModContent.ProjectileType<NavyBobber>()] != 0)
{
int auraCounter = 0;
@@ -4814,6 +4865,7 @@ namespace CalamityMod.CalPlayer
{
}
}
if (brimstoneElementalLore && player.inferno)
{
int num = ModContent.BuffType<BrimstoneFlames>();
@@ -4839,10 +4891,7 @@ namespace CalamityMod.CalPlayer
}
}
}
if (plaguebringerGoliathLore)
{
player.lifeRegen /= 2;
}
if (royalGel)
{
player.npcTypeNoAggro[ModContent.NPCType<AeroSlime>()] = true;
@@ -4858,6 +4907,7 @@ namespace CalamityMod.CalPlayer
// TODO -- When Wulfrum Slimes start being definitely robots, remove this immunity.
player.npcTypeNoAggro[ModContent.NPCType<WulfrumSlime>()] = true;
}
/*if (dukeScales)
{
player.buffImmune[ModContent.BuffType<SulphuricPoisoning>()] = true;
@@ -4905,41 +4955,6 @@ namespace CalamityMod.CalPlayer
{
player.endurance -= 0.2f;
}
if (CalamityWorld.revenge)
{
if (player.statLife < player.statLifeMax2)
{
bool noLifeRegenCap = (player.shinyStone || draedonsHeart || cFreeze || shadeRegen || photosynthesis) &&
(double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0;
if (!noLifeRegenCap)
{
//Max HP = 400
//350 HP = 1 - 0.875 * 10 = 1.25 = 1
//100 HP = 1 - 0.25 * 10 = 7.5 = 7
//200 HP = 1 - 0.5 * 10 = 5
int lifeRegenScale = (int)((1f - ((float)player.statLife / (float)player.statLifeMax2)) * 10f); //9 to 0 (1% HP to 100%)
if (player.lifeRegen > lifeRegenScale)
{
double lifeRegenScalar = (double)(1f + ((float)player.statLife / (float)player.statLifeMax2)); //1 to 2 (1% HP to 100%)
int defLifeRegen = (int)((double)player.lifeRegen / lifeRegenScalar);
player.lifeRegen = defLifeRegen;
}
}
}
}
if (CalamityWorld.bossRushActive)
{
if (Config.BossRushHealthCurse)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
player.lifeRegenTime = 0;
if (player.lifeRegenCount > 0)
player.lifeRegenCount = 0;
}
}
if (Config.ProficiencyEnabled)
{
GetStatBonuses();
@@ -5039,10 +5054,41 @@ namespace CalamityMod.CalPlayer
if (player.wingTimeMax < 50000)
player.wingTimeMax = 50000;
}
#endregion
#region Rogue Mirrors
Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8);
// For the stat meter
damageStats[0] = (int)((player.meleeDamage - 1f) * 100f);
damageStats[1] = (int)((player.rangedDamage - 1f) * 100f);
damageStats[2] = (int)((player.magicDamage - 1f) * 100f);
damageStats[3] = (int)((player.minionDamage - 1f) * 100f);
damageStats[4] = (int)((player.Calamity().throwingDamage - 1f) * 100f);
critStats[0] = player.meleeCrit;
critStats[1] = player.rangedCrit;
critStats[2] = player.magicCrit;
critStats[3] = player.Calamity().throwingCrit;
defenseStat = player.statDefense;
DRStat = (int)(player.endurance * 100f);
meleeSpeedStat = (int)((1f - player.meleeSpeed) * (100f / player.meleeSpeed));
manaCostStat = (int)(player.manaCost * 100f);
rogueVelocityStat = (int)((player.Calamity().throwingVelocity - 1f) * 100f);
minionSlotStat = player.maxMinions;
manaRegenStat = player.manaRegen;
armorPenetrationStat = player.armorPenetration;
wingFlightTimeStat = player.wingTimeMax;
adrenalineChargeStat = 45 -
(adrenalineBoostOne ? 10 : 0) -
(adrenalineBoostTwo ? 10 : 0) -
(adrenalineBoostThree ? 5 : 0);
bool DHorHoD = draedonsHeart || heartOfDarkness;
int rageDamageBoost = 0 +
(rageBoostOne ? (CalamityWorld.death ? 50 : 15) : 0) +
(rageBoostTwo ? (CalamityWorld.death ? 50 : 15) : 0) +
(rageBoostThree ? (CalamityWorld.death ? 50 : 15) : 0);
rageDamageStat = (CalamityWorld.death ? (DHorHoD ? 200 : 170) : (DHorHoD ? 65 : 50)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5
#endregion
#region Rogue Mirrors
Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8);
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0)
@@ -10680,14 +10726,6 @@ namespace CalamityMod.CalPlayer
if (areThereAnyDamnBosses)
price *= 5;
}
// It costs 600,000 (60 gold) to remove a full radiation meter.
price += (int)(600D * radiation);
}
public override void PostNurseHeal(NPC nurse, int health, bool removeDebuffs, int price)
{
radiation = 0.0;
}
#endregion
@@ -10975,19 +11013,6 @@ namespace CalamityMod.CalPlayer
packet.Send(-1, player.whoAmI);
}
private void RadiationPacket(bool server)
{
ModPacket packet = mod.GetPacket(256);
packet.Write((byte)CalamityModMessageType.RadiationSync);
packet.Write(player.whoAmI);
packet.Write(radiation);
if (!server)
packet.Send();
else
packet.Send(-1, player.whoAmI);
}
/*private void DistanceFromBossPacket(bool server)
{
ModPacket packet = mod.GetPacket(256);
@@ -11081,13 +11106,6 @@ namespace CalamityMod.CalPlayer
AdrenalinePacket(true);
}
internal void HandleRadiation(BinaryReader reader)
{
radiation = reader.ReadDouble();
if (Main.netMode == NetmodeID.Server)
RadiationPacket(true);
}
/*internal void HandleDistanceFromBoss(BinaryReader reader)
{
distanceFromBoss = reader.ReadInt32();
@@ -11120,7 +11138,6 @@ namespace CalamityMod.CalPlayer
LevelPacket(false, 4);
StressPacket(false);
AdrenalinePacket(false);
RadiationPacket(false);
//DistanceFromBossPacket(false);
DeathPacket(false);
}
+314 -148
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -34,8 +35,6 @@ namespace CalamityMod.CalPlayer
player.lifeRegen = 0;
player.lifeRegenTime = 0;
player.statDefense -= WhisperingDeath.DefenseReduction;
player.allDamage -= 0.1f;
}
if (modPlayer.aFlames)
@@ -45,7 +44,6 @@ namespace CalamityMod.CalPlayer
player.lifeRegenTime = 0;
player.lifeRegen -= 16;
player.statDefense -= AbyssalFlames.DefenseReduction;
}
if (modPlayer.bFlames)
@@ -73,7 +71,6 @@ namespace CalamityMod.CalPlayer
player.lifeRegenTime = 0;
player.lifeRegen -= 30;
player.statDefense -= GodSlayerInferno.DefenseReduction;
}
if (modPlayer.astralInfection)
@@ -83,7 +80,6 @@ namespace CalamityMod.CalPlayer
player.lifeRegenTime = 0;
player.lifeRegen -= 20;
player.statDefense -= AstralInfectionDebuff.DefenseReduction;
}
if (modPlayer.ZoneSulphur && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && !modPlayer.aquaticScourgeLore)
@@ -128,38 +124,15 @@ namespace CalamityMod.CalPlayer
player.lifeRegenTime = 0;
player.lifeRegen -= 20;
player.blind = true;
player.statDefense -= Plague.DefenseReduction;
player.moveSpeed -= 0.15f;
}
if (modPlayer.bBlood)
{
if (player.lifeRegen > 0)
{
player.lifeRegen = 0;
}
player.lifeRegenTime = 0;
player.lifeRegen -= 8;
player.blind = true;
player.statDefense -= 3;
player.moveSpeed += 0.2f;
player.meleeDamage += 0.05f;
player.rangedDamage -= 0.1f;
player.magicDamage -= 0.1f;
}
if (modPlayer.horror)
{
player.blind = true;
player.statDefense -= 15;
player.moveSpeed -= 0.15f;
}
if (modPlayer.aCrunch)
{
player.statDefense -= ArmorCrunch.DefenseReduction;
player.endurance *= 0.33f;
}
if (modPlayer.vHex)
@@ -169,14 +142,6 @@ namespace CalamityMod.CalPlayer
player.lifeRegenTime = 0;
player.lifeRegen -= 16;
player.blind = true;
player.statDefense -= 30;
player.moveSpeed -= 0.1f;
if (player.wingTimeMax <= 0)
player.wingTimeMax = 0;
player.wingTimeMax /= 2;
}
if (modPlayer.cDepth)
@@ -198,79 +163,133 @@ namespace CalamityMod.CalPlayer
}
}
// Buffs
if (modPlayer.vodka)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.redWine)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.grapeBeer)
{
modPlayer.alcoholPoisonLevel++;
}
if (modPlayer.moonshine)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.rum)
{
modPlayer.alcoholPoisonLevel++;
}
if (modPlayer.fireball)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.whiskey)
{
modPlayer.alcoholPoisonLevel++;
}
if (modPlayer.everclear)
{
modPlayer.alcoholPoisonLevel += 2;
player.lifeRegen -= 10;
}
if (modPlayer.bloodyMary)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 2;
}
if (modPlayer.tequila)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.tequilaSunrise)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.screwdriver)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.caribbeanRum)
{
modPlayer.alcoholPoisonLevel++;
}
if (modPlayer.cinnamonRoll)
{
modPlayer.alcoholPoisonLevel++;
}
if (modPlayer.margarita)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.starBeamRye)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.moscowMule)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 2;
}
if (modPlayer.whiteWine)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.evergreenGin)
{
modPlayer.alcoholPoisonLevel++;
player.lifeRegen -= 1;
}
if (modPlayer.alcoholPoisonLevel > 3)
{
if (player.whoAmI == Main.myPlayer)
player.AddBuff(ModContent.BuffType<AlcoholPoisoning>(), 2, false);
if (modPlayer.tRegen)
player.lifeRegen += 3;
if (player.lifeRegen > 0)
player.lifeRegen = 0;
if (modPlayer.sRegen)
player.lifeRegen += 2;
player.lifeRegenTime = 0;
player.lifeRegen -= 3 * modPlayer.alcoholPoisonLevel;
}
if (modPlayer.tarraSet)
{
player.calmed = modPlayer.tarraMelee ? false : true;
player.lifeMagnet = true;
}
if (modPlayer.manaOverloader)
{
if (player.statMana > (int)((double)player.statManaMax2 * 0.5))
player.lifeRegen -= 3;
}
if (modPlayer.aChicken)
{
player.lifeRegen += 1;
player.statDefense += 5;
player.moveSpeed += 0.1f;
}
// Buffs
if (modPlayer.cadence)
{
if (player.FindBuffIndex(BuffID.Regeneration) > -1)
{ player.ClearBuff(BuffID.Regeneration); }
if (player.FindBuffIndex(BuffID.Lifeforce) > -1)
{ player.ClearBuff(BuffID.Lifeforce); }
player.discount = true;
player.lifeMagnet = true;
player.calmed = true;
player.loveStruck = true;
player.lifeRegen += 5;
player.statLifeMax2 += player.statLifeMax / 5 / 20 * 25;
}
if (modPlayer.bloodfinBoost)
{
if (modPlayer.bloodfinBoost)
{
if (player.lifeRegen < 0)
{
if (player.lifeRegenTime < 1800)
player.lifeRegenTime = 1800;
player.lifeRegen += 10;
}
else
{
player.lifeRegen += 5;
player.lifeRegenTime += 10;
}
}
}
}
if (modPlayer.omniscience)
{
player.detectCreature = true;
player.dangerSense = true;
player.findTreasure = true;
}
if (modPlayer.aWeapon)
player.moveSpeed += 0.15f;
if (modPlayer.mushy)
{
player.statDefense += 5;
player.lifeRegen += 1;
}
if (modPlayer.molten)
player.resistCold = true;
if (modPlayer.shellBoost)
player.moveSpeed += 0.9f;
if (modPlayer.celestialJewel || modPlayer.astralArcanum)
if (modPlayer.celestialJewel || modPlayer.astralArcanum)
{
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
@@ -324,22 +343,12 @@ namespace CalamityMod.CalPlayer
}
}
if (modPlayer.permafrostsConcoction)
{
if (player.statLife < player.statLifeMax2 / 2)
player.lifeRegen++;
if (player.statLife < player.statLifeMax2 / 4)
player.lifeRegen++;
if (player.statLife < player.statLifeMax2 / 10)
player.lifeRegen += 2;
// Last Debuffs
if (player.poisoned || player.onFire || modPlayer.bFlames)
player.lifeRegen += 4;
}
if (modPlayer.plaguebringerGoliathLore && player.lifeRegen > 0)
player.lifeRegen /= 2;
// Last Debuffs
if (modPlayer.omegaBlueChestplate)
if (modPlayer.omegaBlueChestplate)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
@@ -398,40 +407,20 @@ namespace CalamityMod.CalPlayer
else
modPlayer.hInfernoBoost = 0;
if (modPlayer.gState)
{
player.statDefense -= GlacialState.DefenseReduction;
player.velocity.Y = 0f;
player.velocity.X = 0f;
}
if (modPlayer.ZoneAbyss)
{
if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
{
if (player.statLife > 100)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
if (modPlayer.eGravity)
{
if (player.wingTimeMax < 0)
player.wingTimeMax = 0;
if (player.wingTimeMax > 400)
player.wingTimeMax = 400;
player.wingTimeMax /= 4;
}
if (modPlayer.eGrav)
{
if (player.wingTimeMax < 0)
player.wingTimeMax = 0;
if (player.wingTimeMax > 400)
player.wingTimeMax = 400;
player.wingTimeMax /= 2;
}
if (modPlayer.molluskSet)
player.velocity.X *= 0.985f;
if ((modPlayer.warped || modPlayer.caribbeanRum) && !player.slowFall && !player.mount.Active)
player.velocity.Y *= 1.01f;
player.lifeRegenTime = 0;
player.lifeRegen -= 160;
}
}
}
if (modPlayer.weakPetrification || CalamityWorld.bossRushActive)
{
@@ -452,7 +441,143 @@ namespace CalamityMod.CalPlayer
{
CalamityPlayer modPlayer = player.Calamity();
if (!player.shinyStone)
if (modPlayer.rum)
player.lifeRegen += 2;
if (modPlayer.caribbeanRum)
player.lifeRegen += 2;
if (modPlayer.aChicken)
player.lifeRegen += 1;
if (modPlayer.cadence)
player.lifeRegen += 5;
if (modPlayer.mushy)
player.lifeRegen += 1;
if (modPlayer.permafrostsConcoction)
{
if (player.statLife < modPlayer.actualMaxLife / 2)
player.lifeRegen++;
if (player.statLife < modPlayer.actualMaxLife / 4)
player.lifeRegen++;
if (player.statLife < modPlayer.actualMaxLife / 10)
player.lifeRegen += 2;
if (player.poisoned || player.onFire || modPlayer.bFlames)
player.lifeRegen += 4;
}
if (modPlayer.tRegen)
player.lifeRegen += 3;
if (modPlayer.sRegen)
player.lifeRegen += 2;
if (modPlayer.affliction || modPlayer.afflicted)
player.lifeRegen += 1;
if (modPlayer.absorber)
{
if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0)
player.lifeRegen += 2;
}
if (modPlayer.aAmpoule)
{
if (!player.honey && player.lifeRegen < 0)
{
player.lifeRegen += 2;
if (player.lifeRegen > 0)
player.lifeRegen = 0;
}
player.lifeRegenTime += 1;
player.lifeRegen += 2;
}
if (modPlayer.ursaSergeant)
{
if (player.statLife <= (int)((double)modPlayer.actualMaxLife * 0.15))
{
player.lifeRegen += 3;
player.lifeRegenTime += 3;
}
else if (player.statLife <= (int)((double)modPlayer.actualMaxLife * 0.25))
{
player.lifeRegen += 2;
player.lifeRegenTime += 2;
}
else if (player.statLife <= (int)((double)modPlayer.actualMaxLife * 0.5))
{
player.lifeRegen += 1;
player.lifeRegenTime += 1;
}
}
if (modPlayer.polarisBoost)
{
player.lifeRegen += 1;
player.lifeRegenTime += 1;
}
if (modPlayer.projRefRareLifeRegenCounter > 0)
{
player.lifeRegenTime += 2;
player.lifeRegen += 2;
}
if (modPlayer.darkSunRing)
{
if (Main.dayTime)
player.lifeRegen += 3;
}
if (modPlayer.community)
{
float floatTypeBoost = 0.01f +
(NPC.downedSlimeKing ? 0.01f : 0f) +
(NPC.downedBoss1 ? 0.01f : 0f) +
(NPC.downedBoss2 ? 0.01f : 0f) +
(NPC.downedQueenBee ? 0.01f : 0f) + //0.05
(NPC.downedBoss3 ? 0.01f : 0f) +
(Main.hardMode ? 0.01f : 0f) +
(NPC.downedMechBossAny ? 0.01f : 0f) +
(NPC.downedPlantBoss ? 0.01f : 0f) +
(NPC.downedGolemBoss ? 0.01f : 0f) + //0.1
(NPC.downedFishron ? 0.01f : 0f) +
(NPC.downedAncientCultist ? 0.01f : 0f) +
(NPC.downedMoonlord ? 0.01f : 0f) +
(CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15
(CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17
(CalamityWorld.downedYharon ? 0.03f : 0f); //0.2
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int regenBoost = 1 + (integerTypeBoost / 5);
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff);
if (shouldAffect)
lesserEffect = true;
}
if (player.lifeRegen < 0)
player.lifeRegen += lesserEffect ? 1 : regenBoost;
}
if (modPlayer.regenator)
{
player.lifeRegenTime += 8;
player.lifeRegen += 16;
}
if (modPlayer.bloodflareSummon)
{
if (player.statLife <= (int)((double)modPlayer.actualMaxLife * 0.5))
player.lifeRegen += 2;
}
if (!player.shinyStone)
{
int lifeRegenTimeMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 450 : 1800;
int lifeRegenMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 1 : 4;
@@ -478,7 +603,7 @@ namespace CalamityMod.CalPlayer
player.lifeRegen += (int)num3;
}
if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2)
if (player.lifeRegen > 0 && player.statLife < modPlayer.actualMaxLife)
{
player.lifeRegenCount++;
if (Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(30))
@@ -515,7 +640,7 @@ namespace CalamityMod.CalPlayer
player.lifeRegen += (int)num3;
}
if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2)
if (player.lifeRegen > 0 && player.statLife < modPlayer.actualMaxLife)
{
player.lifeRegenCount++;
if (Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(30))
@@ -552,7 +677,7 @@ namespace CalamityMod.CalPlayer
player.lifeRegen += (int)num3;
}
if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2)
if (player.lifeRegen > 0 && player.statLife < modPlayer.actualMaxLife)
{
player.lifeRegenCount++;
if (Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(2))
@@ -593,7 +718,7 @@ namespace CalamityMod.CalPlayer
player.lifeRegen += (int)num3;
}
if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2)
if (player.lifeRegen > 0 && player.statLife < modPlayer.actualMaxLife)
{
player.lifeRegenCount++;
if (Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(2))
@@ -614,7 +739,48 @@ namespace CalamityMod.CalPlayer
}
}
}
}
if (CalamityWorld.revenge)
{
if (player.statLife < modPlayer.actualMaxLife)
{
bool noLifeRegenCap = (player.shinyStone || modPlayer.draedonsHeart || modPlayer.cFreeze || modPlayer.shadeRegen || modPlayer.photosynthesis) &&
(double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0;
if (!noLifeRegenCap)
{
//Max HP = 400
//350 HP = 1 - 0.875 * 10 = 1.25 = 1
//100 HP = 1 - 0.25 * 10 = 7.5 = 7
//200 HP = 1 - 0.5 * 10 = 5
int lifeRegenScale = (int)((1f - ((float)player.statLife / (float)modPlayer.actualMaxLife)) * 10f); //9 to 0 (1% HP to 100%)
if (player.lifeRegen > lifeRegenScale)
{
double lifeRegenScalar = (double)(1f + ((float)player.statLife / (float)modPlayer.actualMaxLife)); //1 to 2 (1% HP to 100%)
int defLifeRegen = (int)((double)player.lifeRegen / lifeRegenScalar);
player.lifeRegen = defLifeRegen;
}
}
}
}
if (CalamityWorld.bossRushActive)
{
if (Config.BossRushHealthCurse)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
player.lifeRegenTime = 0;
if (player.lifeRegenCount > 0)
player.lifeRegenCount = 0;
}
}
// For the stat meter
modPlayer.lifeRegenStat = player.lifeRegen;
}
#endregion
}
}
+1 -5
View File
@@ -3089,9 +3089,6 @@ namespace CalamityMod
case CalamityModMessageType.AdrenalineSync:
Main.player[reader.ReadInt32()].Calamity().HandleAdrenaline(reader);
break;
case CalamityModMessageType.RadiationSync:
Main.player[reader.ReadInt32()].Calamity().HandleRadiation(reader);
break;
/*case CalamityModMessageType.DistanceFromBossSync:
Main.player[reader.ReadInt32()].Calamity().HandleDistanceFromBoss(reader);
break;*/
@@ -3166,8 +3163,7 @@ namespace CalamityMod
DoGCountdownSync,
BossSpawnCountdownSync,
BossTypeSync,
DeathCountSync,
RadiationSync
DeathCountSync
//DistanceFromBossSync
}
}
+85
View File
@@ -0,0 +1,85 @@
using CalamityMod.CalPlayer;
using CalamityMod.World;
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class StatMeter : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Stat Meter");
Tooltip.SetDefault("Displays info about most of your stats");
}
public override void SetDefaults()
{
item.width = 26;
item.height = 26;
item.value = Item.buyPrice(0, 6, 0, 0);
item.rare = 1;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity();
int defense = modPlayer.defenseStat;
int DR = modPlayer.DRStat;
int meleeSpeed = modPlayer.meleeSpeedStat;
int manaCost = modPlayer.manaCostStat;
int rogueVelocity = modPlayer.rogueVelocityStat;
int minionSlots = modPlayer.minionSlotStat;
int lifeRegen = modPlayer.lifeRegenStat;
int manaRegen = modPlayer.manaRegenStat;
int armorPenetration = modPlayer.armorPenetrationStat;
int wingFlightTime = modPlayer.wingFlightTimeStat;
if (CalamityWorld.revenge && Config.AdrenalineAndRage)
{
int adrenalineChargeTime = modPlayer.adrenalineChargeStat;
int rageDamage = modPlayer.rageDamageStat;
foreach (TooltipLine line2 in list)
{
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
{
line2.text = "Adrenaline Charge Time: " + adrenalineChargeTime + " seconds | Rage Damage Boost: " + rageDamage + "%\n\n" +
"Melee Damage: " + modPlayer.damageStats[0] + "% | Melee Crit Chance: " + modPlayer.critStats[0] + "%\n" +
"Melee Speed Boost: " + meleeSpeed + "%\n\n" +
"Ranged Damage: " + modPlayer.damageStats[1] + "% | Ranged Crit Chance: " + modPlayer.critStats[1] + "%\n\n" +
"Magic Damage: " + modPlayer.damageStats[2] + "% | Magic Crit Chance: " + modPlayer.critStats[2] + "%\n" +
"Mana Usage: " + manaCost + "% | Mana Regen: " + manaRegen + "\n\n" +
"Minion Damage: " + modPlayer.damageStats[3] + "% | Minion Slots: " + minionSlots + "\n\n" +
"Rogue Damage: " + modPlayer.damageStats[4] + "% | Rogue Crit Chance: " + modPlayer.critStats[3] + "%\n" +
"Rogue Velocity Boost: " + rogueVelocity + "%\n\n" +
"Defense: " + defense + " | DR: " + DR + "%\n" +
"Life Regen: " + lifeRegen + " | Armor Penetration: " + armorPenetration + "\n" +
"Wing Flight Time: " + wingFlightTime;
}
}
}
else
{
foreach (TooltipLine line2 in list)
{
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
{
line2.text = "Melee Damage: " + modPlayer.damageStats[0] + "% | Melee Crit Chance: " + modPlayer.critStats[0] + "%\n" +
"Melee Speed Boost: " + meleeSpeed + "%\n\n" +
"Ranged Damage: " + modPlayer.damageStats[1] + "% | Ranged Crit Chance: " + modPlayer.critStats[1] + "%\n\n" +
"Magic Damage: " + modPlayer.damageStats[2] + "% | Magic Crit Chance: " + modPlayer.critStats[2] + "%\n" +
"Mana Usage: " + manaCost + "% | Mana Regen: " + manaRegen + "\n\n" +
"Minion Damage: " + modPlayer.damageStats[3] + "% | Minion Slots: " + minionSlots + "\n\n" +
"Rogue Damage: " + modPlayer.damageStats[4] + "% | Rogue Crit Chance: " + modPlayer.critStats[3] + "%\n" +
"Rogue Velocity Boost: " + rogueVelocity + "%\n\n" +
"Defense: " + defense + " | DR: " + DR + "%\n" +
"Life Regen: " + lifeRegen + " | Armor Penetration: " + armorPenetration + "\n" +
"Wing Flight Time: " + wingFlightTime;
}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 351 B

+3 -2
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.UseSound = SoundID.Item102;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<AstrealArrow>();
item.shootSpeed = 1f;
item.shootSpeed = 4f;
item.useAmmo = 40;
}
@@ -52,7 +52,8 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<AstrealArrow>(), (int)(double)damage, knockBack, player.whoAmI, 0f, 0f);
float ai0 = (float)Main.rand.Next(4);
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<AstrealArrow>(), damage, knockBack, player.whoAmI, ai0, 0f);
return false;
}
+3 -3
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue
DisplayName.SetDefault("Deep Sea Dumbbell");
Tooltip.SetDefault("Throws a dumbbell that bounces and flings weights with each bounce\n" +
"Right click to flex with it, increasing the power of your next throw with a stealth strike\n" +
"Can boost the projectile damage up to 8 times its original damage");
"Can boost the projectile damage up to 7.5 times its original damage");
}
public override void SafeSetDefaults()
@@ -98,8 +98,8 @@ namespace CalamityMod.Items.Weapons.Rogue
if (player.altFunctionUse == 2)
{
flexBonusDamageMult += 1f;
if (flexBonusDamageMult > 7f)
flexBonusDamageMult = 7f;
if (flexBonusDamageMult > 6.5f)
flexBonusDamageMult = 6.5f;
return false;
}
+2 -2
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
public class HellsSun : RogueWeapon
{
private static int damage = 180;
private static int damage = 67;
private static int knockBack = 5;
public override void SetStaticDefaults()
@@ -87,7 +87,7 @@ namespace CalamityMod.Items.Weapons.Rogue
}
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
{
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<HellsSunProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<HellsSunProj>(), (int)(damage * 0.45f), knockBack, player.whoAmI, 0f, 0f);
Main.projectile[stealth].Calamity().stealthStrike = true;
Main.projectile[stealth].penetrate = -1;
Main.projectile[stealth].timeLeft = 2400;
+4 -2
View File
@@ -3177,7 +3177,7 @@ namespace CalamityMod.NPCs
for (int i = 0; i < numProj + 1; i++)
{
Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, num153, num152, 0f, Main.myPlayer, 0f, 0f);
int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, num153, num152, 0f, Main.myPlayer, 0f, 1f);
Main.projectile[proj].timeLeft = 600;
}
}
@@ -11976,7 +11976,9 @@ namespace CalamityMod.NPCs
npc.life = 0;
npc.HitEffect(0, 1337.0);
npc.checkDead();
MoonLordLoot(npc);
if (!CalamityWorld.bossRushActive)
MoonLordLoot(npc);
for (int num1174 = 0; num1174 < 200; num1174++)
{
+7 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
npc.defense = 0;
CalamityGlobalNPC global = npc.Calamity();
global.DR = 0.999999f;
// global.unbreakableDR = true;
//global.unbreakableDR = true;
npc.lifeMax = 200;
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
if (calamityModMusic != null)
@@ -96,6 +96,12 @@ namespace CalamityMod.NPCs.CeaselessVoid
public override void AI()
{
if(CalamityWorld.bossRushActive)
{
CalamityGlobalNPC global = npc.Calamity();
global.DR = 0.999999f;
global.unbreakableDR = true;
}
double lifeRatio = (double)npc.life / (double)npc.lifeMax;
int lifePercentage = (int)(100.0 * lifeRatio);
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
+1 -1
View File
@@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void AI()
{
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.4f, 0.5f);
if (npc.justHit || CalamityGlobalNPC.AnyBossNPCS())
if (npc.justHit)
{
hasBeenHit = true;
}
+364 -10
View File
@@ -1,10 +1,13 @@
using CalamityMod.Buffs.StatDebuffs;
using System;
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.NormalNPCs
{
public class OverloadedSoldier : ModNPC
@@ -12,20 +15,20 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Overloaded Soldier");
Main.npcFrameCount[npc.type] = 15;
Main.npcFrameCount[npc.type] = 14;
}
public override void SetDefaults()
{
npc.aiStyle = 3;
npc.damage = 42;
npc.aiStyle = -1;
aiType = -1;
npc.damage = NPC.downedMoonlord ? 84 : 42;
npc.width = 18;
npc.height = 40;
npc.defense = 18;
npc.Calamity().RevPlusDR(0.15f);
npc.lifeMax = 90;
npc.knockBackResist = 0.5f;
animationType = 77;
npc.lifeMax = NPC.downedMoonlord ? 1800 : 135;
npc.knockBackResist = 0f;
npc.value = Item.buyPrice(0, 0, 2, 0);
npc.HitSound = SoundID.NPCHit2;
npc.DeathSound = SoundID.NPCDeath2;
@@ -33,10 +36,361 @@ namespace CalamityMod.NPCs.NormalNPCs
bannerItem = ModContent.ItemType<OverloadedSoldierBanner>();
}
public override void AI()
public override void FindFrame(int frameHeight)
{
npc.frameCounter += (double)Math.Abs(npc.velocity.X);
if (npc.frameCounter > 6.0)
{
npc.frameCounter = 0.0;
npc.frame.Y = npc.frame.Y + frameHeight;
}
if (npc.velocity.Y == 0f)
{
if (npc.direction == 1)
npc.spriteDirection = 1;
if (npc.direction == -1)
npc.spriteDirection = -1;
}
else
{
npc.frameCounter = 0.0;
npc.frame.Y = 0;
return;
}
if (npc.velocity.X == 0f)
{
npc.frameCounter = 0.0;
npc.frame.Y = 0;
}
else
{
if (npc.frame.Y < frameHeight)
npc.frame.Y = frameHeight;
if (npc.frame.Y > frameHeight * 13)
npc.frame.Y = frameHeight;
}
}
public override void AI()
{
npc.velocity.X *= 1.05f;
}
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.35f, 0f, 0.15f);
bool flag3 = false;
if (npc.velocity.X == 0f)
{
flag3 = true;
}
if (npc.justHit)
{
flag3 = false;
}
bool flag4 = false;
bool flag5 = false;
int num35 = 60;
if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0)))
{
flag4 = true;
}
if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num35) | flag4)
{
npc.ai[3] += 1f;
}
else if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f)
{
npc.ai[3] -= 1f;
}
if (npc.ai[3] > (float)(num35 * 10))
{
npc.ai[3] = 0f;
}
if (npc.justHit)
{
npc.ai[3] = 0f;
}
if (npc.ai[3] == (float)num35)
{
npc.netUpdate = true;
}
if (npc.ai[3] < (float)num35)
{
npc.TargetClosest(true);
}
else if (npc.ai[2] <= 0f)
{
if (npc.velocity.X == 0f)
{
if (npc.velocity.Y == 0f)
{
npc.ai[0] += 1f;
if (npc.ai[0] >= 2f)
{
npc.direction *= -1;
npc.spriteDirection = npc.direction;
npc.ai[0] = 0f;
}
}
}
else
{
npc.ai[0] = 0f;
}
if (npc.direction == 0)
{
npc.direction = 1;
}
}
float num65 = 1.5f;
float num66 = 0.1f;
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 400f)
{
num65 += 4f - ((Main.player[npc.target].Center - npc.Center).Length() * 0.01f);
}
if (npc.velocity.X < -num65 || npc.velocity.X > num65)
{
if (npc.velocity.Y == 0f)
npc.velocity *= 0.7f;
}
else if (npc.velocity.X < num65 && npc.direction == 1)
{
npc.velocity.X = npc.velocity.X + num66;
if (npc.velocity.X > num65)
npc.velocity.X = num65;
}
else if (npc.velocity.X > -num65 && npc.direction == -1)
{
npc.velocity.X = npc.velocity.X - num66;
if (npc.velocity.X < -num65)
npc.velocity.X = -num65;
}
bool flag22 = false;
if (npc.velocity.Y == 0f)
{
int num161 = (int)(npc.position.Y + (float)npc.height + 7f) / 16;
int arg_A8FB_0 = (int)npc.position.X / 16;
int num162 = (int)(npc.position.X + (float)npc.width) / 16;
for (int num163 = arg_A8FB_0; num163 <= num162; num163++)
{
if (Main.tile[num163, num161] == null)
{
return;
}
if (Main.tile[num163, num161].nactive() && Main.tileSolid[(int)Main.tile[num163, num161].type])
{
flag22 = true;
break;
}
}
}
if (npc.velocity.Y >= 0f)
{
int num164 = 0;
if (npc.velocity.X < 0f)
{
num164 = -1;
}
if (npc.velocity.X > 0f)
{
num164 = 1;
}
Vector2 position2 = npc.position;
position2.X += npc.velocity.X;
int num165 = (int)((position2.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num164)) / 16f);
int num166 = (int)((position2.Y + (float)npc.height - 1f) / 16f);
if (Main.tile[num165, num166] == null)
{
Main.tile[num165, num166] = new Tile();
}
if (Main.tile[num165, num166 - 1] == null)
{
Main.tile[num165, num166 - 1] = new Tile();
}
if (Main.tile[num165, num166 - 2] == null)
{
Main.tile[num165, num166 - 2] = new Tile();
}
if (Main.tile[num165, num166 - 3] == null)
{
Main.tile[num165, num166 - 3] = new Tile();
}
if (Main.tile[num165, num166 + 1] == null)
{
Main.tile[num165, num166 + 1] = new Tile();
}
if (Main.tile[num165 - num164, num166 - 3] == null)
{
Main.tile[num165 - num164, num166 - 3] = new Tile();
}
if ((float)(num165 * 16) < position2.X + (float)npc.width && (float)(num165 * 16 + 16) > position2.X && ((Main.tile[num165, num166].nactive() && !Main.tile[num165, num166].topSlope() && !Main.tile[num165, num166 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num165, num166].type] && !Main.tileSolidTop[(int)Main.tile[num165, num166].type]) || (Main.tile[num165, num166 - 1].halfBrick() && Main.tile[num165, num166 - 1].nactive())) && (!Main.tile[num165, num166 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 1].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 1].type] || (Main.tile[num165, num166 - 1].halfBrick() && (!Main.tile[num165, num166 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 4].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 4].type]))) && (!Main.tile[num165, num166 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 2].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 2].type]) && (!Main.tile[num165, num166 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 3].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 3].type]) && (!Main.tile[num165 - num164, num166 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num165 - num164, num166 - 3].type]))
{
float num167 = (float)(num166 * 16);
if (Main.tile[num165, num166].halfBrick())
{
num167 += 8f;
}
if (Main.tile[num165, num166 - 1].halfBrick())
{
num167 -= 8f;
}
if (num167 < position2.Y + (float)npc.height)
{
float num168 = position2.Y + (float)npc.height - num167;
float num169 = 16.1f;
if (num168 <= num169)
{
npc.gfxOffY += npc.position.Y + (float)npc.height - num167;
npc.position.Y = num167 - (float)npc.height;
if (num168 < 9f)
{
npc.stepSpeed = 1f;
}
else
{
npc.stepSpeed = 2f;
}
}
}
}
}
if (flag22)
{
int num170 = (int)((npc.position.X + (float)(npc.width / 2) + (float)(15 * npc.direction)) / 16f);
int num171 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f);
if (Main.tile[num170, num171] == null)
{
Main.tile[num170, num171] = new Tile();
}
if (Main.tile[num170, num171 - 1] == null)
{
Main.tile[num170, num171 - 1] = new Tile();
}
if (Main.tile[num170, num171 - 2] == null)
{
Main.tile[num170, num171 - 2] = new Tile();
}
if (Main.tile[num170, num171 - 3] == null)
{
Main.tile[num170, num171 - 3] = new Tile();
}
if (Main.tile[num170, num171 + 1] == null)
{
Main.tile[num170, num171 + 1] = new Tile();
}
if (Main.tile[num170 + npc.direction, num171 - 1] == null)
{
Main.tile[num170 + npc.direction, num171 - 1] = new Tile();
}
if (Main.tile[num170 + npc.direction, num171 + 1] == null)
{
Main.tile[num170 + npc.direction, num171 + 1] = new Tile();
}
if (Main.tile[num170 - npc.direction, num171 + 1] == null)
{
Main.tile[num170 - npc.direction, num171 + 1] = new Tile();
}
Main.tile[num170, num171 + 1].halfBrick();
if ((Main.tile[num170, num171 - 1].nactive() && (Main.tile[num170, num171 - 1].type == 10 || Main.tile[num170, num171 - 1].type == 388)) & flag5)
{
npc.ai[2] += 1f;
npc.ai[3] = 0f;
if (npc.ai[2] >= 60f)
{
npc.velocity.X = 0.5f * (float)-(float)npc.direction;
int num172 = 5;
if (Main.tile[num170, num171 - 1].type == 388)
{
num172 = 2;
}
npc.ai[1] += (float)num172;
npc.ai[2] = 0f;
bool flag23 = false;
if (npc.ai[1] >= 10f)
{
flag23 = true;
npc.ai[1] = 10f;
}
WorldGen.KillTile(num170, num171 - 1, true, false, false);
if ((Main.netMode != NetmodeID.MultiplayerClient || !flag23) && flag23 && Main.netMode != NetmodeID.MultiplayerClient)
{
if (Main.tile[num170, num171 - 1].type == 10)
{
bool flag24 = WorldGen.OpenDoor(num170, num171 - 1, npc.direction);
if (!flag24)
{
npc.ai[3] = (float)num35;
npc.netUpdate = true;
}
if (Main.netMode == NetmodeID.Server & flag24)
{
NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0);
}
}
if (Main.tile[num170, num171 - 1].type == 388)
{
bool flag25 = WorldGen.ShiftTallGate(num170, num171 - 1, false);
if (!flag25)
{
npc.ai[3] = (float)num35;
npc.netUpdate = true;
}
if (Main.netMode == NetmodeID.Server & flag25)
{
NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0);
}
}
}
}
}
else
{
int num173 = npc.spriteDirection;
if ((npc.velocity.X < 0f && num173 == -1) || (npc.velocity.X > 0f && num173 == 1))
{
if (npc.height >= 32 && Main.tile[num170, num171 - 2].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 2].type])
{
if (Main.tile[num170, num171 - 3].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 3].type])
{
npc.velocity.Y = -8f;
npc.netUpdate = true;
}
else
{
npc.velocity.Y = -7f;
npc.netUpdate = true;
}
}
else if (Main.tile[num170, num171 - 1].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 1].type])
{
npc.velocity.Y = -6f;
npc.netUpdate = true;
}
else if (npc.position.Y + (float)npc.height - (float)(num171 * 16) > 20f && Main.tile[num170, num171].nactive() && !Main.tile[num170, num171].topSlope() && Main.tileSolid[(int)Main.tile[num170, num171].type])
{
npc.velocity.Y = -5f;
npc.netUpdate = true;
}
else if (npc.directionY < 0 && (!Main.tile[num170, num171 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num170, num171 + 1].type]) && (!Main.tile[num170 + npc.direction, num171 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num170 + npc.direction, num171 + 1].type]))
{
npc.velocity.Y = -8f;
npc.velocity.X = npc.velocity.X * 1.5f;
npc.netUpdate = true;
}
else if (flag5)
{
npc.ai[1] = 0f;
npc.ai[2] = 0f;
}
if ((npc.velocity.Y == 0f & flag3) && npc.ai[3] == 1f)
{
npc.velocity.Y = -5f;
}
}
}
}
else if (flag5)
{
npc.ai[1] = 0f;
npc.ai[2] = 0f;
}
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

+353 -52
View File
@@ -1,10 +1,13 @@
using CalamityMod.Buffs.StatDebuffs;
using System;
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.NormalNPCs
{
public class PhantomDebris : ModNPC
@@ -17,15 +20,15 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void SetDefaults()
{
npc.damage = 30;
npc.damage = NPC.downedMoonlord ? 60 : 30;
npc.width = 44;
npc.height = 22;
npc.defense = 20;
npc.Calamity().RevPlusDR(0.1f);
npc.lifeMax = 80;
npc.aiStyle = 3;
aiType = 67;
npc.knockBackResist = 0.5f;
npc.lifeMax = NPC.downedMoonlord ? 1600 : 120;
npc.aiStyle = -1;
aiType = -1;
npc.knockBackResist = 0f;
npc.value = Item.buyPrice(0, 0, 2, 0);
npc.HitSound = SoundID.NPCHit2;
npc.DeathSound = SoundID.NPCDeath36;
@@ -35,55 +38,353 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void FindFrame(int frameHeight)
{
npc.frameCounter += 0.15f;
npc.frameCounter %= Main.npcFrameCount[npc.type];
int frame = (int)npc.frameCounter;
npc.frame.Y = frame * frameHeight;
}
npc.frameCounter += (double)Math.Abs(npc.velocity.X);
if (npc.frameCounter > 6.0)
{
npc.frameCounter = 0.0;
npc.frame.Y = npc.frame.Y + frameHeight;
}
if (npc.velocity.Y == 0f)
{
if (npc.direction == 1)
npc.spriteDirection = 1;
if (npc.direction == -1)
npc.spriteDirection = -1;
}
else
{
npc.frameCounter = 0.0;
npc.frame.Y = 0;
return;
}
if (npc.velocity.X == 0f)
{
npc.frameCounter = 0.0;
npc.frame.Y = 0;
}
else
{
if (npc.frame.Y > frameHeight * 3)
npc.frame.Y = 0;
}
}
public override void AI()
{
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
float num79 = (Main.player[npc.target].Center - npc.Center).Length();
num79 *= 0.0025f;
if ((double)num79 > 1.5)
{
num79 = 1.5f;
}
float num78;
if (Main.expertMode)
{
num78 = 4f - num79;
}
else
{
num78 = 3f - num79;
}
num78 *= 0.8f;
if (npc.velocity.X < -num78 || npc.velocity.X > num78)
{
if (npc.velocity.Y == 0f)
{
npc.velocity *= 0.8f;
}
}
else if (npc.velocity.X < num78 && npc.direction == 1)
{
npc.velocity.X = npc.velocity.X + 1.5f;
if (npc.velocity.X > num78)
{
npc.velocity.X = num78;
}
}
else if (npc.velocity.X > -num78 && npc.direction == -1)
{
npc.velocity.X = npc.velocity.X - 1.5f;
if (npc.velocity.X < -num78)
{
npc.velocity.X = -num78;
}
}
}
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.35f, 0f, 0.15f);
bool flag3 = false;
if (npc.velocity.X == 0f)
{
flag3 = true;
}
if (npc.justHit)
{
flag3 = false;
}
bool flag4 = false;
bool flag5 = false;
int num35 = 60;
if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0)))
{
flag4 = true;
}
if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num35) | flag4)
{
npc.ai[3] += 1f;
}
else if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f)
{
npc.ai[3] -= 1f;
}
if (npc.ai[3] > (float)(num35 * 10))
{
npc.ai[3] = 0f;
}
if (npc.justHit)
{
npc.ai[3] = 0f;
}
if (npc.ai[3] == (float)num35)
{
npc.netUpdate = true;
}
if (npc.ai[3] < (float)num35)
{
npc.TargetClosest(true);
}
else if (npc.ai[2] <= 0f)
{
if (npc.velocity.X == 0f)
{
if (npc.velocity.Y == 0f)
{
npc.ai[0] += 1f;
if (npc.ai[0] >= 2f)
{
npc.direction *= -1;
npc.spriteDirection = npc.direction;
npc.ai[0] = 0f;
}
}
}
else
{
npc.ai[0] = 0f;
}
if (npc.direction == 0)
{
npc.direction = 1;
}
}
float num65 = 1.2f + ((Main.player[npc.target].Center - npc.Center).Length() * 0.005f);
float num66 = 0.12f + ((Main.player[npc.target].Center - npc.Center).Length() * 0.0005f);
if (npc.velocity.X < -num65 || npc.velocity.X > num65)
{
if (npc.velocity.Y == 0f)
npc.velocity *= 0.7f;
}
else if (npc.velocity.X < num65 && npc.direction == 1)
{
npc.velocity.X = npc.velocity.X + num66;
if (npc.velocity.X > num65)
npc.velocity.X = num65;
}
else if (npc.velocity.X > -num65 && npc.direction == -1)
{
npc.velocity.X = npc.velocity.X - num66;
if (npc.velocity.X < -num65)
npc.velocity.X = -num65;
}
bool flag22 = false;
if (npc.velocity.Y == 0f)
{
int num161 = (int)(npc.position.Y + (float)npc.height + 7f) / 16;
int arg_A8FB_0 = (int)npc.position.X / 16;
int num162 = (int)(npc.position.X + (float)npc.width) / 16;
for (int num163 = arg_A8FB_0; num163 <= num162; num163++)
{
if (Main.tile[num163, num161] == null)
{
return;
}
if (Main.tile[num163, num161].nactive() && Main.tileSolid[(int)Main.tile[num163, num161].type])
{
flag22 = true;
break;
}
}
}
if (npc.velocity.Y >= 0f)
{
int num164 = 0;
if (npc.velocity.X < 0f)
{
num164 = -1;
}
if (npc.velocity.X > 0f)
{
num164 = 1;
}
Vector2 position2 = npc.position;
position2.X += npc.velocity.X;
int num165 = (int)((position2.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num164)) / 16f);
int num166 = (int)((position2.Y + (float)npc.height - 1f) / 16f);
if (Main.tile[num165, num166] == null)
{
Main.tile[num165, num166] = new Tile();
}
if (Main.tile[num165, num166 - 1] == null)
{
Main.tile[num165, num166 - 1] = new Tile();
}
if (Main.tile[num165, num166 - 2] == null)
{
Main.tile[num165, num166 - 2] = new Tile();
}
if (Main.tile[num165, num166 - 3] == null)
{
Main.tile[num165, num166 - 3] = new Tile();
}
if (Main.tile[num165, num166 + 1] == null)
{
Main.tile[num165, num166 + 1] = new Tile();
}
if (Main.tile[num165 - num164, num166 - 3] == null)
{
Main.tile[num165 - num164, num166 - 3] = new Tile();
}
if ((float)(num165 * 16) < position2.X + (float)npc.width && (float)(num165 * 16 + 16) > position2.X && ((Main.tile[num165, num166].nactive() && !Main.tile[num165, num166].topSlope() && !Main.tile[num165, num166 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num165, num166].type] && !Main.tileSolidTop[(int)Main.tile[num165, num166].type]) || (Main.tile[num165, num166 - 1].halfBrick() && Main.tile[num165, num166 - 1].nactive())) && (!Main.tile[num165, num166 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 1].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 1].type] || (Main.tile[num165, num166 - 1].halfBrick() && (!Main.tile[num165, num166 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 4].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 4].type]))) && (!Main.tile[num165, num166 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 2].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 2].type]) && (!Main.tile[num165, num166 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num165, num166 - 3].type] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 3].type]) && (!Main.tile[num165 - num164, num166 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num165 - num164, num166 - 3].type]))
{
float num167 = (float)(num166 * 16);
if (Main.tile[num165, num166].halfBrick())
{
num167 += 8f;
}
if (Main.tile[num165, num166 - 1].halfBrick())
{
num167 -= 8f;
}
if (num167 < position2.Y + (float)npc.height)
{
float num168 = position2.Y + (float)npc.height - num167;
float num169 = 16.1f;
if (num168 <= num169)
{
npc.gfxOffY += npc.position.Y + (float)npc.height - num167;
npc.position.Y = num167 - (float)npc.height;
if (num168 < 9f)
{
npc.stepSpeed = 1f;
}
else
{
npc.stepSpeed = 2f;
}
}
}
}
}
if (flag22)
{
int num170 = (int)((npc.position.X + (float)(npc.width / 2) + (float)(15 * npc.direction)) / 16f);
int num171 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f);
if (Main.tile[num170, num171] == null)
{
Main.tile[num170, num171] = new Tile();
}
if (Main.tile[num170, num171 - 1] == null)
{
Main.tile[num170, num171 - 1] = new Tile();
}
if (Main.tile[num170, num171 - 2] == null)
{
Main.tile[num170, num171 - 2] = new Tile();
}
if (Main.tile[num170, num171 - 3] == null)
{
Main.tile[num170, num171 - 3] = new Tile();
}
if (Main.tile[num170, num171 + 1] == null)
{
Main.tile[num170, num171 + 1] = new Tile();
}
if (Main.tile[num170 + npc.direction, num171 - 1] == null)
{
Main.tile[num170 + npc.direction, num171 - 1] = new Tile();
}
if (Main.tile[num170 + npc.direction, num171 + 1] == null)
{
Main.tile[num170 + npc.direction, num171 + 1] = new Tile();
}
if (Main.tile[num170 - npc.direction, num171 + 1] == null)
{
Main.tile[num170 - npc.direction, num171 + 1] = new Tile();
}
Main.tile[num170, num171 + 1].halfBrick();
if ((Main.tile[num170, num171 - 1].nactive() && (Main.tile[num170, num171 - 1].type == 10 || Main.tile[num170, num171 - 1].type == 388)) & flag5)
{
npc.ai[2] += 1f;
npc.ai[3] = 0f;
if (npc.ai[2] >= 60f)
{
npc.velocity.X = 0.5f * (float)-(float)npc.direction;
int num172 = 5;
if (Main.tile[num170, num171 - 1].type == 388)
{
num172 = 2;
}
npc.ai[1] += (float)num172;
npc.ai[2] = 0f;
bool flag23 = false;
if (npc.ai[1] >= 10f)
{
flag23 = true;
npc.ai[1] = 10f;
}
WorldGen.KillTile(num170, num171 - 1, true, false, false);
if ((Main.netMode != NetmodeID.MultiplayerClient || !flag23) && flag23 && Main.netMode != NetmodeID.MultiplayerClient)
{
if (Main.tile[num170, num171 - 1].type == 10)
{
bool flag24 = WorldGen.OpenDoor(num170, num171 - 1, npc.direction);
if (!flag24)
{
npc.ai[3] = (float)num35;
npc.netUpdate = true;
}
if (Main.netMode == NetmodeID.Server & flag24)
{
NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0);
}
}
if (Main.tile[num170, num171 - 1].type == 388)
{
bool flag25 = WorldGen.ShiftTallGate(num170, num171 - 1, false);
if (!flag25)
{
npc.ai[3] = (float)num35;
npc.netUpdate = true;
}
if (Main.netMode == NetmodeID.Server & flag25)
{
NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0);
}
}
}
}
}
else
{
int num173 = npc.spriteDirection;
if ((npc.velocity.X < 0f && num173 == -1) || (npc.velocity.X > 0f && num173 == 1))
{
if (npc.height >= 32 && Main.tile[num170, num171 - 2].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 2].type])
{
if (Main.tile[num170, num171 - 3].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 3].type])
{
npc.velocity.Y = -8f;
npc.netUpdate = true;
}
else
{
npc.velocity.Y = -7f;
npc.netUpdate = true;
}
}
else if (Main.tile[num170, num171 - 1].nactive() && Main.tileSolid[(int)Main.tile[num170, num171 - 1].type])
{
npc.velocity.Y = -6f;
npc.netUpdate = true;
}
else if (npc.position.Y + (float)npc.height - (float)(num171 * 16) > 20f && Main.tile[num170, num171].nactive() && !Main.tile[num170, num171].topSlope() && Main.tileSolid[(int)Main.tile[num170, num171].type])
{
npc.velocity.Y = -5f;
npc.netUpdate = true;
}
else if (npc.directionY < 0 && (!Main.tile[num170, num171 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num170, num171 + 1].type]) && (!Main.tile[num170 + npc.direction, num171 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num170 + npc.direction, num171 + 1].type]))
{
npc.velocity.Y = -8f;
npc.velocity.X = npc.velocity.X * 1.5f;
npc.netUpdate = true;
}
else if (flag5)
{
npc.ai[1] = 0f;
npc.ai[2] = 0f;
}
if ((npc.velocity.Y == 0f & flag3) && npc.ai[3] == 1f)
{
npc.velocity.Y = -5f;
}
}
}
}
else if (flag5)
{
npc.ai[1] = 0f;
npc.ai[2] = 0f;
}
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

+40 -33
View File
@@ -438,7 +438,6 @@ namespace CalamityMod.Projectiles
#region AI
public override void AI(Projectile projectile)
{
if (defDamage == 0)
defDamage = projectile.damage;
@@ -446,7 +445,7 @@ namespace CalamityMod.Projectiles
{
if (CalamityMod.dungeonProjectileBuffList.Contains(projectile.type))
{
if ((projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] == 1f) ||
if (((projectile.type == ProjectileID.RocketSkeleton || projectile.type == ProjectileID.Shadowflames) && projectile.ai[1] == 1f) ||
(NPC.golemBoss > 0 && (projectile.type == ProjectileID.InfernoHostileBolt || projectile.type == ProjectileID.InfernoHostileBlast)))
{
projectile.damage = defDamage;
@@ -818,6 +817,10 @@ namespace CalamityMod.Projectiles
if (Main.player[projectile.owner].ghostHeal)
{
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num = 0.1f;
num -= (float)projectile.numHits * 0.05f;
if (num < 0f)
@@ -830,7 +833,11 @@ namespace CalamityMod.Projectiles
if (projectile.type == ProjectileID.VampireKnife)
{
float num = (float)damage * 0.0375f;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num = (float)damage * 0.0375f;
if (num < 0f)
{
num = 0f;
@@ -863,7 +870,11 @@ namespace CalamityMod.Projectiles
if (Main.player[projectile.owner].Calamity().auricSet && target.canGhostHeal)
{
float num11 = 0.05f;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num11 = 0.05f;
num11 -= (float)projectile.numHits * 0.025f;
if (num11 <= 0f)
{
@@ -874,10 +885,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
float num13 = 0f;
int num14 = projectile.owner;
@@ -897,7 +904,11 @@ namespace CalamityMod.Projectiles
}
else if (Main.player[projectile.owner].Calamity().silvaSet && target.canGhostHeal)
{
float num11 = 0.03f;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num11 = 0.03f;
num11 -= (float)projectile.numHits * 0.015f;
if (num11 <= 0f)
{
@@ -908,10 +919,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
float num13 = 0f;
int num14 = projectile.owner;
@@ -960,7 +967,11 @@ namespace CalamityMod.Projectiles
{
if (Main.player[projectile.owner].Calamity().tarraMageHealCooldown <= 0)
{
Main.player[projectile.owner].Calamity().tarraMageHealCooldown = 90;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[projectile.owner].Calamity().tarraMageHealCooldown = 90;
float num11 = 0.03f;
num11 -= (float)projectile.numHits * 0.015f;
if (num11 <= 0f)
@@ -972,10 +983,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
int healAmount = Main.player[projectile.owner].Calamity().auricSet ? projectile.damage / 100 : projectile.damage / 50;
Player player = Main.player[projectile.owner];
@@ -1060,7 +1067,11 @@ namespace CalamityMod.Projectiles
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType<AtaxiaOrb>(), (int)((double)num * 1.25), 0f, projectile.owner, (float)num6, 0f);
if (target.canGhostHeal)
{
float num11 = 0.1f; //0.2
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num11 = 0.1f; //0.2
num11 -= (float)projectile.numHits * 0.05f; //0.05
if (num11 <= 0f)
{
@@ -1071,10 +1082,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
float num13 = 0f;
int num14 = projectile.owner;
@@ -1143,7 +1150,11 @@ namespace CalamityMod.Projectiles
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType<XerocOrb>(), (int)((double)num * 1.25), 0f, projectile.owner, (float)num6, 0f);
if (target.canGhostHeal)
{
float num11 = 0.1f;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num11 = 0.1f;
num11 -= (float)projectile.numHits * 0.05f;
if (num11 <= 0f)
{
@@ -1154,10 +1165,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
float num13 = 0f;
int num14 = projectile.owner;
@@ -1227,7 +1234,11 @@ namespace CalamityMod.Projectiles
(int)((double)num * (Main.player[projectile.owner].Calamity().auricSet ? 2.0 : 1.5)), 0f, projectile.owner, (float)num6, 0f);
if (target.canGhostHeal)
{
float num11 = Main.player[projectile.owner].Calamity().auricSet ? 0.03f : 0.06f; //0.2
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float num11 = Main.player[projectile.owner].Calamity().auricSet ? 0.03f : 0.06f; //0.2
num11 -= (float)projectile.numHits * 0.015f; //0.05
if (num11 <= 0f)
{
@@ -1238,10 +1249,6 @@ namespace CalamityMod.Projectiles
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f;
float num13 = 0f;
int num14 = projectile.owner;
-1
View File
@@ -127,7 +127,6 @@ namespace CalamityMod.Projectiles.Melee
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item10, projectile.position);
int num3;
for (int num795 = 4; num795 < 31; num795 = num3 + 1)
{
-1
View File
@@ -186,7 +186,6 @@ namespace CalamityMod.Projectiles.Melee
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item10, projectile.position);
int num3;
for (int num795 = 4; num795 < 31; num795 = num3 + 1)
{
-1
View File
@@ -127,7 +127,6 @@ namespace CalamityMod.Projectiles.Melee
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item10, projectile.position);
int num3;
for (int num795 = 4; num795 < 31; num795 = num3 + 1)
{
+32 -58
View File
@@ -9,8 +9,6 @@ namespace CalamityMod.Projectiles.Ranged
{
public class AstrealArrow : ModProjectile
{
private int flameTimer = 180;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astreal Arrow");
@@ -34,6 +32,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
if (projectile.localAI[0] == 0f)
{
projectile.scale -= 0.02f;
@@ -54,67 +53,42 @@ namespace CalamityMod.Projectiles.Ranged
projectile.localAI[0] = 0f;
}
}
int random = Main.rand.Next(1, 4);
flameTimer -= random;
int choice = Main.rand.Next(2);
projectile.velocity.X *= 1.05f;
projectile.velocity.Y *= 1.05f;
if (choice == 0 && (projectile.velocity.X >= 25f || projectile.velocity.Y >= 25f))
{
projectile.velocity.X = 0f;
projectile.velocity.Y = 10f;
}
else if (choice == 1 && (projectile.velocity.X >= 25f || projectile.velocity.Y >= 25f))
{
projectile.velocity.X = 10f;
projectile.velocity.Y = 0f;
}
else if (choice == 0 && (projectile.velocity.X <= -25f || projectile.velocity.Y <= -25f))
{
projectile.velocity.X = 0f;
projectile.velocity.Y = -10f;
}
else if (choice == 1 && (projectile.velocity.X <= -25f || projectile.velocity.Y <= -25f))
{
projectile.velocity.X = -10f;
projectile.velocity.Y = 0f;
}
if (projectile.velocity.Length() < 16f)
{
switch ((int)projectile.ai[0])
{
case 0:
projectile.velocity.X *= 1.02f;
break;
case 1:
projectile.velocity.Y *= 1.02f;
break;
case 2:
projectile.velocity.X += 0.1f;
projectile.velocity.Y *= 1.01f;
break;
case 3:
projectile.velocity.Y += 0.1f;
projectile.velocity.X *= 1.01f;
break;
default:
break;
}
}
if (Main.rand.NextBool(5))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
if (flameTimer <= 0)
projectile.ai[1] += (float)Main.rand.Next(3) + 1f;
if (projectile.ai[1] >= 180f)
{
float xPos = Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800;
Vector2 vector2 = new Vector2(xPos, projectile.position.Y + Main.rand.Next(-800, 801));
float num80 = xPos;
float speedX = (float)projectile.position.X - vector2.X;
float speedY = (float)projectile.position.Y - vector2.Y;
float dir = (float)Math.Sqrt((double)(speedX * speedX + speedY * speedY));
dir = 10 / num80;
speedX *= dir * 150;
speedY *= dir * 150;
if (speedX > 15f)
projectile.ai[1] = 0f;
projectile.netUpdate = true;
if (projectile.owner == Main.myPlayer)
{
speedX = 15f;
Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType<AstrealFlame>(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
}
if (speedX < -15f)
{
speedX = -15f;
}
if (speedY > 15f)
{
speedY = 15f;
}
if (speedY < -15f)
{
speedY = -15f;
}
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, ModContent.ProjectileType<AstrealFlame>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
}
flameTimer = 180;
}
}
+6 -6
View File
@@ -28,21 +28,21 @@ namespace CalamityMod.Projectiles.Rogue
projectile.timeLeft = 1200;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
projectile.localNPCHitCooldown = 40;
}
public override void AI()
{
projectile.ai[0] += 1f;
if (projectile.ai[0] >= 90f)
if (projectile.ai[0] >= 70f)
{
projectile.velocity.X *= 0.98f;
projectile.velocity.Y *= 0.98f;
projectile.velocity.X *= 0.96f;
projectile.velocity.Y *= 0.96f;
projectile.localAI[1]++;
if (projectile.Calamity().stealthStrike == true)
{
if ((double) projectile.localAI[1] >= 15.0)
if ((double) projectile.localAI[1] >= 30.0)
{
Vector2 velocity = projectile.velocity;
Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101));
@@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue
}
else
{
if ((double) projectile.localAI[1] >= 30.0)
if ((double) projectile.localAI[1] >= 60.0)
{
Vector2 velocity = projectile.velocity;
Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101));
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 62 KiB