Commit of decompiled and "updated" code.
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
using FabusMod.Projectiles.FoxPistol;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace FabusMod.Items.Weapons.Ranged.FoxPistols;
|
||||
|
||||
public class FoxPistol : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fox Pistol");
|
||||
Tooltip.SetDefault("[c/B6FF00:Autoshoots, doesn't require ammo, dyeable]\nGrants the [c/D78624:Fox Mending] buff for 5 seconds, which regenerates HP and increases speed, but lowers damage by 12% \nUsing <right> increases damage and reduces use time, as well as: \n - Grants the [c/9E9E9E:Fox Break] debuff for 1 second, reducing movement speed \n - Grants the [c/732C73:Fox Wither] debuff for 1.3 seconds on self, and 4 seconds on hit enemies \n - [c/732C73:Fox Wither] debuff deals damage over time and nullifies the [c/D78624:Fox Mending] buff's regeneration");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 22;
|
||||
Item.width = 36;
|
||||
Item.height = 21;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 4f;
|
||||
Item.value = Item.sellPrice(0, 3, 80, 0);
|
||||
Item.UseSound = SoundID.Item11;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 7f;
|
||||
Item.expert = true;
|
||||
Item.shoot = ModContent.ProjectileType<OrangeBolt>();
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(0f, -2f);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 32f;
|
||||
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
|
||||
{
|
||||
position += muzzleOffset;
|
||||
}
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxBreak>(), 60, true);
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxWither>(), 78, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxMending>(), 300, true);
|
||||
}
|
||||
Vector2 perturbedSpeed = Utils.RotatedByRandom(new Vector2(velocity.X, velocity.Y), (double)MathHelper.ToRadians(3f));
|
||||
velocity.X = perturbedSpeed.X;
|
||||
velocity.Y = perturbedSpeed.Y;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
Item.damage = 28;
|
||||
Item.shoot = ModContent.ProjectileType<OrangeBoltRMB>();
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.damage = 22;
|
||||
Item.shoot = ModContent.ProjectileType<OrangeBolt>();
|
||||
}
|
||||
return CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe val = CreateRecipe();
|
||||
val.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.NatureToken>());
|
||||
val.AddRecipeGroup("FabusMod:GoldBar", 10);
|
||||
val.AddTile(TileID.Anvils);
|
||||
val.Register();
|
||||
|
||||
Recipe val2 = CreateRecipe();
|
||||
val2.AddIngredient(ModContent.ItemType<FoxPistolBlue>());
|
||||
val2.AddIngredient(ItemID.OrangeDye, 1);
|
||||
val2.AddTile(TileID.DyeVat);
|
||||
val2.Register();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 639 B |
@@ -0,0 +1,103 @@
|
||||
using FabusMod.Projectiles.FoxPistol;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace FabusMod.Items.Weapons.Ranged.FoxPistols;
|
||||
|
||||
public class FoxPistolBlue : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fox Pistol - Blue");
|
||||
Tooltip.SetDefault("[c/B6FF00:Autoshoots, doesn't require ammo, dyeable]\nGrants the [c/37C8AB:Fox Mending] buff for 5 seconds, which regenerates HP and increases speed, but lowers damage by 12% \nUsing <right> increases damage and reduces use time, as well as: \n - Grants the [c/9E9E9E:Fox Break] debuff for 1 second, reducing movement speed \n - Grants the [c/732C73:Fox Wither] debuff for 1.3 seconds on self, and 4 seconds on hit enemies \n - [c/732C73:Fox Wither] debuff deals damage over time and nullifies the [c/37C8AB:Fox Mending] buff's regeneration");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 22;
|
||||
Item.width = 36;
|
||||
Item.height = 21;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 4f;
|
||||
Item.value = Item.sellPrice(0, 3, 80, 0);
|
||||
Item.UseSound = SoundID.Item11;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 7f;
|
||||
Item.expert = true;
|
||||
Item.shoot = ModContent.ProjectileType<BlueBolt>();
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(0f, -2f);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 32f;
|
||||
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
|
||||
{
|
||||
position += muzzleOffset;
|
||||
}
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxBreak>(), 60, true);
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxWither>(), 78, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.FoxMendingBlue>(), 300, true);
|
||||
}
|
||||
Vector2 perturbedSpeed = Utils.RotatedByRandom(new Vector2(velocity.X, velocity.Y), (double)MathHelper.ToRadians(3f));
|
||||
velocity.X = perturbedSpeed.X;
|
||||
velocity.Y = perturbedSpeed.Y;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
Item.damage = 28;
|
||||
Item.shoot = ModContent.ProjectileType<BlueBoltRMB>();
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.damage = 22;
|
||||
Item.shoot = ModContent.ProjectileType<BlueBolt>();
|
||||
}
|
||||
return CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe val = CreateRecipe();
|
||||
val.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.NatureToken>());
|
||||
val.AddRecipeGroup("FabusMod:GoldBar", 10);
|
||||
val.AddTile(TileID.Anvils);
|
||||
val.Register();
|
||||
|
||||
Recipe val2 = CreateRecipe();
|
||||
val2.AddIngredient(ModContent.ItemType<FoxPistol>(), 1);
|
||||
val2.AddIngredient(ItemID.BlueDye, 1);
|
||||
val2.AddTile(TileID.DyeVat);
|
||||
val2.Register();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 635 B |
@@ -0,0 +1,97 @@
|
||||
using FabusMod.Projectiles.FoxPistol;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace FabusMod.Items.Weapons.Ranged.FoxPistols;
|
||||
|
||||
public class SpectralHowler : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Spectral Howler");
|
||||
Tooltip.SetDefault("[c/B6FF00:Autoshoots, doesn't require ammo]\nGrants the [c/AB2C2C:S][c/F3821B:p][c/E6AF31:e][c/63B465:c][c/82E8E8:t][c/9EF3EF:r][c/2BA0B5:a][c/734679:l ][c/AB2C2C:M][c/F3821B:e][c/E6AF31:n][c/63B465:d][c/82E8E8:i][c/9EF3EF:n][c/2BA0B5:g] buff for 7 seconds, which has the following effects:\n - Increases max HP by 200, regenerates HP, and increases movement speed, but lowers damage by 7% \nUsing <right> increases damage and reduces use time, as well as: \n - Grants the [c/8F77AF:Spectral Wither] debuff for 0.4 seconds, dealing damage over time and nullifying [c/AB2C2C:S][c/F3821B:p][c/E6AF31:e][c/63B465:c][c/82E8E8:t][c/9EF3EF:r][c/2BA0B5:a][c/734679:l ][c/AB2C2C:M][c/F3821B:e][c/E6AF31:n][c/63B465:d][c/82E8E8:i][c/9EF3EF:n][c/2BA0B5:g]'s regeneration\n - Inflicts the [c/AB2C2C:R][c/F3821B:a][c/E6AF31:i][c/63B465:n][c/82E8E8:b][c/9EF3EF:o][c/2BA0B5:w][c/734679:'s ][c/AB2C2C:W][c/F3821B:r][c/E6AF31:a][c/63B465:t][c/82E8E8:h] debuff on hit enemies for 8 seconds, dealing damage over time");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 260;
|
||||
Item.width = 36;
|
||||
Item.height = 21;
|
||||
Item.useTime = 6;
|
||||
Item.useAnimation = 6;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 4f;
|
||||
Item.value = Item.sellPrice(0, 97, 60, 0);
|
||||
Item.UseSound = SoundID.Item11;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 8f;
|
||||
Item.expert = true;
|
||||
Item.shoot = ModContent.ProjectileType<RainbowBolt>();
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-6f, -2f);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 32f;
|
||||
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
|
||||
{
|
||||
position += muzzleOffset;
|
||||
}
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.SpectralWither>(), 24, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<Buffs.FoxPistol.SpectralMending>(), 420, true);
|
||||
}
|
||||
Vector2 perturbedSpeed = Utils.RotatedByRandom(new Vector2(velocity.X, velocity.Y), (double)MathHelper.ToRadians(3f));
|
||||
velocity.X = perturbedSpeed.X;
|
||||
velocity.Y = perturbedSpeed.Y;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 4;
|
||||
Item.useAnimation = 4;
|
||||
Item.damage = 270;
|
||||
Item.shoot = ModContent.ProjectileType<RainbowBoltRMB>();
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = 6;
|
||||
Item.useAnimation = 6;
|
||||
Item.damage = 260;
|
||||
Item.shoot = ModContent.ProjectileType<RainbowBolt>();
|
||||
}
|
||||
return CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
Recipe val = CreateRecipe();
|
||||
val.AddRecipeGroup("FabusMod:FoxPistol", 1);
|
||||
val.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.RainbowToken>());
|
||||
val.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 4);
|
||||
val.AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>());
|
||||
val.Register();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 989 B |
Reference in New Issue
Block a user