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

◆ HasSpecialEventText()

bool Terraria.NPC.HasSpecialEventText ( string specialTextCategoryKey,
out string specialEventText )
inline

Definition at line 112131 of file NPC.cs.

112132 {
112133 specialEventText = null;
112134 object substitutes = Lang.CreateDialogSubstitutionObject(this);
112135 if (Main.LocalPlayer.ZoneGraveyard && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Graveyard", substitutes, ref specialEventText))
112136 {
112137 return true;
112138 }
112140 {
112141 return true;
112142 }
112143 if (Main.raining && !Main.IsItStorming && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Rain", substitutes, ref specialEventText))
112144 {
112145 return true;
112146 }
112147 if (Main.IsItAHappyWindyDay && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Windy", substitutes, ref specialEventText))
112148 {
112149 return true;
112150 }
112151 if (Main.IsItStorming && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Storm", substitutes, ref specialEventText))
112152 {
112153 return true;
112154 }
112155 return false;
112156 }
static bool[] HasNoPartyText
Only applies to vanilla NPCs. Also only applies to town NPCs. If true for a given NPC type (F:Terra...
Definition NPCID.cs:423
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
bool GetSpecialEventTextIfNotEmpty(string specialTextKey, object substitutes, ref string specialEventText)
Definition NPC.cs:112158

References Terraria.Lang.CreateDialogSubstitutionObject(), Terraria.ID.NPCID.Sets.HasNoPartyText, Terraria.Main.IsItAHappyWindyDay, Terraria.Main.IsItStorming, Terraria.Main.LocalPlayer, Terraria.GameContent.Events.BirthdayParty.PartyIsUp, Terraria.Main.raining, and Terraria.Main.rand.

+ Here is the call graph for this function: