added terror talons
This commit is contained in:
1 parent
15f506a9e8
commit
d2aa0ad29e
7 files changed
+209
-1
No files matched your search
@@ -0,0 +1,61 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class TerrorTalons : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Terror Talons");
|
||||
Tooltip.SetDefault("Fires small wavering claws\n" +
|
||||
"Stealth strikes launch a bigger, faster claw that flies straight and pierces indefinitely");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 40;
|
||||
item.damage = 118;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 11;
|
||||
item.useStyle = 1;
|
||||
item.useTime = 11;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.height = 24;
|
||||
item.value = Item.buyPrice(0, 48, 0, 0);
|
||||
item.rare = 6;
|
||||
item.shoot = ModContent.ProjectileType<TalonSmallProj>();
|
||||
item.shootSpeed = 12.5f;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
float stealthDamageMult = 1.1f;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<TalonLargeProj>(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.FeralClaws);
|
||||
recipe.AddIngredient(ItemID.ChlorophyteBar, 5);
|
||||
recipe.AddIngredient(ItemID.SoulofFright, 10);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 697 B |
@@ -771,7 +771,10 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (projectile.Calamity().rogue && projectile.Calamity().stealthStrike && Main.player[projectile.owner].Calamity().dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType<InfernadoFriendly>()) < 2)
|
||||
if (rogue && stealthStrike && Main.player[projectile.owner].Calamity().stealthStrikeAlwaysCrits)
|
||||
crit = true;
|
||||
|
||||
if (rogue && stealthStrike && Main.player[projectile.owner].Calamity().dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType<InfernadoFriendly>()) < 2)
|
||||
{
|
||||
int projTileX = (int)(projectile.Center.X / 16f);
|
||||
int projTileY = (int)(projectile.Center.Y / 16f);
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class TalonLargeProj : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Talon");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.Next(5) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
if (Main.rand.Next(10) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 111, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
projectile.ai[0]++;
|
||||
if (projectile.ai[0] > 2f)
|
||||
{
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
||||
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 10; i++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 595 B |
@@ -0,0 +1,78 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class TalonSmallProj : ModProjectile
|
||||
{
|
||||
private int x;
|
||||
private double speed = 10;
|
||||
private float startSpeedY = 0f;
|
||||
private int angle = 4;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Talon");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[0] == 0f) //only happens once
|
||||
angle = Main.rand.Next(4,11);
|
||||
if (Main.rand.Next(5) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
projectile.ai[0]++;
|
||||
if (projectile.ai[0] > 2f)
|
||||
{
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + (Main.player[projectile.owner].velocity.X * 0.5f);
|
||||
startSpeedY = projectile.velocity.Y + (Main.player[projectile.owner].velocity.Y * 0.5f);
|
||||
projectile.velocity.Y = startSpeedY;
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] >= 5f)
|
||||
{
|
||||
x++;
|
||||
speed += 0.05;
|
||||
projectile.velocity.Y = startSpeedY + (float)(speed * Math.Sin(x / angle));
|
||||
}
|
||||
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
||||
projectile.rotation = projectile.velocity.ToRotation();
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 5; i++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 469 B |
Reference in new issue
Block a user