Merge branch '1.4.4' into HolyFlamesAlternative
No files matched your search
@@ -1,20 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
public class TeslaBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().tesla = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -19,5 +21,16 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int dustType = Main.rand.NextBool() ? DustID.GemSapphire : DustID.BlueCrystalShard;
|
||||
Vector2 dustVelocity = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 12f, 0f)) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
Dust theDust = Dust.NewDustDirect(npc.position, npc.width, npc.height, dustType, dustVelocity.X, dustVelocity.Y);
|
||||
theDust.noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,6 +179,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
#region Timer and Counter
|
||||
public int gaelSwipes = 0;
|
||||
public int arsenalCooldown = 0;
|
||||
public int dragoonDrizzlefishGelBoost = 1;
|
||||
public int deadSunCounter = 6;
|
||||
public int DragonsBreathAudioCooldown = 0;
|
||||
@@ -507,6 +508,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool evasionScarf = false;
|
||||
public bool badgeOfBravery = false;
|
||||
public bool warbannerOfTheSun = false;
|
||||
public bool tesla = false;
|
||||
public bool teslaVisuals = true;
|
||||
public bool cryogenSoul = false;
|
||||
public bool ascendantInsignia = false;
|
||||
public int ascendantInsigniaBuffTime = 0;
|
||||
@@ -969,7 +972,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool astralInjection = false;
|
||||
public bool gravityNormalizer = false;
|
||||
public bool flaskHoly = false;
|
||||
public bool tesla = false;
|
||||
public bool galvanicCorrosion = false;
|
||||
public bool sulphurskin = false;
|
||||
public bool baguette = false;
|
||||
@@ -1178,7 +1180,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool omegaBlueTransformation;
|
||||
public bool omegaBlueTransformationForce;
|
||||
public bool omegaBlueTransformationPower;
|
||||
public bool redBow;
|
||||
public bool ghostBracelet;
|
||||
#endregion
|
||||
|
||||
#region Calamitas Enchant Effects
|
||||
@@ -1737,6 +1739,8 @@ namespace CalamityMod.CalPlayer
|
||||
evolution = false;
|
||||
nanotech = false;
|
||||
deadshotBrooch = false;
|
||||
tesla = false;
|
||||
teslaVisuals = true;
|
||||
cryogenSoul = false;
|
||||
ascendantInsignia = false;
|
||||
ascendantTrail = false;
|
||||
@@ -2034,7 +2038,6 @@ namespace CalamityMod.CalPlayer
|
||||
astralInjection = false;
|
||||
gravityNormalizer = false;
|
||||
flaskHoly = false;
|
||||
tesla = false;
|
||||
galvanicCorrosion = false;
|
||||
sulphurskin = false;
|
||||
baguette = false;
|
||||
@@ -2233,7 +2236,7 @@ namespace CalamityMod.CalPlayer
|
||||
omegaBlueTransformationPrevious = omegaBlueTransformation;
|
||||
omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false;
|
||||
|
||||
redBow = false;
|
||||
ghostBracelet = false;
|
||||
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
@@ -2336,6 +2339,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Debuffs
|
||||
heldGaelsLastFrame = false;
|
||||
gaelSwipes = 0;
|
||||
arsenalCooldown = 0;
|
||||
andromedaState = AndromedaPlayerState.Inactive;
|
||||
planarSpeedBoost = 0;
|
||||
galileoCooldown = 0;
|
||||
@@ -2504,7 +2508,6 @@ namespace CalamityMod.CalPlayer
|
||||
astralInjection = false;
|
||||
gravityNormalizer = false;
|
||||
flaskHoly = false;
|
||||
tesla = false;
|
||||
galvanicCorrosion = false;
|
||||
sulphurskin = false;
|
||||
baguette = false;
|
||||
@@ -3886,9 +3889,6 @@ namespace CalamityMod.CalPlayer
|
||||
#region Get Weapon Damage And KB
|
||||
public override void ModifyWeaponDamage(Item item, ref StatModifier damage)
|
||||
{
|
||||
if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type))
|
||||
damage += 0.1f;
|
||||
|
||||
if (item.CountsAsClass<RogueDamageClass>())
|
||||
{
|
||||
// Apply weapon modifier stealth strike damage bonus
|
||||
@@ -3976,7 +3976,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (item.CountsAsClass<MeleeDamageClass>())
|
||||
{
|
||||
var source = Player.GetSource_ItemUse(item);
|
||||
if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type) && Player.whoAmI == Main.myPlayer)
|
||||
if (fungalSymbiote && Player.HasBuff(ModContent.BuffType<Mushy>()) && Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
if (Player.itemAnimation == (int)(Player.itemAnimationMax * 0.1) ||
|
||||
Player.itemAnimation == (int)(Player.itemAnimationMax * 0.3) ||
|
||||
@@ -4291,11 +4291,11 @@ namespace CalamityMod.CalPlayer
|
||||
profanedCrystalAnimCounter = new KeyValuePair<int, int>(0, 10);
|
||||
}
|
||||
|
||||
if (redBow)
|
||||
if (ghostBracelet)
|
||||
{
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Body);
|
||||
Player.head = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Head);
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
|
||||
Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
|
||||
}
|
||||
|
||||
if (snowRuffianSet)
|
||||
|
||||
@@ -41,12 +41,10 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Chat;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.Graphics.Renderers;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
@@ -498,10 +496,6 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").Format(Player.name));
|
||||
}
|
||||
if (alcoholPoisonLevel > (cirrusDress ? 5 : 3))
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholSmall").Format(Player.name));
|
||||
}
|
||||
if (witheredDebuff)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").Format(Player.name));
|
||||
@@ -1041,12 +1035,6 @@ namespace CalamityMod.CalPlayer
|
||||
projectileDamageReduction += 0.15;
|
||||
}
|
||||
|
||||
if (transformer)
|
||||
{
|
||||
if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet)
|
||||
projectileDamageReduction += 0.5;
|
||||
}
|
||||
|
||||
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
|
||||
{
|
||||
// Daedalus Reflect counts as a reflect but doesn't actually stop you from taking damage
|
||||
@@ -1292,20 +1280,36 @@ namespace CalamityMod.CalPlayer
|
||||
if (!hasIFrames && !Player.creativeGodMode)
|
||||
nextHitDealsDefenseDamage |= proj.Calamity().DealsDefenseDamage;
|
||||
|
||||
if (sulphurSet && !proj.friendly && hurtInfo.Damage > 0)
|
||||
// CIT 22JUL2024: This entire code segment is bugged, so I'm disabling it.
|
||||
// Very likely because it's trying to index into Main.npc using Projectile.owner.
|
||||
/*if (!proj.friendly && hurtInfo.Damage > 0)
|
||||
{
|
||||
if (Main.player[proj.owner] is null)
|
||||
{
|
||||
if (!Main.npc[proj.owner].friendly)
|
||||
Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
|
||||
{
|
||||
if (sulphurSet)
|
||||
Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
|
||||
if (aSpark)
|
||||
{
|
||||
if (transformer)
|
||||
Main.npc[proj.owner].Calamity().transformerShocked = 120;
|
||||
else
|
||||
Main.npc[proj.owner].Calamity().shocked = 120;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Player p = Main.player[proj.owner];
|
||||
if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0))
|
||||
p.AddBuff(BuffID.Poisoned, 60);
|
||||
{
|
||||
if (sulphurSet)
|
||||
p.AddBuff(BuffID.Poisoned, 60);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Apply The Bee cooldown, must be applied here so that it does not apply on dodges
|
||||
if (theBee && shouldTriggerBeeCooldown)
|
||||
@@ -1469,23 +1473,6 @@ namespace CalamityMod.CalPlayer
|
||||
// As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit
|
||||
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0)
|
||||
{
|
||||
// The Transformer can reflect bullets
|
||||
if (transformer)
|
||||
{
|
||||
if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser)
|
||||
{
|
||||
proj.hostile = false;
|
||||
proj.friendly = true;
|
||||
proj.velocity *= -1f;
|
||||
proj.damage = (int)Player.GetBestClassDamage().ApplyTo(proj.damage * 8);
|
||||
proj.penetrate = 1;
|
||||
|
||||
// 17APR2024: Ozzatron: The Transformer is a reflect which also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
|
||||
int transformerIFrames = Player.ComputeReflectIFrames();
|
||||
Player.GiveUniversalIFrames(transformerIFrames, true);
|
||||
}
|
||||
}
|
||||
|
||||
double dodgeDamageGateValuePercent = 0.05;
|
||||
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
|
||||
|
||||
@@ -2527,33 +2514,23 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (aSpark)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<HideofAstrumDeus>()));
|
||||
if (hurtInfo.Damage > 0)
|
||||
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
|
||||
|
||||
// Only visual effects are done here
|
||||
// The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC
|
||||
|
||||
SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f);
|
||||
GeneralParticleHandler.SpawnParticle(boom);
|
||||
|
||||
for (int e = 0; e < 6; e++)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
|
||||
|
||||
// Start with base damage, then apply the best damage class you can
|
||||
int sDamage = 6;
|
||||
Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f);
|
||||
Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f);
|
||||
electric.noGravity = true;
|
||||
if (transformer)
|
||||
sDamage += 42;
|
||||
sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage);
|
||||
sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage);
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
float sparkCount = transformer ? 10f : 8f;
|
||||
for (float i = 0f; i < sparkCount; i++)
|
||||
{
|
||||
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)
|
||||
{
|
||||
spark.timeLeft = 240;
|
||||
spark.extraUpdates = 1;
|
||||
spark.penetrate = 10;
|
||||
}
|
||||
}
|
||||
NanoParticle nano = new(Player.Center, dustVel, new Color(0, 186, 242), 1f, 20, true, true);
|
||||
GeneralParticleHandler.SpawnParticle(nano);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1414,6 +1414,8 @@ namespace CalamityMod.CalPlayer
|
||||
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
|
||||
}
|
||||
|
||||
if (arsenalCooldown > 0)
|
||||
arsenalCooldown--;
|
||||
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
|
||||
ascendantInsigniaCooldown--;
|
||||
if (DragonsBreathAudioCooldown > 0)
|
||||
@@ -2912,7 +2914,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (giantPearl)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && !areThereAnyDamnBosses)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
foreach (NPC npc in Main.ActiveNPCs)
|
||||
{
|
||||
@@ -3033,7 +3035,11 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (mushy)
|
||||
Player.statDefense += 6;
|
||||
{
|
||||
Player.statDefense += 8;
|
||||
if (fungalSymbiote)
|
||||
Player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
}
|
||||
|
||||
if (omniscience)
|
||||
{
|
||||
@@ -3533,11 +3539,24 @@ namespace CalamityMod.CalPlayer
|
||||
if (check)
|
||||
{
|
||||
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
|
||||
var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType<TeslaBuff>()));
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(10);
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<TeslasAmulet>()));
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(12);
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<TeslaAura>()] < 1)
|
||||
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<TeslaAura>(), damage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
// Reduce duration of Static Discharge
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
if (Player.buffType[l] == ModContent.BuffType<StaticDischarge>())
|
||||
{
|
||||
if (Player.buffTime[l] > 2)
|
||||
{
|
||||
Player.buffTime[l]--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Player.ownedProjectileCounts[ModContent.ProjectileType<TeslaAura>()] > 0)
|
||||
|
||||
@@ -7,9 +7,7 @@ using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.EntitySources;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Prismatic;
|
||||
using CalamityMod.Items.Armor.Reaver;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
@@ -27,7 +25,6 @@ using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MonoMod.Cil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -202,11 +199,11 @@ namespace CalamityMod.CalPlayer
|
||||
GemTechState.MeleeOnHitEffects(target);
|
||||
|
||||
// Handle on-hit ranged effects for the gem tech armor set.
|
||||
if (proj.CountsAsClass<RangedDamageClass>() && proj.type != ModContent.ProjectileType<GemTechGreenFlechette>())
|
||||
if (proj.CountsAsClass<RangedDamageClass>() && proj.type != ProjectileType<GemTechGreenFlechette>())
|
||||
GemTechState.RangedOnHitEffects(target, proj.damage);
|
||||
|
||||
// Handle on-hit projectiles effects for the mythril armor set.
|
||||
if (proj.type != ModContent.ProjectileType<MythrilFlare>())
|
||||
if (proj.type != ProjectileType<MythrilFlare>())
|
||||
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
|
||||
|
||||
if (witheringWeaponEnchant)
|
||||
@@ -501,7 +498,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
}
|
||||
|
||||
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
|
||||
@@ -523,7 +520,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -629,13 +626,13 @@ namespace CalamityMod.CalPlayer
|
||||
if (!proj.CountsAsClass<MeleeDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && Player.meleeEnchant == 7)
|
||||
Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner);
|
||||
|
||||
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType<BasicPlagueBee>())
|
||||
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType<BasicPlagueBee>())
|
||||
{
|
||||
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
|
||||
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
|
||||
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
|
||||
|
||||
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
bee.ArmorPenetration = 20;
|
||||
bee.penetrate = 2;
|
||||
bee.extraUpdates = 1;
|
||||
@@ -678,7 +675,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
AbaddonCooldown = 15;
|
||||
int AbaddonExploDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.03f, 25);
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
if (ursaSergeant && ursaSergeantCooldown <= 0)
|
||||
@@ -688,7 +685,7 @@ namespace CalamityMod.CalPlayer
|
||||
int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(333);
|
||||
ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage);
|
||||
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<UrsaSlash>(), ursaSlashdamage, 0f, Player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<UrsaSlash>(), ursaSlashdamage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
if (proj.CountsAsClass<MeleeDamageClass>())
|
||||
@@ -811,7 +808,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons
|
||||
int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250));
|
||||
|
||||
int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<BloodBombExplosion>(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
|
||||
int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<BloodBombExplosion>(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
|
||||
if (fire.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[fire].DamageType = DamageClass.Generic;
|
||||
@@ -1206,7 +1203,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (eGauntlet)
|
||||
{
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType<ElementalMix>());
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, BuffType<ElementalMix>());
|
||||
}
|
||||
if (ataxiaFire)
|
||||
{
|
||||
@@ -1287,7 +1284,7 @@ namespace CalamityMod.CalPlayer
|
||||
//20% chance for Voltaic Jelly
|
||||
if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5))
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<StaticDischarge>(), 60);
|
||||
target.AddBuff(BuffType<StaticDischarge>(), 60);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1305,6 +1302,11 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<CrushDepth>(), 180);
|
||||
if (sulphurSet)
|
||||
target.AddBuff(BuffID.Poisoned, 60);
|
||||
if (aSpark && Player.IsUnderwater())
|
||||
{
|
||||
int duration = transformer ? 120 : 60;
|
||||
target.AddBuff(BuffType<StaticDischarge>(), duration);
|
||||
}
|
||||
if (abyssalAmulet)
|
||||
{
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, BuffType<RiptideDebuff>());
|
||||
@@ -1346,7 +1348,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
|
||||
{
|
||||
target.Calamity().gladiatorOnKill = false;
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
}
|
||||
|
||||
if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
|
||||
@@ -1512,7 +1514,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
|
||||
{
|
||||
target.Calamity().gladiatorOnKill = false;
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
}
|
||||
|
||||
if (reaverDefense)
|
||||
|
||||
@@ -106,8 +106,6 @@ namespace CalamityMod
|
||||
public static List<int> amalgamBuffList;
|
||||
public static List<int> persistentBuffList;
|
||||
public static List<int> MagicGunIDs;
|
||||
public static List<int> MushroomWeaponIDs;
|
||||
public static List<int> MushroomProjectileIDs;
|
||||
public static List<int> BlacklistedWeaponsWithToolPower;
|
||||
|
||||
// Some of these lists of enemies are unused, but were difficult to create. Many of these common enemy types have a ton of variants.
|
||||
@@ -913,17 +911,17 @@ namespace CalamityMod
|
||||
NPCType<KingSlimeJewelRuby>(),
|
||||
NPCType<KingSlimeJewelSapphire>(),
|
||||
NPCType<KingSlimeJewelEmerald>(),
|
||||
NPCID.EyeofCthulhu,
|
||||
NPCType<BloodlettingServant>(),
|
||||
NPCID.EaterofWorldsHead,
|
||||
NPCID.EaterofWorldsBody,
|
||||
NPCID.EaterofWorldsTail,
|
||||
NPCID.BrainofCthulhu,
|
||||
NPCID.Creeper,
|
||||
NPCID.EyeofCthulhu,
|
||||
NPCType<BloodlettingServant>(),
|
||||
NPCID.QueenBee,
|
||||
NPCID.Deerclops,
|
||||
NPCID.SkeletronHead,
|
||||
NPCID.SkeletronHand,
|
||||
NPCID.Deerclops,
|
||||
NPCID.WallofFlesh,
|
||||
NPCID.WallofFleshEye,
|
||||
NPCID.PirateShipCannon,
|
||||
@@ -941,7 +939,6 @@ namespace CalamityMod
|
||||
NPCID.Plantera,
|
||||
NPCID.PlanterasTentacle,
|
||||
NPCType<PlanterasFreeTentacle>(),
|
||||
NPCID.HallowBoss,
|
||||
NPCID.Everscream,
|
||||
NPCID.SantaNK1,
|
||||
NPCID.IceQueen,
|
||||
@@ -959,6 +956,7 @@ namespace CalamityMod
|
||||
NPCID.DukeFishron,
|
||||
NPCID.Sharkron,
|
||||
NPCID.Sharkron2,
|
||||
NPCID.HallowBoss,
|
||||
NPCID.CultistBoss,
|
||||
NPCID.CultistDragonHead,
|
||||
NPCID.CultistDragonBody1,
|
||||
@@ -1566,6 +1564,7 @@ namespace CalamityMod
|
||||
TileType<LivingGodSlayerFireBlockTile>(),
|
||||
TileType<LivingHolyFireBlockTile>(),
|
||||
TileType<LivingBrimstoneFireBlockTile>(),
|
||||
TileType<LivingPlagueFireBlockTile>(),
|
||||
TileID.LivingFire,
|
||||
TileID.LivingCursedFire,
|
||||
TileID.LivingDemonFire,
|
||||
@@ -1589,7 +1588,6 @@ namespace CalamityMod
|
||||
BuffType<ShadowBuff>(),
|
||||
BuffType<Soaring>(),
|
||||
BuffType<SulphurskinBuff>(),
|
||||
BuffType<TeslaBuff>(),
|
||||
BuffType<WeaponImbueBrimstone>(),
|
||||
BuffType<WeaponImbueCrumbling>(),
|
||||
BuffType<WeaponImbueHolyFlames>(),
|
||||
@@ -1727,34 +1725,6 @@ namespace CalamityMod
|
||||
ItemID.ZapinatorOrange
|
||||
};
|
||||
|
||||
MushroomWeaponIDs = new List<int>()
|
||||
{
|
||||
ItemType<Mycoroot>(),
|
||||
ItemType<InfestedClawmerang>(),
|
||||
ItemType<PuffShroom>(),
|
||||
ItemType<HyphaeRod>(),
|
||||
ItemType<Fungicide>(),
|
||||
ItemType<MycelialClaws>(),
|
||||
ItemType<Shroomer>(),
|
||||
ItemID.Hammush,
|
||||
ItemID.MushroomSpear,
|
||||
ItemID.Shroomerang
|
||||
};
|
||||
|
||||
MushroomProjectileIDs = new List<int>()
|
||||
{
|
||||
ProjectileType<MycorootProj>(),
|
||||
ProjectileType<ShroomerangSpore>(),
|
||||
ProjectileType<InfestedClawmerangProj>(),
|
||||
ProjectileType<PuffCloud>(),
|
||||
ProjectileType<FungiOrb2>(),
|
||||
ProjectileType<FungiOrb>(),
|
||||
ProjectileType<Shroom>(),
|
||||
ProjectileID.TruffleSpore,
|
||||
ProjectileID.MushroomSpear,
|
||||
ProjectileID.Shroomerang
|
||||
};
|
||||
|
||||
// This list intentionally does not contain Grax.
|
||||
BlacklistedWeaponsWithToolPower = new List<int>()
|
||||
{
|
||||
@@ -2764,8 +2734,6 @@ namespace CalamityMod
|
||||
amalgamBuffList = null;
|
||||
persistentBuffList = null;
|
||||
MagicGunIDs = null;
|
||||
MushroomWeaponIDs = null;
|
||||
MushroomProjectileIDs = null;
|
||||
BlacklistedWeaponsWithToolPower = null;
|
||||
|
||||
zombieList = null;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Localization;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class ArsenalPower : CooldownHandler
|
||||
{
|
||||
public static new string ID => "ArsenalPower";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/ArsenalPower";
|
||||
public override Color OutlineColor => Color.White;
|
||||
public override Color CooldownStartColor => Color.Sienna;
|
||||
public override Color CooldownEndColor => Color.LightSlateGray;
|
||||
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/ArsenalOffCooldown");
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 868 B |
|
After Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 864 B |
@@ -8,7 +8,6 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
// TODO -- this item includes a dodge accessory, Brain of Cthulhu
|
||||
public class AmalgamatedBrain : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
@@ -46,7 +45,7 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
}
|
||||
}
|
||||
player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
player.GetDamage<GenericDamageClass>() += 0.05f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class AmidiasPendant : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public const int ShardProjectiles = 2;
|
||||
public const float ShardAngleSpread = 120;
|
||||
public int ShardCountdown = 0;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 26;
|
||||
Item.height = 46;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (ShardCountdown <= 0)
|
||||
{
|
||||
ShardCountdown = 140;
|
||||
}
|
||||
if (ShardCountdown > 0)
|
||||
{
|
||||
ShardCountdown -= Main.rand.Next(1, 4);
|
||||
if (ShardCountdown <= 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
int speed2 = 25;
|
||||
float spawnX = Main.rand.Next(1000) - 500 + player.Center.X;
|
||||
float spawnY = -1000 + player.Center.Y;
|
||||
Vector2 baseSpawn = new Vector2(spawnX, spawnY);
|
||||
Vector2 baseVelocity = player.Center - baseSpawn;
|
||||
baseVelocity.Normalize();
|
||||
baseVelocity *= speed2;
|
||||
int spawnOffset = ShardProjectiles * 15;
|
||||
float spread = -ShardAngleSpread / 2f;
|
||||
for (int i = 0; i < ShardProjectiles; i++)
|
||||
{
|
||||
Vector2 spawn = baseSpawn;
|
||||
spawn.X = spawn.X + i * 30 - spawnOffset;
|
||||
Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(spread + (ShardAngleSpread * i / (float)ShardProjectiles)));
|
||||
velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f;
|
||||
int type = 0;
|
||||
int damage = 0;
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
type = ModContent.ProjectileType<PendantProjectile1>();
|
||||
damage = 15;
|
||||
break;
|
||||
case 1:
|
||||
type = ModContent.ProjectileType<PendantProjectile2>();
|
||||
damage = 15;
|
||||
break;
|
||||
case 2:
|
||||
type = ModContent.ProjectileType<PendantProjectile3>();
|
||||
damage = 30;
|
||||
break;
|
||||
}
|
||||
|
||||
int finalDamage = (int)player.GetBestClassDamage().ApplyTo(damage);
|
||||
finalDamage = player.ApplyArmorAccDamageBonusesTo(finalDamage);
|
||||
Projectile.NewProjectile(source, spawn.X, spawn.Y, velocity.X / 3, velocity.Y / 2, type, finalDamage, 5f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -17,6 +17,8 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().transformer;
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 38;
|
||||
Item.height = 44;
|
||||
Item.width = 50;
|
||||
Item.height = 48;
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.defense = 8; // we buff Ankh Shield to 8
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,10 +1,14 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[LegacyName("AmidiasPendant")]
|
||||
public class GiantPearl : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
@@ -22,6 +26,32 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.giantPearl = true;
|
||||
Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.45f, 0.8f, 0.8f);
|
||||
|
||||
// Draw the aura visual
|
||||
float npcDistCompare = 1000f;
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
if (n.friendly || n.dontTakeDamage)
|
||||
continue;
|
||||
|
||||
float currentNPCDist = Vector2.Distance(n.Center, player.Center);
|
||||
if (currentNPCDist < npcDistCompare)
|
||||
npcDistCompare = currentNPCDist;
|
||||
}
|
||||
float opacity = Utils.Remap(npcDistCompare, 120f, 640f, 1f, 0f);
|
||||
|
||||
if (opacity > 0.7f)
|
||||
{
|
||||
for (int d = 0; d < 3; d++)
|
||||
{
|
||||
Vector2 bubbleSpawn = player.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 120f;
|
||||
GenericBubbleParticle bubble = new(bubbleSpawn, Main.rand.NextVector2CircularEdge(0.75f, 0.75f), 0.3f, Main.rand.NextFloat(MathHelper.TwoPi), 8);
|
||||
GeneralParticleHandler.SpawnParticle(bubble);
|
||||
}
|
||||
}
|
||||
|
||||
CustomPulse auraVisual = new(player.Center, Vector2.Zero, new Color(75, 164, 191), "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, 0f, 0.12f, 0.1175f, 3, true, opacity);
|
||||
GeneralParticleHandler.SpawnParticle(auraVisual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ using static CalamityMod.CalamityUtils;
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[AutoloadEquip(EquipType.Back)]
|
||||
//Its not like its a renamed version of the bayonet, but i put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item.
|
||||
//It's not like it's a renamed version of the bayonet, but I put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item.
|
||||
[LegacyName("MarniteBayonet")]
|
||||
public class MarniteRepulsionShield : ModItem, ILocalizedModType
|
||||
{
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
|
||||
Item.accessory = true;
|
||||
Item.defense = 2;
|
||||
Item.defense = 4;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<MarniteRepulsionHitbox>()] < 1)
|
||||
{
|
||||
var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<MarniteRepulsionHitbox>(), baseDamage, 10f, Main.myPlayer);
|
||||
var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<MarniteRepulsionHitbox>(), baseDamage, 12f, Main.myPlayer);
|
||||
hitbox.originalDamage = baseDamage;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,7 @@ namespace CalamityMod.Items.Accessories
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 700;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ArmorPenetration = 20;
|
||||
Projectile.netImportant = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.nCore = true;
|
||||
player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(250);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
float knockBack = 3f;
|
||||
|
||||
// Spawn nebula stars
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
// Count the number of current active nebula stars; if this is at least 10, no more can spawn
|
||||
int numProj = 0;
|
||||
foreach (Projectile p in Main.ActiveProjectiles)
|
||||
{
|
||||
@@ -46,56 +46,32 @@ namespace CalamityMod.Items.Accessories
|
||||
numProj++;
|
||||
}
|
||||
}
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (Main.rand.Next(15) >= numProj && numProj < 10)
|
||||
{
|
||||
int spawnRadius = 24;
|
||||
int backupSpawnRadius = 90;
|
||||
for (int j = 0; j < 50; j++)
|
||||
for (int j = 0; j < 50; j++) // Attempt to spawn the star randomly around the player
|
||||
{
|
||||
int randomProjOffset = Main.rand.Next(200 - j * 2, 400 + j * 2);
|
||||
float randomProjOffset = Main.rand.NextFloat(200 - j * 2, 400 + j * 2);
|
||||
Vector2 center = player.Center;
|
||||
center.X += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
|
||||
center.Y += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
|
||||
center.X += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1);
|
||||
center.Y += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1);
|
||||
// Ensure we are not trying to spawn the star on top of a solid tile or liquid
|
||||
if (!Collision.SolidCollision(center, spawnRadius, spawnRadius) && !Collision.WetCollision(center, spawnRadius, spawnRadius))
|
||||
{
|
||||
center.X += (float)(spawnRadius / 2);
|
||||
center.Y += (float)(spawnRadius / 2);
|
||||
if (Collision.CanHit(new Vector2(player.Center.X, player.position.Y), 1, 1, center, 1, 1) || Collision.CanHit(new Vector2(player.Center.X, player.position.Y - 50f), 1, 1, center, 1, 1))
|
||||
// Ensure the star's spawn point has line-of-sight with the player
|
||||
if (Collision.CanHit(player.Center, 1, 1, center, 1, 1) || Collision.CanHit(player.Center - new Vector2(0f, 50f), 1, 1, center, 1, 1))
|
||||
{
|
||||
int projTileX = (int)center.X / 16;
|
||||
int projTileY = (int)center.Y / 16;
|
||||
bool canSpawnProj = false;
|
||||
if (Main.rand.NextBool(3) && Main.tile[projTileX, projTileY] != null && Main.tile[projTileX, projTileY].WallType > 0)
|
||||
if (Main.rand.NextBool(3) && Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
canSpawnProj = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
center.X -= (float)(backupSpawnRadius / 2);
|
||||
center.Y -= (float)(backupSpawnRadius / 2);
|
||||
if (Collision.SolidCollision(center, backupSpawnRadius, backupSpawnRadius))
|
||||
{
|
||||
center.X += (float)(backupSpawnRadius / 2);
|
||||
center.Y += (float)(backupSpawnRadius / 2);
|
||||
canSpawnProj = true;
|
||||
}
|
||||
}
|
||||
if (canSpawnProj)
|
||||
{
|
||||
for (int k = 0; k < Main.maxProjectiles; k++)
|
||||
{
|
||||
if (Main.projectile[k].active && Main.projectile[k].owner == player.whoAmI && Main.projectile[k].type == ModContent.ProjectileType<NebulaStar>() && (center - Main.projectile[k].Center).Length() < 48f)
|
||||
{
|
||||
canSpawnProj = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (canSpawnProj && Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
|
||||
return;
|
||||
}
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(250);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
float knockBack = 3f;
|
||||
|
||||
Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class TeslasAmulet : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 14));
|
||||
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().tesla = true;
|
||||
player.Calamity().teslaVisuals = !hideVisual;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.BottledWater).
|
||||
AddIngredient<AerialiteBar>(8).
|
||||
AddIngredient<SeaPrism>(8).
|
||||
AddIngredient<StormlionMandible>(4).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -27,6 +27,8 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().aSpark;
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -4,23 +4,22 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories.Vanity
|
||||
{
|
||||
public class RedBow : ModItem, ILocalizedModType
|
||||
[LegacyName("RedBow")]
|
||||
public class GhostBracelet : ModItem, ILocalizedModType
|
||||
{
|
||||
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Head", EquipType.Head, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Body", EquipType.Body, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Legs", EquipType.Legs, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Head", EquipType.Head, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Body", EquipType.Body, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Legs", EquipType.Legs, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
return;
|
||||
|
||||
@@ -37,8 +36,8 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 22;
|
||||
Item.height = 30;
|
||||
Item.width = 42;
|
||||
Item.height = 38;
|
||||
Item.accessory = true;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
@@ -48,21 +47,21 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
player.Calamity().redBow = true;
|
||||
player.Calamity().ghostBracelet = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (!hideVisual)
|
||||
{
|
||||
player.Calamity().redBow = true;
|
||||
player.Calamity().ghostBracelet = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Silk, 5).
|
||||
AddIngredient(ItemID.Silk, 20).
|
||||
AddTile(TileID.Loom).
|
||||
Register();
|
||||
}
|
||||
|
After Width: | Height: | Size: 919 B |
|
Before Width: | Height: | Size: 640 B |
@@ -61,13 +61,13 @@ namespace CalamityMod.Items.Armor.GemTech
|
||||
Item.height = 32;
|
||||
Item.defense = 14;
|
||||
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.rare = RarityType<Violet>();
|
||||
Item.Calamity().donorItem = true;
|
||||
}
|
||||
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs)
|
||||
{
|
||||
return body.type == ModContent.ItemType<GemTechBodyArmor>() && legs.type == ModContent.ItemType<GemTechSchynbaulds>();
|
||||
return body.type == ItemType<GemTechBodyArmor>() && legs.type == ItemType<GemTechSchynbaulds>();
|
||||
}
|
||||
public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType<GemTechHeadgear>() && player.armor[1].type == ItemType<GemTechBodyArmor>() && player.armor[2].type == ItemType<GemTechSchynbaulds>();
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect
|
||||
orig(self);
|
||||
}
|
||||
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType<MarniteArchitectToga>();
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType<MarniteArchitectToga>();
|
||||
public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType<MarniteArchitectHeadgear>() && player.armor[1].type == ItemType<MarniteArchitectToga>();
|
||||
public bool IsPartOfSet(Item item) => item.type == ItemType<MarniteArchitectHeadgear>() ||
|
||||
item.type == ItemType<MarniteArchitectToga>();
|
||||
@@ -205,7 +205,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect
|
||||
|
||||
public override void PostUpdateMiscEffects()
|
||||
{
|
||||
if (!setEquipped && Player.mount.Type == ModContent.MountType<MarniteLift>() && Player.mount.Active)
|
||||
if (!setEquipped && Player.mount.Type == MountType<MarniteLift>() && Player.mount.Active)
|
||||
Player.mount.Dismount(Player);
|
||||
|
||||
if (mounted)
|
||||
@@ -368,7 +368,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect
|
||||
//Sprites
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
MountData.frontTextureGlow = ModContent.Request<Texture2D>("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire");
|
||||
MountData.frontTextureGlow = Request<Texture2D>("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ namespace CalamityMod.Items.Armor.Wulfrum
|
||||
}
|
||||
}
|
||||
|
||||
else if (player.HasItem(ModContent.ItemType<WulfrumMetalScrap>()))
|
||||
else if (player.HasItem(ItemType<WulfrumMetalScrap>()))
|
||||
{
|
||||
player.ConsumeItem(ModContent.ItemType<WulfrumMetalScrap>());
|
||||
player.ConsumeItem(ItemType<WulfrumMetalScrap>());
|
||||
//I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right.
|
||||
player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime);
|
||||
//Though do i need to sync that or is the player inventory auto synced?
|
||||
@@ -234,7 +234,7 @@ namespace CalamityMod.Items.Armor.Wulfrum
|
||||
setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f));
|
||||
tooltips.Insert(setBonusIndex + 1, setBonus1);
|
||||
|
||||
int AmmoItem = ModContent.ItemType<WulfrumMetalScrap>();
|
||||
int AmmoItem = ItemType<WulfrumMetalScrap>();
|
||||
string AmmoDisplay = $"[i:{AmmoItem}] {CalamityUtils.GetItemName(AmmoItem)}";
|
||||
TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem<WulfrumHat>("AbilityDescription").Format(AmmoDisplay));
|
||||
setBonus2.OverrideColor = new Color(110, 192, 93);
|
||||
|
||||
@@ -826,7 +826,7 @@ namespace CalamityMod.Items
|
||||
//Flame Waker Boots buff.
|
||||
if (item.type == ItemID.FlameWakerBoots)
|
||||
{
|
||||
EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25\n" +
|
||||
EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25x\n" +
|
||||
"All attacks light enemies on fire\n" +
|
||||
"'Never get cold feet again'");
|
||||
}
|
||||
@@ -835,7 +835,7 @@ namespace CalamityMod.Items
|
||||
if (item.type == ItemID.HellfireTreads)
|
||||
{
|
||||
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs"));
|
||||
EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5, does not stack with downgrades\n" +
|
||||
EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5x, does not stack with downgrades\n" +
|
||||
"All attacks inflict Hellfire");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Tiles.LivingFire;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.LivingFire
|
||||
{
|
||||
public class LivingPlagueFireBlock : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 10;
|
||||
Item.height = 12;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<LivingPlagueFireBlockTile>();
|
||||
}
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
Lighting.AddLight((int)((Item.position.X + Item.width / 2) / 16f), (int)((Item.position.Y + Item.height / 2) / 16f), 0f, 1f, 0.2f);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(20).
|
||||
AddIngredient(ItemID.LivingFireBlock, 20).
|
||||
AddIngredient<PlagueCellCanister>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 232 B |
@@ -1,60 +0,0 @@
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions
|
||||
{
|
||||
public class TeslaPotion : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 14));
|
||||
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.useTurn = true;
|
||||
Item.maxStack = 9999;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.useAnimation = 17;
|
||||
Item.useTime = 17;
|
||||
Item.useStyle = ItemUseStyleID.DrinkLiquid;
|
||||
Item.UseSound = SoundID.Item3;
|
||||
Item.consumable = true;
|
||||
Item.buffType = ModContent.BuffType<TeslaBuff>();
|
||||
Item.buffTime = CalamityUtils.SecondsToFrames(480f);
|
||||
Item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(5).
|
||||
AddIngredient(ItemID.BottledWater).
|
||||
AddIngredient<AerialiteOre>(2).
|
||||
AddIngredient<SeaPrism>(5).
|
||||
AddIngredient<PearlShard>().
|
||||
AddIngredient<StormlionMandible>().
|
||||
AddTile(TileID.Bottles).
|
||||
AddDecraftCondition(CalamityConditions.DownedHiveMindOrPerforator).
|
||||
Register();
|
||||
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.BottledWater).
|
||||
AddIngredient<BloodOrb>(10).
|
||||
AddIngredient<PearlShard>().
|
||||
AddTile(TileID.AlchemyTable).
|
||||
Register()
|
||||
.DisableDecraft();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,8 +38,8 @@ namespace CalamityMod.Items.SummonItems.Invasion
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
CalamityNetcode.SyncWorld();
|
||||
AcidRainEvent.TryStartEvent(true);
|
||||
AcidRainEvent.TryStartEvent(forceRain: true);
|
||||
//CalamityNetcode.SyncWorld(); //TryStartEvent(forceRain: true) already sync the world data
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,16 @@ namespace CalamityMod.Items.SummonItems.Invasion
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
Main.StartInvasion(InvasionID.MartianMadness);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Main.invasionDelay = 0;
|
||||
Main.StartInvasion(InvasionID.MartianMadness);
|
||||
}
|
||||
else
|
||||
{
|
||||
//-7.0 is hardcoded id for MartianMadness Event
|
||||
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, number: player.whoAmI, number2: -7.0f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot.
|
||||
Item.shoot = ProjectileType<BobbitHead>();
|
||||
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
|
||||
Item.rare = ModContent.RarityType<PureGreen>();
|
||||
Item.rare = RarityType<PureGreen>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,9 +34,15 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
//Only SinglePlayer or DedServ should change time to prevent unwanted race condition
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
return true;
|
||||
|
||||
if (CalamityPlayer.areThereAnyDamnBosses)
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
// Early Morning -> Noon
|
||||
if (Main.dayTime && Main.time < NoonCutoff)
|
||||
Main.SkipToTime(NoonCutoff, true);
|
||||
|
||||
@@ -90,15 +90,15 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags
|
||||
};
|
||||
itemLoot.AddIf(getsHapuFruit, ModContent.ItemType<HapuFruit>());
|
||||
|
||||
// Apelusa dev item
|
||||
// Name specific: "Pelusa"
|
||||
static bool getsRedBow(DropAttemptInfo info)
|
||||
// Dandy dev item
|
||||
// Name specific: "Dandy"
|
||||
static bool getsGhostBracelet(DropAttemptInfo info)
|
||||
{
|
||||
string playerName = info.player.name;
|
||||
return playerName == "Pelusa";
|
||||
return playerName == "Dandy";
|
||||
}
|
||||
|
||||
itemLoot.AddIf(getsRedBow, ModContent.ItemType<RedBow>());
|
||||
itemLoot.AddIf(getsGhostBracelet, ModContent.ItemType<GhostBracelet>());
|
||||
|
||||
// Mishiro dev vanity
|
||||
// Name specific: "Amber" or "Mishiro"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.NPCs.BrimstoneElemental;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Sounds;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -11,37 +12,61 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public class SeethingDischarge : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Magic";
|
||||
|
||||
public int DartTimer = 0;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 28;
|
||||
Item.height = 32;
|
||||
Item.damage = 52;
|
||||
Item.damage = 40;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 15;
|
||||
Item.useTime = 24;
|
||||
Item.useAnimation = 24;
|
||||
Item.mana = 20;
|
||||
Item.useTime = 60;
|
||||
Item.useAnimation = 60;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 6.75f;
|
||||
Item.UseSound = CommonCalamitySounds.FlareSound;
|
||||
Item.UseSound = BrimstoneElemental.ShellFireSound;
|
||||
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
|
||||
Item.rare = ItemRarityID.Pink;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>();
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shootSpeed = 10f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float SpeedX = velocity.X + 10f * 0.05f;
|
||||
float SpeedY = velocity.Y + 10f * 0.05f;
|
||||
float SpeedX2 = velocity.X - 10f * 0.05f;
|
||||
float SpeedY2 = velocity.Y - 10f * 0.05f;
|
||||
float SpeedX3 = velocity.X + 0f * 0.05f;
|
||||
float SpeedY3 = velocity.Y + 0f * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX3, SpeedY3, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
DartTimer++;
|
||||
|
||||
// Spawn hellblasts
|
||||
float diameter = 50f;
|
||||
Vector2 projVelocity = velocity.SafeNormalize(Vector2.UnitY);
|
||||
projVelocity *= diameter;
|
||||
|
||||
int totalProjectiles = 5;
|
||||
float offsetAngle = MathHelper.Pi * 0.2f;
|
||||
|
||||
for (int j = 0; j < totalProjectiles; j++)
|
||||
{
|
||||
float radians = j - (totalProjectiles - 1f) / 2f;
|
||||
Vector2 offset = projVelocity.RotatedBy(offsetAngle * radians);
|
||||
Projectile.NewProjectile(source, player.Center + offset, velocity, ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
// Every 3rd attack, spawn a ring of homing darts
|
||||
if (DartTimer == 3)
|
||||
{
|
||||
DartTimer = 0;
|
||||
|
||||
totalProjectiles = 8;
|
||||
Vector2 initialOffset = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(0f, MathHelper.PiOver4));
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
velocity = initialOffset.RotatedBy(MathHelper.TwoPi * (k / (float)totalProjectiles)) * Item.shootSpeed;
|
||||
Projectile.NewProjectile(source, player.Center, velocity, type, damage, 0f, player.whoAmI, 0f, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.shootSpeed = 28f;
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.rare = RarityType<Violet>();
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 74;
|
||||
Item.height = 86;
|
||||
Item.width = 86;
|
||||
Item.height = 98;
|
||||
Item.damage = 105;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.useAnimation = 22;
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -138,7 +138,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/ExobladeGlow").Value);
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request<Texture2D>("CalamityMod/Items/Weapons/Melee/ExobladeGlow").Value);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.knockBack = 4;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.rare = RarityType<Violet>();
|
||||
Item.Calamity().donorItem = true;
|
||||
|
||||
Item.autoReuse = false;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
Item.channel = true;
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.shoot = ModContent.ProjectileType<CnidarianJellyfishOnTheString>();
|
||||
Item.shoot = ProjectileType<CnidarianJellyfishOnTheString>();
|
||||
Item.shootSpeed = 10f;
|
||||
|
||||
Item.rare = ItemRarityID.Green;
|
||||
@@ -124,7 +124,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
Texture2D properSprite = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Summon/Cnidarian").Value;
|
||||
Texture2D properSprite = Request<Texture2D>("CalamityMod/Items/Weapons/Summon/Cnidarian").Value;
|
||||
|
||||
spriteBatch.DrawNewInventorySprite(properSprite, new Vector2(42f, 34), position, drawColor, origin, scale);
|
||||
return false;
|
||||
@@ -132,7 +132,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
Texture2D properSprite = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Summon/Cnidarian").Value;
|
||||
Texture2D properSprite = Request<Texture2D>("CalamityMod/Items/Weapons/Summon/Cnidarian").Value;
|
||||
|
||||
spriteBatch.Draw(properSprite, Item.position - Main.screenPosition, null, lightColor, rotation, properSprite.Size() / 2f, scale, 0, 0);
|
||||
return false;
|
||||
|
||||
@@ -597,11 +597,6 @@ SulphurskinBuff: {
|
||||
Description: The sulphuric waters have a lesser effect on you
|
||||
}
|
||||
|
||||
TeslaBuff: {
|
||||
DisplayName: Tesla's Electricity
|
||||
Description: Summons an aura of electricity
|
||||
}
|
||||
|
||||
WeaponImbueBrimstone: {
|
||||
DisplayName: Weapon Imbue: Brimstone
|
||||
Description: Melee, Whip, and Rogue attacks ignite enemies with brimstone flames
|
||||
@@ -785,7 +780,7 @@ KamiBuff: {
|
||||
|
||||
Mushy: {
|
||||
DisplayName: Mushy
|
||||
Description: Increased defense by 6 and life regen by 1HP/s
|
||||
Description: Increased defense by 8 and life regen by 1HP/s
|
||||
}
|
||||
|
||||
PhantomicEmpowerment: {
|
||||
|
||||
@@ -103,10 +103,10 @@ AmalgamatedBrain: {
|
||||
DisplayName: Amalgamated Brain
|
||||
Tooltip:
|
||||
'''
|
||||
10% increased damage
|
||||
Shade rains down and enemies are confused when hit,
|
||||
and summon damage and crit chance are boosted by 10%
|
||||
5% increased damage
|
||||
Shade rains down and enemies are confused when hit
|
||||
Grants the ability to dodge attacks
|
||||
After dodging, summon damage and crit chance are boosted by 10%
|
||||
'''
|
||||
HoldShiftTooltip:
|
||||
'''
|
||||
@@ -129,14 +129,14 @@ AmbrosialAmpoule: {
|
||||
'''
|
||||
}
|
||||
|
||||
AmidiasPendant: {
|
||||
DisplayName: Amidias' Pendant
|
||||
Tooltip: Periodically rains down prism shards that briefly stun enemies
|
||||
}
|
||||
|
||||
AmidiasSpark: {
|
||||
DisplayName: Amidias' Spark
|
||||
Tooltip: Taking damage releases a blast of sparks
|
||||
Tooltip:
|
||||
'''
|
||||
Attacks inflict Static Discharge while underwater
|
||||
Taking damage causes the enemy to be shocked
|
||||
Shocked enemies constantly release sparks
|
||||
'''
|
||||
}
|
||||
|
||||
AncientFossil: {
|
||||
@@ -359,7 +359,7 @@ BlunderBooster: {
|
||||
12% increased rogue damage and 15% increased rogue projectile velocity
|
||||
Stealth generates 10% faster
|
||||
Summons a red lightning aura around the player that electrifies nearby enemies
|
||||
The aura's appearance can be toggled with visibility
|
||||
The aura has reduced opacity if visibility is disabled
|
||||
Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards diagonal dash
|
||||
This dash leaves a trail of red lightning bolts
|
||||
This effect has a 1 second cooldown before it can be used again
|
||||
@@ -808,8 +808,8 @@ FungalSymbiote: {
|
||||
Tooltip:
|
||||
'''
|
||||
You grow mushrooms on the grass beneath you
|
||||
Consuming mushrooms provides the Mushy buff, granting 6 defense and +1 HP/s life regen
|
||||
All mushroom-based weapons deal 10% more damage and emit harmless mushrooms
|
||||
Consuming mushrooms provides the Mushy buff, granting 8 defense and +1 HP/s life regen
|
||||
10% increased damage while you have the Mushy buff
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ GiantPearl: {
|
||||
'''
|
||||
You have a light aura around you
|
||||
Enemies within the aura are slowed down
|
||||
Does not work while a boss is alive
|
||||
You release homing prism shards while an enemy is slowed
|
||||
Provides a small amount of light in the abyss
|
||||
'''
|
||||
}
|
||||
@@ -1754,6 +1754,16 @@ SupremeBaitTackleBoxFishingStation: {
|
||||
'''
|
||||
}
|
||||
|
||||
TeslasAmulet: {
|
||||
DisplayName: Tesla's Amulet
|
||||
Tooltip:
|
||||
'''
|
||||
Generates an electrifying field that slows enemies
|
||||
The field has reduced opacity if visibility is disabled
|
||||
Reduces the duration of the Static Discharge debuff
|
||||
'''
|
||||
}
|
||||
|
||||
TheAbsorber: {
|
||||
DisplayName: The Absorber
|
||||
Tooltip:
|
||||
@@ -1863,10 +1873,11 @@ TheTransformer: {
|
||||
DisplayName: The Transformer
|
||||
Tooltip:
|
||||
'''
|
||||
Multiplies all electric debuff damage by 1.5
|
||||
Taking damage releases a blast of sparks
|
||||
Complete immunity to Electrified and all electric attacks
|
||||
You take halved damage from enemy bullets and reflect them for 800% damage
|
||||
Multiplies all electricity debuff damage by 1.5x
|
||||
Attacks inflict Static Discharge while underwater
|
||||
Reduces the damage of all electricity debuffs by 50%
|
||||
Taking damage causes the enemy to be shocked
|
||||
Shocked enemies constantly release sparks
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -2027,9 +2038,9 @@ CrystalHeartVodka: {
|
||||
Tooltip: "'Tastes like strawberry cream liqueur (and estrogen)'"
|
||||
}
|
||||
|
||||
CocosFeather: {
|
||||
DisplayName: Coco's Feather
|
||||
Tooltip: ""
|
||||
GhostBracelet: {
|
||||
DisplayName: Ghost Bracelet
|
||||
Tooltip: Wow.... It looks at me with its hollow eyes full of curiosity
|
||||
}
|
||||
|
||||
HapuFruit: {
|
||||
@@ -2050,8 +2061,3 @@ Popo: {
|
||||
'Don't let the demons steal your nose'
|
||||
'''
|
||||
}
|
||||
|
||||
RedBow: {
|
||||
DisplayName: Red Bow
|
||||
Tooltip: "'Pelusa's favorite bow'"
|
||||
}
|
||||
@@ -46,7 +46,7 @@ UrsaSergeant: {
|
||||
Attacks maul enemies with astral claw swipes
|
||||
Taking damage reduces the cooldown, but inflicts you with Astral Infection
|
||||
Enemy kills also reduce the cooldown
|
||||
Swipes will be opaque and produce no sound if visibility is disabled
|
||||
Swipes will be translucent and silent if visibility is disabled
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -3095,6 +3095,11 @@ LivingHolyFireBlock: {
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
LivingPlagueFireBlock: {
|
||||
DisplayName: Living Plague Fire Block
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
DraedonExoSelectMusicBox: {
|
||||
DisplayName: Music Box (Exo Mech Selection)
|
||||
Tooltip: Plays 'Signal Received' by CDMusic
|
||||
|
||||
@@ -155,15 +155,6 @@ SupremeManaPotion: {
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
TeslaPotion: {
|
||||
DisplayName: Tesla Potion
|
||||
Tooltip:
|
||||
'''
|
||||
Summons an aura of electricity that electrifies and slows enemies
|
||||
Aura damage is reduced on bosses
|
||||
'''
|
||||
}
|
||||
|
||||
ZenPotion: {
|
||||
DisplayName: Zen Potion
|
||||
Tooltip: Vastly decreases enemy spawn rate
|
||||
|
||||
@@ -723,7 +723,11 @@ SanguineFlare: {
|
||||
|
||||
SeethingDischarge: {
|
||||
DisplayName: Seething Discharge
|
||||
Tooltip: Fires a barrage of brimstone blasts
|
||||
Tooltip:
|
||||
'''
|
||||
Fires an accelerating arc of brimstone hellblasts
|
||||
Every third attack spawns a brimstone dart ring which chases after foes
|
||||
'''
|
||||
}
|
||||
|
||||
Serpentine: {
|
||||
|
||||
@@ -579,7 +579,7 @@ THIEF: {
|
||||
LikeNPC: "{NPCName} doesn't only keep spiky balls in his pockets, he keeps a ton of cash! He's too absentminded to notice I'm stealing from him too! I like that a lot!"
|
||||
DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods.
|
||||
LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute!
|
||||
Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how she does it!"
|
||||
Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how they do it!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ HolyFlare.DisplayName: Holy Flare
|
||||
HolyLight.DisplayName: Holy Light
|
||||
HolySpear.DisplayName: Holy Spear
|
||||
HomingGasBulb.DisplayName: Homing Gas Bulb
|
||||
HomingGasBulbSporeGas.DisplayName: Homing Gas Bulb Spore Gas
|
||||
HomingGasBulbSporeGas.DisplayName: Spore Bulb Gas
|
||||
IceBlast.DisplayName: Ice Blast
|
||||
IceBomb.DisplayName: Ice Bomb
|
||||
IceRain.DisplayName: Ice Rain
|
||||
|
||||
@@ -76,6 +76,7 @@ DeepWounderWater.DisplayName: Water Droplet
|
||||
DesecratedBubble.DisplayName: Desecrated Bubble
|
||||
DesecratedWaterProj.DisplayName: Desecrated Water
|
||||
DestructionBolt.DisplayName: Destruction Bolt
|
||||
DestructionExplosion.DisplayName: Destruction Explosion
|
||||
DestructionStar.DisplayName: Star of Destruction
|
||||
DragonScalesInfernado.DisplayName: Infernado
|
||||
DragonShit.DisplayName: Fire
|
||||
@@ -328,4 +329,3 @@ WrathwingCinder.DisplayName: Wrathwing Eruption
|
||||
WrathwingFireball.DisplayName: Wrathwing Fireball
|
||||
WrathwingSpear.DisplayName: Wrathwing
|
||||
WulfrumKnifeProj.DisplayName: Wulfrum Knife
|
||||
DestructionExplosion.DisplayName: Destruction Explosion
|
||||
@@ -89,9 +89,7 @@ OmegaBlueTentacle.DisplayName: Omega Blue Tentacle
|
||||
OnyxLabSeeker.DisplayName: Seeking Mechanism
|
||||
PauldronDash.DisplayName: Pauldron Dash
|
||||
PauldronExplosion.DisplayName: Pauldron Explosion
|
||||
PendantProjectile1.DisplayName: Prism Shard
|
||||
PendantProjectile2.DisplayName: Prism Shard
|
||||
PendantProjectile3.DisplayName: Prism Shard
|
||||
PearlAuraShard.DisplayName: Prism Shard
|
||||
PlaguePulse.DisplayName: Plague Pulse
|
||||
PoisonousSeawater.DisplayName: Seawater
|
||||
PscTransformAnimation.DisplayName: Psc Transform Animation
|
||||
|
||||
@@ -3,7 +3,6 @@ AbyssDrown2: Oxygen failed to reach {0} from the depths of the Abyss.
|
||||
AbyssDrown3: "{0} faded away, lost in the dark waters."
|
||||
AlcoholBig1: "{0} downed too many shots."
|
||||
AlcoholBig2: "{0}'s liver failed."
|
||||
AlcoholSmall: "{0} succumbed to alcohol sickness."
|
||||
Armageddon: "{0} failed the challenge at hand."
|
||||
AstralInfection1: "{0}'s infection spread too far."
|
||||
AstralInfection2: "{0}'s skin was replaced by the astral virus."
|
||||
|
||||
@@ -80,6 +80,7 @@ ExtensionName: {
|
||||
// Cooldowns
|
||||
Cooldowns: {
|
||||
AquaticHeartIceShield: Ice Shield Cooldown
|
||||
ArsenalPower: Arsenal Cooldown
|
||||
AscendEffect: Ascension Cooldown
|
||||
BloodflareFrenzy: Blood Frenzy Cooldown
|
||||
BloodflareRangedSet: Bloodflare Soul Cooldown
|
||||
|
||||
@@ -37,7 +37,7 @@ SetBonus: {
|
||||
'''
|
||||
Eskimo:
|
||||
'''
|
||||
Multiplies all cold-based debuff damage by 1.25
|
||||
Multiplies all cold-based debuff damage by 1.25x
|
||||
Cold enemies will deal reduced contact damage to the player
|
||||
Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs
|
||||
'''
|
||||
|
||||
@@ -1074,8 +1074,8 @@ namespace CalamityMod
|
||||
double Damage(DamageClass damageClass) => Math.Round(Main.LocalPlayer.GetTotalDamage(damageClass).Additive * Main.LocalPlayer.GetTotalDamage(damageClass).Multiplicative * 100 - 100);
|
||||
int Crit(DamageClass damageClass) => (int)Main.LocalPlayer.GetTotalCritChance(damageClass);
|
||||
|
||||
int rogueItem = ModContent.ItemType<WulfrumKnife>();
|
||||
DamageClass rogueDamageClass = ModContent.GetInstance<RogueDamageClass>();
|
||||
int rogueItem = ItemType<WulfrumKnife>();
|
||||
DamageClass rogueDamageClass = GetInstance<RogueDamageClass>();
|
||||
Func<string> rogueDamage = () => $"Rogue Damage: {Damage(rogueDamageClass)}%";
|
||||
Func<string> rogueCrit = () => $"Rogue Critical: {Crit(rogueDamageClass)}%";
|
||||
fargos.Call("AddStat", rogueItem, rogueDamage);
|
||||
|
||||
@@ -91,8 +91,8 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(NPC.localAI[0]);
|
||||
writer.Write(playerCrossed);
|
||||
writer.Write(NPC.localAI[0]);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
|
||||
@@ -156,8 +156,8 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
hasDoneDeathray = reader.ReadBoolean();
|
||||
AttackIndex = reader.ReadInt32();
|
||||
DelayTime = reader.ReadInt32();
|
||||
DeathrayTime = reader.ReadInt32();
|
||||
JumpTimer = reader.ReadSingle();
|
||||
DeathrayTime = reader.ReadInt32();
|
||||
ShootPosition = reader.ReadVector2();
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +112,8 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
NPC.chaseable = reader.ReadBoolean();
|
||||
currentMode = reader.ReadInt32();
|
||||
NPC.chaseable = reader.ReadBoolean();
|
||||
NPC.localAI[0] = reader.ReadSingle();
|
||||
NPC.localAI[1] = reader.ReadSingle();
|
||||
NPC.localAI[3] = reader.ReadSingle();
|
||||
|
||||
@@ -130,6 +130,7 @@ namespace CalamityMod.NPCs.CalClone
|
||||
double dist = death ? 180 : 150;
|
||||
NPC.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - NPC.width / 2;
|
||||
NPC.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - NPC.height / 2;
|
||||
NPC.velocity = Vector2.Zero;
|
||||
NPC.ai[1] += death ? 0.5f : 2f;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,11 +47,12 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
|
||||
bool revenge = CalamityWorld.revenge || bossRush;
|
||||
bool death = CalamityWorld.death || bossRush;
|
||||
|
||||
float exhaustionGateValue = 300f;
|
||||
float exhaustionGateValue = 360f;
|
||||
if (Main.getGoodWorld)
|
||||
exhaustionGateValue *= 0.5f;
|
||||
|
||||
float exhaustionIncreasePerAttack = exhaustionGateValue * 0.1f;
|
||||
float numberOfAttacksBeforeExhaustion = 12f;
|
||||
float exhaustionIncreasePerAttack = exhaustionGateValue * (1f / numberOfAttacksBeforeExhaustion);
|
||||
bool exhausted = calamityGlobalNPC.newAI[1] == 1f;
|
||||
bool phase2 = lifeRatio <= (death ? 0.8f : revenge ? 0.7f : 0.5f);
|
||||
bool phase3 = lifeRatio <= (death ? 0.5f : (revenge ? 0.35f : 0.2f)) && expertMode;
|
||||
|
||||
@@ -246,6 +246,7 @@ namespace CalamityMod.NPCs
|
||||
public int slowed = 0;
|
||||
public int electrified = 0;
|
||||
public int pearlAura = 0;
|
||||
public int pearlAuraCounter = 0;
|
||||
public int bBlood = 0;
|
||||
public int brainRot = 0;
|
||||
public int laceration = 0;
|
||||
@@ -282,6 +283,8 @@ namespace CalamityMod.NPCs
|
||||
public int astralInfection = 0;
|
||||
public int wDeath = 0;
|
||||
public int nightwither = 0;
|
||||
public int shocked = 0;
|
||||
public int transformerShocked = 0;
|
||||
public int voidfrost = 0;
|
||||
public int shellfishVore = 0;
|
||||
public int clamDebuff = 0;
|
||||
@@ -471,6 +474,7 @@ namespace CalamityMod.NPCs
|
||||
myClone.slowed = slowed;
|
||||
myClone.electrified = electrified;
|
||||
myClone.pearlAura = pearlAura;
|
||||
myClone.pearlAuraCounter = pearlAuraCounter;
|
||||
myClone.bBlood = bBlood;
|
||||
myClone.brainRot = brainRot;
|
||||
myClone.laceration = laceration;
|
||||
@@ -503,6 +507,8 @@ namespace CalamityMod.NPCs
|
||||
myClone.astralInfection = astralInfection;
|
||||
myClone.wDeath = wDeath;
|
||||
myClone.nightwither = nightwither;
|
||||
myClone.shocked = shocked;
|
||||
myClone.transformerShocked = transformerShocked;
|
||||
myClone.voidfrost = voidfrost;
|
||||
myClone.shellfishVore = shellfishVore;
|
||||
myClone.clamDebuff = clamDebuff;
|
||||
@@ -1447,7 +1453,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f;
|
||||
}
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>())
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType<SkeletronPrime2>())
|
||||
{
|
||||
// HP boosted in Master Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar)
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.7 : 1.2));
|
||||
@@ -1458,7 +1464,7 @@ namespace CalamityMod.NPCs
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65);
|
||||
npc.scale = 1.2f;
|
||||
}
|
||||
else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == ModContent.NPCType<Foveanator>())
|
||||
else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == NPCType<Foveanator>())
|
||||
{
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2);
|
||||
npc.npcSlots = 10f;
|
||||
@@ -2471,7 +2477,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
if (!NPC.downedMechBossAny)
|
||||
{
|
||||
if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType<Foveanator>())
|
||||
if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType<Foveanator>())
|
||||
{
|
||||
double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier);
|
||||
@@ -2481,7 +2487,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1))
|
||||
{
|
||||
if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType<Foveanator>())
|
||||
if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType<Foveanator>())
|
||||
{
|
||||
double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier);
|
||||
@@ -3432,7 +3438,7 @@ namespace CalamityMod.NPCs
|
||||
public override bool PreAI(NPC npc)
|
||||
{
|
||||
// Change Spaz and Ret weaknesses and resistances when phase 2 starts.
|
||||
if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType<Foveanator>())
|
||||
if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType<Foveanator>())
|
||||
{
|
||||
if (npc.ai[0] >= 2f)
|
||||
{
|
||||
@@ -5142,6 +5148,9 @@ namespace CalamityMod.NPCs
|
||||
npc.ai[3] = 0f;
|
||||
}
|
||||
|
||||
// Incremement Giant Pearl's pearl shard counter
|
||||
pearlAuraCounter++;
|
||||
|
||||
// Debuff decrements
|
||||
if (debuffResistanceTimer > 0)
|
||||
debuffResistanceTimer--;
|
||||
@@ -5220,6 +5229,10 @@ namespace CalamityMod.NPCs
|
||||
wDeath--;
|
||||
if (nightwither > 0)
|
||||
nightwither--;
|
||||
if (shocked > 0)
|
||||
shocked--;
|
||||
if (transformerShocked > 0)
|
||||
transformerShocked--;
|
||||
if (voidfrost > 0)
|
||||
voidfrost--;
|
||||
if (shellfishVore > 0)
|
||||
@@ -5230,8 +5243,6 @@ namespace CalamityMod.NPCs
|
||||
sulphurPoison--;
|
||||
if (sagePoisonTime > 0)
|
||||
sagePoisonTime--;
|
||||
if (kamiFlu > 0)
|
||||
kamiFlu--;
|
||||
if (relicOfResilienceCooldown > 0)
|
||||
relicOfResilienceCooldown--;
|
||||
if (relicOfResilienceWeakness > 0)
|
||||
@@ -5263,11 +5274,9 @@ namespace CalamityMod.NPCs
|
||||
Particle sparks = new LineParticle(npc.Center, new Vector2(Main.rand.NextFloat(-9f, 9f), Main.rand.NextFloat(-9f, 9f)), false, 45, 0.9f, Main.rand.NextBool() ? Color.Cyan : Color.SkyBlue);
|
||||
GeneralParticleHandler.SpawnParticle(sparks);
|
||||
}
|
||||
//Particle boop = new CustomPulse(npc.Center, Vector2.Zero, new Color(233, 95, 212), "CalamityMod/Particles/Sparkle2", Vector2.One, Main.rand.NextFloat(-5f, 5f), 0.8f + (float)(0.04 * veriumDoomStacks), 1.6f + (float)(0.08 * veriumDoomStacks), 40);
|
||||
//GeneralParticleHandler.SpawnParticle(boop);
|
||||
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/NPCHit/CryogenHit", 3) { Volume = 0.6f }, npc.Center);
|
||||
Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), 100 + (15 * veriumDoomStacks), 0, Main.myPlayer, 200f);
|
||||
Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ProjectileType<DirectStrike>(), 100 + (15 * veriumDoomStacks), 0, Main.myPlayer, 200f);
|
||||
|
||||
veriumDoomMarked = false;
|
||||
veriumDoomStacks = 0;
|
||||
@@ -5323,10 +5332,43 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
|
||||
if (!CalamityPlayer.areThereAnyDamnBosses && !CalamityLists.enemyImmunityList.Contains(npc.type))
|
||||
if (pearlAura > 0)
|
||||
{
|
||||
if (pearlAura > 0)
|
||||
npc.velocity *= 0.9f;
|
||||
// Slow the enemy
|
||||
npc.velocity *= 0.9f;
|
||||
|
||||
// Spawn pearl shards on a counter
|
||||
if (pearlAuraCounter % 12 == 0)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item49, Main.LocalPlayer.Center);
|
||||
Vector2 shardVel = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 7.5f;
|
||||
int damage = 20;
|
||||
Projectile.NewProjectile(npc.GetSource_FromThis(), Main.LocalPlayer.Center, shardVel, ProjectileType<PearlAuraShard>(), damage, 5f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
if (shocked > 0 || transformerShocked > 0)
|
||||
{
|
||||
var player = Main.LocalPlayer;
|
||||
bool strongerShock = transformerShocked > 0;
|
||||
|
||||
int frequency = strongerShock ? 10 : 12;
|
||||
|
||||
// Spawn sparks from the enemy
|
||||
if (player.miscCounter % frequency == 0)
|
||||
{
|
||||
int sDamage = strongerShock ? 50 : 10;
|
||||
Vector2 velocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 5f;
|
||||
Projectile spark = Projectile.NewProjectileDirect(npc.GetSource_FromThis(), npc.Center, velocity, ProjectileType<GenericElectricSpark>(), sDamage, 0f, player.whoAmI, 0f, 1f);
|
||||
spark.timeLeft = 120;
|
||||
spark.penetrate = 3;
|
||||
if (strongerShock)
|
||||
{
|
||||
spark.timeLeft = 240;
|
||||
spark.extraUpdates = 1;
|
||||
spark.penetrate = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Auric Ore/Repulsers reject Town NPCs and dummies (Auric Land Mines work on them too)
|
||||
@@ -5391,7 +5433,7 @@ namespace CalamityMod.NPCs
|
||||
SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates());
|
||||
GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AuricLandMineExplosion>(), 40000, 0f);
|
||||
Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ProjectileType<AuricLandMineExplosion>(), 40000, 0f);
|
||||
WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true);
|
||||
continue;
|
||||
}
|
||||
@@ -5413,7 +5455,7 @@ namespace CalamityMod.NPCs
|
||||
if (tile.TileType == auricOreID)
|
||||
{
|
||||
npc.SimpleStrikeNPC((int)(npc.lifeMax * 0.2f), 0);
|
||||
npc.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
|
||||
npc.AddBuff(BuffType<AuricRebuke>(), 120);
|
||||
}
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), npc.Center);
|
||||
break;
|
||||
@@ -5431,6 +5473,14 @@ namespace CalamityMod.NPCs
|
||||
if (target.Calamity().sulphurSet)
|
||||
npc.AddBuff(BuffID.Poisoned, 60);
|
||||
|
||||
if (target.Calamity().aSpark)
|
||||
{
|
||||
if (target.Calamity().transformer)
|
||||
transformerShocked = 120;
|
||||
else
|
||||
shocked = 120;
|
||||
}
|
||||
|
||||
if (target.Calamity().snowman)
|
||||
{
|
||||
if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil)
|
||||
@@ -5870,7 +5920,7 @@ namespace CalamityMod.NPCs
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC nPC = Main.npc[i];
|
||||
if (nPC.active && nPC.type == ModContent.NPCType<SkeletronPrime2>() && nPC.life > 0)
|
||||
if (nPC.active && nPC.type == NPCType<SkeletronPrime2>() && nPC.life > 0)
|
||||
{
|
||||
nPC.life = 0;
|
||||
nPC.HitEffect();
|
||||
@@ -5935,7 +5985,7 @@ namespace CalamityMod.NPCs
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType<PlanterasFreeTentacle>());
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), NPCType<PlanterasFreeTentacle>());
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -6477,7 +6527,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>())
|
||||
if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType<SkeletronPrime2>())
|
||||
npc.frameCounter = 0D;
|
||||
}
|
||||
}
|
||||
@@ -6541,6 +6591,9 @@ namespace CalamityMod.NPCs
|
||||
if (nightwither > 0)
|
||||
Nightwither.DrawEffects(npc, ref drawColor);
|
||||
|
||||
if (pearlAura > 0)
|
||||
PearlAura.DrawEffects(npc, ref drawColor);
|
||||
|
||||
if (voidfrost > 0)
|
||||
Voidfrost.DrawEffects(npc, ref drawColor);
|
||||
|
||||
@@ -6692,7 +6745,7 @@ namespace CalamityMod.NPCs
|
||||
drawColor = Color.Fuchsia;
|
||||
|
||||
else if (pearlAura > 0)
|
||||
drawColor = Color.White;
|
||||
drawColor = new Color(185, 185, 255);
|
||||
|
||||
else if (timeSlow > 0 || tesla > 0)
|
||||
drawColor = Color.Aquamarine;
|
||||
@@ -6708,7 +6761,7 @@ namespace CalamityMod.NPCs
|
||||
return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR);
|
||||
|
||||
if (npc.type == NPCID.KingSlime && Main.masterMode && CalamityWorld.revenge)
|
||||
return NPC.AnyNPCs(ModContent.NPCType<KingSlimeJewelSapphire>()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null;
|
||||
return NPC.AnyNPCs(NPCType<KingSlimeJewelSapphire>()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null;
|
||||
|
||||
if (npc.type == NPCID.QueenBee && Main.zenithWorld)
|
||||
{
|
||||
@@ -6907,7 +6960,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>() || CalamityLists.DestroyerIDs.Contains(npc.type))
|
||||
if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType<SkeletronPrime2>() || CalamityLists.DestroyerIDs.Contains(npc.type))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7681,7 +7734,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
// His afterimages I can't get to work, so fuck it
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>())
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType<SkeletronPrime2>())
|
||||
{
|
||||
Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value;
|
||||
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
|
||||
|
||||
@@ -465,6 +465,11 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.TheGroom:
|
||||
npcLoot.Add(ModContent.ItemType<BloodOrb>(), 10);
|
||||
break;
|
||||
|
||||
// Ghost Bracelet @ 10% (Dandy requests this drops at a "high chance" but inventory clutter is real so)
|
||||
case NPCID.Ghost:
|
||||
npcLoot.Add(ModContent.ItemType<GhostBracelet>(), 10);
|
||||
break;
|
||||
#endregion
|
||||
|
||||
#region Blood Moon
|
||||
|
||||
@@ -170,6 +170,7 @@ namespace CalamityMod.NPCs
|
||||
"Cap'n Deek", // "Alex N" on Patreon (No discord account)
|
||||
"Captain Billy Bones", // <@!699589229507772416> (djackv)
|
||||
"Captain J. Crackers", // <@!233232602994049024> (qyuuno)
|
||||
"Gol D. Roger", // <@!256228859110752257> (xtra3678)
|
||||
};
|
||||
private static readonly string[] PrincessNames =
|
||||
{
|
||||
@@ -1000,7 +1001,7 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
case NPCID.Wizard:
|
||||
if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ModContent.ItemType<NormalityRelocator>()) && !Main.LocalPlayer.ZoneHallow)
|
||||
if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ItemType<NormalityRelocator>()) && !Main.LocalPlayer.ZoneHallow)
|
||||
chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.MentionRoD");
|
||||
if (Main.rand.NextBool(10) && Main.hardMode)
|
||||
chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.Hardmode");
|
||||
@@ -1070,7 +1071,7 @@ namespace CalamityMod.NPCs
|
||||
public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile)
|
||||
{
|
||||
//Not an axe but close enough
|
||||
if (npc.type == NPCID.TaxCollector && projectile.type == ModContent.ProjectileType<SlickCaneProjectile>())
|
||||
if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType<SlickCaneProjectile>())
|
||||
return true;
|
||||
return base.CanBeHitByProjectile(npc, projectile);
|
||||
}
|
||||
@@ -1115,7 +1116,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (type == NPCID.Demolitionist)
|
||||
{
|
||||
shop.Add(ModContent.ItemType<DeepcoreGK2>(), Condition.DownedMechBossAny);
|
||||
shop.Add(ItemType<DeepcoreGK2>(), Condition.DownedMechBossAny);
|
||||
}
|
||||
|
||||
if (type == NPCID.ArmsDealer)
|
||||
|
||||
@@ -94,11 +94,11 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(NPC.dontTakeDamage);
|
||||
writer.Write(playedbuildsound);
|
||||
writer.Write(NPC.localAI[0]);
|
||||
writer.Write(NPC.localAI[1]);
|
||||
writer.Write(NPC.localAI[2]);
|
||||
writer.Write(NPC.localAI[3]);
|
||||
writer.Write(playedbuildsound);
|
||||
for (int i = 0; i < 4; i++)
|
||||
writer.Write(NPC.Calamity().newAI[i]);
|
||||
}
|
||||
|
||||
@@ -155,6 +155,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
writer.Write(biomeEnrageTimer);
|
||||
writer.Write(teleportLocationX);
|
||||
writer.Write(NPC.dontTakeDamage);
|
||||
writer.Write(NPC.localAI[1]);
|
||||
for (int i = 0; i < 4; i++)
|
||||
writer.Write(NPC.Calamity().newAI[i]);
|
||||
}
|
||||
@@ -164,6 +165,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
biomeEnrageTimer = reader.ReadInt32();
|
||||
teleportLocationX = reader.ReadInt32();
|
||||
NPC.dontTakeDamage = reader.ReadBoolean();
|
||||
NPC.localAI[1] = reader.ReadSingle();
|
||||
for (int i = 0; i < 4; i++)
|
||||
NPC.Calamity().newAI[i] = reader.ReadSingle();
|
||||
}
|
||||
@@ -236,15 +238,18 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if ((int)NPC.ai[0] + 1 > currentPhase)
|
||||
HandlePhaseTransition((int)NPC.ai[0] + 1);
|
||||
|
||||
if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (NPC.ai[0] < 3f || bossRush || (death && NPC.ai[0] > 3f))) //spawn shield for phase 0 1 2, not 3 4 5
|
||||
if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f)
|
||||
{
|
||||
NPC.localAI[1] = 1f;
|
||||
SoundEngine.PlaySound(ShieldRegenSound, NPC.Center);
|
||||
int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenShield>(), NPC.whoAmI);
|
||||
NPC.ai[2] = shieldSpawn + 1;
|
||||
NPC.localAI[1] = -1f;
|
||||
NPC.netUpdate = true;
|
||||
Main.npc[shieldSpawn].ai[0] = NPC.whoAmI;
|
||||
Main.npc[shieldSpawn].netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenShield>(), NPC.whoAmI);
|
||||
NPC.ai[2] = shieldSpawn + 1;
|
||||
NPC.netUpdate = true;
|
||||
Main.npc[shieldSpawn].ai[0] = NPC.whoAmI;
|
||||
Main.npc[shieldSpawn].netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
int shieldTracker = (int)NPC.ai[2] - 1;
|
||||
@@ -256,11 +261,6 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
NPC.dontTakeDamage = false;
|
||||
NPC.ai[2] = 0f;
|
||||
|
||||
if (NPC.localAI[1] == -1f)
|
||||
NPC.localAI[1] = death ? 540f : expertMode ? 720f : 1080f;
|
||||
if (NPC.localAI[1] > 0f)
|
||||
NPC.localAI[1] -= 1f;
|
||||
}
|
||||
|
||||
if (CalamityConfig.Instance.BossesStopWeather)
|
||||
@@ -428,6 +428,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
NPC.ai[0] = 1f;
|
||||
NPC.localAI[0] = 0f;
|
||||
NPC.netUpdate = true;
|
||||
|
||||
SoundEngine.PlaySound(ShieldRegenSound, NPC.Center);
|
||||
if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenShield>(), NPC.whoAmI);
|
||||
NPC.ai[2] = shieldSpawn + 1;
|
||||
Main.npc[shieldSpawn].ai[0] = NPC.whoAmI;
|
||||
Main.npc[shieldSpawn].netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NPC.ai[0] == 1f)
|
||||
@@ -617,6 +626,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
calamityGlobalNPC.newAI[0] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
NPC.netUpdate = true;
|
||||
|
||||
SoundEngine.PlaySound(ShieldRegenSound, NPC.Center);
|
||||
if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenShield>(), NPC.whoAmI);
|
||||
NPC.ai[2] = shieldSpawn + 1;
|
||||
Main.npc[shieldSpawn].ai[0] = NPC.whoAmI;
|
||||
Main.npc[shieldSpawn].netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NPC.ai[0] == 2f)
|
||||
@@ -968,6 +986,18 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
NPC.netUpdate = true;
|
||||
|
||||
if (death)
|
||||
{
|
||||
SoundEngine.PlaySound(ShieldRegenSound, NPC.Center);
|
||||
if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenShield>(), NPC.whoAmI);
|
||||
NPC.ai[2] = shieldSpawn + 1;
|
||||
Main.npc[shieldSpawn].ai[0] = NPC.whoAmI;
|
||||
Main.npc[shieldSpawn].netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
int chance = 100;
|
||||
if (DateTime.Now.Month == 4 && DateTime.Now.Day == 1)
|
||||
chance = 20;
|
||||
|
||||
@@ -32,11 +32,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
NPC.height = 216;
|
||||
NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f;
|
||||
NPC.DR_NERD(0.4f);
|
||||
NPC.lifeMax = CalamityWorld.death ? 700 : 1400;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
NPC.lifeMax = 10000;
|
||||
}
|
||||
NPC.LifeMaxNERB(2800, 3360, 33600);
|
||||
NPC.Opacity = 0f;
|
||||
NPC.HitSound = Cryogen.HitSound;
|
||||
NPC.DeathSound = BreakSound;
|
||||
|
||||
@@ -574,7 +574,6 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
// Equipment
|
||||
npcLoot.Add(ModContent.ItemType<GiantPearl>(), 3);
|
||||
npcLoot.Add(ModContent.ItemType<AmidiasPendant>(), 3);
|
||||
|
||||
// Trophy
|
||||
npcLoot.Add(ModContent.ItemType<GiantClamTrophy>(), 10);
|
||||
|
||||
@@ -206,6 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float distanceFromSCal = Main.getGoodWorld ? 300f : 225f;
|
||||
NPC.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * distanceFromSCal - NPC.Size * 0.5f;
|
||||
NPC.velocity = Vector2.Zero;
|
||||
RotationalDegreeOffset += 0.5f;
|
||||
}
|
||||
|
||||
|
||||
@@ -622,8 +622,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f);
|
||||
if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : 52f) : 26f))
|
||||
{
|
||||
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 (canHit || !spazAlive || finalPhase)
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float retinazerPhase2LaserSpeed = 10f;
|
||||
@@ -648,16 +647,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
retinazerPhase2TargetY *= retinazerPhase2TargetDist;
|
||||
|
||||
Vector2 laserVelocity = new Vector2(retinazerPhase2TargetX, retinazerPhase2TargetY);
|
||||
if (canHit)
|
||||
{
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -728,8 +718,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f);
|
||||
if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : 20f) : 10f))
|
||||
{
|
||||
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 (canHit || !spazAlive || finalPhase)
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
int type = ProjectileID.DeathLaser;
|
||||
@@ -752,16 +741,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
retinazerPhase2RapidFireTargetY *= retinazerPhase2RapidFireTargetDist;
|
||||
|
||||
Vector2 laserVelocity = new Vector2(retinazerPhase2RapidFireTargetX, retinazerPhase2RapidFireTargetY);
|
||||
if (canHit)
|
||||
{
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -769,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.ai[2] += spazAlive ? 1f : 1.5f;
|
||||
if (npc.ai[2] >= (masterMode ? 150f : 180f) - (death ? (masterMode ? 60f : 90f) * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f))
|
||||
{
|
||||
npc.ai[1] = (!spazAlive || finalPhase) ? 4f : 0f;
|
||||
npc.ai[1] = finalPhase ? 4f : 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
@@ -1103,7 +1083,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Phase HP ratios
|
||||
float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f;
|
||||
float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f;
|
||||
float finalPhaseLifeRatio = masterMode ? 0.3f : 0.15f;
|
||||
|
||||
// Movement variables
|
||||
float phase1MaxSpeedIncrease = masterMode ? 2.25f : 4.5f;
|
||||
@@ -1576,15 +1556,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float phaseGateValue = NPC.IsMechQueenUp ? 900f : 180f - (death ? 60f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
if (npc.ai[2] >= phaseGateValue)
|
||||
{
|
||||
npc.ai[1] = (!retAlive || finalPhase) ? 5f : 1f;
|
||||
npc.ai[1] = finalPhase ? 5f : 1f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
// Fire fireballs and flamethrower
|
||||
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 (canHit || !retAlive || finalPhase)
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
// Play flame sound on timer
|
||||
npc.localAI[2] += 1f;
|
||||
@@ -1642,20 +1621,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
|
||||
Vector2 flamethrowerVelocity = new Vector2(spazmatismFlamethrowerTargetX, spazmatismFlamethrowerTargetY);
|
||||
if (canHit)
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer);
|
||||
if (masterMode && npc.ai[3] % 30f == 0f)
|
||||
{
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer);
|
||||
if (masterMode && npc.ai[3] % 30f == 0f)
|
||||
{
|
||||
type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType<ShadowflameFireball>() : ProjectileID.CursedFlameHostile;
|
||||
damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType<ShadowflameFireball>() : ProjectileID.CursedFlameHostile;
|
||||
damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,12 @@ namespace CalamityMod.Particles
|
||||
private string NewTexture;
|
||||
private float OriginalScale;
|
||||
private float FinalScale;
|
||||
private float BaseOpacity;
|
||||
private float opacity;
|
||||
private Vector2 Squish;
|
||||
private Color BaseColor;
|
||||
|
||||
public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true)
|
||||
public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true, float baseOpacity = 1f)
|
||||
{
|
||||
Position = position;
|
||||
Velocity = velocity;
|
||||
@@ -32,6 +33,7 @@ namespace CalamityMod.Particles
|
||||
FinalScale = finalScale;
|
||||
Scale = originalScale;
|
||||
Lifetime = lifeTime;
|
||||
BaseOpacity = baseOpacity;
|
||||
Squish = squish;
|
||||
Rotation = rotation;
|
||||
UseAltVisual = UseAdditiveBlend;
|
||||
@@ -42,7 +44,7 @@ namespace CalamityMod.Particles
|
||||
float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) });
|
||||
Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress);
|
||||
|
||||
opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2);
|
||||
opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2) * BaseOpacity;
|
||||
|
||||
Color = BaseColor * opacity;
|
||||
Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace CalamityMod.Particles
|
||||
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
|
||||
if (glowCenter)
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.5f, 0.5f), 0, 0f);
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut * 0.7f, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.9f, 0.9f), 0, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,26 +13,75 @@ namespace CalamityMod.Particles
|
||||
public override bool UseCustomDraw => true;
|
||||
public override bool SetLifetime => true;
|
||||
|
||||
public Vector2 Squish;
|
||||
public float ShakePower;
|
||||
public float Opacity;
|
||||
public Projectile AttachedProjectile;
|
||||
public float DisplacementFromProjectile;
|
||||
/// <summary>
|
||||
/// The function that decides to follow a specific <see cref="Vector2"/>.
|
||||
/// </summary>
|
||||
public Func<Vector2> FollowFunction;
|
||||
|
||||
public ThunderBoltVFX(Vector2 position, Color color, float rotation, float scale, Vector2 squish, float opacity = 1f, float shakePower = 20f, Projectile projectileToFollow = null, float displacementFromProjectile = 0f)
|
||||
/// <summary>
|
||||
/// The opacity of this particle, can only go from 0 to 1.<br/>
|
||||
/// Defaults to 1.
|
||||
/// </summary>
|
||||
public float Opacity
|
||||
{
|
||||
get => opacity;
|
||||
set => opacity = Math.Clamp(value, 0f, 1f);
|
||||
}
|
||||
private float opacity = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of shaking this particle will have.<br/>
|
||||
/// Will always be positive.<br/>
|
||||
/// Defaults to 0.
|
||||
/// </summary>
|
||||
public float ShakePower
|
||||
{
|
||||
get => shakePower;
|
||||
set => shakePower = Math.Abs(value);
|
||||
}
|
||||
private float shakePower;
|
||||
|
||||
/// <summary>
|
||||
/// The squish of this particle, how much is streched, widened, distorted, etc.<br/>
|
||||
/// For standard purposes, it defaults to <see cref="Vector2.One"/>.
|
||||
/// </summary>
|
||||
public Vector2 Squish = Vector2.One;
|
||||
|
||||
/// <summary>
|
||||
/// A constructor that spawns a particle that does not move from where it spawns.
|
||||
/// </summary>
|
||||
public ThunderBoltVFX(Vector2 position, float rotation, float scale, Color color, int lifeTime, float shakePower, float opacity = 1f, Vector2? squish = null)
|
||||
{
|
||||
Position = position;
|
||||
Velocity = Vector2.Zero;
|
||||
Color = color;
|
||||
Scale = scale;
|
||||
Squish = squish;
|
||||
Rotation = rotation;
|
||||
Scale = scale;
|
||||
Color = color;
|
||||
Opacity = opacity;
|
||||
Lifetime = lifeTime;
|
||||
ShakePower = shakePower;
|
||||
if (projectileToFollow != null)
|
||||
AttachedProjectile = projectileToFollow;
|
||||
DisplacementFromProjectile = displacementFromProjectile;
|
||||
Lifetime = 30;
|
||||
if (squish != null)
|
||||
Squish = (Vector2)squish;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A constructor that spawns a particle that follows a specific <see cref="Vector2"/>.<br/>
|
||||
/// For simple one-line positions, you can just write in the argument, for example:<br/>
|
||||
/// <br/>
|
||||
/// <code>() => Projectile.Center</code>
|
||||
/// For more complicated logic to decide which <see cref="Vector2"/> it should follow,<br/>
|
||||
/// you'd just make your own function which returns a <see cref="Vector2"/> and give it as an argument.
|
||||
/// </summary>
|
||||
public ThunderBoltVFX(Func<Vector2> followFunction, float rotation, float scale, Color color, int lifeTime, float shakePower, float opacity = 1f, Vector2? squish = null)
|
||||
{
|
||||
FollowFunction = followFunction;
|
||||
Rotation = rotation;
|
||||
Scale = scale;
|
||||
Color = color;
|
||||
Opacity = opacity;
|
||||
Lifetime = lifeTime;
|
||||
ShakePower = shakePower;
|
||||
if (squish != null)
|
||||
Squish = (Vector2)squish;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
@@ -40,9 +90,7 @@ namespace CalamityMod.Particles
|
||||
float fadeFactor = 1f - 0.05f * MathHelper.Clamp((Time - 10) / 10f, 0f, 1f);
|
||||
Opacity *= fadeFactor;
|
||||
Squish.X *= fadeFactor;
|
||||
|
||||
if (AttachedProjectile != null && AttachedProjectile.active)
|
||||
Position = AttachedProjectile.Center + Vector2.UnitY * DisplacementFromProjectile;
|
||||
if (FollowFunction is not null) Position = FollowFunction.Invoke();
|
||||
}
|
||||
|
||||
public override void CustomDraw(SpriteBatch spriteBatch)
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 80;
|
||||
Projectile.height = 80;
|
||||
Projectile.width = 32;
|
||||
Projectile.height = 32;
|
||||
Projectile.hostile = true;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.penetrate = -1;
|
||||
@@ -76,6 +76,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (Projectile.localAI[0] % 4 == 0)
|
||||
Projectile.frameCounter++;
|
||||
|
||||
Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * Math.PI / timeBeforeVanish) * 10f * projScale;
|
||||
if (Projectile.scale > projScale)
|
||||
@@ -129,43 +131,47 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (Projectile.velocity == Vector2.Zero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
|
||||
Texture2D texture2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/BirbAuraStart", AssetRequestMode.ImmediateLoad).Value;
|
||||
Texture2D texture3 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/BirbAuraEnd", AssetRequestMode.ImmediateLoad).Value;
|
||||
float auraDrawLength = Projectile.localAI[1]; //length of laser
|
||||
|
||||
Texture2D middleTex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
|
||||
Texture2D endpointTex = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/BirbAuraEndpoints", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
// Used to track the animation of the segments
|
||||
int middleFrame = Projectile.frameCounter % 12;
|
||||
int endpointFrame = Projectile.frameCounter % 3;
|
||||
float auraDrawLength = Projectile.localAI[1]; // Length of the laser
|
||||
Color grayColor = new Color(128, 128, 128, 0);
|
||||
Vector2 vector = Projectile.Center - Main.screenPosition;
|
||||
Rectangle? sourceRectangle2 = null;
|
||||
Main.EntitySpriteDraw(texture2, vector, sourceRectangle2, grayColor, Projectile.rotation, texture2.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
auraDrawLength -= (texture2.Height / 2 + texture3.Height) * Projectile.scale;
|
||||
|
||||
// Draw the bottom endpoint segment
|
||||
Rectangle? sourceRectangle2 = endpointTex.Frame(1, 3, 0, endpointFrame);
|
||||
Vector2 endPosition = Projectile.Center - Main.screenPosition - new Vector2(0f, 22f); // Of course it's 22, this stupid fucking accursed number
|
||||
Main.EntitySpriteDraw(endpointTex, endPosition, sourceRectangle2, grayColor, Projectile.rotation, endpointTex.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0);
|
||||
|
||||
// Draw the middle segments
|
||||
auraDrawLength -= (endpointTex.Height / 2 + endpointTex.Height) * Projectile.scale;
|
||||
Vector2 projCenter = Projectile.Center;
|
||||
projCenter += Projectile.velocity * Projectile.scale * texture2.Height / 2f;
|
||||
if (auraDrawLength > 0f)
|
||||
projCenter += Projectile.velocity * Projectile.scale * endpointTex.Height / 2f;
|
||||
if (auraDrawLength > 0f) // Only draw a middle segment if there's enough height for one
|
||||
{
|
||||
float auraSegment = 0f;
|
||||
Rectangle drawRectangle = new Rectangle(0, 0, texture.Width, texture.Height);
|
||||
Rectangle drawRectangle = middleTex.Frame(12, 1, middleFrame, 0);
|
||||
while (auraSegment + 1f < auraDrawLength)
|
||||
{
|
||||
if (auraDrawLength - auraSegment < drawRectangle.Height)
|
||||
{
|
||||
drawRectangle.Height = (int)(auraDrawLength - auraSegment);
|
||||
}
|
||||
Main.EntitySpriteDraw(texture, projCenter - Main.screenPosition, new Rectangle?(drawRectangle), grayColor, Projectile.rotation, new Vector2(drawRectangle.Width / 2, 0f), Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(middleTex, projCenter - Main.screenPosition, new Rectangle?(drawRectangle), grayColor, Projectile.rotation, new Vector2(drawRectangle.Width / 2, 0f), Projectile.scale, SpriteEffects.None, 0);
|
||||
auraSegment += drawRectangle.Height * Projectile.scale;
|
||||
projCenter += Projectile.velocity * drawRectangle.Height * Projectile.scale;
|
||||
drawRectangle.Y += texture.Height;
|
||||
if (drawRectangle.Y + drawRectangle.Height > texture.Height)
|
||||
drawRectangle.Y += middleTex.Height;
|
||||
if (drawRectangle.Y + drawRectangle.Height > middleTex.Height)
|
||||
{
|
||||
drawRectangle.Y = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector2 vector2 = projCenter - Main.screenPosition;
|
||||
sourceRectangle2 = null;
|
||||
Main.EntitySpriteDraw(texture3, vector2, sourceRectangle2, grayColor, Projectile.rotation, texture3.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0);
|
||||
// There is intentionally no top endpoint segment drawn
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 11 KiB |
@@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public override void AI()
|
||||
{
|
||||
// Cal Clone bullet hell projectiles accelerate after a certain time has passed
|
||||
if (Projectile.ai[0] == 2f && Main.expertMode && Projectile.timeLeft < 1260)
|
||||
if (Projectile.ai[0] == 2f && (Main.expertMode || BossRushEvent.BossRushActive) && Projectile.timeLeft < 1260)
|
||||
{
|
||||
if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 15f : 10f))
|
||||
if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 12.5f : 10f))
|
||||
Projectile.velocity *= 1.005f;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Buffs;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Dusts;
|
||||
@@ -2670,7 +2671,7 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
int totalProjectiles = masterMode ? 12 : 8;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int type = ModContent.ProjectileType<ThornBallSpike>();
|
||||
int type = ProjectileType<ThornBallSpike>();
|
||||
float velocity = 1f;
|
||||
Vector2 spinningPoint = new Vector2(0f, -velocity);
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
@@ -3639,7 +3640,7 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
if (!projectile.npcProj && !projectile.trap && projectile.friendly && projectile.damage > 0)
|
||||
{
|
||||
if (modPlayer.fungalSymbiote && CalamityLists.MushroomProjectileIDs.Contains(projectile.type))
|
||||
if (modPlayer.fungalSymbiote && player.HasBuff(BuffType<Mushy>()))
|
||||
{
|
||||
if (Main.player[projectile.owner].miscCounter % 6 == 0 && projectile.FinalExtraUpdate())
|
||||
{
|
||||
@@ -3810,7 +3811,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
break;
|
||||
case CalamityGlobalBuff.ModdedFlaskEnchant:
|
||||
int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType<BrimstoneFlame>()) : (Main.rand.NextBool() ? 121 : DustID.Stone);
|
||||
int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType<BrimstoneFlame>()) : (Main.rand.NextBool() ? 121 : DustID.Stone);
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f));
|
||||
@@ -3830,7 +3831,7 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
if ((player.Calamity().flaskBrimstone || player.Calamity().flaskCrumbling || player.Calamity().flaskHoly) && !projectile.noEnchantments && !projectile.noEnchantmentVisuals)
|
||||
{
|
||||
int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType<BrimstoneFlame>()) : (Main.rand.NextBool() ? 121 : DustID.Stone);
|
||||
int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType<BrimstoneFlame>()) : (Main.rand.NextBool() ? 121 : DustID.Stone);
|
||||
if (Main.rand.NextBool(player.Calamity().flaskCrumbling ? 5 : 4))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f));
|
||||
@@ -3897,7 +3898,7 @@ namespace CalamityMod.Projectiles
|
||||
PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : ModContent.DustType<BrimstoneFlame>(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f));
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : DustType<BrimstoneFlame>(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.5f, 1f);
|
||||
}
|
||||
@@ -4805,7 +4806,7 @@ namespace CalamityMod.Projectiles
|
||||
int beeType = Main.rand.Next(NPCID.Bee, NPCID.BeeSmall + 1);
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
beeType = Main.rand.NextBool(3) ? ModContent.NPCType<PlagueChargerLarge>() : ModContent.NPCType<PlagueCharger>();
|
||||
beeType = Main.rand.NextBool(3) ? NPCType<PlagueChargerLarge>() : NPCType<PlagueCharger>();
|
||||
}
|
||||
else if (Main.masterMode || BossRushEvent.BossRushActive)
|
||||
{
|
||||
|
||||
@@ -35,13 +35,15 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Play a sound upon spawning
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(BrimstoneElemental.DartSound, Projectile.Center);
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
|
||||
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < (Projectile.ai[1] == 1f ? 12f : 16f))
|
||||
// Accelerate over time
|
||||
if ((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 16f) && Projectile.ai[1] != 1f)
|
||||
{
|
||||
Projectile.velocity *= 1.01f;
|
||||
}
|
||||
@@ -57,6 +59,30 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.frame = 0;
|
||||
}
|
||||
Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f);
|
||||
|
||||
// Seething Discharge darts have weak homing capabilities
|
||||
if (Projectile.ai[1] == 1f && Projectile.timeLeft < 585)
|
||||
{
|
||||
float npcDistCompare = 480f;
|
||||
int index = -1;
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
if (!n.CanBeChasedBy(Projectile, false))
|
||||
continue;
|
||||
|
||||
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
|
||||
if (currentNPCDist < npcDistCompare)
|
||||
{
|
||||
npcDistCompare = currentNPCDist;
|
||||
index = n.whoAmI;
|
||||
}
|
||||
}
|
||||
if (index != -1)
|
||||
{
|
||||
float homingStrength = Main.rand.NextFloat(0.075f, 0.085f);
|
||||
Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Main.npc[index].Center).ToRotation(), homingStrength).ToRotationVector2() * 12f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.DamageType = DamageClass.Magic;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.penetrate = 4;
|
||||
Projectile.penetrate = 3;
|
||||
Projectile.timeLeft = 255;
|
||||
Projectile.alpha = 0;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 10;
|
||||
Projectile.localNPCHitCooldown = 20;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -61,8 +61,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(damageMultiplier);
|
||||
writer.Write(damageShouldDecay);
|
||||
writer.Write(decayGracePeriod);
|
||||
writer.Write(damageShouldDecay);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
|
||||
@@ -14,13 +14,11 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
Main.projFrames[Projectile.type] = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 46;
|
||||
Projectile.height = 36;
|
||||
Projectile.width = Projectile.height = 24;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = DamageClass.Melee;
|
||||
Projectile.penetrate = 1;
|
||||
@@ -46,15 +44,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.alpha = 0;
|
||||
}
|
||||
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 6)
|
||||
{
|
||||
Projectile.frame++;
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
if (Projectile.frame > 4)
|
||||
Projectile.frame = 0;
|
||||
|
||||
if (Projectile.ai[0] >= 0f && Projectile.ai[0] < 200f)
|
||||
{
|
||||
int npcTracker = (int)Projectile.ai[0];
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 549 B |
@@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public class BladecrestOathswordProj : BaseIdleHoldoutProjectile
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<BladecrestOathsword>();
|
||||
public enum SwingState
|
||||
public enum SwingState : byte
|
||||
{
|
||||
Default,
|
||||
Swinging
|
||||
@@ -57,14 +57,14 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
writer.Write(Direction);
|
||||
writer.Write(PostSwingRepositionDelay);
|
||||
writer.Write((int)CurrentState);
|
||||
writer.Write((byte)CurrentState);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
Direction = reader.ReadInt32();
|
||||
PostSwingRepositionDelay = reader.ReadSingle();
|
||||
CurrentState = (SwingState)reader.ReadInt32();
|
||||
CurrentState = (SwingState)reader.ReadByte();
|
||||
}
|
||||
|
||||
public override void SafeAI()
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
using System;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.NPCs.PrimordialWyrm;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -23,7 +19,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<Earth>();
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/Earth";
|
||||
public override float HitboxOutset => 105;
|
||||
public override float HitboxOutset => 135;
|
||||
|
||||
public override Vector2 HitboxSize => new Vector2(255, 255);
|
||||
public override float HitboxRotationOffset => MathHelper.ToRadians(-45);
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.NPCs.PrimordialWyrm;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -154,9 +155,21 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
if (CanHit)
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 19, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.Gold : Color.Goldenrod));
|
||||
if (Main.rand.NextBool(4))
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Color.Black, false, false, false));
|
||||
else
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue));
|
||||
}
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
float randRot = Main.rand.NextFloat(-30, -60);
|
||||
Vector2 dustVel = (new Vector2(0, 15 * -Projectile.ai[1] * Owner.direction)).RotatedBy(FinalRotation + MathHelper.ToRadians(randRot));
|
||||
Dust dust2 = Dust.NewDustPerfect(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), 278, dustVel * Main.rand.NextFloat(0.1f, 0.5f));
|
||||
dust2.scale = Main.rand.NextFloat(0.45f, 0.95f);
|
||||
dust2.noGravity = true;
|
||||
dust2.color = Main.rand.NextBool(3) ? Color.Goldenrod : Color.Gold;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,9 +265,9 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Color auraColor = Color.Lerp(Color.DarkGoldenrod, Color.Gold, Utils.GetLerpValue(0, 5, i)) * 0.5f * fadeIn;
|
||||
Color auraColor = Color.Lerp(Color.Goldenrod, Color.Gold, Utils.GetLerpValue(0, 5, i)) * 0.5f * fadeIn;
|
||||
Texture2D centerTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/GrandDadGhost").Value;
|
||||
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 17f).ToRotationVector2();
|
||||
rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 4f) * 0.5f + 1.5f);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public class OldLordClaymoreProj : BaseIdleHoldoutProjectile
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<OldLordClaymore>();
|
||||
public enum SwingState
|
||||
public enum SwingState : byte
|
||||
{
|
||||
Default,
|
||||
Swinging,
|
||||
@@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
writer.Write(Direction);
|
||||
writer.Write(PostSwingRepositionDelay);
|
||||
writer.Write(ChargePower);
|
||||
writer.Write((int)CurrentState);
|
||||
writer.Write((byte)CurrentState);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
@@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Direction = reader.ReadInt32();
|
||||
PostSwingRepositionDelay = reader.ReadSingle();
|
||||
ChargePower = reader.ReadSingle();
|
||||
CurrentState = (SwingState)reader.ReadInt32();
|
||||
CurrentState = (SwingState)reader.ReadByte();
|
||||
}
|
||||
|
||||
public override void SafeAI()
|
||||
|
||||
@@ -161,7 +161,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
//Chunger
|
||||
var Sound = SoundEngine.PlaySound(CommonCalamitySounds.LightningSound with { Volume = CommonCalamitySounds.LightningSound.Volume * 0.4f }, Projectile.Center);
|
||||
|
||||
Particle thunder = new ThunderBoltVFX(Projectile.Center + Vector2.UnitY * 20f, Main.rand.NextBool() ? Main.rand.NextBool() ? Color.Goldenrod : Color.GreenYellow : Main.rand.NextBool() ? Color.Cyan : Color.Magenta, 0f, 1.5f, Vector2.One, 1f, 15f, Projectile, 20f);
|
||||
Particle thunder = new ThunderBoltVFX(
|
||||
() => Projectile.Center + Vector2.UnitY * 20f,
|
||||
0f,
|
||||
1.5f,
|
||||
Main.rand.NextBool() ? Main.rand.NextBool() ? Color.Goldenrod : Color.GreenYellow : Main.rand.NextBool() ? Color.Cyan : Color.Magenta,
|
||||
30,
|
||||
15f);
|
||||
GeneralParticleHandler.SpawnParticle(thunder);
|
||||
|
||||
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 5)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -28,8 +29,13 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
private ref float CurrentChargingFrames => ref Projectile.ai[0];
|
||||
private ref float PumpkinsCharge => ref Projectile.ai[1];
|
||||
|
||||
private ref float FramesToLoadNextPumpkin => ref Projectile.localAI[0];
|
||||
|
||||
//This possibly could moved to ai[2] ¯\_(ツ)_/¯
|
||||
private ref float Overfilled => ref Projectile.localAI[1]; //This functionally is a "IsPlayingShootAnim" variable
|
||||
|
||||
private bool IsOverfilled => (Overfilled >= 0.5f);
|
||||
private float angularSpread = MathHelper.ToRadians(15);
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -49,10 +55,10 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f;
|
||||
|
||||
// Unloads all pumpkins if you can't shoot/stop holding out the projectile or if the gun is overfilled
|
||||
if (Owner.CantUseHoldout() || Overfilled == 1f)
|
||||
if (Owner.CantUseHoldout() || IsOverfilled)
|
||||
{
|
||||
|
||||
if (PumpkinsCharge <= 0f && Overfilled == 0f) //If the projectile isnt playing its animation and if there arent any pumpkins loaded, kill it
|
||||
if (PumpkinsCharge <= 0f && !IsOverfilled) //If the projectile isnt playing its animation and if there arent any pumpkins loaded, kill it
|
||||
{
|
||||
Projectile.Kill();
|
||||
return;
|
||||
@@ -68,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
// Shoot anim is done? Remove the shoot anim tag
|
||||
if (Projectile.frame == 0 && Overfilled == 1f)
|
||||
if (Projectile.frame == 0 && IsOverfilled)
|
||||
Overfilled = 0f;
|
||||
//Animation stuff end
|
||||
|
||||
@@ -145,7 +151,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
SmokeBurst(tipPosition);
|
||||
FramesToLoadNextPumpkin = Owner.ActiveItem().useAnimation; //reset the reload time
|
||||
PumpkinsCharge = 0; //Unload the barrel
|
||||
if (!(Overfilled == 1f))
|
||||
if (!IsOverfilled)
|
||||
Overfilled = 1f; //Make the shoot anim play
|
||||
Projectile.frame = 6; //Initialize the animation
|
||||
}
|
||||
@@ -213,7 +219,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Main.spriteBatch.EnterShaderRegion();
|
||||
if (PumpkinsCharge > 0 && Overfilled == 0f)
|
||||
if (PumpkinsCharge > 0 && !IsOverfilled)
|
||||
{
|
||||
GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(MathHelper.Clamp(1f - 0.20f * CurrentChargingFrames - 0.1f * (5f - PumpkinsCharge), 0f, 1f));
|
||||
//tint effect is visible if its charging. The more pumpkins are loaded, the more opacity
|
||||
@@ -240,12 +246,12 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
//netcode hell
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(Overfilled);
|
||||
writer.Write(IsOverfilled);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
Overfilled = reader.ReadInt32();
|
||||
Overfilled = reader.ReadBoolean() ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||