Brimflame frenzy
This commit is contained in:
1 parent
217e581976
commit
e84929ca95
7 files changed
+88
-42
No files matched your search
@@ -1,24 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Cooldowns
|
||||
{
|
||||
public class BrimflameFrenzyCooldown : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Brimflame Frenzy Cooldown");
|
||||
Description.SetDefault("Your use of brimstone magic has left you exhausted");
|
||||
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().brimflameFrenzyCooldown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 640 B |
@@ -718,8 +718,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool daedalusShard = false;
|
||||
public bool brimflameSet = false;
|
||||
public bool brimflameFrenzy = false;
|
||||
public bool brimflameFrenzyCooldown = false;
|
||||
public int brimflameFrenzyTimer = 0;
|
||||
public bool flamethrowerBoost = false;
|
||||
public bool hoverboardBoost = false; //hoverboard + shroomite visage
|
||||
public bool shadeRegen = false;
|
||||
@@ -1746,7 +1744,6 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
brimflameSet = false;
|
||||
brimflameFrenzy = false;
|
||||
brimflameFrenzyCooldown = false;
|
||||
|
||||
rangedAmmoCost = 1f;
|
||||
|
||||
@@ -2418,8 +2415,6 @@ namespace CalamityMod.CalPlayer
|
||||
daedalusShard = false;
|
||||
brimflameSet = false;
|
||||
brimflameFrenzy = false;
|
||||
brimflameFrenzyCooldown = false;
|
||||
brimflameFrenzyTimer = 0;
|
||||
reaverSpeed = false;
|
||||
reaverRegen = false;
|
||||
reaverRegenCooldown = 0;
|
||||
@@ -2940,7 +2935,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (CalamityMod.TarraHotKey.JustPressed)
|
||||
{
|
||||
if (brimflameSet && !brimflameFrenzyCooldown)
|
||||
if (brimflameSet && !Cooldowns.Exists(cooldown => cooldown.GetType() == typeof(BrimflameFrenzyCooldown)))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
|
||||
@@ -1047,8 +1047,6 @@ namespace CalamityMod.CalPlayer
|
||||
dogTextCooldown--;
|
||||
if (titanCooldown > 0)
|
||||
titanCooldown--;
|
||||
if (brimflameFrenzyTimer > 0)
|
||||
brimflameFrenzyTimer--;
|
||||
if (fungalSymbioteTimer > 0)
|
||||
fungalSymbioteTimer--;
|
||||
if (aBulwarkRareTimer > 0)
|
||||
@@ -1602,8 +1600,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
brimflameFrenzy = false;
|
||||
player.ClearBuff(ModContent.BuffType<BrimflameFrenzyBuff>());
|
||||
player.AddBuff(ModContent.BuffType<BrimflameFrenzyCooldown>(), BrimflameScowl.CooldownLength, true);
|
||||
brimflameFrenzyTimer = BrimflameScowl.CooldownLength;
|
||||
Cooldowns.Add(new BrimflameFrenzyCooldown(BrimflameScowl.CooldownLength, player));
|
||||
}
|
||||
if (!bloodflareMelee && bloodflareFrenzy)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ using CalamityMod.Buffs.Cooldowns;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.UI.CooldownIndicators;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -44,14 +45,9 @@ namespace CalamityMod.Items.Armor
|
||||
if (!modPlayer.brimflameFrenzy)
|
||||
{
|
||||
frenzy = false;
|
||||
player.AddBuff(ModContent.BuffType<BrimflameFrenzyCooldown>(), CooldownLength, true);
|
||||
modPlayer.brimflameFrenzyTimer = CooldownLength;
|
||||
modPlayer.Cooldowns.Add(new BrimflameFrenzyCooldown(CooldownLength, player));
|
||||
}
|
||||
}
|
||||
if (modPlayer.brimflameFrenzyTimer == 1) //sound when ready to use again
|
||||
{
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimflameRecharge"), player.Center);
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.UI.CooldownIndicators
|
||||
{
|
||||
public class BrimflameFrenzyCooldown : CooldownIndicator
|
||||
{
|
||||
public override string SyncID => "BrimflameFrenzy";
|
||||
public override bool DisplayMe => true;
|
||||
public override string Name => "Brimflame Frenzy Cooldown";
|
||||
public override string Texture => "CalamityMod/UI/CooldownIndicators/BrimflameFrenzy";
|
||||
public override Color OutlineColor => new Color(211, 124, 93);
|
||||
public override Color CooldownColorStart => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion);
|
||||
public override Color CooldownColorEnd => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion);
|
||||
|
||||
public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BrimflameRecharge");
|
||||
|
||||
public BrimflameFrenzyCooldown(int duration, Player player) : base(duration, player)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool UseCustomDraw => true;
|
||||
|
||||
//Add red eyes to the icon
|
||||
public override void CustomDraw(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
base.CustomDraw(spriteBatch, position, opacity, scale);
|
||||
|
||||
Texture2D sprite = GetTexture(Texture + "Eyes");
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.Crimson * opacity * (1 - Completion), 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,28 @@ namespace CalamityMod.UI.CooldownIndicators
|
||||
/// <summary>
|
||||
/// Use this method if you want to handle the drawing yourself. Only called if UseCustomDraw is set to true.
|
||||
/// </summary>
|
||||
public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) { }
|
||||
public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = ModContent.GetTexture(Texture);
|
||||
Texture2D outline = ModContent.GetTexture(TextureOutline);
|
||||
Texture2D barBase = ModContent.GetTexture(ChargeBarTexture);
|
||||
|
||||
//Draw the ring
|
||||
spriteBatch.End();
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
|
||||
ApplyBarShaders(opacity);
|
||||
|
||||
spriteBatch.Draw(barBase, position, null, Color.White * opacity, 0, barBase.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
spriteBatch.End();
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Main.UIScaleMatrix);
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set this to true to disable default drawing, thus calling CustomDraw()/CustomDrawCompact() instead. This only applies to the compact mode of display
|
||||
@@ -102,7 +123,23 @@ namespace CalamityMod.UI.CooldownIndicators
|
||||
/// <summary>
|
||||
/// Use this method if you want to handle the drawing yourself. Only called if UseCustomDrawCompact is set to true.
|
||||
/// </summary>
|
||||
public virtual void CustomDrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) { }
|
||||
public virtual void CustomDrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = ModContent.GetTexture(Texture);
|
||||
Texture2D outline = ModContent.GetTexture(TextureOutline);
|
||||
Texture2D overlay = ModContent.GetTexture(TextureOverlay);
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * (1 - Completion));
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The texture of the charge bar. If set to a different texture path than the bar base, and if UseCustomDraw is set to false , it will be used as the ring around the cooldown icon
|
||||
|
||||
Reference in new issue
Block a user