Unit entities

Description

Unit responsible for NPC stat, initialising enemies and utility functions

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Record Creature  

Functions and Procedures

procedure spawnPlayer;
procedure killEntity(id: smallint);
procedure moveNPC(id, newX, newY: smallint);
function getCreatureHP(x, y: smallint): smallint;
function getCreatureMaxHP(x, y: smallint): smallint;
function getCreatureID(x, y: smallint): smallint;
function getCreatureName(x, y: smallint): shortstring;
function getCreatureDescription(x, y: smallint): shortstring;
function isCreatureVisible(x, y: smallint): boolean;
procedure occupyUpdate;
procedure redrawMapDisplay(id: smallint);
procedure newFloorNPCs;
function countLivingEntities: smallint;
procedure outOfView;
procedure initPath(id: smallint);
procedure NPCgameLoop;

Types

Tattitudes = (...);
Tfactions = (...);

Variables

entityList: array of Creature;
listLength: smallint;
npcAmount: smallint;

Description

Functions and Procedures

procedure spawnPlayer;

Add player to list of creatures on the map

procedure killEntity(id: smallint);

Handle death of NPC's

procedure moveNPC(id, newX, newY: smallint);

Update NPCs X, Y coordinates

function getCreatureHP(x, y: smallint): smallint;

Get creature currentHP at coordinates

function getCreatureMaxHP(x, y: smallint): smallint;

Get creature maxHP at coordinates

function getCreatureID(x, y: smallint): smallint;

Get creature ID at coordinates

function getCreatureName(x, y: smallint): shortstring;

Get creature name at coordinates

function getCreatureDescription(x, y: smallint): shortstring;

Get creature description

function isCreatureVisible(x, y: smallint): boolean;

Check if creature is visible at coordinates

procedure occupyUpdate;

Ensure all NPC's are correctly occupying tiles

procedure redrawMapDisplay(id: smallint);

Update the map display to show all NPC's

procedure newFloorNPCs;

Clear list of NPC's

function countLivingEntities: smallint;

Count all living NPC's

procedure outOfView;

When the light source goes out

procedure initPath(id: smallint);

Initialise pathfinding array

procedure NPCgameLoop;

Call Creatures.takeTurn procedure

Types

Tattitudes = (...);

NPC attitudes

Values
  • stateNeutral
  • stateHostile
  • stateEscape
Tfactions = (...);

NPC factions / groups

Values
  • redcapFaction
  • bugFaction
  • animalFaction
  • fungusFaction
  • undeadFaction
  • trapFaction
  • npcFaction

Variables

entityList: array of Creature;
 
listLength: smallint;
 
npcAmount: smallint;
 

Generated by PasDoc 0.16.0.