added Tyranny's End (auric gun)
This commit is contained in:
1 parent
a83f423c27
commit
435503a41e
4 files changed
+166
-1
No files matched your search
+2
-1
@@ -1866,7 +1866,8 @@ namespace CalamityMod
|
||||
ModContent.ItemType<Shroomer>(),
|
||||
ModContent.ItemType<SpectreRifle>(),
|
||||
ModContent.ItemType<Svantechnical>(),
|
||||
ModContent.ItemType<Skullmasher>()
|
||||
ModContent.ItemType<Skullmasher>(),
|
||||
ModContent.ItemType<TyrannysEnd>()
|
||||
};
|
||||
|
||||
boomerangList = new List<int>()
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class TyrannysEnd : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Tyranny's End");
|
||||
Tooltip.SetDefault("Pierce the heart of even the most heavily-armored foe\n" +
|
||||
"Fires a .70 caliber sniper round that bypasses enemy defense and DR\n" +
|
||||
"Rounds mark enemies for death and summon a swarm of additional bullets on crits");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 4000;
|
||||
item.crit += 35;
|
||||
item.knockBack = 9.5f;
|
||||
item.ranged = true;
|
||||
item.useTime = 55;
|
||||
item.useAnimation = 55;
|
||||
item.shoot = ProjectileID.BulletHighVelocity;
|
||||
item.shootSpeed = 12f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
item.autoReuse = true;
|
||||
|
||||
item.width = 94;
|
||||
item.height = 32;
|
||||
item.useStyle = 5;
|
||||
item.noMelee = true;
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire");
|
||||
item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<GoldenEagle>());
|
||||
recipe.AddIngredient(ModContent.ItemType<AMR>());
|
||||
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 4);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PiercingBullet>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class PiercingBullet : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Piercing Blow");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.light = 0.5f;
|
||||
projectile.alpha = 255;
|
||||
projectile.extraUpdates = 10;
|
||||
projectile.scale = 1.18f;
|
||||
projectile.friendly = true;
|
||||
projectile.ranged = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.BulletHighVelocity;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
|
||||
{
|
||||
//Avoid touching things that you probably aren't meant to damage
|
||||
if (target.defense > 999 || target.Calamity().DR >= 0.95f || target.Calamity().unbreakableDR)
|
||||
return;
|
||||
|
||||
//DR applies after defense, so undo it first
|
||||
damage = (int)(damage * (1 / (1 - target.Calamity().DR)));
|
||||
|
||||
//Then proceed to ignore all defense
|
||||
int penetratableDefense = Math.Max(target.defense - Main.player[projectile.owner].armorPenetration, 0);
|
||||
int penetratedDefense = Math.Min(penetratableDefense, target.defense);
|
||||
damage += (int)(0.5f * penetratedDefense);
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (crit)
|
||||
{
|
||||
int bulletCount = 10;
|
||||
for (int x = 0; x < bulletCount; x++)
|
||||
{
|
||||
float speed = 12f;
|
||||
float xPos = projectile.Center.X + (x < bulletCount / 2 ? 500f : -500f);
|
||||
float yPos = projectile.Center.Y + Main.rand.Next(-500, 501);
|
||||
Vector2 origin = new Vector2(xPos, yPos);
|
||||
Vector2 velocity = new Vector2(target.Center.X - origin.X, target.Center.Y - origin.Y);
|
||||
velocity.Normalize();
|
||||
velocity *= speed;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(origin, velocity, ModContent.ProjectileType<AMR2>(), (int)(projectile.damage * 0.2), projectile.knockBack, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 900);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (crit)
|
||||
{
|
||||
int bulletCount = 10;
|
||||
for (int x = 0; x < bulletCount; x++)
|
||||
{
|
||||
float speed = 12f;
|
||||
float xPos = projectile.Center.X + (x < bulletCount / 2 ? 500f : -500f);
|
||||
float yPos = projectile.Center.Y + Main.rand.Next(-500, 501);
|
||||
Vector2 origin = new Vector2(xPos, yPos);
|
||||
Vector2 velocity = new Vector2(target.Center.X - origin.X, target.Center.Y - origin.Y);
|
||||
velocity.Normalize();
|
||||
velocity *= speed;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(origin, velocity, ModContent.ProjectileType<AMR2>(), (int)(projectile.damage * 0.2), projectile.knockBack, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 900);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 577 B |
Reference in new issue
Block a user