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

◆ PlayerInteraction()

void Terraria.NPC.PlayerInteraction ( int player)
inline

Definition at line 72193 of file NPC.cs.

72194 {
72195 bool flag = false;
72196 if ((realLife < 0) ? (lastInteraction == player) : (Main.npc[realLife].lastInteraction == player))
72197 {
72198 return;
72199 }
72200 if (type == 13 || type == 14 || type == 15)
72201 {
72202 for (int i = 0; i < 200; i++)
72203 {
72204 if (i != whoAmI && Main.npc[i].active && (Main.npc[i].type == 13 || Main.npc[i].type == 14 || Main.npc[i].type == 15))
72205 {
72206 Main.npc[i].ApplyInteraction(player);
72207 }
72208 }
72209 }
72210 if (type == 134 || type == 135 || type == 136)
72211 {
72212 for (int j = 0; j < 200; j++)
72213 {
72214 if (j != whoAmI && Main.npc[j].active && (Main.npc[j].type == 134 || Main.npc[j].type == 135 || Main.npc[j].type == 136))
72215 {
72216 Main.npc[j].ApplyInteraction(player);
72217 }
72218 }
72219 }
72220 if (type == 35 || type == 36)
72221 {
72222 for (int k = 0; k < 200; k++)
72223 {
72224 if (k != whoAmI && Main.npc[k].active && (Main.npc[k].type == 35 || Main.npc[k].type == 36))
72225 {
72226 Main.npc[k].ApplyInteraction(player);
72227 }
72228 }
72229 }
72230 if (type == 113 || type == 114)
72231 {
72232 for (int l = 0; l < 200; l++)
72233 {
72234 if (l != whoAmI && Main.npc[l].active && (Main.npc[l].type == 113 || Main.npc[l].type == 114))
72235 {
72236 Main.npc[l].ApplyInteraction(player);
72237 }
72238 }
72239 }
72240 if (type >= 127 && type <= 131)
72241 {
72242 for (int m = 0; m < 200; m++)
72243 {
72244 if (m != whoAmI && Main.npc[m].active && Main.npc[m].type >= 127 && Main.npc[m].type <= 131)
72245 {
72246 Main.npc[m].ApplyInteraction(player);
72247 }
72248 }
72249 }
72250 if (type >= 245 && type <= 249)
72251 {
72252 for (int n = 0; n < 200; n++)
72253 {
72254 if (n != whoAmI && Main.npc[n].active && Main.npc[n].type >= 245 && Main.npc[n].type <= 249)
72255 {
72256 Main.npc[n].ApplyInteraction(player);
72257 }
72258 }
72259 }
72260 if ((type == 396 || type == 397) && Main.npc[(int)ai[3]].active && Main.npc[(int)ai[3]].type == 398)
72261 {
72262 Main.npc[(int)ai[3]].ApplyInteraction(player);
72263 }
72264 if ((type == 393 || type == 394) && Main.npc[(int)ai[0]].active && Main.npc[(int)ai[0]].type == 395)
72265 {
72266 Main.npc[(int)ai[0]].ApplyInteraction(player);
72267 }
72268 if (type == 492 && Main.npc[(int)ai[0]].active && Main.npc[(int)ai[0]].type == 491)
72269 {
72270 Main.npc[(int)ai[0]].ApplyInteraction(player);
72271 }
72272 if (type == 125 || type == 126)
72273 {
72274 for (int num = 0; num < 200; num++)
72275 {
72276 if (num != whoAmI && Main.npc[num].active && (Main.npc[num].type == 125 || Main.npc[num].type == 126))
72277 {
72278 Main.npc[num].ApplyInteraction(player);
72279 }
72280 }
72281 }
72282 ApplyInteraction(player);
72283 }
float[] ai
Definition NPC.cs:447
void ApplyInteraction(int player)
Definition NPC.cs:72285
int type
Definition NPC.cs:445
int lastInteraction
Definition NPC.cs:115
int realLife
Definition NPC.cs:173

References Terraria.Main.npc, and System.type.