diff --git a/CalPlayer/Dashes/PlayerDashManager.cs b/CalPlayer/Dashes/PlayerDashManager.cs index d28827ea6d..724292f85f 100644 --- a/CalPlayer/Dashes/PlayerDashManager.cs +++ b/CalPlayer/Dashes/PlayerDashManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Terraria; +using Terraria.ModLoader.Core; namespace CalamityMod.CalPlayer.Dashes { @@ -44,7 +45,8 @@ namespace CalamityMod.CalPlayer.Dashes { DashIdentificationTable = new(); Type baseType = typeof(PlayerDashEffect); - foreach (Type type in CalamityMod.Instance.Code.GetTypes()) + Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + foreach (Type type in types) { // Ignore any types which are not dash effects or are abstract. // This eliminates the PlayerDashEffect template type, which cannot have instances. diff --git a/CalamityMod.cs b/CalamityMod.cs index f94136beed..b13eacd509 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -144,6 +144,7 @@ namespace CalamityMod internal Mod crouchMod = null; internal Mod dialogueTweak = null; internal Mod fargos = null; + internal Mod luminance = null; internal Mod magicStorage = null; internal Mod overhaul = null; internal Mod redemption = null; @@ -179,6 +180,8 @@ namespace CalamityMod ModLoader.TryGetMod("DialogueTweak", out dialogueTweak); fargos = null; ModLoader.TryGetMod("Fargowiltas", out fargos); + luminance = null; + ModLoader.TryGetMod("Luminance", out luminance); magicStorage = null; ModLoader.TryGetMod("MagicStorage", out magicStorage); overhaul = null; @@ -424,6 +427,7 @@ namespace CalamityMod crouchMod = null; dialogueTweak = null; fargos = null; + luminance = null; magicStorage = null; overhaul = null; redemption = null; diff --git a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs index ae22039d7d..fd242a29e5 100644 --- a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs +++ b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Runtime.Serialization; using Terraria; using Terraria.ID; +using Terraria.ModLoader.Core; namespace CalamityMod.Items.VanillaArmorChanges { @@ -15,7 +16,8 @@ namespace CalamityMod.Items.VanillaArmorChanges internal static void Load() { ArmorChanges = new List(); - foreach (Type type in CalamityMod.Instance.Code.GetTypes()) + Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + foreach (Type type in types) { if (!type.IsSubclassOf(typeof(VanillaArmorChange)) || type.IsAbstract) continue; diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 05c2f03692..d0f99778f5 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -33,6 +33,7 @@ NoDifficultyInfo: The classic Terraria experience, with no Calamity difficulty c Revengeance: Revengeance RevMaster: Rev+Master RevLegend: Rev+Legend +RevengeanceEnabled: Revengeance Mode is enabled RevengeanceShortInfo: "[c/F54254:The intended Calamity experience!]" RevengeanceExpandedInfo: ''' @@ -49,6 +50,7 @@ RevengeanceDeactivate: Revengeance is not active. Death: Death DeathMaster: Death+Master DeathLegend: Death+Legend +DeathEnabled: Death Mode is enabled DeathShortInfo: "[c/C82DF7:A tougher challenge for the more experienced, or for those that want a step up from Revengeance Mode]" DeathExpandedInfo: ''' diff --git a/ModSupport/Luminance/Luminance.dll b/ModSupport/Luminance/Luminance.dll new file mode 100644 index 0000000000..96d943374b Binary files /dev/null and b/ModSupport/Luminance/Luminance.dll differ diff --git a/ModSupport/Luminance/Luminance.xml b/ModSupport/Luminance/Luminance.xml new file mode 100644 index 0000000000..5aa1be01e1 --- /dev/null +++ b/ModSupport/Luminance/Luminance.xml @@ -0,0 +1,2849 @@ + + + + Luminance + + + + + wrapper that facilitates lazy-loading. + + The asset type. + + + + wrapper that facilitates lazy-loading. + + The asset type. + + + + The lazy-initialized asset. + + + + + The value underlying this asset. + + + + + Requests an asset, wrapped in a . + + The path to the asset. + The request mode by which the asset should be loaded. Defaults to . + + + + An elastic easing curves. Characterized chiefly by small bumps at extreme points. + + + + + A linear easing curve. + + + + + A sine easing curve. + + + + + An exponential easing curve. + + + + + A circular easing curve. + + + + + A polynomial easing curve of degree 2. + + + + + A polynomial easing curve of degree 3. + + + + + A polynomial easing curve of degree 4. + + + + + A polynomial easing curve of degree 5. + + + + + A polynomial easing curve of degree 6. + + + + + Creates a polynomial easing curves with an arbitrary exponent/potentially-non-integer degree. + + The exponent of the polynomial curve. + + + + An easing mode. + + + "In" curves start out slowly but gradually reach their end value, similar to an x^2 function.

+ "Out" curves start out quickly but gradually slow down to reach their end value, similar to an x^0.5 function.

+ "InOut" curves start out and end gradually, but accelerate near the middle, similar to a smoothstep function. +
+
+ + + A piecewise curve that takes up a part of the domain of a , specifying the equivalent range and curvature in said domain. + + + + + A piecewise curve that takes up a part of the domain of a , specifying the equivalent range and curvature in said domain. + + + + + The list of that encompass the entire 0-1 domain of this function. + + + + + Inserts a new easing curve into the domain of the overall piecewise curve. + + The curve to insert. + The type to use when evaluating the curve, such as In, Out, or InOut. + The ending height of the curve. + The ending input domain for the newly added curve. Must be greater than 0 and less than or equal to 1. + An optional starting height for the curve. Defaults to the ending height of the last curve, or 0 if there are no curves yet. + The original easing curve, for method chaining purposes. + + + + + Evaluates the result of the chained easing curves as a given 0-1 interpolant value. + + + + The interpolant value is automatically clamped between 0-1 by this method, since the domain of piecewise curves exists solely within those bounds. + + + The interpolant input to evaluate at. + + + + A piecewise rotation curve that takes up a part of the domain of a , specifying the equivalent range and curvature in said domain. + + + + + A piecewise rotation curve that takes up a part of the domain of a , specifying the equivalent range and curvature in said domain. + + + + + The list of that encompass the entire 0-1 domain of this function. + + + + + Adds a new interpolation step to this piecewise rotation curve, encompassing a part of the animation function's domain. + + The curve. + The type of curve to use. + The ending rotation to interpolate between. + The ending interpolant that this rotation should encompass. + The starting rotation to interpolate between. Uses the last rotation by default, assuming it isn't empty. + The original rotation, for method chaining purposes. + + + + + Evaluates the overall rotation curve, interpolating between configurations as necessary. + + The animation completion interpolant. + Whether rotations should take the optimal route in cases where the rotational difference exceeds 180 degrees. One might want this disabled for giant swings, so that the full arc is travelled. + The direction of inversion with respect to the optimal route taking. + + + + Marks a method as associated with the provided for the purpose of automated state machine behavior linking. + + The state to register this method as behavior for. + + + + Marks a method as associated with the provided for the purpose of automated state machine behavior linking. + + The state to register this method as behavior for. + + + + The associated state of the method. + + + + + Fills the 's behaviors with all methods in the provided instance that have this attribute. + + The type of the instance that will access the methods. + The state machine to fill. + The instance to access the methods with. + + + + Invokes all methods marked with a for a given object. + + The object instance to check methods for. + + + + An implementation of that adds only a simple integer timer. + + The type that this state is associated with. + The identifying value for this specific state. + + + + An implementation of that adds only a simple integer timer. + + The type that this state is associated with. + The identifying value for this specific state. + + + + The identifier for this state. + + + + + A local timer that exists for use by this state. + + + + + Represents an abstraction of a state within a , containing local information specific to the state, such as timers or switches, as it sits within the stack. + + + + + + The identifier for this state. + + + + + A method called whenever this state is popped from the stack in the . + + + + + Represents a framework for hijacking a transition's final state selection. + This is useful for allowing states to transition to something customized when its default transition condition has been triggered, without having to duplicate conditions many times. + + + + + Represents a framework for hijacking a transition's final state selection. + This is useful for allowing states to transition to something customized when its default transition condition has been triggered, without having to duplicate conditions many times. + + + + + Represents a framework for a state transition's information. + + + + + Represents a framework for a state transition's information. + + + + + Delegate for actions that run when is fired. + + + + + A collection of custom states that should be performed when a state is ongoing. + + + + + A list of hijack actions to perform during a state transition. + + + + + A generalized registry of states with individualized data. + + + + + The state stack for the automaton. + + + + + The current state of the automaton. + + + + + The set of actions that should occur when a state is popped. + + + + + The set of actions that should occur when a state transition occurs. + + + + + Registers a state in the registry. + + The state to register. + + + + Links an action to a state identifier as its behavior. + + + Consider using instead of this method to reduce boilerplate. + + + + + + + Registers a transition between two states. + + The state to transition from. + The state to transition to. + Whether to pop the initial state or not, useful for states that pause other states instead of replacing them. + The condition that must be fulfilled for the transition to occur. + An optional action that runs when the transition occurs. + + + + Applies an action to every registered state in this machine, barring any provided exceptions. A good use example is for states that interrupt most other states if a certain condition is met. + + The action to perform. + The list of exceptions. + + + + Shifts a point until it reaches level ground. + + The original point. + + + + Shifts a point until it reaches level ground. + + The original point. + The direction to search in. + + + + Draws a projectile as a series of afterimages. The first of these afterimages is centered on the center of the projectile's hitbox.
+ This function is guaranteed to draw the projectile itself, even if it has no afterimages and/or the Afterimages config option is turned off. +
+ The projectile to be drawn. + The type of afterimage drawing code to use. Vanilla Terraria has three options: 0, 1, and 2. + The light color to use for the afterimages. + If mode 1 is used, this controls the loop increment. Set it to more than 1 to skip afterimages. + An optional override to set the amount of afterimages that are drawn. + The minimum scaling factor across the afterimages. Defaults to 1, but values below that allow for afterimages to "shrink" as they get smaller. + An interpolant that determines how clumped afterimages are to the original position via Vector2.Lerp(afterimagePosition, Projectile.Center, positionClumpInterpolant). + The texture to draw. Set to null to draw the projectile's own loaded texture. + If false, the afterimages will be centered on the projectile's position instead of its own center. +
+ + + Draws a simple bloom line from a starting point to an ending point. Positional parameters are expected to be in world position. +

+ This method expects to be drawn with . +
+ The sprite batch to draw the line with. + The world position of the start of the line. + The world position of the end of the line. + The color of the line. + How wide the line should be. +
+ + + Returns a color interpolation similar to that supports multiple colors. + + The 0-1 incremental value used when interpolating. + The various colors to interpolate across. + + + + Returns a color lerp that allows for smooth transitioning between two given colors. + + The first color you want it to switch between. + The second color you want it to switch between. + How long you want it to take to swap between colors. This accounts for dividing by zero errors. + + + + Hue shifts a given color by a desired amount. The hue spectrum is within a 0-1 range. + + The original color. + The amount to offset the hue by. + + + + Flips an origin around a in accordance with a direction. + + The texture to flip based on. + The unmodified origin. + The direction to use as a basis for flipping. + + + + Flips an origin around a frame in accordance with a direction. + + The frame to flip based on. + The unmodified origin. + The direction to use as a basis for flipping. + + + + Generates an arbitrary quantity of evenly spaced laser point positions for a projectile. Commonly used when calculating points for primitive-based laser beams. + + The projectile to calculate positions from. + The amount of subdivisions that should be performed. Larger values are more precise, but also more computationally expensive to use. + The length of the laser. Used for determining the end point of the laser. + The direction of the laser. By default uses the unit direction of the projectile's velocity. + + + + Calculates matrices for usage by vertex shaders, notably in the context of primitive meshes. + + The width of the overall view. + The height of the overall view. + The view matrix. + The projection matrix. + Whether this is for UI. Controls whether gravity screen flipping is taken into account. + + + + Calculates a for the purpose of resets in the context of background/sky drawing. + + + + + Converts world positions to 0-1 UV values relative to the screen. This is incredibly useful when supplying position data to screen shaders. + + The world position. + + + + Swaps the to a desired render target and clears said render target's contents. +

+ Be careful when using this method. Render targets have been observed to cause significant lag on weaker devices, and as such should be manipulated only as necessary. +
+ The desired render target. + The color to reset the render target's contents to. Defaults to . +
+ + + A blend state that works opposite to , making colors darker based on intensity rather than brighter. + + + + + Resets a sprite batch with a desired . The is specified as . If is needed, use instead. +

+ Like any sprite batch resetting function, use this sparingly. Overusage (such as performing this operation multiple times per frame) will lead to significantly degraded performance on weaker systems. +
+ The sprite batch. + The desired blend state. +
+ + + Resets the sprite batch with blending, along with an optional . For use when shaders are necessary. +

+ Like any sprite batch resetting function, use this sparingly. Overusage (such as performing this operation multiple times per frame) will lead to significantly degraded performance on weaker devices. +
+ The sprite batch. + An optional blend state. If none is supplied, is used. + Whether this is for UI drawing or not. Controls what matrix is used. +
+ + + Resets the sprite batch to its 'default' state relative to most effects in the game, with a default blend state and sort mode. For use after the sprite batch state has been altered and needs to be reset. +

+ Like any sprite batch resetting function, use this sparingly. Overusage (such as performing this operation multiple times per frame) will lead to significantly degraded performance on weaker systems. +
+ The sprite batch. + Whether to call first and flush the contents of the previous draw batch. Defaults to true. +
+ + + Resets the sprite batch to its 'default' state relative to the UI, with a default blend state and sort mode. For use after the sprite batch state has been altered and needs to be reset. +

+ Like any sprite batch resetting function, use this sparingly. Overusage (such as performing this operation multiple times per frame) will lead to significantly degraded performance on weaker systems. +
+ The sprite batch. + Whether to call first and flush the contents of the previous draw batch. Defaults to true. +
+ + + Prepares a specialized with enabled screen culling, for efficiency reasons. It also informs the of this change. + + + + + Draws an atlas texture to the screen. + + + + + Determine whether a given destination point is right of a given entity. + + The entity to check relative to. + The point to check. + + + + Determine whether a given destination point is right of a given entity. + + The entity to check relative to. + The other entity whose center point should be checked. + + + + Calculates the direction to a given position from an entity with safely performed underlying normalization. + + The entity to perform the calculations relative to. + The position to get the direction towards. + + + + Calculates the X direction to a given position from an entity. + + The entity to perform the calculations relative to. + The position to get the direction towards. + + + + Defines a given 's HP based on the current difficulty mode. + + The NPC to set the HP for. + HP value for normal mode + HP value for expert mode + HP value for master mode + + + + Excludes a given from the bestiary completely. + + The NPC to apply the bestiary deletion to. + + + + A simple utility that gracefully gets a 's instance as a specific type without having to do clunky casting. + + + In the case of casting errors, this will create a log message that informs the user of the failed cast and fall back on a dummy instance. + + The ModNPC type to convert to. + The NPC to access the ModNPC from. + + + + Checks if any bosses are present this frame. + + + + + Gives a given infinite flight. + + The player to apply infinite flight to. + + + + Gets the current mouse item for a given . This supports (the item held by the cursor) and (the item in use with the hotbar). + + The player to retrieve the mouse item for. + + + + Summons a projectile of a specific type while also adjusting damage for vanilla spaghetti regarding hostile projectiles. + + The source of the projectile. + The X spawn position of the projectile. + The Y spawn position of the projectile. + The X velocity of the projectile. + The Y velocity of the projectile + The id of the projectile type that should be spawned. + The damage of the projectile. + The knockback of the projectile. + The owner index of the projectile. + An optional [0] fill value. Defaults to 0. + An optional [1] fill value. Defaults to 0. + An optional [2] fill value. Defaults to 0. + + + + Summons a projectile of a specific type while also adjusting damage for vanilla spaghetti regarding hostile projectiles. + + The source of the projectile. + The spawn position of the projectile. + The velocity of the projectile + The id of the projectile type that should be spawned. + The damage of the projectile. + The knockback of the projectile. + The owner index of the projectile. + An optional [0] fill value. Defaults to 0. + An optional [1] fill value. Defaults to 0. + An optional [2] fill value. Defaults to 0. + + + + Returns all projectiles present of a specific type. + + The projectile type to check for. + + + + Determines if a is on its final extra update. Useful for things like timer increments, which may only want to be performed once every frame. + + The projectile to check. + + + + Checks if a given projectile ID is present anywhere. + + The projectile ID to check for. + + + + Counts the amount of projectiles of any given IDs. + + The projectile IDs to check for. + + + + Checks whether the projectile's hitbox intersects the screen, accounting for the setting. + + The projectile to check. + + + + A simple utility that gracefully gets a 's instance as a specific type without having to do clunky casting. + + + In the case of casting errors, this will create a log message that informs the user of the failed cast and fall back on a dummy instance. + + The ModProjectile type to convert to. + The Projectile to access the ModProjectile from. + + + + Finds the projectile with the current identity that belongs to the provided owner. + + The projectile, null if one was not found. + + + + Enables toggled tile states on the X frame based on whether a wire signal is flowing through the tile. +

+ This works for multi-framed tiles, checking the top-left-most tile. +
+ The tile's ID. + The X position of the tile. + The Y position of the tile. + The width of the overall tile. + The height of overall tile. +
+ + + Determines if a typical hitbox rectangle is intersecting a circular hitbox. + + The center of the circular hitbox. + The radius of the circular hitbox. + The hitbox of the target to check. + + + + Performs collision based a rotating hitbox for an entity by treating the hitbox as a line. By default uses the velocity of the entity as a direction. This can be overridden. + + The entity. + The top left coordinates of the target to check. + The hitbox size of the target to check. + An optional direction override + The scale of the hitbox. + + + + Determines the distance required before a ray in a given direction from a given starting position hits solid tiles. Gives up after a certain quantity of tiles, or when a world border is reached. + + The point to check from. + The direction in which tiles are checked. Will always be a unit vector. + How many times to repeat a step and check for collision before giving up and returning. + + + + Wraps an angle similar to , except with a range of 0 to 2pi instead of -pi to pi. + + The angle to wrap. + + + + Wraps an angle between -90 and 90 degrees. If an angle goes past this range it'll go back to the other end. + + + + + + + Determines the angular distance between two vectors based on dot product comparisons. This method ensures underlying normalization is performed safely. + + The first vector. + The second vector. + + + + Determines the inverse of a given quaternion. + + The quaternion to calculate the inverse of. + + + + Rotates a given vector by a given quaternion rotation. + + The vector to rotate. + The quaternion to rotate by. + + + + Gives the real modulo of a divided by a divisor. + This method is necessary because the % operator in C# keeps the sign of the dividend. + + + + + Approximates the derivative of a function at a given point based on a + + The function to take the derivative of. + The value to evaluate the derivative at. + + + + Searches for an approximate for a root of a given function. + + The function to find the root for. + The initial guess for what the root could be. + The amount of iterations to perform. The higher this is, the more generally accurate the result will be. + + + + Samples a value from a Gaussian distribution. + + The input value. + The standard deviation of the distribution. + The mean of the distribution. Used for horizontally shifting the overall resulting graph. + + + + Determines the sign of a number. Does not return zero. If zero is supplied as an input, one is returned. + + The input number. + + + + Converts a -1 or 1 based direction to an equivalent for convenience. + + The numerical direction. + + + + Commonly known as a sine bump. Converts 0 to 1 values to a 0 to 1 to 0 again bump. + + The input number. + + + + Easy shorthand that converts seconds to whole number frames. + + The amount of seconds. + + + + Easy shorthand that converts minutes to whole number frames. + + The amount of minutes. + + + + Easy shorthand for (sin(x) + 1) / 2, which has the useful property of having a range of 0 to 1 rather than -1 to 1. + + The input number. + + + + Easy shorthand for (cos(x) + 1) / 2, which has the useful property of having a range of 0 to 1 rather than -1 to 1. + + The input number. + + + + Clamps a given number between 0 and 1. + + The number to clamp. + + + + A shorthand for with defaulting to true. + + The value to interpolate from. + The value to interpolate to. + The value to interpolate in accordance with. + Whether outputs should be clamped between 0 and 1. + + + + Performs a linear bump across a spectrum of two in/out values. + + The value at which the output should rise from 0 to 1. + The value at which the output start bumping at 1. + The value at which the output cease bumping at 1. + The value at which the output should descent from 1 to 0. + The input interpolant. + + 0 when is less than or equal to . +

+ Anywhere between 0 and 1, ascending, when is greater than but less than . +

+ 1 when is between and . +

+ Anywhere between 0 and 1, descending, when is greater than but less than . +

+ 1 when is greater than or equal to . +
+
+ + + A smooth polynomial curve (4x^3 - 6x^2 + 3x, to be exact) that takes in a 0-1 interpolant and biases it smoothly towards 0.5. + + + The resulting polynomial of 4x^3 - 6x^2 + 3x was arrived at via a lerp(x^3, 1 - (1 - x)^3, x) operation and simplifying results. + + The input interpolant. + + + + Multiplies x by itself twice. + + The input number. + + + + Multiplies x by itself three times. + + The input number. + + + + Calculates an aperiodic sine. This function only achieves this if and are irrational numbers. + + The input value. + An optional, secondary value that works similarly to x. Unlike x, however, it serves as an input offset that is unaffected by the two coefficients. + The first irrational coefficient. + The second irrational coefficient. + + + + Applies 2D FBM, an iterative process commonly use with things like Perlin noise to give a natural, "crisp" aesthetic to noise, rather than a blobby one. +

+ The greater the amount of octaves, the more pronounced this effect is, but the more performance intensive it is. +
+ The X position to sample from. + The Y position to sample from. + The RNG seed for the underlying noise calculations. + The amount of octaves. The greater than is, the more crisp the results are. + The exponential factor between each iteration. Iterations have an intensity of g^n, where g is the gain and n is the iteration number. + The degree of self-similarity of the noise. +
+ + + Samples a random value from a Gaussian distribution. + + The RNG to use for sampling. + The standard deviation of the distribution. + The mean of the distribution. Used for horizontally shifting the overall resulting graph. + + + + Computes 2-dimensional Perlin Noise, which gives "random" but continuous values. + + The X position on the map. + The Y position on the map. + A metric of "instability" of the noise. The higher this is, the more unstable. Lower of bounds of 2-3 are preferable. + The seed for the noise. + + + + Calculates the elbow position of a two-limbed IK system via trigonometry. + + The start of the IK system. + The end effector position of the IK system. + The length of the first limb. + The length of the second limb. + Whether the angles need to be flipped. + + + + Clamps the length of a vector. + + The vector to clamp the length of. + The minimum vector length. + The maximum vector length. + + + + Interpolates between three -based points via a quadratic Bezier spline. + + The first point. + The second point. + The third point. + The interpolant to sample points by. + + + + Calculates the signed distance of a point from a given line. This is relative to how far it is perpendicular to said line. + + The point to check. + The pivot point upon which the line rotates. + The direction of the line. + + + + Rotates a vector's direction towards an ideal angle at a specific incremental rate. + + The original vector to rotated from. + The ideal direction to approach. + The maximum angular increment to make in the pursuit of approaching the destination. + + + + Rolls a random 0-1 probability based on a RNG, and checks whether it fits the criteria of a certain probability. + + The random number generator. + The probability of a success. + + + + Binding flags that account for all access/local membership status. + + + + + Loads all instances of a given mod type (such as ) that have a specific interface attribute.

+ This method is useful for handling autoloading on multi-attributed pieces of content. +
+ The mod to search in. + A secondary query condition to apply when collecting interfaces. By default this doesn't affect output results. +
+ + + Retrieves all types which derive from a specific type in a given assembly. + + The base type. + The assembly to search. + + + + Returns the namespace path to the provided object, including the object itself. + + + + + Returns the provided number with the correct ordinal suffix.
+ For example, 3 would return 3rd. +
+
+ + + Displays arbitrary text in the game chat with a desired color. This method expects to be called server-side in multiplayer, with the message display packet being sent to all clients from there. + + The text to display. + The color of the text. + + + + Displays the localized text gotten from the provided key in the chat, accounting for multiplayer. + + + + + Colors a message with the provided color using chat tags. + + + + + Represents a verlet segment, for use in verlet simulatons. + + The position of this segment. + The velocity of this segment. + Whether the segment is locked in place. If true, its position will not update via simulations. + + + + Represents a verlet segment, for use in verlet simulatons. + + The position of this segment. + The velocity of this segment. + Whether the segment is locked in place. If true, its position will not update via simulations. + + + + Configurable settings for verlet simulations. + + Whether the segments should collide with tiles. + Whether the segments should move slower through water.
Does nothing if is 0. + The gravity strength to apply to the segments. + The maximum speed the segments should fall due to gravity. + Whether an additional calcuation should be performed to conserve the energy of the segments.
This results in them bouncing around a lot more before settling down. +
+ + + Configurable settings for verlet simulations. + + Whether the segments should collide with tiles. + Whether the segments should move slower through water.
Does nothing if is 0. + The gravity strength to apply to the segments. + The maximum speed the segments should fall due to gravity. + Whether an additional calcuation should be performed to conserve the energy of the segments.
This results in them bouncing around a lot more before settling down. +
+ + Whether the segments should collide with tiles. + + + Whether the segments should move slower through water.
Does nothing if is 0.
+
+ + The gravity strength to apply to the segments. + + + The maximum speed the segments should fall due to gravity. + + + Whether an additional calcuation should be performed to conserve the energy of the segments.
This results in them bouncing around a lot more before settling down.
+
+ + + Contains various simulations for verlet chains. + + + + + Performs a verlet simulation, configure specific details with . + + The segments to run through the simulaion. + The ideal distance between each segment. + The settings for the simulation. + The number of loops to perform to calculate the final positions. More is more precise, but more costly. + The segments post simulation. + + + + Performs a verlet simulation for a rope with a fixed end(s), configure specific details with . + + The segments to run through the simulaion. + The fixed postion of the start of the rope. + The ideal length of the rope. + The settings for the simulation. + The optional, fixed position of the end of the rope. + The segments post simulation. + + + + Defines what priority a balance change should have in case of conflicts. Only the change with the highest priority will occur. + + + + + Use if the balance change isnt that important, and being overwritten by other mod's balancing is fine. + + + + + Use if the balance change should happen, but it isnt a huge deal if it gets overwritten. + + + + + Use if the balance change is quite important, and being overwritten could noticably mess with balance. + + + + + Use if the balance change is very important, and should only be overwritten in extreme cases. + + + + + Use sparingly if the balance change MUST happen, and should not be overwritten. + + + + + A class to supply balancing changes on mod loading. + + + + + Return all relevant item balancing changes here.
+ Called automatically, do not call. +
+
+ + + Return all relevant npc hit balancing changes here.
+ Called automatically, do not call. +
+
+ + + Return all relevant npc hp balancing changes here.
+ Called automatically, do not call. +
+
+ + + This class contains several default balancing rules that you can use. You can also make your own by creating a class/record that implements . + + + + + Reduces all incoming damage from projectiles of specified types. + + + + + Reduces all incoming damage from projectiles of specified types. + + + + + Appies to all incoming damage caused by projectiles with remaining pierce. + + + + + Appies to all incoming damage caused by projectiles with remaining pierce. + + + + + Applies to all incoming damage from projectiles of specified damage classes. + + + + + Applies to all incoming damage from projectiles of specified damage classes. + + + + + Use to create new balancing rules by attaching to classes/records. + + + + + A unique name for the rule. Good practice is to prefix it with your mods name. + + + + + The priority of this balancing rule. + + + + + Whether the rule should apply to the npc based on the hit context. + + + + + + + + Apply any balancing change(s) here. + + + + + + + How long the cutscene has been active for. + + + + + Whether the cutscene is active. + + + + + Set to true to force the cutscene to instantly end. + + + + + A 0-1 ratio of how far along its lifetime this cutscene is. + + + + + The length of time the cutscene should be active for. + + + + + An optional blocker condition to use for the cutscene. Returns by default. + + + + + Called when the cutscene begins. + + + + + Called when the cutscene ends. + + + + + Called each tick the cutscene is active. Runs at the end of the update. + + + + + Use to modify + + + + + Use to modify the transform matrix. + + + + + Called after NPC drawing. + + + + + Called in at layer (125). Draw to last. + + + + + Called during PostDraw. + + + + + The cutscene that is currently active. + + + + + Whether any cutscenes are active. + + + + + Queues a cutscene to be played. + + + + + + Returns whether the provided cutscene is active, via checking the names. + + + + + Represents a texture atlas, which is a large texture sheet with smaller, single textures crammed into it as tightly as possible.
+ Single textures are loaded by a data file that contains json data for each texture. Access these textures via . + You can create atlases using this software +
+
+ + + The texture of the atlas. + + + + + The mod that owns this atlas. + + + + + The name of the atlas. + + + + + The file path to both the texture and data files, without the file extensions. + + + + + The size of the atlas texture. + + + + + Whether the texture has been disposed of. + + + + + All textures stored on the atlas. + + + + + Represents a texture atlas, which is a large texture with smaller, single textures crammed into it as tightly as possible.
+ Single textures are loaded by a data file, that contains json data for each texture. Access these via . +
+ The mod this atlas belongs to. + The name of the atlas. + The file path to both the texture and data files, without the file extensions nor the quality suffix. +
+ + + Gets a texture with the given name from the atlases. + + The unique texture name, prefixed with the mod name. For example, "MyMod.Particles". + The texture, or if it was not found. + + + + Gets the atlas with the given name. Will return if it is not registered. + + The name of the atlas. + The atlas. + + + + Attempts to get the atlas with the given name. + + The name of the atlas. + The atlas. + Whether the atlas was found. + + + + Checks if an atlas with the given name is registered. + + The name of the atlas. + Whether the atlas is registered. + + + + Registers an atlas. + + The mod this atlas belongs to. + The name of the atlas. Must be unique. + The file path to the atlas files, not including the file extensions. + The atlas that was registered. + + + + Represents a texture on an . Contains its position on the atlas, and a unique string identifier.
+ Use to retrieve an instance with the given string identifier. +
+
+ + + Represents a texture on an . Contains its position on the atlas, and a unique string identifier.
+ Use to retrieve an instance with the given string identifier. +
+
+ + + Whether this render target if waiting for its first initialization or not. + + + + + The initialization action that dictates how this render target should be (re)initialized. + + + + + Whether this render target is uninitialized or not. + + + + + How long it's been, in frames, since this render target was last used in some way. + + + This is based on calls to the property getter. + + + + + Whether this render target is disposed or not. + + + + + Whether this render target should be reset when the screen size changes. + + + + + Whether this render target should be subject to automatic garbage collection when not in use. + + + + + The raw this wrapper holds. + + + + + The width of the render target. + + + + + The height of the render target. + + + + + Represents a standard render target regeneration method. Used commonly in conjunction with and the ManagedRenderTarget constructor. + + The screen width. + The screen height. + + + + Immediately disposes of this render target, freeing unmanaged GPU resources in the process. + + + + + Recreates this render target, freeing old unmanaged GPU resources in the process before creating new ones. + + The width that should be used as a basis for recreating the render target. + The height that should be used as a basis for recreating the render target. + + + + The set of all managed render targets. + + + + + The event responsible for updating all render targets. + + + Should be subscribed for the purpose of rendering into render targets, to ensure that their contents are defined in a way that does not interfere with other parts of the game's rendering loop. + + + + + How long standard render targets can go, in frames, before they are subject to automatic disposal. + + + + + Causes all managed render targets to become disposed, freeing their unmanaged resources. + + + + + Evaluates all active render targets, checking if they need to be reset or disposed of. + + + + + Checks a render target for whether it needs to be reset for any reason. If so, the reset is scheduled on the main thread for the next frame. + + The render target to check. + + + + Provides direct access to the associated particle's draw collection, allowing for more control about how they are rendered. + + + Particles using this will not be automatically rendered. + + The particle type that is associated with this renderer. + + + + Iterate over here and perform rendering logic.
+ Note that no spritebatch has been started. +
+
+ + + Represents a base metaball particle instance. + + + + + The position of the metaball particle. + + + + + The velocity of the metaball particle. + + + + + The size of the metaball particle. + + + + + An array of length 4 that contains optional extra info for per metaball information. What this is used for depends on the that owns this particle instance. + + + + + Renders the contents of this metaball. + + + + + Disposes of all unmanaged GPU resources used up by the . This is called automatically on mod unload.

+ It is your responsibility to recreate layer targets later if you call this method manually. +
+
+ + + Whether this metaball should be drawn manually. + + + + + Whether the layer overlay contents at the provided index should be fixed to the screen.
+ When true, the texture will be statically drawn to the screen with no respect for world position. +
+
+ + + Optionally overridable method that can be used to make layers offset when drawn, to allow for layer-specific animations. Defaults to , aka no animation. + + + + + Use this method to use your own custom spritebatch begin call.
+ Return if you do this.
+ Returns by default. +
+ + +
+ + + Whether a given particle in the list should be killed or not. + + The particle to determine the kill state of. + + + + Optionally overridable method that defines for preparations for the render target. Defaults to using the typical texture overlay behavior. + + The layer index that should be prepared for. + + + + Optional method that allows for drawing optional things to the layers. + + + + + Update things such as velocity, size, and any optional things here. The center will be automatically updated by velocity after this method has ran.
+ Be aware that this method is called in parallel, and as such should not modify anything other than the particle instance provided. +
+
+ + + The texture of the particle. + + + + + The texture name of this particle on the particle atlas. Should be prefixed with "YourModName." + + + + + Whether the particle is manually drawn. + + + + + The position of the particle. + + + + + The velocity of the particle. + + + + + The scale of the particle. + + + + + The draw color of the particle. + + + + + The frame of the particle. + + + + + The rotation of the particle. + + + + + The rotation speed of the particle. + + + + + The opacity of the particle. + + + + + The time the particle has existed for. + + + + + The maximum lifetime of the particle, in seconds. + + + + + The direction of the particle. + + + + + A 0-1 interpolant of how far along its lifetime the particle is. + + + + + The blend state to draw the particle with. Defaults to . + + + + + How many frames this particle has in its standard texture. Defaults to 1. + + + + + Spawns the particle into the world. + + + + + + Immediately destroys this particle next update. + + + + + Override to run custom update code for the particle. Does nothing by default. + + + + + Override to run custom rendering for the particle. Draws the particle texture to the screen by default. + + + + + Use to successfully render primitives with pixelation with an NPC or Projectile. + + + + + The layer to render the primitive(s) to. + + + + + Render primitives that use pixelation here. + + + + + Controls what layer the renders to. + + + + + Whether the system is currently rendering any primitives. + + + + + Prepares a draw action for rendering to the pixelation target on the next frame. + + + + This should only be used when absolutely necessary. If possible, you should use instead. + + + The render action to perform. + The layer to draw to. + + + + Must be lower than , less than 1/4 of and less than 1/6 of . + + + + + Renders a primitive trail. + + The list of positions to use. Keep in mind that these are expected to be in world position, and is automatically subtracted from them all.
At least 4 points are required to use smoothing. + The primitive draw settings to use. + The amount of points to use. More is higher detailed, but less performant. By default, is the number of positions provided. Going above 100 is NOT recommended. +
+ + + Renders a primitive quad from a texture. Useful for using with rotation matrices. + + The texture to use as the base. + The world position to render the quad at. + The scale to apply. + The rotation to apply. + The color to draw with. Defaults to the lighting color at . + The shader to use. Defaults to "Luminance.QuadRenderer". + The rotation quarternion to use. Defaults to null. + + + + Renders a primitive quad from a texture. Useful for using with rotation matrices. + + The texture to use as the base. + The world position to render the quad at. + The scale to apply. + The rotation to apply. + The color to draw with. Defaults to the lighting color at . + The shader to use. Defaults to "Luminance.QuadRenderer". + The rotation quarternion to use. Defaults to null. + + + + Renders a circle made up of primitives. + + The world position to render the circle at. + The settings to use. + The amount of triangles to use in the circle. Higher = smoother edge but more costly. + + + + Renders the edge of a circle made up of primitives. + + The world position to render the circle at. + The settings to use. + The amount of triangles to use in the circle. Higher = smoother edge but more costly. + + + + Configurable settings for a primitive trail. + + Determines the width of the trail. + Determines the color of the trail. + Determines the offset of the trail. + Whether to smoothen the positions of the trail. + Whether to pixelate the trail. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + Optional tuple to replace the first vertex positions. + + + + Configurable settings for a primitive trail. + + Determines the width of the trail. + Determines the color of the trail. + Determines the offset of the trail. + Whether to smoothen the positions of the trail. + Whether to pixelate the trail. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + Optional tuple to replace the first vertex positions. + + + Determines the width of the trail. + + + Determines the color of the trail. + + + Determines the offset of the trail. + + + Whether to smoothen the positions of the trail. + + + Whether to pixelate the trail. MUST be used with or + + + The shader to use when rendering. + + + The width of the projection matrix area. Defaults to . + + + The height of the projection matrix area. Defaults to . + + + Whether to use an unscaled matrix when rendering. + + + Optional tuple to replace the first vertex positions. + + + + A delegate to dynamically determine the width of the trail at each position. + + The current position along the trail as a 0-1 interpolant value. + The width for the current point. + + + + A delegate to dynamically determine the color of the trail at each position. + + The current position along the trail as a 0-1 interpolant value. + The color for the current point. + + + + A delegate to dynamically determine the offset of the trail at each position. + + The current position along the trail as a 0-1 interpolant value. + The offset for the current point. + + + + Configurable settings for a primitive circle. + + Determines the radius of the circle. + Determines the color of the circle. + Whether to pixelate the circle. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + + + + Configurable settings for a primitive circle. + + Determines the radius of the circle. + Determines the color of the circle. + Whether to pixelate the circle. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + + + Determines the radius of the circle. + + + Determines the color of the circle. + + + Whether to pixelate the circle. MUST be used with or + + + The shader to use when rendering. + + + The width of the projection matrix area. Defaults to . + + + The height of the projection matrix area. Defaults to . + + + Whether to use an unscaled matrix when rendering. + + + + Configurable settings for a primitive circle edge. + + Determines the width of the circle edge. + Determines the color of the circle edge. + Determines the radius of the circle edge. + Whether to pixelate the circle edge. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + + + + Configurable settings for a primitive circle edge. + + Determines the width of the circle edge. + Determines the color of the circle edge. + Determines the radius of the circle edge. + Whether to pixelate the circle edge. MUST be used with or + The shader to use when rendering. + The width of the projection matrix area. Defaults to . + The height of the projection matrix area. Defaults to . + Whether to use an unscaled matrix when rendering. + + + Determines the width of the circle edge. + + + Determines the color of the circle edge. + + + Determines the radius of the circle edge. + + + Whether to pixelate the circle edge. MUST be used with or + + + The shader to use when rendering. + + + The width of the projection matrix area. Defaults to . + + + The height of the projection matrix area. Defaults to . + + + Whether to use an unscaled matrix when rendering. + + + + A custom vertex type with a position using Vector2 instead of Vector4, as Terraria is only a 2D game. + + This represents a vertex that will be rendered by the GPU. + + + + A custom vertex type with a position using Vector2 instead of Vector4, as Terraria is only a 2D game. + + This represents a vertex that will be rendered by the GPU. + + + + The position of the vertex. + + + + + The color of the vertex. + + + + + The texture-coordinate of the vertex. + + /// + The Z component isn't actually related to 3D, it holds the width of the vertex at the given point, since arbitrary data cannot be saved on a per-vertex basis and needs to be contained within some pre-defined format. + + + + + The vertex declaration. This declares the layout and size of the data in the vertex shader. + + + + + All deferred textures that should be applied when the filter's shader is applied. + + + + + A managed copy of all parameter data. Used to minimize excess SetValue calls, in cases where the value aren't actually being changed. + + + + + The opacity of the filter. As long as this is above 0, the filter will be applied for that frame. + + + + + The standard parameter name prefix for texture sizes. + + + + + Represents a texture that is supplied to a filter when its shader is ready to be applied. + + The texture to use. + The index in the array that the texture should go in. + An optional sampler state that should be used alongside the texture. Does nothing if . + + + + Represents a texture that is supplied to a filter when its shader is ready to be applied. + + The texture to use. + The index in the array that the texture should go in. + An optional sampler state that should be used alongside the texture. Does nothing if . + + + The texture to use. + + + The index in the array that the texture should go in. + + + An optional sampler state that should be used alongside the texture. Does nothing if . + + + + A wrapper class for that is focused around screen filter effects. + + + + + Sets "mainColor" to the provided value, if it exists. + + + + + + Sets "secondaryColor" to the provided value, if it exists. + + + + + + Attempts to send parameter data to the GPU for the filter to use. + + The name of the parameter. This must correspond with the parameter name in the filter. + The value to supply to the parameter. + + + + Sets a texture at a given index for this filter to use based a the wrapper. Typically, index 0 is populated with whatever was passed into a .Draw call. + + + + The texture is cached rather than used immediately, since it can only be applied properly when the filter is being used (a.k.a during screen shader rendering). + + + The asset that contains the texture to supply. + The index to place the texture in. + Which sampler should be used for the texture. + + + + Sets a texture at a given index for this shader to use. Typically, index 0 is populated with whatever was passed into a .Draw call. + + The texture to supply. + The index to place the texture in. + Which sampler should be used for the texture. + + + + Call to indicate that the filter should be active. This needs to happen each frame it should be active for. + + + + + Automatically called at the end of each update, after updating the filter. + + + + + Apply the filter. + + If true, this will automatically try to set certain parameters in the shader, such as globalTime. + Specify a specific pass to use, if the shader has multiple. + + + + A managed copy of all parameter data. Used to minimize excess SetValue calls, in cases where the value aren't actually being changed. + + + + + The shader reference underlying this wrapper. + + + + + Whether this shader is disposed. + + + + + The standard parameter name prefix for texture sizes. + + + + + The standard pass name when autoloading shaders. + + + + + Resets the cache of parameters for this shader. Should be used in contexts where the underlying shader used by this can be changed in contexts that do not respect the cache. + + + + An example of this being useful could when be having this shader shared with a screen shader, which supplies its values directly and without the wrapper. + + + + + Attempts to send parameter data to the GPU for the shader to use. + + The name of the parameter. This must correspond with the parameter name in the shader. + The value to supply to the parameter. + + + + Sets a texture at a given index for this shader to use based a the wrapper. Typically, index 0 is populated with whatever was passed into a .Draw call. + + The asset that contains the texture to supply. + The index to place the texture in. + Which sampler should be used for the texture. + + + + Sets a texture at a given index for this shader to use. Typically, index 0 is populated with whatever was passed into a .Draw call. + + The texture to supply. + The index to place the texture in. + Which sampler should be used for the texture. + + + + Prepares the shader for drawing. + + The pass to apply. + + + + The class responsible for central shader management, including both general-purpose and screen filter shaders. + + + + + The set of all shaders handled by this manager class. + + + + + The set of all filters handled by this manager class. + + + + + Whether this manager class has finished loading all shaders yet or not. + + + + This primarily exists for cases where shaders may be used at mod loading times, such as on the game title screen. + + + + + The main screen render target used for screen filter management. + + + + + A secondary screen render target used for screen filter management, as a means of swapping back and forth to create repeated shader effects. + + + + + The folder directory in which shaders to autoload are searched for. + + + + + The folder directory in which filters to autoload are searched for. + + + + + Handles all shader initialization effects. + + + + + Retrieves a managed shader of a given name. + + + In this context, the "name" must correspond with the file name of the shader, not including the path extension. + + The name of the shader. + + + + Retrieves a managed filter of a given name. + + + In this context, the "name" must correspond with the file name of the filter, not including the path extension. + + The name of the filter. + + + + Safely retrieves a managed shader of a given name. + + + In this context, the "name" must correspond with the file name of the shader, not including the path extension. + + The name of the shader. + The shader output. + + + + Safely retrieves a managed filter of a given name. + + + In this context, the "name" must correspond with the file name of the filter, not including the path extension. + + The name of the filter. + The filter output. + + + + Sets a shader with a given name in the registry manually. + + The name of the shader. + The shader data reference to save. + + + + Sets a filter with a given name in the registry manually. + + The name of the filter. + The shader data reference to save. + + + + The shader recompilation manager, which is responsible for ensuring that changes to .fx files are reflected in-game automatically. + + + + + The path to the central mod compiler. + + + + + Represents a watcher that looks over a given directory with .fx files. + + The path that this watcher oversees. + The name of the mod responsible for this shader watcher. + The file watcher that fires signals when an .fx file changes. + + + + Represents a watcher that looks over a given directory with .fx files. + + The path that this watcher oversees. + The name of the mod responsible for this shader watcher. + The file watcher that fires signals when an .fx file changes. + + + The path that this watcher oversees. + + + The name of the mod responsible for this shader watcher. + + + The file watcher that fires signals when an .fx file changes. + + + + Represents a .fx file that is being compiled. + + The path to the associated file. + Whether the file represents a screen filter or not. + + + + Represents a .fx file that is being compiled. + + The path to the associated file. + Whether the file represents a screen filter or not. + + + The path to the associated file. + + + Whether the file represents a screen filter or not. + + + + Processes all shader watchers, checking if anything needs to be compiled. + + + + + Handles on-mod-load effects for the library, ensuring that the compiler directory is unpacked. + + + + + Handles on-mod-unload effects for all shader watchers, disposing of unmanaged file watchers. + + + + + Creates the compiler directory in accordance with . + + + + + Attempts to load all potential shader watchers for a given mod. + + + + In order for this method to do anything, the following conditions must be met: + + The mod being searched must have an Assets/AutoloadedEffects directory, as an indicator that the mod is using the Luminance library. + The mod being searched must have an Assets/AutoloadedEffects/Compiler directory. + The user executing this method must have a relevant mod source folder that corresponds with the mod. + + + The mod to check for. + + + + Clears all .fx, .xnb, and .fxc files in the compiler directory. + + + + + Attempts to create a new shader watcher for a given mod over a given path. + + The mod that should own the shader watcher. + The path that the shader watcher should oversee. + + + + Processes a given shader watcher, compiling files as they're modified. + + The shader watcher to process + + + + Starts the fxc compiler and runs it for a given .fx file. + + The path to the .fx file. + + + + Processes a given compiled file after compilation, handling the deletion of old files and the setting of shaders in the central management system. + + The file to process. + The shader watcher responsible for the file. + The directory that contains the compiler executable. + + + + Moves a given compiling file to the compilation directory so that the compiler can run on it and acquire a new compiled shader. + + The file to move. + + + + Marks a given file as needing compilation. Called as a consequence of a file watcher event firing. + + The event sender. + The event arguments that specify file data. + + + + Represents a condition that dictates an input block. + + Whether inputs should be blocked. + Whether UI interactions and drawing should be blocked. + The condition delegate that dictates whether the block is in effect. + + + + Represents a condition that dictates an input block. + + Whether inputs should be blocked. + Whether UI interactions and drawing should be blocked. + The condition delegate that dictates whether the block is in effect. + + + Whether inputs should be blocked. + + + Whether UI interactions and drawing should be blocked. + + + The condition delegate that dictates whether the block is in effect. + + + + Whether this block affects nothing. + + + + + A default-object blocking condition that does nothing. + + + + + Whether a block of any kind was in effect lack frame or not. + + + + + Starts a new block effect with a given condition. + + Whether inputs should be blocked. + Whether UI interactions and drawing should be blocked. + The condition delegate that dictates whether the block is in effect. + + + + Starts a new block effect based on a given . + + The configuration that dictates how the black should operate. + + + + The position the camera should focus on. + + + + + The 0-1 interpolant that dictates how much the camera position should move. + + + + + How much the camera should zoom in. Accepts negative values up -1 for zoom-out effects. + + + + + Causes the camera to pan towards a given point, with a given 0-1 interpolant. + + The point at which the camera should focus on. + How much the screen position should pan towards the destination. + + + + Zooms the camera in by a given factor. Does not work with negative values. + + + A value of 0 means no zoom-in, a value of 1 means 2x the zoom in, a value of 2 means 3x, and so on. + + The amount to zoom in by. + + + + Zooms the camera out by a given factor. Does not work with negative values. + + + A value of 0 means no zoom-in, a value of 1 means 0.5x the zoom, a value of 2 means 0.333x, and so on. + + The amount to zoom out by. + + + + The layer of cutscenes in the modifiers. + + + + + The layer of screen filters in the modifiers. + + + + + Call to register a screen modifier delegate at the provided layer. Each registered modifier is ran in ascending layer order. + + + + + This indicates the maximum amount BaseDirection can be rotated by when a shake occurs. At sufficiently high values there is effectively no shake direction and it's equivalent to NextVector2Circular. + + + + + This indicate how much, in pixels, the screen should shake. + + + + + This indicates the general direction the shake should occur in. + + + + + This indicates how much the shake should dissipate every frame. + + + + + Provides useful methods for working with IL editing and custom detouring. + + + + + Modifies the provided methodbase with the provided detour, and caches it. This is automatically undone on unloading. + + + + + Modifies the provided methodbase with the provided IL manipulator, and caches it. This is automatically undone on unloading. + + + + + Does nothing, existing solely for the purpose of unsubscription in custom IL edit event implementations that use add/remove event syntax. + + + + + A generic IL edit that simply immediately emits a return. + + + + + + + Provides a class with automanaged implementation of creating and subscribing to a new detour(s). + + + + + Call here to implement your custom detour(s). + + + + + Provides a class with automanaged implementation of an existing tModLoader detour(s). + + + + + Subscribe to the detour here. + + + + + Unsubscribe to the detour here. + + + + + A basic provider class for wrapping around a single . If you need to do multiple in one class, use a or similar. + + + + + Subscribe to your IL event here. + + + + + Unsubscribe to your IL event here. + + + + + Perform the actual IL edit here. Use the provided ManagedILEdit's log method if something goes wrong. + + + + + Wrapper for ILEdits that automatically un-applies them all, and provides a useful error logging template. + + The name of the edit. + The mod that owns this ILEdit. + An action that subscribes the ILEdit. + An action that unsubscribes the ILEdit. + The delegate that contains/represents the ILEdit. + + + + Wrapper for ILEdits that automatically un-applies them all, and provides a useful error logging template. + + The name of the edit. + The mod that owns this ILEdit. + An action that subscribes the ILEdit. + An action that unsubscribes the ILEdit. + The delegate that contains/represents the ILEdit. + + + The name of the edit. + + + The mod that owns this ILEdit. + + + An action that subscribes the ILEdit. + + + An action that unsubscribes the ILEdit. + + + The delegate that contains/represents the ILEdit. + + + + Exposes the editing function directly, this should be used in and + + + + + + Applies the ILEdits . + + + + + Provides a standardization for IL editing failure cases, making use of .

+ This should be used if an IL edit could not be loaded for any reason, such as a failure. +
+ The reason that the IL edit failed. +
+ + + A class to supply all information icons for your mod on loading. + + + + + Return all player info icons here.
+ Called automatically, do not call. +
+
+ + + Return all world info icons here.
+ Called automatically, do not call. +
+
+ + + Represents an icon that shows up on the player selection UI to provide information about the player's state. + + The path to the texture of the icon, including the mod name. + The localization key for the text that should be displayed when this icon is hovered. + Whether this icon should appear for the provided player. + The priority of this icon, this determines the ordering of the icon from low to high. + + + + Represents an icon that shows up on the player selection UI to provide information about the player's state. + + The path to the texture of the icon, including the mod name. + The localization key for the text that should be displayed when this icon is hovered. + Whether this icon should appear for the provided player. + The priority of this icon, this determines the ordering of the icon from low to high. + + + The path to the texture of the icon, including the mod name. + + + The localization key for the text that should be displayed when this icon is hovered. + + + Whether this icon should appear for the provided player. + + + The priority of this icon, this determines the ordering of the icon from low to high. + + + + Represents an icon that shows up on the world selection UI to provide information about the world's state. + + The path to the texture of the icon, including the mod name. + The localization key for the text that should be displayed when this icon is hovered. + Whether this icon should appear for the provided world. Store things in the world header and check them here. + The priority of this icon, this determines the ordering of the icon from low to high. + + + + Represents an icon that shows up on the world selection UI to provide information about the world's state. + + The path to the texture of the icon, including the mod name. + The localization key for the text that should be displayed when this icon is hovered. + Whether this icon should appear for the provided world. Store things in the world header and check them here. + The priority of this icon, this determines the ordering of the icon from low to high. + + + The path to the texture of the icon, including the mod name. + + + The localization key for the text that should be displayed when this icon is hovered. + + + Whether this icon should appear for the provided world. Store things in the world header and check them here. + + + The priority of this icon, this determines the ordering of the icon from low to high. + + + + Processes the modcall, checking that all the parameters match and throws if not. + + + + + + + + Process the mod call here. Return instead of null if no other return value is suitable. + + + + + + + Once a call makes it to a public version, NEVER delete it from here. + + + + + The ordered types that the args must be. Return as null if none are needed. + + + + + Call this from YourMod.Call(params object[] args). + + + + + An automatic termination condition that governs whether the looping sound should terminate or not. Meant to serve as a fail-safe to ensure that looped sounds do not go on long after they should have stopped. + Useful for cases such as sounds that are attached to an entity but should go away. + + + + + The sound slot that manages this looping sound. + + + + + Whether the loop sound has been started yet or not. + + + + + Whether this sound has been stopped or not. + + + + + Whether the loop sound is being played. + + + + + Updates all active sounds. + + The moving source position of the sounds. + An optional update behavior that should be applied to the sounds. + + + + Starts all sounds. + + The source position of the sounds. + + + + Handles stop behaviors for sounds, sans the state changes. + + + + + Performs all necessary update behaviors for sounds, evaluating whether they need to be started, updating sound positions in the world, and performing arbitrary update behaviors via . + + The source position of the sounds. + An optional update behavior that should be applied to the sounds. + + + + Marks sounds as being eligible for restarting. + + + + + Stops all sounds. + + + + + The set of all looping sounds handled by the manager. + + + + + Creates a new looping sound, with an optional, perpetually evaluated termination condition. + + The sound that should be looped. + An optional condition that dictates whether the sound should terminate automatically. + + + + The central mod type for the Luminance library. + + + + + Handles all necessary manual unloading effects for the library. + + + + + Handles all necessary loading effects for the library, after all mods have loaded and all dependencies have been established. + + +
+
diff --git a/ModSupport/Luminance/LuminanceWorldIcons.cs b/ModSupport/Luminance/LuminanceWorldIcons.cs new file mode 100644 index 0000000000..3dc9fd2b20 --- /dev/null +++ b/ModSupport/Luminance/LuminanceWorldIcons.cs @@ -0,0 +1,38 @@ +using CalamityMod.Systems; +using Luminance.Core.MenuInfoUI; +using System.Collections.Generic; +using Terraria.ModLoader; + +namespace CalamityMod.ModSupport.LuminanceSupport +{ + [JITWhenModsEnabled("Luminance")] + [ExtendsFromMod("Luminance")] + public sealed class CalamityUIManagers : InfoUIManager + { + public override IEnumerable GetWorldInfoIcons() + { + yield return new WorldInfoIcon("CalamityMod/UI/ModeIndicator/ModeIndicator_Death", + "Mods.CalamityMod.UI.DeathEnabled", + worldData => + { + if (!worldData.TryGetHeaderData(out var tagData)) + + return false; + + return tagData.ContainsKey("DeathMode") && tagData.GetBool("DeathMode"); + }, + 50); + yield return new WorldInfoIcon("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev", + "Mods.CalamityMod.UI.RevengeanceEnabled", + worldData => + { + if (!worldData.TryGetHeaderData(out var tagData)) + + return false; + + return tagData.ContainsKey("RevengeanceMode") && tagData.GetBool("RevengeanceMode") && !(tagData.ContainsKey("DeathMode") && tagData.GetBool("DeathMode")); + }, + 50); + } + } +} diff --git a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs index 4ad1d727c3..fa73780b80 100644 --- a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ModLoader.Core; namespace CalamityMod.Projectiles.BaseProjectiles { @@ -25,7 +26,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles // Look through every type in the mod, and check if it's derived from BaseIdleHoldoutProjectile. // If it is, cache it into the item/projectile relationship cache. - foreach (Type type in typeof(CalamityMod).Assembly.GetTypes()) + Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + foreach (Type type in types) { // Don't load abstract classes; they cannot have instances. if (type.IsAbstract) diff --git a/Systems/WorldSelectionDifficultySystem.cs b/Systems/WorldSelectionDifficultySystem.cs index 0fe71ebfc5..73621eb404 100644 --- a/Systems/WorldSelectionDifficultySystem.cs +++ b/Systems/WorldSelectionDifficultySystem.cs @@ -18,12 +18,16 @@ namespace CalamityMod.Systems // Load all of the World Difficulties to the World Difficulty list // The difficulty the world uses will be the latest applicable one, so these are added in order from easiest to hardest // These colors are all picked from the wiki's colors for each Difficulty combo - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevMaster"), GetMasterRevengeance, new(124, 153, 242))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathMaster"), GetMasterDeath, new(255, 25, 255))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevLegend"), GetLegendRevengeance, new(240, 128, 128))); // Malice color - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color + // Calamity's own difficulties aren't added if the Luminance mod is on, as it adds its own world system + if (CalamityMod.Instance.luminance == null) + { + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42))); + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219))); + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevMaster"), GetMasterRevengeance, new(124, 153, 242))); + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathMaster"), GetMasterDeath, new(255, 25, 255))); + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevLegend"), GetLegendRevengeance, new(240, 128, 128))); // Malice color + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color + } } public override void SaveWorldHeader(TagCompound tag) diff --git a/UI/InvasionProgressUIManager.cs b/UI/InvasionProgressUIManager.cs index 72c71d9c76..4c037c5a74 100644 --- a/UI/InvasionProgressUIManager.cs +++ b/UI/InvasionProgressUIManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader.Core; namespace CalamityMod.UI { @@ -25,7 +26,8 @@ namespace CalamityMod.UI public static void LoadGUIs() { // Look through every type in the mod, and check if it's derived from InvasionProgressUI. If it is, create a copy and save it in the static list. - foreach (Type type in typeof(CalamityMod).Assembly.GetTypes()) + Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + foreach (Type type in types) { // Don't load abstract classes since they cannot have instances. if (type.IsAbstract) diff --git a/Waters/CustomLavaManagement.cs b/Waters/CustomLavaManagement.cs index e1b5cc6df6..e4018ddb5d 100644 --- a/Waters/CustomLavaManagement.cs +++ b/Waters/CustomLavaManagement.cs @@ -7,6 +7,7 @@ using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.Core; namespace CalamityMod.Waters { @@ -23,7 +24,8 @@ namespace CalamityMod.Waters { CustomLavaStyles = new List(); - foreach (Type type in typeof(CalamityMod).Assembly.GetTypes()) + Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + foreach (Type type in types) { // Ignore abstract types; they cannot have instances. // Also ignore types which do not derive from CustomLavaStyle. diff --git a/build.txt b/build.txt index dc2ea7ec07..4aaee7d849 100644 --- a/build.txt +++ b/build.txt @@ -7,3 +7,4 @@ hideCode = false hideResources = true includeSource = false includePDB = true +weakReferences = Luminance \ No newline at end of file