Pawn Move Skill | List of Custom Functions - KnightMiner/ITB-KnightUtils GitHub Wiki

This page contains a list of custom move skill functions added by mods that use the Pawn Move Skill library. If your need is the same as or similar to another pilot mod, consider collaborating with them and using the same custom function for both of your needs.

If your mod adds a custom move skill function, please send (KnightMiner) me a message on Discord or the subset games forums and I will add it to the list.

Cauldron Pilots

CricketMoveSpeed(p1)

  • Pilot: Kate Shreeve
  • Ability: Mech leaps over tiles when moving in a line.
  • Parameters:
    • p1: Point containing the pawn

This function returns the default list of reachable points for the pilot, along with additional points in a straight line, ignoring obstacles. If the function is not provided in a custom move skill that overrides GetSkillEffect, Shreeve's ability will do nothing in that mech.

Default implementation

--- Default target area for the CricketSkillEffect
local function cricketTargetArea(p1)
  -- start with vanilla move
  local ret = pawnMove.GetDefaultTargetArea(p1)
  local defaultSpaces = extract_table(ret)
  -- add any bonus spaces in each direction
  for dir = DIR_START, DIR_END do
    -- if provided, use their move speed logic
    for i = 1, Pawn:GetMoveSpeed() do
      local point = p1 + DIR_VECTORS[dir]*i
      -- if this point is invalid, all later points will also be invalid
      if not Board:IsValid(point) then break end
      -- point must be somewhere they can land and not already included
      if not Board:IsBlocked(point, Pawn:GetPathProf()) and not list_contains(defaultSpaces, point) then
        ret:push_back(point)
      end
    end
  end
  return ret
end

Example overrides - Chess Pawns

  • Rook Mech: Same logic as default. The rook normally moves in a straight line, so this allows leaping to spaces normally unreachable.
  • Bishop Mech: Since the bishop moves diagonally, it uses Shreeve's ability to allow leaping on diagonals.
  • Knight Mech: Since the knight mech already leaps to move, this pilot has no effect.
  • King Mech: Since the king mech is flying, this pilot has no effect.