-
Notifications
You must be signed in to change notification settings - Fork 1
Content Classes
The content classes make up Procedurline's third layer: the content layer. These classes are named according to the scheme of CustomXYZ
, and provide an easy way to implement derivations of already existing gameplay elements, by virtualizing all relevant methods, providing abstract methods which implement key behavior, and allowing one to modify its sprite and other relevant graphical aspects.
Obtains the sprite to be used for this entity. Should cache processed sprites globally when possible. By default recolors the entity to the given color.
Recolors secondary graphics of the entity, like particles, to the specific color.
Makes the player enter the booster. This function is called from the PlayerCollider
callback. When BoostType.CUSTOM
is passed as the boost type, it acts like the player entered the booster, but doesn't call either Player.Boost
or Player.RedBoost
Makes the player exit the booster.
An abstract method called when the player enters the booster. Returns the type of boost to perform, which is passed to MakePlayerEnter
.
Makes the refill break, and optionally respawn after a given delay.
Called when the player touches the refill while it isn't broken. Returns true
if the refill should break.
Creates an array of ParticleData
which is used to create the dream block's particles.
Called when the player enters the dream block.
Called when the player exits the dream block.
Called when the player collides with a solid when inside of the dream block.
Updates the player while they're in the dream block. Can be used to override the default update logic.
A static method which obtains a ParticleData
struct for a dream block particle.
Creates a new dream block particle from a ParticleData
struct.
To provide the functionality of the content classes, Procedurline needs to apply various internal patches. These patches, called content patches, are specified using an internal mechanism which works using internal attributes applied to various methods. The attributes allow one to e.g. call a method on module load and unload (ContentInit
/ ContentUninit
), apply a regular and IL hook to a target method (ContentHook
/ ContentILHook
), virtualize a non-virtual base method using a MethodVirtualizerDetour
(ContentVirtualize
), create a field proxy, which is a property which proxies a (private) field of the base class (ContentFieldProxy
), or patch a specific sound effect to replace it with the return value of a property (ContentPatchSFX
).
The ProcedurlineModule
scans through all classes for these attributes on load, and if it finds them, it performs the appropriate action, which most of the time involves calling a method from the PatchUtil
class. This class can also be used to create these patches yourself, even though the content attributes are internal
.