Exemple #1
0
 /// <summary>
 /// Reads the pylon data from the net module
 /// </summary>
 /// <param name="data"></param>
 public void Deserialize(MemoryStream data)
 {
     PylonEventType = (SubPacketType)data.ReadInt8();
     TileX          = data.ReadInt16();
     TileY          = data.ReadInt16();
     PylonType      = (TeleportPylonType)data.ReadInt8();
 }
        private int HowManyNPCsDoesPylonNeed(TeleportPylonInfo info, Player player)
        {
            TeleportPylonType typeOfPylon = info.TypeOfPylon;

            if (typeOfPylon != TeleportPylonType.Victory)
            {
                return(2);
            }
            return(0);
        }
Exemple #3
0
        public static int PlacementPreviewHook_CheckIfCanPlace(int x, int y, int type = 597, int style = 0, int direction = 1, int alternate = 0)
        {
            TeleportPylonType pylonTypeFromPylonTileStyle = GetPylonTypeFromPylonTileStyle(style);

            if (Main.PylonSystem.HasPylonOfType(pylonTypeFromPylonTileStyle))
            {
                return(1);
            }
            return(0);
        }
Exemple #4
0
        public static int PlacementPreviewHook_CheckIfCanPlace(
            int x,
            int y,
            int type      = 597,
            int style     = 0,
            int direction = 1,
            int alternate = 0)
        {
            TeleportPylonType fromPylonTileStyle = TETeleportationPylon.GetPylonTypeFromPylonTileStyle(style);

            return(Main.PylonSystem.HasPylonOfType(fromPylonTileStyle) ? 1 : 0);
        }
Exemple #5
0
        private bool TryGetPylonTypeFromTileCoords(int x, int y, out TeleportPylonType pylonType)
        {
            pylonType = TeleportPylonType.SurfacePurity;
            Tile tile = Main.tile[x, y];

            if (tile == null || !tile.active() || tile.type != (ushort)597)
            {
                return(false);
            }
            int pylonStyle = (int)tile.frameX / 54;

            pylonType = TETeleportationPylon.GetPylonTypeFromPylonTileStyle(pylonStyle);
            return(true);
        }
 public bool TryGetPylonType(out TeleportPylonType pylonType)
 {
     return(TryGetPylonTypeFromTileCoords(Position.X, Position.Y, out pylonType));
 }
 public bool HasPylonOfType(TeleportPylonType pylonType)
 {
     return(_pylons.Any((TeleportPylonInfo x) => x.TypeOfPylon == pylonType));
 }
Exemple #8
0
 public bool TryGetPylonType(out TeleportPylonType pylonType)
 {
     return(this.TryGetPylonTypeFromTileCoords((int)this.Position.X, (int)this.Position.Y, out pylonType));
 }
Exemple #9
0
 public bool HasPylonOfType(TeleportPylonType pylonType)
 {
     return(this._pylons.Any <TeleportPylonInfo>((Func <TeleportPylonInfo, bool>)(x => x.TypeOfPylon == pylonType)));
 }