- Removed Demonic Bone Ash - Removed Murky Paste - Removed Trapper Bulb Most of these are recipe ordering hell (again) - Moved Shadowspec Bar to the top of most materials - Moved Cosmilite Bar to the top of most materials (under SSpec) - Moved complementary ASE type to pair below Bars - Swap recipe order of Soul Artifacts - Enforced certain material pairing orders - Added missing materials for certain sets
79 lines
3.0 KiB
C#
79 lines
3.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using CalamityMod.Rarities;
|
|
using CalamityMod.Tiles.Furniture.CraftingStations;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class Penumbra : RogueWeapon
|
|
{
|
|
public static float ShootSpeed = 9f;
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 46;
|
|
Item.height = 32;
|
|
Item.autoReuse = true;
|
|
Item.noUseGraphic = true;
|
|
Item.noMelee = true;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.UseSound = SoundID.Item103;
|
|
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
|
|
|
|
Item.damage = 830;
|
|
Item.useAnimation = 40;
|
|
Item.useTime = 40;
|
|
Item.knockBack = 8f;
|
|
Item.shoot = ModContent.ProjectileType<PenumbraBomb>();
|
|
Item.shootSpeed = 9f;
|
|
|
|
Item.rare = ModContent.RarityType<DarkBlue>();
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
// Terraria seems to really dislike high crit values in SetDefaults
|
|
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16;
|
|
|
|
public override float StealthDamageMultiplier => 0.85f;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
{
|
|
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
|
float mouseXDist = Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
|
|
float mouseYDist = Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
|
|
if (player.gravDir == -1f)
|
|
{
|
|
mouseYDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - realPlayerPos.Y;
|
|
}
|
|
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
|
|
{
|
|
mouseXDist = player.direction;
|
|
mouseYDist = 0f;
|
|
}
|
|
realPlayerPos += new Vector2(mouseXDist, mouseYDist);
|
|
int proj = Projectile.NewProjectile(source, realPlayerPos, new Vector2(0f, -0.5f), ModContent.ProjectileType<PenumbraBomb>(), damage, knockback, player.whoAmI, 0f, 1f);
|
|
if (proj.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[proj].Calamity().stealthStrike = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<CosmiliteBar>(8).
|
|
AddIngredient<NightmareFuel>(20).
|
|
AddIngredient<RuinousSoul>(6).
|
|
AddTile<CosmicAnvil>().
|
|
Register();
|
|
}
|
|
}
|
|
}
|