Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ProcessMood()

void Terraria.GameContent.ShopHelper.ProcessMood ( Player player,
NPC npc )
inlineprivate

Definition at line 98 of file ShopHelper.cs.

99 {
102 if (Main.remixWorld)
103 {
104 return;
105 }
106 if (npc.type == 368)
107 {
109 }
110 else if (npc.type == 453)
111 {
113 }
114 else
115 {
116 if (NPCID.Sets.IsTownPet[npc.type])
117 {
118 return;
119 }
120 if (IsNotReallyTownNPC(npc))
121 {
123 return;
124 }
125 if (RuinMoodIfHomeless(npc))
126 {
128 }
129 else if (IsFarFromHome(npc))
130 {
132 }
133 if (IsPlayerInEvilBiomes(player))
134 {
136 }
137 int npcsWithinHouse;
140 bool flag = true;
141 float num = 1.05f;
142 if (npc.type == 663)
143 {
144 flag = false;
145 num = 1f;
146 if (npcsWithinHouse < 2 && npcsWithinVillage < 2)
147 {
148 AddHappinessReportText("HateLonely");
150 }
151 }
152 if (true && npcsWithinHouse > 3)
153 {
154 for (int i = 3; i < npcsWithinHouse; i++)
155 {
157 }
158 if (npcsWithinHouse > 6)
159 {
160 AddHappinessReportText("HateCrowded");
161 }
162 else
163 {
164 AddHappinessReportText("DislikeCrowded");
165 }
166 }
167 if (flag && npcsWithinHouse <= 2 && npcsWithinVillage < 4)
168 {
169 AddHappinessReportText("LoveSpace");
171 }
172 bool[] array = new bool[NPCID.Count];
173 foreach (NPC item in nearbyResidentNPCs)
174 {
175 array[item.type] = true;
176 }
178 helperInfo.player = player;
179 helperInfo.npc = npc;
180 helperInfo.NearbyNPCs = nearbyResidentNPCs;
181 helperInfo.nearbyNPCsByType = array;
184 {
185 shopModifier.ModifyShopPrice(info, this);
186 }
188 if (_currentHappiness == "")
189 {
190 AddHappinessReportText("Content");
191 }
193 }
194 }
void ModifyShopPrice(HelperInfo info, ShopHelper shopHelperInstance)
bool IsPlayerInEvilBiomes(Player player)
PersonalityDatabase _database
Definition ShopHelper.cs:26
void AddHappinessReportText(string textKeyInCategory, object substitutes=null)
float LimitAndRoundMultiplier(float priceAdjustment)
List< NPC > GetNearbyResidentNPCs(NPC npc, out int npcsWithinHouse, out int npcsWithinVillage)
static bool[] IsTownPet
Definition NPCID.cs:4099
static readonly short Count
Definition NPCID.cs:11744

References Terraria.GameContent.ShopHelper._currentHappiness, Terraria.GameContent.ShopHelper._currentPriceAdjustment, Terraria.GameContent.ShopHelper._database, Terraria.GameContent.ShopHelper.AddHappinessReportText(), System.array, Terraria.ID.NPCID.Count, Terraria.GameContent.Personalities.PersonalityDatabase.GetByNPCID(), Terraria.GameContent.ShopHelper.GetNearbyResidentNPCs(), System.info, Terraria.GameContent.ShopHelper.IsFarFromHome(), Terraria.GameContent.ShopHelper.IsNotReallyTownNPC(), Terraria.GameContent.ShopHelper.IsPlayerInEvilBiomes(), Terraria.ID.NPCID.Sets.IsTownPet, System.item, Terraria.GameContent.ShopHelper.LimitAndRoundMultiplier(), Terraria.GameContent.Personalities.AllPersonalitiesModifier.ModifyShopPrice(), Terraria.Main.remixWorld, Terraria.GameContent.ShopHelper.RuinMoodIfHomeless(), Terraria.GameContent.Personalities.PersonalityProfile.ShopModifiers, and Terraria.NPC.type.

Referenced by Terraria.GameContent.ShopHelper.GetShoppingSettings().