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

◆ Collision_DecideFallThroughPlatforms()

bool Terraria.NPC.Collision_DecideFallThroughPlatforms ( )
inlineprivate

Definition at line 110125 of file NPC.cs.

110126 {
110127 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
110128 //IL_0201: Unknown result type (might be due to invalid IL or missing references)
110129 //IL_0218: Unknown result type (might be due to invalid IL or missing references)
110130 //IL_03ef: Unknown result type (might be due to invalid IL or missing references)
110132 if (flag2.HasValue)
110133 {
110134 return flag2.GetValueOrDefault();
110135 }
110136 bool result = false;
110137 if (type == 2 || type == -43 || type == 190 || type == 191 || type == 192 || type == 193 || type == 194 || type == 317 || type == 318 || type == 133)
110138 {
110139 result = true;
110140 }
110141 if (aiStyle == 10)
110142 {
110143 result = true;
110144 }
110145 if (aiStyle == 5)
110146 {
110147 result = true;
110148 }
110149 if (aiStyle == 40)
110150 {
110151 result = true;
110152 }
110153 if (aiStyle == 44)
110154 {
110155 result = true;
110156 }
110157 if (type == 467)
110158 {
110159 result = true;
110160 }
110161 if (type == 477)
110162 {
110163 result = true;
110164 }
110165 if (aiStyle == 22)
110166 {
110167 result = true;
110168 }
110169 if (aiStyle == 49)
110170 {
110171 result = true;
110172 }
110173 if (aiStyle == 14)
110174 {
110175 result = true;
110176 }
110177 if (type == 173)
110178 {
110179 result = true;
110180 }
110181 if (type == 469 && ai[2] == 1f)
110182 {
110183 result = true;
110184 }
110185 if (aiStyle == 3 && directionY == 1)
110186 {
110187 result = true;
110188 }
110189 if (type == 210 || type == 211)
110190 {
110191 result = true;
110192 }
110193 if (type == 50 && target >= 0 && Main.player[target].position.Y > position.Y + (float)height)
110194 {
110195 result = true;
110196 }
110197 if (type == 657 && target >= 0 && Main.player[target].position.Y > base.Bottom.Y)
110198 {
110199 result = true;
110200 }
110201 if (aiStyle == 26 && target >= 0 && Main.player[target].Bottom.Y - velocity.Y > base.Bottom.Y)
110202 {
110203 result = true;
110204 }
110205 if (type == 247 || type == 248)
110206 {
110207 result = true;
110208 }
110209 if (type == 245 && target >= 0 && Main.player[target].position.Y > position.Y + (float)height)
110210 {
110211 result = true;
110212 }
110213 if (type >= 542 && type <= 545)
110214 {
110215 result = true;
110216 }
110217 if (aiStyle == 107 && directionY == 1)
110218 {
110219 result = true;
110220 }
110221 if (type == 418)
110222 {
110223 result = true;
110224 }
110225 if (aiStyle == 87 && Main.player[target].position.Y > position.Y + (float)height)
110226 {
110227 result = true;
110228 }
110229 if (type == 405 || type == 406)
110230 {
110231 result = true;
110232 }
110233 if (type == 490)
110234 {
110235 result = true;
110236 }
110237 if (type == 301)
110238 {
110239 result = true;
110240 }
110241 if (aiStyle == 7)
110242 {
110243 int num = 16;
110244 bool flag = false;
110245 if (townNPC && (!Main.dayTime || Main.invasionType > 0 || Main.eclipse))
110246 {
110247 flag = true;
110248 }
110249 else
110250 {
110251 int num2 = (int)(position.Y + (float)height) / 16;
110252 if (homeTileY - num2 > num)
110253 {
110254 result = true;
110255 }
110256 }
110257 if (flag && (position.Y + (float)height - 8f) / 16f < (float)(homeTileY - 1))
110258 {
110259 result = true;
110260 }
110261 }
110262 if (type == 620)
110263 {
110264 result = ((target >= 0 && Main.player[target].position.Y > base.Bottom.Y) ? true : false);
110265 }
110266 return result;
110267 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static ? bool CanFallThroughPlatforms(NPC npc)
Definition NPCLoader.cs:802
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla NPC AI styles are enumerated in the T:Te...
Definition NPC.cs:1013
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
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
int directionY
Definition NPC.cs:983
int target
Definition NPC.cs:1019
bool townNPC
Definition NPC.cs:1174
int homeTileY
Definition NPC.cs:1182

References Terraria.ModLoader.NPCLoader.CanFallThroughPlatforms(), Terraria.Main.dayTime, Terraria.Main.eclipse, Terraria.Main.invasionType, and Terraria.Main.player.

+ Here is the call graph for this function: