Mod Calls (Aequus)
Mod Calls are special functions provided by tModLoader that mod creators can use to interact with Aequus in certain ways. They are accessible through Mod.Call
and a given call name; for more details, see the tModLoader wiki. This page lists the mod call functions Aequus currently adds.
This page expects you to have an understanding of Terraria mod coding, and how to utilize Mod.Call.
If you would like to view the code for handling mod calls, you can find it here
Important Information
All Calls are required to have 2 parameters. A string
, which is the name of the call, and a Mod
instance, which is the mod that is trying to call. (Usually YOUR mod.)
Examples
The simplest way to get an instance of Aequus:
if (ModLoader.TryGetMod("Aequus", out Mod aequus))
{
// A call goes here
}
Example of some mod calls.
aequus.Call("downedCrabson", Mod); // Returns whether Crabson has been defeated.
aequus.Call("downedCrabson", Mod, true); // Sets Crabson to defeated.
Simple Get/Set functions (downed[X])
- Usage: Can be called anytime ingame.
Parameters
- Optional:
boolean
- Sets the value of the downed flag
Result
- A
boolean
which shows the current state of the flag. Never returnsnull
.
Specific Calls
Call | Result |
---|---|
downedCrabson | Gets value of AequusWorld.downedCrabson .
|
downedOmegaStarite | Gets value of AequusWorld.downedOmegaStarite .
|
downedDustDevil | Gets value of AequusWorld.downedDustDevil .
|
downedHyperStarite | Gets value of AequusWorld.downedHyperStarite .
|
downedUltraStarite | Gets value of AequusWorld.downedUltraStarite .
|
downedRedSprite | Gets value of AequusWorld.downedRedSprite .
|
downedSpaceSquid | Gets value of AequusWorld.downedSpaceSquid .
|
downedEventDemon | Gets value of AequusWorld.downedEventDemon .
|
downedEventCosmic | Gets value of AequusWorld.downedEventCosmic .
|
downedEventAtmosphere | Gets value of AequusWorld.downedEventAtmosphere .
|
chestCobaltTier | Gets value of AequusWorld.chestCobaltTier .
|
chestMythrilTier | Gets value of AequusWorld.chestMythrilTier .
|
chestAdamantiteTier | Gets value of AequusWorld.chestAdamantiteTier .
|
hardmodeChests | Gets value of AequusWorld.hardmodeChests .
|
shadowOrbsBrokenTotal | Gets value of AequusWorld.shadowOrbsBrokenTotal .
|
tinkererRerolls | Gets value of AequusWorld.tinkererRerolls .
|
usedWhiteFlag | Gets value of AequusWorld.usedWhiteFlag .
|
xmasHats | Gets value of AequusWorld.xmasHats .
|
xmasWorld | Gets value of AequusWorld.xmasWorld .
|
NecromancyDatabase
- Usage: Call after
Load
, and beforeAddRecipes
. - Used to set necromancy data for an NPC.
Parameters
Notice: To ignore an optional parameter, use null
instead of providing a value to keep it as default.
short
- NPC ID.float
- tier.- Optional:
float
- View Range for Targetting enemies. - Optional:
int
- Despawn Priority. - Optional:
boolean
- Set totrue
to disable any sort of velocity modifications when converted into a ghost minion. - Optional:
int
- How many slots this should use. NOTICE: Having slots which are not 0 or 1 may be unstable. - Optional:
float
- Lifetime multiplier, allows you to make an NPC live longer or shorter than usual as a Ghost Minion.
Result
- Either the string "Success" or "Failure", depending on if an Exception was thrown. Never returns
null
.
NecromancyNoAutogeneration
- Usage: Call after
Load
, and beforeAddRecipes
. - Disables this mod to have Necromancy data auto-generated.
Parameters
- None.
Result
- The string "Success"
DemonSiegeSacrifice
- Usage: Call after
Load
, and beforeAddRecipes
. - Adds a Demon Siege recipe
Parameters
int
- Item ID.int
- Upgraded item's Item ID.int
- Progression, currently unused. Please always set to0
.
Result
- Either the string "Success" or "Failure", depending on if you didn't provide the proper arguments, or an Exception was thrown. Never returns
null
.
DemonSiegeSacrificeHide
- Usage: Call after
Load
, and beforeAddRecipes
, usually after registering an item yourself. - Adds a Demon Siege recipe
Parameters
int
- Item ID (The pre-upgraded item, example: Light's Bane.)boolean
- Whether or not this sacrifice should be hidden.
Result
- Either the string "Success" or "Failure", depending on if you didn't provide the proper arguments, or an Exception was thrown. Never returns
null
.
Flawless
- Usage: Can be called anytime ingame.
- Provides whether a player has completed Flawless conditions for the target NPC.
Parameters
NPC / int
- NPC / NPC.whoAmIPlayer / int
- Player / Player.whoAmI
Result
- The
boolean
value fromFlawlessGlobalNPC.damagePlayers[player.whoAmI]
.
FlawlessStat
- Usage: Can be called anytime ingame.
- Grants you access to the
FlawlessGlobalNPC.damagedPlayers
field
Parameters
NPC / int
- NPC / NPC.whoAmI
Result
- The
boolean[]
value fromFlawlessGlobalNPC.damagedPlayers
.
FlawlessCheck
- Usage: Can be called anytime ingame.
- Allows you to check or set
FlawlessGlobalNPC.preventNoHitCheck
Parameters
NPC / int
- NPC / NPC.whoAmI- Optional:
boolean
- New value for preventNoHitCheck
Result
- The
boolean
value fromFlawlessGlobalNPC.preventNoHitCheck
.
PushableProjectile
- Set Usage: Call after
Load
, and beforeAddRecipes
. - Get Usage: Can be called anytime ingame.
- Allows you to check or set a certain projectile's status in the
PushableEntities.ProjectileIDs
database.
Parameters
int
- Projectile ID- Optional:
boolean
- New value for Pushable state
Result
boolean
value from checking if the target Projectile ID is inside the Pushable database.
PushableNPC
- Set Usage: Call after
Load
, and beforeAddRecipes
. - Get Usage: Can be called anytime ingame.
- Allows you to check or set a certain npc's status in the
PushableEntities.NPCIDs
database.
Parameters
int
- NPC ID- Optional:
boolean
- New value for Pushable state
Result
boolean
value from checking if the target NPC ID is inside the Pushable database.
SentryAccessory
- Usage: Call after
Load
, and beforeAddRecipes
. - Allows you to add a custom action for an accessory when it's "Equipped" by a Sentry using the Sentry 6502 and its upgrades.
Parameters
int
- Item ID- Function:
Action<Projectile, Item, Player>
- "Simple", has a smaller amount of ParametersAction<Projectile, GlobalProjectile, Item, Player>
- "Complex", has an added GlobalProjectile instance which is the SentryAccessoriesManager from the Projectile instance.
Result
- Either the string "Success" or "Failure", depending on if you successfully added an action for the Item ID. Never returns
null
.
SentryAccessoryOnShoot
- Usage: Call after
Load
, and beforeAddRecipes
. - Allows you to add a custom action for an accessory when it's "Equipped" by a Sentry using the Sentry 6502 and its upgrades. This version is only called when a sentry spawns a projectile, useful for effects which are activated "On Attack" or "On Shoot", like the Bone Glove or Shatter Crystal.
Parameters
int
- Item ID- Function:
Action<Projectile(0), Item, Player>
- "Projectile Fired", has a smaller amount of Parameters
Projectile(0) = Projectile which was Shot from Sentry
Action<Projectile(0), Projectile(1), Item, Player>
- "Projectile Fired and Sentry", has the instance of the Fired projectile
Projectile(0) = Projectile which was Shot from Sentry
Projectile(1) = Sentry (Parent)
Action<IEntitySource, Projectile(0), Item, Player>
- "Projectile Fired with Source", has an IEntitySource for extra context.
Projectile(0) = Projectile which was Shot from Sentry
Action<IEntitySource, Projectile(0), Projectile(1), Item, Player>
- "Projectile Fired with Sentry and Source", has an IEntitySource for extra context.
Projectile(0) = Projectile which was Shot from Sentry
Projectile(1) = Sentry (Parent)
Result
- Either the string "Success" or "Failure", depending on if you successfully added an action for the Item ID. Never returns
null
.
PotionBuffColor
- Set Usage: Call after
Load
, and beforeAddRecipes
. - Get Usage: Can be called anytime ingame.
- Allows you to check or set a color related to a BuffID.
Parameters
int
- Buff ID- Optional:
Color
- New value for the target Buff
Result
Color
related to the specified Buff ID. By default returnsColor.Transparent (R=0, G=0, B=0, A=0)
.
PotionItemColor
- Set Usage: Call after
Load
, and beforeAddRecipes
. - Get Usage: Can be called anytime ingame.
- Allows you to check or set a color related to a ItemID.
Parameters
int
- Item ID- Optional:
Color
- New value for the target Item
Result
Color
related to the specified Item ID. By default returnsColor.Transparent (R=0, G=0, B=0, A=0)
.
PylonColor
- Usage: Call after
Load
, and beforeAddRecipes
. - Used to set a color for Pylon Drones who live at a specific Pylon.
Parameters
int
- The Tile ID for the Pylon.- Optional:
int
- The Tile Style for the Pylon. - Optional:
Color
ORFunc<Color>
- Sets the value of the Pylon's "color"
Result
- A
Func<Color>
which retrieves the color for Pylon Drones at this Pylon type. Never returnsnull
.