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

◆ RerollVariation()

bool Terraria.NPC.RerollVariation ( )
inline

Definition at line 91378 of file NPC.cs.

91379 {
91380 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
91381 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
91382 //IL_007e: Unknown result type (might be due to invalid IL or missing references)
91383 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
91384 if (!TownNPCProfiles.Instance.GetProfile(this, out var profile))
91385 {
91386 return false;
91387 }
91389 int num2 = 0;
91390 while (num2++ < 100 && townNpcVariationIndex == num)
91391 {
91392 townNpcVariationIndex = profile.RollVariation();
91393 }
91395 {
91396 return false;
91397 }
91398 GivenName = profile.GetNameForVariant(this);
91399 life = lifeMax;
91400 if (Main.netMode != 1)
91401 {
91403 particleOrchestraSettings.PositionInWorld = base.Center;
91404 particleOrchestraSettings.MovementVector = velocity;
91407 }
91408 NetMessage.TrySendData(56, -1, -1, null, whoAmI);
91409 return true;
91410 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
static void BroadcastParticleSpawn(ParticleOrchestraType type, ParticleOrchestraSettings settings)
int lifeMax
The maximum life of this NPC.
Definition NPC.cs:1077
string GivenName
The GIVEN name of this NPC. Can be set directly. Given names are unique to each NPC,...
Definition NPC.cs:1468
int townNpcVariationIndex
Definition NPC.cs:500
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
Definition NPC.cs:1072

References Terraria.GameContent.Drawing.ParticleOrchestrator.BroadcastParticleSpawn(), Terraria.GameContent.TownNPCProfiles.Instance, Terraria.Main.netMode, and Terraria.NetMessage.TrySendData().

+ Here is the call graph for this function: