Merge branch 'master' into rarity-shenannigans

This commit is contained in:
Merkalto committed 2021-11-08 16:06:51 -06:00
commit a35db4d77f
123 files changed
+1712 -1047

No files matched your search

+2 -8
View File
@@ -4047,12 +4047,9 @@ namespace CalamityMod.CalPlayer
((abyssalDivingSuit && player.IsUnderwater()) ? 0.05f : 0f) +
(sirenWaterBuff ? 0.15f : 0f) +
((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) +
(auricSet ? 0.1f : 0f) +
(dragonScales ? 0.1f : 0f) +
(kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) +
(cTracers ? 0.1f : 0f) +
(silvaSet ? 0.05f : 0f) +
(eTracers ? 0.05f : 0f) +
(blueCandle ? 0.05f : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
((deepDiver && player.IsUnderwater()) ? 0.15f : 0f) +
@@ -4064,12 +4061,9 @@ namespace CalamityMod.CalPlayer
((abyssalDivingSuit && player.IsUnderwater()) ? 0.05f : 0f) +
(sirenWaterBuff ? 0.15f : 0f) +
((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) +
(auricSet ? 0.1f : 0f) +
(dragonScales ? 0.1f : 0f) +
(kamiBoost ? KamiBuff.RunSpeedBoost : 0f) +
(cTracers ? 0.1f : 0f) +
(silvaSet ? 0.05f : 0f) +
(eTracers ? 0.05f : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
((deepDiver && player.IsUnderwater()) ? 0.15f : 0f) +
(rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f);
@@ -8833,7 +8827,7 @@ namespace CalamityMod.CalPlayer
// Cooldown for God Slayer Armor dash
if (dashMod == 9)
{
player.AddBuff(ModContent.BuffType<GodSlayerCooldown>(), CalamityUtils.SecondsToFrames(20f));
player.AddBuff(ModContent.BuffType<GodSlayerCooldown>(), CalamityUtils.SecondsToFrames(35f));
godSlayerDashHotKeyPressed = false;
}
@@ -10925,7 +10919,7 @@ namespace CalamityMod.CalPlayer
public override void OnConsumeMana(Item item, int manaConsumed)
{
CalamityPlayer modPlayer = player.Calamity();
if (Main.rand.NextBool(4) && modPlayer.lifeManaEnchant)
if (Main.rand.NextBool(2) && modPlayer.lifeManaEnchant)
{
if (Main.myPlayer == player.whoAmI)
{
+3 -13
View File
@@ -3426,18 +3426,8 @@ namespace CalamityMod.CalPlayer
player.maxMinions += 2;
}
if (modPlayer.gArtifact)
{
player.maxMinions += 10;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<YharonKindleBuff>()) == -1)
player.AddBuff(ModContent.BuffType<YharonKindleBuff>(), 3600, true);
if (player.ownedProjectileCounts[ModContent.ProjectileType<SonOfYharon>()] < 2)
Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<SonOfYharon>(), (int)(AngryChickenStaff.Damage * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f);
}
}
if (modPlayer.gArtifact && player.FindBuffIndex(ModContent.BuffType<YharonKindleBuff>()) != -1)
player.maxMinions += player.ownedProjectileCounts[ModContent.ProjectileType<SonOfYharon>()];
if (modPlayer.pArtifact)
{
@@ -3700,7 +3690,7 @@ namespace CalamityMod.CalPlayer
velocity.Y *= travelDist;
velocity.X += Main.rand.Next(-50, 51) * 0.02f;
velocity.Y += Main.rand.Next(-50, 51) * 0.02f;
int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<MagicNebulaShot>(), dmg, 4f, player.whoAmI, 0f, 0f);
int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<DeathhailBeam>(), dmg, 4f, player.whoAmI, 0f, 0f);
Main.projectile[laser].localNPCHitCooldown = 5;
if (laser.WithinBounds(Main.maxProjectiles))
Main.projectile[laser].Calamity().forceTypeless = true;
+11 -28
View File
@@ -86,8 +86,8 @@ namespace CalamityMod.CalPlayer
if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ProjectileType<ChaosGeyser>()] < 3)
{
// Ataxia True Melee Geysers: 15%, softcap starts at 300 base damage
int cappedDamage = CalamityUtils.DamageSoftCap(damage * 0.15, 45);
Projectile.NewProjectile(position, Vector2.Zero, ProjectileType<ChaosGeyser>(), cappedDamage, 2f, player.whoAmI, 0f, 0f);
int geyserDamage = CalamityUtils.DamageSoftCap(damage * 0.15, 45);
Projectile.NewProjectile(position, Vector2.Zero, ProjectileType<ChaosGeyser>(), geyserDamage, 2f, player.whoAmI, 0f, 0f);
}
if (modPlayer.soaring)
{
@@ -211,8 +211,8 @@ namespace CalamityMod.CalPlayer
if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ProjectileType<ChaosGeyser>()] < 3)
{
// Ataxia Melee Geysers: 15%, softcap starts at 240 base damage
int cappedDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.15, 36);
Projectile.NewProjectile(proj.Center, Vector2.Zero, ProjectileType<ChaosGeyser>(), cappedDamage, 0f, player.whoAmI, 0f, 0f);
int geyserDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.15, 36);
Projectile.NewProjectile(proj.Center, Vector2.Zero, ProjectileType<ChaosGeyser>(), geyserDamage, 0f, player.whoAmI, 0f, 0f);
}
if (modPlayer.bloodflareMelee && modProj.trueMelee)
{
@@ -294,8 +294,8 @@ namespace CalamityMod.CalPlayer
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
// Bloodflare Mage Fireballs: 3 x 50%, softcap starts at 500 base damage to not overly punish slow weapons
int cappedDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250);
int fire = Projectile.NewProjectile(position, velocity, ProjectileID.BallofFire, cappedDamage, 0f, player.whoAmI);
int bloodflareFireballDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250);
int fire = Projectile.NewProjectile(position, velocity, ProjectileID.BallofFire, bloodflareFireballDamage, 0f, player.whoAmI);
if (fire.WithinBounds(Main.maxProjectiles))
{
Main.projectile[fire].Calamity().forceTypeless = true;
@@ -308,26 +308,9 @@ namespace CalamityMod.CalPlayer
{
modPlayer.silvaMageCooldown = 300;
Main.PlaySound(SoundID.Zombie, (int)proj.position.X, (int)proj.position.Y, 103);
CalamityGlobalProjectile.ExpandHitboxBy(proj, 96);
for (int d = 0; d < 3; d++)
{
Dust.NewDust(proj.position, proj.width, proj.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f);
}
for (int d = 0; d < 30; d++)
{
int explode = Dust.NewDust(proj.position, proj.width, proj.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f);
Main.dust[explode].noGravity = true;
Main.dust[explode].velocity *= 3f;
explode = Dust.NewDust(proj.position, proj.width, proj.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f);
Main.dust[explode].velocity *= 2f;
Main.dust[explode].noGravity = true;
}
// Silva Mage Blasts: 300%
proj.damage *= 3;
proj.localNPCHitCooldown = 10;
proj.usesLocalNPCImmunity = true;
proj.Damage();
proj.Kill();
// Silva Mage Blasts: 800 + 60%, softcap on the whole combined thing starts at 1400
int silvaBurstDamage = CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400);
Projectile.NewProjectile(proj.Center, Vector2.Zero, ProjectileType<SilvaBurst>(), silvaBurstDamage, 8f, player.whoAmI);
}
}
#endregion
@@ -713,8 +696,8 @@ namespace CalamityMod.CalPlayer
if (modPlayer.umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 5) || Main.rand.NextBool(4)))
{
// Umbraphile Rogue Blasts: 25%, softcap starts at 200 base damage
int blastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50);
Projectile.NewProjectile(proj.Center, Vector2.Zero, ProjectileType<UmbraphileBoom>(), blastDamage, 0f, player.whoAmI);
int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50);
Projectile.NewProjectile(proj.Center, Vector2.Zero, ProjectileType<UmbraphileBoom>(), umbraBlastDamage, 0f, player.whoAmI);
}
if (modPlayer.raiderTalisman && modPlayer.raiderStack < 150 && crit && modPlayer.raiderCooldown <= 0)
+4 -3
View File
@@ -576,8 +576,8 @@ namespace CalamityMod
ProjectileType<NorfleetCannon>(),
ProjectileType<FlurrystormCannonShooting>(),
ProjectileType<PurgeProj>(),
ProjectileType<T1000Proj>(),
ProjectileType<NanoPurgeHoldout>(),
ProjectileType<AetherfluxCannonHoldout>(),
ProjectileType<YharimsCrystalPrism>(),
ProjectileType<DarkSparkPrism>(),
ProjectileType<YharimsCrystalBeam>(),
@@ -2775,7 +2775,8 @@ namespace CalamityMod
ProjectileType<SnapClamStealth>(),
ProjectileType<StickyBol>(),
ProjectileType<UrchinStingerProj>(),
ProjectileType<EyeOfNightCell>()
ProjectileType<EyeOfNightCell>(),
ProjectileType<ViolenceThrownProjectile>(),
};
bossTypes = new SortedDictionary<int, int>()
Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

