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

◆ HasSpecialEventText()

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

Definition at line 91519 of file NPC.cs.

91520 {
91521 specialEventText = null;
91522 object substitutes = Lang.CreateDialogSubstitutionObject(this);
91523 if (Main.LocalPlayer.ZoneGraveyard && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Graveyard", substitutes, ref specialEventText))
91524 {
91525 return true;
91526 }
91528 {
91529 return true;
91530 }
91531 if (Main.raining && !Main.IsItStorming && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Rain", substitutes, ref specialEventText))
91532 {
91533 return true;
91534 }
91535 if (Main.IsItAHappyWindyDay && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Windy", substitutes, ref specialEventText))
91536 {
91537 return true;
91538 }
91539 if (Main.IsItStorming && Main.rand.Next(3) == 0 && GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Storm", substitutes, ref specialEventText))
91540 {
91541 return true;
91542 }
91543 return false;
91544 }
static bool[] HasNoPartyText
Definition NPCID.cs:4204
int type
Definition NPC.cs:445
bool GetSpecialEventTextIfNotEmpty(string specialTextKey, object substitutes, ref string specialEventText)
Definition NPC.cs:91546

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, Terraria.Main.rand, and System.type.