XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

DeathMod

【Terraria】DeathMod (now aka Soul Harvest)

公开
关注 0 Fork 0 Star 0
UTF-8
using SoulHarvest.Buffs;
using SoulHarvest.Common;
using SoulHarvest.Projectiles;
using SoulHarvest.Tiles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;

namespace SoulHarvest.Items;

public class LegacyDeath : ModItem
{
    public override void SetDefaults()
    {
        Item.damage = 99_999_999;
        Item.DamageType = DamageClass.Ranged;
        Item.knockBack = 6f;
        Item.crit = 196;
        Item.rare = ItemRarityID.Purple;
        Item.useTime = 40;
        Item.useAnimation = 20;
        Item.useStyle = ItemUseStyleID.Swing;
        Item.autoReuse = true;
        Item.value = 0;
        Item.UseSound = SoundID.Item1;
        Item.width = 64;
        Item.height = 64;
        Item.scale = 2.4f;
        Item.maxStack = 1;
        Item.shoot = ModContent.ProjectileType<LegacyDeathProjectile>();
        Item.shootSpeed = 20f;
    }

    public override void MeleeEffects(Player player, Rectangle hitbox)
    {
        Dust dust = Dust.NewDustDirect(hitbox.TopLeft(), hitbox.Width, hitbox.Height, DustID.BatScepter, Alpha: 100, Scale: 2f);
        dust.noGravity = true;
        player.AddBuff(ModContent.BuffType<HarvestBuff>(), 600);
    }

    public override void AddRecipes()
    {
        CreateRecipe()
            .AddIngredient<NormalSickle>()
            .AddIngredient<Soul>(999)
            .AddTile(ModContent.TileType<DeathAltarTile>())
            .AddCondition(new Condition(
                Language.GetOrRegister("Mods.SoulHarvest.Conditions.DeathFormUnlocked"),
                () => Main.LocalPlayer.GetModPlayer<MyPlayer>().ReaperProgression.DeathFormUnlocked))
            .Register();
    }
}