Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace KMMXCM.Items.Weapons
- {
- public class XBuster : ModItem
- {
- public override void SetStaticDefaults()
- {
- DisplayName.SetDefault("X Buster");
- Tooltip.SetDefault("A replica, closer to the original. Now with charge shots! \n <RightClick> to use Charge Shot for 50 Mana");
- }
- public override void SetDefaults()
- {
- item.damage = 50;
- item.ranged = true;
- item.width = 30;
- item.height = 18;
- item.useTime = 12;
- item.useAnimation = 12;
- item.useStyle = 5;
- item.knockBack = 2;
- item.value = 1000;
- item.rare = 2;
- item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterShot");
- item.autoReuse = false;
- item.shoot = mod.ProjectileType("XBusterShot");
- item.useTurn = false;
- item.scale = 0.75f;
- item.noUseGraphic = false;
- item.shootSpeed = 18f;
- }
- public override bool AltFunctionUse(Player player) {
- return true;
- }
- public override bool CanUseItem(Player player) {
- if (player.altFunctionUse == 2) {
- item.useStyle = 5;
- item.useTime = 30;
- item.useAnimation = 30;
- item.damage = 350;
- item.mana = 50;
- item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterChargeShot");
- item.shoot = mod.ProjectileType("XBusterChargeShot");
- }
- else {
- item.useStyle = 5;
- item.useTime = 10;
- item.useAnimation = 10;
- item.damage = 50;
- item.mana = 0;
- item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterShot");
- item.shoot = mod.ProjectileType("XBusterShot");
- }
- return base.CanUseItem(player);
- }
- public override void AddRecipes()
- {
- ModRecipe recipe = new ModRecipe(mod);
- recipe.AddIngredient(mod, "XBusterMinus");
- recipe.AddIngredient(mod, "SteelBar", 2);
- recipe.AddIngredient(mod, "CrystalSlime", 6);
- recipe.AddIngredient(mod, "BatteryMKI", 4);
- recipe.AddTile(mod, "MachiningWorkbench");
- recipe.SetResult(this);
- recipe.AddRecipe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement