Merge branch '1.4.4' into HolyFlamesAlternative
This commit is contained in:
commit
ab6921a1bc
48 files changed
+572
-695
No files matched your search
@@ -341,6 +341,9 @@ namespace CalamityMod.Balancing
|
||||
// 35% resist to Venusian Trident's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<VenusianBolt>(), ProjectileType<VenusianExplosion>()))));
|
||||
|
||||
// 25% resist to Corinth Prime's Grenades.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
|
||||
|
||||
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
|
||||
|
||||
|
||||
@@ -488,6 +488,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool unstableGraniteCore = false;
|
||||
public bool regenator = false;
|
||||
public bool theBee = false;
|
||||
public bool shouldTriggerBeeCooldown = false;
|
||||
public int theBeeCooldown = 0;
|
||||
public bool alluringBait = false;
|
||||
public bool enchantedPearl = false;
|
||||
@@ -511,6 +512,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int ascendantInsigniaBuffTime = 0;
|
||||
public int ascendantInsigniaCooldown = 0;
|
||||
public bool ascendantTrail = false;
|
||||
public bool frozenWingsCold = false;
|
||||
public bool magmaStoneVisuals = true;
|
||||
public bool eGauntlet = false;
|
||||
public bool eGauntletVisuals = true; // Used to control dust spawned when swinging
|
||||
@@ -1738,6 +1740,7 @@ namespace CalamityMod.CalPlayer
|
||||
cryogenSoul = false;
|
||||
ascendantInsignia = false;
|
||||
ascendantTrail = false;
|
||||
frozenWingsCold = false;
|
||||
magmaStoneVisuals = true;
|
||||
eGauntlet = false;
|
||||
eGauntletVisuals = true;
|
||||
|
||||
@@ -839,7 +839,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
|
||||
{
|
||||
contactDamageReduction += 0.5;
|
||||
theBeeCooldown = 600;
|
||||
shouldTriggerBeeCooldown = true;
|
||||
}
|
||||
|
||||
// Apply Adrenaline DR if available
|
||||
@@ -1078,7 +1078,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
|
||||
{
|
||||
projectileDamageReduction += 0.5;
|
||||
theBeeCooldown = 600;
|
||||
shouldTriggerBeeCooldown = true;
|
||||
}
|
||||
|
||||
// Apply Adrenaline DR if available
|
||||
@@ -1176,6 +1176,14 @@ namespace CalamityMod.CalPlayer
|
||||
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0)
|
||||
Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, "default");
|
||||
|
||||
// Same thing with The Bee
|
||||
if (theBee && shouldTriggerBeeCooldown)
|
||||
{
|
||||
shouldTriggerBeeCooldown = false;
|
||||
if (hurtInfo.Damage > 0)
|
||||
theBeeCooldown = TheBee.CooldownLength;
|
||||
}
|
||||
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<THELORDE>()))
|
||||
Player.AddBuff(ModContent.BuffType<NOU>(), 15, true);
|
||||
|
||||
@@ -1299,6 +1307,14 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Apply The Bee cooldown, must be applied here so that it does not apply on dodges
|
||||
if (theBee && shouldTriggerBeeCooldown)
|
||||
{
|
||||
shouldTriggerBeeCooldown = false;
|
||||
if (hurtInfo.Damage > 0)
|
||||
theBeeCooldown = TheBee.CooldownLength;
|
||||
}
|
||||
|
||||
if (proj.hostile && hurtInfo.Damage > 0)
|
||||
{
|
||||
if (proj.type == ProjectileID.TorchGod)
|
||||
@@ -2515,10 +2531,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (hurtInfo.Damage > 0)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
|
||||
// Start with base damage, then apply the best damage class you can
|
||||
int sDamage = 6;
|
||||
@@ -2529,32 +2541,17 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < (transformer ? 5 : 4); i++)
|
||||
float sparkCount = transformer ? 10f : 8f;
|
||||
for (float i = 0f; i < sparkCount; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<Spark>(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
|
||||
int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<Spark>(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
|
||||
if (spark1.WithinBounds(Main.maxProjectiles))
|
||||
Vector2 velocity = (MathHelper.TwoPi * i / sparkCount).ToRotationVector2() * 5f;
|
||||
Projectile spark = Projectile.NewProjectileDirect(source, Player.Center, velocity, ModContent.ProjectileType<GenericElectricSpark>(), sDamage, 1.25f, Player.whoAmI);
|
||||
spark.timeLeft = 120;
|
||||
if (transformer)
|
||||
{
|
||||
Main.projectile[spark1].timeLeft = 120;
|
||||
Main.projectile[spark1].DamageType = DamageClass.Generic;
|
||||
if (transformer)
|
||||
{
|
||||
Main.projectile[spark1].timeLeft = 240;
|
||||
Main.projectile[spark1].extraUpdates = 1;
|
||||
Main.projectile[spark1].penetrate = 10;
|
||||
}
|
||||
}
|
||||
if (spark2.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark2].timeLeft = 120;
|
||||
Main.projectile[spark2].DamageType = DamageClass.Generic;
|
||||
if (transformer)
|
||||
{
|
||||
Main.projectile[spark2].timeLeft = 240;
|
||||
Main.projectile[spark2].extraUpdates = 1;
|
||||
Main.projectile[spark2].penetrate = 10;
|
||||
}
|
||||
spark.timeLeft = 240;
|
||||
spark.extraUpdates = 1;
|
||||
spark.penetrate = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3327,13 +3327,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f);
|
||||
int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType<EutrophicSpark>(), damage / 2, 0f, Player.whoAmI);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].DamageType = DamageClass.Generic;
|
||||
Main.projectile[spark].localNPCHitCooldown = -2;
|
||||
Main.projectile[spark].penetrate = 5;
|
||||
}
|
||||
Projectile spark = Projectile.NewProjectileDirect(source, npc.Center, velocity, ModContent.ProjectileType<GenericElectricSpark>(), damage / 2, 0f, Player.whoAmI);
|
||||
spark.localNPCHitCooldown = -2;
|
||||
spark.timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<VulnerabilityHex>(), VulnerabilityHex.AflameDuration);
|
||||
|
||||
target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet;
|
||||
target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
target.Calamity().IncreasedElectricityEffects_Transformer = transformer;
|
||||
@@ -212,6 +213,7 @@ namespace CalamityMod.CalPlayer
|
||||
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
|
||||
|
||||
cgn.IncreasedColdEffects_EskimoSet = eskimoSet;
|
||||
cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
cgn.IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
cgn.IncreasedElectricityEffects_Transformer = transformer;
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public bool HasFlavorTooltip => true;
|
||||
public Color? TooltipExtensionColor => new(195, 223, 255);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class ElysianAegis : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public bool HasFlavorTooltip => true;
|
||||
public Color? TooltipExtensionColor => new(195, 223, 255);
|
||||
|
||||
public const int ShieldSlamDamage = 500;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class TheBee : ModItem, ILocalizedModType
|
||||
{
|
||||
public static int CooldownLength = 600;
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.UI.CalamitasEnchants;
|
||||
using CalamityMod.World;
|
||||
@@ -1417,10 +1418,9 @@ namespace CalamityMod.Items
|
||||
player.noFallDmg = true;
|
||||
if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings)
|
||||
{
|
||||
player.GetDamage<MeleeDamageClass>() += 0.02f;
|
||||
player.GetDamage<RangedDamageClass>() += 0.02f;
|
||||
player.GetCritChance<MeleeDamageClass>() += 1;
|
||||
player.GetCritChance<RangedDamageClass>() += 1;
|
||||
player.GetDamage<MeleeDamageClass>() += 0.04f;
|
||||
player.GetDamage<RangedDamageClass>() += 0.04f;
|
||||
player.Calamity().frozenWingsCold = true;
|
||||
}
|
||||
}
|
||||
else if (item.type == ItemID.FlameWings) // Bonus to melee stats
|
||||
@@ -1766,10 +1766,19 @@ namespace CalamityMod.Items
|
||||
#endregion
|
||||
|
||||
#region On Create
|
||||
private static int cachedForgeID = -1;
|
||||
public override void OnCreated(Item item, ItemCreationContext context)
|
||||
{
|
||||
// ChoosePrefix also happens on craft so go reset it here too
|
||||
storedPrefix = -1;
|
||||
|
||||
// 05JUL2024: Ozzatron: Register the usage of Draedon's Forge for the purposes of his dialogue.
|
||||
// This was moved out of an On edit in the DraedonsForge item for Magic Storage compatibility.
|
||||
Player p = Main.LocalPlayer;
|
||||
if (cachedForgeID < 0)
|
||||
cachedForgeID = ModContent.TileType<DraedonsForge>();
|
||||
if (context is RecipeItemCreationContext && p.adjTile[cachedForgeID])
|
||||
p.Calamity().HasCraftedDraedonsForge = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1301,9 +1301,8 @@ namespace CalamityMod.Items
|
||||
AddWingStats(7.5f, 1f, 1, 160, "5% increased melee damage and critical strike chance");
|
||||
|
||||
if (item.type == ItemID.FrozenWings)
|
||||
AddWingStats(6.75f, 1f, 1, 130, "2% increased melee and ranged damage\n" +
|
||||
"and 1% increased melee and ranged critical strike chance\n" +
|
||||
"while wearing the Frost Armor");
|
||||
AddWingStats(6.75f, 1f, 1, 130, "4% increased melee and ranged damage\n" +
|
||||
"and multiplies all cold debuff damage by 1.25x while wearing Frost armor");
|
||||
|
||||
if (item.type == ItemID.GhostWings)
|
||||
AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Spectre Hood set\n" +
|
||||
|
||||
@@ -9,20 +9,6 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations
|
||||
public class DraedonsForge : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Terraria.On_Recipe.ConsumeForCraft += DraeforgeUnlockDetour;
|
||||
}
|
||||
|
||||
private static bool DraeforgeUnlockDetour(On_Recipe.orig_ConsumeForCraft orig, Recipe self, Item item, Item requiredItem, ref int stackRequired)
|
||||
{
|
||||
if (self.HasTile(ModContent.TileType<Tiles.Furniture.CraftingStations.DraedonsForge>()))
|
||||
{
|
||||
Main.LocalPlayer.Calamity().HasCraftedDraedonsForge = true;
|
||||
}
|
||||
return orig(self, item, requiredItem, ref stackRequired);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 58;
|
||||
|
||||
@@ -31,10 +31,9 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
Item.value = Item.sellPrice(silver: 30);
|
||||
}
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
public override void GetHealLife(Player player, bool quickHeal, ref int healValue)
|
||||
{
|
||||
Item.healLife = player.Calamity().baguette ? 250 : 200;
|
||||
return null;
|
||||
healValue = player.Calamity().baguette ? 250 : 200;
|
||||
}
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -10,8 +10,9 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class TheSevensStriker : ModItem, ILocalizedModType
|
||||
public class TheSevensStriker : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public bool ShowExtensionIndicator => false;
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public static readonly SoundStyle RouletteSound = new("CalamityMod/Sounds/Item/SevensStrikerRoulette") { Volume = 0.6f, SoundLimitBehavior = SoundLimitBehavior.ReplaceOldest };
|
||||
public static readonly SoundStyle RouletteTickSound = new("CalamityMod/Sounds/Item/SevensStrikerRouletteTick") { Volume = 0.5f };
|
||||
|
||||
@@ -689,13 +689,13 @@ ElysianAegis: {
|
||||
Allows the ability to dash, empowered by holy fire
|
||||
This dash can ram through enemies without taking damage
|
||||
Grants immunity to knockback, fire blocks, as well as multiple debuffs
|
||||
Blessed by the Profaned Flame
|
||||
'''
|
||||
HoldShiftTooltip:
|
||||
'''
|
||||
On Fire!, Hellfire, Cursed Inferno, Shadowflame, Daybroken,
|
||||
Holy Flames, Brimstone Flames, Burning
|
||||
'''
|
||||
FlavorTooltip: "'Blessed by the Profaned Flame'"
|
||||
}
|
||||
|
||||
EnchantedPearl: {
|
||||
@@ -1199,8 +1199,8 @@ OldDukeScales: {
|
||||
[c/c3dfff: Stamina will gradually restore after not dashing for 1 second]
|
||||
[c/c3dfff: Stamina recovers faster when you are stationary]
|
||||
[c/c3dfff: If your stamina reaches 0%, you become exhausted]
|
||||
[c/CE0E18: While exhausted, this item's damage reduction and movement bonuses are negated]
|
||||
[c/CE0E18: Being exhausted reduces movement speed by 30% and dash velocity by 50%]
|
||||
[c/e3545c: While exhausted, this item's damage reduction and movement bonuses are negated]
|
||||
[c/e3545c: Being exhausted reduces movement speed by 30% and dash velocity by 50%]
|
||||
[c/c3dfff: This debuff lasts until your stamina reaches 100% again]
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1339,6 +1339,7 @@ TheSevensStriker: {
|
||||
'A gun given to a great gunslinger
|
||||
Forged by the arms of a man given no name'
|
||||
'''
|
||||
HoldShiftTooltip: "[c/ADD8E6:'LET'S GO GAMBLING!']"
|
||||
}
|
||||
|
||||
TheStorm: {
|
||||
|
||||
@@ -90,7 +90,7 @@ BrittleStarStaff: {
|
||||
Summons a small brittle starfish that will dash through enemies until it shatters
|
||||
Starfish will quickly regenerate after shattering
|
||||
Holding right click will swap starfish between dashing and circling you
|
||||
When the starfish are circling, each one provides you with 3 defense
|
||||
When the starfish are circling, each one provides you with 4 defense
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,6 @@ EonBolt.DisplayName: Eon Bolt
|
||||
EssenceFlame2.DisplayName: Essence Flame
|
||||
EssenceScythe.DisplayName: Essence Scythe
|
||||
EutrophicScimitarProj.DisplayName: Scimitar Zap
|
||||
EutrophicSpark.DisplayName: Eutrophic Spark
|
||||
ExcelsusBlue.DisplayName: Excelsus
|
||||
ExcelsusMain.DisplayName: Excelsus
|
||||
ExcelsusPink.DisplayName: Excelsus
|
||||
@@ -230,7 +229,6 @@ SolarNeedle.DisplayName: Solar Needle
|
||||
SolsticeBeam.DisplayName: Solstice Beam
|
||||
SoulScythe.DisplayName: Soul Scythe
|
||||
SoulScytheExplosion.DisplayName: Soul Explosion
|
||||
Spark.DisplayName: Spark
|
||||
SpatialSpear.DisplayName: Elemental Spear
|
||||
SpatialSpear2.DisplayName: Elemental Spear
|
||||
SpatialSpear3.DisplayName: Elemental Spear
|
||||
|
||||
@@ -59,6 +59,7 @@ FlameLickedHellblast.DisplayName: Flame Licked Hellblast
|
||||
FuckYou.DisplayName: Explosion
|
||||
FungalClumpMinion.DisplayName: Fungal Clump
|
||||
GemTechArmorGem.DisplayName: Trireme's Gem
|
||||
GenericElectricSpark.DisplayName: Electric Spark
|
||||
GhostlyBolt.DisplayName: Bolt
|
||||
GodKiller.DisplayName: God Killer
|
||||
GodSlayerShrapnel.DisplayName: Flame
|
||||
|
||||
@@ -28,7 +28,7 @@ AureusBossText2: A faint ethereal click can be heard from the dungeon.
|
||||
// Golem
|
||||
BabyBossText: A plague has befallen the Jungle.
|
||||
// Astrum Deus
|
||||
AstralBossText: The seal of the stars has been broken! You can now mine Astral Ore.
|
||||
AstralBossText: The seal of the stars has been broken! You can now harvest Astral Ore.
|
||||
// Moon Lord
|
||||
MoonBossText: The profaned flame blazes fiercely!
|
||||
FutureOreText: A cold and dark energy has materialized in space.
|
||||
|
||||
@@ -740,9 +740,26 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
|
||||
|
||||
if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
npc.StrikeInstantKill();
|
||||
if (npc.alpha < 255)
|
||||
{
|
||||
npc.velocity *= 0.9f;
|
||||
|
||||
npc.alpha += 2;
|
||||
if (npc.alpha > 255)
|
||||
npc.alpha = 255;
|
||||
|
||||
int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f));
|
||||
for (int i = 0; i < dustAmount; i++)
|
||||
{
|
||||
int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f));
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].fadeIn = 1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.active = false;
|
||||
|
||||
npc.active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1058,9 +1075,25 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
|
||||
|
||||
if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
npc.StrikeInstantKill();
|
||||
if (npc.alpha < 255)
|
||||
{
|
||||
npc.velocity *= 0.9f;
|
||||
|
||||
npc.alpha += 2;
|
||||
if (npc.alpha > 255)
|
||||
npc.alpha = 255;
|
||||
|
||||
int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f));
|
||||
for (int i = 0; i < dustAmount; i++)
|
||||
{
|
||||
int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f));
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].fadeIn = 1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.active = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,14 +117,15 @@ namespace CalamityMod.NPCs
|
||||
public const double VulnerableToDoTDamageMult = 2D;
|
||||
public const double VulnerableToDoTDamageMult_Worms_SlimeGod = 1.5;
|
||||
|
||||
// Eskimo Set and Cryo Stone effects
|
||||
// Cold debuff effects
|
||||
public bool IncreasedColdEffects_EskimoSet = false;
|
||||
public bool IncreasedColdEffects_FrozenWings = false;
|
||||
public bool IncreasedColdEffects_CryoStone = false;
|
||||
|
||||
// Transformer effect
|
||||
public bool IncreasedElectricityEffects_Transformer = false;
|
||||
|
||||
// Fireball, Cinnamon Roll and Hellfire Treads effects
|
||||
// Heat debuff effects
|
||||
public bool IncreasedHeatEffects_Fireball = false;
|
||||
public bool IncreasedHeatEffects_CinnamonRoll = false;
|
||||
public bool IncreasedHeatEffects_FlameWakerBoots = false;
|
||||
@@ -412,6 +413,7 @@ namespace CalamityMod.NPCs
|
||||
myClone.VulnerableToWater = VulnerableToWater;
|
||||
|
||||
myClone.IncreasedColdEffects_EskimoSet = IncreasedColdEffects_EskimoSet;
|
||||
myClone.IncreasedColdEffects_FrozenWings = IncreasedColdEffects_FrozenWings;
|
||||
myClone.IncreasedColdEffects_CryoStone = IncreasedColdEffects_CryoStone;
|
||||
myClone.IncreasedElectricityEffects_Transformer = IncreasedElectricityEffects_Transformer;
|
||||
myClone.IncreasedHeatEffects_Fireball = IncreasedHeatEffects_Fireball;
|
||||
@@ -844,6 +846,8 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (IncreasedColdEffects_EskimoSet)
|
||||
coldDamageMult += 0.25;
|
||||
if (IncreasedColdEffects_FrozenWings)
|
||||
coldDamageMult += 0.25;
|
||||
if (IncreasedColdEffects_CryoStone)
|
||||
coldDamageMult += 0.5;
|
||||
|
||||
@@ -1418,7 +1422,6 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.GolemHeadFree)
|
||||
{
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.7);
|
||||
npc.dontTakeDamage = false;
|
||||
}
|
||||
else if (npc.type == NPCID.HallowBoss)
|
||||
|
||||
@@ -217,9 +217,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
// Spawn less frequently in the inner third of the world.
|
||||
if (spawnInfo.PlayerFloorX > Main.maxTilesX * 0.333f && spawnInfo.PlayerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f)
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.01f : 0.06f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.015f : 0.06f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f);
|
||||
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.033f : 0.15f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.0375f : 0.15f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld))
|
||||
return 0f;
|
||||
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld))
|
||||
return 0f;
|
||||
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld))
|
||||
return 0f;
|
||||
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld))
|
||||
return 0f;
|
||||
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -164,10 +164,18 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
if (NPC.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
|
||||
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
|
||||
int afterimageAmt = 5;
|
||||
|
||||
Vector2 drawLocation = NPC.Center - screenPos;
|
||||
Color backAfterimageColor = PlaguebringerGoliath.BackglowColor * NPC.Opacity;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4f;
|
||||
spriteBatch.Draw(texture, drawLocation + drawOffset, NPC.frame, backAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < afterimageAmt; i += 2)
|
||||
@@ -177,18 +185,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
afterimageColor = NPC.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (float)(afterimageAmt - i) / 15f;
|
||||
Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
afterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 drawLocation = NPC.Center - screenPos;
|
||||
drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
drawLocation -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = GlowTexture.Value;
|
||||
texture = GlowTexture.Value;
|
||||
Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
@@ -199,13 +206,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
secondAfterimageColor = Color.Lerp(secondAfterimageColor, Color.White, 0.5f);
|
||||
secondAfterimageColor *= (float)(afterimageAmt - j) / 15f;
|
||||
Vector2 secondAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
secondAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
secondAfterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
secondAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -121,18 +121,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
if (NPC.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
|
||||
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2);
|
||||
Vector2 drawLocation = NPC.Center - screenPos;
|
||||
drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
|
||||
drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
|
||||
drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
Color backAfterimageColor = PlaguebringerGoliath.BackglowColor * NPC.Opacity;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4f;
|
||||
spriteBatch.Draw(texture, drawLocation + drawOffset, NPC.frame, backAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
texture2D15 = GlowTexture.Value;
|
||||
spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture = GlowTexture.Value;
|
||||
Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
[AutoloadBossHead]
|
||||
public class PlaguebringerGoliath : ModNPC
|
||||
{
|
||||
// Use for all projectiles and spawned enemies.
|
||||
public static Color BackglowColor => new Color(255, 100, 24, 80) * 0.6f;
|
||||
|
||||
private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax;
|
||||
private const float MissileAngleSpread = 60;
|
||||
private const int MissileProjectiles = 8;
|
||||
@@ -464,8 +467,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
NPC.rotation = NPC.velocity.X * 0.02f;
|
||||
charging = false;
|
||||
|
||||
float maxLineUpSpeed = revenge ? 25f : 20f;
|
||||
float lineUpAccel = revenge ? 0.75f : 0.6f;
|
||||
float maxLineUpSpeed = revenge ? 20f : 16f;
|
||||
float lineUpAccel = revenge ? 0.4f : 0.3f;
|
||||
if (phase2)
|
||||
{
|
||||
maxLineUpSpeed += 3f;
|
||||
@@ -628,9 +631,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
// Move closer
|
||||
bool canHitTarget = Collision.CanHit(NPC.Center, 1, 1, player.position, player.width, player.height);
|
||||
float distanceAboveTarget = !canHitTarget ? 0f : 400f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f;
|
||||
float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f;
|
||||
bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX;
|
||||
bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway;
|
||||
bool tooFar = tooFarX || tooFarY;
|
||||
@@ -711,9 +714,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
// Move closer
|
||||
float distanceAboveTarget = !canHitTarget ? 0f : 400f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f;
|
||||
float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f;
|
||||
bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX;
|
||||
bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway;
|
||||
bool tooFar = tooFarX || tooFarY;
|
||||
@@ -800,9 +803,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
// Move closer
|
||||
float distanceAboveTarget = !canHitTarget ? 0f : 400f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f;
|
||||
float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f;
|
||||
bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX;
|
||||
bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway;
|
||||
bool tooFar = tooFarX || tooFarY;
|
||||
@@ -892,9 +895,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
// Move closer
|
||||
float distanceAboveTarget = !canHitTarget ? 0f : 400f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f;
|
||||
float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f;
|
||||
float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f;
|
||||
float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f;
|
||||
bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX;
|
||||
bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway;
|
||||
bool tooFar = tooFarX || tooFarY;
|
||||
@@ -1039,8 +1042,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
NPC.rotation = NPC.velocity.X * 0.02f;
|
||||
charging = false;
|
||||
|
||||
float maxLineUpSpeed = revenge ? 31f : 26f;
|
||||
float lineUpAccel = revenge ? 1.05f : 0.9f;
|
||||
float maxLineUpSpeed = revenge ? 26f : 22f;
|
||||
float lineUpAccel = revenge ? 0.7f : 0.6f;
|
||||
maxLineUpSpeed += 7f * enrageScale;
|
||||
lineUpAccel += 0.35f * enrageScale;
|
||||
|
||||
@@ -1164,8 +1167,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
private void Movement(float distanceAboveTarget, Player player, float enrageScale)
|
||||
{
|
||||
float acceleration = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 0.24f : 0.48f; // Reduce acceleration while spawning minions
|
||||
float velocity = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 12f : (NPC.ai[0] == 2f ? 18f : 24f); // Reduce velocity while preparing to spawn minions and spawning minions
|
||||
float acceleration = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 0.12f : (NPC.ai[0] == 2f ? 0.15f : 0.18f); // Reduce acceleration while spawning minions
|
||||
float velocity = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 12f : (NPC.ai[0] == 2f ? 15f : 18f); // Reduce velocity while preparing to spawn minions and spawning minions
|
||||
acceleration *= 0.5f * enrageScale + 1f;
|
||||
velocity *= 1f + enrageScale * 0.5f;
|
||||
Vector2 hoverDestination = player.Center - Vector2.UnitY * distanceAboveTarget;
|
||||
|
||||
@@ -1756,33 +1756,31 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
float velocity = bossRush ? 12f : masterMode ? 8.4f : 7.2f;
|
||||
float acceleration = bossRush ? 0.1f : masterMode ? 0.07f : 0.06f;
|
||||
float deceleration = 1f - acceleration;
|
||||
|
||||
Vector2 probeCenter = npc.Center;
|
||||
float probeTargetX = targetData.Center.X;
|
||||
float probeTargetY = targetData.Center.Y;
|
||||
probeTargetX = (int)(probeTargetX / 8f) * 8;
|
||||
probeTargetY = (int)(probeTargetY / 8f) * 8;
|
||||
probeCenter.X = (int)(probeCenter.X / 8f) * 8;
|
||||
probeCenter.Y = (int)(probeCenter.Y / 8f) * 8;
|
||||
probeTargetX -= probeCenter.X;
|
||||
probeTargetY -= probeCenter.Y;
|
||||
float distanceFromTarget = (float)Math.Sqrt(probeTargetX * probeTargetX + probeTargetY * probeTargetY);
|
||||
float distance2 = distanceFromTarget;
|
||||
|
||||
bool farAwayFromTarget = false;
|
||||
if (distanceFromTarget > 600f)
|
||||
farAwayFromTarget = true;
|
||||
|
||||
if (distanceFromTarget == 0f)
|
||||
if (targetDead)
|
||||
{
|
||||
probeTargetX = npc.velocity.X;
|
||||
probeTargetY = npc.velocity.Y;
|
||||
Vector2 destination = npc.Center - Vector2.UnitY;
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(destination) * velocity * 0.5f;
|
||||
idealVelocity.X *= npc.direction;
|
||||
idealVelocity.Y *= 2.5f;
|
||||
npc.SimpleFlyMovement(idealVelocity, acceleration);
|
||||
npc.EncourageDespawn(10);
|
||||
}
|
||||
else if (npc.Distance(targetData.Center) > 400f)
|
||||
{
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity;
|
||||
npc.SimpleFlyMovement(idealVelocity, acceleration);
|
||||
}
|
||||
else
|
||||
{
|
||||
distanceFromTarget = velocity / distanceFromTarget;
|
||||
probeTargetX *= distanceFromTarget;
|
||||
probeTargetY *= distanceFromTarget;
|
||||
if (npc.Distance(targetData.Center) < 160f)
|
||||
{
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity;
|
||||
npc.SimpleFlyMovement(-idealVelocity, acceleration);
|
||||
}
|
||||
else
|
||||
npc.velocity *= deceleration;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
@@ -1806,29 +1804,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
}
|
||||
|
||||
if (distance2 > 100f)
|
||||
{
|
||||
npc.ai[0] += 1f;
|
||||
if (npc.ai[0] > 0f)
|
||||
npc.velocity.Y += 0.023f;
|
||||
else
|
||||
npc.velocity.Y -= 0.023f;
|
||||
|
||||
if (npc.ai[0] < -100f || npc.ai[0] > 100f)
|
||||
npc.velocity.X += 0.023f;
|
||||
else
|
||||
npc.velocity.X -= 0.023f;
|
||||
|
||||
if (npc.ai[0] > 200f)
|
||||
npc.ai[0] = -200f;
|
||||
}
|
||||
|
||||
if (targetDead)
|
||||
{
|
||||
probeTargetX = npc.direction * velocity / 2f;
|
||||
probeTargetY = -velocity / 2f;
|
||||
}
|
||||
|
||||
if (npc.ai[3] != 0f)
|
||||
{
|
||||
if (NPC.IsMechQueenUp)
|
||||
@@ -1882,22 +1857,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.dontTakeDamage = false;
|
||||
|
||||
if (npc.velocity.X < probeTargetX)
|
||||
npc.velocity.X += acceleration;
|
||||
else if (npc.velocity.X > probeTargetX)
|
||||
npc.velocity.X -= acceleration;
|
||||
|
||||
if (npc.velocity.Y < probeTargetY)
|
||||
npc.velocity.Y += acceleration;
|
||||
else if (npc.velocity.Y > probeTargetY)
|
||||
npc.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
npc.localAI[0] += 1f;
|
||||
if (npc.justHit && !masterMode)
|
||||
if ((npc.justHit && !masterMode) || targetDead)
|
||||
npc.localAI[0] = 0f;
|
||||
|
||||
float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev;
|
||||
@@ -1921,12 +1884,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
|
||||
int totalProjectiles = oblivionAlive ? 2 : (CalamityWorld.death || bossRush) ? 3 : 1;
|
||||
Vector2 npcCenter = new Vector2(probeTargetX, probeTargetY);
|
||||
Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity;
|
||||
if (NPC.IsMechQueenUp)
|
||||
{
|
||||
Vector2 v = targetData.Center - npc.Center - targetData.Velocity * 20f;
|
||||
float projectileVelocity = 8f;
|
||||
npcCenter = v.SafeNormalize(Vector2.UnitY) * projectileVelocity;
|
||||
projectileVelocity = v.SafeNormalize(Vector2.UnitY) * 8f;
|
||||
}
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
@@ -1936,14 +1898,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
velocityMultiplier = 0.9f;
|
||||
velocityMultiplier = 0.95f;
|
||||
break;
|
||||
case 2:
|
||||
velocityMultiplier = 0.8f;
|
||||
velocityMultiplier = 0.9f;
|
||||
break;
|
||||
}
|
||||
Vector2 laserVelocity = npcCenter * velocityMultiplier;
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), probeCenter + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
Vector2 laserVelocity = projectileVelocity * velocityMultiplier;
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
|
||||
npc.netUpdate = true;
|
||||
@@ -1955,47 +1917,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (WorldGen.InWorld(x, y) && !WorldGen.SolidTile(x, y))
|
||||
Lighting.AddLight((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f), 0.3f, 0.1f, 0.05f);
|
||||
|
||||
if (probeTargetX > 0f)
|
||||
if (targetData.Center.X - npc.Center.X > 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
npc.rotation = (float)Math.Atan2(probeTargetY, probeTargetX);
|
||||
npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X);
|
||||
}
|
||||
if (probeTargetX < 0f)
|
||||
else
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
npc.rotation = (float)Math.Atan2(probeTargetY, probeTargetX) + MathHelper.Pi;
|
||||
}
|
||||
|
||||
float tilePosX = -0.7f;
|
||||
if (npc.collideX)
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
npc.velocity.X = npc.oldVelocity.X * tilePosX;
|
||||
if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f)
|
||||
npc.velocity.X = 2f;
|
||||
if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f)
|
||||
npc.velocity.X = -2f;
|
||||
}
|
||||
|
||||
if (npc.collideY)
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
npc.velocity.Y = npc.oldVelocity.Y * tilePosX;
|
||||
if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5)
|
||||
npc.velocity.Y = 2f;
|
||||
if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5)
|
||||
npc.velocity.Y = -2f;
|
||||
}
|
||||
|
||||
if (farAwayFromTarget)
|
||||
{
|
||||
if ((npc.velocity.X > 0f && probeTargetX > 0f) || (npc.velocity.X < 0f && probeTargetX < 0f))
|
||||
{
|
||||
if (Math.Abs(npc.velocity.X) < (NPC.IsMechQueenUp ? 5f : 12f))
|
||||
npc.velocity.X *= 1.05f;
|
||||
}
|
||||
else
|
||||
npc.velocity.X *= 0.9f;
|
||||
npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X) + MathHelper.Pi;
|
||||
}
|
||||
|
||||
if (NPC.IsMechQueenUp && npc.ai[2] == 0f)
|
||||
@@ -2006,13 +1936,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.Center = center - v2.SafeNormalize(Vector2.UnitY) * 120;
|
||||
}
|
||||
|
||||
if (targetDead)
|
||||
{
|
||||
npc.velocity.Y -= acceleration * 2f;
|
||||
if (npc.timeLeft > 10)
|
||||
npc.timeLeft = 10;
|
||||
}
|
||||
|
||||
if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit)
|
||||
npc.netUpdate = true;
|
||||
|
||||
@@ -2025,61 +1948,37 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
CalamityUtils.CalamityTargeting(npc, default);
|
||||
|
||||
NPCAimedTarget targetData = npc.GetTargetData();
|
||||
bool flag = false;
|
||||
bool targetDead = false;
|
||||
if (targetData.Type == NPCTargetType.Player)
|
||||
flag = Main.player[npc.target].dead;
|
||||
targetDead = Main.player[npc.target].dead;
|
||||
|
||||
float num = Main.zenithWorld ? 3f : Main.expertMode ? 7.2f : 6f;
|
||||
float num2 = Main.expertMode ? 0.06f : 0.05f;
|
||||
float velocity = Main.zenithWorld ? 3f : Main.expertMode ? 7.2f : 6f;
|
||||
float acceleration = Main.expertMode ? 0.06f : 0.05f;
|
||||
float deceleration = 1f - acceleration;
|
||||
|
||||
Vector2 vector = npc.Center;
|
||||
float num4 = targetData.Center.X;
|
||||
float num5 = targetData.Center.Y;
|
||||
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(num4 * num4 + num5 * num5);
|
||||
float num7 = num6;
|
||||
bool flag2 = false;
|
||||
if (num6 > 600f)
|
||||
flag2 = true;
|
||||
|
||||
if (num6 == 0f)
|
||||
if (targetDead || Main.IsItDay())
|
||||
{
|
||||
num4 = npc.velocity.X;
|
||||
num5 = npc.velocity.Y;
|
||||
Vector2 destination = npc.Center - Vector2.UnitY;
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(destination) * velocity * 0.5f;
|
||||
idealVelocity.X *= npc.direction;
|
||||
idealVelocity.Y *= 2.5f;
|
||||
npc.SimpleFlyMovement(idealVelocity, acceleration);
|
||||
npc.EncourageDespawn(10);
|
||||
}
|
||||
else if (npc.Distance(targetData.Center) > 400f)
|
||||
{
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity;
|
||||
npc.SimpleFlyMovement(idealVelocity, acceleration);
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = num / num6;
|
||||
num4 *= num6;
|
||||
num5 *= num6;
|
||||
}
|
||||
|
||||
if (num7 > 100f)
|
||||
{
|
||||
npc.ai[0] += 1f;
|
||||
if (npc.ai[0] > 0f)
|
||||
npc.velocity.Y += 0.023f;
|
||||
if (npc.Distance(targetData.Center) < 160f)
|
||||
{
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity;
|
||||
npc.SimpleFlyMovement(-idealVelocity, acceleration);
|
||||
}
|
||||
else
|
||||
npc.velocity.Y -= 0.023f;
|
||||
|
||||
if (npc.ai[0] < -100f || npc.ai[0] > 100f)
|
||||
npc.velocity.X += 0.023f;
|
||||
else
|
||||
npc.velocity.X -= 0.023f;
|
||||
|
||||
if (npc.ai[0] > 200f)
|
||||
npc.ai[0] = -200f;
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
num4 = (float)npc.direction * num / 2f;
|
||||
num5 = (0f - num) / 2f;
|
||||
npc.velocity *= deceleration;
|
||||
}
|
||||
|
||||
if (npc.ai[3] != 0f)
|
||||
@@ -2135,25 +2034,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.dontTakeDamage = false;
|
||||
|
||||
if (npc.velocity.X < num4)
|
||||
npc.velocity.X += num2;
|
||||
else if (npc.velocity.X > num4)
|
||||
npc.velocity.X -= num2;
|
||||
|
||||
if (npc.velocity.Y < num5)
|
||||
npc.velocity.Y += num2;
|
||||
else if (npc.velocity.Y > num5)
|
||||
npc.velocity.Y -= num2;
|
||||
}
|
||||
|
||||
npc.localAI[0] += 1f;
|
||||
if (npc.ai[3] != 0f)
|
||||
npc.localAI[0] += 2f;
|
||||
|
||||
if (npc.justHit && !Main.masterMode)
|
||||
if ((npc.justHit && !Main.masterMode) || targetDead)
|
||||
npc.localAI[0] = 0f;
|
||||
|
||||
float num10 = ProbeLaserGateValue;
|
||||
@@ -2179,15 +2066,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
damage = (int)(damage * secondMechMultiplier);
|
||||
}
|
||||
|
||||
Vector2 vector3 = new Vector2(num4, num5);
|
||||
Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity;
|
||||
if (NPC.IsMechQueenUp)
|
||||
{
|
||||
Vector2 v = targetData.Center - npc.Center - targetData.Velocity * 20f;
|
||||
float num12 = 8f;
|
||||
vector3 = v.SafeNormalize(Vector2.UnitY) * num12;
|
||||
projectileVelocity = v.SafeNormalize(Vector2.UnitY) * 8f;
|
||||
}
|
||||
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vector + vector3.SafeNormalize(Vector2.UnitY) * 50f, vector3, type, damage, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2198,54 +2084,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (WorldGen.InWorld(num13, num14) && !WorldGen.SolidTile(num13, num14))
|
||||
Lighting.AddLight((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f), 0.3f, 0.1f, 0.05f);
|
||||
|
||||
if (num4 > 0f)
|
||||
if (targetData.Center.X - npc.Center.X > 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
npc.rotation = (float)Math.Atan2(num5, num4);
|
||||
npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X);
|
||||
}
|
||||
|
||||
if (num4 < 0f)
|
||||
else
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
npc.rotation = (float)Math.Atan2(num5, num4) + MathHelper.Pi;
|
||||
}
|
||||
|
||||
float num15 = 0.7f;
|
||||
if (npc.collideX)
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
npc.velocity.X = npc.oldVelocity.X * (0f - num15);
|
||||
if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f)
|
||||
npc.velocity.X = 2f;
|
||||
|
||||
if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f)
|
||||
npc.velocity.X = -2f;
|
||||
}
|
||||
|
||||
if (npc.collideY)
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
npc.velocity.Y = npc.oldVelocity.Y * (0f - num15);
|
||||
if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5)
|
||||
npc.velocity.Y = 2f;
|
||||
|
||||
if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5)
|
||||
npc.velocity.Y = -2f;
|
||||
}
|
||||
|
||||
if (flag2)
|
||||
{
|
||||
if ((npc.velocity.X > 0f && num4 > 0f) || (npc.velocity.X < 0f && num4 < 0f))
|
||||
{
|
||||
int num27 = 12;
|
||||
if (NPC.IsMechQueenUp)
|
||||
num27 = 5;
|
||||
|
||||
if (Math.Abs(npc.velocity.X) < (float)num27)
|
||||
npc.velocity.X *= 1.05f;
|
||||
}
|
||||
else
|
||||
npc.velocity.X *= 0.9f;
|
||||
npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X) + MathHelper.Pi;
|
||||
}
|
||||
|
||||
if (NPC.IsMechQueenUp && npc.ai[2] == 0f)
|
||||
@@ -2257,12 +2104,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.Center = center - v2.SafeNormalize(Vector2.UnitY) * num28;
|
||||
}
|
||||
|
||||
if (Main.IsItDay() || flag)
|
||||
{
|
||||
npc.velocity.Y -= num2 * 2f;
|
||||
npc.EncourageDespawn(10);
|
||||
}
|
||||
|
||||
if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit)
|
||||
npc.netUpdate = true;
|
||||
|
||||
|
||||
@@ -350,7 +350,72 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
}
|
||||
else
|
||||
NormalJump();
|
||||
{
|
||||
if (npc.ai[3] == 0f)
|
||||
npc.ai[3] = !headAlive ? Main.rand.Next(2) + 1f : 1f;
|
||||
|
||||
switch ((int)npc.ai[3])
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
NormalJump();
|
||||
break;
|
||||
|
||||
// Jump directly above the target's head and slam down
|
||||
case 2:
|
||||
|
||||
npc.noTileCollide = true;
|
||||
|
||||
npc.ai[2] += 1f;
|
||||
float jumpVelocity = death ? 23f : 21f;
|
||||
if (enrage)
|
||||
jumpVelocity *= 1.25f;
|
||||
if (turboEnrage)
|
||||
jumpVelocity *= 1.5f;
|
||||
|
||||
float minJumpTime = 15f;
|
||||
float maxJumpTime = 45f;
|
||||
if ((npc.ai[2] >= minJumpTime && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= jumpVelocity) || npc.ai[2] >= maxJumpTime)
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center;
|
||||
if (!Main.player[npc.target].dead && Main.player[npc.target].active && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= despawnDistance)
|
||||
center = Main.player[npc.target].Center;
|
||||
|
||||
center.Y -= 480f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity = center - npc.Center;
|
||||
npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero);
|
||||
npc.velocity *= jumpVelocity;
|
||||
|
||||
float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f);
|
||||
float speedMult = 1f;
|
||||
|
||||
float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f;
|
||||
if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode))
|
||||
speedMult += distanceBelowTarget * multiplier;
|
||||
|
||||
float speedMultLimit = turboEnrage ? 3.5f : enrage ? 3f : 2.5f;
|
||||
if (speedMult > speedMultLimit)
|
||||
speedMult = speedMultLimit;
|
||||
|
||||
if (Main.player[npc.target].position.Y < npc.Bottom.Y)
|
||||
npc.velocity.Y *= speedMult;
|
||||
}
|
||||
else
|
||||
npc.velocity.Y *= 0.95f;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NormalJump()
|
||||
{
|
||||
@@ -1328,21 +1393,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
|
||||
npc.ai[3] -= 1f +
|
||||
((phase2 || turboEnrage) ? 1f : 0f) +
|
||||
((phase3 || turboEnrage) ? 1f : 0f) +
|
||||
((phase4 || turboEnrage) ? 2f : 0f);
|
||||
(turboEnrage ? 1f : phase2 ? 0.5f : 0f) +
|
||||
(turboEnrage ? 1f : phase3 ? 0.5f : 0f) +
|
||||
(turboEnrage ? 2f : phase4 ? 1f : 0f);
|
||||
|
||||
float offsetX = calamityGlobalNPC.newAI[0];
|
||||
float offsetY = calamityGlobalNPC.newAI[1];
|
||||
Vector2 destination = Main.player[npc.target].Center + new Vector2(offsetX, offsetY);
|
||||
|
||||
// Velocity and acceleration
|
||||
float velocity = 16f +
|
||||
((phase2 || turboEnrage) ? 8f : 0f) +
|
||||
((phase3 || turboEnrage) ? 8f : 0f);
|
||||
float velocity = (turboEnrage ? 15f : 10f) +
|
||||
(turboEnrage ? 7.5f : phase2 ? 5f : 0f) +
|
||||
(turboEnrage ? 7.5f : phase3 ? 5f : 0f);
|
||||
|
||||
if (enrage)
|
||||
velocity = (phase3 || turboEnrage) ? 40f : 32f;
|
||||
velocity = (phase3 || turboEnrage) ? 35f : 25f;
|
||||
|
||||
float acceleration = phase3 ? 0f : turboEnrage ? 6f : enrage ? 4.8f : phase2 ? 1.2f : 0.8f;
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
distanceFromTarget = targetPosition - npcPosition;
|
||||
|
||||
float halfAverageScreenWidth = 960f;
|
||||
float distanceBeforeSlowingDown = 400f;
|
||||
float distanceBeforeSlowingDown = 480f;
|
||||
float timeBeforeEnrage = (masterMode ? 150f : 600f) - (death ? (masterMode ? 130f : 390f) * (1f - lifeRatio) : 0f);
|
||||
float speedMult = 1f;
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
calamityGlobalNPC.newAI[0] -= 1f;
|
||||
}
|
||||
|
||||
speedMult = MathHelper.Clamp(speedMult, 0.75f, 2f);
|
||||
speedMult = MathHelper.Clamp(speedMult, 0.4f, 2f);
|
||||
}
|
||||
|
||||
// Enrage if target is off screen for too long
|
||||
@@ -450,51 +450,56 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (Main.rand.NextBool(chance))
|
||||
{
|
||||
int hungryAmt = 0;
|
||||
float[] array = new float[10];
|
||||
for (int j = 0; j < Main.maxNPCs; j++)
|
||||
int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(2f, 8f, npc.life / (float)npc.lifeMax));
|
||||
if (NPC.CountNPCS(NPCID.TheHungry) < maxHungriesBasedOnHP)
|
||||
{
|
||||
if (hungryAmt < 10 && Main.npc[j].active && Main.npc[j].type == NPCID.TheHungry)
|
||||
int hungryAmt = 0;
|
||||
int maxHungries = 10;
|
||||
float[] array = new float[maxHungries];
|
||||
for (int j = 0; j < Main.maxNPCs; j++)
|
||||
{
|
||||
array[hungryAmt] = Main.npc[j].ai[0];
|
||||
hungryAmt++;
|
||||
}
|
||||
}
|
||||
|
||||
int maxValue = 1 + hungryAmt * 2;
|
||||
if (masterMode)
|
||||
maxValue /= 2;
|
||||
|
||||
if (maxValue < 2)
|
||||
maxValue = 2;
|
||||
|
||||
if (hungryAmt < 10 && Main.rand.Next(maxValue) <= 1)
|
||||
{
|
||||
int spawnHungryControl = -1;
|
||||
for (int k = 0; k < 1000; k++)
|
||||
{
|
||||
int randomHungrySpawnValue = Main.rand.Next(10);
|
||||
float hungryArrayValue = randomHungrySpawnValue * 0.1f - 0.05f;
|
||||
bool shouldRespawnHungry = true;
|
||||
for (int i = 0; i < hungryAmt; i++)
|
||||
if (hungryAmt < maxHungries && Main.npc[j].active && Main.npc[j].type == NPCID.TheHungry)
|
||||
{
|
||||
if (hungryArrayValue == array[i])
|
||||
array[hungryAmt] = Main.npc[j].ai[0];
|
||||
hungryAmt++;
|
||||
}
|
||||
}
|
||||
|
||||
int maxValue = 1 + hungryAmt * 2;
|
||||
if (masterMode)
|
||||
maxValue /= 2;
|
||||
|
||||
if (maxValue < 2)
|
||||
maxValue = 2;
|
||||
|
||||
if (hungryAmt < maxHungries && Main.rand.Next(maxValue) <= 1)
|
||||
{
|
||||
int spawnHungryControl = -1;
|
||||
for (int k = 0; k < 1000; k++)
|
||||
{
|
||||
int randomHungrySpawnValue = Main.rand.Next(maxHungries);
|
||||
float hungryArrayValue = randomHungrySpawnValue * 0.1f - 0.05f;
|
||||
bool shouldRespawnHungry = true;
|
||||
for (int i = 0; i < hungryAmt; i++)
|
||||
{
|
||||
shouldRespawnHungry = false;
|
||||
if (hungryArrayValue == array[i])
|
||||
{
|
||||
shouldRespawnHungry = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldRespawnHungry)
|
||||
{
|
||||
spawnHungryControl = randomHungrySpawnValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldRespawnHungry)
|
||||
if (spawnHungryControl >= 0)
|
||||
{
|
||||
spawnHungryControl = randomHungrySpawnValue;
|
||||
break;
|
||||
int hungryRespawns = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.TheHungry, npc.whoAmI);
|
||||
Main.npc[hungryRespawns].ai[0] = spawnHungryControl * 0.1f - 0.05f;
|
||||
}
|
||||
}
|
||||
if (spawnHungryControl >= 0)
|
||||
{
|
||||
int hungryRespawns = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.TheHungry, npc.whoAmI);
|
||||
Main.npc[hungryRespawns].ai[0] = spawnHungryControl * 0.1f - 0.05f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -724,6 +729,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
bool shouldFireLasers = true;
|
||||
float phase2LifeRatio = 0.5f;
|
||||
bool masterModeDetach = lifeRatio < phase2LifeRatio && masterMode;
|
||||
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
if (!masterModeDetach)
|
||||
{
|
||||
npc.position.X = Main.npc[Main.wofNPCIndex].position.X;
|
||||
@@ -759,7 +765,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
else
|
||||
{
|
||||
float distanceAboveTarget = 240f * npc.ai[0];
|
||||
float distanceAboveTarget = (canHit ? 240f : 120f) * npc.ai[0];
|
||||
float distanceAwayFromTargetX = 560f;
|
||||
float distanceAwayFromTargetXLeeway = 40f;
|
||||
float distanceAwayFromTargetY = Main.player[npc.target].Center.Y - npc.Center.Y;
|
||||
@@ -864,8 +870,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float shootBoost = fireEnragedLasers ? (death ? 5f : 4f) : (death ? 3f : 3f * (1f - lifeRatio));
|
||||
npc.localAI[1] += 1f + shootBoost;
|
||||
|
||||
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
|
||||
if (npc.localAI[2] == 0f)
|
||||
{
|
||||
if (npc.localAI[1] > LaserShootGateValue)
|
||||
@@ -1111,6 +1115,24 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.velocity.Y = 0f;
|
||||
npc.position.Y = num368;
|
||||
|
||||
float targetPosition = Main.player[npc.target].Center.X;
|
||||
float npcPosition = npc.Center.X;
|
||||
|
||||
// Slow down if close
|
||||
float distanceFromTarget;
|
||||
if (npc.velocity.X < 0f)
|
||||
distanceFromTarget = npcPosition - targetPosition;
|
||||
else
|
||||
distanceFromTarget = targetPosition - npcPosition;
|
||||
|
||||
float distanceBeforeSlowingDown = 480f;
|
||||
float speedMult = 1f;
|
||||
|
||||
if (distanceFromTarget < distanceBeforeSlowingDown)
|
||||
speedMult += (distanceFromTarget - distanceBeforeSlowingDown) * 0.002f;
|
||||
|
||||
speedMult = MathHelper.Clamp(speedMult, 0.4f, 1f);
|
||||
|
||||
float masterModeVelocityBoost = 0f;
|
||||
if (Main.masterMode)
|
||||
{
|
||||
@@ -1175,6 +1197,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
num369 += 0.2f;
|
||||
}
|
||||
|
||||
num369 *= speedMult;
|
||||
|
||||
if (npc.velocity.X == 0f)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
@@ -1255,66 +1279,71 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (Main.expertMode && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num378 = (int)(1f + (float)npc.life / (float)npc.lifeMax * 10f);
|
||||
num378 *= num378;
|
||||
if (num378 < 400)
|
||||
num378 = (num378 * 19 + 400) / 20;
|
||||
int chanceToSpawnHungry = (int)(1f + (float)npc.life / (float)npc.lifeMax * 10f);
|
||||
chanceToSpawnHungry *= chanceToSpawnHungry;
|
||||
if (chanceToSpawnHungry < 400)
|
||||
chanceToSpawnHungry = (chanceToSpawnHungry * 19 + 400) / 20;
|
||||
|
||||
if (num378 < 60)
|
||||
num378 = (num378 * 3 + 60) / 4;
|
||||
if (chanceToSpawnHungry < 60)
|
||||
chanceToSpawnHungry = (chanceToSpawnHungry * 3 + 60) / 4;
|
||||
|
||||
if (num378 < 20)
|
||||
num378 = (num378 + 20) / 2;
|
||||
if (chanceToSpawnHungry < 20)
|
||||
chanceToSpawnHungry = (chanceToSpawnHungry + 20) / 2;
|
||||
|
||||
num378 = (int)((double)num378 * (Main.masterMode ? 0.5 : 0.7));
|
||||
if (num378 < 2)
|
||||
num378 = 2;
|
||||
chanceToSpawnHungry = (int)((double)chanceToSpawnHungry * (Main.masterMode ? 0.5 : 0.7));
|
||||
if (chanceToSpawnHungry < 2)
|
||||
chanceToSpawnHungry = 2;
|
||||
|
||||
if (Main.rand.NextBool(num378))
|
||||
if (Main.rand.NextBool(chanceToSpawnHungry))
|
||||
{
|
||||
int num379 = 0;
|
||||
float[] array = new float[10];
|
||||
for (int num380 = 0; num380 < Main.maxNPCs; num380++)
|
||||
int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(2f, 8f, npc.life / (float)npc.lifeMax));
|
||||
if (NPC.CountNPCS(NPCID.TheHungry) < maxHungriesBasedOnHP)
|
||||
{
|
||||
if (num379 < 10 && Main.npc[num380].active && Main.npc[num380].type == NPCID.TheHungry)
|
||||
int hungryCount = 0;
|
||||
int maxHungries = 10;
|
||||
float[] hungryArray = new float[maxHungries];
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
array[num379] = Main.npc[num380].ai[0];
|
||||
num379++;
|
||||
}
|
||||
}
|
||||
|
||||
int maxValue = 1 + num379 * 2;
|
||||
if (Main.masterMode)
|
||||
maxValue /= 2;
|
||||
if (maxValue < 2)
|
||||
maxValue = 2;
|
||||
|
||||
if (num379 < 10 && Main.rand.Next(maxValue) <= 1)
|
||||
{
|
||||
int num381 = -1;
|
||||
for (int num382 = 0; num382 < 1000; num382++)
|
||||
{
|
||||
int num383 = Main.rand.Next(10);
|
||||
float num384 = (float)num383 * 0.1f - 0.05f;
|
||||
bool flag26 = true;
|
||||
for (int num385 = 0; num385 < num379; num385++)
|
||||
if (hungryCount < maxHungries && Main.npc[i].active && Main.npc[i].type == NPCID.TheHungry)
|
||||
{
|
||||
if (num384 == array[num385])
|
||||
hungryArray[hungryCount] = Main.npc[i].ai[0];
|
||||
hungryCount++;
|
||||
}
|
||||
}
|
||||
|
||||
int maxValue = 1 + hungryCount * 2;
|
||||
if (Main.masterMode)
|
||||
maxValue /= 2;
|
||||
if (maxValue < 2)
|
||||
maxValue = 2;
|
||||
|
||||
if (hungryCount < maxHungries && Main.rand.Next(maxValue) <= 1)
|
||||
{
|
||||
int ai0 = -1;
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
int randomHungryLocation = Main.rand.Next(maxHungries);
|
||||
float hungryLocation = (float)randomHungryLocation * 0.1f - 0.05f;
|
||||
bool spawnHungry = true;
|
||||
for (int j = 0; j < hungryCount; j++)
|
||||
{
|
||||
flag26 = false;
|
||||
if (hungryLocation == hungryArray[j])
|
||||
{
|
||||
spawnHungry = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (spawnHungry)
|
||||
{
|
||||
ai0 = randomHungryLocation;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag26)
|
||||
{
|
||||
num381 = num383;
|
||||
break;
|
||||
}
|
||||
if (ai0 >= 0)
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num368, NPCID.TheHungry, npc.whoAmI, (float)ai0 * 0.1f - 0.05f);
|
||||
}
|
||||
|
||||
if (num381 >= 0)
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num368, NPCID.TheHungry, npc.whoAmI, (float)num381 * 0.1f - 0.05f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
public class DestroyerCursedLaser : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 4;
|
||||
@@ -25,32 +27,29 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.75f / 255f, 0f);
|
||||
|
||||
if (Projectile.alpha > 0)
|
||||
{
|
||||
Projectile.alpha -= 125;
|
||||
}
|
||||
if (Projectile.alpha < 0)
|
||||
{
|
||||
Projectile.alpha = 0;
|
||||
}
|
||||
|
||||
if (Projectile.localAI[1] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item33, Projectile.Center);
|
||||
Projectile.localAI[1] = 1f;
|
||||
}
|
||||
if (Projectile.velocity.Length() < 12f)
|
||||
{
|
||||
|
||||
if (Projectile.velocity.Length() < CalamityGlobalProjectile.AcceleratingBossLaserVelocityCap)
|
||||
Projectile.velocity *= 1.0025f;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (Projectile.alpha < 200)
|
||||
{
|
||||
return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0);
|
||||
}
|
||||
|
||||
return Color.Transparent;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,13 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
public class DestroyerElectricLaser : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.ignoreWater = true;
|
||||
@@ -26,32 +28,29 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.35f / 255f);
|
||||
|
||||
if (Projectile.alpha > 0)
|
||||
{
|
||||
Projectile.alpha -= 125;
|
||||
}
|
||||
if (Projectile.alpha < 0)
|
||||
{
|
||||
Projectile.alpha = 0;
|
||||
}
|
||||
|
||||
if (Projectile.localAI[1] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item33, Projectile.Center);
|
||||
Projectile.localAI[1] = 1f;
|
||||
}
|
||||
if (Projectile.velocity.Length() < 12f)
|
||||
{
|
||||
|
||||
if (Projectile.velocity.Length() < CalamityGlobalProjectile.AcceleratingBossLaserVelocityCap)
|
||||
Projectile.velocity *= 1.0025f;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (Projectile.alpha < 200)
|
||||
{
|
||||
return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0);
|
||||
}
|
||||
|
||||
return Color.Transparent;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs.PlaguebringerGoliath;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -83,6 +84,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs.PlaguebringerGoliath;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -52,6 +53,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 90);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Vector2 center = new Vector2(Projectile.Center.X, Projectile.Center.Y);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs.PlaguebringerGoliath;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -42,6 +43,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 90);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D glow = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Value;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles
|
||||
public bool CreatedByPlayerDash = false;
|
||||
|
||||
// Speed cap for accelerating boss laser projectiles with 2 extraUpdates.
|
||||
public const float AcceleratingBossLaserVelocityCap = 10f;
|
||||
public const float AcceleratingBossLaserVelocityCap = 8f;
|
||||
|
||||
// Damage Adjusters
|
||||
public const float PierceResistHarshness = 0.12f;
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class EutrophicSpark : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 6;
|
||||
Projectile.height = 12;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 2;
|
||||
Projectile.timeLeft = 30;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 15;
|
||||
Projectile.DamageType = DamageClass.Melee;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.1f;
|
||||
}
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.5f;
|
||||
}
|
||||
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
|
||||
{
|
||||
Projectile.velocity.Y = Projectile.velocity.Y * -0.5f;
|
||||
}
|
||||
Projectile.ai[0] += 1f;
|
||||
if (Projectile.ai[0] > 5f)
|
||||
{
|
||||
Projectile.ai[0] = 5f;
|
||||
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.97f;
|
||||
if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01)
|
||||
{
|
||||
Projectile.velocity.X = 0f;
|
||||
Projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
Projectile.velocity.Y = Projectile.velocity.Y + 0.2f;
|
||||
}
|
||||
Projectile.rotation += Projectile.velocity.X * 0.1f;
|
||||
int eutrophicDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8976_cp_0 = Main.dust[eutrophicDust];
|
||||
expr_8976_cp_0.position.X -= 2f;
|
||||
Dust expr_8994_cp_0 = Main.dust[eutrophicDust];
|
||||
expr_8994_cp_0.position.Y += 2f;
|
||||
Main.dust[eutrophicDust].scale += (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[eutrophicDust].noGravity = true;
|
||||
Dust expr_89E7_cp_0 = Main.dust[eutrophicDust];
|
||||
expr_89E7_cp_0.velocity.Y -= 2f;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
int eutrophicDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8A4E_cp_0 = Main.dust[eutrophicDust2];
|
||||
expr_8A4E_cp_0.position.X -= 2f;
|
||||
Dust expr_8A6C_cp_0 = Main.dust[eutrophicDust2];
|
||||
expr_8A6C_cp_0.position.Y += 2f;
|
||||
Main.dust[eutrophicDust2].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[eutrophicDust2].noGravity = true;
|
||||
Main.dust[eutrophicDust2].velocity *= 0.1f;
|
||||
}
|
||||
if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.8f;
|
||||
}
|
||||
Projectile.rotation = -Projectile.velocity.X * 0.05f;
|
||||
if (Projectile.velocity.Y > 16f)
|
||||
{
|
||||
Projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -48,16 +49,15 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Electric);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer);
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSparks(target);
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSparks(target);
|
||||
|
||||
public void SpawnSparks(Entity target)
|
||||
{
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer);
|
||||
Projectile spark = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType<GenericElectricSpark>(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer);
|
||||
spark.DamageType = DamageClass.Melee;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class Spark : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 6;
|
||||
Projectile.height = 12;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 5;
|
||||
Projectile.timeLeft = 60;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 15;
|
||||
Projectile.DamageType = DamageClass.Melee;
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<StaticDischarge>(), 120);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.1f;
|
||||
}
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.5f;
|
||||
}
|
||||
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
|
||||
{
|
||||
Projectile.velocity.Y = Projectile.velocity.Y * -0.5f;
|
||||
}
|
||||
Projectile.ai[0] += 1f;
|
||||
if (Projectile.ai[0] > 5f)
|
||||
{
|
||||
Projectile.ai[0] = 5f;
|
||||
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.97f;
|
||||
if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01)
|
||||
{
|
||||
Projectile.velocity.X = 0f;
|
||||
Projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
Projectile.velocity.Y = Projectile.velocity.Y + 0.2f;
|
||||
}
|
||||
Projectile.rotation += Projectile.velocity.X * 0.1f;
|
||||
int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8976_cp_0 = Main.dust[sparky];
|
||||
expr_8976_cp_0.position.X -= 2f;
|
||||
Dust expr_8994_cp_0 = Main.dust[sparky];
|
||||
expr_8994_cp_0.position.Y += 2f;
|
||||
Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[sparky].noGravity = true;
|
||||
Dust expr_89E7_cp_0 = Main.dust[sparky];
|
||||
expr_89E7_cp_0.velocity.Y -= 2f;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8A4E_cp_0 = Main.dust[sparkier];
|
||||
expr_8A4E_cp_0.position.X -= 2f;
|
||||
Dust expr_8A6C_cp_0 = Main.dust[sparkier];
|
||||
expr_8A6C_cp_0.position.Y += 2f;
|
||||
Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[sparkier].noGravity = true;
|
||||
Main.dust[sparkier].velocity *= 0.1f;
|
||||
}
|
||||
if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.8f;
|
||||
}
|
||||
Projectile.rotation = -Projectile.velocity.X * 0.05f;
|
||||
if (Projectile.velocity.Y > 16f)
|
||||
{
|
||||
Projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.Center = Vector2.Lerp(Projectile.Center, idleDestination, 0.15f);
|
||||
AITimer++;
|
||||
|
||||
Owner.statDefense += 5;
|
||||
Owner.statDefense += 4;
|
||||
Projectile.rotation += MoveWidth * 0.2f;
|
||||
}
|
||||
if (!MinionBuffMode && !Reforming) // Minion when ramming
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -280,7 +279,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
for (int i = 0; i < Main.rand.Next(1, 4); i++)
|
||||
{
|
||||
Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f));
|
||||
int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType<StormjawSpark>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType<StormjawSpark>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
sparkCounter = 0;
|
||||
}
|
||||
@@ -313,17 +312,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
for (int j = 0; j < Main.rand.Next(1, 4); j++)
|
||||
{
|
||||
Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f));
|
||||
int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType<Spark>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].DamageType = DamageClass.Summon;
|
||||
Main.projectile[spark].originalDamage = Projectile.originalDamage;
|
||||
Main.projectile[spark].timeLeft = 120;
|
||||
Main.projectile[spark].penetrate = 3;
|
||||
Main.projectile[spark].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[spark].idStaticNPCHitCooldown = 10;
|
||||
Main.projectile[spark].usesLocalNPCImmunity = false;
|
||||
}
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType<StormjawSpark>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
sparkCounter = 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public new string LocalizationCategory => "Projectiles.Summon";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
//literally had to make another projectile cuz whips exist
|
||||
// Clone of Typeless/GenericElectricSpark but specfically benefits from whips
|
||||
public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true;
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -24,65 +26,48 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.DamageType = DamageClass.Summon;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<StaticDischarge>(), 120);
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.1f;
|
||||
}
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * -0.5f;
|
||||
}
|
||||
Projectile.velocity.X *= -0.1f;
|
||||
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
|
||||
{
|
||||
Projectile.velocity.Y = Projectile.velocity.Y * -0.5f;
|
||||
}
|
||||
Projectile.ai[0] += 1f;
|
||||
Projectile.velocity.Y *= -0.5f;
|
||||
|
||||
Projectile.ai[0]++;
|
||||
if (Projectile.ai[0] > 5f)
|
||||
{
|
||||
Projectile.ai[0] = 5f;
|
||||
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.97f;
|
||||
if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01)
|
||||
Projectile.velocity.X *= 0.97f;
|
||||
if (MathF.Abs(Projectile.velocity.X) < 0.01f)
|
||||
{
|
||||
Projectile.velocity.X = 0f;
|
||||
Projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
Projectile.velocity.Y = Projectile.velocity.Y + 0.2f;
|
||||
Projectile.velocity.Y += 0.2f;
|
||||
}
|
||||
Projectile.rotation += Projectile.velocity.X * 0.1f;
|
||||
int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8976_cp_0 = Main.dust[sparky];
|
||||
expr_8976_cp_0.position.X -= 2f;
|
||||
Dust expr_8994_cp_0 = Main.dust[sparky];
|
||||
expr_8994_cp_0.position.Y += 2f;
|
||||
Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[sparky].noGravity = true;
|
||||
Dust expr_89E7_cp_0 = Main.dust[sparky];
|
||||
expr_89E7_cp_0.velocity.Y -= 2f;
|
||||
Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100);
|
||||
spark.position.X -= 2f;
|
||||
spark.position.Y += 2f;
|
||||
spark.scale += Main.rand.NextFloat(0f, 0.5f);
|
||||
spark.noGravity = true;
|
||||
spark.velocity.Y -= 2f;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8A4E_cp_0 = Main.dust[sparkier];
|
||||
expr_8A4E_cp_0.position.X -= 2f;
|
||||
Dust expr_8A6C_cp_0 = Main.dust[sparkier];
|
||||
expr_8A6C_cp_0.position.Y += 2f;
|
||||
Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[sparkier].noGravity = true;
|
||||
Main.dust[sparkier].velocity *= 0.1f;
|
||||
spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100);
|
||||
spark.position.X -= 2f;
|
||||
spark.position.Y += 2f;
|
||||
spark.scale += Main.rand.NextFloat(0.3f, 0.8f);
|
||||
spark.noGravity = true;
|
||||
spark.velocity *= 0.1f;
|
||||
}
|
||||
if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15)
|
||||
{
|
||||
Projectile.velocity.X = Projectile.velocity.X * 0.8f;
|
||||
}
|
||||
Projectile.rotation = -Projectile.velocity.X * 0.05f;
|
||||
|
||||
if (Projectile.velocity.Y > 16f)
|
||||
{
|
||||
Projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class GenericElectricSpark : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 6;
|
||||
Projectile.height = 12;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 5;
|
||||
Projectile.timeLeft = 60;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 15;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<StaticDischarge>(), 120);
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.velocity.X != Projectile.velocity.X)
|
||||
Projectile.velocity.X *= -0.1f;
|
||||
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
|
||||
Projectile.velocity.Y *= -0.5f;
|
||||
|
||||
Projectile.ai[0]++;
|
||||
if (Projectile.ai[0] > 5f)
|
||||
{
|
||||
Projectile.ai[0] = 5f;
|
||||
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
|
||||
{
|
||||
Projectile.velocity.X *= 0.97f;
|
||||
if (MathF.Abs(Projectile.velocity.X) < 0.01f)
|
||||
{
|
||||
Projectile.velocity.X = 0f;
|
||||
Projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
Projectile.velocity.Y += 0.2f;
|
||||
}
|
||||
Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100);
|
||||
spark.position.X -= 2f;
|
||||
spark.position.Y += 2f;
|
||||
spark.scale += Main.rand.NextFloat(0f, 0.5f);
|
||||
spark.noGravity = true;
|
||||
spark.velocity.Y -= 2f;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100);
|
||||
spark.position.X -= 2f;
|
||||
spark.position.Y += 2f;
|
||||
spark.scale += Main.rand.NextFloat(0.3f, 0.8f);
|
||||
spark.noGravity = true;
|
||||
spark.velocity *= 0.1f;
|
||||
}
|
||||
|
||||
if (Projectile.velocity.Y > 16f)
|
||||
Projectile.velocity.Y = 16f;
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
||||
}
|
||||
}
|
||||
+18
-6
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Tiles.Astral;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -28,7 +30,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
TileID.Sets.Ore[Type] = true;
|
||||
TileID.Sets.OreMergesWithMud[Type] = true;
|
||||
|
||||
MinPick = 210;
|
||||
MinPick = 110;
|
||||
DustType = 173;
|
||||
AddMapEntry(new Color(255, 153, 255), CreateMapEntryName());
|
||||
MineResist = 3f;
|
||||
@@ -36,7 +38,8 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
TileID.Sets.Ore[Type] = true;
|
||||
TileID.Sets.ChecksForMerge[Type] = true;
|
||||
TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true;
|
||||
// TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true;
|
||||
TileID.Sets.AvoidedByMeteorLanding[Type] = true;
|
||||
|
||||
this.RegisterUniversalMerge(ModContent.TileType<AstralDirt>(), "CalamityMod/Tiles/Merges/AstralDirtMerge");
|
||||
}
|
||||
@@ -57,14 +60,23 @@ namespace CalamityMod.Tiles.Ores
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanKillTile(int i, int j, ref bool blockDamaged)
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
return DownedBossSystem.downedAstrumDeus;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int xRandom = Main.rand.Next(-3, 3);
|
||||
int yRandom = Main.rand.Next(-3, 3);
|
||||
if (Main.tile[i + xRandom, j + yRandom].TileType == TileID.Meteorite)
|
||||
AstralBiome.ConvertToAstral(i + xRandom, j + yRandom, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
public override IEnumerable<Item> GetItemDrops(int i, int j)
|
||||
{
|
||||
return false;
|
||||
if (!DownedBossSystem.downedAstrumDeus)
|
||||
yield return new Item(ModContent.ItemType<StarblightSoot>(), Main.rand.Next(1, 2 + 1));
|
||||
else
|
||||
yield return new Item(ModContent.ItemType<Items.Placeables.Ores.AstralOre>());
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -723,6 +723,7 @@ namespace CalamityMod.World
|
||||
case TileID.Lead:
|
||||
case TileID.Tungsten:
|
||||
case TileID.Platinum:
|
||||
case TileID.Meteorite:
|
||||
if (convertOre)
|
||||
{
|
||||
Main.tile[x, y].TileType = (ushort)ModContent.TileType<AstralOre>();
|
||||
|
||||
Reference in new issue
Block a user