Repository navigation
[Lib] PawnTypeUtils
Helpers for determining more detailed pawn spawn categories on top of EasyEdit enemy lists: Core, Leader, Unique, Bots, and Boss. Includes finale mission and island specific pools.
Any issues or concerns? Join the Redacted Rice Discord and @Das Keifer
A library providing functions to determine EasyEdit spawn categories for pawns. Requires EasyEdit.
| Argument name | Type | Description |
|---|---|---|
pawn |
Pawn | Pawn to check |
spawnCategory |
number / string |
SPAWN_CATEGORIES.* id, or one of SPAWN_CATEGORIES_STRS ("Core", "Leader", "Unique", "Bots", "Boss") |
Returns whether the pawn belongs to that spawn category for the current context.
If spawnCategory is "Boss" / SPAWN_CATEGORIES.BOSS, uses isBoss.
For other categories:
- Finale missions - checks all EasyEdit enemy lists via checkAllEnemyLists
- Normal missions - checks the current island's enemy list via checkIslandEnemyList
Returns false if pawn is nil or the category is unknown.
Example:
if PawnTypeUtils.isSpawnCategory(pawn, "Leader") then
-- leader vek
end
if PawnTypeUtils.isSpawnCategory(pawn, PawnTypeUtils.SPAWN_CATEGORIES.BOSS) then
-- boss
end
| Argument name | Type | Description |
|---|---|---|
pawn |
Pawn | Pawn to check |
Returns true if any of the following hold:
_G[pawnType].Tier == TIER_BOSS- Current mission's
BossPawnmatches the pawn type - Any EasyEdit mission child lists this type as
BossPawn
Example:
if PawnTypeUtils.isBoss(pawn) then
-- treat as boss
end
| Argument name | Type | Description |
|---|---|---|
pawnType |
string | Pawn type id (e.g. "Beetle1") |
Strips a trailing digit for enemy list lookup (Beetle1 -> Beetle). Types like BeetleBoss (no trailing digit) are left unchanged. Non string/empty values are returned as is.
Example:
local baseId = PawnTypeUtils.pawnTypeToBaseId(pawn:GetType())
-- "Beetle1" -> "Beetle"
Returns true when the current mission id is Mission_Final or Mission_Final_Cave.
Example:
if PawnTypeUtils.isFinaleMission() then
-- use all-island enemy list checks
end
| Argument name | Type | Description |
|---|---|---|
enemyList |
table | EasyEdit enemy list object with an enemies table |
baseId |
string | Base pawn id (see pawnTypeToBaseId) |
category |
string | EasyEdit category name (e.g. "Core", "Leaders", "Unique", "Bots") |
Returns true if baseId appears in enemyList.enemies[category].
| Argument name | Type | Description |
|---|---|---|
baseId |
string | Base pawn id |
targetCategory |
string | EasyEdit category name |
Returns true if any EasyEdit enemy list contains baseId in targetCategory. Used for finale missions.
| Argument name | Type | Description |
|---|---|---|
baseId |
string | Base pawn id |
targetCategory |
string | EasyEdit category name |
Returns true if the current island's EasyEdit enemy list contains baseId in targetCategory.
| Name | Type | Description |
|---|---|---|
EASY_EDIT_CATEGORIES |
table |
{ "Core", "Leaders", "Unique", "Bots" } — EasyEdit list keys |
SPAWN_CATEGORIES_STRS |
table |
{ "Core", "Leader", "Unique", "Bots", "Boss" } — string names for isSpawnCategory
|
SPAWN_CATEGORIES |
table |
{ CORE = 1, LEADER = 2, UNIQUE = 3, BOTS = 4, BOSS = 5 } — numeric ids |