Merge: Thermocline Blaster, Arietes 41, Pearl God
This commit is contained in:
19 files changed
+826
-114
No files matched your search
@@ -16,6 +16,7 @@ using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Projectiles.Healing;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
@@ -338,6 +339,157 @@ namespace CalamityMod.CalPlayer
|
||||
GungeonMusicSystem.GUN();
|
||||
}
|
||||
|
||||
if (cgp.fireBullet)
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire3, 60);
|
||||
if (proj.numHits == 0)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
CritSpark spark = new CritSpark(proj.Center, proj.velocity.RotatedByRandom(0.4) * Main.rand.NextFloat(0.8f, 1.5f), Main.rand.NextBool() ? Color.Orange : Color.OrangeRed, Color.Yellow, Main.rand.NextFloat(0.4f, 0.6f), 15, Main.rand.NextFloat(-2f, 2f), 1.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.3f, Pitch = 1f }, proj.Center);
|
||||
}
|
||||
}
|
||||
|
||||
if (cgp.iceBullet)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn2, 60);
|
||||
if (proj.numHits == 0)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
CritSpark spark = new CritSpark(proj.Center, proj.velocity.RotatedByRandom(0.4) * Main.rand.NextFloat(0.8f, 1.5f), Main.rand.NextBool() ? Color.DeepSkyBlue : Color.LightSkyBlue, Color.White, Main.rand.NextFloat(0.4f, 0.6f), 15, Main.rand.NextFloat(-2f, 2f), 1.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item27 with { Volume = 0.3f, Pitch = 0.8f }, proj.Center);
|
||||
}
|
||||
}
|
||||
|
||||
if (cgp.shockBullet)
|
||||
{
|
||||
target.AddBuff(BuffID.Electrified, 180);
|
||||
|
||||
if (proj.numHits == 0)
|
||||
{
|
||||
CustomPulse spark = new CustomPulse(proj.Center, Vector2.Zero, Color.Turquoise, "CalamityMod/Particles/PlasmaExplosion", new Vector2(1, 1), Main.rand.NextFloat(-2f, 2f), 0.005f, Main.rand.NextFloat(0.048f, 0.055f), 14);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
int points = 6;
|
||||
float radians = MathHelper.TwoPi / points;
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
float rotRando = Main.rand.NextFloat(0.1f, 2.5f);
|
||||
for (int k = 0; k < points; k++)
|
||||
{
|
||||
Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando);
|
||||
SparkParticle subTrail = new SparkParticle(proj.Center + velocity * 4.5f, velocity * 8, false, 13, 0.85f, Color.Turquoise);
|
||||
GeneralParticleHandler.SpawnParticle(subTrail);
|
||||
}
|
||||
for (int i = 0; i <= 12; i++)
|
||||
{
|
||||
Dust dust2 = Dust.NewDustPerfect(proj.Center, 278, new Vector2(4, 4).RotatedByRandom(100f) * Main.rand.NextFloat(0.1f, 2.9f));
|
||||
dust2.noGravity = false;
|
||||
dust2.scale = Main.rand.NextFloat(0.3f, 0.9f);
|
||||
dust2.color = Color.Turquoise;
|
||||
}
|
||||
|
||||
int onHitDamage = Player.CalcIntDamage<RangedDamageClass>(0.2f * proj.damage);
|
||||
Player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false);
|
||||
|
||||
SoundStyle hitSound = new("CalamityMod/Sounds/Item/ElectricHit");
|
||||
SoundEngine.PlaySound(hitSound with { Volume = 0.2f, Pitch = 0.7f, PitchVariance = 0.2f }, proj.Center);
|
||||
}
|
||||
}
|
||||
|
||||
if ((cgp.pearlBullet1 || cgp.pearlBullet2 || cgp.pearlBullet3) && proj.numHits == 0)
|
||||
{
|
||||
Color color = cgp.pearlBullet1 ? Color.LightBlue : cgp.pearlBullet2 ? Color.LightPink : Color.Khaki;
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
float radians = MathHelper.TwoPi / 3;
|
||||
|
||||
Vector2 Position = target.Center + spinningPoint.RotatedBy(radians * (cgp.pearlBullet1 ? 0 : cgp.pearlBullet2 ? 1 : 2)).RotatedBy(-0.45f) * 55;
|
||||
int bulletType = (cgp.pearlBullet1 ? 0 : cgp.pearlBullet2 ? 1 : 2);
|
||||
|
||||
CustomPulse spark = new CustomPulse(target.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/HighResHollowCircleHardEdge", new Vector2(1, 1), Main.rand.NextFloat(-2f, 2f), 0.005f, 0.035f + 0.018f * bulletType, 14 + bulletType);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
CustomPulse spark2 = new CustomPulse(Position, Vector2.Zero, color, "CalamityMod/Particles/HighResFoggyCircleHardEdge", new Vector2(1, 1), Main.rand.NextFloat(-2f, 2f), 0.005f, 0.06f, 17);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
|
||||
int points = 6;
|
||||
radians = MathHelper.TwoPi / points;
|
||||
spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
float rotRando = Main.rand.NextFloat(0.1f, 2.5f);
|
||||
for (int k = 0; k < points; k++)
|
||||
{
|
||||
Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando);
|
||||
Particle subTrail = new GlowSparkParticle(Position + velocity * 10f, velocity * 15, false, 12, 0.03f, color, new Vector2(1.35f, 0.5f), true);
|
||||
GeneralParticleHandler.SpawnParticle(subTrail);
|
||||
}
|
||||
|
||||
int pearls = (int)(MathHelper.Clamp(7 - (int)(proj.numHits * 0.5f), 2, 7));
|
||||
for (int k = 0; k < pearls; k++)
|
||||
{
|
||||
Vector2 velocity = new Vector2(1, 1).RotatedByRandom(100) * Main.rand.NextFloat(0.7f, 1.2f);
|
||||
PearlParticle subTrail = new PearlParticle(Position + velocity * 11f, velocity * 10, true, 50, 0.85f, color, 0.95f, Main.rand.NextFloat(2, -2), true);
|
||||
GeneralParticleHandler.SpawnParticle(subTrail);
|
||||
}
|
||||
int dusts = (int)(MathHelper.Clamp(10 - (int)(proj.numHits * 0.5f), 2, 10));
|
||||
for (int i = 0; i <= dusts; i++)
|
||||
{
|
||||
Dust dust2 = Dust.NewDustPerfect(Position, 278, new Vector2(5, 5).RotatedByRandom(100f) * Main.rand.NextFloat(0.1f, 2.9f));
|
||||
dust2.noGravity = false;
|
||||
dust2.scale = Main.rand.NextFloat(0.3f, 0.8f);
|
||||
dust2.color = color;
|
||||
}
|
||||
|
||||
int onHitDamage = Player.CalcIntDamage<RangedDamageClass>(0.2f * proj.damage);
|
||||
Player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false);
|
||||
|
||||
SoundStyle hitSound = new("CalamityMod/Sounds/Item/HadalUrnClose");
|
||||
SoundEngine.PlaySound(hitSound with { Volume = 0.4f, Pitch = 0.4f, PitchVariance = 0.2f }, proj.Center);
|
||||
}
|
||||
|
||||
|
||||
if (cgp.lifeBullet && proj.numHits == 0)
|
||||
{
|
||||
int points = 10;
|
||||
for (int k = 0; k < points; k++)
|
||||
{
|
||||
Vector2 velocity = proj.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(0.3f, 0.8f);
|
||||
LineParticle orb = new LineParticle(proj.Center + velocity * 1.5f, velocity * Main.rand.NextFloat(1f, 2f), false, 18, Main.rand.NextFloat(0.4f, 0.7f), Color.White * 0.85f);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
}
|
||||
|
||||
int heal = (int)Math.Round(hit.Damage * 0.035);
|
||||
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);
|
||||
}
|
||||
|
||||
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
|
||||
{
|
||||
int points = 12;
|
||||
for (int k = 0; k < points; k++)
|
||||
{
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
|
||||
Vector2 velocity = proj.velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 0.8f);
|
||||
LineParticle orb = new LineParticle(proj.Center + velocity * 1.5f, velocity * Main.rand.NextFloat(1f, 3f), false, 18, Main.rand.NextFloat(0.4f, 0.7f), color);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
}
|
||||
|
||||
int heal = (int)Math.Round(hit.Damage * 0.01);
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
|
||||
return;
|
||||
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
}
|
||||
}
|
||||
|
||||
ProjLifesteal(target, proj, damageDone, hit.Crit);
|
||||
ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false));
|
||||
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), true, proj.noEnchantments);
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Arietes41 : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public bool swapType = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 56;
|
||||
Item.height = 30;
|
||||
Item.scale = 0.85f;
|
||||
Item.damage = 65;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 13;
|
||||
Item.useAnimation = 13;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 2.5f;
|
||||
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
Item.UseSound = SoundID.Item41;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 13f;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
|
||||
// Shock bullet
|
||||
if (!swapType)
|
||||
{
|
||||
for (int k = 0; k < 8; k++)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 0.65f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), false, Main.rand.Next(10, 15 + 1), Main.rand.NextFloat(0.2f, 0.35f), Color.Turquoise);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
Projectile shockShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.65f, velocity, type, damage, knockback, player.whoAmI);
|
||||
CalamityGlobalProjectile cgp = shockShot.Calamity();
|
||||
cgp.shockBullet = true;
|
||||
}
|
||||
// Life bullet
|
||||
if (swapType)
|
||||
{
|
||||
for (int k = 0; k < 8; k++)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 0.65f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), false, Main.rand.Next(10, 15 + 1), Main.rand.NextFloat(0.2f, 0.35f), Color.White);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
Projectile lifeShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) - velocity * 0.65f, velocity, type, damage, knockback, player.whoAmI);
|
||||
CalamityGlobalProjectile cgp = lifeShot.Calamity();
|
||||
cgp.lifeBullet = true;
|
||||
}
|
||||
|
||||
swapType = !swapType;
|
||||
return false;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
Vector2 itemSize = new Vector2(56, 30);
|
||||
Vector2 itemOrigin = new Vector2(-24, 3);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
if (animProgress < 0.4f)
|
||||
rotation += -0.03f * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<ThermoclineBlaster>().
|
||||
AddIngredient(ItemID.ShroomiteBar, 3).
|
||||
AddIngredient(ItemID.FallenStar, 3). // 41 Arietis is a triple star system
|
||||
AddIngredient<CoreofSunlight>().
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 533 B |
@@ -1,48 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class CursedCapper : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 52;
|
||||
Item.height = 32;
|
||||
Item.damage = 31;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 2.25f;
|
||||
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.UseSound = SoundID.Item41;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 14f;
|
||||
Item.shoot = ProjectileID.CursedBullet;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ProjectileID.CursedBullet, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.PhoenixBlaster).
|
||||
AddIngredient(ItemID.CursedFlame, 10).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 837 B |
@@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<PearlGod>().
|
||||
AddIngredient<Arietes41>().
|
||||
AddIngredient<RuinousSoul>(5).
|
||||
AddIngredient(ItemID.LunarBar, 15).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
|
||||
@@ -1,107 +1,163 @@
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
using System;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class PearlGod : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
private const int defaultSpread = 1;
|
||||
private int spread = defaultSpread;
|
||||
private bool finalShot = false;
|
||||
public bool swapType = false;
|
||||
public bool healVisual = false;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 80;
|
||||
Item.height = 46;
|
||||
Item.damage = 33;
|
||||
Item.damage = 150;
|
||||
Item.scale = 0.75f;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useTime = 9;
|
||||
Item.useAnimation = 9;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 3f;
|
||||
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
Item.UseSound = SoundID.Item41;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shoot = ModContent.ProjectileType<ShockblastRound>();
|
||||
Item.shootSpeed = 14f;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (spread > 6)
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
spread = defaultSpread;
|
||||
finalShot = true;
|
||||
Projectile.NewProjectile(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.35f, velocity, ModContent.ProjectileType<ShockblastRound>(), damage * 3, knockback * 5f, player.whoAmI, 0f, 10f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
float rotation = MathHelper.ToRadians(spread);
|
||||
if (!finalShot)
|
||||
// Pearl bullets
|
||||
if (!swapType)
|
||||
{
|
||||
int totalLoops = 1;
|
||||
switch (spread)
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
totalLoops = 2;
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
totalLoops = 3;
|
||||
break;
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
SparkParticle spark = new SparkParticle(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.35f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), false, Main.rand.Next(20, 25 + 1), Main.rand.NextFloat(0.4f, 0.65f), color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
|
||||
for (int i = 0; i < totalLoops; i++)
|
||||
for (int k = 0; k < 6; k++)
|
||||
{
|
||||
int bullet1 = Projectile.NewProjectile(source, position, velocity.RotatedBy(-rotation * (i + 1)), type, (int)(damage * 0.5), knockback * 0.5f, player.whoAmI);
|
||||
Main.projectile[bullet1].extraUpdates += spread;
|
||||
int bullet2 = Projectile.NewProjectile(source, position, velocity.RotatedBy(+rotation * (i + 1)), type, (int)(damage * 0.5), knockback * 0.5f, player.whoAmI);
|
||||
Main.projectile[bullet2].extraUpdates += spread;
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
PearlParticle pearl1 = new PearlParticle(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.35f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1f), false, Main.rand.Next(40, 45 + 1), Main.rand.NextFloat(0.6f, 0.75f), color, 0.95f, Main.rand.NextFloat(1, -1), true);
|
||||
GeneralParticleHandler.SpawnParticle(pearl1);
|
||||
}
|
||||
int shotColor = Main.rand.Next(1, 3 + 1);
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
Projectile pearlShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.65f, velocity.RotatedBy(k == 0 ? 0 : k == 1 ? 0.025f : -0.025f), type, damage, knockback, player.whoAmI);
|
||||
CalamityGlobalProjectile cgp = pearlShot.Calamity();
|
||||
if (shotColor == 1)
|
||||
cgp.pearlBullet1 = true; // blue
|
||||
if (shotColor == 2)
|
||||
cgp.pearlBullet2 = true; // pink
|
||||
if (shotColor == 3)
|
||||
cgp.pearlBullet3 = true; // yellow
|
||||
|
||||
int shockblast = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ShockblastRound>(), damage, knockback, player.whoAmI, 0f, spread);
|
||||
Main.projectile[shockblast].extraUpdates += spread;
|
||||
if (shotColor < 3)
|
||||
shotColor++;
|
||||
else
|
||||
shotColor = 1;
|
||||
|
||||
spread++;
|
||||
}
|
||||
}
|
||||
else
|
||||
// Life bullet
|
||||
if (swapType)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int k = 0; k < 8; k++)
|
||||
{
|
||||
int bigShockblast = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ShockblastRound>(), damage * 2, knockback * 2f, player.whoAmI, 0f, 10f);
|
||||
Main.projectile[bigShockblast].extraUpdates += 9;
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
Particle spark = new SparkParticle(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.35f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), false, Main.rand.Next(20, 25 + 1), Main.rand.NextFloat(0.4f, 0.65f), color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int k = 0; (k < 13); k++)
|
||||
{
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
|
||||
finalShot = false;
|
||||
Dust dust2 = Dust.NewDustPerfect(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.35f, 278, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.1f, 0.9f));
|
||||
dust2.noGravity = true;
|
||||
dust2.scale = Main.rand.NextFloat(0.3f, 0.45f);
|
||||
dust2.color = color;
|
||||
}
|
||||
Projectile lifeShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) - velocity * 0.65f, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (!healVisual)
|
||||
{
|
||||
CalamityGlobalProjectile cgp = lifeShot.Calamity();
|
||||
cgp.betterLifeBullet1 = true;
|
||||
}
|
||||
if (healVisual)
|
||||
{
|
||||
CalamityGlobalProjectile cgp = lifeShot.Calamity();
|
||||
cgp.betterLifeBullet2 = true;
|
||||
}
|
||||
healVisual = !healVisual;
|
||||
}
|
||||
|
||||
swapType = !swapType;
|
||||
return false;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
Vector2 itemSize = new Vector2(80, 46);
|
||||
Vector2 itemOrigin = new Vector2(-24, 4);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
if (animProgress < 0.4f)
|
||||
rotation += -0.03f * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<CursedCapper>().
|
||||
AddIngredient(ItemID.SpectreBar, 5).
|
||||
AddIngredient(ItemID.ShroomiteBar, 5).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
AddIngredient<Arietes41>().
|
||||
AddIngredient<LifeAlloy>(5).
|
||||
AddIngredient<RuinousSoul>(2).
|
||||
AddIngredient(ItemID.WhitePearl).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,12 +61,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe().
|
||||
AddIngredient<P90>().
|
||||
AddIngredient(ItemID.Uzi).
|
||||
AddIngredient<PearlGod>(). //This should be removed
|
||||
AddIngredient(ItemID.LunarBar, 5).
|
||||
AddIngredient(ItemID.FragmentVortex, 10).
|
||||
AddIngredient<GalacticaSingularity>(6). //This should be removed
|
||||
AddIngredient<CoreofCalamity>(). // This should be removed
|
||||
AddIngredient<Stardust>(25). // This should be removed
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
[LegacyName("CursedCapper")]
|
||||
public class ThermoclineBlaster : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public bool swapType = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 60;
|
||||
Item.height = 40;
|
||||
Item.scale = 0.75f;
|
||||
Item.damage = 45;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 16;
|
||||
Item.useAnimation = 16;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 2.25f;
|
||||
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.UseSound = SoundID.Item41;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
|
||||
// Ice bullet
|
||||
if (!swapType)
|
||||
{
|
||||
for (int k = 0; k < 8; k++)
|
||||
{
|
||||
CritSpark spark = new CritSpark(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 0.5f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), Main.rand.NextBool() ? Color.DeepSkyBlue : Color.LightSkyBlue, Color.White, Main.rand.NextFloat(0.3f, 0.7f), Main.rand.Next(10, 15 + 1), Main.rand.NextFloat(-2f, 2f), 1.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
Projectile iceShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) - velocity * 0.5f, velocity, type, damage, knockback, player.whoAmI);
|
||||
CalamityGlobalProjectile cgp = iceShot.Calamity();
|
||||
cgp.iceBullet = true;
|
||||
}
|
||||
// Fire bullet
|
||||
if (swapType)
|
||||
{
|
||||
for (int k = 0; k < 8; k++)
|
||||
{
|
||||
CritSpark spark = new CritSpark(itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 0.5f, velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1.5f), Main.rand.NextBool() ? Color.Orange : Color.OrangeRed, Color.Yellow, Main.rand.NextFloat(0.3f, 0.7f), Main.rand.Next(10, 15 + 1), Main.rand.NextFloat(-2f, 2f), 1.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
Projectile fireShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) - velocity * 0.5f, velocity, type, damage, knockback, player.whoAmI);
|
||||
CalamityGlobalProjectile cgp = fireShot.Calamity();
|
||||
cgp.fireBullet = true;
|
||||
}
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
Vector2 spawnPosition = itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 0.5f;
|
||||
Vector2 smokeVel = velocity.RotatedByRandom(0.25) * Main.rand.NextFloat(0.2f, 1f);
|
||||
Particle smoke = new HeavySmokeParticle(spawnPosition, smokeVel, Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.45f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(spawnPosition, 303, smokeVel.RotatedByRandom(0.15f), 80, default, Main.rand.NextFloat(0.25f, 1f));
|
||||
dust.noGravity = false;
|
||||
dust.color = Color.White;
|
||||
}
|
||||
|
||||
swapType = !swapType;
|
||||
return false;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f;
|
||||
Vector2 itemSize = new Vector2(60, 40);
|
||||
Vector2 itemOrigin = new Vector2(-24, 3);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
if (animProgress < 0.4f)
|
||||
rotation += -0.05f * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.PhoenixBlaster).
|
||||
AddIngredient<EssenceofEleum>(5).
|
||||
AddIngredient<EssenceofHavoc>(5).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -80,6 +80,15 @@ Archerfish: {
|
||||
Tooltip: Converts musket balls into streams of water
|
||||
}
|
||||
|
||||
Arietes41: {
|
||||
DisplayName: Arietes 41
|
||||
Tooltip:
|
||||
'''
|
||||
Alternates between firing bullets imbued with lifesteal and electricity
|
||||
Electric imbued bullets crate a small shockbast on impact, dealing additional damage to the enemy they hit
|
||||
'''
|
||||
}
|
||||
|
||||
ArterialAssault: {
|
||||
DisplayName: Arterial Assault
|
||||
Tooltip:
|
||||
@@ -333,11 +342,6 @@ CrackshotColt: {
|
||||
'''
|
||||
}
|
||||
|
||||
CursedCapper: {
|
||||
DisplayName: Cursed Capper
|
||||
Tooltip: Fires cursed bullets
|
||||
}
|
||||
|
||||
DaemonsFlame: {
|
||||
DisplayName: Daemon's Flame
|
||||
Tooltip:
|
||||
@@ -879,9 +883,8 @@ PearlGod: {
|
||||
DisplayName: Pearl God
|
||||
Tooltip:
|
||||
'''
|
||||
Fires shockblast rounds that emit massive explosions and steal enemy life as well as additional bullets
|
||||
Every seventh shot fires a massive shockblast
|
||||
'Your life is mine...'
|
||||
Alternates between firing a bullet imbued with lifesteal and 3 bullets imbued with pearlescence
|
||||
Pearlescent imbued bullets crate a radiant flash on impact, dealing additional damage to the enemy they hit
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1269,6 +1272,15 @@ ThePack: {
|
||||
Tooltip: Fires large homing rockets that explode into more homing mini rockets when in proximity to an enemy
|
||||
}
|
||||
|
||||
ThermoclineBlaster: {
|
||||
DisplayName: Thermocline Blaster
|
||||
Tooltip:
|
||||
'''
|
||||
Alternates between firing bullets imbued with fire and ice
|
||||
Any bullet type can be imbued when fired from this gun
|
||||
'''
|
||||
}
|
||||
|
||||
TheSevensStriker: {
|
||||
DisplayName: The Sevens Striker
|
||||
Tooltip:
|
||||
|
||||
@@ -22,3 +22,4 @@ AbsorberAura.DisplayName: Absorber Aura
|
||||
BlueJellyAura.DisplayName: Blue Jelly Aura
|
||||
GreenJellyAura.DisplayName: Green Jelly Aura
|
||||
PinkJellyAura.DisplayName: Pink Jelly Aura
|
||||
AltTransfusionTrail.DisplayName: Alt Transfusion Trail
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 368 KiB |
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Particles
|
||||
{
|
||||
public class PearlParticle : Particle
|
||||
{
|
||||
public Color InitialColor;
|
||||
public bool AffectedByGravity;
|
||||
public float ShrinkSpeed;
|
||||
public float RotationSpeed;
|
||||
public bool HitTiles;
|
||||
public bool hasTileHit;
|
||||
public float pVelX;
|
||||
public float pVelY;
|
||||
public override bool SetLifetime => true;
|
||||
public override bool UseCustomDraw => true;
|
||||
public override bool UseAdditiveBlend => false;
|
||||
|
||||
public override string Texture => "CalamityMod/Particles/PearlParticle";
|
||||
|
||||
public PearlParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, float shrinkSpeed = 0.95f, float rotationSpeed = 0, bool hitTiles = false)
|
||||
{
|
||||
Position = relativePosition;
|
||||
Velocity = velocity;
|
||||
AffectedByGravity = affectedByGravity;
|
||||
Scale = scale;
|
||||
Lifetime = lifetime;
|
||||
Color = InitialColor = color;
|
||||
ShrinkSpeed = shrinkSpeed;
|
||||
RotationSpeed = rotationSpeed;
|
||||
HitTiles = hitTiles;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (HitTiles)
|
||||
{
|
||||
if (hasTileHit)
|
||||
{
|
||||
if (Velocity.X != pVelX)
|
||||
{
|
||||
Velocity.X = -pVelX;
|
||||
}
|
||||
if (Velocity.Y != pVelY)
|
||||
{
|
||||
Velocity.Y = -pVelY;
|
||||
}
|
||||
HitTiles = false;
|
||||
}
|
||||
if (Collision.SolidCollision(Position, (int)(7f * Scale), (int)(7f * Scale)))
|
||||
{
|
||||
hasTileHit = true;
|
||||
pVelX = Velocity.X;
|
||||
pVelY = Velocity.Y;
|
||||
}
|
||||
}
|
||||
Scale *= ShrinkSpeed;
|
||||
RotationSpeed *= ShrinkSpeed;
|
||||
Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D));
|
||||
Velocity *= 0.95f;
|
||||
if (Velocity.Length() < 12f && AffectedByGravity)
|
||||
{
|
||||
Velocity.X *= 0.94f;
|
||||
Velocity.Y += 0.25f;
|
||||
}
|
||||
Rotation += RotationSpeed;
|
||||
}
|
||||
|
||||
public override void CustomDraw(SpriteBatch spriteBatch)
|
||||
{
|
||||
Vector2 scale = new Vector2(1f, 1f) * Scale;
|
||||
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
|
||||
Texture2D texture2 = ModContent.Request<Texture2D>("CalamityMod/Particles/PearlParticleGlow").Value;
|
||||
|
||||
spriteBatch.Draw(texture2, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.White, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale, 0, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
@@ -82,6 +82,30 @@ namespace CalamityMod.Projectiles
|
||||
// Adds Brimstone flames to bullets, currently only used by Animosity
|
||||
public bool brimstoneBullets = false;
|
||||
|
||||
// Adds fire to bullets, currently used by Thermocline Blaster
|
||||
public bool fireBullet = false;
|
||||
|
||||
// Adds ice to bullets, currently used by Thermocline Blaster
|
||||
public bool iceBullet = false;
|
||||
|
||||
// Adds shock to bullets, currently used by Arietes 41
|
||||
public bool shockBullet = false;
|
||||
|
||||
// Adds... pearl? to bullets (visual 1, blue), currently used by Pearl God
|
||||
public bool pearlBullet1 = false;
|
||||
// Adds... pearl? to bullets (visual 2, pink), currently used by Pearl God
|
||||
public bool pearlBullet2 = false;
|
||||
// Adds... pearl? to bullets (visual 3, yellow), currently used by Pearl God
|
||||
public bool pearlBullet3 = false;
|
||||
|
||||
// Adds lifesteal to bullets, currently used by Arietes 41
|
||||
public bool lifeBullet = false;
|
||||
|
||||
// Adds lifesteal to bullets (visual 1), currently used by Pearl God
|
||||
public bool betterLifeBullet1 = false;
|
||||
// Adds lifesteal to bullets (visual 2), currently used by Pearl God
|
||||
public bool betterLifeBullet2 = false;
|
||||
|
||||
// If true, this projectile creates impact sparks upon hitting enemies
|
||||
public bool deepcoreBullet = false;
|
||||
|
||||
@@ -3686,7 +3710,144 @@ namespace CalamityMod.Projectiles
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.5f, 1f);
|
||||
}
|
||||
if (fireBullet)
|
||||
{
|
||||
if (projectile.timeLeft > 200)
|
||||
{
|
||||
float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * 8f;
|
||||
Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation);
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, Main.rand.NextBool() ? 174 : 6, projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.8f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iceBullet)
|
||||
{
|
||||
if (projectile.timeLeft > 200)
|
||||
{
|
||||
float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * -8f;
|
||||
Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation);
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, Main.rand.NextBool() ? 135 : 137, projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.8f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shockBullet)
|
||||
{
|
||||
float targetDist = Vector2.Distance(player.Center, projectile.Center);
|
||||
if (projectile.timeLeft > 200 && targetDist < 1400f)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 1.1f, Color.Turquoise * 0.75f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
SparkParticle spark2 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.4f), false, 20, 0.4f, Color.Turquoise * 0.75f);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((pearlBullet1 || pearlBullet2 || pearlBullet3))
|
||||
{
|
||||
float targetDist = Vector2.Distance(player.Center, projectile.Center);
|
||||
if (projectile.timeLeft > 200 && targetDist < 1400f)
|
||||
{
|
||||
Color color = pearlBullet1 ? Color.LightBlue : pearlBullet2 ? Color.LightPink : Color.Khaki;
|
||||
Particle spark = new GlowSparkParticle(projectile.Center + projectile.velocity * 1.5f, -projectile.velocity * 0.05f, false, 3, 0.0093f, color, new Vector2(0.6f, 1.8f), false, false);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
PearlParticle pearl1 = new PearlParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, Main.rand.Next(15, 20 + 1), Main.rand.NextFloat(0.4f, 0.55f), color, 0.9f, Main.rand.NextFloat(1, -1), true);
|
||||
GeneralParticleHandler.SpawnParticle(pearl1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lifeBullet)
|
||||
{
|
||||
float targetDist = Vector2.Distance(player.Center, projectile.Center);
|
||||
if (projectile.timeLeft > 200 && targetDist < 1400f)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 0.85f, Color.White * 0.75f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + projectile.velocity, 261, -projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.65f, 0.9f);
|
||||
dust.alpha = 100;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#region betterLifeBullet
|
||||
if (betterLifeBullet1)
|
||||
{
|
||||
float targetDist = Vector2.Distance(player.Center, projectile.Center);
|
||||
if (projectile.timeLeft > 200 && targetDist < 1400f)
|
||||
{
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
|
||||
float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * -8f;
|
||||
Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation);
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, 278, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.35f, 0.45f);
|
||||
dust.color = color;
|
||||
}
|
||||
|
||||
SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f, color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f, color * 0.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark3);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (betterLifeBullet2)
|
||||
{
|
||||
float targetDist = Vector2.Distance(player.Center, projectile.Center);
|
||||
if (projectile.timeLeft > 200 && targetDist < 1400f)
|
||||
{
|
||||
int randomColor = Main.rand.Next(1, 3 + 1);
|
||||
Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki;
|
||||
|
||||
float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * 8f;
|
||||
Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation);
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, 278, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.35f, 0.45f);
|
||||
dust.color = color;
|
||||
}
|
||||
|
||||
SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f, color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f, color * 0.5f);
|
||||
GeneralParticleHandler.SpawnParticle(spark3);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Particles;
|
||||
|
||||
namespace CalamityMod.Projectiles.Healing
|
||||
{
|
||||
public class AltTransfusionTrail : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Healing";
|
||||
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public int time = 0;
|
||||
public float opacity = 0.3f;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 4;
|
||||
Projectile.height = 4;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.friendly = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.extraUpdates = 5;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 15f, MathHelper.Clamp(80f - time, 5, 80));
|
||||
if (time == 1)
|
||||
{
|
||||
bool direction = Main.rand.NextBool();
|
||||
Projectile.velocity = (Projectile.velocity * 10).RotatedBy(direction ? Main.rand.NextFloat(0.6f, 1.8f) : Main.rand.NextFloat(-0.6f, -1.8f)) * 2f;
|
||||
}
|
||||
|
||||
SparkParticle orb = new SparkParticle(Projectile.Center, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.1f), false, 5, 0.6f, Color.White * opacity);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 63 : 91, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.25f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.75f, 0.9f);
|
||||
dust.alpha = 100;
|
||||
dust.noLight = true;
|
||||
}
|
||||
|
||||
if (Projectile.timeLeft < 300)
|
||||
{
|
||||
Projectile.extraUpdates = 12;
|
||||
if (opacity > 0)
|
||||
opacity -= 0.01f;
|
||||
}
|
||||
time++;
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Particle Plus = new HealingPlus(Owner.Center - new Vector2(Main.rand.Next(-4, 24 + 1), 2), Main.rand.NextFloat(0.2f, 0.5f), new Vector2(0, Main.rand.NextFloat(-2f, -4.5f)) + Owner.velocity, Color.SlateGray * 0.75f, Color.White * 0.75f, Main.rand.Next(15, 20));
|
||||
GeneralParticleHandler.SpawnParticle(Plus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user