Sahara Slicers
Aquatic Discharge -> Sahara Slicers A pair of dual daggers with short range Hitting enemies with the daggers will give you two bolts for each hit, up to 10 Pressing Right Click will allow you to toss collected bolts at enemies
This commit is contained in:
1 parent
a88be3282f
commit
48182e27a8
17 files changed
+389
-107
No files matched your search
@@ -179,6 +179,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Timer and Counter
|
||||
public int gaelSwipes = 0;
|
||||
public bool sBlasterDashActivated = false;
|
||||
public int saharaSlicersBolts = 0;
|
||||
public int Holyhammer = 0;
|
||||
public int PHAThammer = 0;
|
||||
public int StellarHammer = 0;
|
||||
|
||||
@@ -190,6 +190,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>())
|
||||
heldGaelsLastFrame = true;
|
||||
|
||||
if (Player.ActiveItem().type != ModContent.ItemType<SaharaSlicers>())
|
||||
saharaSlicersBolts = 0;
|
||||
|
||||
// De-equipping Gael's Greatsword deletes all rage.
|
||||
else if (heldGaelsLastFrame)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
// Weapons
|
||||
itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[]
|
||||
{
|
||||
ModContent.ItemType<AquaticDischarge>(),
|
||||
ModContent.ItemType<SaharaSlicers>(),
|
||||
ModContent.ItemType<Barinade>(),
|
||||
ModContent.ItemType<StormSpray>(),
|
||||
ModContent.ItemType<SeaboundStaff>(),
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class AquaticDischarge : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Melee";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useStyle = ItemUseStyleID.Rapier;
|
||||
Item.damage = 23;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = Item.useTime = 18;
|
||||
Item.shoot = ModContent.ProjectileType<AquaticDischargeProj>();
|
||||
Item.shootSpeed = 2f;
|
||||
Item.knockBack = 5.5f;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
public override bool MeleePrefix() => true;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 430 B |
@@ -0,0 +1,78 @@
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
[LegacyName("AquaticDischarge")]
|
||||
public class SaharaSlicers : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Melee";
|
||||
public bool AltProjectile = true;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 43;
|
||||
Item.height = 34;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.damage = 23;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.shoot = ModContent.ProjectileType<SaharaSlicersBolt>();
|
||||
Item.shootSpeed = 3.3f;
|
||||
Item.knockBack = 5.5f;
|
||||
Item.UseSound = null;
|
||||
Item.channel = true;
|
||||
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.altFunctionUse == 2) // Bolts
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
if (player.Calamity().saharaSlicersBolts > 0)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.DD2_GhastlyGlaivePierce with { Pitch = 1.5f }, player.Center);
|
||||
Projectile.NewProjectile(source, position, velocity * 2, ModContent.ProjectileType<SaharaSlicersBolt>(), (int)(damage * 1.5), knockback * 2, player.whoAmI, 1);
|
||||
player.Calamity().saharaSlicersBolts--;
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item7 with { Pitch = 0.2f }, player.Center);
|
||||
}
|
||||
}
|
||||
else // Shortswords
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
if (AltProjectile)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item1 with { Pitch = 0.4f }, player.Center);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<SaharaSlicersBladeAlt>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item1 with { Pitch = 0.9f }, player.Center);
|
||||
Projectile.NewProjectile(source, position, velocity * 0.75f, ModContent.ProjectileType<SaharaSlicersBlade>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
AltProjectile = !AltProjectile;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool MeleePrefix() => true;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -65,11 +65,6 @@ Aorta: {
|
||||
'''
|
||||
}
|
||||
|
||||
AquaticDischarge: {
|
||||
DisplayName: Aquatic Discharge
|
||||
Tooltip: Enemies release electric sparks on hit
|
||||
}
|
||||
|
||||
ArkoftheCosmos: {
|
||||
DisplayName: Ark of the Cosmos
|
||||
Tooltip:
|
||||
@@ -974,6 +969,16 @@ Roxcalibur: {
|
||||
LockedInfo: The hellish Wall of Flesh holds the key to this weapon's power
|
||||
}
|
||||
|
||||
SaharaSlicers: {
|
||||
DisplayName: Sahara Slicers
|
||||
Tooltip:
|
||||
'''
|
||||
A pair of dual daggers with short range
|
||||
Hitting enemies with the daggers will give you two bolts for each hit, up to 10
|
||||
Pressing <right> will allow you to toss collected bolts at enemies
|
||||
'''
|
||||
}
|
||||
|
||||
SausageMaker: {
|
||||
DisplayName: Sausage Maker
|
||||
Tooltip: Sprays homing blood on hit
|
||||
|
||||
@@ -209,6 +209,7 @@ RendingNeedle.DisplayName: Rending Needle
|
||||
Rox1.DisplayName: Rock
|
||||
RoxcaliburProj.DisplayName: Roxcalibur
|
||||
RSSolarFlare.DisplayName: Flare
|
||||
SaharaSlicersBolt.DisplayName: Dagger Bolt
|
||||
SandBlade.DisplayName: Sand Blade
|
||||
SandFire.DisplayName: Fire
|
||||
SanguineFury.DisplayName: Sanguine Fury
|
||||
|
||||
@@ -726,7 +726,7 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
// Weapons and accessories
|
||||
int[] items = new int[]
|
||||
{
|
||||
ModContent.ItemType<AquaticDischarge>(),
|
||||
ModContent.ItemType<SaharaSlicers>(),
|
||||
ModContent.ItemType<Barinade>(),
|
||||
ModContent.ItemType<StormSpray>(),
|
||||
ModContent.ItemType<SeaboundStaff>(),
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,105 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class SaharaSlicersBolt : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
}
|
||||
public ref int Bolts => ref Main.player[Projectile.owner].Calamity().saharaSlicersBolts;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 18;
|
||||
Projectile.height = 18;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 2;
|
||||
Projectile.tileCollide = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.DamageType = DamageClass.Melee;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
|
||||
// Shot Mode
|
||||
if (Projectile.ai[0] == 1)
|
||||
{
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
Projectile.extraUpdates = 6;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Main.rand.NextBool() ? 288 : 207);
|
||||
dust.scale = Main.rand.NextFloat(0.2f, 0.45f);
|
||||
dust.noGravity = true;
|
||||
dust.velocity = -Projectile.velocity * 0.5f;
|
||||
}
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, 313);
|
||||
dust2.scale = Main.rand.NextFloat(0.4f, 0.6f);
|
||||
dust2.noGravity = true;
|
||||
dust2.velocity = -Projectile.velocity * Main.rand.NextFloat(0.45f, 0.85f);
|
||||
}
|
||||
else // "Quiver" mode
|
||||
{
|
||||
// Refresh lifetime
|
||||
Projectile.timeLeft = 4;
|
||||
|
||||
// If the player uses a bolt, destroy the most recent bolt
|
||||
if (Bolts < Projectile.ai[1])
|
||||
Projectile.Kill();
|
||||
|
||||
// Setting the bolt's position on the player's back
|
||||
Projectile.rotation = (21.8f - (Projectile.ai[1] * 0.1f)) * -Owner.direction;
|
||||
Vector2 BoltPos = Owner.MountedCenter + new Vector2((10 + Projectile.ai[1] * 2.5f) * -Owner.direction, 3f - Projectile.ai[1]);
|
||||
|
||||
Projectile.Center = BoltPos;
|
||||
}
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
for (int i = 0; i <= 8; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.9f));
|
||||
dust.noGravity = false;
|
||||
dust.scale = Main.rand.NextFloat(0.6f, 0.9f);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.9f));
|
||||
dust2.noGravity = false;
|
||||
dust2.scale = Main.rand.NextFloat(0.6f, 0.9f);
|
||||
}
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
if (Projectile.ai[0] == 1)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
|
||||
for (int i = 0; i <= 5; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1f));
|
||||
dust.noGravity = false;
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.4f));
|
||||
dust2.noGravity = false;
|
||||
dust2.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (Projectile.ai[0] == 1)
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
return true;
|
||||
}
|
||||
public override bool? CanDamage() => Projectile.ai[0] == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -1,68 +0,0 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
{
|
||||
public class AquaticDischargeProj: BaseShortswordProjectile
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<AquaticDischarge>();
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/AquaticDischarge";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.Size = new Vector2(16);
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.scale = 1f;
|
||||
Projectile.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.timeLeft = 360;
|
||||
Projectile.hide = true;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 8;
|
||||
}
|
||||
|
||||
public override void SetVisualOffsets()
|
||||
{
|
||||
const int HalfSpriteWidth = 32 / 2;
|
||||
const int HalfSpriteHeight = 32 / 2;
|
||||
|
||||
int HalfProjWidth = Projectile.width / 2;
|
||||
int HalfProjHeight = Projectile.height / 2;
|
||||
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = -(HalfSpriteWidth - HalfProjWidth);
|
||||
DrawOriginOffsetY = -(HalfSpriteHeight - HalfProjHeight);
|
||||
}
|
||||
|
||||
public override void ExtraBehavior()
|
||||
{
|
||||
if (Main.rand.NextBool(5))
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Electric);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
int sparkDamage = player.CalcIntDamage<MeleeDamageClass>(0.5f * Projectile.damage);
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), sparkDamage, hit.Knockback, Main.myPlayer);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
int sparkDamage = player.CalcIntDamage<MeleeDamageClass>(0.5f * Projectile.damage);
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), sparkDamage, Projectile.knockBack, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
{
|
||||
public class SaharaSlicersBlade: BaseShortswordProjectile
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<SaharaSlicers>();
|
||||
public override string Texture => "CalamityMod/Projectiles/Melee/SaharaSlicersBlade";
|
||||
public ref int Bolts => ref Main.player[Projectile.owner].Calamity().saharaSlicersBolts;
|
||||
public override float FadeInDuration => 8f;
|
||||
public override float FadeOutDuration => 0f;
|
||||
public override float TotalDuration => 12f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.Size = new Vector2(15);
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.scale = 1f;
|
||||
Projectile.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.timeLeft = 360;
|
||||
Projectile.hide = true;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void SetVisualOffsets()
|
||||
{
|
||||
const int HalfSpriteWidth = 32 / 2;
|
||||
const int HalfSpriteHeight = 32 / 2;
|
||||
|
||||
int HalfProjWidth = Projectile.width / 2;
|
||||
int HalfProjHeight = Projectile.height / 2;
|
||||
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = -(HalfSpriteWidth - HalfProjWidth);
|
||||
DrawOriginOffsetY = -(HalfSpriteHeight - HalfProjHeight);
|
||||
}
|
||||
|
||||
public override void ExtraBehavior()
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(12, 12), 288);
|
||||
dust.scale = Main.rand.NextFloat(0.15f, 0.6f);
|
||||
dust.noGravity = true;
|
||||
dust.velocity = -Projectile.velocity * 0.5f;
|
||||
}
|
||||
|
||||
float armPointingDirection = ((Owner.Calamity().mouseWorld - Owner.MountedCenter).ToRotation());
|
||||
Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, armPointingDirection - MathHelper.PiOver2);
|
||||
Owner.heldProj = Projectile.whoAmI;
|
||||
|
||||
Projectile.Center = Projectile.Center + new Vector2(0, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
// Add to bolt counter, spawn 2 quiver bolts, and on hit visual
|
||||
if (Bolts < 10)
|
||||
{
|
||||
Bolts++;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType<SaharaSlicersBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts);
|
||||
if (Bolts < 10)
|
||||
{
|
||||
Bolts++;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType<SaharaSlicersBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts);
|
||||
}
|
||||
}
|
||||
float numberOfDusts = 5f;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
for (int i = 0; i < numberOfDusts; i++)
|
||||
{
|
||||
float rot = MathHelper.ToRadians(i * rotFactor);
|
||||
Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 207, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = false;
|
||||
dust.velocity = velOffset;
|
||||
dust.scale = Main.rand.NextFloat(1.5f, 1.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using static Humanizer.In;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
{
|
||||
public class SaharaSlicersBladeAlt: BaseShortswordProjectile
|
||||
{
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<SaharaSlicers>();
|
||||
public override string Texture => "CalamityMod/Projectiles/Melee/SaharaSlicersBladeAlt";
|
||||
public ref int Bolts => ref Main.player[Projectile.owner].Calamity().saharaSlicersBolts;
|
||||
public override float FadeInDuration => 8f;
|
||||
public override float FadeOutDuration => 0f;
|
||||
public override float TotalDuration => 12f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.Size = new Vector2(15);
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.scale = 1f;
|
||||
Projectile.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.timeLeft = 360;
|
||||
Projectile.hide = true;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void SetVisualOffsets()
|
||||
{
|
||||
const int HalfSpriteWidth = 32 / 2;
|
||||
const int HalfSpriteHeight = 32 / 2;
|
||||
|
||||
int HalfProjWidth = Projectile.width / 2;
|
||||
int HalfProjHeight = Projectile.height / 2;
|
||||
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = -(HalfSpriteWidth - HalfProjWidth);
|
||||
DrawOriginOffsetY = -(HalfSpriteHeight - HalfProjHeight);
|
||||
}
|
||||
|
||||
public override void ExtraBehavior()
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(12, 12), 288);
|
||||
dust.scale = Main.rand.NextFloat(0.15f, 0.6f);
|
||||
dust.noGravity = true;
|
||||
dust.velocity = -Projectile.velocity * 0.5f;
|
||||
}
|
||||
|
||||
float armPointingDirection = (Owner.Calamity().mouseWorld - Owner.MountedCenter).ToRotation();
|
||||
Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armPointingDirection - MathHelper.PiOver2);
|
||||
Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, 0);
|
||||
Owner.heldProj = Projectile.whoAmI;
|
||||
|
||||
Projectile.Center = Projectile.Center + new Vector2(0, -6f);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
// Add to bolt counter, spawn 2 quiver bolts, and on hit visual
|
||||
if (Bolts < 10)
|
||||
{
|
||||
Bolts++;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType<SaharaSlicersBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts);
|
||||
if (Bolts < 10)
|
||||
{
|
||||
Bolts++;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType<SaharaSlicersBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts);
|
||||
}
|
||||
}
|
||||
float numberOfDusts = 5f;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
for (int i = 0; i < numberOfDusts; i++)
|
||||
{
|
||||
float rot = MathHelper.ToRadians(i * rotFactor);
|
||||
Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 207, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = false;
|
||||
dust.velocity = velOffset;
|
||||
dust.scale = Main.rand.NextFloat(1.5f, 1.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user