1 - Ripper damage function is now a util 2 - Rage lasts 10 seconds instead of 5. 3 - Rage adds +50% damage and between 10% and 20% multiplicative DR (higher at fuller meter). 4 - Rage Boosters increase duration by 2 seconds each instead of adding damage. 5 - Rage is gained via pre-mitigation damage versus your max health. 6 - Rage decays when out of combat. 7 - Heart of Darkness removes Rage decay and gives constant Rage gain. 8 - Draedon's Heart massively increases Rage generation at low HP. 9 - Reworked when-player-takes-damage code. 10 - Adjusted tooltips of relevant items.
67 lines
2.5 KiB
C#
67 lines
2.5 KiB
C#
using CalamityMod.CalPlayer;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.PermanentBoosters
|
|
{
|
|
public class RedLightningContainer : ModItem
|
|
{
|
|
public int frameCounter = 0;
|
|
public int frame = 0;
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Red Lightning Container");
|
|
Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" +
|
|
"Revengeance drop");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 30;
|
|
item.height = 40;
|
|
item.useAnimation = 30;
|
|
item.useTime = 30;
|
|
item.useStyle = ItemUseStyleID.HoldingUp;
|
|
item.UseSound = SoundID.Item122;
|
|
item.consumable = true;
|
|
item.rare = ItemRarityID.Purple;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => !player.Calamity().rageBoostThree;
|
|
|
|
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
|
{
|
|
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated");
|
|
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
|
|
return false;
|
|
}
|
|
|
|
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
|
{
|
|
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated");
|
|
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
|
|
return false;
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainerGlow");
|
|
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
if (player.itemAnimation > 0 && player.itemTime == 0)
|
|
{
|
|
player.itemTime = item.useTime;
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.rageBoostThree = true;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|