npc#
Inherits: sprite
Variables#
const int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
const int |
|
untyped[] |
|
untyped[] |
|
int |
|
bool |
|
int |
|
bool |
|
int[] |
|
untyped[] |
|
int |
|
int |
|
int |
|
int[] |
|
int |
|
int |
|
bool |
|
bool |
|
bool[] |
|
bool[] |
|
int |
|
int |
|
bool |
|
bool |
|
bool |
|
int |
|
int |
|
int |
|
bool |
|
int |
|
int |
|
const int |
|
int |
|
int |
|
int |
|
const int |
UID deprecated |
int |
ParentUID deprecated |
Functions#
int |
Max() deprecated |
void |
Max(int value) deprecated |
bool |
isValid() |
void |
Explode(int mode) |
bool |
|
void |
GetName(char32[] buffer) |
void |
|
void |
|
bool |
isDead() |
bool |
CanSlide() |
bool |
Slide() |
void |
Remove() |
void |
|
void |
Attack() |
void |
NewDir(int arr) |
void |
ConstantWalk(int arr) |
void |
ConstantWalk8(int arr) |
void |
VariableWalk(int arr) |
void |
VariableWalk8(int arr) |
void |
HaltingWalk(int arr) |
void |
HaltingWalk8(int arr) |
void |
FloatingWalk(int arr) |
void |
BreathAttack(bool seeklink = |
void |
NewDir8(int arr) |
bool |
Collision(int obj_type, untyped obj_pointer) |
int |
LinedUp(int range, bool dir8 = |
bool |
LinkInRange(int dist_in_pixels) |
bool |
CanMove(int array) |
bool |
SimulateHit(int array) |
Create(int array) |
|
bool |
Knockback(int time, int dir, int speed = |
bool |
Switch(int effect) |
bool |
|
bool |
Move(int dir, int pxamnt, int special = |
bool |
MoveAtAngle(int degrees, int pxamnt, int special = |
bool |
MoveXY(int dx, int dy, int special = |
bool |
CanMove(int dir, int pxamnt, int special = |
bool |
CanMoveAtAngle(int degrees, int pxamnt, int special = |
bool |
CanMoveXY(int dx, int dy, int special = |
bool |
CanPlace(int nx, int ny, int special = |
bool |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
OwnArray(untyped array) |
void |
OwnObject(untyped object) |
Enumerations#
Enemy IDs. Used with Screen->CreateNPC().
NPCID NPC_ABEI = 1
NPCID NPC_AMA = 2
NPCID NPC_MERCHANT = 3
NPCID NPC_MOBLIN = 4
NPCID NPC_FIRE = 5
NPCID NPC_FAIRY = 6
NPCID NPC_GORIYA = 7
NPCID NPC_ZELDA = 8
NPCID NPC_ABEI2 = 9
NPCID NPC_AQUAMENTUSL = 93
NPCID NPC_AQUAMENTUSR = 58
NPCID NPC_ARMOS = 37
NPCID NPC_BAT = 106
NPCID NPC_BOMBCHU = 160
NPCID NPC_BOULDER = 135
NPCID NPC_BUBBLEITEMP = 118
Permanently jinxes.
NPCID NPC_BUBBLEITEMR = 119
Restores item usage.
NPCID NPC_BUBBLEITEMT = 117
NPCID NPC_BUBBLESWORDP = 81
Permanently jinxes.
NPCID NPC_BUBBLESWORDR = 82
Restores sword usage.
NPCID NPC_BUBBLESWORDT = 51
NPCID NPC_CEILINGMASTER = 101
This enemy isnβt implemented.
NPCID NPC_DARKNUT1 = 49
NPCID NPC_DARKNUT2 = 50
NPCID NPC_DARKNUT3 = 92
Splits when killed.
NPCID NPC_DARKNUT4 = 172
This enemy isnβt implemented.
NPCID NPC_DARKNUT5 = 87
Sword beams.
NPCID NPC_DIGDOGGER1 = 66
Splits into 1.
NPCID NPC_DIGDOGGER3 = 67
Splits into 3.
NPCID NPC_DIGKID1 = 68
Spawned by NPC_DIGDOGGER1.
NPCID NPC_DIGKID2 = 69
Spawned by NPC_DIGDOGGER3.
NPCID NPC_DIGKID3 = 70
Spawned by NPC_DIGDOGGER3.
NPCID NPC_DIGKID4 = 71
Spawned by NPC_DIGDOGGER3.
NPCID NPC_DODONGO = 60
Uses one tile when walking vertically.
NPCID NPC_DODONGOBS = 114
Uses two tiles when walking vertically.
NPCID NPC_DODONGOFIRE = 115
This enemy isnβt implemented.
NPCID NPC_ENEMYFIRE = 85
The Fire enemy in Princess Zeldaβs screen.
NPCID NPC_FLOORMASTER = 102
This enemy isnβt implemented.
NPCID NPC_GANON = 78
NPCID NPC_GEL = 42
NPCID NPC_GELFIRE = 161
NPCID NPC_GELFIRETRIB = 163
NPCID NPC_GELTRIB = 88
NPCID NPC_GHINI1 = 35
NPCID NPC_GHINI2 = 36
NPCID NPC_GHINIMGC = 173
This enemy isnβt implemented.
NPCID NPC_GIBDO = 54
NPCID NPC_GLEEOK1 = 62
NPCID NPC_GLEEOK1FIRE = 109
NPCID NPC_GLEEOK2 = 63
NPCID NPC_GLEEOK2FIRE = 110
NPCID NPC_GLEEOK3 = 64
NPCID NPC_GLEEOK3FIRE = 111
NPCID NPC_GLEEOK4 = 65
NPCID NPC_GLEEOK4FIRE = 112
NPCID NPC_GOHMA1 = 72
NPCID NPC_GOHMA2 = 73
NPCID NPC_GOHMA3 = 121
NPCID NPC_GOHMAFIRE = 122
NPCID NPC_GORIYA1 = 45
NPCID NPC_GORIYA2 = 46
NPCID NPC_GORIYA3 = 136
NPCID NPC_GRAPBUGHP = 174
This enemy isnβt implemented.
NPCID NPC_GRAPBUGMP = 175
This enemy isnβt implemented.
NPCID NPC_ITEMFAIRY = 84
NPCID NPC_KEESE1 = 38
NPCID NPC_KEESE2 = 39
NPCID NPC_KEESE3 = 40
NPCID NPC_KEESETRIB = 90
NPCID NPC_LANMOLA1 = 74
NPCID NPC_LANMOLA2 = 75
NPCID NPC_LEEVER1 = 26
NPCID NPC_LEEVER2 = 27
NPCID NPC_LEEVER3 = 137
NPCID NPC_LIKELIKE = 53
NPCID NPC_LYNEL1 = 30
NPCID NPC_LYNEL2 = 31
NPCID NPC_LYNEL3 = 168
NPCID NPC_MANHANDLA = 61
NPCID NPC_MANHANDLA2 = 94
NPCID NPC_MOBLIN1 = 28
NPCID NPC_MOBLIN2 = 29
NPCID NPC_MOLDORM = 59
NPCID NPC_OCTOROCK1F = 22
NPCID NPC_OCTOROCK1S = 20
NPCID NPC_OCTOROCK2F = 23
NPCID NPC_OCTOROCK2S = 21
NPCID NPC_OCTOROCKBOMBF = 141
NPCID NPC_OCTOROCKBOMBS = 140
NPCID NPC_OCTOROCKFIREF = 139
NPCID NPC_OCTOROCKFIRES = 138
NPCID NPC_OCTOROCKMGC = 86
NPCID NPC_PATRA1 = 76
NPCID NPC_PATRA2 = 104
NPCID NPC_PATRA3 = 105
NPCID NPC_PATRABS = 103
NPCID NPC_PATRAOVAL = 77
NPCID NPC_PEAHAT = 32
NPCID NPC_PEAHATFIRE = 169
This enemy isnβt implemented.
NPCID NPC_POLSVOICE = 55
NPCID NPC_POLSVOICEBS = 171
This enemy isnβt implemented.
NPCID NPC_POLSVOICEMGC = 170
NPCID NPC_ROCK = 34
NPCID NPC_ROPE1 = 44
NPCID NPC_ROPE2 = 80
NPCID NPC_SHOOTFBALL = 83
NPCID NPC_SHOOTFLAME = 158
NPCID NPC_SHOOTFLAME2 = 159
NPCID NPC_SHOOTMAGIC = 154
NPCID NPC_SHOOTROCK = 155
NPCID NPC_SHOOTSPEAR = 156
NPCID NPC_SHOOTSWORD = 157
NPCID NPC_SPINTILE = 166
NPCID NPC_SPINTILERND = 167
Random spin tile.
NPCID NPC_STALFOS1 = 41
NPCID NPC_STALFOS2 = 79
NPCID NPC_STALFOS3 = 120
NPCID NPC_TEKTITE1 = 24
NPCID NPC_TEKTITE2 = 25
NPCID NPC_TEKTITE3 = 165
This enemy isnβt implemented.
NPCID NPC_TRAP = 47
NPCID NPC_TRAP8WAY = 142
This enemy isnβt implemented.
NPCID NPC_TRAPBACKSLASHC = 146
This enemy isnβt implemented.
NPCID NPC_TRAPBACKSLASHLOS = 147
This enemy isnβt implemented.
NPCID NPC_TRAPCCLOCKWISEC = 150
This enemy isnβt implemented.
NPCID NPC_TRAPCCLOCKWISELOS = 151
This enemy isnβt implemented.
NPCID NPC_TRAPCLOCKWISEC = 148
This enemy isnβt implemented.
NPCID NPC_TRAPCLOCKWISELOS = 149
This enemy isnβt implemented.
NPCID NPC_TRAPDIAG = 143
This enemy isnβt implemented.
NPCID NPC_TRAPHORIZC = 97
NPCID NPC_TRAPHORIZLOS = 95
NPCID NPC_TRAPSLASHC = 144
This enemy isnβt implemented.
NPCID NPC_TRAPSLASHLOS = 145
NPCID NPC_TRAPVERTC = 98
NPCID NPC_TRAPVERTLOS = 96
NPCID NPC_TRIGGER = 116
NPCID NPC_VIRE = 52
NPCID NPC_VIRETRIB = 91
NPCID NPC_WALLMASTER = 48
NPCID NPC_WIZZROBE1 = 56
Teleports.
NPCID NPC_WIZZROBE2 = 57
Phases through blocks.
NPCID NPC_WIZZROBEBAT = 107
NPCID NPC_WIZZROBEBAT2 = 108
This enemy isnβt implemented.
NPCID NPC_WIZZROBEFIRE = 99
NPCID NPC_WIZZROBEICE = 153
This enemy isnβt implemented.
NPCID NPC_WIZZROBEMIRR = 113
NPCID NPC_WIZZROBESUMM = 152
NPCID NPC_WIZZROBEWIND = 100
NPCID NPC_ZOL = 43
NPCID NPC_ZOLFIRE = 162
NPCID NPC_ZOLFIRETRIB = 164
NPCID NPC_ZOLTRIB = 89
NPCID NPC_ZORA = 33
enum NPCMiscBitflags: π Source
NPCMiscBitflags NPCMF_0POWERWEAPS = 1
Damaged by 0-Power Weapons.
NPCMiscBitflags NPCMF_ISINVISIBLE = 2
Is Invisible.
NPCMiscBitflags NPCMF_NEVERRETURNS = 4
Never Returns After Death.
NPCMiscBitflags NPCMF_NOT_BEATABLE = 8
Doesnβt Count as beatable Enemy.
NPCMiscBitflags NPCMF_SPAWNFLICKER = 16
Unused.
NPCMiscBitflags NPCMF_ONLY_LENS = 32
Only Seen By Lens of truth.
NPCMiscBitflags NPCMF_FLASHING = 64
Is Flashing.
NPCMiscBitflags NPCMF_FLICKERING = 128
Is Flickering.
NPCMiscBitflags NPCMF_TRANSLUCENT = 256
Is translucent.
NPCMiscBitflags NPCMF_SHIELDED_FRONT = 512
Shielded on Front.
NPCMiscBitflags NPCMF_SHIELDED_LEFT = 1024
Shielded on Left.
NPCMiscBitflags NPCMF_SHIELDED_RIGHT = 2048
Shielded on Right.
NPCMiscBitflags NPCMF_SHIELDED_BACK = 4096
Shielded on Back.
NPCMiscBitflags NPCMF_HAMMERBREAKS = 8192
Hammer Can break Shield.
Default item drop sets.
ItemSet IS_NONE = 0
ItemSet IS_DEFAULT = 1
ItemSet IS_BOMBS = 2
ItemSet IS_MONEY = 3
ItemSet IS_LIFE = 4
ItemSet IS_BOMB100 = 5
Used by Dodongos
ItemSet IS_SBOMB100 = 6
Used by Dodongos
ItemSet IS_MAGIC = 7
ItemSet IS_MAGICBOMBS = 8
ItemSet IS_MAGICMONEY = 9
ItemSet IS_MAGICLIFE = 10
ItemSet IS_MAGIC2 = 11
ItemSet IS_COMBOS = 12
Used by Tall Grass / Bush / Slash combos.
Boss palettes.
BossPal BPAL_AQUA = 0
BossPal BPAL_GLEEOK = 1
BossPal BPAL_DODONGO = 2
BossPal BPAL_GANON = 3
BossPal BPAL_BROWN = 4
BossPal BPAL_PILE = 5
Used for the Dust Pile.
BossPal BPAL_BLUE = 6
BossPal BPAL_RED = 7
BossPal BPAL_GOLD = 8
BossPal BPAL_ICON1 = 9
Used for Quest Icon 1.
BossPal BPAL_ICON2 = 10
Used for Quest Icon 2.
BossPal BPAL_ICON3 = 11
Used for Quest Icon 3.
BossPal BPAL_ICON4 = 12
Used for Quest Icon 4.
BossPal BPAL_GLEEOKF = 13
BossPal BPAL_FROZEN = 14
Unused
βspecialβ walk flags.
NPCWalkType SPW_NONE = 0
NPCWalkType SPW_DOOR = 1
NPCWalkType SPW_CLIPRIGHT = 2
NPCWalkType SPW_FLOATER = 3
NPCWalkType SPW_TRAP = 4
NPCWalkType SPW_HALFSTEP = 5
NPCWalkType SPW_WATER = 6
NPCWalkType SPW_WIZZROBE = 7
NPCWalkType SPW_CLIPBOTTOMRIGHT = 8
enum NPCMoveStatus: π Source
NPCMoveStatus NPCMS_PAUSED = 0
NPCMoveStatus NPCMS_SPEEDUP = 1
NPCMoveStatus NPCMS_NORMAL = 2
NPCMoveStatus NPCMS_SLOWDOWN = 3
Variable descriptions#
value
NPCType (NPCT_)
The type, or βnpc classβ of the npc.
value
NPCType (NPCT_)
Exactly the same as Type, use that instead.
The current frame of the npcβs animation.
Returns the max number of npcs currently allowed.
The timer used for npc knockback. The first byte is the clock. The second byte is the dir. Enemies that split do not slide.
value
NPCFade (NPCF_)
The death effect for the npc.
The clock for how long an npc is halted.
value
NPCMoveStatus (NPCMS_)
The movement status of an npc, usually flying.
Corresponds to the Enemy Editor Random Rate value.
value
NPCWeapon (WPN_)
The weapon type used by the npc.
value
ItemSet
The Dropset ID that this npc will drop from when killed.
Alias for npc->ItemSet.
Read or write the item dropset used by the npc.
const int TotalDYOffset π Source
the weaponβs total visual Y-offset.
The 8 InitD[] arguments for the npc script.
untyped[] Attributes π Source
Expanded to size [32], and made datatype-insensitive.
bool CollDetection π Source
The duration the npc is stunned for. If 0, the npc is not stunned.
This returns true if the NPC is the core segment of a segmented engine npc.
index
NPCDefenseIndex (NPCD_)
value
NPCDefenseType (NPCDT_)
The defense categories for the npc.
index
HitIndex (HIT_)
Stores the ID/UIDs of objects that hurt the npc this frame.
Indices:
The first four indices are for the *screen index* of objects:
Description Index Status
HIT_BY_NPC [0] Not used at this time.
HIT_BY_EWEAPON [1] Not used at this time.
HIT_BY_LWEAPON [2] In use by the engine.
HIT_BY_FFC [3] Not used at this time.
The next four, are for the FFCore βscriptβ UIDs of objects:
Description Index Status
HIT_BY_NPC_UID [4] Not used at this time.
HIT_BY_EWEAPON_UID [5] Not used at this time.
HIT_BY_LWEAPON_UID [6] In use by the engine.
HIT_BY_FFC_UID [7] Not used at this time.
The last two, are reserved for special damage-object types.
Description Index Status
HIT_BY_COMBO [8] Not used at this time.
HIT_BY_MAPFLAG [9] Not used at this time.
These indices are uniform across all HitBy[] array members, for any datatype with that member.
Some lweapons, notably some melee weapons such as swords (but not sword beams), and boomerangs are not yet implemented in this mechanic.
The sprite (Quest->Graphics->Sprites->Weapons) used to draw the weapon fired by the npc.
The sfx (Quest->Audio->SFXData) used whenever the npc fires its weapon. If WeaponSFX <= 0 no sound will be played.
int[] ScriptDefense π Source
Returns the number of remaining invincibility frames if the npc is invincible, otherwise 0.
Returns if the npc is invincible, because of ( superman variable ).
If true, the npc is a Ringleader, and killing this npc will kill every npc in the room.
True if the npc is carrying an item.
index
NPCShieldIndex (SHLD_)
The shield status of the npc.
Returns a direction constant if the npc is being knocked back.
Returns -1 if the npc is not being knockd back.
Writing to this has no effect, and is ignored.
This value is set both from engine, and from scripted knockback.
The npc script running on this npc.
If true, the npc will not βdieβ even if it has 0hp or is too far off-screen.
Remove() will still delete the npc.
False by default. If set to βtrueβ, engine knockback is ignored.
bool NoScriptKnockback π Source
False by default. If set to βtrueβ, scripted knockback via βnpc->Knockback()β is ignored.
The number of pixels engine knockback moves the npc at a time. Default 4.
The spawn sprite used by the npc, 0-255
The death sprite used by the npc, 0-255
If set false, the npc will neither flash, nor flicker when invincible.
This sets what color the npc is drawn when flickering.
int FlickerTransparencyPasses π Source
This sets how many times the transparency effect is applied to the npcβs flicker effect.
const int FlashingCSet π Source
This returns the npcβs current displayed cset when taking damage or invincible. If not in one of these states, will return its normal cset.
Deprecated.
Deprecated.
Function descriptions#
Returns the max number of npcs currently allowed.
Deprecated: Use Max instead!
void Max(int value) π Source
Sets the max number of npcs allowed to a new value. Range 1-1024
.
Deprecated: Use Max instead!
Returns true if this pointer points to a valid npc. If this returns false, using any other value of this pointer will error.
void Explode(int mode) π Source
Creates an explosion particle effect in mode 0, 1, or 2 of the sprite.
Returns true if the npc is submerged (ex. underground/underwater)
void GetName(char32[] buffer) π Source
void BreakShield() π Source
void RepairShield() π Source
Returns if the NPC is dead, or dying
Unimplemented
Run Engine knockback (Only does anything if a knockback is in-progress)
This is automatically called for most engine npc types
Calling this from npc types such as βOtherβ will allow them to recieve knockback
This is called as a part of scripted walking functions, such as βConstantWalk()β, automatically.
Return: 0 if no knockback occurred, 1 if scripted knockback (β->Knockback()β) occurred, 2 if engine knockback occurred.
Instantly DELETES an npc. No items will be dropped, no sound will play; the npc is simply DELETED OUTRIGHT.
This will immediately invalidate the npc pointer, as well as update βScreen->NumNPCs()β, and change the indexes for βScreen->LoadNPC()β
If called from an NPC script on the NPC running the script, immediately terminates the script.
Stops the background sounds that the npc is generating.
Causes the npc to attack with its weapon.
void NewDir(int arr) π Source
The npc chooses a new direction.
Uses an array literal for its args:
{ int rate, int homing, int special }
void ConstantWalk(int arr) π Source
Causes the npc to walk.
Uses an array literal for its args.
Pass NULL as the pointer to run without args, or use:
{int rate, int homing, int special}
void ConstantWalk8(int arr) π Source
As ConstantWalk(), but 8-directions.
{int rate, int homing, int special}
void VariableWalk(int arr) π Source
Causes the npc to walk and occasionally change speed.
{int rate, int homing, int special}
void VariableWalk8(int arr) π Source
As VariableWalk(), but 8-directions.
{int rate, int homing, int newclk, int special}
{int rate, int homing, int newclk, int special, int dx1, int dy1, int dx2, int dy2}
void HaltingWalk(int arr) π Source
Causes an npc to walk, and occasionally halt.
{int rate, int homing, int special, int hrate, int haltcnt}
void HaltingWalk8(int arr) π Source
As HaltingWalk(), but 8-directions.
{int newrate, int newhoming, int newclk, int special, int newhrate, int haltcnt}
void FloatingWalk(int arr) π Source
Causes an npc to move, ignoring solidity on the screen.
void BreathAttack(bool seeklink = false
) π Source
Fires the breath weapon set to the npc.
void NewDir8(int arr) π Source
As NewDir(), but 8-directions.
{int rate, int homing, int special}
{int rate, int homing, int special, int dx1, int dy1, int dx2, int dy2}
bool Collision(int obj_type, untyped obj_pointer) π Source
Returns if either an object is colliding with the npc, or if an arbitrary set of
coordinates would collide.
Valid Object Types:
obj_type_lweapon, obj_type_eweapon, obj_type_npc, obj_type_link, obj_type_ffc, obj_type_combo_pos, obj_type_item
** Not fully implemented!
int LinedUp(int range, bool dir8 = false
) π Source
Checks if npc is lined up with Link.
If so, returns direction Link is at as compared to npc.
Returns -1 if not lined up. Range is inclusive.
bool LinkInRange(int dist_in_pixels) π Source
Returns true if Link is within βrangeβ pixels of the npc.
bool CanMove(int array) π Source
Returns true if the npc can move in a given direction.
Uses an array literal for varying args.
Overloaded for a number of options:
{int dir}: Dir only, should use the default step distance.
{int dir, int special}
{int ndir, int step, int special}
{int ndir,int step,int special,int dx1,int dy1,int dx2,int dy2}
bool SimulateHit(int array) π Source
Simulates hitting the npc with a weapon, another sprite, or an arbitrary set of
values passed as an overloaded array literal.
Returns true if that object would hit the npc.
{TYPE, pointer} : Specify the type, such as PTR_TYPE_LWEAPON, then pass an object pointer.
{int tx, int ty, int tz, int txsz, int tysz, int tzsz} : Arbitrary values.
npc Create(int array) π Source
Similar to Screen->CreateNPC(), except:
It uses an arry literal for its args, with varying size.
You can either create an npc only by its ID, or you can do
that and set its spawn coordinates at the same time.
It works based on an existing pointer, such as:
npc n; n->Create{args});
{ int id }
{ int id, int x, int y }
bool Knockback(int time, int dir, int speed = 4
) π Source
Attempt to knock back the npc in βdirβ direction, for βtimeβ frames, at a rate of βspeedβ pixels per frame.
bool Switch(int effect) π Source
Switch the Hero with this sprite.
Valid values for effect
is SwitchEffect (SW_) (SW_EFF_
).
Returns true if the npc is in a state in which it should not be allowed to move (ex. spawning, dying, stunned, time frozen by clock)
bool Move(int dir, int pxamnt, int special = 0
) π Source
Attempts to move the npc by βpxamntβ pixels in the βdirβ direction, failing if it is blocked by something it cannot walk through.
bool MoveAtAngle(int degrees, int pxamnt, int special = 0
) π Source
Attempts to move the npc by βpxamntβ pixels in the βdegreesβ angle, failing if it is blocked by something it cannot walk through.
bool MoveXY(int dx, int dy, int special = 0
) π Source
Attempts to move the npc by βdxβ in the x direction and βdyβ in the y direction, failing if it is blocked by something it cannot walk through.
bool CanMove(int dir, int pxamnt, int special = 0
) π Source
Attempts to move the npc by βpxamntβ pixels in the βdirβ direction, failing if it is blocked by something it cannot walk through.
bool CanMoveAtAngle(int degrees, int pxamnt, int special = 0
) π Source
Attempts to move the npc by βpxamntβ pixels in the βdegreesβ angle, failing if it is blocked by something it cannot walk through.
bool CanMoveXY(int dx, int dy, int special = 0
) π Source
Attempts to move the npc by βdxβ in the x direction and βdyβ in the y direction, failing if it is blocked by something it cannot walk through.
bool CanPlace(int nx, int ny, int special = SPW_NONE
, bool knockback = false
, int nw = -1
, int nh = -1
) π Source
param
NPCWalkType (SPW_) special - for example, SPW_FLOATER for flying enemies
Checks if the npc could be arbitrarily placed (teleported) at βnx,nyβ.
If βnwβ or βnhβ are > -1, they will be used as the width/height of the npc for the check.
Otherwise, the npcβs hitwidth/hitheight are used.
Some enemies treat pits/liquid as solid, EXCEPT if they are being knocked back.
βbool knockbackβ here affects this for the placement checks.
Returns true if the npc could be placed successfully, false otherwise.
bool isFlickerFrame() π Source
This returns true if the npc is currently in a flicker frame (either invisible or color masked).
void Own(bitmap b) π Source
Grants βOwnershipβ of the parameter object to the npc.
void Own(paldata b) π Source
Grants βOwnershipβ of the parameter object to the npc.
Grants βOwnershipβ of the parameter object to the npc.
void Own(directory b) π Source
Grants βOwnershipβ of the parameter object to the npc.
Grants βOwnershipβ of the parameter object to the npc.
void Own(randgen b) π Source
Grants βOwnershipβ of the parameter object to the npc.
void OwnArray(untyped array) π Source
Grants βOwnershipβ of the parameter object to the npc.
void OwnObject(untyped object) π Source
Grants βOwnershipβ of the parameter object to the npc.