warrior's ambition item setup and locale

This commit is contained in:
2026-01-28 18:22:14 +01:00
parent d006a3fbaf
commit 4aebc3a261
8 changed files with 258 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace YHTMod.Buffs;
public class WarriorAmbitionBuff : ModBuff {
public override void SetStaticDefaults() {
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) {
YhtPlayer modPlayer = Main.LocalPlayer.TryGetModPlayer(out YhtPlayer mp) ? mp : null;
if (modPlayer == null) return;
tip = Language.GetTextValue("Mods.YHTMod.Buffs.WarriorAmbitionBuff.Description",
modPlayer.WarriorAmbitions.Count);
}
public override void Update(Player player, ref int buffIndex) {
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
if (modPlayer.WarriorAmbition) {
player.buffTime[buffIndex] = 18000;
}
else {
player.DelBuff(buffIndex);
buffIndex--;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB