Refactor and redo Shattered Prism
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Projectiles.FragmentedPrism;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
||||
{
|
||||
public class FragmentedPrism : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 200;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 36;
|
||||
Item.width = 54;
|
||||
Item.height = 54;
|
||||
Item.useTime = 30;
|
||||
Item.useAnimation = 30;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.channel = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.knockBack = 3.5f;
|
||||
Item.value = Item.buyPrice(platinum: 2, gold: 50);
|
||||
Item.rare = ModContent.RarityType<SingularityItem>();
|
||||
Item.UseSound = SoundID.Item15;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<FragmentedPrismController>();
|
||||
Item.shootSpeed = 0f;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => true;
|
||||
|
||||
public override bool Shoot(Player player, Terraria.DataStructures.EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) => false;
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[Item.shoot] == 0)
|
||||
{
|
||||
IEntitySource spawnSource = player.GetSource_ItemUse(Item);
|
||||
int damage = player.GetWeaponDamage(Item);
|
||||
float knockBack = player.GetWeaponKnockback(Item, Item.knockBack);
|
||||
Projectile.NewProjectile(spawnSource, player.Center, Vector2.Zero, Item.shoot, damage, knockBack, player.whoAmI);
|
||||
}
|
||||
|
||||
Lighting.AddLight(player.Center, new Vector3(0.08f, 0.16f, 0.26f));
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -1,42 +0,0 @@
|
||||
using ForgottenWawiTech.Content.Projectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
||||
{
|
||||
public class ShatteredPrism : ModItem
|
||||
{
|
||||
public override string Texture => "Terraria/Images/Item_" + ItemID.LastPrism; // TODO: Change
|
||||
public static Color OverrideColor = new(80,0,80);
|
||||
|
||||
public override void SetDefaults() {
|
||||
Item.CloneDefaults(ItemID.LastPrism);
|
||||
Item.mana = 4;
|
||||
Item.damage = 500;
|
||||
Item.shoot = ModContent.ProjectileType<ShatteredPrismHoldout>();
|
||||
Item.shootSpeed = 30f;
|
||||
Item.color = OverrideColor;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return player.ownedProjectileCounts[ModContent.ProjectileType<ShatteredPrismHoldout>()] <= 0;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe recipe = CreateRecipe();
|
||||
// Only add recipe if Calamity Mod is loaded
|
||||
if (ModLoader.TryGetMod("CalamityMod", out Mod calamityMod))
|
||||
{
|
||||
recipe.AddIngredient(ItemID.LastPrism, 1);
|
||||
recipe.AddIngredient(calamityMod.Find<ModItem>("ShatteredCommunity").Type, 1);
|
||||
recipe.AddIngredient<Content.Items.Materials.RGBAlloy>(10);
|
||||
recipe.AddTile<Content.Tiles.CraftingStations.HighTechMarvel>();
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 504 B |
Reference in New Issue
Block a user