Napalm -> Cinder Arrows
Also includes small changes to other arrow types
This commit is contained in:
1 parent
6e4b40692a
commit
320508d408
7 files changed
+160
-106
No files matched your search
@@ -6,7 +6,8 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Ammo
|
||||
{
|
||||
public class NapalmArrow : ModItem, ILocalizedModType
|
||||
[LegacyName("NapalmArrow")]
|
||||
public class CinderArrow : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Ammo";
|
||||
public override void SetStaticDefaults()
|
||||
@@ -25,7 +26,7 @@ namespace CalamityMod.Items.Ammo
|
||||
Item.knockBack = 1.5f;
|
||||
Item.value = Item.sellPrice(copper: 12);
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.shoot = ModContent.ProjectileType<NapalmArrowProj>();
|
||||
Item.shoot = ModContent.ProjectileType<CinderArrowProj>();
|
||||
Item.shootSpeed = 13f;
|
||||
Item.ammo = AmmoID.Arrow;
|
||||
}
|
||||
@@ -33,10 +34,9 @@ namespace CalamityMod.Items.Ammo
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(250).
|
||||
AddIngredient(ItemID.WoodenArrow, 250).
|
||||
AddIngredient<EssenceofHavoc>().
|
||||
AddIngredient(ItemID.Torch).
|
||||
AddTile(TileID.Anvils).
|
||||
AddIngredient(ItemID.HellfireArrow, 250).
|
||||
AddIngredient<UnholyCore>().
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 383 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB |
@@ -50,6 +50,11 @@ BubonicRound: {
|
||||
'''
|
||||
}
|
||||
|
||||
CinderArrow: {
|
||||
DisplayName: Cinder Arrow
|
||||
Tooltip: Explosive arrows that burst into weak flaming shards that inflict Brimstone Flames
|
||||
}
|
||||
|
||||
ElysianArrow: {
|
||||
DisplayName: Elysian Arrow
|
||||
Tooltip:
|
||||
@@ -88,6 +93,16 @@ HolyFireBullet: {
|
||||
'''
|
||||
}
|
||||
|
||||
HailstormBullet: {
|
||||
DisplayName: Hailstorm Bullet
|
||||
Tooltip:
|
||||
'''
|
||||
Bullets imbued with potent ice magic
|
||||
These bullets rapidly decelerate after being fired
|
||||
Critical hits cause a flash freeze, dealing additional damage
|
||||
'''
|
||||
}
|
||||
|
||||
HyperiusBullet: {
|
||||
DisplayName: Hyperius Bullet
|
||||
Tooltip:
|
||||
@@ -107,16 +122,6 @@ IcicleArrow: {
|
||||
'''
|
||||
}
|
||||
|
||||
HailstormBullet: {
|
||||
DisplayName: Hailstorm Bullet
|
||||
Tooltip:
|
||||
'''
|
||||
Bullets imbued with potent ice magic
|
||||
These bullets rapidly decelerate after being fired
|
||||
Critical hits cause a flash freeze, dealing additional damage
|
||||
'''
|
||||
}
|
||||
|
||||
MarksmanRound: {
|
||||
DisplayName: Marksman Round
|
||||
Tooltip:
|
||||
@@ -136,11 +141,6 @@ MortarRound: {
|
||||
'''
|
||||
}
|
||||
|
||||
NapalmArrow: {
|
||||
DisplayName: Napalm Arrow
|
||||
Tooltip: Explodes into fire shards
|
||||
}
|
||||
|
||||
RubberMortarRound: {
|
||||
DisplayName: Rubber Mortar Round
|
||||
Tooltip:
|
||||
@@ -156,7 +156,7 @@ TerraArrow: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires an energy arrow that quickly splits into two arrows
|
||||
These arrows ignore 25 points of defense
|
||||
These arrows ignore 8 points of defense
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ ChargedBlast.DisplayName: Blast
|
||||
ChargedBlast2.DisplayName: Blast
|
||||
ChickenExplosion.DisplayName: Kentucky Fried Explosion
|
||||
ChickenRocket.DisplayName: Chicken Rocket
|
||||
CinderArrowProj.DisplayName: Cinder Arrow
|
||||
ClamorRifleProj.DisplayName: Clamor Bolt
|
||||
ClamorRifleProjSplit.DisplayName: Clamor Bolt
|
||||
ClaretCannonProj.DisplayName: Claret Cannon
|
||||
@@ -129,7 +130,6 @@ MiniatureFolly.DisplayName: Miniature Folly
|
||||
MiniSharkron.DisplayName: Mini Sharkron
|
||||
MistArrow.DisplayName: Mist Arrow
|
||||
MortarRoundProj.DisplayName: Mortar
|
||||
NapalmArrowProj.DisplayName: Napalm Arrow
|
||||
NeedlerProj.DisplayName: Needle
|
||||
NorfleetComet.DisplayName: Comet
|
||||
NorfleetExplosion.DisplayName: Explosion
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using CalamityMod.Items.Ammo;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CinderArrowProj : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public override string Texture => "CalamityMod/Items/Ammo/CinderArrow";
|
||||
public bool isShrapnel = false;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 10;
|
||||
Projectile.height = 10;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.arrow = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.aiStyle = ProjAIStyleID.Arrow;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.ai[1] == 0)
|
||||
{
|
||||
isShrapnel = Projectile.ai[2] == 1;
|
||||
if (isShrapnel)
|
||||
{
|
||||
Projectile.velocity *= 0.5f;
|
||||
Projectile.timeLeft = 300;
|
||||
}
|
||||
}
|
||||
Projectile.ai[1]++;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
if (isShrapnel)
|
||||
{
|
||||
Projectile.arrow = false;
|
||||
Projectile.extraUpdates = 3;
|
||||
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.65f, 0.85f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Projectile.ai[1] > 4 && Main.rand.NextBool(3))
|
||||
{
|
||||
float velMulti = Main.rand.NextFloat(0.1f, 0.75f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti);
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.45f, 0.75f);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti);
|
||||
dust2.noGravity = true;
|
||||
dust2.scale = Main.rand.NextFloat(0.45f, 0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
if (!isShrapnel)
|
||||
{
|
||||
int Dusts = 9;
|
||||
float radians = MathHelper.TwoPi / Dusts;
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
for (int i = 0; i < Dusts; i++)
|
||||
{
|
||||
Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i).RotatedBy(0.5f) * 6.5f;
|
||||
Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f),Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-1, 1), true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center);
|
||||
|
||||
for (int b = 0; b < 3; b++)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0, -10).RotatedByRandom(0.8f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType<CinderArrowProj>(), (int)(Projectile.damage * 0.05f), 0f, Projectile.owner, 0f, 0f, 1f);
|
||||
}
|
||||
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.damage = (int)(Projectile.damage * 0.3f);
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.ExpandHitboxBy(110);
|
||||
Projectile.Damage();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (isShrapnel)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (isShrapnel)
|
||||
{
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/DrainLine").Value;
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.35f, 1, texture);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value;
|
||||
if (Projectile.ai[1] > 6)
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White * 0.3f, 1, texture);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => isShrapnel && Projectile.ai[1] < 20 ? false : null;
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using CalamityMod.Items.Ammo;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class NapalmArrowProj : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public override string Texture => "CalamityMod/Items/Ammo/NapalmArrow";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 10;
|
||||
Projectile.height = 10;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.arrow = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.aiStyle = ProjAIStyleID.Arrow;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.ai[1]++;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
if (Projectile.ai[1] > 4)
|
||||
{
|
||||
float velMulti = Main.rand.NextFloat(0.1f, 0.75f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti);
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.45f, 0.75f);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti);
|
||||
dust2.noGravity = true;
|
||||
dust2.scale = Main.rand.NextFloat(0.45f, 0.75f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int b = 0; b < 20; b++)
|
||||
{
|
||||
int dustType = Main.rand.NextBool() ? 90 : ModContent.DustType<BrimstoneFlame>();
|
||||
float velMulti = Main.rand.NextFloat(0.1f, 0.75f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, dustType, new Vector2(14, 14).RotatedByRandom(100) * velMulti);
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.75f, 1.35f);
|
||||
}
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Crimson, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 15);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.45f, Pitch = -0.3f, PitchVariance = 0.15f }, Projectile.Center);
|
||||
SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 0.9f, PitchVariance = 0.15f }, Projectile.Center);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.damage = (int)(Projectile.damage * 0.3f);
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.ExpandHitboxBy(110);
|
||||
Projectile.Damage();
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value;
|
||||
if (Projectile.ai[1] > 6)
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1, texture);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user