mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-12 05:56:56 +00:00
33 lines
987 B
C#
33 lines
987 B
C#
using Terraria;
|
|
using Terraria.Localization;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace YHTMod.Buffs;
|
|
|
|
public class SummonerAmbitionBuff : 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<YhtPlayer>(out var mp) ? mp : null;
|
|
if (modPlayer == null) return;
|
|
|
|
tip = Language.GetTextValue("Mods.YHTMod.Buffs.SummonerAmbitionBuff.Description",
|
|
modPlayer.SummonerAmbitions.Count);
|
|
}
|
|
|
|
public override void Update(Player player, ref int buffIndex) {
|
|
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
|
|
|
|
if (modPlayer.SummonerAmbition) {
|
|
player.buffTime[buffIndex] = 18000;
|
|
}
|
|
else {
|
|
player.DelBuff(buffIndex);
|
|
buffIndex--;
|
|
}
|
|
}
|
|
}
|