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

◆ HasLuckTextForWizard()

bool Terraria.NPC.HasLuckTextForWizard ( out string specialEventText)
inline

Definition at line 91500 of file NPC.cs.

91501 {
91502 specialEventText = null;
91503 object obj = Lang.CreateDialogSubstitutionObject(this);
91504 if (Main.rand.Next(3) == 0)
91505 {
91506 float normalizedLuck = Main.player[Main.myPlayer].NormalizedLuck;
91507 if (normalizedLuck == 0f)
91508 {
91509 return false;
91510 }
91511 string text = null;
91512 text = ((normalizedLuck < -0.6f) ? "WizardSpecialText.LuckIsCursed" : ((normalizedLuck < -0.4f) ? "WizardSpecialText.LuckIsTerrible" : ((normalizedLuck < -0.2f) ? "WizardSpecialText.LuckIsPoor" : ((normalizedLuck < 0f) ? "WizardSpecialText.LuckIsBad" : ((normalizedLuck < 0.25f) ? "WizardSpecialText.LuckIsGood" : ((normalizedLuck < 0.5f) ? "WizardSpecialText.LuckIsGreat" : ((!(normalizedLuck < 0.75f)) ? "WizardSpecialText.LuckIsGodly" : "WizardSpecialText.LuckIsAmazing")))))));
91513 specialEventText = Language.SelectRandom(Lang.CreateDialogFilter(text)).FormatWith(obj);
91514 return true;
91515 }
91516 return false;
91517 }
static LocalizedText SelectRandom(LanguageSearchFilter filter, UnifiedRandom random=null)
Definition Language.cs:65

References Terraria.Lang.CreateDialogFilter(), Terraria.Lang.CreateDialogSubstitutionObject(), Terraria.Main.myPlayer, System.obj, Terraria.Main.player, Terraria.Main.rand, Terraria.Localization.Language.SelectRandom(), and System.text.