Withered Enchant and Shattered Community change
This commit is contained in:
1 parent
6ac52dc3cd
commit
c2954fc699
7 files changed
+50
-32
No files matched your search
@@ -0,0 +1,21 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Cooldowns
|
||||
{
|
||||
public class Withered : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Withered");
|
||||
Description.SetDefault("Holding withered weapons causes you to suffer but makes your weapons strong");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
longerExpertDebuff = false;
|
||||
canBeCleared = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().witheredDebuff = true;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 517 B |
@@ -5,6 +5,7 @@ using CalamityMod.Events;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -408,7 +409,23 @@ namespace CalamityMod.CalPlayer
|
||||
if (player.lifeRegen > 0)
|
||||
player.lifeRegen = 0;
|
||||
lifeRegenLost += 42; //the meaning of death
|
||||
}
|
||||
}
|
||||
if (modPlayer.witheredDebuff)
|
||||
{
|
||||
modPlayer.witheredWeaponHoldTime += modPlayer.witheringWeaponEnchant.ToDirectionInt();
|
||||
if (modPlayer.witheredWeaponHoldTime < 0)
|
||||
{
|
||||
modPlayer.witheredWeaponHoldTime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lifeRegenLost += (int)(4D * Math.Pow(1.5D, modPlayer.witheredWeaponHoldTime / 87D));
|
||||
if (player.lifeRegen > 0)
|
||||
player.lifeRegen = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
modPlayer.witheredWeaponHoldTime = 0;
|
||||
|
||||
player.lifeRegen -= (int)(lifeRegenLost * lifeRegenMult);
|
||||
|
||||
|
||||
@@ -238,30 +238,5 @@ namespace CalamityMod.Items.Accessories
|
||||
level = reader.ReadInt32();
|
||||
totalRageDamage = reader.ReadInt64();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ShatteredCommunityRecipe(mod);
|
||||
r.SetResult(this);
|
||||
r.AddIngredient(ModContent.ItemType<TheCommunity>());
|
||||
r.AddIngredient(ModContent.ItemType<HeartofDarkness>());
|
||||
r.AddIngredient(ModContent.ItemType<CalamitousEssence>(), 120);
|
||||
r.AddRecipe();
|
||||
}
|
||||
|
||||
// The Shattered Community can only be crafted with a full-power Community.
|
||||
// That is, in a world where all relevant bosses have been defeated.
|
||||
private class ShatteredCommunityRecipe : ModRecipe
|
||||
{
|
||||
public ShatteredCommunityRecipe(Mod mod) : base(mod) { }
|
||||
|
||||
public override bool RecipeAvailable()
|
||||
{
|
||||
bool vanillaBosses = NPC.downedSlimeKing && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedQueenBee && NPC.downedBoss3 && Main.hardMode;
|
||||
vanillaBosses &= NPC.downedMechBossAny && NPC.downedPlantBoss && NPC.downedGolemBoss && NPC.downedFishron && NPC.downedAncientCultist && NPC.downedMoonlord;
|
||||
bool calamityBosses = CalamityWorld.downedProvidence && CalamityWorld.downedDoG && CalamityWorld.downedYharon;
|
||||
return vanillaBosses && calamityBosses;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1721,7 +1721,7 @@ namespace CalamityMod.Items
|
||||
if (calamitasNPCIndex != -1)
|
||||
currentPower = Utils.InverseLerp(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true);
|
||||
|
||||
position += Vector2.One * 14f;
|
||||
position += frame.Size() * 0.25f;
|
||||
EnchantmentEnergyParticles.InterpolationSpeed = MathHelper.Lerp(0.035f, 0.1f, currentPower);
|
||||
EnchantmentEnergyParticles.DrawSet(position + Main.screenPosition);
|
||||
|
||||
|
||||
@@ -239,9 +239,6 @@ namespace CalamityMod.UI.CalamitasEnchants
|
||||
itemScale *= inventoryScale * baseScale;
|
||||
drawPosition += Vector2.One * 23f * baseScale;
|
||||
|
||||
if (EnchantmentManager.ItemUpgradeRelationship.ContainsKey(CurrentlyHeldItem.type))
|
||||
drawPosition -= Vector2.One * 12f;
|
||||
|
||||
// Draw the item.
|
||||
if (hasMultipleFrames || ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale))
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -180,7 +181,7 @@ namespace CalamityMod.UI.CalamitasEnchants
|
||||
player => player.Calamity().dischargingItemEnchant = true,
|
||||
item => item.damage > 0 && item.maxStack == 1 && !item.summon),
|
||||
|
||||
new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. The explosion can hurt both you and enemies. Minions do more damage the longer they live and idly explode.",
|
||||
new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.",
|
||||
700,
|
||||
null,
|
||||
player => player.Calamity().explosiveMinionsEnchant = true,
|
||||
@@ -223,6 +224,12 @@ namespace CalamityMod.UI.CalamitasEnchants
|
||||
null,
|
||||
player => player.Calamity().manaMonsterEnchant = true,
|
||||
item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0),
|
||||
|
||||
new Enchantment("Withering", "You heal when hurt based on damage dealt. After being hurt, the weapon rapidly drains your life to deal massive damage.",
|
||||
1000,
|
||||
null,
|
||||
player => player.Calamity().witheringWeaponEnchant = true,
|
||||
item => item.damage > 0 && item.maxStack == 1 && !item.summon),
|
||||
};
|
||||
|
||||
// Special disenchantment thing. This is separated from the list on purpose.
|
||||
@@ -232,7 +239,8 @@ namespace CalamityMod.UI.CalamitasEnchants
|
||||
|
||||
ItemUpgradeRelationship = new Dictionary<int, int>()
|
||||
{
|
||||
[ModContent.ItemType<BlightedEyeStaff>()] = ModContent.ItemType<ExhumedVigilance>()
|
||||
[ModContent.ItemType<TheCommunity>()] = ModContent.ItemType<ShatteredCommunity>(),
|
||||
[ModContent.ItemType<BlightedEyeStaff>()] = ModContent.ItemType<ExhumedVigilance>(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user