Merge branch 'master' into utilities-and-shortcuts
No files matched your search
@@ -100,8 +100,8 @@ namespace CalamityMod.CalPlayer
|
||||
player.lifeRegen = 0;
|
||||
|
||||
player.lifeRegenTime = 0;
|
||||
player.lifeRegen -= 16;
|
||||
}
|
||||
lifeRegenLost += 16;
|
||||
}
|
||||
|
||||
if (modPlayer.vaporfied)
|
||||
{
|
||||
@@ -109,8 +109,8 @@ namespace CalamityMod.CalPlayer
|
||||
player.lifeRegen = 0;
|
||||
|
||||
player.lifeRegenTime = 0;
|
||||
player.lifeRegen -= 8;
|
||||
}
|
||||
lifeRegenLost += 8;
|
||||
}
|
||||
|
||||
if (modPlayer.cragsLava)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace CalamityMod.CalPlayer
|
||||
player.lifeRegen = 0;
|
||||
|
||||
player.lifeRegenTime = 0;
|
||||
lifeRegenLost += 20;
|
||||
lifeRegenLost += 16;
|
||||
}
|
||||
|
||||
if (modPlayer.pFlames)
|
||||
|
||||
@@ -66,6 +66,7 @@ using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Tiles.LivingFire;
|
||||
using CalamityMod.Skies;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.World;
|
||||
@@ -194,6 +195,7 @@ namespace CalamityMod
|
||||
public static List<int> highTestFishList;
|
||||
public static List<int> flamethrowerList;
|
||||
public static List<int> forceItemList;
|
||||
public static List<int> livingFireBlockList;
|
||||
|
||||
public static List<int> zombieList;
|
||||
public static List<int> demonEyeList;
|
||||
@@ -417,6 +419,7 @@ namespace CalamityMod
|
||||
highTestFishList = null;
|
||||
flamethrowerList = null;
|
||||
forceItemList = null;
|
||||
livingFireBlockList = null;
|
||||
|
||||
zombieList = null;
|
||||
demonEyeList = null;
|
||||
@@ -1651,7 +1654,6 @@ namespace CalamityMod
|
||||
{
|
||||
NPCID.TheDestroyer,
|
||||
NPCID.SolarCrawltipedeHead,
|
||||
ModContent.NPCType<AstrumDeusHead>(),
|
||||
ModContent.NPCType<AstrumDeusHeadSpectral>(),
|
||||
ModContent.NPCType<ProfanedGuardianBoss>(),
|
||||
ModContent.NPCType<Bumblefuck>(),
|
||||
@@ -2347,6 +2349,19 @@ namespace CalamityMod
|
||||
ItemID.SuperHealingPotion
|
||||
};
|
||||
|
||||
livingFireBlockList = new List<int>()
|
||||
{
|
||||
ModContent.TileType<LivingGodSlayerFireBlockTile>(),
|
||||
ModContent.TileType<LivingHolyFireBlockTile>(),
|
||||
ModContent.TileType<LivingBrimstoneFireBlockTile>(),
|
||||
TileID.LivingFire,
|
||||
TileID.LivingCursedFire,
|
||||
TileID.LivingDemonFire,
|
||||
TileID.LivingFrostFire,
|
||||
TileID.LivingIchor,
|
||||
TileID.LivingUltrabrightFire
|
||||
};
|
||||
|
||||
zombieList = new List<int>()
|
||||
{
|
||||
NPCID.Zombie,
|
||||
@@ -2762,12 +2777,9 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<Leviathan>(), 10800 },
|
||||
{ ModContent.NPCType<Siren>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumAureus>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumDeusBodySpectral>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumDeusTailSpectral>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumDeusHead>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusBody>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusTail>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), 5400 },
|
||||
{ ModContent.NPCType<AstrumDeusBodySpectral>(), 5400 },
|
||||
{ ModContent.NPCType<AstrumDeusTailSpectral>(), 5400 },
|
||||
{ ModContent.NPCType<PlaguebringerGoliath>(), 10800 },
|
||||
{ ModContent.NPCType<RavagerBody>(), 10800 },
|
||||
{ ModContent.NPCType<ProfanedGuardianBoss>(), 5400 },
|
||||
@@ -2782,12 +2794,12 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<Signus>(), 7200 },
|
||||
{ ModContent.NPCType<Polterghast>(), 10800 },
|
||||
{ ModContent.NPCType<OldDuke>(), 10800 },
|
||||
{ ModContent.NPCType<DevourerofGodsHead>(), 7200 },
|
||||
{ ModContent.NPCType<DevourerofGodsBody>(), 7200 },
|
||||
{ ModContent.NPCType<DevourerofGodsTail>(), 7200 },
|
||||
{ ModContent.NPCType<DevourerofGodsHeadS>(), 10800 },
|
||||
{ ModContent.NPCType<DevourerofGodsBodyS>(), 10800 },
|
||||
{ ModContent.NPCType<DevourerofGodsTailS>(), 10800 },
|
||||
{ ModContent.NPCType<DevourerofGodsHead>(), 5400 },
|
||||
{ ModContent.NPCType<DevourerofGodsBody>(), 5400 },
|
||||
{ ModContent.NPCType<DevourerofGodsTail>(), 5400 },
|
||||
{ ModContent.NPCType<DevourerofGodsHeadS>(), 9000 },
|
||||
{ ModContent.NPCType<DevourerofGodsBodyS>(), 9000 },
|
||||
{ ModContent.NPCType<DevourerofGodsTailS>(), 9000 },
|
||||
{ ModContent.NPCType<Yharon>(), 10800 },
|
||||
{ ModContent.NPCType<SupremeCalamitas>(), 18000 }
|
||||
};
|
||||
@@ -2872,9 +2884,6 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<AstrumDeusBodySpectral>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AstrumDeusTailSpectral>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AstrumDeusHead>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<AstrumDeusBody>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AstrumDeusTail>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AstrumDeusProbe3>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<PlaguebringerGoliath>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<PlaguebringerShade>(), velocityScaleMin },
|
||||
@@ -3740,6 +3749,7 @@ namespace CalamityMod
|
||||
case CalamityModMessageType.AcidRainSync:
|
||||
CalamityWorld.rainingAcid = reader.ReadBoolean();
|
||||
CalamityWorld.acidRainPoints = reader.ReadInt32();
|
||||
CalamityWorld.timeSinceAcidRainKill = reader.ReadInt32();
|
||||
break;
|
||||
case CalamityModMessageType.AcidRainUIDrawFadeSync:
|
||||
CalamityWorld.acidRainExtraDrawTime = reader.ReadInt32();
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace CalamityMod.Events
|
||||
// A partially bright pale-ish cyan with a hint of yellow.
|
||||
public static readonly Color TextColor = new Color(115, 194, 147);
|
||||
|
||||
public const int InvasionNoKillPersistTime = 14400; // How long the invasion persists, in frames, if nothing is killed.
|
||||
|
||||
public const float BloodwormSpawnRate = 0.1f;
|
||||
|
||||
// Not a readonly collection so that if anyone else wants to add stuff in here with their own mod, they can.
|
||||
@@ -167,17 +169,16 @@ namespace CalamityMod.Events
|
||||
Main.numClouds = Main.numCloudsTemp;
|
||||
Main.windSpeedTemp = 0.72f;
|
||||
Main.windSpeedSet = Main.windSpeedTemp;
|
||||
Main.weatherCounter = 600;
|
||||
Main.weatherCounter = 60 * 60 * 10; // 10 minutes of rain. Remember, once the rain goes away, so does the invasion.
|
||||
Main.rainTime = Main.weatherCounter;
|
||||
Main.maxRaining = 0.89f;
|
||||
CalamityWorld.forcedDownpourWithTear = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
if (CalamityWorld.startAcidicDownpour)
|
||||
{
|
||||
Main.raining = true;
|
||||
}
|
||||
CalamityWorld.triedToSummonOldDuke = false;
|
||||
CalamityWorld.timeSinceAcidRainKill = 0; // Reset the kill cooldown, just in case.
|
||||
}
|
||||
|
||||
UpdateInvasion();
|
||||
BroadcastEventText("Mods.CalamityMod.AcidRainStart"); // A toxic downpour falls over the wasteland seas!
|
||||
}
|
||||
@@ -222,6 +223,7 @@ namespace CalamityMod.Events
|
||||
netMessage.Write((byte)CalamityModMessageType.AcidRainSync);
|
||||
netMessage.Write(CalamityWorld.rainingAcid);
|
||||
netMessage.Write(CalamityWorld.acidRainPoints);
|
||||
netMessage.Write(CalamityWorld.timeSinceAcidRainKill);
|
||||
netMessage.Send();
|
||||
}
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<RustyLockpick>(), 1);
|
||||
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 20);
|
||||
recipe.AddRecipeGroup("IronBar", 10);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<RustyLockpick>(), 1);
|
||||
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 20);
|
||||
recipe.AddRecipeGroup("IronBar", 10);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace CalamityMod.Items.Accessories.Wings
|
||||
{
|
||||
if (player.controlJump && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart)
|
||||
{
|
||||
int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType<FrostShardFriendly>(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType<FrostShardFriendly>(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI, 1f);
|
||||
Main.projectile[p].Calamity().forceTypeless = true;
|
||||
Main.projectile[p].frame = Main.rand.Next(5);
|
||||
modPlayer.icicleCooldown = 10;
|
||||
|
||||
@@ -81,6 +81,12 @@ namespace CalamityMod.Items
|
||||
myClone.StealthGenBonus = StealthGenBonus;
|
||||
return myClone;
|
||||
}
|
||||
|
||||
public override bool NewPreReforge(Item item)
|
||||
{
|
||||
StealthGenBonus = 1f;
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SetDefaults
|
||||
@@ -129,7 +135,7 @@ namespace CalamityMod.Items
|
||||
else if (item.type == ItemID.BlizzardStaff)
|
||||
item.damage = (int)(item.damage * 0.7);
|
||||
else if (item.type == ItemID.LaserMachinegun)
|
||||
item.damage = (int)(item.damage * 0.6);
|
||||
item.damage = (int)(item.damage * 0.65);
|
||||
else if (item.type == ItemID.StardustDragonStaff)
|
||||
item.damage = (int)(item.damage * 0.5);
|
||||
|
||||
@@ -2805,7 +2811,7 @@ Provides heat and cold protection in Death Mode";
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<BlackHawkRemote>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<BlastBarrel>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<RogueEmblem>(), 4);
|
||||
DropHelper.DropItemFromSetChance(player, 5, ItemID.CorruptionKey, ItemID.CrimsonKey);
|
||||
DropHelper.DropItemFromSetChance(player, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey);
|
||||
DropHelper.DropItemCondition(player, ModContent.ItemType<MLGRune>(), !CalamityWorld.demonMode); // Demon Trophy
|
||||
break;
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
"Activates adrenaline. When adrenaline is maxed press B to activate adrenaline mode.\n" +
|
||||
"You gain adrenaline whenever a boss is alive. Getting hit drops adrenaline back to 0.\n" +
|
||||
"All enemies drop 50% more cash.\n" +
|
||||
"All enemies gain a new damage reduction stat, which can be reduced by applying various debuffs to them.\n" +
|
||||
"The amount of this damage reduction stat varies based on enemy type.\n" +
|
||||
"Makes certain enemies immune to life steal and nerfs the effectiveness of life steal.\n" +
|
||||
"Increases enemy damage by 25% and spawn rates by 15%.\n" +
|
||||
"Nerfs the effectiveness of the Titanium Armor set bonus.\n" +
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches
|
||||
}
|
||||
|
||||
// Weapons
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAstrageldon,
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAstrageldon, 0.2f,
|
||||
ModContent.ItemType<StellarKnife>(),
|
||||
ModContent.ItemType<AstralachneaStaff>(),
|
||||
ModContent.ItemType<TitanArm>(),
|
||||
|
||||
@@ -20,12 +20,12 @@ namespace CalamityMod.Items.Fishing.AstralCatches
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 55;
|
||||
item.damage = 50;
|
||||
item.ranged = true;
|
||||
item.width = 38;
|
||||
item.height = 34;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.useTime = 21;
|
||||
item.useAnimation = 21;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 2.25f;
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches
|
||||
}
|
||||
else if (modPlayer.polarisBoostTwo) //Splits on enemy or tile hits
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PolarStar>(), (int)((double)damage * 1.25), knockBack, player.whoAmI, 0f, 1f);
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<PolarStar>(), (int)(damage * 1.25), knockBack, player.whoAmI, 0f, 1f);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -77,14 +77,14 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
|
||||
}
|
||||
|
||||
// Weapons
|
||||
DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3,
|
||||
DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.2f,
|
||||
ModContent.ItemType<Archerfish>(),
|
||||
ModContent.ItemType<BallOFugu>(),
|
||||
ModContent.ItemType<HerringStaff>(),
|
||||
ModContent.ItemType<Lionfish>(),
|
||||
ModContent.ItemType<BlackAnurian>());
|
||||
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain,
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain, 0.2f,
|
||||
ModContent.ItemType<SkyfinBombers>(),
|
||||
ModContent.ItemType<NuclearRod>(),
|
||||
ModContent.ItemType<SulphurousGrabber>(),
|
||||
@@ -94,7 +94,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
|
||||
ModContent.ItemType<BelchingSaxophone>());
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3,
|
||||
DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.4f,
|
||||
ModContent.ItemType<StrangeOrb>(),
|
||||
ModContent.ItemType<DepthCharm>(),
|
||||
ModContent.ItemType<IronBoots>(),
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
|
||||
}
|
||||
|
||||
// Weapons
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAM && Main.hardMode,
|
||||
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAM && Main.hardMode, 0.2f,
|
||||
ModContent.ItemType<ShellfishStaff>(),
|
||||
ModContent.ItemType<ClamCrusher>(),
|
||||
ModContent.ItemType<Poseidon>(),
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Placeables.Furniture
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<RustyLockpick>(), 1);
|
||||
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 20);
|
||||
recipe.AddRecipeGroup("IronBar", 10);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.consumable = true;
|
||||
item.value = 500;
|
||||
item.createTile = ModContent.TileType<RustyChestLocked>();
|
||||
item.createTile = ModContent.TileType<RustyChestTile>();
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items
|
||||
{
|
||||
public class RustyLockpick : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Tooltip.SetDefault("Opens locked rusty chests");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 14;
|
||||
item.height = 28;
|
||||
item.maxStack = 99;
|
||||
item.rare = 1;
|
||||
item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 15);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 383 B |
@@ -31,15 +31,11 @@ namespace CalamityMod.Items.SummonItems
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return !Main.dayTime && player.Calamity().ZoneAstral && !NPC.AnyNPCs(ModContent.NPCType<AstrumDeusHead>()) && !NPC.AnyNPCs(ModContent.NPCType<AstrumDeusHeadSpectral>());
|
||||
return !Main.dayTime && player.Calamity().ZoneAstral && !NPC.AnyNPCs(ModContent.NPCType<AstrumDeusHeadSpectral>());
|
||||
}
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
{
|
||||
for (int x = 0; x < 10; x++)
|
||||
{
|
||||
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<AstrumDeusHead>());
|
||||
}
|
||||
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<AstrumDeusHeadSpectral>());
|
||||
Main.PlaySound(SoundID.Roar, player.position, 0);
|
||||
return true;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return !Main.slimeRain && (Main.rainTime > 3600 || !CalamityWorld.death || !Main.raining);
|
||||
return !Main.slimeRain && (Main.rainTime > 3600 || !CalamityWorld.death || !Main.raining || CalamityWorld.rainingAcid);
|
||||
}
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
@@ -48,22 +48,10 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
Main.rainTime = 3600;
|
||||
AdjustRainSeverity(true);
|
||||
}
|
||||
if (CalamityWorld.rainingAcid)
|
||||
{
|
||||
CalamityWorld.acidRainPoints = 0;
|
||||
CalamityWorld.triedToSummonOldDuke = false;
|
||||
AcidRainEvent.UpdateInvasion(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.raining = false;
|
||||
if (CalamityWorld.rainingAcid)
|
||||
{
|
||||
CalamityWorld.acidRainPoints = 0;
|
||||
CalamityWorld.triedToSummonOldDuke = false;
|
||||
AcidRainEvent.UpdateInvasion(false);
|
||||
}
|
||||
}
|
||||
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 90;
|
||||
item.damage = 75;
|
||||
item.magic = true;
|
||||
item.mana = 14;
|
||||
item.rare = 8;
|
||||
item.width = 48;
|
||||
item.height = 54;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.useTime = 22;
|
||||
item.useAnimation = 22;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 3.75f;
|
||||
@@ -35,17 +35,14 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
item.shootSpeed = 10f;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOrigin()
|
||||
{
|
||||
return new Vector2(15, 15);
|
||||
}
|
||||
public override Vector2? HoldoutOrigin() => new Vector2(15, 15);
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
position = Main.MouseWorld;
|
||||
for (int x = 0; x < 10; x++)
|
||||
{
|
||||
Projectile.NewProjectile(position.X + (float)Main.rand.Next(-150, 150), position.Y + 600f, 0f, -10f, type, damage, knockBack, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(position.X + (float)Main.rand.Next(-150, 150), position.Y + 600f, 0f, -10f, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Parasitic Sceptor");
|
||||
DisplayName.SetDefault("Parasitic Scepter");
|
||||
Tooltip.SetDefault("Fires a spread of water leeches that latch onto enemies, dealing a stacking damage over time");
|
||||
Item.staff[item.type] = true;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
item.width = item.height = 52;
|
||||
item.UseSound = SoundID.Item46;
|
||||
item.noMelee = true;
|
||||
item.useStyle = 5;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.rare = 2;
|
||||
item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
||||
}
|
||||
@@ -38,28 +38,28 @@ 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 speed = item.shootSpeed;
|
||||
Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X;
|
||||
float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y;
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y;
|
||||
}
|
||||
float speed = item.shootSpeed;
|
||||
Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X;
|
||||
float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y;
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y;
|
||||
}
|
||||
Vector2 vector = new Vector2(xDist, yDist);
|
||||
float speedMult = vector.Length();
|
||||
if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f))
|
||||
{
|
||||
xDist = player.direction;
|
||||
yDist = 0f;
|
||||
speedMult = speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
speedMult = speed / speedMult;
|
||||
}
|
||||
xDist *= speedMult;
|
||||
yDist *= speedMult;
|
||||
if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f))
|
||||
{
|
||||
xDist = player.direction;
|
||||
yDist = 0f;
|
||||
speedMult = speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
speedMult = speed / speedMult;
|
||||
}
|
||||
xDist *= speedMult;
|
||||
yDist *= speedMult;
|
||||
int leechAmt = 2;
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
@@ -73,21 +73,21 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
leechAmt ++;
|
||||
}
|
||||
for (int i = 0; i < leechAmt; i++)
|
||||
{
|
||||
float xVec = xDist;
|
||||
float yVec = yDist;
|
||||
float spreadMult = 0.05f * i;
|
||||
xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult;
|
||||
yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult;
|
||||
for (int i = 0; i < leechAmt; i++)
|
||||
{
|
||||
float xVec = xDist;
|
||||
float yVec = yDist;
|
||||
float spreadMult = 0.05f * i;
|
||||
xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult;
|
||||
yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult;
|
||||
Vector2 directionToShoot = new Vector2(xVec, yVec);
|
||||
speedMult = directionToShoot.Length();
|
||||
speedMult = speed / speedMult;
|
||||
xVec *= speedMult;
|
||||
yVec *= speedMult;
|
||||
directionToShoot = new Vector2(xVec, yVec);
|
||||
Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
speedMult = speed / speedMult;
|
||||
xVec *= speedMult;
|
||||
yVec *= speedMult;
|
||||
directionToShoot = new Vector2(xVec, yVec);
|
||||
Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 26;
|
||||
item.damage = 20;
|
||||
item.magic = true;
|
||||
item.mana = 16;
|
||||
item.width = 28;
|
||||
@@ -37,12 +37,11 @@ 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 spread = 22.5f * 0.0174f;
|
||||
float spread = 22.5f * 0.01f * MathHelper.PiOver2;
|
||||
double startAngle = Math.Atan2(speedX, speedY) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
for (i = 0; i < 8; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), type, damage, knockBack, Main.myPlayer);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 18;
|
||||
item.damage = 14;
|
||||
item.magic = true;
|
||||
item.mana = 8;
|
||||
item.width = 42;
|
||||
|
||||
@@ -50,29 +50,28 @@ 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)
|
||||
{
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float num72 = item.shootSpeed;
|
||||
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
|
||||
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
|
||||
float f = Main.rand.NextFloat() * 6.28318548f;
|
||||
float value12 = 20f;
|
||||
float value13 = 60f;
|
||||
Vector2 vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat());
|
||||
Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float speed = item.shootSpeed;
|
||||
float xPos = (float)Main.mouseX + Main.screenPosition.X - playerPos.X;
|
||||
float yPos = (float)Main.mouseY + Main.screenPosition.Y - playerPos.Y;
|
||||
float f = Main.rand.NextFloat() * MathHelper.TwoPi;
|
||||
float sourceVariationLow = 20f;
|
||||
float sourceVariationHigh = 60f;
|
||||
Vector2 source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(sourceVariationLow, sourceVariationHigh, Main.rand.NextFloat());
|
||||
for (int num202 = 0; num202 < 50; num202++)
|
||||
{
|
||||
vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat());
|
||||
if (Collision.CanHit(vector2, 0, 0, vector13 + (vector13 - vector2).SafeNormalize(Vector2.UnitX) * 8f, 0, 0))
|
||||
source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(sourceVariationLow, sourceVariationHigh, Main.rand.NextFloat());
|
||||
if (Collision.CanHit(playerPos, 0, 0, source + (source - playerPos).SafeNormalize(Vector2.UnitX) * 8f, 0, 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
f = Main.rand.NextFloat() * 6.28318548f;
|
||||
f = Main.rand.NextFloat() * MathHelper.TwoPi;
|
||||
}
|
||||
Vector2 mouseWorld = Main.MouseWorld;
|
||||
Vector2 vector14 = mouseWorld - vector13;
|
||||
Vector2 vector15 = new Vector2(num78, num79).SafeNormalize(Vector2.UnitY) * num72;
|
||||
vector14 = vector14.SafeNormalize(vector15) * num72;
|
||||
vector14 = Vector2.Lerp(vector14, vector15, 0.25f);
|
||||
Projectile.NewProjectile(vector13, vector14, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3));
|
||||
Vector2 velocity = Main.MouseWorld - source;
|
||||
Vector2 velocityVariation = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitY) * speed;
|
||||
velocity = velocity.SafeNormalize(velocityVariation) * speed;
|
||||
velocity = Vector2.Lerp(velocity, velocityVariation, 0.25f);
|
||||
Projectile.NewProjectile(source, velocity, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 20;
|
||||
item.damage = 15;
|
||||
item.magic = true;
|
||||
item.mana = 4;
|
||||
item.width = 30;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
item.width = 56;
|
||||
item.height = 60;
|
||||
item.damage = 95;
|
||||
item.damage = 120;
|
||||
item.melee = true;
|
||||
item.useTurn = true;
|
||||
item.useAnimation = 20;
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
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, type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,65 +7,54 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Butcher : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Butcher");
|
||||
Tooltip.SetDefault("Fires faster and more accurately the longer you hold the trigger");
|
||||
}
|
||||
public class Butcher : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Butcher");
|
||||
Tooltip.SetDefault("Fires faster and more accurately the longer you hold the trigger");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 17;
|
||||
item.width = 20;
|
||||
item.height = 12;
|
||||
item.useTime = 40;
|
||||
item.useAnimation = 40;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.rare = 5;
|
||||
item.knockBack = 1f;
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.UseSound = SoundID.Item38;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.ranged = true;
|
||||
item.channel = true;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<ButcherGun>();
|
||||
item.shootSpeed = 12f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 18;
|
||||
item.width = 20;
|
||||
item.height = 12;
|
||||
item.useTime = 40;
|
||||
item.useAnimation = 40;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.rare = 5;
|
||||
item.knockBack = 1f;
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.UseSound = SoundID.Item38;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.ranged = true;
|
||||
item.channel = true;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<ButcherGun>();
|
||||
item.shootSpeed = 12f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
Projectile p = Main.projectile[i];
|
||||
if (p.active && p.type == ModContent.ProjectileType<ButcherGun>() && p.owner == player.whoAmI)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
|
||||
|
||||
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<ButcherGun>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
return false;
|
||||
}
|
||||
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, new Vector2(speedX, speedY), ModContent.ProjectileType<ButcherGun>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Shotgun);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 4);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 4);
|
||||
recipe.AddIngredient(ItemID.IllegalGunParts);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Shotgun);
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 4);
|
||||
recipe.AddIngredient(ItemID.IllegalGunParts);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,46 @@
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class ClamorRifle : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Clamor Rifle");
|
||||
Tooltip.SetDefault("Shoots homing energy bolts");
|
||||
}
|
||||
public class ClamorRifle : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Clamor Rifle");
|
||||
Tooltip.SetDefault("Shoots homing energy bolts");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 27;
|
||||
item.ranged = true;
|
||||
item.width = 64;
|
||||
item.height = 30;
|
||||
item.useTime = 13;
|
||||
item.useAnimation = 13;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 2.5f;
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt");
|
||||
item.autoReuse = true;
|
||||
item.rare = 5;
|
||||
item.shoot = ModContent.ProjectileType<ClamorRifleProj>();
|
||||
item.shootSpeed = 15f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 23;
|
||||
item.ranged = true;
|
||||
item.width = 64;
|
||||
item.height = 30;
|
||||
item.useTime = 15;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 2.5f;
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt");
|
||||
item.autoReuse = true;
|
||||
item.rare = 5;
|
||||
item.shoot = ModContent.ProjectileType<ClamorRifleProj>();
|
||||
item.shootSpeed = 15f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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<ClamorRifleProj>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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, new Vector2(speedX, speedY), ModContent.ProjectileType<ClamorRifleProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
item.width = 70;
|
||||
item.height = 42;
|
||||
item.damage = 450;
|
||||
item.damage = 485;
|
||||
item.crit += 16;
|
||||
item.ranged = true;
|
||||
item.useTime = 30;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 1750;
|
||||
item.damage = 1666;
|
||||
item.crit += 20;
|
||||
item.ranged = true;
|
||||
item.width = 84;
|
||||
@@ -41,17 +41,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.useAmmo = 23;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-15, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-15, 0);
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 50;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -6,51 +6,53 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class OpalStriker : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Opal Striker");
|
||||
Tooltip.SetDefault("Fires a string of opal strikes");
|
||||
}
|
||||
public class OpalStriker : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Opal Striker");
|
||||
Tooltip.SetDefault("Fires a string of opal strikes");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 9;
|
||||
item.ranged = true;
|
||||
item.width = 64;
|
||||
item.height = 16;
|
||||
item.useTime = 5;
|
||||
item.reuseDelay = 25;
|
||||
item.useAnimation = 20;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 0f;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike");
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<OpalStrike>();
|
||||
item.shootSpeed = 6f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 9;
|
||||
item.ranged = true;
|
||||
item.width = 64;
|
||||
item.height = 16;
|
||||
item.useTime = 5;
|
||||
item.reuseDelay = 25;
|
||||
item.useAnimation = 20;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 0f;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike");
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<OpalStrike>();
|
||||
item.shootSpeed = 6f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
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<OpalStrike>(), damage, 0f, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Marble, 20);
|
||||
recipe.AddIngredient(ItemID.Amber, 5);
|
||||
recipe.AddIngredient(ItemID.Diamond, 3);
|
||||
recipe.AddIngredient(ItemID.FlintlockPistol);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
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, new Vector2(speedX, speedY), ModContent.ProjectileType<OpalStrike>(), damage, knockBack, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Marble, 20);
|
||||
recipe.AddIngredient(ItemID.Amber, 5);
|
||||
recipe.AddIngredient(ItemID.Diamond, 3);
|
||||
recipe.AddIngredient(ItemID.FlintlockPistol);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,14 +68,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
position += velocity.ToRotation().ToRotationVector2() * 80f;
|
||||
Projectile.NewProjectile(position, velocity.SafeNormalize(Vector2.Zero) * 17f, ModContent.ProjectileType<ExoLightBurst>(), damage * 3, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(position, velocity.SafeNormalize(Vector2.Zero) * 17f, ModContent.ProjectileType<ExoLightBurst>(), (int)(damage * 2.3), knockBack, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY).RotatedByRandom(0.05f);
|
||||
Projectile.NewProjectile(position, velocity, type, damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
|
||||
@@ -21,13 +21,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.damage = 108;
|
||||
item.damage = 120;
|
||||
item.shootSpeed = 15f;
|
||||
item.shoot = ModContent.ProjectileType<ApoctolithProj>();
|
||||
item.width = 66;
|
||||
item.height = 64;
|
||||
item.useTime = 25;
|
||||
item.useAnimation = 25;
|
||||
item.useTime = 24;
|
||||
item.useAnimation = 24;
|
||||
item.useStyle = 1;
|
||||
item.knockBack = 10f;
|
||||
item.crit = 20;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = -6; i <= 6; i += 4)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage / 2, knockBack * 0.5f, player.whoAmI, 0f, 0f);
|
||||
int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage, knockBack * 0.5f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[dart].Calamity().forceRogue = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return mod.GetPrefix(newPrefix).Type;
|
||||
}
|
||||
|
||||
public override bool NewPreReforge()
|
||||
{
|
||||
StealthStrikeDamage = 1f;
|
||||
return true;
|
||||
}
|
||||
|
||||
public sealed override void SetDefaults()
|
||||
{
|
||||
SafeSetDefaults();
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 36;
|
||||
item.damage = 32;
|
||||
item.mana = 10;
|
||||
item.width = 46;
|
||||
item.height = 28;
|
||||
|
||||
@@ -19,12 +19,12 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 70;
|
||||
item.damage = 60;
|
||||
item.mana = 10;
|
||||
item.width = 66;
|
||||
item.height = 70;
|
||||
item.useTime = item.useAnimation = 20;
|
||||
item.useStyle = 1;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 1f;
|
||||
item.value = CalamityGlobalItem.Rarity7BuyPrice;
|
||||
|
||||
@@ -44,8 +44,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<RustyLockpick>(), 1);
|
||||
ModRecipe recipe = new ModRecipe(mod);;
|
||||
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 20);
|
||||
recipe.AddRecipeGroup("IronBar", 10);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
npc.width = 80;
|
||||
npc.height = 40;
|
||||
npc.defense = 50;
|
||||
npc.Calamity().RevPlusDR(0.25f);
|
||||
npc.DR_NERD(0.25f);
|
||||
npc.lifeMax = 10000;
|
||||
npc.knockBackResist = 0f;
|
||||
aiType = -1;
|
||||
|
||||
@@ -91,17 +91,17 @@ namespace CalamityMod.NPCs.Abyss
|
||||
if (flag16)
|
||||
{
|
||||
npc.localAI[2] = 1f;
|
||||
npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f;
|
||||
npc.velocity *= 0.975f;
|
||||
float num263 = 0.8f;
|
||||
if (npc.velocity.X > -num263 && npc.velocity.X < num263 && npc.velocity.Y > -num263 && npc.velocity.Y < num263)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
float num264 = CalamityWorld.death ? 12f : 8f;
|
||||
Vector2 vector31 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num265 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector31.X;
|
||||
float num266 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector31.Y;
|
||||
float num267 = (float)Math.Sqrt((double)(num265 * num265 + num266 * num266));
|
||||
Vector2 vector31 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num265 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector31.X;
|
||||
float num266 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector31.Y;
|
||||
float num267 = (float)Math.Sqrt(num265 * num265 + num266 * num266);
|
||||
num267 = num264 / num267;
|
||||
num265 *= num267;
|
||||
num266 *= num267;
|
||||
@@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
else
|
||||
{
|
||||
npc.localAI[2] = 0f;
|
||||
npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.02f;
|
||||
npc.velocity.X = npc.velocity.X + npc.direction * 0.02f;
|
||||
npc.rotation = npc.velocity.X * 0.4f;
|
||||
if (npc.velocity.X < -1f || npc.velocity.X > 1f)
|
||||
{
|
||||
@@ -134,8 +134,8 @@ namespace CalamityMod.NPCs.Abyss
|
||||
npc.ai[0] = -1f;
|
||||
}
|
||||
}
|
||||
int num268 = (int)(npc.position.X + (float)(npc.width / 2)) / 16;
|
||||
int num269 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16;
|
||||
int num268 = (int)(npc.position.X + (npc.width / 2)) / 16;
|
||||
int num269 = (int)(npc.position.Y + (npc.height / 2)) / 16;
|
||||
if (Main.tile[num268, num269 - 1] == null)
|
||||
{
|
||||
Main.tile[num268, num269 - 1] = new Tile();
|
||||
@@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
if ((double)npc.velocity.Y > 1.2 || (double)npc.velocity.Y < -1.2)
|
||||
if (npc.velocity.Y > 1.2 || npc.velocity.Y < -1.2)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y * 0.99f;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
npc.width = 180;
|
||||
npc.height = 180;
|
||||
npc.defense = 50;
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
npc.lifeMax = 220000;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
int num = 200;
|
||||
if (npc.ai[2] == 0f)
|
||||
{
|
||||
npc.localAI[0] += 1f;
|
||||
npc.alpha = num;
|
||||
npc.TargetClosest(true);
|
||||
if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f &&
|
||||
@@ -60,7 +59,82 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
npc.ai[2] = -16f;
|
||||
}
|
||||
return;
|
||||
if (npc.collideX)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * -1f;
|
||||
npc.direction *= -1;
|
||||
}
|
||||
if (npc.collideY)
|
||||
{
|
||||
if (npc.velocity.Y > 0f)
|
||||
{
|
||||
npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f;
|
||||
npc.directionY = -1;
|
||||
npc.ai[0] = -1f;
|
||||
}
|
||||
else if (npc.velocity.Y < 0f)
|
||||
{
|
||||
npc.velocity.Y = Math.Abs(npc.velocity.Y);
|
||||
npc.directionY = 1;
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
}
|
||||
npc.velocity.X = npc.velocity.X + npc.direction * 0.02f;
|
||||
npc.rotation = npc.velocity.X * 0.4f;
|
||||
if (npc.velocity.X < -1f || npc.velocity.X > 1f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.95f;
|
||||
}
|
||||
if (npc.ai[0] == -1f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - 0.01f;
|
||||
if (npc.velocity.Y < -1f)
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y + 0.01f;
|
||||
if (npc.velocity.Y > 1f)
|
||||
{
|
||||
npc.ai[0] = -1f;
|
||||
}
|
||||
}
|
||||
int num268 = (int)(npc.position.X + (npc.width / 2)) / 16;
|
||||
int num269 = (int)(npc.position.Y + (npc.height / 2)) / 16;
|
||||
if (Main.tile[num268, num269 - 1] == null)
|
||||
{
|
||||
Main.tile[num268, num269 - 1] = new Tile();
|
||||
}
|
||||
if (Main.tile[num268, num269 + 1] == null)
|
||||
{
|
||||
Main.tile[num268, num269 + 1] = new Tile();
|
||||
}
|
||||
if (Main.tile[num268, num269 + 2] == null)
|
||||
{
|
||||
Main.tile[num268, num269 + 2] = new Tile();
|
||||
}
|
||||
if (Main.tile[num268, num269 - 1].liquid > 128)
|
||||
{
|
||||
if (Main.tile[num268, num269 + 1].active())
|
||||
{
|
||||
npc.ai[0] = -1f;
|
||||
}
|
||||
else if (Main.tile[num268, num269 + 2].active())
|
||||
{
|
||||
npc.ai[0] = -1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
if (npc.velocity.Y > 1.2 || npc.velocity.Y < -1.2)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y * 0.99f;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (npc.ai[2] < 0f)
|
||||
{
|
||||
@@ -75,8 +149,9 @@ namespace CalamityMod.NPCs.Abyss
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[2] == 0f)
|
||||
{
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.X = (float)(npc.direction * 2);
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.X = npc.direction * 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
npc.width = 126; //36
|
||||
npc.height = 76; //20
|
||||
npc.defense = 300;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 160000;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
|
||||
@@ -77,9 +77,9 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
bool phase1 = (double)npc.life > (double)npc.lifeMax * 0.5;
|
||||
bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.5;
|
||||
bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.1;
|
||||
bool phase1 = npc.life > npc.lifeMax * 0.5;
|
||||
bool phase2 = npc.life <= npc.lifeMax * 0.5;
|
||||
bool phase3 = npc.life <= npc.lifeMax * 0.1;
|
||||
npc.chaseable = hasBeenHit;
|
||||
if (npc.soundDelay <= 0)
|
||||
{
|
||||
@@ -108,41 +108,33 @@ namespace CalamityMod.NPCs.Abyss
|
||||
reset2 = true;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.spriteDirection = (npc.direction > 0) ? -1 : 1;
|
||||
int num = 200;
|
||||
if (npc.ai[2] == 0f)
|
||||
{
|
||||
npc.localAI[0] += 1f;
|
||||
npc.alpha = num;
|
||||
npc.TargetClosest(true);
|
||||
if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f)
|
||||
if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
npc.ai[2] = -16f;
|
||||
}
|
||||
if (npc.velocity.X != 0f || npc.velocity.Y < 0f || npc.velocity.Y > 2f || npc.justHit || npc.localAI[0] >= 420f)
|
||||
if (npc.justHit || npc.localAI[0] >= 420f)
|
||||
{
|
||||
npc.ai[2] = -16f;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (npc.ai[2] < 0f)
|
||||
{
|
||||
if (npc.alpha > 0)
|
||||
{
|
||||
npc.alpha -= num / 16;
|
||||
if (npc.alpha < 0)
|
||||
{
|
||||
npc.alpha = 0;
|
||||
}
|
||||
}
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[2] == 0f)
|
||||
{
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.X = (float)(npc.direction * 2);
|
||||
npc.velocity.X = npc.direction * 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
if (npc.direction == 0)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
npc.damage = 120;
|
||||
npc.lifeMax = 5500;
|
||||
npc.defense = 45;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
npc.lifeMax = 7000;
|
||||
npc.Calamity().RevPlusDR(0.4f);
|
||||
npc.DR_NERD(0.4f);
|
||||
}
|
||||
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
|
||||
npc.damage = 130;
|
||||
npc.lifeMax = 5915;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.defense = 50;
|
||||
|
||||
npc.aiStyle = aiType = -1;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.Calamity().RevPlusDR(0.4f);
|
||||
npc.DR_NERD(0.4f);
|
||||
npc.lavaImmune = false;
|
||||
npc.noGravity = false;
|
||||
npc.noTileCollide = false;
|
||||
|
||||
@@ -29,14 +29,14 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npc.damage = 75;
|
||||
npc.lifeMax = 605;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.075f);
|
||||
npc.DR_NERD(0.075f);
|
||||
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
npc.damage = 150;
|
||||
npc.lifeMax = 4500;
|
||||
npc.defense = 65;
|
||||
npc.Calamity().RevPlusDR(0.35f);
|
||||
npc.DR_NERD(0.35f);
|
||||
}
|
||||
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -39,13 +39,13 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npc.damage = 150;
|
||||
npc.lifeMax = 5001;
|
||||
npc.defense = 58;
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
}
|
||||
else if (CalamityWorld.downedAquaticScourge)
|
||||
{
|
||||
npc.damage = 85;
|
||||
npc.lifeMax = 700;
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
}
|
||||
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npc.damage = 100;
|
||||
npc.lifeMax = 5000;
|
||||
npc.defense = 33;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
}
|
||||
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -34,14 +34,14 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npc.damage = 66;
|
||||
npc.lifeMax = 850;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.25f);
|
||||
npc.DR_NERD(0.25f);
|
||||
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
npc.damage = 120;
|
||||
npc.lifeMax = 4900;
|
||||
npc.defense = 78;
|
||||
npc.Calamity().RevPlusDR(0.4f);
|
||||
npc.DR_NERD(0.4f);
|
||||
}
|
||||
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
npc.width = 32;
|
||||
npc.height = 32;
|
||||
npc.defense = 20;
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
npc.width = 32;
|
||||
npc.height = 32;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.05f);
|
||||
npc.DR_NERD(0.05f);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
npc.width = 100;
|
||||
npc.height = 90;
|
||||
npc.defense = 10;
|
||||
npc.Calamity().RevPlusDR(0.1f);
|
||||
npc.DR_NERD(0.1f);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.LifeMaxNERB(73000, 85000, 10000000);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
npc.width = 30;
|
||||
npc.height = 50;
|
||||
npc.defense = 25;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 54;
|
||||
npc.aiStyle = 41;
|
||||
npc.defense = 14;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 300;
|
||||
npc.knockBackResist = 0.6f;
|
||||
npc.value = Item.buyPrice(0, 0, 10, 0);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.width = 30; //324
|
||||
npc.height = 30; //216
|
||||
npc.defense = 10;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 50;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.aiStyle = 3;
|
||||
npc.damage = 55;
|
||||
npc.defense = 20;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 500;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.knockBackResist = 0.38f;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.aiStyle = -1;
|
||||
npc.damage = 55;
|
||||
npc.defense = 20;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 500;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 88;
|
||||
npc.damage = 70;
|
||||
npc.defense = 40;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 1200;
|
||||
npc.knockBackResist = 0.08f;
|
||||
npc.value = Item.buyPrice(0, 1, 0, 0);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 56;
|
||||
npc.damage = 50;
|
||||
npc.defense = 20;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 430;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.noGravity = true;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.aiStyle = 103;
|
||||
npc.lifeMax = 400;
|
||||
npc.defense = 12;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.value = Item.buyPrice(0, 0, 20, 0);
|
||||
npc.knockBackResist = 0.8f;
|
||||
npc.behindTiles = true;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.aiStyle = -1;
|
||||
npc.damage = 50;
|
||||
npc.defense = 8;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 330;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.knockBackResist = 0.75f;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.aiStyle = -1;
|
||||
npc.damage = 55;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 470;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 58;
|
||||
npc.aiStyle = -1;
|
||||
npc.defense = 6;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 340;
|
||||
npc.knockBackResist = 0.2f;
|
||||
npc.value = Item.buyPrice(0, 0, 15, 0);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 50;
|
||||
npc.damage = 45;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 230;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.noGravity = true;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.height = 40;
|
||||
npc.damage = 38;
|
||||
npc.defense = 16;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.lifeMax = 310;
|
||||
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
|
||||
npc.noGravity = true;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
|
||||
npc.npcSlots = 0.5f; //needed?
|
||||
npc.damage = 55;
|
||||
npc.defense = 18;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.knockBackResist = 0.65f;
|
||||
npc.lifeMax = 210;
|
||||
npc.value = Item.buyPrice(0, 0, 10, 0);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npc.width = 400;
|
||||
npc.height = 280;
|
||||
npc.defense = 50;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.LifeMaxNERB(96000, NPC.downedMoonlord ? 440000 : 122000, 8400000); // 30 seconds in boss rush
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusBody : ModNPC
|
||||
{
|
||||
private int spawn = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.damage = 85;
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 38;
|
||||
npc.height = 44;
|
||||
npc.defense = 40;
|
||||
npc.Calamity().RevPlusDR(0.1f);
|
||||
npc.LifeMaxNERB(12000, 18000, 360000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = 6;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
}
|
||||
npc.alpha = 255;
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.dontCountMe = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(spawn);
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
writer.Write(npc.localAI[3]);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
spawn = reader.ReadInt32();
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
npc.localAI[3] = reader.ReadSingle();
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false, false);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
return !npc.dontTakeDamage;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAlt") : Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
if (npc.localAI[3] != 1f)
|
||||
spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (NPC.CountNPCS(ModContent.NPCType<AstrumDeusProbe3>()) < 3 && CalamityWorld.revenge)
|
||||
{
|
||||
if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25))
|
||||
{
|
||||
spawn = 1;
|
||||
int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType<AstrumDeusProbe3>(), 0, 0f, 0f, 0f, 0f, 255);
|
||||
if (Main.netMode == NetmodeID.Server && num660 < 200)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180, true);
|
||||
}
|
||||
|
||||
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale);
|
||||
npc.damage = (int)(npc.damage * 0.85f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
@@ -10,10 +9,8 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusBodySpectral : ModNPC
|
||||
public class AstrumDeusBodySpectral : ModNPC
|
||||
{
|
||||
private int spawn = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus");
|
||||
@@ -27,9 +24,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
npc.width = 38;
|
||||
npc.height = 44;
|
||||
npc.defense = 50;
|
||||
npc.LifeMaxNERB(37500, 53800, 1300000);
|
||||
double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.LifeMaxNERB(187500, 225000, 6500000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
@@ -61,16 +58,12 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(spawn);
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
spawn = reader.ReadInt32();
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
@@ -80,7 +73,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false, true);
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
@@ -91,8 +84,8 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral") : Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White;
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
@@ -103,22 +96,22 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f) * npc.Opacity;
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
@@ -126,9 +119,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color41 *= (num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
@@ -136,7 +129,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
color43 *= (num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
@@ -167,27 +160,29 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (NPC.CountNPCS(ModContent.NPCType<AstrumDeusProbe3>()) < 6 && CalamityWorld.revenge)
|
||||
if (Main.expertMode)
|
||||
{
|
||||
if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25))
|
||||
if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(25))
|
||||
{
|
||||
spawn = 1;
|
||||
int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType<AstrumDeusProbe3>(), 0, 0f, 0f, 0f, 0f, 255);
|
||||
if (Main.netMode == NetmodeID.Server && num660 < 200)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
npc.netUpdate = true;
|
||||
if (NPC.CountNPCS(ModContent.NPCType<AstrumDeusProbe3>()) < 3)
|
||||
{
|
||||
int num660 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + npc.height), ModContent.NPCType<AstrumDeusProbe3>(), 0, 0f, 0f, 0f, 0f, 255);
|
||||
if (Main.netMode == NetmodeID.Server && num660 < 200)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
@@ -195,7 +190,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
public class AstrumDeusHead : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.damage = 100;
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 56;
|
||||
npc.height = 56;
|
||||
npc.defense = 20;
|
||||
npc.Calamity().RevPlusDR(0.1f);
|
||||
npc.LifeMaxNERB(12000, 18000, 360000);
|
||||
double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = 6;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
}
|
||||
npc.alpha = 255;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
|
||||
if (calamityModMusic != null)
|
||||
music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/AstrumDeus");
|
||||
else
|
||||
music = MusicID.Boss3;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, true, false);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
return !npc.dontTakeDamage;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 240, true);
|
||||
}
|
||||
|
||||
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
@@ -22,7 +22,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
[AutoloadBossHead]
|
||||
public class AstrumDeusHeadSpectral : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
@@ -38,9 +38,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
npc.width = 56;
|
||||
npc.height = 56;
|
||||
npc.defense = 25;
|
||||
npc.LifeMaxNERB(37500, 53800, 1300000);
|
||||
double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.LifeMaxNERB(187500, 225000, 6500000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
@@ -73,18 +73,16 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, true, true);
|
||||
CalamityAI.AstrumDeusAI(npc, mod, true);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
@@ -100,8 +98,8 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = npc.Calamity().newAI[0] == 1f ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White;
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
@@ -112,22 +110,22 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.Calamity().newAI[0] == 1f ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f) * npc.Opacity;
|
||||
Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
@@ -135,15 +133,15 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color41 *= (num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
color43 *= (num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
@@ -155,25 +153,16 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
if (npc.Calamity().newAI[0] == 1f && Main.player[npc.target].gravDir != -1f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
@@ -181,7 +170,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
|
||||
|
Before Width: | Height: | Size: 417 B |
@@ -1,142 +0,0 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusProbe : ModNPC
|
||||
{
|
||||
private bool start = true;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus Probe");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.width = 30;
|
||||
npc.height = 30;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.chaseable = false;
|
||||
npc.dontTakeDamage = true;
|
||||
npc.damage = 0;
|
||||
npc.lifeMax = 100;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
}
|
||||
|
||||
public override bool PreAI()
|
||||
{
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
if (start)
|
||||
{
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
}
|
||||
npc.ai[1] = npc.ai[0];
|
||||
start = false;
|
||||
}
|
||||
npc.TargetClosest(true);
|
||||
Vector2 direction = Main.player[npc.target].Center - npc.Center;
|
||||
direction.Normalize();
|
||||
direction *= CalamityWorld.bossRushActive ? 13f : 9f;
|
||||
npc.rotation = direction.ToRotation();
|
||||
npc.localAI[0] += 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 720f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
int seeProjFileforDmg = 0;
|
||||
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType<DeusMine>(), seeProjFileforDmg, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
bool anySmallDeusHeads = NPC.AnyNPCs(ModContent.NPCType<AstrumDeusHead>());
|
||||
if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
Player player = Main.player[npc.target];
|
||||
int npcType = anySmallDeusHeads ? ModContent.NPCType<AstrumDeusHead>() : ModContent.NPCType<AstrumDeusHeadSpectral>();
|
||||
NPC parent = Main.npc[NPC.FindFirstNPC(npcType)];
|
||||
double deg = (double)npc.ai[1];
|
||||
double rad = deg * (Math.PI / 180);
|
||||
double dist = 75;
|
||||
npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2;
|
||||
npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2;
|
||||
npc.ai[1] += 2f;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Astral/AstralProbeGlow");
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White * 0.6f, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 536 B |
@@ -1,143 +0,0 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusProbe2 : ModNPC
|
||||
{
|
||||
public int timer = 0;
|
||||
public bool start = true;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus Probe");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.width = 30;
|
||||
npc.height = 30;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.chaseable = false;
|
||||
npc.dontTakeDamage = true;
|
||||
npc.damage = 0;
|
||||
npc.lifeMax = 100;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
}
|
||||
|
||||
public override bool PreAI()
|
||||
{
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
if (start)
|
||||
{
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
}
|
||||
npc.ai[1] = npc.ai[0];
|
||||
start = false;
|
||||
}
|
||||
npc.TargetClosest(true);
|
||||
Vector2 direction = Main.player[npc.target].Center - npc.Center;
|
||||
direction.Normalize();
|
||||
direction *= 40f;
|
||||
npc.rotation = direction.ToRotation();
|
||||
npc.localAI[0] += 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 360f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
int seeProjFileforDmg = 0;
|
||||
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType<DeusMine>(), seeProjFileforDmg, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
bool anySmallDeusHeads = NPC.AnyNPCs(ModContent.NPCType<AstrumDeusHead>());
|
||||
if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
Player player = Main.player[npc.target];
|
||||
int npcType = anySmallDeusHeads ? ModContent.NPCType<AstrumDeusHead>() : ModContent.NPCType<AstrumDeusHeadSpectral>();
|
||||
NPC parent = Main.npc[NPC.FindFirstNPC(npcType)];
|
||||
double deg = (double)npc.ai[1];
|
||||
double rad = deg * (Math.PI / 180);
|
||||
double dist = 150;
|
||||
npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2;
|
||||
npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2;
|
||||
npc.ai[1] += 2f;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Astral/AstralProbeGlow");
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White * 0.6f, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 536 B |
@@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
npc.width = 30;
|
||||
npc.height = 30;
|
||||
npc.defense = 30;
|
||||
npc.Calamity().RevPlusDR(0.2f);
|
||||
npc.DR_NERD(0.2f);
|
||||
npc.lifeMax = 1400;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.lifeMax = 120000;
|
||||
}
|
||||
npc.knockBackResist = 0.95f;
|
||||
npc.knockBackResist = 0.4f;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
@@ -44,12 +44,6 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
public override void AI()
|
||||
{
|
||||
bool revenge = CalamityWorld.revenge;
|
||||
if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
@@ -66,16 +60,16 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
num *= 1.5f;
|
||||
num2 *= 1.5f;
|
||||
}
|
||||
Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num4 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
|
||||
float num5 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
|
||||
num4 = (float)((int)(num4 / 8f) * 8);
|
||||
num5 = (float)((int)(num5 / 8f) * 8);
|
||||
vector.X = (float)((int)(vector.X / 8f) * 8);
|
||||
vector.Y = (float)((int)(vector.Y / 8f) * 8);
|
||||
Vector2 vector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num4 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2);
|
||||
float num5 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2);
|
||||
num4 = (int)(num4 / 8f) * 8;
|
||||
num5 = (int)(num5 / 8f) * 8;
|
||||
vector.X = (int)(vector.X / 8f) * 8;
|
||||
vector.Y = (int)(vector.Y / 8f) * 8;
|
||||
num4 -= vector.X;
|
||||
num5 -= vector.Y;
|
||||
float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5));
|
||||
float num6 = (float)Math.Sqrt(num4 * num4 + num5 * num5);
|
||||
float num7 = num6;
|
||||
bool flag = false;
|
||||
if (num6 > 600f)
|
||||
@@ -119,7 +113,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
}
|
||||
if (Main.player[npc.target].dead)
|
||||
{
|
||||
num4 = (float)npc.direction * num / 2f;
|
||||
num4 = npc.direction * num / 2f;
|
||||
num5 = -num / 2f;
|
||||
}
|
||||
if (npc.velocity.X < num4)
|
||||
@@ -155,17 +149,17 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
num11 /= 16;
|
||||
if (!WorldGen.SolidTile(num10, num11))
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 0f, 0.25f);
|
||||
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.3f, 0f, 0.25f);
|
||||
}
|
||||
if (num4 > 0f)
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
npc.rotation = (float)Math.Atan2((double)num5, (double)num4);
|
||||
npc.rotation = (float)Math.Atan2(num5, num4);
|
||||
}
|
||||
if (num4 < 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
npc.rotation = (float)Math.Atan2((double)num5, (double)num4) + 3.14f;
|
||||
npc.rotation = (float)Math.Atan2(num5, num4) + 3.14f;
|
||||
}
|
||||
float num12 = 0.7f;
|
||||
if (npc.collideX)
|
||||
@@ -185,11 +179,11 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
npc.velocity.Y = npc.oldVelocity.Y * -num12;
|
||||
if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5)
|
||||
if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5)
|
||||
{
|
||||
npc.velocity.Y = 2f;
|
||||
}
|
||||
if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5)
|
||||
if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5)
|
||||
{
|
||||
npc.velocity.Y = -2f;
|
||||
}
|
||||
@@ -221,9 +215,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
@@ -256,12 +250,12 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 30;
|
||||
npc.height = 30;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
@@ -269,7 +263,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
@@ -291,25 +285,25 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
scaleFactor10 = 1f;
|
||||
}
|
||||
int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
int num626 = Gore.NewGore(new Vector2(npc.position.X + (npc.width / 2) - 24f, npc.position.Y + (npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
Main.gore[num626].velocity *= scaleFactor10;
|
||||
Gore expr_13AB6_cp_0 = Main.gore[num626];
|
||||
expr_13AB6_cp_0.velocity.X += 1f;
|
||||
Gore expr_13AD6_cp_0 = Main.gore[num626];
|
||||
expr_13AD6_cp_0.velocity.Y += 1f;
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (npc.width / 2) - 24f, npc.position.Y + (npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
Main.gore[num626].velocity *= scaleFactor10;
|
||||
Gore expr_13B79_cp_0 = Main.gore[num626];
|
||||
expr_13B79_cp_0.velocity.X -= 1f;
|
||||
Gore expr_13B99_cp_0 = Main.gore[num626];
|
||||
expr_13B99_cp_0.velocity.Y += 1f;
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (npc.width / 2) - 24f, npc.position.Y + (npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
Main.gore[num626].velocity *= scaleFactor10;
|
||||
Gore expr_13C3C_cp_0 = Main.gore[num626];
|
||||
expr_13C3C_cp_0.velocity.X += 1f;
|
||||
Gore expr_13C5C_cp_0 = Main.gore[num626];
|
||||
expr_13C5C_cp_0.velocity.Y -= 1f;
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
num626 = Gore.NewGore(new Vector2(npc.position.X + (npc.width / 2) - 24f, npc.position.Y + (npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
Main.gore[num626].velocity *= scaleFactor10;
|
||||
Gore expr_13CFF_cp_0 = Main.gore[num626];
|
||||
expr_13CFF_cp_0.velocity.X -= 1f;
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusTail : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astrum Deus");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.damage = 70;
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 52;
|
||||
npc.height = 68;
|
||||
npc.defense = 60;
|
||||
npc.Calamity().RevPlusDR(0.35f);
|
||||
npc.LifeMaxNERB(12000, 18000, 360000);
|
||||
double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = 6;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
}
|
||||
npc.alpha = 255;
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
npc.dontCountMe = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false, false);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
return !npc.dontTakeDamage;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
|
||||
}
|
||||
|
||||
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale);
|
||||
npc.damage = (int)(npc.damage * 0.85f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -9,7 +9,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
public class AstrumDeusTailSpectral : ModNPC
|
||||
public class AstrumDeusTailSpectral : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -24,9 +24,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
npc.width = 52;
|
||||
npc.height = 68;
|
||||
npc.defense = 75;
|
||||
npc.LifeMaxNERB(37500, 53800, 1300000);
|
||||
double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.LifeMaxNERB(187500, 225000, 6500000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
@@ -59,13 +59,11 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
writer.Write(npc.chaseable);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
npc.chaseable = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
@@ -75,7 +73,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false, true);
|
||||
CalamityAI.AstrumDeusAI(npc, mod, false);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
@@ -85,8 +83,8 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White;
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
@@ -97,21 +95,21 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f);
|
||||
Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
@@ -119,9 +117,9 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
color41 *= (num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
@@ -141,12 +139,12 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
@@ -154,7 +152,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
npc.width = 60;
|
||||
npc.height = 60;
|
||||
npc.defense = 0;
|
||||
npc.Calamity().RevPlusDR(normalDR);
|
||||
npc.DR_NERD(normalDR);
|
||||
npc.lifeMax = 4000;
|
||||
npc.knockBackResist = 0f;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
npc.defense = 15;
|
||||
npc.value = Item.buyPrice(0, 12, 0, 0);
|
||||
npc.LifeMaxNERB(30000, 41000, 6500000);
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.damage *= 3;
|
||||
|
||||
@@ -42,9 +42,8 @@ namespace CalamityMod.NPCs.Bumblebirb
|
||||
npc.width = 130;
|
||||
npc.height = 100;
|
||||
npc.defense = 40;
|
||||
npc.DR_NERD(0.1f, null, null, null, true);
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.1f;
|
||||
global.customDR = true;
|
||||
global.multDRReductions.Add(BuffID.Ichor, 0.88f);
|
||||
global.multDRReductions.Add(BuffID.CursedInferno, 0.9f);
|
||||
npc.LifeMaxNERB(227500, 252500, 3000000);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.width = 120;
|
||||
npc.height = 120;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.value = 0f;
|
||||
npc.LifeMaxNERB(37500, 51750, 5200000);
|
||||
if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.width = 120;
|
||||
npc.height = 120;
|
||||
npc.defense = 10;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.LifeMaxNERB(9000, 13200, 800000);
|
||||
if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.width = 120;
|
||||
npc.height = 120;
|
||||
npc.defense = 10;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.LifeMaxNERB(7500, 11025, 800000);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.LifeMaxNERB(7500, 11025, 800000);
|
||||
if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.damage *= 3;
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.height = 120;
|
||||
npc.defense = 25;
|
||||
npc.value = Item.buyPrice(0, 15, 0, 0);
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.LifeMaxNERB(28125, 38812, 3900000);
|
||||
npc.DR_NERD(0.15f);
|
||||
npc.LifeMaxNERB(28125, 38812, 3900000);
|
||||
if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.damage *= 3;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.canGhostHeal = false;
|
||||
npc.damage = 40;
|
||||
npc.defense = 10;
|
||||
npc.Calamity().RevPlusDR(0.1f);
|
||||
npc.DR_NERD(0.1f);
|
||||
npc.lifeMax = 2500;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
|
||||
@@ -2545,7 +2545,7 @@ namespace CalamityMod.NPCs
|
||||
float KBResistMultiplier = 1f - baseKnockBackResist * 0.4f;
|
||||
for (float num = 1f; num < balance; num += 0.34f)
|
||||
{
|
||||
if ((double)KBResist < 0.05)
|
||||
if (KBResist < 0.05)
|
||||
{
|
||||
KBResist = 0f;
|
||||
break;
|
||||
@@ -2564,11 +2564,14 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
int enrageScale = 0;
|
||||
if ((double)(npc.position.Y / 16f) < Main.worldSurface)
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale++;
|
||||
if (!Main.player[npc.target].ZoneJungle)
|
||||
enrageScale++;
|
||||
|
||||
if (CalamityWorld.bossRushActive)
|
||||
enrageScale = 0;
|
||||
|
||||
// Boost defense and damage as health decreases
|
||||
int statBoost = (int)(20f * (1f - npc.life / (float)npc.lifeMax));
|
||||
if (death)
|
||||
@@ -2609,7 +2612,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
npc.spriteDirection = npc.direction;
|
||||
|
||||
if (npc.position.X < (float)(Main.maxTilesX * 8))
|
||||
if (npc.position.X < (Main.maxTilesX * 8))
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -4377,13 +4380,17 @@ namespace CalamityMod.NPCs
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Phases based on life percentage
|
||||
bool phase2 = lifeRatio < 0.66f || death;
|
||||
bool phase3 = lifeRatio < 0.33f || death;
|
||||
bool phase2 = lifeRatio < 0.85f || death;
|
||||
bool phase3 = lifeRatio < 0.7f || death;
|
||||
bool startFlightPhase = lifeRatio < 0.5f || death;
|
||||
bool phase4 = lifeRatio < 0.25f;
|
||||
bool phase5 = lifeRatio < 0.1f;
|
||||
|
||||
// Flight timer
|
||||
float newAISet = phase5 ? 900f : phase4 ? 450f : 0f;
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
if (calamityGlobalNPC.newAI[3] >= 1800f)
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = newAISet;
|
||||
|
||||
// Set worm variable for worms
|
||||
if (npc.ai[3] > 0f)
|
||||
@@ -4399,10 +4406,7 @@ namespace CalamityMod.NPCs
|
||||
bool targetFloatingUp = player.gravDir == -1f;
|
||||
|
||||
// Phase for flying at the player
|
||||
bool flyAtTarget = calamityGlobalNPC.newAI[3] >= 900f && (lifeRatio < 0.5f || death);
|
||||
|
||||
// Velocity
|
||||
npc.velocity.Length();
|
||||
bool flyAtTarget = calamityGlobalNPC.newAI[3] >= 900f && startFlightPhase;
|
||||
|
||||
// Dust on spawn and alpha effects
|
||||
if (npc.type == NPCID.TheDestroyer || (npc.type != NPCID.TheDestroyer && Main.npc[(int)npc.ai[1]].alpha < 128))
|
||||
@@ -4497,10 +4501,10 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
// Fire lasers
|
||||
if (npc.type == NPCID.TheDestroyerBody && Vector2.Distance(player.Center, npc.Center) > (flyAtTarget ? 320f : 80f))
|
||||
if (npc.type == NPCID.TheDestroyerBody && Vector2.Distance(player.Center, npc.Center) > 80f && !flyAtTarget)
|
||||
{
|
||||
// Laser rate of fire
|
||||
int shootTime = 1 + (int)Math.Ceiling(((enraged || configBossRushBoost) ? 7D : 3D) * lifeRatio);
|
||||
int shootTime = 2 + (int)Math.Ceiling(((enraged || configBossRushBoost) ? 5D : 2D) * (1f - lifeRatio));
|
||||
if (CalamityWorld.bossRushActive)
|
||||
shootTime += 1;
|
||||
|
||||
@@ -4559,11 +4563,6 @@ namespace CalamityMod.NPCs
|
||||
damage += 4;
|
||||
projectileType = ModContent.ProjectileType<DestroyerHomingLaser>();
|
||||
}
|
||||
else if (phase2)
|
||||
{
|
||||
damage += 2;
|
||||
projectileType = ModContent.ProjectileType<DestroyerFrostLaser>();
|
||||
}
|
||||
}
|
||||
else
|
||||
projectileType = ProjectileID.SaucerScrap;
|
||||
@@ -4699,6 +4698,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float fallSpeedBoost = death ? 5f : 5f * (1f - lifeRatio);
|
||||
fallSpeed += fallSpeedBoost;
|
||||
|
||||
@@ -4708,6 +4708,13 @@ namespace CalamityMod.NPCs
|
||||
float speed = 0.1f + speedBoost;
|
||||
float turnSpeed = 0.15f + turnSpeedBoost;
|
||||
|
||||
if (flyAtTarget)
|
||||
{
|
||||
float speedMultiplier = phase5 ? 2f : phase4 ? 1.5f : 1f;
|
||||
speed *= speedMultiplier;
|
||||
fallSpeed *= speedMultiplier;
|
||||
}
|
||||
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
speed *= 1.5f;
|
||||
@@ -13541,6 +13548,12 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.MoonLordFreeEye)
|
||||
{
|
||||
if (Main.npc[(int)npc.ai[3]].ai[0] == 2f)
|
||||
{
|
||||
npc.HitEffect(0, 9999.0);
|
||||
npc.active = false;
|
||||
}
|
||||
|
||||
if (calamityGlobalNPC.newAI[0] == 0f)
|
||||
{
|
||||
int eyeCount = NPC.CountNPCS(npc.type);
|
||||
|
||||
@@ -170,7 +170,6 @@ namespace CalamityMod.NPCs
|
||||
public static int leviathan = -1;
|
||||
public static int siren = -1;
|
||||
public static int scavenger = -1;
|
||||
public static int astrumDeusHeadMain = -1;
|
||||
public static int energyFlame = -1;
|
||||
public static int doughnutBoss = -1;
|
||||
public static int holyBossAttacker = -1;
|
||||
@@ -281,9 +280,6 @@ namespace CalamityMod.NPCs
|
||||
/// </summary>
|
||||
public static List<int> AstrumDeusIDs = new List<int>
|
||||
{
|
||||
NPCType<AstrumDeusHead>(),
|
||||
NPCType<AstrumDeusBody>(),
|
||||
NPCType<AstrumDeusTail>(),
|
||||
NPCType<AstrumDeusHeadSpectral>(),
|
||||
NPCType<AstrumDeusBodySpectral>(),
|
||||
NPCType<AstrumDeusTailSpectral>()
|
||||
@@ -297,6 +293,19 @@ namespace CalamityMod.NPCs
|
||||
NPCType<AquaticScourgeTail>()
|
||||
};
|
||||
|
||||
public static List<int> PerforatorIDs = new List<int>
|
||||
{
|
||||
NPCType<PerforatorHeadLarge>(),
|
||||
NPCType<PerforatorBodyLarge>(),
|
||||
NPCType<PerforatorTailLarge>(),
|
||||
NPCType<PerforatorHeadMedium>(),
|
||||
NPCType<PerforatorBodyMedium>(),
|
||||
NPCType<PerforatorTailMedium>(),
|
||||
NPCType<PerforatorHeadSmall>(),
|
||||
NPCType<PerforatorBodySmall>(),
|
||||
NPCType<PerforatorTailSmall>()
|
||||
};
|
||||
|
||||
public static List<int> DesertScourgeIDs = new List<int>
|
||||
{
|
||||
NPCType<DesertScourgeHead>(),
|
||||
@@ -324,6 +333,27 @@ namespace CalamityMod.NPCs
|
||||
NPCType<StormWeaverBodyNaked>(),
|
||||
NPCType<StormWeaverTailNaked>()
|
||||
};
|
||||
|
||||
public static List<int> GrenadeResistIDs = new List<int>
|
||||
{
|
||||
ProjectileID.Grenade,
|
||||
ProjectileID.StickyGrenade,
|
||||
ProjectileID.BouncyGrenade,
|
||||
ProjectileID.Bomb,
|
||||
ProjectileID.StickyBomb,
|
||||
ProjectileID.BouncyBomb,
|
||||
ProjectileID.Dynamite,
|
||||
ProjectileID.StickyDynamite,
|
||||
ProjectileID.BouncyDynamite,
|
||||
ProjectileID.Explosives,
|
||||
ProjectileID.ExplosiveBunny,
|
||||
ProjectileID.PartyGirlGrenade,
|
||||
ProjectileID.BombFish,
|
||||
ProjectileID.Beenade,
|
||||
ProjectileID.Bee,
|
||||
ProjectileID.GiantBee
|
||||
//ProjectileID.ScarabBomb
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region Instance Per Entity
|
||||
@@ -375,7 +405,6 @@ namespace CalamityMod.NPCs
|
||||
ResetSavedIndex(ref leviathan, NPCType<Leviathan.Leviathan>());
|
||||
ResetSavedIndex(ref siren, NPCType<Siren>());
|
||||
ResetSavedIndex(ref scavenger, NPCType<RavagerBody>());
|
||||
ResetSavedIndex(ref astrumDeusHeadMain, NPCType<AstrumDeusHeadSpectral>());
|
||||
ResetSavedIndex(ref energyFlame, NPCType<ProfanedEnergyBody>());
|
||||
ResetSavedIndex(ref doughnutBoss, NPCType<ProfanedGuardianBoss>());
|
||||
ResetSavedIndex(ref holyBossAttacker, NPCType<ProvSpawnOffense>());
|
||||
@@ -516,11 +545,11 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
|
||||
npc.lifeRegen -= projectileCount * 350;
|
||||
npc.lifeRegen -= projectileCount * 250;
|
||||
|
||||
if (damage < projectileCount * 70)
|
||||
if (damage < projectileCount * 50)
|
||||
{
|
||||
damage = projectileCount * 70;
|
||||
damage = projectileCount * 50;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,21 +716,18 @@ namespace CalamityMod.NPCs
|
||||
newAI[m] = 0f;
|
||||
}
|
||||
|
||||
// Apply DR to vanilla NPCs. No vanilla NPCs have DR except in Rev+.
|
||||
// This also applies DR to other mods' NPCs who have set up their NPCs to have DR in Rev+.
|
||||
if (CalamityWorld.revenge)
|
||||
{
|
||||
if (CalamityMod.DRValues.ContainsKey(npc.type))
|
||||
{
|
||||
CalamityMod.DRValues.TryGetValue(npc.type, out float revDR);
|
||||
DR = revDR;
|
||||
}
|
||||
// Apply DR to vanilla NPCs.
|
||||
// This also applies DR to other mods' NPCs who have set up their NPCs to have DR.
|
||||
if (CalamityMod.DRValues.ContainsKey(npc.type))
|
||||
{
|
||||
CalamityMod.DRValues.TryGetValue(npc.type, out float newDR);
|
||||
DR = newDR;
|
||||
}
|
||||
|
||||
if (CalamityMod.bossKillTimes.ContainsKey(npc.type))
|
||||
{
|
||||
CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime);
|
||||
KillTime = revKillTime;
|
||||
}
|
||||
if (CalamityMod.bossKillTimes.ContainsKey(npc.type))
|
||||
{
|
||||
CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime);
|
||||
KillTime = revKillTime;
|
||||
}
|
||||
|
||||
if (npc.boss && CalamityWorld.revenge)
|
||||
@@ -1017,17 +1043,6 @@ namespace CalamityMod.NPCs
|
||||
npc.canGhostHeal = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the DR of this NPC only if Revengeance Mode is enabled. Otherwise sets DR to zero.
|
||||
/// </summary>
|
||||
/// <param name="dr">The DR to set, assuming Rev+ difficulty.</param>
|
||||
/// <returns>Whether Revengeance Mode is currently enabled.</returns>
|
||||
public bool RevPlusDR(float dr)
|
||||
{
|
||||
DR = CalamityWorld.revenge ? dr : 0f;
|
||||
return CalamityWorld.revenge;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Other Stat Changes
|
||||
@@ -1428,17 +1443,24 @@ namespace CalamityMod.NPCs
|
||||
#region Strike NPC
|
||||
public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
|
||||
{
|
||||
// Damage reduction on spawn
|
||||
if (CalamityWorld.revenge || CalamityWorld.bossRushActive)
|
||||
{
|
||||
if (DestroyerIDs.Contains(npc.type))
|
||||
if (DestroyerIDs.Contains(npc.type) || AstrumDeusIDs.Contains(npc.type))
|
||||
{
|
||||
if (newAI[1] < 480f || newAI[2] > 0f)
|
||||
if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type)))
|
||||
{
|
||||
damage *= 0.01;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Large Deus worm takes reduced damage to last a long enough time
|
||||
if (AstrumDeusIDs.Contains(npc.type) && newAI[0] == 0f)
|
||||
{
|
||||
damage *= 0.8;
|
||||
}
|
||||
|
||||
// Override hand/head eye 'death' code and use custom 'death' code instead, this is here just in case the AI code fails
|
||||
if (CalamityWorld.revenge || CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -2917,8 +2939,7 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
case 29:
|
||||
if (!AstrumDeusIDs.Contains(npc.type) && npc.type != NPCType<AstrumDeusProbe>() &&
|
||||
npc.type != NPCType<AstrumDeusProbe2>() && npc.type != NPCType<AstrumDeusProbe3>())
|
||||
if (!AstrumDeusIDs.Contains(npc.type) && npc.type != NPCType<AstrumDeusProbe3>())
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
@@ -3525,183 +3546,196 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
|
||||
if (AstrumDeusIDs.Contains(npc.type))
|
||||
// Expert Mode resists, mostly worms
|
||||
if (Main.expertMode)
|
||||
{
|
||||
if (projectile.type == ProjectileType<PlaguenadeBee>() || projectile.type == ProjectileType<PlaguenadeProj>() || projectile.type == ProjectileType<RainbowBoom>() || projectile.type == ProjectileType<RainBolt>() || projectile.type == ProjectileType<AtlantisSpear2>() || ProjectileID.Sets.StardustDragon[projectile.type])
|
||||
if (AstrumDeusIDs.Contains(npc.type))
|
||||
{
|
||||
damage = (int)(damage * 0.1);
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
if (projectile.type == ProjectileType<PlaguenadeBee>() || projectile.type == ProjectileType<PlaguenadeProj>() || projectile.type == ProjectileType<RainbowBoom>() || projectile.type == ProjectileType<RainBolt>() || projectile.type == ProjectileType<AtlantisSpear2>() || ProjectileID.Sets.StardustDragon[projectile.type])
|
||||
{
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType<MalachiteBolt>() || projectile.type == ProjectileType<SakuraBullet>() || projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileID.DD2BetsyArrow)
|
||||
{
|
||||
damage = (int)(damage * 0.4);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SpikecragSpike>() || projectile.type == ProjectileType<SolarBeam2>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<CosmicTentacle>() || projectile.type == ProjectileType<BrimstoneTentacle>())
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<BigNuke>())
|
||||
{
|
||||
damage = (int)(damage * 0.85);
|
||||
}
|
||||
}
|
||||
else if (projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType<MalachiteBolt>() || projectile.type == ProjectileType<SakuraBullet>() || projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileID.DD2BetsyArrow)
|
||||
else if (StormWeaverIDs.Contains(npc.type))
|
||||
{
|
||||
damage = (int)(damage * 0.4);
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
if (projectile.type == ProjectileType<ShatteredSunScorchedBlade>())
|
||||
{
|
||||
damage = (int)(damage * 0.9);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<MoltenAmputatorProj>() || projectile.type == ProjectileType<MoltenBlobThrown>())
|
||||
{
|
||||
if (projectile.penetrate == -1)
|
||||
projectile.penetrate = projectile.Calamity().stealthStrike ? 6 : 9;
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<ElementalAxeMinion>() || projectile.type == ProjectileType<DazzlingStabber>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (ProjectileID.Sets.StardustDragon[projectile.type])
|
||||
{
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SpikecragSpike>() || projectile.type == ProjectileType<SolarBeam2>())
|
||||
else if (DestroyerIDs.Contains(npc.type))
|
||||
{
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
if (projectile.type == ProjectileType<FossilShardThrown>() || projectile.type == ProjectileType<DesecratedBubble>() || projectile.type == ProjectileType<KelvinCatalystStar>() || projectile.type == ProjectileType<RainbowTrail>())
|
||||
{
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SulphuricNukesplosion>())
|
||||
{
|
||||
damage = (int)(damage * 0.38);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SeasSearingSpout>())
|
||||
{
|
||||
damage = (int)(damage * 0.25);
|
||||
}
|
||||
}
|
||||
else if (AquaticScourgeIDs.Contains(npc.type))
|
||||
{
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
if (projectile.type == ProjectileType<FlameBeamTip>() || projectile.type == ProjectileType<FlameBeamTip2>())
|
||||
{
|
||||
damage = (int)(damage * 0.9);
|
||||
}
|
||||
if (projectile.type == ProjectileType<SHPExplosion>() || projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<Brimblast>())
|
||||
{
|
||||
if (projectile.penetrate == -1)
|
||||
projectile.penetrate = 2;
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
}
|
||||
else if (PerforatorIDs.Contains(npc.type))
|
||||
{
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
}
|
||||
else if (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper)
|
||||
{
|
||||
if (npc.type == NPCID.Creeper)
|
||||
GrenadeResist(projectile, ref damage);
|
||||
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
|
||||
if (projectile.type == ProjectileType<SparklingBeam>())
|
||||
{
|
||||
damage = (int)(damage * 0.7);
|
||||
}
|
||||
}
|
||||
else if (DesertScourgeIDs.Contains(npc.type))
|
||||
{
|
||||
GrenadeResist(projectile, ref damage);
|
||||
PierceResistGlobal(projectile, ref damage);
|
||||
}
|
||||
}
|
||||
|
||||
// Other projectile resists
|
||||
if (npc.type == NPCType<OldDuke.OldDuke>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<CrescentMoonFlail>())
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<GalileosMoon>() || projectile.type == ProjectileType<CalamariInk>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<CosmicTentacle>() || projectile.type == ProjectileType<BrimstoneTentacle>())
|
||||
else if (projectile.type == ProjectileType<BloodBombExplosion>() || projectile.type == ProjectileType<CrescentMoonProj>())
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<BigNuke>())
|
||||
else if (projectile.type == ProjectileType<GhastlySoulLarge>() || projectile.type == ProjectileType<GhastlySoulMedium>() || projectile.type == ProjectileType<GhastlySoulSmall>() || projectile.type == ProjectileType<GhostFire>())
|
||||
{
|
||||
damage = (int)(damage * 0.85);
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
|
||||
if (projectile.penetrate == -1 && !projectile.minion)
|
||||
else if (projectile.type == ProjectileID.LunarFlare)
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.penetrate > 1 && projectile.type != ProjectileType<BrinySpout>())
|
||||
{
|
||||
damage /= projectile.penetrate;
|
||||
damage = (int)(damage * 0.8);
|
||||
}
|
||||
}
|
||||
else if (StormWeaverIDs.Contains(npc.type))
|
||||
{
|
||||
if (projectile.type == ProjectileType<ShatteredSunScorchedBlade>())
|
||||
{
|
||||
damage = (int)(damage * 0.9);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<MoltenAmputatorProj>() || projectile.type == ProjectileType<MoltenBlobThrown>())
|
||||
{
|
||||
if (projectile.penetrate == -1)
|
||||
projectile.penetrate = projectile.Calamity().stealthStrike ? 6 : 9;
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<ElementalAxeMinion>() || projectile.type == ProjectileType<DazzlingStabber>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (ProjectileID.Sets.StardustDragon[projectile.type])
|
||||
{
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
|
||||
if (projectile.penetrate == -1 && !projectile.minion)
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.penetrate > 1)
|
||||
{
|
||||
damage /= projectile.penetrate;
|
||||
}
|
||||
}
|
||||
else if (DestroyerIDs.Contains(npc.type))
|
||||
{
|
||||
if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
if (projectile.type == ProjectileType<FossilShardThrown>() || projectile.type == ProjectileType<DesecratedBubble>() || projectile.type == ProjectileType<KelvinCatalystStar>() || projectile.type == ProjectileType<RainbowTrail>())
|
||||
{
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SulphuricNukesplosion>())
|
||||
{
|
||||
damage = (int)(damage * 0.38);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<SeasSearingSpout>())
|
||||
{
|
||||
damage = (int)(damage * 0.25);
|
||||
}
|
||||
}
|
||||
else if (AquaticScourgeIDs.Contains(npc.type))
|
||||
{
|
||||
if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
if (projectile.type == ProjectileType<FlameBeamTip>() || projectile.type == ProjectileType<FlameBeamTip2>())
|
||||
{
|
||||
damage = (int)(damage * 0.9);
|
||||
}
|
||||
if (projectile.type == ProjectileType<SHPExplosion>() || projectile.type == ProjectileType<DormantBrimseekerBab>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<Brimblast>())
|
||||
{
|
||||
if (projectile.penetrate == -1)
|
||||
projectile.penetrate = 2;
|
||||
damage = (int)(damage * 0.1);
|
||||
}
|
||||
}
|
||||
else if (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper)
|
||||
{
|
||||
if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
if (projectile.type == ProjectileType<SparklingBeam>())
|
||||
{
|
||||
damage = (int)(damage * 0.7);
|
||||
}
|
||||
}
|
||||
else if (DesertScourgeIDs.Contains(npc.type))
|
||||
{
|
||||
if (projectile.type == ProjectileType<Spark>())
|
||||
{
|
||||
damage = (int)(damage * 0.7);
|
||||
}
|
||||
}
|
||||
else if (npc.type == NPCType<OldDuke.OldDuke>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<CrescentMoonFlail>())
|
||||
{
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<GalileosMoon>() || projectile.type == ProjectileType<CalamariInk>())
|
||||
{
|
||||
damage = (int)(damage * 0.5);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<BloodBombExplosion>() || projectile.type == ProjectileType<CrescentMoonProj>())
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
else if (projectile.type == ProjectileType<GhastlySoulLarge>() || projectile.type == ProjectileType<GhastlySoulMedium>() || projectile.type == ProjectileType<GhastlySoulSmall>() || projectile.type == ProjectileType<GhostFire>())
|
||||
{
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (projectile.type == ProjectileID.LunarFlare)
|
||||
{
|
||||
damage = (int)(damage * 0.8);
|
||||
}
|
||||
}
|
||||
else if (npc.type == NPCID.CultistBoss)
|
||||
{
|
||||
if (projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileType<SakuraBullet>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileType<SakuraBullet>())
|
||||
{
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
}
|
||||
else if (npc.type == NPCID.DukeFishron)
|
||||
else if (npc.type == NPCID.DukeFishron)
|
||||
{
|
||||
if (projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileType<SakuraBullet>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<PurpleButterfly>() || projectile.type == ProjectileType<SakuraBullet>())
|
||||
{
|
||||
damage = (int)(damage * 1.35);
|
||||
}
|
||||
}
|
||||
else if (npc.type == NPCType<Providence.Providence>())
|
||||
else if (npc.type == NPCType<Providence.Providence>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<ElementalAxeMinion>())
|
||||
{
|
||||
if (projectile.type == ProjectileType<ElementalAxeMinion>())
|
||||
{
|
||||
damage = (int)(damage * 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region On Hit By Item
|
||||
public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit)
|
||||
private void GrenadeResist(Projectile projectile, ref int damage)
|
||||
{
|
||||
if (GrenadeResistIDs.Contains(projectile.type))
|
||||
damage = (int)(damage * 0.2);
|
||||
}
|
||||
|
||||
private void PierceResistGlobal(Projectile projectile, ref int damage)
|
||||
{
|
||||
if (projectile.minion)
|
||||
return;
|
||||
|
||||
if (projectile.penetrate == -1)
|
||||
damage = (int)(damage * 0.5);
|
||||
else if (projectile.penetrate > 1)
|
||||
damage = (int)MathHelper.Clamp(damage * (float)Math.Pow(0.9, projectile.penetrate), damage * 0.5f, damage);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region On Hit By Item
|
||||
public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (player.Calamity().bloodflareSet)
|
||||
{
|
||||
@@ -5948,7 +5982,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
return CalamityWorld.downedAstrageldon;
|
||||
}
|
||||
else if (type == NPCType<AstrumDeusHeadSpectral>() || type == NPCType<AstrumDeusBodySpectral>() || type == NPCType<AstrumDeusTailSpectral>() || type == NPCType<AstrumDeusHead>() || type == NPCType<AstrumDeusBody>() || type == NPCType<AstrumDeusTail>())
|
||||
else if (type == NPCType<AstrumDeusHeadSpectral>() || type == NPCType<AstrumDeusBodySpectral>() || type == NPCType<AstrumDeusTailSpectral>())
|
||||
{
|
||||
return CalamityWorld.downedStarGod;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace CalamityMod.NPCs
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<BlastBarrel>(), !Main.expertMode, 5, 1, 1);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<RogueEmblem>(), !Main.expertMode, 8, 1, 1);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<IbarakiBox>(), !Main.hardMode, Main.hardMode ? 0.1f : 1f); // 100% chance on first kill, 10% chance afterwards
|
||||
DropHelper.DropItemFromSetCondition(npc, !Main.expertMode, 5, ItemID.CorruptionKey, ItemID.CrimsonKey);
|
||||
DropHelper.DropItemFromSetCondition(npc, !Main.expertMode, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey);
|
||||
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeUnderworld>(), true, !Main.hardMode);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeWallofFlesh>(), true, !Main.hardMode);
|
||||
@@ -1339,12 +1339,6 @@ namespace CalamityMod.NPCs
|
||||
if (lastPlayer >= 0)
|
||||
{
|
||||
CalamityWorld.ChangeTime(false);
|
||||
|
||||
for (int x = 0; x < 10; x++)
|
||||
{
|
||||
NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType<AstrumDeusHead>());
|
||||
}
|
||||
|
||||
NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType<AstrumDeusHeadSpectral>());
|
||||
CalamityMod.astralKillCount = 0;
|
||||
}
|
||||
@@ -1620,16 +1614,18 @@ namespace CalamityMod.NPCs
|
||||
private void AcidRainProgression(NPC npc)
|
||||
{
|
||||
Dictionary<int, AcidRainSpawnData> possibleEnemies = AcidRainEvent.PossibleEnemiesPreHM;
|
||||
|
||||
if (CalamityWorld.downedAquaticScourge)
|
||||
possibleEnemies = AcidRainEvent.PossibleEnemiesAS;
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
possibleEnemies = AcidRainEvent.PossibleEnemiesPolter;
|
||||
|
||||
if (possibleEnemies.Select(enemy => enemy.Key).Contains(npc.type) && CalamityWorld.rainingAcid)
|
||||
{
|
||||
CalamityWorld.acidRainPoints -= possibleEnemies[npc.type].InvasionContributionPoints;
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke.
|
||||
CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke.
|
||||
}
|
||||
}
|
||||
Dictionary<int, AcidRainSpawnData> possibleMinibosses = CalamityWorld.downedPolterghast ? AcidRainEvent.PossibleMinibossesPolter : AcidRainEvent.PossibleMinibossesAS;
|
||||
@@ -1638,7 +1634,7 @@ namespace CalamityMod.NPCs
|
||||
CalamityWorld.acidRainPoints -= possibleMinibosses[npc.type].InvasionContributionPoints;
|
||||
if (CalamityWorld.downedPolterghast)
|
||||
{
|
||||
CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke.
|
||||
CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1651,6 +1647,7 @@ namespace CalamityMod.NPCs
|
||||
CalamityWorld.triedToSummonOldDuke = false;
|
||||
CalamityWorld.acidRainPoints = 0;
|
||||
}
|
||||
CalamityWorld.timeSinceAcidRainKill = 0;
|
||||
AcidRainEvent.UpdateInvasion();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.2f, 0.4f);
|
||||
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.2f, 0.4f);
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
float speed = revenge ? 1.25f : 1f;
|
||||
Player player = Main.player[npc.target];
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
npc.velocity.Y = speed;
|
||||
}
|
||||
npc.TargetClosest(true);
|
||||
if (npc.position.X + (float)npc.width < player.position.X)
|
||||
if (npc.position.X + npc.width < player.position.X)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
}
|
||||
npc.velocity.X += (CalamityWorld.bossRushActive ? 0.2f : 0.1f);
|
||||
}
|
||||
else if (npc.position.X > player.position.X + (float)player.width)
|
||||
else if (npc.position.X > player.position.X + player.width)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
{
|
||||
@@ -85,9 +85,9 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
@@ -75,13 +75,21 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
npc.gfxOffY = -16;
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.3f, 0.7f);
|
||||
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.3f, 0.7f);
|
||||
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
|
||||
npc.spriteDirection = npc.direction;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Phases
|
||||
bool phase2 = (lifeRatio < 0.5f && expertMode) || death;
|
||||
bool phase3 = (lifeRatio < 0.1f && expertMode) || death;
|
||||
|
||||
// Get a target
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
npc.TargetClosest(true);
|
||||
@@ -121,10 +129,10 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
|
||||
if (npc.ai[0] != 0f && npc.ai[0] < 3f)
|
||||
{
|
||||
Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num349 = player.position.X + (float)(player.width / 2) - vector34.X;
|
||||
float num350 = player.position.Y + (float)(player.height / 2) - vector34.Y;
|
||||
float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350));
|
||||
Vector2 vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num349 = player.position.X + (player.width / 2) - vector34.X;
|
||||
float num350 = player.position.Y + (player.height / 2) - vector34.Y;
|
||||
float num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num352 = 1;
|
||||
@@ -134,12 +142,12 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
npc.localAI[3] += 2f;
|
||||
num352 += 3;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
if (phase2)
|
||||
{
|
||||
npc.localAI[3] += 1f;
|
||||
num352 += 2;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
if (phase3)
|
||||
{
|
||||
npc.localAI[3] += 2f;
|
||||
num352 += 3;
|
||||
@@ -156,7 +164,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
npc.localAI[3] = 0f;
|
||||
npc.ai[3] += 1f;
|
||||
if (npc.ai[3] >= (float)num352)
|
||||
if (npc.ai[3] >= num352)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
}
|
||||
@@ -168,18 +176,18 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
num353 += 3f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
if (phase2)
|
||||
{
|
||||
num353 += 1f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
if (phase3)
|
||||
{
|
||||
num353 += 1f;
|
||||
}
|
||||
vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num349 = player.position.X + (float)player.width * 0.5f - vector34.X;
|
||||
num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y;
|
||||
num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350));
|
||||
vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num349 = player.position.X + player.width * 0.5f - vector34.X;
|
||||
num350 = player.position.Y + player.height * 0.5f - vector34.Y;
|
||||
num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350);
|
||||
num351 = num353 / num351;
|
||||
num349 *= num351;
|
||||
num350 *= num351;
|
||||
@@ -227,9 +235,9 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
float num823 = 1.25f;
|
||||
bool flag51 = false;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
if (phase2)
|
||||
num823 = 1.5f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
if (phase3)
|
||||
num823 = 2f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num823 = 12f;
|
||||
@@ -243,7 +251,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
if (flag51)
|
||||
{
|
||||
npc.velocity.X *= 0.9f;
|
||||
if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1)
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
{
|
||||
npc.velocity.X = 0f;
|
||||
}
|
||||
@@ -260,9 +268,9 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
}
|
||||
int num854 = 80;
|
||||
int num855 = 20;
|
||||
Vector2 position2 = new Vector2(npc.Center.X - (float)(num854 / 2), npc.position.Y + (float)npc.height - (float)num855);
|
||||
Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855);
|
||||
bool flag52 = false;
|
||||
if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y + (float)player.height - 16f)
|
||||
if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f)
|
||||
{
|
||||
flag52 = true;
|
||||
}
|
||||
@@ -276,7 +284,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
npc.velocity.Y = 0f;
|
||||
}
|
||||
if ((double)npc.velocity.Y > -0.2)
|
||||
if (npc.velocity.Y > -0.2)
|
||||
{
|
||||
npc.velocity.Y -= 0.025f;
|
||||
}
|
||||
@@ -295,7 +303,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
npc.velocity.Y = 0f;
|
||||
}
|
||||
if ((double)npc.velocity.Y < 0.1)
|
||||
if (npc.velocity.Y < 0.1)
|
||||
{
|
||||
npc.velocity.Y += 0.025f;
|
||||
}
|
||||
@@ -347,13 +355,13 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 2 || death)
|
||||
if (phase2)
|
||||
{
|
||||
npc.ai[1] += (!revenge ? 4f : 1f);
|
||||
npc.ai[1] += !revenge ? 4f : 1f;
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 4 || death)
|
||||
if (phase3)
|
||||
{
|
||||
npc.ai[1] += (!revenge ? 4f : 1f);
|
||||
npc.ai[1] += !revenge ? 4f : 1f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,8 +393,20 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
break;
|
||||
}
|
||||
}
|
||||
npc.velocity.X = (float)(velocityX * npc.direction);
|
||||
npc.velocity.Y = velocityY;
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
if (player.position.Y < npc.Bottom.Y)
|
||||
npc.velocity.Y = velocityY;
|
||||
else
|
||||
npc.velocity.Y = 1f;
|
||||
|
||||
npc.noTileCollide = true;
|
||||
}
|
||||
else
|
||||
npc.velocity.Y = velocityY;
|
||||
|
||||
npc.velocity.X = velocityX * npc.direction;
|
||||
|
||||
npc.ai[0] = 4f;
|
||||
npc.ai[1] = 0f;
|
||||
@@ -403,14 +423,14 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, ModContent.ProjectileType<Mushmash>(), 20, 0f, Main.myPlayer, 0f, 0f);
|
||||
|
||||
int num354 = expertMode ? 12 : 16;
|
||||
if (npc.ai[2] % 2f == 0f && (double)npc.life < (double)npc.lifeMax * 0.5 && revenge)
|
||||
if (npc.ai[2] % 2f == 0f && phase2 && revenge)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float velocityX = npc.ai[2] == 0f ? -4f : 4f;
|
||||
for (int x = 0; x < 20; x++)
|
||||
{
|
||||
Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType<MushBombFall>(), num354, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType<MushBombFall>(), num354, 0f, Main.myPlayer, 0f, 0f);
|
||||
shotSpacing -= 100;
|
||||
}
|
||||
shotSpacing = 1000;
|
||||
@@ -419,13 +439,13 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
|
||||
npc.TargetClosest(true);
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[2] >= ((double)npc.life < (double)npc.lifeMax * 0.5 ? 4f : 3f))
|
||||
if (npc.ai[2] >= (phase2 ? 4f : 3f))
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && revenge && (double)npc.life >= (double)npc.lifeMax * 0.5)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && revenge && !phase2)
|
||||
{
|
||||
for (int x = 0; x < 20; x++)
|
||||
{
|
||||
Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType<MushBombFall>(), num354, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType<MushBombFall>(), num354, 0f, Main.myPlayer, 0f, 0f);
|
||||
shotSpacing -= 100;
|
||||
}
|
||||
shotSpacing = 1000;
|
||||
@@ -447,17 +467,25 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
for (int num623 = 0; num623 < 4; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f);
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[num624].velocity *= 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width)
|
||||
if (!player.dead && expertMode)
|
||||
{
|
||||
if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f))
|
||||
npc.noTileCollide = true;
|
||||
else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height)))
|
||||
npc.noTileCollide = false;
|
||||
}
|
||||
|
||||
if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width)
|
||||
{
|
||||
npc.velocity.X *= 0.9f;
|
||||
npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.3f : 0.15f);
|
||||
npc.velocity.Y += CalamityWorld.bossRushActive ? 0.3f : 0.15f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -479,11 +507,11 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
num626 += 3f;
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 2 || death)
|
||||
if (phase2)
|
||||
{
|
||||
num626 += 1f;
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 10 || death)
|
||||
if (phase3)
|
||||
{
|
||||
num626 += 1f;
|
||||
}
|
||||
@@ -501,26 +529,26 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
|
||||
if (npc.localAI[0] == 0f && npc.life > 0)
|
||||
{
|
||||
npc.localAI[0] = (float)npc.lifeMax;
|
||||
npc.localAI[0] = npc.lifeMax;
|
||||
}
|
||||
if (npc.life > 0)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num660 = (int)((double)npc.lifeMax * 0.05);
|
||||
if ((float)(npc.life + num660) < npc.localAI[0])
|
||||
int num660 = (int)(npc.lifeMax * 0.05);
|
||||
if ((npc.life + num660) < npc.localAI[0])
|
||||
{
|
||||
npc.localAI[0] = (float)npc.life;
|
||||
npc.localAI[0] = npc.life;
|
||||
int num661 = expertMode ? Main.rand.Next(2, 4) : Main.rand.Next(1, 3);
|
||||
for (int num662 = 0; num662 < num661; num662++)
|
||||
{
|
||||
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
|
||||
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
|
||||
int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32));
|
||||
int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32));
|
||||
int num663 = ModContent.NPCType<CrabShroom>();
|
||||
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num664].SetDefaults(num663, -1f);
|
||||
Main.npc[num664].velocity.X = (float)Main.rand.Next(-50, 51) * 0.1f;
|
||||
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-50, -31) * 0.1f;
|
||||
Main.npc[num664].velocity.X = Main.rand.Next(-50, 51) * 0.1f;
|
||||
Main.npc[num664].velocity.Y = Main.rand.Next(-50, -31) * 0.1f;
|
||||
if (Main.netMode == NetmodeID.Server && num664 < 200)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
|
||||
@@ -556,17 +584,17 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
Texture2D textureAttack = ModContent.GetTexture("CalamityMod/NPCs/Crabulon/CrabulonAttack");
|
||||
Texture2D textureAttackGlow = ModContent.GetTexture("CalamityMod/NPCs/Crabulon/CrabulonAttackGlow");
|
||||
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2);
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)Main.npcTexture[npc.type].Width, (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
if (npc.ai[0] > 2f)
|
||||
{
|
||||
vector11 = new Vector2((float)(textureAttack.Width / 2), (float)(textureAttack.Height / 2));
|
||||
vector11 = new Vector2(textureAttack.Width / 2, textureAttack.Height / 2);
|
||||
vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)textureAttack.Width, (float)(textureAttack.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(textureAttack.Width, textureAttack.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(textureAttack, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
@@ -575,9 +603,9 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
}
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
vector11 = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2));
|
||||
vector11 = new Vector2(texture.Width / 2, texture.Height / 2);
|
||||
vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
@@ -641,12 +669,12 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 200;
|
||||
npc.height = 100;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f);
|
||||
@@ -654,7 +682,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 70; num623++)
|
||||
@@ -665,7 +693,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
float randomSpread = (float)(Main.rand.Next(-200, 200) / 100);
|
||||
float randomSpread = Main.rand.Next(-200, 200) / 100;
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon2"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon3"), 1f);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Crags
|
||||
npc.width = 72; //324
|
||||
npc.height = 72; //216
|
||||
npc.defense = 38;
|
||||
npc.Calamity().RevPlusDR(0.35f);
|
||||
npc.DR_NERD(0.35f);
|
||||
npc.lifeMax = 120;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.value = Item.buyPrice(0, 0, 5, 0);
|
||||
|
||||