Skip to content

[Lib] PawnTypeUtils

DasKeifer edited this page Oct 6, 2026 · 1 revision

Overview

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

API

 

PawnTypeUtils

A library providing functions to determine EasyEdit spawn categories for pawns. Requires EasyEdit.

 

isSpawnCategory

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:

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

 

isBoss

Argument name Type Description
pawn Pawn Pawn to check

Returns true if any of the following hold:

  1. _G[pawnType].Tier == TIER_BOSS
  2. Current mission's BossPawn matches the pawn type
  3. Any EasyEdit mission child lists this type as BossPawn

Example:

if PawnTypeUtils.isBoss(pawn) then
    -- treat as boss
end

 

pawnTypeToBaseId

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"

 

isFinaleMission

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

 

isInSpawnCategory

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].

 

checkAllEnemyLists

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.

 

checkIslandEnemyList

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.

 

Constants

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

 

Clone this wiki locally