63 tileCoordsForToggling.Y -= tile.frameY % 54 / 18;
65 result.handler =
this;
66 result.tileCoordsForToggling = tileCoordsForToggling;
73 int intendedOpeningDirection =
playerInfo.intendedOpeningDirection;
78 rectangle.Height += 16;
82 rectangle.Height += 16;
93 WorldGen.
OpenDoor(tileCoordsForToggling.
X, tileCoordsForToggling.
Y, intendedOpeningDirection);
94 if (
Main.
tile[tileCoordsForToggling.
X, tileCoordsForToggling.
Y].type != 10)
96 NetMessage.
SendData(19, -1, -1,
null, 0, tileCoordsForToggling.
X, tileCoordsForToggling.
Y, intendedOpeningDirection);
99 WorldGen.
OpenDoor(tileCoordsForToggling.
X, tileCoordsForToggling.
Y, -intendedOpeningDirection);
100 if (
Main.
tile[tileCoordsForToggling.
X, tileCoordsForToggling.
Y].type != 10)
102 NetMessage.
SendData(19, -1, -1,
null, 0, tileCoordsForToggling.
X, tileCoordsForToggling.
Y, -intendedOpeningDirection);
110 Point tileCoordsForToggling =
info.tileCoordsForToggling;
111 Tile tile =
Main.
tile[tileCoordsForToggling.
X, tileCoordsForToggling.
Y];
116 int num = tile.frameX % 72 / 18;
149 tileCoordsForToggling.Y -= tile.frameY % 90 / 18;
151 result.handler =
this;
152 result.tileCoordsForToggling = tileCoordsForToggling;
158 Point tileCoordsForToggling =
doorInfo.tileCoordsForToggling;
163 rectangle.Height += 16;
167 rectangle.Height += 16;
181 NetMessage.
SendData(19, -1, -1,
null, 4 + flag.ToInt(), tileCoordsForToggling.
X, tileCoordsForToggling.
Y);
189 Point tileCoordsForToggling =
info.tileCoordsForToggling;
190 Tile tile =
Main.
tile[tileCoordsForToggling.
X, tileCoordsForToggling.
Y];
195 _ = tile.frameY % 90 / 18;
207 NetMessage.
SendData(19, -1, -1,
null, 4 + flag.ToInt(), tileCoordsForToggling.
X, tileCoordsForToggling.
Y);
254 DoorAutoOpeningPreference.EnabledForEverything =>
true,
292 result.hitboxToNotCloseDoor = player.
Hitbox;
318 int playerGravityDirection = (int)player.
gravDir;
338 Point point =
r.TopLeft().ToTileCoordinates();
342 result.hitboxToOpenDoor =
hitbox;
343 result.intendedOpeningDirection = num;
344 result.playerGravityDirection = playerGravityDirection;
345 result.tileCoordSpaceForCheckingForDoors = tileCoordSpaceForCheckingForDoors;
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
static double Ceiling(double a)
static double Abs(double value)
static int Sign(decimal value)
DoorOpenCloseTogglingInfo ProvideInfo(Point tileCoords)
DoorCloseAttemptResult TryCloseDoor(DoorOpenCloseTogglingInfo info, PlayerInfoForClosingDoors playerInfo)
bool TryOpenDoor(DoorOpenCloseTogglingInfo doorInfo, PlayerInfoForOpeningDoors playerInfo)
bool TryOpenDoor(DoorOpenCloseTogglingInfo doorInfo, PlayerInfoForOpeningDoors playerInfo)
DoorCloseAttemptResult TryCloseDoor(DoorOpenCloseTogglingInfo info, PlayerInfoForClosingDoors playerInfo)
DoorOpenCloseTogglingInfo ProvideInfo(Point tileCoords)
static DoorAutoOpeningPreference PreferenceSettings
PlayerInfoForOpeningDoors GetPlayerInfoForOpeningDoor(Player player)
void AllowOpeningDoorsByVelocityAloneForATime(int timeInFramesToAllow)
void Update(Player player)
static void CyclePreferences()
DoorAutoOpeningPreference
bool ShouldTryOpeningDoors()
void LookForDoorsToOpen(Player player)
void TryAutoOpeningDoor(Point tileCoords, PlayerInfoForOpeningDoors playerInfo)
Dictionary< int, DoorAutoHandler > _handlerByTileType
bool TryGetHandler(Point tileCoords, out DoorAutoHandler infoProvider)
List< DoorOpenCloseTogglingInfo > _ongoingOpenDoors
PlayerInfoForClosingDoors GetPlayerInfoForClosingDoor(Player player)
int _timeWeCanOpenDoorsUsingVelocityAlone
void LookForDoorsToClose(Player player)
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
static bool OpenDoor(int i, int j, int direction)
static bool CloseDoor(int i, int j, bool forced=false)
static bool ShiftTallGate(int x, int y, bool closing, bool forced=false)
static bool InWorld(int x, int y, int fluff=0)
bool TryOpenDoor(DoorOpenCloseTogglingInfo info, PlayerInfoForOpeningDoors playerInfo)
DoorCloseAttemptResult TryCloseDoor(DoorOpenCloseTogglingInfo info, PlayerInfoForClosingDoors playerInfo)
DoorOpenCloseTogglingInfo ProvideInfo(Point tileCoords)
static Rectangle Intersect(Rectangle value1, Rectangle value2)
static Rectangle Union(Rectangle value1, Rectangle value2)
Point tileCoordsForToggling
Rectangle hitboxToNotCloseDoor
Rectangle hitboxToOpenDoor
Rectangle tileCoordSpaceForCheckingForDoors
int playerGravityDirection
int intendedOpeningDirection