Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. using Terraria;
  2. using Terraria.ID;
  3. using Terraria.ModLoader;
  4.  
  5. namespace KMMXCM.Items.Weapons
  6. {
  7.     public class XBuster : ModItem
  8.     {
  9.         public override void SetStaticDefaults()
  10.         {
  11.             DisplayName.SetDefault("X Buster");
  12.             Tooltip.SetDefault("A replica, closer to the original. Now with charge shots! \n <RightClick> to use Charge Shot for 50 Mana");
  13.         }
  14.         public override void SetDefaults()
  15.         {
  16.             item.damage = 50;
  17.             item.ranged = true;
  18.             item.width = 30;
  19.             item.height = 18;
  20.             item.useTime = 12;
  21.             item.useAnimation = 12;
  22.             item.useStyle = 5;
  23.             item.knockBack = 2;
  24.             item.value = 1000;
  25.             item.rare = 2;
  26.             item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterShot");
  27.             item.autoReuse = false;
  28.             item.shoot = mod.ProjectileType("XBusterShot");
  29.             item.useTurn = false;
  30.             item.scale = 0.75f;
  31.             item.noUseGraphic = false;
  32.             item.shootSpeed = 18f;
  33.         }
  34.        
  35.                 public override bool AltFunctionUse(Player player) {
  36.             return true;
  37.         }
  38.        
  39.         public override bool CanUseItem(Player player) {
  40.            
  41.             if (player.altFunctionUse == 2) {
  42.                 item.useStyle = 5;
  43.                 item.useTime = 30;
  44.                 item.useAnimation = 30;
  45.                 item.damage = 350;
  46.                 item.mana = 50;
  47.                 item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterChargeShot");
  48.                 item.shoot = mod.ProjectileType("XBusterChargeShot");
  49.                
  50.             }
  51.             else {
  52.                 item.useStyle = 5;
  53.                 item.useTime = 10;
  54.                 item.useAnimation = 10;
  55.                 item.damage = 50;
  56.                 item.mana = 0;
  57.                 item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BusterShot");
  58.                 item.shoot = mod.ProjectileType("XBusterShot");
  59.             }
  60.             return base.CanUseItem(player);
  61.         }
  62.  
  63.         public override void AddRecipes()
  64.         {
  65.             ModRecipe recipe = new ModRecipe(mod);
  66.             recipe.AddIngredient(mod, "XBusterMinus");
  67.             recipe.AddIngredient(mod, "SteelBar", 2);
  68.             recipe.AddIngredient(mod, "CrystalSlime", 6);
  69.             recipe.AddIngredient(mod, "BatteryMKI", 4);
  70.             recipe.AddTile(mod, "MachiningWorkbench");
  71.             recipe.SetResult(this);
  72.             recipe.AddRecipe();
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement