mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
configure a code style that is not completely cursed
This commit is contained in:
+11
-18
@@ -10,18 +10,15 @@ using YHTMod.Projectiles.Weapons;
|
||||
|
||||
namespace YHTMod.Items;
|
||||
|
||||
public class ToclafaneStaff : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
public class ToclafaneStaff : ModItem {
|
||||
public override void SetStaticDefaults() {
|
||||
ItemID.Sets.GamepadWholeScreenUseRange[Item.type] =
|
||||
true; // This lets the player target anywhere on the whole screen while using a controller.
|
||||
ItemID.Sets.LockOnIgnoresCollision[Item.type] = true;
|
||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
public override void SetDefaults() {
|
||||
Item.damage = 30;
|
||||
Item.knockBack = 3f;
|
||||
Item.mana = 10;
|
||||
@@ -40,16 +37,14 @@ public class ToclafaneStaff : ModItem
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity,
|
||||
int type, int damage, float knockback)
|
||||
{
|
||||
int type, int damage, float knockback) {
|
||||
player.AddBuff(Item.buffType, 2);
|
||||
position = Main.MouseWorld;
|
||||
return base.Shoot(player, source, position, velocity, type, damage, knockback);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
var watchGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.AnyWatch"),
|
||||
public override void AddRecipes() {
|
||||
RecipeGroup watchGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.AnyWatch"),
|
||||
ItemID.GoldWatch,
|
||||
ItemID.SilverWatch,
|
||||
ItemID.TinWatch,
|
||||
@@ -59,30 +54,28 @@ public class ToclafaneStaff : ModItem
|
||||
);
|
||||
RecipeGroup.RegisterGroup("YHTMod:Watches", watchGroup);
|
||||
|
||||
var tier2BarGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.Tier2Bars"),
|
||||
RecipeGroup tier2BarGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.Tier2Bars"),
|
||||
ItemID.MythrilBar,
|
||||
ItemID.OrichalcumBar
|
||||
);
|
||||
RecipeGroup.RegisterGroup("YHTMod:Tier2Bars", tier2BarGroup);
|
||||
|
||||
var recipe = CreateRecipe();
|
||||
Recipe recipe = CreateRecipe();
|
||||
|
||||
recipe.AddRecipeGroup(watchGroup);
|
||||
recipe.AddIngredient(ItemID.GuideVoodooDoll);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
|
||||
// Calamity delays when you obtain hallowed bars, so use alternate recipe if Calamity is installed
|
||||
if (ModLoader.HasMod("CalamityMod"))
|
||||
{
|
||||
if (ModLoader.HasMod("CalamityMod")) {
|
||||
recipe.AddRecipeGroup(tier2BarGroup, 35);
|
||||
recipe.AddIngredient(ItemID.SoulofLight, 10);
|
||||
recipe.AddIngredient(ItemID.SoulofNight, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 15);
|
||||
}
|
||||
|
||||
recipe.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user