public bool Inflicted(NPC npc) { if (ModContent.GetModBuff(Type) != null && npc.buffImmune.Length > Type) { return(npc.active && npc.HasBuff(Type)); } return(false); }
private void GetBuffBoost(Player player, Element element) { buffBoost = new Boost(1, string.Empty); for (int i = 0; i < player.buffType.Length; i++) { ModBuff modBuff = ModContent.GetModBuff(player.buffType[i]); if (modBuff != null && modBuff is IPowerupType powerupType) { buffBoost = powerupType.PowerupType(new PowerupTypeParameters(element, new PlayerWrapper(player))).boost; } } }
public EntityTyping CheckBuffModifyType(EntityTyping defTyping) { for (int i = 0; i < BuffLoader.BuffCount; i++) { if (NPC.HasBuff(i)) { ModBuff modBuff = ModContent.GetModBuff(i); if (modBuff != null && modBuff is IUseModifiedType modifiedType) { return(new EntityTyping(modifiedType.MyElement, Element.none, defTyping.offensiveElement)); } } } return(defTyping); }
public static VitriBuff TranslateVitri(string name) { name = name.ToLower(); VitriBuff ret = null; if (VitriumBuffs.TryGetValue(name, out int id)) { ret = (VitriBuff)ModContent.GetModBuff(id); } if (ret == null) { ret = (VitriBuff)Mod.GetBuff(name); } return(ret); }
private TypeSet BuffType(TypeSet typeSet) { for (int i = 0; i < player.buffType.Length; i++) { ModBuff modBuff = ModContent.GetModBuff(player.buffType[i]); if (modBuff != null) { if (modBuff is IBuffModifyType buffModify) { buffModify.ModifyType(new Abilities.Buffs.ModifyTypeParameters(typeSet, new PlayerWrapper(this))); } else if (modBuff is IUseModifiedType) { typeSet.Primary = ModifyType; typeSet.Secondary = Element.none; } } } return(typeSet); }
public override bool UseItem(Player player) { int buffCount = BuffLoader.BuffCount; int buffID = Main.rand.Next(buffCount); int length = 1800 + Main.rand.Next(1800); /*if (Main.debuff[buffID]) * { * length = 600 + Main.rand.Next(600); * }*/ while (buffID == BuffID.DrillMount && !NPC.downedGolemBoss) { Main.NewText("You can't get the drill containment unit from the Wonder Waffle until after beating the Golem", Color.OrangeRed); buffID = Main.rand.Next(buffCount); } while (ModContent.GetModBuff(buffID).Name == "PrimordiaCurse") { Main.NewText("Prevented " + Lang.GetBuffName(buffID) + " from crashing the game", Color.OrangeRed); buffID = Main.rand.Next(buffCount); } player.AddBuff(buffID, length, false); return(true); }
//////////////// private void UpdateTransformBuffs() { bool isTransformed = false; for (int i = 0; i < this.player.buffType.Length; i++) { int buffType = this.player.buffType[i]; if (buffType <= 0 || this.player.buffTime[i] <= 0) { continue; } ModBuff mybuff = ModContent.GetModBuff(buffType); if (mybuff == null || !(mybuff is TransformBuffBase)) { continue; } if (isTransformed) { this.player.ClearBuff(buffType); if (buffType == ModContent.BuffType <PsychoModeBuff>()) { this.PsychoKills = 0; } } isTransformed = true; } if (!isTransformed && this.IsTransformed) { this.ClearTransformation(); } }