Skip to content
dedChar edited this page May 20, 2017 · 2 revisions

"Getter" functions

Entity Agony:getNearestEnemy(Entity sourceEnt, *table whiteList, *table blackList)

Takes a source Entity and two optional tables, a blackList and a whiteList. Each entry of a list consists of an EntityType.
For Example:

whiteList = { 4,
5,
6,
EntityType.ENTITY_CLOTTY
}

The blackList also has a special mode entry that can tell the function to do specific built-in tasks.
Usage of modes:

blackList = { 
mode = "only_same_ent"
}

All currently available modes:

  • only_same_ent: The function will only return the nearest entity that has the same Type, Variant and SubType as the source.
  • only_whitelist: The function will only return the nearest entities that are in the whiteList.
    Returns the nearest entity to another entity or, if there is none, the source Entity.

Entity Agony:getFurthestEnemy(Entity sourceEnt, *table whiteList, *table blackList)

Same as Agony:getNearestEnemy(), but returns the furthest away entity.


string Agony:getItemGfxFromId(int CollectibleType)

Returns the path of the collectible sprite of the item with CollectibleType as its id.


table Agony:getCurrentItems(*table pool)

Takes an optional table with itemIds.
Returns all items the player currently has. If a pool was given, it'll only return items that are also in the pool.


int Agony:getCurrTime()

Returns the dfTime variable. An int that counts from 0 at game start, increasing by 1 every frame.

Deprecated soon

table Agony:getEternalsList() - Returns the EternalsList table.