TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.Wiring Class Reference
+ Collaboration diagram for Terraria.Wiring:

Static Public Member Functions

static void SetCurrentUser (int plr=-1)
 
static void Initialize ()
 
static void SkipWire (int x, int y)
 Use to prevent wire signals from running for the provided coordinates. Typically used in multi-tiles to prevent a wire touching multiple tiles of the multi-tile from erroneously running wire code multiple times. In M:Terraria.ModLoader.ModTile.HitWire(System.Int32,System.Int32), call SkipWire for all the coordinates the tile covers.
 
static void SkipWire (Point16 point)
 
static void ClearAll ()
 
static void UpdateMech ()
 
static void HitSwitch (int i, int j)
 
static void PokeLogicGate (int lampX, int lampY)
 
static bool Actuate (int i, int j)
 
static void ActuateForced (int i, int j)
 
static void MassWireOperation (Point ps, Point pe, Player master)
 
static bool CheckMech (int i, int j, int time)
 Returns true if the wiring cooldown has been reached for the provided tile coordinates. The time parameter will set the cooldown if wiring cooldown has elapsed. Use larger values for less frequent activations. Use this method to limit how often mechanisms can be triggerd. M:Terraria.Item.MechSpawn(System.Single,System.Single,System.Int32) and M:Terraria.NPC.MechSpawn(System.Single,System.Single,System.Int32) should also be checked for mechanisms spawning items or NPC, such as Statues.
 
static void TripWire (int left, int top, int width, int height)
 Used to send a single to wiring wired up to the specified area. The parameters represent the tile coordinates where wire signals will be sent. Mechanism tiles such as F:Terraria.ID.TileID.Switches, F:Terraria.ID.TileID.PressurePlates, F:Terraria.ID.TileID.Timers, and F:Terraria.ID.TileID.LogicSensor use this method as part of their interaction code.
 
static IEntitySource GetProjectileSource (int sourceTileX, int sourceTileY)
 
static IEntitySource GetNPCSource (int sourceTileX, int sourceTileY)
 
static IEntitySource GetItemSource (int sourceTileX, int sourceTileY)
 
static void ToggleHolidayLight (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
 
static void ToggleHangingLantern (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void Toggle2x2Light (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void ToggleLampPost (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void ToggleTorch (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
 
static void ToggleCandle (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn)
 
static void ToggleLamp (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void ToggleChandelier (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void ToggleCampFire (int i, int j, Tile tileCache, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void ToggleFirePlace (int i, int j, Tile theBlock, bool? forcedStateWhereTrueIsOn, bool doSkipWires)
 
static void DeActive (int i, int j)
 
static void ReActive (int i, int j)
 

Static Public Attributes

static bool blockPlayerTeleportationForOneIteration
 
static bool running
 True while wiring pulse code is running, which happens in M:Terraria.Wiring.TripWire(System.Int32,System.Int32,System.Int32,System.Int32). Check this before calling M:Terraria.Wiring.SkipWire(System.Int32,System.Int32) in any code that is shared between wiring and other interactions to prevent buggy behavior.

For example, the code in ExampleCampfireneeds to check F:Terraria.Wiring.running because the code is shared between wiring and right click interactions.
 
static DoubleStack< Point16_wireList
 
static DoubleStack< byte > _wireDirectionList
 
static Dictionary< Point16, byte > _toProcess
 
static Queue< Point16_LampsToCheck
 
static Queue< Point16_GatesNext
 
static Vector2[] _teleport
 
static int[] _inPumpX
 
static int[] _inPumpY
 
static int _numInPump
 
static int[] _outPumpX
 
static int[] _outPumpY
 
static int _numOutPump
 
static int _currentWireColor
 

Static Private Member Functions

static void XferWater ()
 
static void PixelBoxPass ()
 
static void LogicGatePass ()
 
static void CheckLogicGate (int lampX, int lampY)
 
static void HitWire (DoubleStack< Point16 > next, int wireType)
 
static void HitWireSingle (int i, int j)
 
static void GeyserTrap (int i, int j)
 
static void Teleport ()
 
static bool TeleporterHitboxIntersects (Rectangle teleporter, Rectangle entity)
 
static void MassWireOperationInner (Player user, Point ps, Point pe, Vector2 dropPoint, bool dir, ref int wireCount, ref int actuatorCount)
 
static ? bool MassWireOperationStep (Player user, Point pt, WiresUI.Settings.MultiToolMode mode, ref int wiresLeftToConsume, ref int actuatorsLeftToConstume)
 

Static Private Attributes

static Dictionary< Point16, bool > _wireSkip
 
static Queue< Point16_GatesCurrent
 
static Dictionary< Point16, bool > _GatesDone
 
static Dictionary< Point16, byte > _PixelBoxTriggers
 
const int MaxPump = 20
 
const int MaxMech = 1000
 
static int[] _mechX
 
static int[] _mechY
 
static int _numMechs
 
static int[] _mechTime
 
static int CurrentUser = 255
 

Detailed Description

Definition at line 14 of file Wiring.cs.


The documentation for this class was generated from the following file: