tModLoader v2022.09
A mod to make and play Terraria mods
Terraria.ModLoader.NPCHappiness Struct Reference

This struct provides access to an NPC type's NPC & Biome relationships. More...

Public Member Functions

NPCHappiness SetBiomeAffection (IShoppingBiome biome, AffectionLevel affectionLevel)
 
NPCHappiness SetBiomeAffection< T > (AffectionLevel affectionLevel)
 
NPCHappiness SetNPCAffection (int npcId, AffectionLevel affectionLevel)
 
NPCHappiness SetNPCAffection< T > (AffectionLevel affectionLevel)
 

Static Public Member Functions

static NPCHappiness Get (int npcType)
 

Public Attributes

readonly int NpcType
 

Static Public Attributes

static readonly Dictionary< AffectionLevel, float > AffectionLevelToPriceMultiplier
 Allows you to modify the shop price multipliers associated with a (biome/npc type) relationship level. More...
 

Detailed Description

This struct provides access to an NPC type's NPC & Biome relationships.

Member Function Documentation

◆ SetBiomeAffection< T >()

NPCHappiness Terraria.ModLoader.NPCHappiness.SetBiomeAffection< T > ( AffectionLevel  affectionLevel)
Type Constraints
T :class 
T :ILoadable 
T :IShoppingBiome 
T :SetBiomeAffection 
T :ModContent.GetInstance<T>() 
T :affectionLevel 

◆ SetNPCAffection< T >()

NPCHappiness Terraria.ModLoader.NPCHappiness.SetNPCAffection< T > ( AffectionLevel  affectionLevel)
Type Constraints
T :ModNPC 
T :SetNPCAffection 
T :ModContent.GetInstance<T>() 
T :Type 
T :affectionLevel 

Member Data Documentation

◆ AffectionLevelToPriceMultiplier

readonly Dictionary<AffectionLevel, float> Terraria.ModLoader.NPCHappiness.AffectionLevelToPriceMultiplier
static
Initial value:
= new() {
{ AffectionLevel.Hate, ShopHelper.hateValue },
{ AffectionLevel.Dislike, ShopHelper.dislikeValue },
{ AffectionLevel.Like, ShopHelper.likeValue },
{ AffectionLevel.Love, ShopHelper.loveValue },
}

Allows you to modify the shop price multipliers associated with a (biome/npc type) relationship level.