115 {
116
117
118
119
120
121
122
123
124
125
126
127
128
130 string key = null;
133 {
136 {
137 key = "Net.CannotTeleportToPylonBecausePlayerIsNotNearAPylon";
138 }
139 }
141 {
145 {
146 key = "Net.CannotTeleportToPylonBecauseNotEnoughNPCs";
147 }
148 }
150 {
155 {
156 num3 = ((
info.ModPylon?.ValidTeleportCheck_AnyDanger(
info) ??
flag) ? 1 : 0);
157 }
158 else
159 {
160 bool value =
flag3.GetValueOrDefault();
161 num3 = (value ? 1 : 0);
162 }
165 {
166 key = "Net.CannotTeleportToPylonBecauseThereIsDanger";
167 }
168 }
170 {
171 if (!
NPC.downedPlantBoss && (
double)info.PositionInTiles.Y > Main.worldSurface && Framing.GetTileSafely(
info.PositionInTiles.X,
info.PositionInTiles.Y).wall == 87)
172 {
174 }
176 {
177 key = "Net.CannotTeleportToPylonBecauseAccessingLihzahrdTempleEarly";
178 }
179 }
181 {
183 {
184 VisualScanArea = null,
185 BiomeScanCenterPositionInWorld =
info.PositionInTiles.ToWorldCoordinates(),
186 ScanOreFinderData = false
187 });
190 {
191 key = "Net.CannotTeleportToPylonBecauseNotMeetingBiomeRequirements";
192 }
193 }
195 TeleportPylonInfo
nearbyInfo =
default(TeleportPylonInfo);
198 for (
int i = 0; i <
_pylons.Count; i++)
199 {
202 {
203 continue;
204 }
207 {
209 }
212 {
214 {
216 }
218 {
219 VisualScanArea = null,
220 BiomeScanCenterPositionInWorld =
info2.PositionInTiles.ToWorldCoordinates(),
221 ScanOreFinderData = false
222 });
224 {
226 break;
227 }
228 }
229 }
231 {
233 {
234 1 => "Net.CannotTeleportToPylonBecauseNotEnoughNPCsAtCurrentPylon",
235 2 => "Net.CannotTeleportToPylonBecauseNotMeetingBiomeRequirements",
236 _ =>
"Net.CannotTeleportToPylonBecausePlayerIsNotNearAPylon",
237 };
238 }
242 {
243 Vector2
newPos =
info.PositionInTiles.ToWorldCoordinates() -
new Vector2(0
f, (
float)player.HeightOffsetBoost);
249 player.velocity = Vector2.Zero;
250 if (Main.netMode == 2)
251 {
252 RemoteClient.CheckSection(player.whoAmI, player.position);
253 NetMessage.SendData(65, -1, -1,
null, 0, player.whoAmI,
newPos.X,
newPos.Y,
num2,
number,
typeOfPylon);
254 }
255 }
256 else
257 {
259 }
260 }
static void SendChatMessageToClient(NetworkText text, Color color, int playerId)
SceneMetrics _sceneMetrics
int HowManyNPCsDoesPylonNeed(TeleportPylonInfo info, Player player)
bool DoesPylonAcceptTeleportation(TeleportPylonInfo info, Player player)
static bool IsPlayerNearAPylon(Player player)
bool DoesPylonHaveEnoughNPCsAroundIt(TeleportPylonInfo info, int necessaryNPCCount)
List< TeleportPylonInfo > _pylons
static NetworkText FromKey(string key, params object[] substitutions)
Creates a NetworkText object from a localization key and optional substitutions. The receiving client...
Represents text that will be sent over the network in multiplayer and displayed to the receiving user...
static ? bool ValidTeleportCheck_PreAnyDanger(TeleportPylonInfo pylonInfo)
static void PostValidTeleportCheck(TeleportPylonInfo destinationPylonInfo, TeleportPylonInfo nearbyPylonInfo, ref bool destinationPylonValid, ref bool validNearbyPylonFound, ref string errorKey)
void ScanAndExportToMain(SceneMetricsScanSettings settings)
static TileReachCheckSettings Pylons