Reworked and moved Phantasmal Ruin, removed Phantom lance
Phantasmal Ruin: Fires a large ghost lance that explodes into spirits on enemy hits Stealth strikes pierce and summon many spirits from the depths on enemy hits
This commit is contained in:
1 parent
5f85495d42
commit
fda6ee93e6
15 files changed
+182
-243
No files matched your search
@@ -237,8 +237,6 @@ namespace CalamityMod.Balancing
|
||||
// 10% resist to Old Reaper.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<ReaperProjectile>()))));
|
||||
|
||||
// 5% resist to Phantasmal Ruin.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.95f, ProjectileType<PhantasmalSoul>(), ProjectileType<PhantasmalRuinProj>(), ProjectileType<PhantasmalRuinGhost>()))));
|
||||
#endregion
|
||||
|
||||
#region Exo Mechs: Ares
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -13,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 955;
|
||||
Item.damage = 120;
|
||||
Item.knockBack = 8f;
|
||||
|
||||
Item.width = 102;
|
||||
@@ -24,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.useTime = 35;
|
||||
Item.useAnimation = 35;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 14.5f;
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shoot = ModContent.ProjectileType<PhantasmalRuinProj>();
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.rare = ModContent.RarityType<PureGreen>();
|
||||
}
|
||||
|
||||
public override float StealthDamageMultiplier => 1.22f;
|
||||
public override float StealthDamageMultiplier => 2.3f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -42,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].penetrate = 3;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -50,10 +52,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<PhantomLance>(500).
|
||||
AddIngredient<RuinousSoul>(4).
|
||||
AddIngredient<Polterplasm>(20).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
AddIngredient(ItemID.SpectreBar, 15).
|
||||
AddIngredient(ItemID.Bone, 35).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class PhantomLance : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 99;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 70;
|
||||
Item.knockBack = 5f;
|
||||
|
||||
Item.width = 62;
|
||||
Item.height = 68;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
|
||||
Item.value = Item.buyPrice(0, 0, 50, 0);
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
Item.useTime = 23;
|
||||
Item.useAnimation = 23;
|
||||
Item.maxStack = 9999;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.consumable = true;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 10f;
|
||||
Item.shoot = ModContent.ProjectileType<PhantomLanceProj>();
|
||||
}
|
||||
|
||||
public override float StealthDamageMultiplier => 1.75f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(150).
|
||||
AddIngredient(ItemID.SpectreBar).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 999 B |
@@ -846,9 +846,8 @@ PhantasmalRuin: {
|
||||
DisplayName: Phantasmal Ruin
|
||||
Tooltip:
|
||||
'''
|
||||
Fires an enormous ghost lance that emits lost souls as it flies
|
||||
Explodes into tormented souls on enemy hits
|
||||
Stealth strikes continuously leave spectral clones in their wake
|
||||
Fires a large ghost lance that explodes into spirits on enemy hits
|
||||
Stealth strikes pierce and summon many spirits from the depths on enemy hits
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -206,10 +206,8 @@ PanSpark.DisplayName: Spark
|
||||
PartisanExplosion.DisplayName: Profaned Explosion
|
||||
PenumbraBomb.DisplayName: Penumbra Bomb
|
||||
PenumbraSoul.DisplayName: Penumbra Soul
|
||||
PhantasmalRuinGhost.DisplayName: Phantasmal Afterimage
|
||||
PhantasmalRuinProj.DisplayName: Phantasmal Ruin
|
||||
PhantasmalSoul.DisplayName: Phantasmal Soul
|
||||
PhantomLanceProj.DisplayName: Phantom Lance
|
||||
PlaguedFuelPackCloud.DisplayName: Plagued Cloud
|
||||
PlaguenadeBee.DisplayName: Plague Bee
|
||||
PlaguenadeProj.DisplayName: Plaguenade
|
||||
@@ -330,4 +328,5 @@ LanceofDestiny.DisplayName: Holy Lance
|
||||
SpearofDestinyStealth.DisplayName: Empowered Holy Lance
|
||||
SpearofDestinyStealthExplosion.DisplayName: Strong Burst
|
||||
RealityRuptureMini.DisplayName: Reality Shard
|
||||
RealityRuptureStealth.DisplayName: Ruptured Reality
|
||||
RealityRuptureStealth.DisplayName: Ruptured Reality
|
||||
PhantasmalSoulBlue.DisplayName: Blue Spirit
|
||||
@@ -1,48 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class PhantasmalRuinGhost : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 30;
|
||||
Projectile.height = 30;
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = 240;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Set the projectile's direction correctly
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
||||
|
||||
// The projectile rapidly fades in as it starts existing
|
||||
if (Projectile.timeLeft >= 207)
|
||||
Projectile.alpha += 6;
|
||||
|
||||
CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 40f);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(100, 200, 255, 100);
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (Projectile.timeLeft > 239)
|
||||
return false;
|
||||
|
||||
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
|
||||
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,5 +1,8 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -9,9 +12,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/PhantasmalRuin";
|
||||
|
||||
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/WulfrumKnifeThrowSingle") { Volume = 0.8f};
|
||||
private const int Lifetime = 600;
|
||||
private const int FramesPerSubProjectile = 13;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -28,7 +30,9 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = Lifetime;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 30;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
@@ -44,22 +48,14 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
||||
|
||||
// Dust and light
|
||||
Dust d = Dust.NewDustDirect(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, default, 0.85f);
|
||||
Dust d = Dust.NewDustDirect(Projectile.position + Projectile.velocity, Projectile.width - (Projectile.Calamity().stealthStrike ? 6 : 0), Projectile.height - (Projectile.Calamity().stealthStrike ? 6 : 0), Projectile.Calamity().stealthStrike ? 132 : 180, Projectile.velocity.X * -0.8f, Projectile.velocity.Y * -0.8f, 0, default, Projectile.Calamity().stealthStrike ? 1.2f : 0.8f);
|
||||
d.noLight = true;
|
||||
Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.1f, 0.4f, 0.7f, 0.9f);
|
||||
d.noGravity = true;
|
||||
Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.2f, 0.2f, 0.7f, 0.9f);
|
||||
|
||||
// Fire sub projectiles occasionally
|
||||
bool shouldFireSubProjectile = (Lifetime - Projectile.timeLeft) % (Projectile.MaxUpdates * FramesPerSubProjectile) == 8;
|
||||
if (Projectile.owner == Main.myPlayer && shouldFireSubProjectile)
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
bool ss = Projectile.Calamity().stealthStrike;
|
||||
int projID = ss ? ModContent.ProjectileType<PhantasmalRuinGhost>() : ModContent.ProjectileType<LostSoulFriendly>();
|
||||
int damage = (int)(Projectile.damage * 0.25f);
|
||||
float kb = Projectile.knockBack * (ss ? 1f : 0.25f);
|
||||
Vector2 velocity = ss
|
||||
? (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(-0.04f, 0.04f))
|
||||
: (Projectile.velocity * 0.08f) + Main.rand.NextVector2Circular(0.4f, 0.4f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projID, damage, kb, Projectile.owner);
|
||||
Projectile.extraUpdates = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,24 +67,44 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int numSouls = 4;
|
||||
int projID = ModContent.ProjectileType<PhantasmalSoul>();
|
||||
int soulDamage = (int)(Projectile.damage * 0.1f);
|
||||
float soulKB = 0f;
|
||||
float speed = 5f;
|
||||
float startAngle = Main.rand.NextFloat(-0.07f, 0.07f) + MathHelper.PiOver4;
|
||||
Vector2 velocity = (Vector2.UnitX * speed).RotatedBy(startAngle);
|
||||
for (int i = 0; i < numSouls; i += 2)
|
||||
{
|
||||
// Each pair of souls has randomized player homing strength
|
||||
float ai1 = Main.rand.NextFloat() + 0.5f;
|
||||
if (Main.rand.NextBool(2))
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projID, soulDamage, soulKB, Projectile.owner, 0f, ai1);
|
||||
if (Main.rand.NextBool(2))
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, projID, soulDamage, soulKB, Projectile.owner, 0f, ai1);
|
||||
SoundEngine.PlaySound(HitSound with { PitchVariance = 0.4f }, Projectile.position);
|
||||
|
||||
// Rotate direction for the next pair of souls.
|
||||
velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls);
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
for (int i = 0; i < 5; i += 2)
|
||||
{
|
||||
int soulDamage = (int)(Projectile.damage * 0.3f);
|
||||
Vector2 velocity = new Vector2(0f, -15f);
|
||||
velocity = velocity.RotatedByRandom(0.5f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + new Vector2(0, 600f), velocity, ModContent.ProjectileType<PhantasmalSoulBlue>(), soulDamage, 0f, Projectile.owner, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int numSouls = 4;
|
||||
int projID = ModContent.ProjectileType<PhantasmalSoulBlue>();
|
||||
int soulDamage = (int)(Projectile.damage * 0.2f);
|
||||
float soulKB = 0f;
|
||||
float speed = 10f;
|
||||
float startAngle = Main.rand.NextFloat(-0.07f, 0.07f) + MathHelper.PiOver4;
|
||||
Vector2 velocity = (Vector2.UnitX * speed).RotatedBy(startAngle);
|
||||
for (int i = 0; i < numSouls; i += 2)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projID, soulDamage, soulKB, Projectile.owner, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, projID, soulDamage, soulKB, Projectile.owner, 0f);
|
||||
// Rotate direction for the next pair of souls.
|
||||
velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls);
|
||||
}
|
||||
for (int i = 0; i < 8; i += 2)
|
||||
{
|
||||
// d, du, dus, dust :)
|
||||
Dust du = Dust.NewDustPerfect(Projectile.Center, 180, velocity, 0, default, Main.rand.NextFloat(1.1f, 1.4f));
|
||||
Dust dus = Dust.NewDustPerfect(Projectile.Center, 180, -velocity, 0, default, Main.rand.NextFloat(1.1f, 1.4f));
|
||||
du.noGravity = true;
|
||||
dus.noGravity = true;
|
||||
// Rotate direction for the next dust.
|
||||
velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
private const int Lifetime = 300;
|
||||
private const int NoHomingFrames = 40;
|
||||
private const int NoHomingFrames = 35;
|
||||
private const int NoHitFrames = 10;
|
||||
private const int NoDrawFrames = 5;
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,119 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class PhantasmalSoulBlue : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/PhantomSpirit") { Volume = 0.3f };
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
private const int Lifetime = 300;
|
||||
private const int NoHomingFrames = 45;
|
||||
private const int NoHitFrames = 20;
|
||||
private const int NoDrawFrames = 5;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.projFrames[Projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = Projectile.height = 36;
|
||||
Projectile.alpha = 100;
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = Lifetime;
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < Lifetime - NoHomingFrames && target.CanBeChasedBy(Projectile);
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Handle animation
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 6)
|
||||
{
|
||||
Projectile.frame++;
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
if (Projectile.frame > 3)
|
||||
Projectile.frame = 0;
|
||||
|
||||
// Activate homing on enemies after a brief delay
|
||||
if (Projectile.timeLeft < Lifetime - NoHomingFrames)
|
||||
Projectile.ai[0] = 1f;
|
||||
|
||||
// Occasional dust
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int dustID = 180;
|
||||
Dust d = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustID);
|
||||
d.velocity *= 0.1f;
|
||||
d.scale = 1.3f;
|
||||
d.noGravity = true;
|
||||
d.noLight = true;
|
||||
}
|
||||
|
||||
// Blue light
|
||||
Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.7f);
|
||||
|
||||
// Make sure the soul is always facing forwards
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
|
||||
if (Projectile.ai[0] == 1f)
|
||||
CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 15f, 20f);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (Projectile.timeLeft > Lifetime - NoDrawFrames)
|
||||
return false;
|
||||
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get darker when about to disappear
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (Projectile.timeLeft < 85)
|
||||
{
|
||||
byte b2 = (byte)(Projectile.timeLeft * 3);
|
||||
byte a2 = (byte)(100f * ((float)b2 / 255f));
|
||||
return new Color((int)b2, (int)b2, (int)b2, (int)a2);
|
||||
}
|
||||
return new Color(255, 255, 255, 100);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
int dustCount = 36;
|
||||
int dustID = 180;
|
||||
for (int i = 0; i < dustCount; i++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2Circular(1f, 1f);
|
||||
velocity = 12f * velocity + Projectile.velocity * 0.1f;
|
||||
Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID);
|
||||
d.velocity = velocity;
|
||||
d.noGravity = true;
|
||||
d.noLight = true;
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(HitSound with { PitchVariance = 0.4f }, Projectile.position);
|
||||
}
|
||||
|
||||
// Cannot deal damage for the first several frames of existence.
|
||||
public override bool CanHitPvp(Player target) => Projectile.timeLeft < Lifetime - NoHitFrames;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@@ -1,81 +0,0 @@
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class PhantomLanceProj : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/PhantomLance";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 20;
|
||||
Projectile.height = 20;
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (!Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
if (Projectile.timeLeft <= 255)
|
||||
Projectile.alpha += 1;
|
||||
if (Projectile.timeLeft >= 75)
|
||||
{
|
||||
Projectile.velocity.X *= 0.995f;
|
||||
Projectile.velocity.Y *= 0.995f;
|
||||
}
|
||||
}
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, default, 0.85f);
|
||||
Projectile.ai[0]++;
|
||||
if (Projectile.ai[0] % 18f == 0f)
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float damageMult = Projectile.timeLeft * 0.7f / 300f;
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
damageMult = 0.7f;
|
||||
int soulDamage = (int)(Projectile.damage * damageMult);
|
||||
int soul = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<Phantom>(), soulDamage, Projectile.knockBack, Projectile.owner);
|
||||
if (soul.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[soul].DamageType = RogueDamageClass.Instance;
|
||||
Main.projectile[soul].usesLocalNPCImmunity = true;
|
||||
Main.projectile[soul].localNPCHitCooldown = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 10; i++)
|
||||
{
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user