Updates P:Terraria.NPC.maxFallSpeed and P:Terraria.NPC.gravity in line with vanilla behavior and resets F:Terraria.NPC.GravityMultiplier. Behavior can be modified with F:Terraria.NPC.GravityIgnoresType, F:Terraria.NPC.GravityIgnoresSpace, and F:Terraria.NPC.GravityIgnoresLiquid.
Certain NPC type ids may also cap velocity, see F:Terraria.NPC.GravityIgnoresType.
107734 {
107738 {
107740 {
107743 {
107745 }
107746 }
107747 else if (
type == 425 &&
ai[2] == 1
f)
107748 {
107750 }
107751 else if ((
type == 576 ||
type == 577) &&
ai[0] > 0
f &&
ai[1] == 2
f)
107752 {
107755 {
107757 }
107758 }
107759 else if (
type == 427 &&
ai[2] == 1
f)
107760 {
107763 {
107765 }
107766 }
107767 else if (
type == 426)
107768 {
107771 {
107773 }
107774 }
107775 else if (
type == 541)
107776 {
107778 }
107780 {
107782 }
107783 }
107785 {
107786 float num = (float)Main.maxTilesX / 4200
f;
107788 float num2 = (float)((
double)(position.Y / 16
f - (60
f + 10
f *
num)) / (Main.worldSurface / 6.0));
107789 if ((
double)
num2 < 0.25)
107790 {
107792 }
107794 {
107796 }
107798 }
107800 {
107802 {
107805 }
107807 {
107810 }
107811 else
107812 {
107815 }
107816 }
107817 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
float maxFallSpeed
The current fall speed cap in velocity applied every frame. Multiply F:Terraria....
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla NPC AI styles are enumerated in the T:Te...
float gravity
The current change in velocity due to gravity applied every frame. Multiply F:Terraria....
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
bool GravityIgnoresSpace
Set to disable the effect of being in space on NPC gravity.
bool GravityIgnoresLiquid
Set to disable the effect of being submerged in liquid on NPC gravity. Note that being submerged in...
bool GravityIgnoresType
Set to disable vanilla type and AI based NPC gravity calculations. Affects types 258,...