+6 -8
View File
@@ -11,17 +11,15 @@ namespace CalamityMod.Items.Accessories
{
public class DaawnlightSpiritOrigin : ModItem
{
// Despite the seemingly insane numbers here, I think this item might actually be underpowered
// I left all the numbers easily accessible so it can be quickly rebalanced
// Regular crits can be intentionally weak; bullseyes should be doing all the work
// If the item is too weak, increase BullseyeCritRatio (originally 3.8f) until bullseyes are doing enough damage
// - Ozzatron
// "Despite the seemingly insane numbers here, I think this item might actually be underpowered"
// hindsight: the item was not underpowered. Ozzatron 05NOV2021
//
private const float BullseyeCritRatio = 3.8f; // Bullseye crits deal x3.8 damage instead of x2.
private const float StoredCritConversionRatio = 0.02f; // Add +2% more damage to crits for every 1% critical chance the player would have had.
// Regular crits are intentionally weak; bullseyes should be doing all the work
private const float BullseyeCritRatio = 3.5f; // Bullseye crits deal x3.5 damage instead of x2.
private const float StoredCritConversionRatio = 0.01f; // Add +1% more damage to crits for every 1% critical chance the player would have had.
private const float MinUseTimeForSlowBonus = 11f;
private const float MaxSlowBonusUseTime = 72f;
private const float MaxSlowWeaponBonus = 0.96f; // Up to +96% more damage to crits for slower weapons.
private const float MaxSlowWeaponBonus = 0.33f; // Up to +33% more damage to crits for slower weapons.
internal static float GetDamageMultiplier(Player p, CalamityPlayer mp, bool hitBullseye)
{
+10 -10
View File
@@ -14,18 +14,18 @@ namespace CalamityMod.Items.Accessories
{
DisplayName.SetDefault("Godly Soul Artifact");
Tooltip.SetDefault("Loyalty\n" +
"Summons two Sons of Yharon to fight for you");
"For each Son of Yharon you have summoned, you gain 1 minion slot");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 28;
item.accessory = true;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.Violet;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
}
item.accessory = true;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.Violet;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
@@ -36,10 +36,10 @@ namespace CalamityMod.Items.Accessories
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<ExodiumClusterOre>(), 25);
recipe.AddIngredient(ModContent.ItemType<PlagueContainmentCells>(), 25);
recipe.AddIngredient(ModContent.ItemType<HellcasterFragment>(), 5);
recipe.AddTile(TileID.DemonAltar);
recipe.AddIngredient(ModContent.ItemType<ExodiumClusterOre>(), 25);
recipe.AddIngredient(ModContent.ItemType<PlagueContainmentCells>(), 25);
recipe.AddIngredient(ModContent.ItemType<HellcasterFragment>(), 5);
recipe.AddTile(TileID.DemonAltar);
recipe.SetResult(this);
recipe.AddRecipe();
}
+1 -2
View File
@@ -40,8 +40,7 @@ namespace CalamityMod.Items.Armor
{
player.setBonus = "Melee Tarragon, Bloodflare and God Slayer effects\n" +
"Enemies are more likely to target you\n" +
"All projectiles spawn healing auric orbs on enemy hits\n" +
"Max run speed and acceleration boosted by 10%";
"All projectiles spawn healing auric orbs on enemy hits";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.tarraSet = true;
modPlayer.tarraMelee = true;
+1 -2
View File
@@ -39,8 +39,7 @@ namespace CalamityMod.Items.Armor
public override void UpdateArmorSet(Player player)
{
player.setBonus = "Ranged Tarragon, Bloodflare and God Slayer armor effects\n" +
"All projectiles spawn healing auric orbs on enemy hits\n" +
"Max run speed and acceleration boosted by 10%";
"All projectiles spawn healing auric orbs on enemy hits";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.tarraSet = true;
modPlayer.tarraRanged = true;
-1
View File
@@ -40,7 +40,6 @@ namespace CalamityMod.Items.Armor
{
player.setBonus = "Rogue Tarragon, Bloodflare and God Slayer armor effects\n" +
"All projectiles spawn healing auric orbs on enemy hits\n" +
"Max run speed and acceleration boosted by 10%\n" +
"Rogue stealth builds while not attacking and slower while moving, up to a max of 130\n" +
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor
{
player.setBonus = "Summoner Tarragon, Bloodflare and Silva armor effects\n" +
"All projectiles spawn healing auric orbs on enemy hits\n" +
"Max run speed and acceleration boosted by 10%\n" +
"Max run speed and acceleration boosted by 5%\n" +
"+6 max minions and 90% increased minion damage";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.tarraSet = true;
+3 -3
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auric Tesla Wire-Hemmed Visage");
Tooltip.SetDefault("20% increased magic damage and critical strike chance, +100 max mana, and 20% reduced mana usage\n" +
Tooltip.SetDefault("30% increased magic damage, 20% increased magic critical strike chance, +100 max mana and 20% reduced mana usage\n" +
"Not moving boosts all damage and critical strike chance");
}
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Armor
{
player.setBonus = "Magic Tarragon, Bloodflare and Silva armor effects\n" +
"All projectiles spawn healing auric orbs on enemy hits\n" +
"Max run speed and acceleration boosted by 10%";
"Max run speed and acceleration boosted by 5%";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.tarraSet = true;
modPlayer.tarraMage = true;
@@ -65,7 +65,7 @@ namespace CalamityMod.Items.Armor
CalamityPlayer modPlayer = player.Calamity();
modPlayer.auricBoost = true;
player.manaCost *= 0.8f;
player.magicDamage += 0.2f;
player.magicDamage += 0.3f;
player.magicCrit += 20;
player.statManaMax2 += 100;
}
+2 -2
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor
{
DisplayName.SetDefault("Bloodflare Hydra Hood");
Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" +
"10% increased magic damage and critical strike chance, +100 max mana, and 17% reduced mana usage");
"20% increased magic damage, 10% increased magic critical strike chance, +100 max mana and 17% reduced mana usage");
}
public override void SetDefaults()
@@ -71,7 +71,7 @@ namespace CalamityMod.Items.Armor
player.manaCost *= 0.83f;
player.lavaMax += 240;
player.ignoreWater = true;
player.magicDamage += 0.1f;
player.magicDamage += 0.2f;
player.magicCrit += 10;
player.statManaMax2 += 100;
}
+2 -2
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Prismatic Helmet");
Tooltip.SetDefault("8% increased magic damage and 12% increased magic crit\n" +
Tooltip.SetDefault("18% increased magic damage and 12% increased magic crit\n" +
"20% decreased non-magic damage\n" +
"Enemies with less than 500 max health deal no contact damage\n" +
"This does not occur while a boss is alive");
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor
player.Calamity().prismaticHelmet = true;
player.allDamage -= 0.2f;
player.magicDamage += 0.2f;
player.magicDamage += 0.08f;
player.magicDamage += 0.18f;
player.magicCrit += 12;
}
+3 -3
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Silva Masked Cap");
Tooltip.SetDefault("13% increased magic damage and critical strike chance\n" +
Tooltip.SetDefault("23% increased magic damage and 13% increased magic critical strike chance\n" +
"+100 max mana and 19% reduced mana usage");
}
@@ -47,13 +47,13 @@ namespace CalamityMod.Items.Armor
"Max run speed and acceleration boosted by 5%\n" +
"If you are reduced to 1 HP you will not die from any further damage for 8 seconds\n" +
"This effect only triggers once per life\n" +
"Magic projectiles have a 10% chance to cause a massive explosion on enemy hits";
"Magic projectiles which cannot pierce will occasionally set off potent blasts of nature energy";
}
public override void UpdateEquip(Player player)
{
player.manaCost *= 0.81f;
player.magicDamage += 0.13f;
player.magicDamage += 0.23f;
player.magicCrit += 13;
player.statManaMax2 += 100;
}
+2 -2
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor
DisplayName.SetDefault("Tarragon Mask");
Tooltip.SetDefault("Temporary immunity to lava\n" +
"Can move freely through liquids\n" +
"10% increased magic damage and critical strike chance\n" +
"20% increased magic damage and 10% increased magic critical strike chance\n" +
"5% increased damage reduction, +100 max mana, and 15% reduced mana usage");
}
@@ -71,7 +71,7 @@ namespace CalamityMod.Items.Armor
public override void UpdateEquip(Player player)
{
player.manaCost *= 0.85f;
player.magicDamage += 0.1f;
player.magicDamage += 0.2f;
player.magicCrit += 10;
player.endurance += 0.05f;
player.lavaMax += 240;
+3 -13
View File
@@ -82,7 +82,6 @@ namespace CalamityMod.Items
public bool challengeDrop = false;
public bool canFirePointBlankShots = false;
public bool trueMelee = false;
public bool rogueClockworkWeapon = false;
public static readonly Color ExhumedTooltipColor = new Color(198, 27, 64);
@@ -684,10 +683,6 @@ namespace CalamityMod.Items
item.mana = 7;
break;
case ItemID.LaserMachinegun:
item.damage = 39;
break;
case ItemID.StardustDragonStaff:
item.damage = 20;
item.useTime = 19;
@@ -846,7 +841,7 @@ namespace CalamityMod.Items
{
speedX *= modPlayer.throwingVelocity;
speedY *= modPlayer.throwingVelocity;
if (modPlayer.gloveOfRecklessness && !rogueClockworkWeapon)
if (modPlayer.gloveOfRecklessness && item.useTime == item.useAnimation)
{
Vector2 rotated = new Vector2(speedX, speedY);
rotated = rotated.RotatedByRandom(MathHelper.ToRadians(6f));
@@ -1104,7 +1099,7 @@ namespace CalamityMod.Items
#region Saving And Loading
public override bool NeedsSaving(Item item)
{
return rogue || canFirePointBlankShots || trueMelee || rogueClockworkWeapon || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0;
return rogue || canFirePointBlankShots || trueMelee || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0;
}
public override TagCompound Save(Item item)
@@ -1119,8 +1114,7 @@ namespace CalamityMod.Items
["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0,
["DischargeEnchantExhaustion"] = DischargeEnchantExhaustion,
["canFirePointBlankShots"] = canFirePointBlankShots,
["trueMelee"] = trueMelee,
["rogueClockworkWeapon"] = rogueClockworkWeapon
["trueMelee"] = trueMelee
};
}
@@ -1129,7 +1123,6 @@ namespace CalamityMod.Items
rogue = tag.GetBool("rogue");
canFirePointBlankShots = tag.GetBool("canFirePointBlankShots");
trueMelee = tag.GetBool("trueMelee");
rogueClockworkWeapon = tag.GetBool("rogueClockworkWeapon");
timesUsed = tag.GetInt("timesUsed");
customRarity = (CalamityRarity)tag.GetInt("rarity");
@@ -1164,7 +1157,6 @@ namespace CalamityMod.Items
rogue = flags[0];
canFirePointBlankShots = flags[1];
trueMelee = flags[2];
rogueClockworkWeapon = flags[3];
}
else
{
@@ -1178,7 +1170,6 @@ namespace CalamityMod.Items
flags[0] = rogue;
flags[1] = canFirePointBlankShots;
flags[2] = trueMelee;
flags[3] = rogueClockworkWeapon;
writer.Write(flags);
writer.Write((int)customRarity);
@@ -1195,7 +1186,6 @@ namespace CalamityMod.Items
rogue = flags[0];
canFirePointBlankShots = flags[1];
trueMelee = flags[2];
rogueClockworkWeapon = flags[3];
customRarity = (CalamityRarity)reader.ReadInt32();
timesUsed = reader.ReadInt32();
+17 -13
View File
@@ -17,21 +17,25 @@ namespace CalamityMod.Items.DifficultyItems
{
DisplayName.SetDefault("Malice");
Tooltip.SetDefault("Enables/disables Malice Mode.\n" +
// Overall description and warning lines
"[c/c01818:This mode is intentionally extremely hard. You should prepare as much as possible.]\n" +
"[c/c01818:You will need to master a boss inside and out to defeat it on-tier.]\n" +
"While enabled, bosses will drop Challenge and Legendary Challenge items.\n" +
// Misc lines
"Greatly nerfs the effectiveness of life steal.\n" +
"Nerfs the effectiveness of the Titanium Armor set bonus, doesn't stack with Revengeance Mode.\n" +
"The Nurse no longer heals you while a boss is alive.\n" +
"Defense damage is 5% higher than Death Mode.\n" +
"Increases damage done by 50% for several debuffs and all alcohols that reduce life regen.\n" +
// Misc lines
"Greatly nerfs the effectiveness of life steal.\n" +
"Nerfs the effectiveness of the Titanium Armor set bonus, doesn't stack with Revengeance Mode.\n" +
"The Nurse no longer heals you while a boss is alive.\n" +
"Defense damage is 5% higher than Death Mode.\n" +
"Increases damage done by 50% for several debuffs and all alcohols that reduce life regen.\n" +
// Boss lines
"All boss minions no longer drop hearts.\n" +
"Gives every boss a new enraged AI and allows them to drop special items.\n" +
"Bosses and their projectiles deal 35% more damage.\n" +
"Most bosses will enter later phases sooner if the fight has gone on for a long time.\n" +
"Increases the velocity of most boss projectiles by 25%, this is increased to 35% during Boss Rush.\n" +
"Boss reactive DR is always active outside of Boss Rush and is increased by 50%.");
// Boss lines
"All boss minions no longer drop hearts.\n" +
"Gives every boss a new enraged AI and allows them to drop special items.\n" +
"Bosses and their projectiles deal 35% more damage.\n" +
"Most bosses will enter later phases sooner if the fight has gone on for a long time.\n" +
"Increases the velocity of most boss projectiles by 25%, this is increased to 35% during Boss Rush.\n" +
"Boss reactive DR is always active outside of Boss Rush and is increased by 50%.");
}
public override void SetDefaults()
+26 -4
View File
@@ -1,5 +1,8 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.LoreItems
{
@@ -23,17 +26,36 @@ namespace CalamityMod.Items.LoreItems
public override bool CanUseItem(Player player) => false;
// Requires an Exo Mechs trophy.
/*
public override void AddRecipes()
{
ModRecipe r = new ModRecipe(mod);
r.SetResult(this);
r.AddTile(TileID.Bookcases);
r.AddIngredient(ModContent.ItemType<SupremeCalamitasTrophy>());
r.AddIngredient(ModContent.ItemType<ArtemisTrophy>());
r.AddIngredient(ModContent.ItemType<VictoryShard>(), 10);
r.AddRecipe();
r = new ModRecipe(mod);
r.SetResult(this);
r.AddTile(TileID.Bookcases);
r.AddIngredient(ModContent.ItemType<ApolloTrophy>());
r.AddIngredient(ModContent.ItemType<VictoryShard>(), 10);
r.AddRecipe();
r = new ModRecipe(mod);
r.SetResult(this);
r.AddTile(TileID.Bookcases);
r.AddIngredient(ModContent.ItemType<ThanatosTrophy>());
r.AddIngredient(ModContent.ItemType<VictoryShard>(), 10);
r.AddRecipe();
r = new ModRecipe(mod);
r.SetResult(this);
r.AddTile(TileID.Bookcases);
r.AddIngredient(ModContent.ItemType<AresTrophy>());
r.AddIngredient(ModContent.ItemType<VictoryShard>(), 10);
r.AddRecipe();
}
*/
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Placeables.Furniture
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Weightless Candle");
Tooltip.SetDefault("When placed, nearby players gain 10% movement speed, 10% wing time, and 5% acceleration\n" +
Tooltip.SetDefault("When placed, nearby players gain 10% movement speed, 10% wing time and 5% acceleration\n" +
"'The floating flame seems to uplift your very spirit'");
}
+14 -30
View File
@@ -2,7 +2,6 @@ using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,16 +10,18 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class Climax : ModItem
{
public const int OrbFireRate = 10;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Voltaic Climax");
Tooltip.SetDefault("Fires a circular spread of magnetic orbs around the mouse cursor");
Tooltip.SetDefault("Conjures an octagon of supercharged magnet spheres around the cursor");
Item.staff[item.type] = true;
}
public override void SetDefaults()
{
item.damage = 105;
item.damage = 122;
item.magic = true;
item.mana = 30;
item.width = 78;
@@ -46,34 +47,17 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float num72 = item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
int numOrbs = 8;
Vector2 clickPos = Main.MouseWorld;
float orbSpeed = 14f;
Vector2 vel = Main.rand.NextVector2CircularEdge(orbSpeed, orbSpeed);
for (int i = 0; i < numOrbs; i++)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
}
else
{
num80 = num72 / num80;
}
vector2 += new Vector2(num78, num79);
float spread = 45f * 0.0174f;
double startAngle = Math.Atan2(speedX, speedY) - spread / 2;
double deltaAngle = spread / 8f;
double offsetAngle;
for (int i = 0; i < 4; i++)
{
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), type, damage, knockBack, player.whoAmI, 1f, 0f);
Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), type, damage, knockBack, player.whoAmI, 0f, 0f);
// Choose random firing stagger values for each orb to create a desynchronized barrage of lasers
float timingStagger = Main.rand.Next(OrbFireRate);
Projectile.NewProjectile(clickPos, vel, type, damage, knockBack, player.whoAmI, ai0: timingStagger);
vel = vel.RotatedBy(MathHelper.TwoPi / numOrbs);
}
return false;
}
+7 -7
View File
@@ -20,13 +20,13 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 155;
item.damage = 328;
item.magic = true;
item.mana = 12;
item.mana = 16;
item.width = 80;
item.height = 84;
item.useTime = 8;
item.useAnimation = 16;
item.useTime = 11;
item.useAnimation = 22;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 4f;
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.DarkBlue;
item.UseSound = SoundID.Item12;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<MagicNebulaShot>();
item.shoot = ModContent.ProjectileType<DeathhailBeam>();
item.shootSpeed = 18f;
}
@@ -78,8 +78,8 @@ namespace CalamityMod.Items.Weapons.Magic
num80 = num72 / num80;
}
int num107 = 2;
for (int num108 = 0; num108 < num107; num108++)
int numLasers = 2;
for (int num108 = 0; num108 < numLasers; num108++)
{
vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(91) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.width = 112;
item.height = 112;
item.magic = true;
item.damage = 3875;
item.damage = 2838;
item.knockBack = 9.5f;
item.mana = 26;
item.useAnimation = 37;
+12 -9
View File
@@ -8,6 +8,8 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class Purge : ModItem
{
public const int UseTime = 20;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nano Purge");
@@ -16,13 +18,12 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 50;
item.damage = 73;
item.magic = true;
item.mana = 6;
item.width = 20;
item.height = 12;
item.useTime = 20;
item.useAnimation = 20;
item.width = 62;
item.height = 34;
item.useTime = item.useAnimation = UseTime;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.noUseGraphic = true;
@@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Magic
item.rare = ItemRarityID.Cyan;
item.value = CalamityGlobalItem.Rarity9BuyPrice;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<PurgeProj>();
item.shootSpeed = 24f;
item.shoot = ModContent.ProjectileType<NanoPurgeHoldout>();
item.shootSpeed = 16f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
@@ -40,8 +41,8 @@ namespace CalamityMod.Items.Weapons.Magic
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FragmentVortex, 20);
recipe.AddIngredient(ItemID.LaserMachinegun);
recipe.AddIngredient(ItemID.FragmentVortex, 20);
recipe.AddIngredient(ItemID.Nanites, 100);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
@@ -50,7 +51,9 @@ namespace CalamityMod.Items.Weapons.Magic
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<PurgeProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
Vector2 shootVelocity = new Vector2(speedX, speedY);
Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction);
Projectile.NewProjectile(position, shootDirection, type, damage, knockBack, player.whoAmI);
return false;
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 175;
item.damage = 242;
item.magic = true;
item.mana = 78;
item.width = 38;
+19 -12
View File
@@ -10,32 +10,34 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class T1000 : ModItem
{
public const int UseTime = 36;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("T1000");
Tooltip.SetDefault("Fires a spread of rainbow lasers");
DisplayName.SetDefault("Aetherflux Cannon");
Tooltip.SetDefault("Fires a barrage of phased god rays that pass through terrain");
}
public override void SetDefaults()
{
item.damage = 250;
item.damage = 171;
item.magic = true;
item.mana = 10;
item.width = 20;
item.height = 12;
item.useTime = 12;
item.useAnimation = 12;
item.mana = 8;
item.width = 94;
item.height = 54;
item.useTime = item.useAnimation = UseTime;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.noUseGraphic = true;
item.channel = true;
item.knockBack = 4f;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
item.rare = ItemRarityID.Purple;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<T1000Proj>();
item.shoot = ModContent.ProjectileType<AetherfluxCannonHoldout>();
item.shootSpeed = 24f;
item.rare = ItemRarityID.Purple;
item.Calamity().customRarity = CalamityRarity.Violet;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
@@ -44,7 +46,10 @@ namespace CalamityMod.Items.Weapons.Magic
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<Purge>());
recipe.AddIngredient(ModContent.ItemType<PurgeGuzzler>());
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 12);
recipe.AddIngredient(ModContent.ItemType<DivineGeode>(), 8);
recipe.AddTile(ModContent.TileType<CosmicAnvil>());
recipe.SetResult(this);
recipe.AddRecipe();
@@ -52,7 +57,9 @@ namespace CalamityMod.Items.Weapons.Magic
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<T1000Proj>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
Vector2 shootVelocity = new Vector2(speedX, speedY);
Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction);
Projectile.NewProjectile(position, shootDirection, type, damage, knockBack, player.whoAmI);
return false;
}
}
+16 -13
View File
@@ -6,46 +6,49 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class Vehemenc : ModItem
public class Vehemenc : ModItem
{
public const int VehemenceSkullDamage = 1250;
public const int BaseDamage = 5185;
public const float SkullRatio = 0.08f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Vehemence");
Tooltip.SetDefault("Casts an intense energy blast\n" +
"Does far more damage the more HP an enemy has left\n" +
"Max damage is capped at 200,000\n" +
"If an enemy has full HP it will inflict Demon Flames for an extremely long time");
Tooltip.SetDefault("Casts intense bolts of hellish power that explode into skulls\n" +
"Direct hits inflict Demon Flames for an extended period of time");
Item.staff[item.type] = true;
}
public override void SetDefaults()
{
item.damage = 3;
item.damage = BaseDamage;
item.magic = true;
item.mana = 590;
item.mana = 41;
item.width = 44;
item.height = 44;
item.useTime = item.useAnimation = 50;
item.useTime = item.useAnimation = 43;
item.noUseGraphic = true;
item.channel = true;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 5.75f;
item.value = Item.buyPrice(1, 0, 0, 0);
item.rare = ItemRarityID.Red;
item.UseSound = SoundID.Item73;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<VehemenceHoldout>();
item.shootSpeed = 16f;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.Violet;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
}
public override Vector2? HoldoutOrigin() => new Vector2(25, 25);
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, Vector2.Zero, type, damage, knockBack, player.whoAmI);
player.AddBuff(BuffID.ManaSickness, 600, true);
Item v = player.ActiveItem();
int chargeTime = 2 * v.useAnimation;
Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, chargeTime);
return false;
}
+19 -33
View File
@@ -1,6 +1,5 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,16 +8,18 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class VoidVortex : ModItem
{
public const int OrbFireRate = 16;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Void Vortex");
Tooltip.SetDefault("Fires a circular spread of magnetic orbs around the mouse cursor");
Tooltip.SetDefault("Conjures a swirling vortex of supercharged magnet spheres around the cursor");
Item.staff[item.type] = true;
}
public override void SetDefaults()
{
item.damage = 88;
item.damage = 140;
item.magic = true;
item.mana = 60;
item.width = 130;
@@ -45,37 +46,22 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float num72 = item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
int numOrbs = 12;
Vector2 clickPos = Main.MouseWorld;
float orbDistance = 48f;
float orbSpeed = 5f;
float spinCoinflip = Main.rand.NextBool() ? -1f : 1f;
Vector2 dir = Main.rand.NextVector2Unit();
for (int i = 0; i < numOrbs; i++)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
}
else
{
num80 = num72 / num80;
}
vector2 += new Vector2(num78, num79);
float spread = 45f * 0.0174f;
double startAngle = Math.Atan2(speedX, speedY) - spread / 2;
double deltaAngle = spread / 8f;
double offsetAngle;
int i;
float passedVar = 1f;
for (i = 0; i < 4; i++)
{
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), type, damage, knockBack, player.whoAmI, passedVar, 0f);
Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), type, damage, knockBack, player.whoAmI, -passedVar, 0f);
passedVar += 1f;
Vector2 orbPos = clickPos + dir * orbDistance;
Vector2 vel = dir.RotatedBy(spinCoinflip * MathHelper.PiOver2) * orbSpeed;
// Choose random firing stagger values for each orb to create a desynchronized barrage of lasers
float timingStagger = Main.rand.Next(OrbFireRate);
Projectile.NewProjectile(orbPos, vel, type, damage, knockBack, player.whoAmI, timingStagger, spinCoinflip);
dir = dir.RotatedBy(MathHelper.TwoPi / numOrbs);
}
return false;
}
+10 -9
View File
@@ -8,20 +8,23 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public class Condemnation : ModItem
{
public const int MaxLoadedArrows = 8;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Condemnation");
Tooltip.SetDefault("Left clicks allows you to charge the repeater and release more arrows the longer the charge lasts\n" +
"Right clicks release fast moving arrows");
Tooltip.SetDefault("Fires powerful scarlet bolts suffused with hateful magics\n" +
"Hold left click to load up to eight bolts for powerful burst fire\n" +
"Hold right click to use the repeater full auto");
}
public override void SetDefaults()
{
item.damage = 566;
item.damage = 1914;
item.ranged = true;
item.width = 130;
item.height = 42;
item.useTime = item.useAnimation = 16;
item.useTime = item.useAnimation = 23;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 5f;
@@ -32,8 +35,8 @@ namespace CalamityMod.Items.Weapons.Ranged
item.shoot = ModContent.ProjectileType<CondemnationArrow>();
item.shootSpeed = 14.5f;
item.useAmmo = AmmoID.Arrow;
item.Calamity().canFirePointBlankShots = true;
}
item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset() => new Vector2(-50f, 0f);
@@ -57,8 +60,6 @@ namespace CalamityMod.Items.Weapons.Ranged
return base.CanUseItem(player);
}
public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.7f : 1f;
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 shootVelocity = new Vector2(speedX, speedY);
@@ -73,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Ranged
// Charge-up. Done via a holdout projectile.
else
Projectile.NewProjectile(position, shootDirection, ModContent.ProjectileType<CondemnationHoldout>(), 0, knockBack, player.whoAmI);
Projectile.NewProjectile(position, shootDirection, ModContent.ProjectileType<CondemnationHoldout>(), 0, 0f, player.whoAmI);
return false;
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 272;
item.damage = 198;
item.ranged = true;
item.width = 64;
item.height = 28;
+13 -10
View File
@@ -1,6 +1,4 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
@@ -12,6 +10,8 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public class Drataliornus : ModItem
{
private const double RightClickDamageRatio = 0.6;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Drataliornus");
@@ -24,7 +24,7 @@ Right click to fire two devastating barrages of five empowered fireballs.
public override void SetDefaults()
{
item.damage = 124;
item.damage = 129;
item.knockBack = 1f;
item.shootSpeed = 18f;
item.useStyle = ItemUseStyleID.HoldingOut;
@@ -61,10 +61,10 @@ Right click to fire two devastating barrages of five empowered fireballs.
else
{
item.noUseGraphic = true;
if (player.ownedProjectileCounts[item.shoot] > 0)
{
if (player.ownedProjectileCounts[item.shoot] > 0)
{
return false;
}
}
}
return base.CanUseItem(player);
}
@@ -73,16 +73,19 @@ Right click to fire two devastating barrages of five empowered fireballs.
{
if (player.altFunctionUse == 2) //tsunami
{
int flameID = ModContent.ProjectileType<DrataliornusFlame>();
const int numFlames = 5;
int flameDamage = (int)(damage * RightClickDamageRatio);
const float num3 = 0.471238898f;
const int num4 = 5;
Vector2 spinningpoint = new Vector2(speedX, speedY);
spinningpoint.Normalize();
spinningpoint *= 36f;
for (int index1 = 0; index1 < num4; ++index1)
for (int index1 = 0; index1 < numFlames; ++index1)
{
float num8 = index1 - (num4 - 1) / 2;
float num8 = index1 - (numFlames - 1) / 2;
Vector2 vector2_5 = spinningpoint.RotatedBy(num3 * num8, new Vector2());
Projectile.NewProjectile(position.X + vector2_5.X, position.Y + vector2_5.Y, speedX, speedY, ModContent.ProjectileType<DrataliornusFlame>(), (int)(damage * 0.69), knockBack, player.whoAmI, 1f, 0f);
Projectile.NewProjectile(position.X + vector2_5.X, position.Y + vector2_5.Y, speedX, speedY, flameID, flameDamage, knockBack, player.whoAmI, 1f, 0f);
}
}
else
+2 -7
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 390;
item.damage = 275;
item.ranged = true;
item.width = 72;
item.height = 34;
@@ -50,12 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return false;
}
public override bool ConsumeAmmo(Player player)
{
if (Main.rand.Next(0, 100) < 80)
return false;
return true;
}
public override bool ConsumeAmmo(Player player) => Main.rand.NextFloat() > 0.8f;
public override void AddRecipes()
{
-1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.shoot = ModContent.ProjectileType<AshenStalactiteProj>();
item.shootSpeed = 15f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
-1
View File
@@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.shoot = ModContent.ProjectileType<CosmicKunaiProj>();
item.shootSpeed = 28f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
-1
View File
@@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.shoot = ModContent.ProjectileType<EquanimityProj>();
item.shootSpeed = 30f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+5 -2
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void SafeSetDefaults()
{
item.width = 38;
item.damage = 685;
item.damage = 640;
item.noMelee = true;
item.noUseGraphic = true;
item.autoReuse = true;
@@ -42,11 +42,14 @@ namespace CalamityMod.Items.Weapons.Rogue
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.Calamity().StealthStrikeAvailable())
damage = (int)(damage * 0.25f);
damage = (int)(damage * 0.5f);
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
{
Main.projectile[proj].timeLeft += EradicatorProjectile.StealthExtraLifetime;
Main.projectile[proj].Calamity().stealthStrike = true;
}
return false;
}
-1
View File
@@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.shoot = ModContent.ProjectileType<ExecutionersBladeProj>();
item.shootSpeed = 26f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
-1
View File
@@ -34,7 +34,6 @@ Stealth strike throws a volley of knives");
item.shoot = ModContent.ProjectileType<FeatherKnifeProjectile>();
item.shootSpeed = 25f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
item.value = Item.sellPrice(copper: 60);
item.rare = ItemRarityID.Orange;
-1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.shoot = ModContent.ProjectileType<GhoulishGougerBoomerang>();
item.shootSpeed = 16f;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
item.value = CalamityGlobalItem.Rarity13BuyPrice;
item.Calamity().customRarity = CalamityRarity.PureGreen;
-1
View File
@@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().customRarity = CalamityRarity.DarkBlue;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
+1 -1
View File
@@ -105,7 +105,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
float baseMultiplier = SafeSetUseTimeMultiplier(player);
float rogueAS = baseMultiplier == -1f ? 1f : baseMultiplier;
if (!item.Calamity().rogueClockworkWeapon)
if (item.useTime == item.useAnimation)
{
if (player.Calamity().gloveOfPrecision)
rogueAS -= 0.2f;
+8 -7
View File
@@ -12,29 +12,30 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sacrifice");
Tooltip.SetDefault("Releases a dagger that sticks to enemies\n" +
"Right clicking causes all stuck daggers to fly back at you and give you life\n" +
Tooltip.SetDefault("Throws sacrificial daggers that lodge themselves in enemies\n" +
"Right click causes all stuck daggers to fly back at you and give you life\n" +
"Daggers stuck to enemies release bloodsplosions over time\n" +
"Stealth strikes provide much more life when returning to you");
}
public override void SafeSetDefaults()
{
item.damage = 266;
item.damage = 290;
item.width = item.height = 68;
item.useAnimation = item.useTime = 6;
item.useAnimation = item.useTime = 9;
item.noMelee = true;
item.noUseGraphic = true;
item.useStyle = ItemUseStyleID.SwingThrow;
item.knockBack = 4f;
item.rare = ItemRarityID.Purple;
item.Calamity().customRarity = CalamityRarity.Violet;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.shoot = ModContent.ProjectileType<SacrificeProjectile>();
item.shootSpeed = 12f;
item.Calamity().rogue = true;
item.rare = ItemRarityID.Purple;
item.Calamity().customRarity = CalamityRarity.Violet;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
}
public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[item.shoot] > 0;
-1
View File
@@ -20,7 +20,6 @@ Does not consume stealth and cannot stealth strike");
item.width = 72;
item.damage = 52;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
item.noMelee = true;
item.noUseGraphic = true;
item.channel = true;
-1
View File
@@ -25,7 +25,6 @@ namespace CalamityMod.Items.Weapons.Rogue
item.height = 66;
item.damage = 333;
item.Calamity().rogue = true;
item.Calamity().rogueClockworkWeapon = true;
item.knockBack = 8f;
item.noMelee = true;
item.noUseGraphic = true;
+3 -3
View File
@@ -506,8 +506,8 @@ namespace CalamityMod
BossDifficulty.TryGetValue("StormWeaver", out float order);
List<int> segments = new List<int>() { NPCType<StormWeaverHead>(), NPCType<StormWeaverBody>(), NPCType<StormWeaverTail>() };
int summon = ItemType<RuneofCos>();
List<int> loot = new List<int>() { ItemType<StormWeaverBag>(), ItemType<ArmoredShell>(), ItemType<TheStorm>(), ItemType<StormDragoon>(), ItemType<LittleLight>(), ItemType<SupremeHealingPotion>() };
List<int> collection = new List<int>() { ItemType<WeaverTrophy>(), ItemType<StormWeaverMask>(), ItemType<GodSlayerHornedHelm>(), ItemType<GodSlayerVisage>(), ItemType<AncientGodSlayerHelm>(), ItemType<AncientGodSlayerChestplate>(), ItemType<AncientGodSlayerLeggings>(), ItemType<KnowledgeSentinels>() };
List<int> loot = new List<int>() { ItemType<StormWeaverBag>(), ItemType<ArmoredShell>(), ItemType<TheStorm>(), ItemType<StormDragoon>(), ItemType<SupremeHealingPotion>() };
List<int> collection = new List<int>() { ItemType<WeaverTrophy>(), ItemType<StormWeaverMask>(), ItemType<GodSlayerHornedHelm>(), ItemType<GodSlayerVisage>(), ItemType<AncientGodSlayerHelm>(), ItemType<AncientGodSlayerChestplate>(), ItemType<AncientGodSlayerLeggings>(), ItemType<KnowledgeSentinels>(), ItemType<LittleLight>() };
string instructions = $"Use a [i:{summon}] in Space";
string despawn = CalamityUtils.ColorMessage("Storm Weaver hid itself once again within the stormfront.", new Color(0xEE, 0x82, 0xEE));
string bossLogTex = "CalamityMod/NPCs/StormWeaver/StormWeaver_BossChecklist";
@@ -556,7 +556,7 @@ namespace CalamityMod
int type = NPCType<DevourerofGodsHead>();
int summon = ItemType<CosmicWorm>();
List<int> loot = new List<int>() { ItemType<DevourerofGodsBag>(), ItemType<CosmiliteBar>(), ItemType<CosmiliteBrick>(), ItemType<Excelsus>(), ItemType<TheObliterator>(), ItemType<Deathwind>(), ItemType<DeathhailStaff>(), ItemType<StaffoftheMechworm>(), ItemType<Eradicator>(), ItemType<Skullmasher>(), ItemType<Norfleet>(), ItemType<CosmicDischarge>(), ItemType<NebulousCore>(), ItemType<Fabsol>(), ItemType<OmegaHealingPotion>() };
List<int> collection = new List<int>() { ItemType<DevourerofGodsTrophy>(), ItemType<DevourerofGodsMask>(), ItemType<SilvaHornedHelm>(), ItemType<SilvaMask>(), ItemType<KnowledgeDevourerofGods>() };
List<int> collection = new List<int>() { ItemType<DevourerofGodsTrophy>(), ItemType<DevourerofGodsMask>(), ItemType<SilvaHelm>(), ItemType<SilvaHornedHelm>(), ItemType<SilvaMask>(), ItemType<KnowledgeDevourerofGods>() };
string instructions = $"Use a [i:{summon}]";
string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF));
string bossLogTex = "CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist";
@@ -67,6 +67,7 @@ namespace CalamityMod.NPCs.AquaticScourge
{
writer.Write(npc.chaseable);
writer.Write(npc.localAI[1]);
writer.Write(npc.localAI[2]);
for (int i = 0; i < 4; i++)
writer.Write(npc.Calamity().newAI[i]);
}
@@ -75,6 +76,7 @@ namespace CalamityMod.NPCs.AquaticScourge
{
npc.chaseable = reader.ReadBoolean();
npc.localAI[1] = reader.ReadSingle();
npc.localAI[2] = reader.ReadSingle();
for (int i = 0; i < 4; i++)
npc.Calamity().newAI[i] = reader.ReadSingle();
}
+52 -13
View File
@@ -99,8 +99,22 @@ namespace CalamityMod.NPCs
player.position.Y > Main.worldSurface * 16.0 ||
(player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
// Enrage
if (head)
{
if (notOcean && !player.Calamity().ZoneSulphur && !BossRushEvent.BossRushActive)
{
if (npc.localAI[2] > 0f)
npc.localAI[2] -= 1f;
}
else
npc.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax;
}
bool biomeEnraged = npc.localAI[2] <= 0f || malice;
float enrageScale = 0f;
if ((!player.Calamity().ZoneSulphur && notOcean) || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 2f;
@@ -689,10 +703,24 @@ namespace CalamityMod.NPCs
bool phase2 = lifeRatio < 0.5f && revenge;
bool phase3 = lifeRatio < 0.33f;
// Enrage
if ((!player.ZoneUnderworldHeight || !modPlayer.ZoneCalamity) && !BossRushEvent.BossRushActive)
{
if (calamityGlobalNPC.newAI[3] > 0f)
calamityGlobalNPC.newAI[3] -= 1f;
}
else
calamityGlobalNPC.newAI[3] = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f || malice;
float enrageScale = 0f;
if (!player.ZoneUnderworldHeight || malice)
if (biomeEnraged && (!player.ZoneUnderworldHeight || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
if (!modPlayer.ZoneCalamity || malice)
}
if (biomeEnraged && (!modPlayer.ZoneCalamity || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
@@ -759,7 +787,7 @@ namespace CalamityMod.NPCs
int phase;
int random = phase2 ? 6 : 5;
do phase = Main.rand.Next(random);
while (phase == npc.ai[1] || (phase == 0 && phase3) || phase == 1 || phase == 2 || (phase == 4 && npc.localAI[3] != 0f));
while (phase == npc.ai[1] || (phase == 0 && phase3 && revenge) || phase == 1 || phase == 2 || (phase == 4 && npc.localAI[3] != 0f));
npc.ai[0] = phase;
npc.ai[1] = 0f;
@@ -1097,6 +1125,8 @@ namespace CalamityMod.NPCs
// Laser beam attack
else if (npc.ai[0] == 5f)
{
npc.chaseable = true;
npc.defense = npc.defDefense * 2;
Vector2 source = new Vector2(vectorCenter.X + (npc.spriteDirection > 0 ? 34f : -34f), vectorCenter.Y - 74f);
@@ -4594,17 +4624,14 @@ namespace CalamityMod.NPCs
npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs;
npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// If target is outside the jungle for more than 3 seconds, enrage
// If target is outside the jungle for more than 5 seconds, enrage
if (!player.ZoneJungle)
{
if (npc.localAI[1] < 300f)
if (npc.localAI[1] < CalamityGlobalNPC.biomeEnrageTimerMax)
npc.localAI[1] += 1f;
}
else
{
if (npc.localAI[1] > 0f)
npc.localAI[1] -= 1f;
}
npc.localAI[1] = 0f;
// If dragonfolly is off screen, enrage for the next couple attacks
if (Vector2.Distance(player.Center, vector) > 1200f)
@@ -4612,7 +4639,7 @@ namespace CalamityMod.NPCs
// Enrage scale
float enrageScale = death ? 1.5f : 1f;
if (npc.localAI[1] >= 300f || malice)
if (npc.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax || malice)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
@@ -5439,14 +5466,26 @@ namespace CalamityMod.NPCs
bool enrage = !BossRushEvent.BossRushActive &&
(player.position.Y < 300f || player.position.Y > Main.worldSurface * 16.0 ||
(player.position.X > 8000f && player.position.X < (Main.maxTilesX * 16 - 8000)));
npc.Calamity().CurrentlyEnraged = enrage || enraged;
// Enrage
if (enrage)
{
if (npc.localAI[1] > 0f)
npc.localAI[1] -= 1f;
}
else
npc.localAI[1] = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = npc.localAI[1] <= 0f || malice;
npc.Calamity().CurrentlyEnraged = biomeEnraged || enraged;
// If the player isn't in the ocean biome or Old Duke is transitioning between phases, become immune
if (!phase3AI)
npc.dontTakeDamage = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f;
// Enrage
if (enrage || enraged)
if (biomeEnraged || enraged)
{
toothBallBelchPhaseTimer = 30;
toothBallBelchPhaseDivisor = 6;
+24 -12
View File
@@ -84,6 +84,9 @@ namespace CalamityMod.NPCs
public const int DoGPhase1KillTime = 5400;
public const int DoGPhase2KillTime = 9000;
// Biome enrage timer max
public const int biomeEnrageTimerMax = 300;
public bool ShouldFallThroughPlatforms;
/// <summary>
@@ -3364,7 +3367,7 @@ namespace CalamityMod.NPCs
AstrumDeusIDs.Contains(npc.type) || StormWeaverIDs.Contains(npc.type) || ThanatosIDs.Contains(npc.type) ||
npc.type == NPCType<DarkEnergy>() || npc.type == NPCType<RavagerBody>() || AresIDs.Contains(npc.type))
{
double damageMult = AresIDs.Contains(npc.type) ? 0.75 : 0.5;
double damageMult = AresIDs.Contains(npc.type) ? 0.75 : ThanatosIDs.Contains(npc.type) ? 0.35 : 0.5;
if (item.melee && item.type != ItemType<UltimusCleaver>() && item.type != ItemType<InfernaCutter>())
damage = (int)(damage * damageMult);
}
@@ -3493,9 +3496,9 @@ namespace CalamityMod.NPCs
if (AresIDs.Contains(npc.type))
{
// 25% resist to true melee.
// 25% resist to true melee and 50% resist to Murasama.
if (projectile.Calamity().trueMelee)
damage = (int)(damage * 0.75);
damage = (int)(damage * (projectile.type == ProjectileType<MurasamaSlash>() ? 0.5 : 0.75));
// 20% resist to Eclipse's Fall stealth strike.
else if (projectile.type == ProjectileType<EclipsesSmol>())
@@ -3509,21 +3512,30 @@ namespace CalamityMod.NPCs
}
else if (ThanatosIDs.Contains(npc.type))
{
// 75% resist to Celestus.
if (projectile.type == ProjectileType<CelestusBoomerang>() || projectile.type == ProjectileType<Celestus2>())
// 75% resist to Celestus and Chicken Cannon.
if (projectile.type == ProjectileType<CelestusBoomerang>() || projectile.type == ProjectileType<Celestus2>() || projectile.type == ProjectileType<ChickenExplosion>())
damage = (int)(damage * 0.25);
// 50% resist to true melee.
else if (projectile.Calamity().trueMelee)
// 65% resist to true melee and Hadopelagic Echo.
else if (projectile.Calamity().trueMelee || projectile.type == ProjectileType<HadopelagicEchoSoundwave>() || projectile.type == ProjectileType<HadopelagicEcho2>())
damage = (int)(damage * 0.35);
// 50% resist to Vehemence skulls.
else if (projectile.type == ProjectileType<VehemenceSkull>())
damage = (int)(damage * 0.5);
// 40% resist to Wrathwing stealth strike.
else if (projectile.type == ProjectileType<WrathwingCinder>())
// 40% resist to Wrathwing stealth strike, Rancor, and Yharim's Crystal.
else if (projectile.type == ProjectileType<WrathwingCinder>() || projectile.type == ProjectileType<RancorLaserbeam>() || projectile.type == ProjectileType<YharimsCrystalBeam>())
damage = (int)(damage * 0.6);
// 25% resist to Eradicator beams.
else if (projectile.type == ProjectileType<NebulaShot>())
damage = (int)(damage * 0.75);
// 20% resist to Eradicator beams and Voltaic Climax / Void Vortex hitscan.
else if (projectile.type == ProjectileType<NebulaShot>() || projectile.type == ProjectileType<ClimaxBeam>())
damage = (int)(damage * 0.8);
// 15% resist to God Slayer Slugs, Luminite Bullets, and Gruesome Eminence.
else if (projectile.type == ProjectileID.MoonlordBullet || projectile.type == ProjectileType<GodSlayerSlugProj>() || projectile.type == ProjectileType<SpiritCongregation>())
damage = (int)(damage * 0.85);
}
else if (npc.type == NPCType<RavagerBody>())
{
+17 -3
View File
@@ -23,7 +23,8 @@ namespace CalamityMod.NPCs.Crabulon
[AutoloadBossHead]
public class CrabulonIdle : ModNPC
{
private int shotSpacing = 1000;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private int shotSpacing = 1000;
public override void SetStaticDefaults()
{
@@ -57,12 +58,14 @@ namespace CalamityMod.NPCs.Crabulon
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(biomeEnrageTimer);
writer.Write(npc.localAI[0]);
writer.Write(shotSpacing);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
biomeEnrageTimer = reader.ReadInt32();
npc.localAI[0] = reader.ReadSingle();
shotSpacing = reader.ReadInt32();
}
@@ -138,13 +141,24 @@ namespace CalamityMod.NPCs.Crabulon
else if (npc.timeLeft < 1800)
npc.timeLeft = 1800;
// Enrage
if ((!player.ZoneGlowshroom || (npc.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if ((npc.position.Y / 16f) < Main.worldSurface || malice)
if (biomeEnraged && ((npc.position.Y / 16f) < Main.worldSurface || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
}
if (!player.ZoneGlowshroom || malice)
if (biomeEnraged && (!player.ZoneGlowshroom || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
+18 -4
View File
@@ -27,7 +27,8 @@ namespace CalamityMod.NPCs.Cryogen
[AutoloadBossHead]
public class Cryogen : ModNPC
{
private int time = 0;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private int time = 0;
private int iceShard = 0;
private int currentPhase = 1;
private int teleportLocationX = 0;
@@ -66,7 +67,8 @@ namespace CalamityMod.NPCs.Cryogen
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(time);
writer.Write(biomeEnrageTimer);
writer.Write(time);
writer.Write(iceShard);
writer.Write(teleportLocationX);
writer.Write(npc.dontTakeDamage);
@@ -76,7 +78,8 @@ namespace CalamityMod.NPCs.Cryogen
public override void ReceiveExtraAI(BinaryReader reader)
{
time = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
time = reader.ReadInt32();
iceShard = reader.ReadInt32();
teleportLocationX = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
@@ -106,8 +109,19 @@ namespace CalamityMod.NPCs.Cryogen
bool revenge = CalamityWorld.revenge || malice;
bool death = CalamityWorld.death || malice;
// Enrage
if (!player.ZoneSnow && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = death ? 0.5f : 0f;
if (!player.ZoneSnow || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 2f;
+18 -4
View File
@@ -25,7 +25,8 @@ namespace CalamityMod.NPCs.DesertScourge
[AutoloadBossHead]
public class DesertScourgeHead : ModNPC
{
private bool TailSpawned = false;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private bool TailSpawned = false;
public bool playRoarSound = false;
public override void SetStaticDefaults()
@@ -69,14 +70,16 @@ namespace CalamityMod.NPCs.DesertScourge
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(playRoarSound);
writer.Write(biomeEnrageTimer);
writer.Write(playRoarSound);
for (int i = 0; i < 4; i++)
writer.Write(npc.Calamity().newAI[i]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
playRoarSound = reader.ReadBoolean();
biomeEnrageTimer = reader.ReadInt32();
playRoarSound = reader.ReadBoolean();
for (int i = 0; i < 4; i++)
npc.Calamity().newAI[i] = reader.ReadSingle();
}
@@ -101,8 +104,19 @@ namespace CalamityMod.NPCs.DesertScourge
Player player = Main.player[npc.target];
// Enrage
if (!player.ZoneDesert && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if (!player.ZoneDesert || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 2f;
+1 -1
View File
@@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.DevourerofGods
bool useOtherTextures = phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60;
Texture2D texture2D15 = useOtherTextures ? ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
+1 -1
View File
@@ -2065,7 +2065,7 @@ namespace CalamityMod.NPCs.DevourerofGods
bool useOtherTextures = phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60;
Texture2D texture2D15 = useOtherTextures ? ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadS") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
+1 -1
View File
@@ -277,7 +277,7 @@ namespace CalamityMod.NPCs.DevourerofGods
bool useOtherTextures = phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60;
Texture2D texture2D15 = useOtherTextures ? ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailS") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
+14 -2
View File
@@ -298,6 +298,10 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
if (otherExoMechWasFirst)
npc.ai[3] = 1f;
// Decrement the timer used to stop Artemis from firing lasers
if (npc.ai[3] > 1f)
npc.ai[3] -= 1f;
// Phases
bool phase2 = lifeRatio < 0.6f;
bool spawnOtherExoMechs = lifeRatio < 0.7f && npc.ai[3] == 0f;
@@ -400,7 +404,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
float chargeTime = (float)chargeDistance / chargeVelocity;
// Plasma and rocket projectile velocities
float projectileVelocity = 14f;
float projectileVelocity = 12f;
if (lastMechAlive)
projectileVelocity *= 1.2f;
else if (berserk)
@@ -861,7 +865,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
int type = ModContent.ProjectileType<ApolloRocket>();
int damage = npc.GetProjectileDamage(type);
Main.PlaySound(SoundID.Item36, npc.Center);
Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity;
Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity * 1.2f;
Vector2 offset = Vector2.Normalize(rocketVelocity) * 70f;
Projectile.NewProjectile(npc.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y);
}
@@ -1075,6 +1079,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
chargeLocations[i] = default;
ChargeComboFlash = 0f;
// Tell Apollo and Artemis to swap positions
if (npc.ai[0] < 10f)
npc.ai[0] = 10f;
npc.ai[0] += 1f;
// Tell Artemis to not fire lasers for a short time while swapping positions
npc.ai[3] = 61f;
npc.TargetClosest();
}
+135 -24
View File
@@ -17,6 +17,7 @@ using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.ID;
@@ -26,7 +27,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
{
[AutoloadBossHead]
public class AresBody : ModNPC
{
{
// Used for loot
public enum MechType
{
@@ -106,34 +107,38 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Max distance from the target before they are unable to hear sound telegraphs
private const float soundDistance = 4800f;
// Drawers for arm segments.
public static PrimitiveTrail LightningDrawer;
public static PrimitiveTrail LightningBackgroundDrawer;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("XF-09 Ares");
{
DisplayName.SetDefault("XF-09 Ares");
NPCID.Sets.TrailingMode[npc.type] = 3;
NPCID.Sets.TrailCacheLength[npc.type] = npc.oldPos.Length;
}
public override void SetDefaults()
{
public override void SetDefaults()
{
npc.npcSlots = 5f;
npc.damage = 100;
npc.width = 220;
npc.height = 252;
npc.defense = 100;
npc.height = 252;
npc.defense = 100;
npc.DR_NERD(0.35f);
npc.LifeMaxNERB(1300000, 1495000, 500000);
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
npc.aiStyle = -1;
aiType = -1;
aiType = -1;
npc.Opacity = 0f;
npc.knockBackResist = 0f;
npc.value = Item.buyPrice(3, 33, 0, 0);
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.knockBackResist = 0f;
npc.value = Item.buyPrice(3, 33, 0, 0);
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3;
bossBag = ModContent.ItemType<DraedonTreasureBag>();
@@ -146,19 +151,19 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
}
public override void SendExtraAI(BinaryWriter writer)
{
{
writer.Write(frameX);
writer.Write(frameY);
writer.Write(armsSpawned);
writer.Write(npc.dontTakeDamage);
writer.Write(npc.dontTakeDamage);
writer.Write(npc.localAI[0]);
writer.Write(npc.localAI[1]);
for (int i = 0; i < 4; i++)
writer.Write(npc.Calamity().newAI[i]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
public override void ReceiveExtraAI(BinaryReader reader)
{
frameX = reader.ReadInt32();
frameY = reader.ReadInt32();
armsSpawned = reader.ReadBoolean();
@@ -169,8 +174,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.Calamity().newAI[i] = reader.ReadSingle();
}
public override void AI()
{
public override void AI()
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
CalamityGlobalNPC.draedonExoMechPrime = npc.whoAmI;
@@ -787,10 +792,27 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Draw the enrage smoke behind Ares
SmokeDrawer.DrawSet(npc.Center);
// Draw arms.
int laserArm = NPC.FindFirstNPC(ModContent.NPCType<AresLaserCannon>());
int gaussArm = NPC.FindFirstNPC(ModContent.NPCType<AresGaussNuke>());
int teslaArm = NPC.FindFirstNPC(ModContent.NPCType<AresTeslaCannon>());
int plasmaArm = NPC.FindFirstNPC(ModContent.NPCType<AresPlasmaFlamethrower>());
Color afterimageBaseColor = EnragedState == (float)Enraged.Yes ? Color.Red : Color.White;
Color armGlowmaskColor = afterimageBaseColor;
armGlowmaskColor.A = 184;
if (laserArm != -1)
DrawArm(spriteBatch, Main.npc[laserArm].Center, armGlowmaskColor, -1, true);
if (gaussArm != -1)
DrawArm(spriteBatch, Main.npc[gaussArm].Center, armGlowmaskColor, 1, true);
if (teslaArm != -1)
DrawArm(spriteBatch, Main.npc[teslaArm].Center, armGlowmaskColor, -1, false);
if (plasmaArm != -1)
DrawArm(spriteBatch, Main.npc[plasmaArm].Center, armGlowmaskColor, 1, false);
Texture2D texture = Main.npcTexture[npc.type];
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
Color afterimageBaseColor = EnragedState == (float)Enraged.Yes ? Color.Red : Color.White;
int numAfterimages = 5;
if (CalamityConfig.Instance.Afterimages)
@@ -832,6 +854,95 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
return false;
}
internal float WidthFunction(float completionRatio)
{
return MathHelper.Lerp(0.5f, 1.3f, (float)Math.Sin(MathHelper.Pi * completionRatio)) * npc.scale;
}
internal Color ColorFunction(float completionRatio)
{
Color baseColor1 = EnragedState == (float)Enraged.Yes ? Color.Red : Color.Cyan;
Color baseColor2 = EnragedState == (float)Enraged.Yes ? Color.IndianRed : Color.Cyan;
float fadeToWhite = MathHelper.Lerp(0f, 0.65f, (float)Math.Sin(MathHelper.TwoPi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f);
Color baseColor = Color.Lerp(baseColor1, Color.White, fadeToWhite);
Color color = Color.Lerp(baseColor, baseColor2, ((float)Math.Sin(MathHelper.Pi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f) * 0.8f) * npc.Opacity;
color.A = 84;
return color;
}
internal float BackgroundWidthFunction(float completionRatio) => WidthFunction(completionRatio) * 4f;
public Color BackgroundColorFunction(float completionRatio)
{
Color backgroundColor = EnragedState == (float)Enraged.Yes ? Color.Crimson : Color.CornflowerBlue;
Color color = backgroundColor * npc.Opacity * 0.4f;
return color;
}
public void DrawArm(SpriteBatch spriteBatch, Vector2 handPosition, Color glowmaskColor, int direction, bool backArm)
{
if (LightningDrawer is null)
LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction);
if (LightningBackgroundDrawer is null)
LightningBackgroundDrawer = new PrimitiveTrail(BackgroundWidthFunction, BackgroundColorFunction, PrimitiveTrail.RigidPointRetreivalFunction);
SpriteEffects spriteDirection = direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
float distanceFromHand = npc.Distance(handPosition);
Texture2D shoulderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopShoulder");
Texture2D armTexture1 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart1");
Texture2D armSegmentTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopSegment");
Texture2D armTexture2 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart2");
Texture2D shoulderGlowmask = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopShoulderGlow");
Texture2D armSegmentGlowmask = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopSegmentGlow");
Texture2D armGlowmask2 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart2Glow");
Vector2 shoulderDrawPosition = npc.Center + new Vector2(direction * (backArm ? 176f : 232f), backArm ? -100f : -36f);
Vector2 arm1DrawPosition = shoulderDrawPosition + new Vector2(direction * (shoulderTexture.Width + 16f), 10f);
Vector2 armSegmentDrawPosition = arm1DrawPosition;
Vector2 arm1Origin = armTexture1.Size() * new Vector2((direction == 1).ToInt(), 0.5f);
Vector2 arm2Origin = armTexture2.Size() * new Vector2((direction == 1).ToInt(), 0.5f);
float arm1Rotation = MathHelper.Clamp(distanceFromHand * direction / 1200f, -0.12f, 0.12f);
float arm2Rotation = (handPosition - armSegmentDrawPosition).ToRotation();
if (direction == 1)
arm2Rotation += MathHelper.Pi;
float armSegmentRotation = arm1Rotation * 1.8f;
// Handle offsets for points.
armSegmentDrawPosition += arm1Rotation.ToRotationVector2() * direction * -2f;
Vector2 arm2DrawPosition = armSegmentDrawPosition;
arm2DrawPosition -= arm2Rotation.ToRotationVector2() * direction * 40f;
arm2DrawPosition += (arm2Rotation - MathHelper.PiOver2).ToRotationVector2() * 14f;
// Calculate colors.
Color shoulderLightColor = npc.GetAlpha(Lighting.GetColor((int)shoulderDrawPosition.X / 16, (int)shoulderDrawPosition.Y / 16));
Color arm1LightColor = npc.GetAlpha(Lighting.GetColor((int)arm1DrawPosition.X / 16, (int)arm1DrawPosition.Y / 16));
Color armSegmentLightColor = npc.GetAlpha(Lighting.GetColor((int)armSegmentDrawPosition.X / 16, (int)armSegmentDrawPosition.Y / 16));
Color arm2LightColor = npc.GetAlpha(Lighting.GetColor((int)arm2DrawPosition.X / 16, (int)arm2DrawPosition.Y / 16));
Color glowmaskAlphaColor = npc.GetAlpha(glowmaskColor);
// Draw electricity between arms.
List<Vector2> arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition + arm2Rotation.ToRotationVector2() * -direction * 20f, 250290787);
LightningBackgroundDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90);
LightningDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90);
shoulderDrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition;
arm1DrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition;
armSegmentDrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition;
arm2DrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition;
spriteBatch.Draw(armTexture1, arm1DrawPosition, null, arm1LightColor, arm1Rotation, arm1Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipHorizontally, 0f);
spriteBatch.Draw(shoulderTexture, shoulderDrawPosition, null, shoulderLightColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f);
spriteBatch.Draw(shoulderGlowmask, shoulderDrawPosition, null, glowmaskAlphaColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f);
spriteBatch.Draw(armSegmentTexture, armSegmentDrawPosition, null, armSegmentLightColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f);
spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskAlphaColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f);
spriteBatch.Draw(armTexture2, arm2DrawPosition, null, arm2LightColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f);
spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskAlphaColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f);
}
public override void BossLoot(ref string name, ref int potionType)
{
@@ -839,7 +950,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
}
public override void NPCLoot()
{
{
// Check if the other exo mechs are alive
bool exoWormAlive = false;
bool exoTwinsAlive = false;
@@ -1021,5 +1132,5 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.8f);
}
}
}
}
+6
View File
@@ -83,6 +83,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
npc.hide = true;
music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3;
}
@@ -527,6 +528,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
return false;
}
public override void DrawBehind(int index)
{
Main.instance.DrawCacheNPCProjectiles.Add(index);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
+6
View File
@@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
npc.hide = true;
music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3;
}
@@ -583,6 +584,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
return false;
}
public override void DrawBehind(int index)
{
Main.instance.DrawCacheNPCProjectiles.Add(index);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
@@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
npc.hide = true;
music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3;
}
@@ -511,6 +512,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
return false;
}
public override void DrawBehind(int index)
{
Main.instance.DrawCacheNPCProjectiles.Add(index);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
+7 -1
View File
@@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
npc.hide = true;
music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3;
}
@@ -508,7 +509,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
return false;
}
public override void DrawBehind(int index)
{
Main.instance.DrawCacheNPCProjectiles.Add(index);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
+127 -19
View File
@@ -297,10 +297,18 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
// Used to nerf Artemis laser shotgun if Apollo is in charging phase
bool nerfedLaserShotgun = false;
bool canFireLasers = true;
if (exoTwinGreenAlive)
{
nerfedLaserShotgun = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].Calamity().newAI[0] == (float)Apollo.Apollo.Phase.LineUpChargeCombo ||
Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].Calamity().newAI[0] == (float)Apollo.Apollo.Phase.ChargeCombo;
// Can only fire lasers if cooldown is less than or equal to 1
canFireLasers = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].ai[3] <= 1f;
// Set movement according to Apollo
if (npc.ai[0] >= 10f)
npc.ai[0] = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].ai[0];
}
// Check if any of the other mechs were spawned first
@@ -403,6 +411,32 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
// Spin variables
float spinRadius = 500f;
float spinLocationDistance = 50f;
Vector2 spinLocation = player.Center;
switch ((int)npc.ai[3])
{
// Laser from top
case 0:
case 1:
spinLocation.Y -= spinRadius;
break;
// Laser from bottom
case 2:
spinLocation.Y += spinRadius;
break;
// Laser from left
case 3:
spinRadius *= 1.7f;
spinLocation.X -= spinRadius;
break;
// Laser from right
case 4:
spinRadius *= 1.7f;
spinLocation.X += spinRadius;
break;
}
// Distance where Artemis stops moving
float movementDistanceGateValue = 100f;
@@ -420,10 +454,10 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack;
// Laser shotgun variables
float laserShotgunDuration = 90f;
float laserShotgunDuration = lastMechAlive ? 120f : 90f;
// If Artemis can fire projectiles, cannot fire if too close to the target
bool canFire = Vector2.Distance(npc.Center, player.Center) > 320f;
bool canFire = Vector2.Distance(npc.Center, player.Center) > 320f && canFireLasers;
// Rotation
Vector2 predictionVector = AIState == (float)Phase.Deathray ? Vector2.Zero : player.velocity * predictionAmt;
@@ -515,7 +549,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
bool flyLeft = npc.ai[0] % 2f == 0f || npc.ai[0] < 10f || !revenge;
float destinationX = flyLeft ? -750f : 750f;
float destinationY = player.Center.Y;
Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X + destinationX * 1.6f, destinationY) : AIState == (float)Phase.Deathray ? new Vector2(player.Center.X, destinationY - spinRadius) : new Vector2(player.Center.X + destinationX, destinationY);
Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X + destinationX * 1.6f, destinationY) : AIState == (float)Phase.Deathray ? spinLocation : new Vector2(player.Center.X + destinationX, destinationY);
// Add a bit of randomness to the destination, but only in specific phases where it's necessary
if (AIState == (float)Phase.Normal || AIState == (float)Phase.LaserShotgun || AIState == (float)Phase.PhaseTransition)
@@ -566,9 +600,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
if (spawnOtherExoMechs)
{
// Reset everything
if (npc.ai[0] < 10f)
npc.ai[0] = 10f;
npc.ai[0] += 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 1f;
@@ -611,9 +642,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
if (otherMechIsBerserk)
{
// Reset everything
if (npc.ai[0] < 10f)
npc.ai[0] = 10f;
npc.ai[0] += 1f;
SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -641,9 +669,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
if (otherMechIsBerserk)
{
// Reset everything
if (npc.ai[0] < 10f)
npc.ai[0] = 10f;
npc.ai[0] += 1f;
SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -986,9 +1011,34 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
if (calamityGlobalNPC.newAI[2] == 0f)
{
npc.velocity = Vector2.Zero;
spinningPoint = npc.Center + Vector2.UnitY * spinRadius;
switch ((int)npc.ai[3])
{
// Laser from top
case 0:
case 1:
spinningPoint = npc.Center + Vector2.UnitY * spinRadius;
break;
// Laser from bottom
case 2:
spinningPoint = npc.Center - Vector2.UnitY * spinRadius;
break;
// Laser from left
case 3:
spinningPoint = npc.Center + Vector2.UnitX * spinRadius;
break;
// Laser from right
case 4:
spinningPoint = npc.Center - Vector2.UnitX * spinRadius;
break;
}
npc.ai[1] = spinningPoint.X;
npc.ai[2] = spinningPoint.Y;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int type = ModContent.ProjectileType<ArtemisDeathrayTelegraph>();
@@ -997,6 +1047,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
Vector2 offset = laserVelocity * 70f;
Projectile.NewProjectile(npc.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, npc.whoAmI);
}
npc.netUpdate = true;
}
@@ -1007,12 +1058,41 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
if (rotationDirection == 0)
{
// Set spin direction
if (Main.player[npc.target].velocity.X > 0f)
rotationDirection = 1;
else if (Main.player[npc.target].velocity.X < 0f)
rotationDirection = -1;
else
rotationDirection = player.direction;
switch ((int)npc.ai[3])
{
// Laser from top
case 0:
case 1:
if (player.Center.X >= npc.Center.X)
rotationDirection = 1;
else
rotationDirection = -1;
break;
// Laser from bottom
case 2:
if (player.Center.X >= npc.Center.X)
rotationDirection = -1;
else
rotationDirection = 1;
break;
// Laser from left
case 3:
if (player.Center.Y >= npc.Center.Y)
rotationDirection = -1;
else
rotationDirection = 1;
break;
// Laser from right
case 4:
if (player.Center.Y >= npc.Center.Y)
rotationDirection = 1;
else
rotationDirection = -1;
break;
}
// Set spin velocity
spinVelocity.X = MathHelper.Pi * spinRadius / spinTime;
@@ -1087,8 +1167,36 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
AIState = (float)Phase.Normal;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
if (revenge)
{
// Can use all 4 types of lasers in rev+
switch ((int)npc.ai[3])
{
case 0:
case 1:
npc.ai[3] = 3f + Main.rand.Next(2);
break;
case 2:
npc.ai[3] = 3f + Main.rand.Next(2);
break;
case 3:
npc.ai[3] = 1f + Main.rand.Next(2);
break;
case 4:
npc.ai[3] = 1f + Main.rand.Next(2);
break;
}
}
else if (expertMode)
{
// Can only use the top and bottom lasers in expert
npc.ai[3] += 1f;
if (npc.ai[3] > 2f)
npc.ai[3] = 1f;
}
npc.localAI[2] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
npc.netUpdate = true;
}
break;
+14 -3
View File
@@ -446,6 +446,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
destination += new Vector2(0f, 2400f);
}
// Distance from target
float distanceFromTarget = Vector2.Distance(npc.Center, destination);
// Increase speed if too far from target
float increaseSpeedMult = 1f;
float increaseSpeedGateValue = 500f;
if (distanceFromTarget > increaseSpeedGateValue)
{
float distanceAmount = MathHelper.Clamp((distanceFromTarget - increaseSpeedGateValue) / (CalamityGlobalNPC.CatchUpDistance350Tiles - increaseSpeedGateValue), 0f, 1f);
increaseSpeedMult = MathHelper.Lerp(1f, 3.5f, distanceAmount);
}
// Charge variables
float turnDistance = baseTurnDistance;
float chargeLocationDistance = turnDistance * 0.2f;
@@ -462,6 +474,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
// Increase top velocity if target is dead or if Thanatos is uncoiling
if (targetDead || speedUp)
baseVelocity *= 4f;
else
baseVelocity *= increaseSpeedMult;
float turnDegrees = baseVelocity * 0.11f * (berserk ? 1.25f : 1f);
@@ -484,9 +498,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
float laserBarrageVelocityScalarIncrement = lastMechAlive ? 0.025f : berserk ? 0.02f : 0.01f;
float laserBarrageVelocityScalarDecrement = 1f / velocityAdjustTime;
// Distance from target
float distanceFromTarget = Vector2.Distance(npc.Center, destination);
// Passive and Immune phases
switch ((int)SecondaryAIState)
{
+16 -2
View File
@@ -50,6 +50,7 @@ namespace CalamityMod.NPCs.HiveMind
}
// This block of values can be modified in SetDefaults() based on difficulty mode or something
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private int burrowTimer = 420;
private int minimumDriftTime = 300;
private int teleportRadius = 300;
@@ -157,6 +158,7 @@ namespace CalamityMod.NPCs.HiveMind
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(biomeEnrageTimer);
writer.Write(npc.dontTakeDamage);
writer.Write(npc.noTileCollide);
writer.Write(npc.noGravity);
@@ -178,6 +180,7 @@ namespace CalamityMod.NPCs.HiveMind
public override void ReceiveExtraAI(BinaryReader reader)
{
biomeEnrageTimer = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
npc.noTileCollide = reader.ReadBoolean();
npc.noGravity = reader.ReadBoolean();
@@ -362,13 +365,24 @@ namespace CalamityMod.NPCs.HiveMind
lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression;
}
// Enrage
if ((!player.ZoneCorrupt || (npc.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if ((npc.position.Y / 16f) < Main.worldSurface || malice)
if (biomeEnraged && (!player.ZoneCorrupt || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
}
if (!player.ZoneCorrupt || malice)
if (biomeEnraged && ((npc.position.Y / 16f) < Main.worldSurface || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
+20 -6
View File
@@ -26,9 +26,10 @@ namespace CalamityMod.NPCs.Leviathan
[AutoloadBossHead]
public class Leviathan : ModNPC
{
int counter = 0;
bool initialised = false;
int soundDelay = 0;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private int counter = 0;
private bool initialised = false;
private int soundDelay = 0;
public static Texture2D AttackTexture = null;
public override void SetStaticDefaults()
@@ -68,14 +69,16 @@ namespace CalamityMod.NPCs.Leviathan
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(npc.dontTakeDamage);
writer.Write(biomeEnrageTimer);
writer.Write(npc.dontTakeDamage);
writer.Write(soundDelay);
writer.Write(npc.Calamity().newAI[3]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
npc.dontTakeDamage = reader.ReadBoolean();
biomeEnrageTimer = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
soundDelay = reader.ReadInt32();
npc.Calamity().newAI[3] = reader.ReadSingle();
}
@@ -158,8 +161,19 @@ namespace CalamityMod.NPCs.Leviathan
bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
// Enrage
if (notOcean && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if (notOcean || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 2f;
+19 -7
View File
@@ -1,6 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
using CalamityMod.Events;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Projectiles.Boss;
@@ -17,7 +15,8 @@ namespace CalamityMod.NPCs.Leviathan
[AutoloadBossHead]
public class Siren : ModNPC
{
private bool spawnedLevi = false;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private bool spawnedLevi = false;
private bool forceChargeFrames = false;
private int frameUsed = 0;
public bool HasBegunSummoningLeviathan = false;
@@ -66,7 +65,8 @@ namespace CalamityMod.NPCs.Leviathan
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(spawnedLevi);
writer.Write(biomeEnrageTimer);
writer.Write(spawnedLevi);
writer.Write(forceChargeFrames);
writer.Write(npc.localAI[0]);
writer.Write(npc.localAI[2]);
@@ -79,7 +79,8 @@ namespace CalamityMod.NPCs.Leviathan
public override void ReceiveExtraAI(BinaryReader reader)
{
spawnedLevi = reader.ReadBoolean();
biomeEnrageTimer = reader.ReadInt32();
spawnedLevi = reader.ReadBoolean();
forceChargeFrames = reader.ReadBoolean();
npc.localAI[0] = reader.ReadSingle();
npc.localAI[2] = reader.ReadSingle();
@@ -125,8 +126,19 @@ namespace CalamityMod.NPCs.Leviathan
bool expertMode = Main.expertMode || malice;
bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
// Enrage
if (notOcean && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if (notOcean || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1.5f;
+2
View File
@@ -63,6 +63,7 @@ namespace CalamityMod.NPCs.OldDuke
{
writer.Write(npc.dontTakeDamage);
writer.Write(npc.localAI[0]);
writer.Write(npc.localAI[1]);
writer.Write(npc.rotation);
writer.Write(npc.spriteDirection);
for (int i = 0; i < 4; i++)
@@ -73,6 +74,7 @@ namespace CalamityMod.NPCs.OldDuke
{
npc.dontTakeDamage = reader.ReadBoolean();
npc.localAI[0] = reader.ReadSingle();
npc.localAI[1] = reader.ReadSingle();
npc.rotation = reader.ReadSingle();
npc.spriteDirection = reader.ReadInt32();
for (int i = 0; i < 4; i++)
+2 -2
View File
@@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.OldDuke
aiGateValue -= extraTime * 0.3f;
float explodeIntoGoreGateValue = aiGateValue + extraTime;
float fallDownGateValue = aiGateValue + extraTime * 0.5f;
float maxVelocity = malice ? 25f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f;
float maxVelocity = malice ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f;
if (npc.ai[0] == 0f)
{
@@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.OldDuke
Vector2 vector17 = Main.player[npc.target].Center - npc.Center;
vector17.Normalize();
vector17 *= scaleFactor2;
float inertia = malice ? 15f : death ? 18f : revenge ? 20f : expertMode ? 22f : 25f;
float inertia = malice ? 16f : death ? 18f : revenge ? 20f : expertMode ? 22f : 25f;
npc.velocity = (npc.velocity * (inertia - 1f) + vector17) / inertia;
npc.velocity.Normalize();
npc.velocity *= scaleFactor2;
+3 -3
View File
@@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.OldDuke
float num1372 = death ? 14f : revenge ? 13f : 12f;
if (expertMode || malice)
{
float speedUpMult = BossRushEvent.BossRushActive ? 0.02f : CalamityWorld.malice ? 0.015f : 0.01f;
float speedUpMult = BossRushEvent.BossRushActive ? 0.015f : CalamityWorld.malice ? 0.0125f : 0.01f;
num1372 += Vector2.Distance(player.Center, npc.Center) * speedUpMult;
}
@@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.OldDuke
npc.velocity.Y = (npc.velocity.Y * 7f + num1374) / 8f;
}
float num1247 = CalamityWorld.malice ? 0.75f : 0.5f;
float num1247 = CalamityWorld.malice ? 0.65f : 0.5f;
for (int num1248 = 0; num1248 < Main.maxNPCs; num1248++)
{
if (Main.npc[num1248].active)
@@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.OldDuke
int damage = Main.expertMode ? 55 : 70;
for (int k = 0; k < totalProjectiles; k++)
{
float velocity = Main.rand.Next(7, 11);
float velocity = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? Main.rand.Next(6, 10) : Main.rand.Next(7, 11);
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<SandToothOldDuke>(), damage, 0f, Main.myPlayer, 0f, 0f);
Main.projectile[proj].timeLeft = 360;
+17 -3
View File
@@ -15,7 +15,8 @@ namespace CalamityMod.NPCs.Perforator
[AutoloadBossHead]
public class PerforatorHeadLarge : ModNPC
{
private bool TailSpawned = false;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private bool TailSpawned = false;
public override void SetStaticDefaults()
{
@@ -54,12 +55,14 @@ namespace CalamityMod.NPCs.Perforator
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(biomeEnrageTimer);
for (int i = 0; i < 4; i++)
writer.Write(npc.Calamity().newAI[i]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
biomeEnrageTimer = reader.ReadInt32();
for (int i = 0; i < 4; i++)
npc.Calamity().newAI[i] = reader.ReadSingle();
}
@@ -74,10 +77,21 @@ namespace CalamityMod.NPCs.Perforator
bool revenge = CalamityWorld.revenge || malice;
bool death = CalamityWorld.death || malice;
// Enrage
if ((!Main.player[npc.target].ZoneCrimson || (npc.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if ((npc.position.Y / 16f) < Main.worldSurface || malice)
if (biomeEnraged && (!Main.player[npc.target].ZoneCrimson || malice))
enrageScale += 1f;
if (!Main.player[npc.target].ZoneCrimson || malice)
if (biomeEnraged && ((npc.position.Y / 16f) < Main.worldSurface || malice))
enrageScale += 1f;
if (BossRushEvent.BossRushActive)
enrageScale += 1f;
+27 -4
View File
@@ -5,6 +5,7 @@ using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,7 +15,8 @@ namespace CalamityMod.NPCs.Perforator
[AutoloadBossHead]
public class PerforatorHeadSmall : ModNPC
{
private const int MsgType = 23;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private const int MsgType = 23;
private bool TailSpawned = false;
public override void SetStaticDefaults()
@@ -51,7 +53,17 @@ namespace CalamityMod.NPCs.Perforator
npc.scale = 1.1f;
}
public override void AI()
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(biomeEnrageTimer);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
biomeEnrageTimer = reader.ReadInt32();
}
public override void AI()
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
@@ -61,10 +73,21 @@ namespace CalamityMod.NPCs.Perforator
bool revenge = CalamityWorld.revenge || malice;
bool death = CalamityWorld.death || malice;
// Enrage
if ((!Main.player[npc.target].ZoneCrimson || (npc.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if ((npc.position.Y / 16f) < Main.worldSurface || malice)
if (biomeEnraged && (!Main.player[npc.target].ZoneCrimson || malice))
enrageScale += 1f;
if (!Main.player[npc.target].ZoneCrimson || malice)
if (biomeEnraged && ((npc.position.Y / 16f) < Main.worldSurface || malice))
enrageScale += 1f;
if (BossRushEvent.BossRushActive)
enrageScale += 1f;
+27 -3
View File
@@ -18,6 +18,7 @@ using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -27,7 +28,8 @@ namespace CalamityMod.NPCs.Perforator
[AutoloadBossHead]
public class PerforatorHive : ModNPC
{
private bool small = false;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private bool small = false;
private bool medium = false;
private bool large = false;
@@ -69,6 +71,16 @@ namespace CalamityMod.NPCs.Perforator
npc.frame.Y = frame * frameHeight;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(biomeEnrageTimer);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
biomeEnrageTimer = reader.ReadInt32();
}
public override void AI()
{
CalamityGlobalNPC.perfHive = npc.whoAmI;
@@ -118,13 +130,24 @@ namespace CalamityMod.NPCs.Perforator
// Phases based on life percentage
bool phase2 = lifeRatio < 0.7f;
// Enrage
if ((!player.ZoneCrimson || (npc.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = 0f;
if ((npc.position.Y / 16f) < Main.worldSurface || malice)
if (biomeEnraged && (!player.ZoneCrimson || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
}
if (!Main.player[npc.target].ZoneCrimson || malice)
if (biomeEnraged && ((npc.position.Y / 16f) < Main.worldSurface || malice))
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1f;
@@ -153,6 +176,7 @@ namespace CalamityMod.NPCs.Perforator
if (npc.timeLeft > 60)
npc.timeLeft = 60;
return;
}
}
+1 -1
View File
@@ -36,7 +36,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
npc.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.9f;
animationType = NPCID.Bee;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.noGravity = true;
npc.noTileCollide = true;
npc.canGhostHeal = false;
@@ -264,6 +263,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
}
if (npc.life <= 0)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center);
for (int k = 0; k < 10; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f);
+1 -1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
aiType = -1;
npc.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.95f;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.noGravity = true;
npc.noTileCollide = true;
npc.canGhostHeal = false;
@@ -157,6 +156,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
}
if (npc.life <= 0)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center);
for (int k = 0; k < 10; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f);
@@ -29,7 +29,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
[AutoloadBossHead]
public class PlaguebringerGoliath : ModNPC
{
private const float MissileAngleSpread = 60;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private const float MissileAngleSpread = 60;
private const int MissileProjectiles = 8;
private int MissileCountdown = 0;
private int despawnTimer = 120;
@@ -74,7 +75,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(halfLife);
writer.Write(biomeEnrageTimer);
writer.Write(halfLife);
writer.Write(canDespawn);
writer.Write(flyingFrame2);
writer.Write(MissileCountdown);
@@ -87,7 +89,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
public override void ReceiveExtraAI(BinaryReader reader)
{
halfLife = reader.ReadBoolean();
biomeEnrageTimer = reader.ReadInt32();
halfLife = reader.ReadBoolean();
canDespawn = reader.ReadBoolean();
flyingFrame2 = reader.ReadBoolean();
MissileCountdown = reader.ReadInt32();
@@ -192,8 +195,18 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
Vector2 distFromPlayer = player.Center - vectorCenter;
// Enrage
if (!player.ZoneJungle && !BossRushEvent.BossRushActive)
{
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
float enrageScale = death ? 0.5f : 0f;
if (!player.ZoneJungle || malice)
if (biomeEnraged)
{
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive;
enrageScale += 1.5f;
@@ -24,9 +24,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
private int spearType = 0;
private int dustTimer = 3;
private int immuneTimer = 300;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
public override void SetStaticDefaults()
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Profaned Guardian");
Main.npcFrameCount[npc.type] = 6;
@@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
writer.Write(spearType);
writer.Write(dustTimer);
writer.Write(immuneTimer);
writer.Write(biomeEnrageTimer);
writer.Write(npc.dontTakeDamage);
}
@@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
spearType = reader.ReadInt32();
dustTimer = reader.ReadInt32();
immuneTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
}
@@ -155,19 +155,19 @@ namespace CalamityMod.NPCs.ProfanedGuardians
bool isHell = player.ZoneUnderworldHeight;
if (!isHoly && !isHell && !BossRushEvent.BossRushActive)
{
if (immuneTimer > 0)
immuneTimer--;
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
else
npc.Calamity().CurrentlyEnraged = true;
}
else
immuneTimer = 300;
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
if (enraged)
npc.Calamity().CurrentlyEnraged = true;
// Take damage or not
npc.dontTakeDamage = immuneTimer <= 0 && !malice;
npc.dontTakeDamage = biomeEnrageTimer <= 0 && !malice;
bool flag100 = false;
for (int num569 = 0; num569 < Main.maxNPCs; num569++)
@@ -17,8 +17,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
[AutoloadBossHead]
public class ProfanedGuardianBoss2 : ModNPC
{
private int immuneTimer = 300;
public override void SetStaticDefaults()
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Profaned Guardian");
Main.npcFrameCount[npc.type] = 6;
@@ -51,13 +52,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(immuneTimer);
writer.Write(biomeEnrageTimer);
writer.Write(npc.dontTakeDamage);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
immuneTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
}
@@ -92,16 +93,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
// Become immune over time if target isn't in hell or hallow
if (!isHoly && !isHell && !BossRushEvent.BossRushActive)
{
if (immuneTimer > 0)
immuneTimer--;
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
else
npc.Calamity().CurrentlyEnraged = true;
}
else
immuneTimer = 300;
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
// Take damage or not
npc.dontTakeDamage = immuneTimer <= 0 && !malice;
npc.dontTakeDamage = biomeEnrageTimer <= 0 && !malice;
Vector2 vectorCenter = npc.Center;
@@ -17,8 +17,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
[AutoloadBossHead]
public class ProfanedGuardianBoss3 : ModNPC
{
private int immuneTimer = 300;
public override void SetStaticDefaults()
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Profaned Guardian");
Main.npcFrameCount[npc.type] = 6;
@@ -51,13 +52,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(immuneTimer);
writer.Write(biomeEnrageTimer);
writer.Write(npc.dontTakeDamage);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
immuneTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
npc.dontTakeDamage = reader.ReadBoolean();
}
@@ -92,16 +93,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
// Become immune over time if target isn't in hell or hallow
if (!isHoly && !isHell && !BossRushEvent.BossRushActive)
{
if (immuneTimer > 0)
immuneTimer--;
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
else
npc.Calamity().CurrentlyEnraged = true;
}
else
immuneTimer = 300;
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
// Take damage or not
npc.dontTakeDamage = immuneTimer <= 0 && !malice;
npc.dontTakeDamage = biomeEnrageTimer <= 0 && !malice;
Vector2 vectorCenter = npc.Center;
+14 -11
View File
@@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.Providence
private int biomeType = 0;
private int flightPath = 0;
private int phaseChange = 0;
private int immuneTimer = 300;
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
private int frameUsed = 0;
private int healTimer = 0;
internal bool challenge = Main.expertMode/* && Main.netMode == NetmodeID.SinglePlayer*/; //Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only.
@@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Providence
writer.Write(useDefenseFrames);
writer.Write(biomeType);
writer.Write(phaseChange);
writer.Write(immuneTimer);
writer.Write(biomeEnrageTimer);
writer.Write(frameUsed);
writer.Write(healTimer);
writer.Write(flightPath);
@@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.Providence
useDefenseFrames = reader.ReadBoolean();
biomeType = reader.ReadInt32();
phaseChange = reader.ReadInt32();
immuneTimer = reader.ReadInt32();
biomeEnrageTimer = reader.ReadInt32();
frameUsed = reader.ReadInt32();
healTimer = reader.ReadInt32();
flightPath = reader.ReadInt32();
@@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.Providence
if (nightTime)
projectileDamageMult = 2;
npc.Calamity().CurrentlyEnraged = (!BossRushEvent.BossRushActive && (nightTime || malice)) || enraged;
npc.Calamity().CurrentlyEnraged = (!BossRushEvent.BossRushActive && (nightTime || malice)) || enraged || biomeEnrageTimer <= 0;
// Projectile damage values
int holyLaserDamage = npc.GetProjectileDamage(ModContent.ProjectileType<ProvidenceHolyRay>()) * projectileDamageMult;
@@ -344,14 +344,15 @@ namespace CalamityMod.NPCs.Providence
// Become immune over time if target isn't in hell or hallow
if (!isHoly && !isHell && !BossRushEvent.BossRushActive)
{
if (immuneTimer > 0)
immuneTimer--;
if (biomeEnrageTimer > 0)
biomeEnrageTimer--;
}
else
immuneTimer = 300;
biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
// Take damage or not
npc.dontTakeDamage = immuneTimer <= 0 && !malice;
// Take damage or not
bool biomeEnraged = biomeEnrageTimer <= 0 || malice;
npc.dontTakeDamage = biomeEnraged && !malice;
// Heal
if (healerAlive)
@@ -487,7 +488,7 @@ namespace CalamityMod.NPCs.Providence
// Velocity and acceleration
float speedIncreaseTimer = enraged ? 60f : nightTime ? 75f : death ? 120f : 150f;
bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer;
bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer || biomeEnraged;
float accelerationBoost = death ? 0.3f * (1f - lifeRatio) : 0.2f * (1f - lifeRatio);
float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio);
float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost;
@@ -505,8 +506,10 @@ namespace CalamityMod.NPCs.Providence
else if (increaseSpeed)
{
velocity += (calamityGlobalNPC.newAI[0] - speedIncreaseTimer) * 0.04f;
if (velocity > 30f)
if (velocity > 30f || biomeEnraged)
velocity = 30f;
if (biomeEnraged)
acceleration = 2f;
}
if (!targetDead)
+1 -1
View File
@@ -222,7 +222,7 @@ namespace CalamityMod.NPCs.StormWeaver
bool shedArmor = npc.life / (float)npc.lifeMax < 0.9f;
Texture2D texture2D15 = shedArmor ? ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverBodyNaked") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
+1 -1
View File
@@ -620,7 +620,7 @@ namespace CalamityMod.NPCs.StormWeaver
bool shedArmor = npc.life / (float)npc.lifeMax < 0.9f;
Texture2D texture2D15 = shedArmor ? ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
+1 -1
View File
@@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.StormWeaver
bool shedArmor = npc.life / (float)npc.lifeMax < 0.9f;
Texture2D texture2D15 = shedArmor ? ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverTailNaked") : Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
+3 -3
View File
@@ -39,11 +39,11 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
// 23 frames starting at 0.5
// 18 frames starting at 1
// 22 frames starting at 0.5
// 17 frames starting at 1
if (projectile.velocity.Length() < maxVelocity)
{
projectile.velocity *= 1.15f;
projectile.velocity *= 1.075f;
if (projectile.velocity.Length() > maxVelocity)
{
projectile.velocity.Normalize();
+2 -2
View File
@@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss
return null;
}
public List<Vector2> DetermineElectricArcPoints(Vector2 start, Vector2 end, int seed)
public static List<Vector2> DetermineElectricArcPoints(Vector2 start, Vector2 end, int seed)
{
List<Vector2> points = new List<Vector2>();
@@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Boss
Vector2 offsetDirection = (noise * MathHelper.Pi * 0.7f).ToRotationVector2();
// Then, determine the factor of the offset. This is based on the initial direction (but squashed) and the muffle factor from above.
Vector2 offset = offsetDirection * (float)Math.Pow(offsetDirection.Y, 2D) * offsetMuffleFactor * 25f;
Vector2 offset = offsetDirection * (float)Math.Pow(offsetDirection.Y, 2D) * offsetMuffleFactor * 15f;
points[i] += offset;
}
+66 -61
View File
@@ -2584,87 +2584,92 @@ namespace CalamityMod.Projectiles
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false)
{
float maxDistance = distanceRequired;
bool homeIn = false;
int[] targetArray = new int[maxTargets];
int targetArrayIndex = 0;
// Only shoot once every N frames.
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > projectileTimer)
{
projectile.localAI[0] = 0f;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2);
// Only search for targets if projectiles could be fired.
float maxDistance = distanceRequired;
bool homeIn = false;
int[] targetArray = new int[maxTargets];
int targetArrayIndex = 0;
bool canHit = true;
if (extraDistance < maxDistance)
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2);
if (projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit)
{
if (targetArrayIndex < maxTargets)
{
targetArray[targetArrayIndex] = i;
targetArrayIndex++;
homeIn = true;
}
else
break;
}
}
}
bool canHit = true;
if (extraDistance < maxDistance)
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
if (homeIn)
{
int randomTarget = Main.rand.Next(targetArrayIndex);
randomTarget = targetArray[randomTarget];
if (projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit)
{
if (targetArrayIndex < maxTargets)
{
targetArray[targetArrayIndex] = i;
targetArrayIndex++;
homeIn = true;
}
else
break;
}
}
}
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > projectileTimer)
{
projectile.localAI[0] = 0f;
Vector2 spawnPos = projectile.Center + projectile.velocity * 4f;
Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - spawnPos) * homingVelocity;
// If there is anything to actually shoot at, pick targets at random and fire.
if (homeIn)
{
int randomTarget = Main.rand.Next(targetArrayIndex);
randomTarget = targetArray[randomTarget];
if (attackMultiple)
{
for (int i = 0; i < targetArrayIndex; i++)
{
velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - spawnPos) * homingVelocity;
projectile.localAI[0] = 0f;
Vector2 spawnPos = projectile.Center + projectile.velocity * 4f;
Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - spawnPos) * homingVelocity;
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (attackMultiple)
{
for (int i = 0; i < targetArrayIndex; i++)
{
velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - spawnPos) * homingVelocity;
if (projectile.type == ProjectileType<EradicatorProjectile>())
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ProjectileType<EradicatorProjectile>())
if (projectile2.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile2].Calamity().forceRogue = true;
}
}
}
}
return;
}
return;
}
if (projectile.type == ProjectileType<GodsGambitYoyo>())
{
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
velocity.X += Main.rand.Next(-30, 31) * 0.05f;
}
if (projectile.type == ProjectileType<GodsGambitYoyo>())
{
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
velocity.X += Main.rand.Next(-30, 31) * 0.05f;
}
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ProjectileType<CnidarianYoyo>() || projectile.type == ProjectileType<GodsGambitYoyo>() ||
projectile.type == ProjectileType<ShimmersparkYoyo>() || projectile.type == ProjectileType<VerdantYoyo>())
if (projectile.type == ProjectileType<CnidarianYoyo>() || projectile.type == ProjectileType<GodsGambitYoyo>() ||
projectile.type == ProjectileType<ShimmersparkYoyo>() || projectile.type == ProjectileType<VerdantYoyo>())
if (projectile2.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile2].Calamity().forceMelee = true;
if (projectile.type == ProjectileType<SeashellBoomerangProjectile>())
if (projectile2.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile2].Calamity().forceRogue = true;
}
}
}
}
}
}
}
public static void ExpandHitboxBy(Projectile projectile, int width, int height)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 154 B

@@ -0,0 +1,183 @@
using CalamityMod.Items.Weapons.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class AetherfluxCannonHoldout : ModProjectile
{
private const int FramesPerFireRateIncrease = 36;
private Player Owner => Main.player[projectile.owner];
private bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem(), true) && !Owner.noItems && !Owner.CCed;
private ref float DeployedFrames => ref projectile.ai[0];
private ref float AnimationRate => ref projectile.ai[1];
private ref float LastShootAttemptTime => ref projectile.localAI[0];
private ref float LastAnimationTime => ref projectile.localAI[1];
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Aetherflux Cannon");
Main.projFrames[projectile.type] = 8;
}
public override void SetDefaults()
{
projectile.width = 58;
projectile.height = 94;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.magic = true;
}
public override void AI()
{
Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true);
Vector2 gunBarrelPos = armPosition + projectile.velocity * projectile.height * 0.4f;
// If the player is unable to continue using the holdout, delete it.
if (!OwnerCanShoot)
{
projectile.Kill();
return;
}
// Play a sound frame 1.
if (DeployedFrames <= 0f)
{
var sound = Main.PlaySound(SoundID.DD2_DarkMageCastHeal, projectile.Center);
if (sound != null)
sound.Volume = MathHelper.Clamp(sound.Volume * 1.5f, 0f, 1f);
}
// Update damage based on curent magic damage stat (so Mana Sickness affects it)
Item weaponItem = Owner.ActiveItem();
projectile.damage = (int)((weaponItem?.damage ?? 0) * Owner.MagicDamage());
// Get the original weapon's use time.
int itemUseTime = weaponItem?.useAnimation ?? T1000.UseTime;
// 36, base use time, will result in 5. Speed increasing reforges push it to 4.
int framesPerShot = itemUseTime / 7;
// Update time.
DeployedFrames += 1f;
// Determine animation rate. If the gun is spinning up, it increases linearly. Otherwise it's maxed.
AnimationRate = DeployedFrames >= itemUseTime ? 2f : MathHelper.Lerp(7f, 2f, DeployedFrames / itemUseTime);
// Update the animation. This occurs even when firing is not occurring.
if (DeployedFrames - LastAnimationTime >= AnimationRate)
{
LastAnimationTime = DeployedFrames;
projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type];
}
// Once past the initial spin-up time, fire constantly as long as mana is available.
// Before the spin-up is done, sparks are produced but no lasers come out (and no mana is consumed).
if (DeployedFrames - LastShootAttemptTime >= framesPerShot)
{
LastShootAttemptTime = DeployedFrames;
bool actuallyShoot = DeployedFrames >= itemUseTime;
bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem(), -1, true, false);
if (manaOK)
{
if (actuallyShoot)
Main.PlaySound(SoundID.Item91, projectile.Center);
int projID = ModContent.ProjectileType<PhasedGodRay>();
float shootSpeed = weaponItem.shootSpeed;
Vector2 shootDirection = projectile.velocity.SafeNormalize(Vector2.UnitY);
Vector2 shootVelocity = shootDirection * shootSpeed;
// Waving beams need to start offset so they cross each other neatly.
float waveSideOffset = Main.rand.NextFloat(18f, 28f);
Vector2 perp = shootDirection.RotatedBy(-MathHelper.PiOver2) * waveSideOffset;
// Dust chaotically sheds off the crystal while charging or firing.
float dustInaccuracy = 0.045f;
for (int i = -1; i <= 1 ; i += 2)
{
Vector2 laserStartPos = gunBarrelPos + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f);
Vector2 dustOnlySpread = Main.rand.NextVector2Circular(shootSpeed, shootSpeed);
Vector2 dustVelocity = shootVelocity + dustInaccuracy * dustOnlySpread;
if (actuallyShoot)
{
Projectile godRay = Projectile.NewProjectileDirect(laserStartPos, shootVelocity, projID, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
// Tell this Phased God Ray exactly which way it should be waving.
godRay.localAI[1] = i * 0.5f;
}
SpawnFiringDust(gunBarrelPos, dustVelocity);
}
}
// Delete the laser gun if a mana cost cannot be paid.
else
{
projectile.Kill();
return;
}
}
UpdateProjectileHeldVariables(armPosition);
ManipulatePlayerVariables();
}
private void UpdateProjectileHeldVariables(Vector2 armPosition)
{
if (Main.myPlayer == projectile.owner)
{
float interpolant = Utils.InverseLerp(5f, 25f, projectile.Distance(Main.MouseWorld), true);
Vector2 oldVelocity = projectile.velocity;
projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(Main.MouseWorld), interpolant);
if (projectile.velocity != oldVelocity)
{
projectile.netSpam = 0;
projectile.netUpdate = true;
}
}
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
projectile.Center = armPosition + projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * 8f;
projectile.spriteDirection = projectile.direction;
projectile.timeLeft = 2;
}
private void ManipulatePlayerVariables()
{
Owner.ChangeDir(projectile.direction);
Owner.heldProj = projectile.whoAmI;
Owner.itemTime = 2;
Owner.itemAnimation = 2;
Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation();
}
private void SpawnFiringDust(Vector2 gunBarrelPos, Vector2 laserVelocity)
{
int dustID = 133;
int dustRadius = 12;
float dustRandomness = 11f;
int dustDiameter = 2 * dustRadius;
Vector2 dustCorner = gunBarrelPos - Vector2.One * dustRadius;
for (int i = 0; i < 2; i++)
{
Vector2 dustVel = laserVelocity + Main.rand.NextVector2Circular(dustRandomness, dustRandomness);
Dust d = Dust.NewDustDirect(dustCorner, dustDiameter, dustDiameter, dustID, dustVel.X, dustVel.Y);
d.velocity *= 0.18f;
d.noGravity = true;
d.scale = 0.6f;
}
}
public override bool CanDamage() => false;
// prevents the item from appearing backwards frame 1
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => FramesPerFireRateIncrease > 0f;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

+11 -11
View File
@@ -20,18 +20,18 @@ namespace CalamityMod.Projectiles.Magic
projectile.friendly = true;
projectile.timeLeft = 90;
projectile.magic = true;
projectile.ignoreWater = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
}
}
public override void AI()
{
Vector2 vector33 = projectile.position;
vector33 -= projectile.velocity * 0.25f;
int num448 = Dust.NewDust(vector33, 1, 1, 206, 0f, 0f, 0, default, 1.25f);
Main.dust[num448].position = vector33;
Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num448].velocity *= 0.1f;
}
public override void AI()
{
Vector2 vector33 = projectile.position;
vector33 -= projectile.velocity * 0.25f;
int num448 = Dust.NewDust(vector33, 1, 1, 206, 0f, 0f, 0, default, 1.25f);
Main.dust[num448].position = vector33;
Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num448].velocity *= 0.1f;
}
}
}
+16 -14
View File
@@ -1,8 +1,9 @@
using CalamityMod.Items.Weapons.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class ClimaxProj : ModProjectile
@@ -18,27 +19,25 @@ namespace CalamityMod.Projectiles.Magic
projectile.width = 38;
projectile.height = 38;
projectile.friendly = true;
projectile.light = 0.5f;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.timeLeft = 96;
projectile.timeLeft = 48;
projectile.magic = true;
projectile.ignoreWater = true;
}
public override void AI()
{
projectile.velocity *= 0.96f;
// Rapidly screech to a halt once spawned.
projectile.velocity *= 0.86f;
if (projectile.velocity.X > 0f)
{
projectile.rotation += (Math.Abs(projectile.velocity.Y) + Math.Abs(projectile.velocity.X)) * 0.001f;
}
else
{
projectile.rotation -= (Math.Abs(projectile.velocity.Y) + Math.Abs(projectile.velocity.X)) * 0.001f;
}
// Spin chaotically given a pre-defined spin direction. Choose one initially at random.
float spinTheta = 0.11f;
if (projectile.localAI[1] == 0f)
projectile.localAI[1] = Main.rand.NextBool() ? -spinTheta : spinTheta;
projectile.rotation += projectile.localAI[1];
// Animate the lightning orb.
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
@@ -50,8 +49,11 @@ namespace CalamityMod.Projectiles.Magic
}
}
if (projectile.timeLeft % 4 == projectile.ai[0])
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 8f, 4f, 2, ModContent.ProjectileType<ClimaxBeam>(), 1D, true);
// Initial stagger in frames needs to be skipped over before it starts shooting,
// but once it's past that then it can fire constantly
--projectile.ai[0];
if (projectile.ai[0] < 0f)
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, Climax.OrbFireRate, 2, ModContent.ProjectileType<ClimaxBeam>(), 1D, true);
}
public override Color? GetAlpha(Color lightColor)
@@ -1,16 +1,15 @@
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class MagicNebulaShot : BaseLaserbeamProjectile
public class DeathhailBeam : BaseLaserbeamProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private Color startingColor = new Color(119, 210, 255);
private Color secondColor = new Color(247, 119, 255);
@@ -25,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nebula Shot");
DisplayName.SetDefault("Deathhail");
}
public override void SetDefaults()
@@ -35,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic
projectile.magic = true;
projectile.penetrate = -1;
projectile.alpha = 255;
projectile.localNPCHitCooldown = 8;
projectile.localNPCHitCooldown = -1;
projectile.usesLocalNPCImmunity = true;
}
+5 -5
View File
@@ -31,19 +31,19 @@ namespace CalamityMod.Projectiles.Magic
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = -1;
projectile.timeLeft = 30;
projectile.extraUpdates = 1;
projectile.tileCollide = false;
projectile.extraUpdates = 1;
projectile.tileCollide = false;
}
public override void AI()
{
projectile.width = (int)(36f * projectile.scale);
projectile.height = (int)(36f * projectile.scale);
projectile.height = (int)(36f * projectile.scale);
if (projectile.alpha > 100)
projectile.alpha -= 25;
if (projectile.alpha < 100)
projectile.alpha = 100;
if (projectile.alpha < 100)
projectile.alpha = 100;
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X);
}
+36 -36
View File
@@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Magic
{
public override string Texture => "CalamityMod/Projectiles/Magic/EidolicWailSoundwave";
private int echoCooldown = 0;
private bool playedSound = false;
private static int penetrationAmt = 50;
private int echoCooldown = 0;
private bool playedSound = false;
private static int penetrationAmt = 50;
public override void SetStaticDefaults()
{
@@ -35,20 +35,20 @@ namespace CalamityMod.Projectiles.Magic
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 8;
projectile.timeLeft = 450;
projectile.Calamity().PierceResistHarshness = 0.06f;
projectile.Calamity().PierceResistCap = 0.4f;
}
projectile.Calamity().PierceResistHarshness = 0.06f;
projectile.Calamity().PierceResistCap = 0.4f;
}
public override void AI()
{
if (projectile.ai[0] == 0f || projectile.ai[0] == 4f)
{
if (!playedSound)
{
Main.PlaySound(Main.rand.NextBool(100) ? mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater") : mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)projectile.Center.X, (int)projectile.Center.Y);
playedSound = true;
}
}
if (projectile.ai[0] == 0f || projectile.ai[0] == 4f)
{
if (!playedSound)
{
Main.PlaySound(Main.rand.NextBool(100) ? mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater") : mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)projectile.Center.X, (int)projectile.Center.Y);
playedSound = true;
}
}
if (projectile.localAI[0] < 1f)
{
@@ -63,8 +63,8 @@ namespace CalamityMod.Projectiles.Magic
projectile.height = 36;
}
if (echoCooldown > 0)
echoCooldown--;
if (echoCooldown > 0)
echoCooldown--;
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X);
}
@@ -97,28 +97,28 @@ namespace CalamityMod.Projectiles.Magic
target.AddBuff(BuffID.Electrified, 600);
projectile.velocity *= 0.85f;
if (echoCooldown <= 0)
{
echoCooldown = 60;
int echoID = ModContent.ProjectileType<HadopelagicEcho2>();
int echoDamage = (int)(0.2f * projectile.damage);
float echoKB = projectile.knockBack / 3;
int echos = 5;
for (int i = 0; i < echos; ++i)
{
float startDist = Main.rand.NextFloat(260f, 270f);
Vector2 startDir = Main.rand.NextVector2Unit();
Vector2 startPoint = target.Center + (startDir * startDist);
if (echoCooldown <= 0)
{
echoCooldown = 60;
int echoID = ModContent.ProjectileType<HadopelagicEcho2>();
int echoDamage = (int)(0.2f * projectile.damage);
float echoKB = projectile.knockBack / 3;
int echos = 5;
for (int i = 0; i < echos; ++i)
{
float startDist = Main.rand.NextFloat(260f, 270f);
Vector2 startDir = Main.rand.NextVector2Unit();
Vector2 startPoint = target.Center + (startDir * startDist);
float echoSpeed = Main.rand.NextFloat(15f, 18f);
Vector2 velocity = startDir * (-echoSpeed);
float echoSpeed = Main.rand.NextFloat(15f, 18f);
Vector2 velocity = startDir * (-echoSpeed);
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(startPoint, velocity, echoID, echoDamage, echoKB, projectile.owner);
}
}
}
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(startPoint, velocity, echoID, echoDamage, echoKB, projectile.owner);
}
}
}
}
public override Color? GetAlpha(Color lightColor)
+157
View File
@@ -0,0 +1,157 @@
using CalamityMod.Items.Weapons.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class NanoPurgeHoldout : ModProjectile
{
private const int FramesPerFireRateIncrease = 36;
private static int[] LaserOffsetByAnimationFrame = { 4, 3, 0, 3 };
private Player Owner => Main.player[projectile.owner];
private bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem(), true) && !Owner.noItems && !Owner.CCed;
private ref float DeployedFrames => ref projectile.ai[0];
private ref float ChargeTowardsNextShot => ref projectile.ai[1];
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nano Purge");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
{
projectile.width = 34;
projectile.height = 62;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.magic = true;
}
public override void AI()
{
Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true);
Vector2 gunBarrelPos = armPosition + projectile.velocity * projectile.height * 0.5f;
// If the player is unable to continue using the holdout, delete it.
if (!OwnerCanShoot)
{
projectile.Kill();
return;
}
// Update damage based on curent magic damage stat (so Mana Sickness affects it)
Item nanoPurge = Owner.ActiveItem();
projectile.damage = (int)((nanoPurge?.damage ?? 0) * Owner.MagicDamage());
// Get the original weapon's use time.
int itemUseTime = nanoPurge?.useAnimation ?? Purge.UseTime;
// Update time.
DeployedFrames += 1f;
// Choose fire rate multiplier (1x, 2x, 3x, 4x) based on current time spent firing.
int fireRate = (int)MathHelper.Clamp(DeployedFrames / FramesPerFireRateIncrease, 1f, 4f);
// Increment counter towards the item's use time by an amount equal to the current fire rate.
ChargeTowardsNextShot += fireRate;
// If enough charging progress is made, perform a shoot event if enough mana is available.
if (ChargeTowardsNextShot >= itemUseTime)
{
ChargeTowardsNextShot -= itemUseTime;
// Update the animation.
projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type];
bool manaCostPaid = Owner.CheckMana(Owner.ActiveItem(), -1, true, false);
if (manaCostPaid)
{
Main.PlaySound(SoundID.Item91, projectile.Center);
int projID = ModContent.ProjectileType<NanoPurgeLaser>();
float shootSpeed = nanoPurge.shootSpeed;
float inaccuracyRatio = 0.045f;
Vector2 shootDirection = projectile.velocity.SafeNormalize(Vector2.UnitY);
Vector2 perp = shootDirection.RotatedBy(MathHelper.PiOver2);
// Fire a pair of lasers, one with a negative offset, one with a positive offset.
for (int i = -1; i <= 1; i += 2)
{
Vector2 spread = Main.rand.NextVector2CircularEdge(shootSpeed, shootSpeed);
Vector2 shootVelocity = shootDirection * shootSpeed + inaccuracyRatio * spread;
Vector2 splitBarrelPos = gunBarrelPos + i * LaserOffsetByAnimationFrame[projectile.frame] * perp;
Projectile.NewProjectile(splitBarrelPos, shootVelocity, projID, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
SpawnFiringDust(splitBarrelPos, shootVelocity);
}
}
// Delete the laser gun if a mana cost cannot be paid.
else
{
projectile.Kill();
return;
}
}
UpdateProjectileHeldVariables(armPosition);
ManipulatePlayerVariables();
}
private void UpdateProjectileHeldVariables(Vector2 armPosition)
{
if (Main.myPlayer == projectile.owner)
{
float interpolant = Utils.InverseLerp(5f, 25f, projectile.Distance(Main.MouseWorld), true);
Vector2 oldVelocity = projectile.velocity;
projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(Main.MouseWorld), interpolant);
if (projectile.velocity != oldVelocity)
{
projectile.netSpam = 0;
projectile.netUpdate = true;
}
}
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
projectile.Center = armPosition + projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * 8f;
projectile.spriteDirection = projectile.direction;
projectile.timeLeft = 2;
}
private void ManipulatePlayerVariables()
{
Owner.ChangeDir(projectile.direction);
Owner.heldProj = projectile.whoAmI;
Owner.itemTime = 2;
Owner.itemAnimation = 2;
Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation();
}
private void SpawnFiringDust(Vector2 gunBarrelPos, Vector2 laserVelocity)
{
int dustID = 107;
int dustRadius = 5;
int dustDiameter = 2 * dustRadius;
Vector2 dustCorner = gunBarrelPos - Vector2.One * dustRadius;
for (int i = 0; i < 2; i++)
{
Vector2 dustVel = laserVelocity + Main.rand.NextVector2Circular(7f, 7f);
Dust d = Dust.NewDustDirect(dustCorner, dustDiameter, dustDiameter, dustID, dustVel.X, dustVel.Y);
d.velocity *= 0.125f;
d.noGravity = true;
d.scale = 1.4f;
}
}
public override bool CanDamage() => false;
// prevents the item from appearing backwards frame 1
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => DeployedFrames > 0f;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff. Show more