fixed various stealth related issues w/ slick cane, sylvan slasher, and final dawn
This commit is contained in:
1 parent
5a06378f1d
commit
63359b68b6
6 files changed
+23
-29
No files matched your search
@@ -7200,7 +7200,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (veneratedLocket)
|
||||
{
|
||||
if (item.Calamity().rogue)
|
||||
if (item.Calamity().rogue && item.type != ModContent.ItemType<SylvanSlasher>())
|
||||
{
|
||||
float num72 = item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
|
||||
@@ -36,6 +36,6 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<YharimsCrystalPrism>()] <= 0;
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
|
||||
}
|
||||
}
|
||||
@@ -44,17 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/BansheeHookGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
|
||||
@@ -37,17 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.shootSpeed = 22f;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
|
||||
@@ -98,12 +98,13 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
// Stealth Strike
|
||||
if (player.Calamity().StealthStrikeAvailable() && projectile.ai[1] != 1f)
|
||||
{
|
||||
Projectile.NewProjectile(player.Center,
|
||||
int stealth = Projectile.NewProjectile(player.Center,
|
||||
player.DirectionTo(Main.MouseWorld) * 38f,
|
||||
ModContent.ProjectileType<FinalDawnThrow2>(),
|
||||
(int)(projectile.damage * 1.5f),
|
||||
projectile.knockBack,
|
||||
projectile.owner);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
player.Calamity().ConsumeStealthByAttacking();
|
||||
}
|
||||
else
|
||||
@@ -122,12 +123,13 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
// Stealth
|
||||
if (player.Calamity().StealthStrikeAvailable() && projectile.ai[1] != 1f)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center,
|
||||
int stealth = Projectile.NewProjectile(projectile.Center,
|
||||
projectile.velocity,
|
||||
ModContent.ProjectileType<FinalDawnHorizontalSlash>(),
|
||||
(int)(projectile.damage * 1.5f),
|
||||
projectile.knockBack,
|
||||
projectile.owner);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
player.Calamity().ConsumeStealthByAttacking();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class SlickCaneProjectile : BaseSpearProjectile
|
||||
{
|
||||
private bool initialized = false;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Slick Cane");
|
||||
@@ -34,6 +35,17 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear;
|
||||
public override float TravelSpeed => 8f;
|
||||
|
||||
public override bool PreAI()
|
||||
{
|
||||
// Initialization. Using the AI hook would override the base spear's code, and we don't want that.
|
||||
if (!initialized)
|
||||
{
|
||||
Main.player[projectile.owner].Calamity().ConsumeStealthByAttacking();
|
||||
initialized = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Vector2 drawPosition = projectile.position + new Vector2(projectile.width, projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition;
|
||||
@@ -84,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
modifiedMoneyValue /= Main.rand.Next(3) + 1;
|
||||
}
|
||||
moneyValueToDrop -= 10000 * modifiedMoneyValue;
|
||||
Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, ItemID.GoldCoin, modifiedMoneyValue, false, 0, false, false);
|
||||
DropHelper.DropItem(target, ItemID.GoldCoin, modifiedMoneyValue);
|
||||
}
|
||||
while (moneyValueToDrop > 100f)
|
||||
{
|
||||
@@ -98,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
modifiedMoneyValue /= Main.rand.Next(3) + 1;
|
||||
}
|
||||
moneyValueToDrop -= 100 * modifiedMoneyValue;
|
||||
Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, ItemID.SilverCoin, modifiedMoneyValue, false, 0, false, false);
|
||||
DropHelper.DropItem(target, ItemID.SilverCoin, modifiedMoneyValue);
|
||||
}
|
||||
while (moneyValueToDrop > 0f)
|
||||
{
|
||||
@@ -116,7 +128,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
modifiedMoneyValue = 1;
|
||||
}
|
||||
moneyValueToDrop -= modifiedMoneyValue;
|
||||
Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, ItemID.CopperCoin, modifiedMoneyValue, false, 0, false, false);
|
||||
DropHelper.DropItem(target, ItemID.CopperCoin, modifiedMoneyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user