tModLoader v2024.08
A mod to make and play Terraria mods
ItemID.BannerEffect Struct Reference

Determines the strength an NPC's banner has on players' interactions with that NPC. Used in Sets.BannerStrength More...

Public Member Functions

 BannerEffect (float normalDamageDealt, float expertDamageDealt, float normalDamageReceived, float expertDamageReceived)
 Creates a new BannerEffect with NormalDamageDealt, ExpertDamageDealt, NormalDamageReceived, and ExpertDamageReceived set to the provided values. More...
 
 BannerEffect (float strength=1f)
 Creates a new BannerEffect of strength strength. More...
 

Public Attributes

readonly bool Enabled
 If true, this banner actually affects players' interactions with NPCs.
 
readonly float ExpertDamageDealt
 The percent of damage dealt to the NPC this banner represents in Expert Mode or higher.
 
readonly float ExpertDamageReceived
 The percent of damage dealt to players by the NPC this banner represents in Expert Mode or higher.
 
readonly float NormalDamageDealt
 The percent of damage dealt to the NPC this banner represents in Normal Mode.
 
readonly float NormalDamageReceived
 The percent of damage dealt to players by the NPC this banner represents in Normal Mode.
 

Static Public Attributes

static readonly BannerEffect None = new BannerEffect(0f)
 Represents a completely decorative banner.
 
static readonly BannerEffect Reduced = new BannerEffect(0.2f)
 Represents a significantly weakened banner.
 

Detailed Description

Determines the strength an NPC's banner has on players' interactions with that NPC. Used in Sets.BannerStrength

Constructor & Destructor Documentation

◆ BannerEffect() [1/2]

ItemID.BannerEffect.BannerEffect ( float  strength = 1f)

Creates a new BannerEffect of strength strength.

Parameters
strengthThe strength of this banner compared to a standard banner.

This banner sets Enabled to true as long as strength != 0f.

◆ BannerEffect() [2/2]

ItemID.BannerEffect.BannerEffect ( float  normalDamageDealt,
float  expertDamageDealt,
float  normalDamageReceived,
float  expertDamageReceived 
)

Creates a new BannerEffect with NormalDamageDealt, ExpertDamageDealt, NormalDamageReceived, and ExpertDamageReceived set to the provided values.

This banner always has Enabled set to true, even if all provided values are 0f.