npc#
Inherits: sprite
Variables#
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
const 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 |
|
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 arg1) |
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#
NpcType NPCT_GUY = 0
NpcType NPCT_WALK = 1
NpcType NPCT_TEKTITE = 3
NpcType NPCT_LEEVER = 4
NpcType NPCT_PEAHAT = 5
NpcType NPCT_ZORA = 6
NpcType NPCT_ROCK = 7
NpcType NPCT_GHINI = 8
NpcType NPCT_ARMOS = 9
NpcType NPCT_KEESE = 10
NpcType NPCT_TRAP = 15
NpcType NPCT_WALLMASTER = 16
NpcType NPCT_WIZZROBE = 21
NpcType NPCT_AQUAMENTUS = 22
NpcType NPCT_MOLDORM = 23
NpcType NPCT_DODONGO = 24
NpcType NPCT_MANHANDLA = 25
NpcType NPCT_GLEEOK = 26
NpcType NPCT_DIGDOGGER = 27
NpcType NPCT_GOHMA = 28
NpcType NPCT_LANMOLA = 29
NpcType NPCT_PATRA = 30
NpcType NPCT_GANON = 31
NpcType NPCT_PROJECTILE = 32
NpcType NPCT_SPINTILE = 37
NpcType NPCT_NONE = 38
NpcType NPCT_FAIRY = 39
NpcType NPCT_OTHERFLOAT = 40
NpcType NPCT_OTHER = 41
NpcType NPCT_CUSTOM_01 = 43
NpcType NPCT_SCRIPT_01 = 43
NpcType NPCT_CUSTOM_02 = 44
NpcType NPCT_SCRIPT_02 = 44
NpcType NPCT_CUSTOM_03 = 45
NpcType NPCT_SCRIPT_03 = 45
NpcType NPCT_CUSTOM_04 = 46
NpcType NPCT_SCRIPT_04 = 46
NpcType NPCT_CUSTOM_05 = 47
NpcType NPCT_SCRIPT_05 = 47
NpcType NPCT_CUSTOM_06 = 48
NpcType NPCT_SCRIPT_06 = 48
NpcType NPCT_CUSTOM_07 = 49
NpcType NPCT_SCRIPT_07 = 49
NpcType NPCT_CUSTOM_08 = 50
NpcType NPCT_SCRIPT_08 = 50
NpcType NPCT_CUSTOM_09 = 51
NpcType NPCT_SCRIPT_09 = 51
NpcType NPCT_CUSTOM_10 = 52
NpcType NPCT_SCRIPT_10 = 52
NpcType NPCT_CUSTOM_11 = 53
NpcType NPCT_SCRIPT_11 = 53
NpcType NPCT_CUSTOM_12 = 54
NpcType NPCT_SCRIPT_12 = 54
NpcType NPCT_CUSTOM_13 = 55
NpcType NPCT_SCRIPT_13 = 55
NpcType NPCT_CUSTOM_14 = 56
NpcType NPCT_SCRIPT_14 = 56
NpcType NPCT_CUSTOM_15 = 57
NpcType NPCT_SCRIPT_15 = 57
NpcType NPCT_CUSTOM_16 = 58
NpcType NPCT_SCRIPT_16 = 58
NpcType NPCT_CUSTOM_17 = 59
NpcType NPCT_SCRIPT_17 = 59
NpcType NPCT_CUSTOM_18 = 60
NpcType NPCT_SCRIPT_18 = 60
NpcType NPCT_CUSTOM_19 = 61
NpcType NPCT_SCRIPT_19 = 61
NpcType NPCT_CUSTOM_20 = 62
NpcType NPCT_SCRIPT_20 = 62
NpcType NPCT_FRIENDLY_01 = 63
NpcType NPCT_FRIENDLY_02 = 64
NpcType NPCT_FRIENDLY_03 = 65
NpcType NPCT_FRIENDLY_04 = 66
NpcType NPCT_FRIENDLY_05 = 67
NpcType NPCT_FRIENDLY_06 = 68
NpcType NPCT_FRIENDLY_07 = 69
NpcType NPCT_FRIENDLY_08 = 70
NpcType NPCT_FRIENDLY_09 = 71
NpcType NPCT_FRIENDLY_10 = 72
enum NpcDefenseIndex: ๐ Source
Use as index for npc->Defense[].
NpcDefenseIndex NPCD_BRANG = 0
NpcDefenseIndex NPCD_BOMB = 1
NpcDefenseIndex NPCD_SBOMB = 2
NpcDefenseIndex NPCD_ARROW = 3
NpcDefenseIndex NPCD_FIRE = 4
NpcDefenseIndex NPCD_WAND = 5
NpcDefenseIndex NPCD_MAGIC = 6
NpcDefenseIndex NPCD_HOOKSHOT = 7
NpcDefenseIndex NPCD_HAMMER = 8
NpcDefenseIndex NPCD_SWORD = 9
NpcDefenseIndex NPCD_BEAM = 10
NpcDefenseIndex NPCD_REFBEAM = 11
NpcDefenseIndex NPCD_REFMAGIC = 12
NpcDefenseIndex NPCD_REFFIREBALL = 13
NpcDefenseIndex NPCD_REFROCK = 14
NpcDefenseIndex NPCD_STOMP = 15
NpcDefenseIndex NPCD_BYRNA = 16
NpcDefenseIndex NPCD_SCRIPT = 17
NpcDefenseIndex NPCD_SCRIPT1 = 20
NpcDefenseIndex NPCD_SCRIPT2 = 21
NpcDefenseIndex NPCD_SCRIPT3 = 22
NpcDefenseIndex NPCD_SCRIPT4 = 23
NpcDefenseIndex NPCD_SCRIPT5 = 24
NpcDefenseIndex NPCD_SCRIPT6 = 25
NpcDefenseIndex NPCD_SCRIPT7 = 26
NpcDefenseIndex NPCD_SCRIPT8 = 27
NpcDefenseIndex NPCD_SCRIPT9 = 28
NpcDefenseIndex NPCD_SCRIPT10 = 29
NpcDefenseIndex NPCD_WHISTLE = 35
NpcDefenseIndex NPCD_SWITCHHOOK = 36
NpcDefenseIndex NPCD_THROWN = 37
NpcDefenseIndex NPCD_REFARROW = 38
NpcDefenseIndex NPCD_REFFIRE = 39
NpcDefenseIndex NPCD_REFFIRE2 = 40
enum NpcDefenseType: ๐ Source
Use as value type for npc->Defense[].
NpcDefenseType NPCDT_NONE = 0
NpcDefenseType NPCDT_HALFDAMAGE = 1
NpcDefenseType NPCDT_QUARTERDAMAGE = 2
NpcDefenseType NPCDT_STUN = 3
NpcDefenseType NPCDT_STUNORBLOCK = 4
NpcDefenseType NPCDT_STUNORIGNORE = 5
NpcDefenseType NPCDT_BLOCK1 = 6
NpcDefenseType NPCDT_BLOCK2 = 7
NpcDefenseType NPCDT_BLOCK4 = 8
NpcDefenseType NPCDT_BLOCK6 = 9
NpcDefenseType NPCDT_BLOCK8 = 10
NpcDefenseType NPCDT_BLOCK = 11
NpcDefenseType NPCDT_IGNORE1 = 12
NpcDefenseType NPCDT_IGNORE = 13
NpcDefenseType NPCDT_ONEHITKILL = 14
NpcDefenseType NPCDT_BLOCK10 = 15
NpcDefenseType NPCDT_2XDAMAGE = 16
NpcDefenseType NPCDT_3XDAMAGE = 17
NpcDefenseType NPCDT_4XDAMAGE = 18
NpcDefenseType NPCDT_HEAL = 19
NpcDefenseType NPCDT_TRIGGERSECRETS = 20
NpcDefenseType NPCDT_SWITCH = 50
Enemy projectile weapon selections. Use with npc->Weapon.
Note: Donโt use these with Screen->CreateEWeapon! Use the EW_
constants instead.
Use WeaponTypeToID to convert this enum to a EW_
value.
NpcWeapon WPN_NONE = 0
NpcWeapon WPN_ENEMYFLAME = 140
NpcWeapon WPN_ENEMYWIND = 141
NpcWeapon WPN_ENEMYFIREBALL = 129
NpcWeapon WPN_ENEMYARROW = 130
NpcWeapon WPN_ENEMYBRANG = 131
NpcWeapon WPN_ENEMYSWORD = 132
NpcWeapon WPN_ENEMYROCK = 133
NpcWeapon WPN_ENEMYMAGIC = 134
NpcWeapon WPN_ENEMYBOMB = 135
NpcWeapon WPN_ENEMYSBOMB = 136
NpcWeapon WPN_ENEMYLITBOMB = 137
NpcWeapon WPN_ENEMYLITSBOMB = 138
NpcWeapon WPN_ENEMYFIRETRAIL = 139
NpcWeapon WPN_ENEMYFLAME2 = 142
NpcWeapon WPN_ENEMYFLAME2TRAIL = 143
Not implemented
NpcWeapon WPN_ENEMYICE = 144
Not implemented
NpcWeapon WPN_ENEMYFIREBALL2 = 145
A fireball that doesnโt fly toward Link
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
enum NpcMoveFlagIndex: ๐ Source
NpcMoveFlagIndex NPCMV_OBEYS_GRAVITY = 0
NpcMoveFlagIndex NPCMV_CAN_PITFALL = 1
NpcMoveFlagIndex NPCMV_CAN_PIT_WALK = 2
NpcMoveFlagIndex NPCMV_CAN_WATERDROWN = 3
NpcMoveFlagIndex NPCMV_CAN_WATER_WALK = 4
NpcMoveFlagIndex NPCMV_ONLY_WATER_WALK = 5
NpcMoveFlagIndex NPCMV_ONLY_SHALLOW_WATER_WALK = 6
NpcMoveFlagIndex NPCMV_ONLY_PIT_WALK = 7
NpcMoveFlagIndex NPCMV_NO_FAKE_Z = 8
NpcMoveFlagIndex NPCMV_NO_REAL_Z = 9
NpcMoveFlagIndex NPCMV_USE_FAKE_Z = 10
NpcMoveFlagIndex NPCMV_IGNORE_SOLIDITY = 11
NpcMoveFlagIndex NPCMV_IGNORE_BLOCKFLAGS = 12
NpcMoveFlagIndex NPCMV_IGNORE_SCREENEDGE = 13
NpcMoveFlagIndex NPCMV_USE_SCRIPTED_MOVEMENT_ENGINE = 14
NpcMoveFlagIndex NPCMV_NOT_PUSHABLE_BY_SOLIDS = 15
enum NpcShieldIndex: ๐ Source
NpcShieldIndex SHLD_FRONT = 0
NpcShieldIndex SHLD_BACK = 1
NpcShieldIndex SHLD_LEFT = 2
NpcShieldIndex SHLD_RIGHT = 3
NpcShieldIndex SHLD_CAN_BREAK = 4
NpcFade NPCF_NONE = 0
NpcFade NPCF_FLICKER = 1
NpcFade NPCF_INVISIBLE = 2
NpcFade NPCF_FLASH = 3
NpcFade NPCF_POOF = 4
Variable descriptions#
The current frame of the npcโs animation.
Returns the max number of npcs currently allowed.
The timer used for enemy knockback. The first byte is the clock. The second byte is the dir. Enemies that split do not slide.
The death effect for the npc.
Valid values: NpcFade (NPCF_
).
The clock for how long an npc is halted.
The movement status of an npc, usually flying.
See enum NPCMoveStatus in <std.zh>.
Corresponds to the Enemy Editor Random Rate value.
The enemy ID of the enemy.
The type, or โenemy classโ of the enemy.
Valid values: NpcType (NPCT_
).
The type, or โenemy classโ of the enemy. Same as Type.
Valid values: NpcType (NPCT_
).
Valid values: NpcWeapon (WPN_
).
The Dropset ID that this enemy will drop from when killed.
Valid values: ItemSet (IS_
).
Alias for npc->ItemSet.
Read or write the item dropset used by the npc.
Valid values: BossPal (BPAL_
).
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 enemy.
Expanded to a size of 42 to cover new defense categories.
Valid indices are NpcDefenseIndex (NPCD_
).
Valid values: NpcDefenseType (NPCDT_
).
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 enemy is invincible, otherwise 0.
Returns if the enemy is invincible, because of ( superman variable ).
If true, the enemy is a Ringleader, and killing this npc will kill every npc in the room.
True if the enemy is carrying an item.
Flags related to the enemyโs shield.
Valid indices are NpcShieldIndex (SHLD_
).
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 enemy 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 enemy at a time. Default 4.
The radius of light this object emits in a dark room
The shape of light this object emits in a dark room.
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 enemy is drawn when flickering.
int FlickerTransparencyPasses ๐ Source
This sets how many times the transparency effect is applied to the enemyโs flicker effect.
const int FlashingCSet ๐ Source
This returns the enemyโs current displayed cset when taking damage or invincible. If not in one of these states, will return its normal cset.
Warning
Deprecated!
Warning
Deprecated!
Function descriptions#
Returns the max number of npcs currently allowed.
Warning
Deprecated! Use Max instead!
void Max(int value) ๐ Source
Sets the max number of npcs allowed to a new value. Range 1-1024
.
Warning
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 arg1) ๐ Source
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 enemy types
Calling this from enemy 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 enemy 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 enemy to move, ignoring solidity on the screen.
void BreathAttack(bool seeklink = false
) ๐ Source
Fires the breath weapon set to the enemy.
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 enemy is lined up with Link.
If so, returns direction Link is at as compared to enemy.
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 enemy.
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_EFF_
).
Returns true if the enemy 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 enemy 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 enemy 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 enemy 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 enemy 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 enemy 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 enemy 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 = 0
, bool knockback = false
, int nw = -1
, int nh = -1
) ๐ Source
Checks if the enemy could be arbitrarily placed (teleported) at โnx,nyโ.
If โnwโ or โnhโ are > -1, they will be used as the width/height of the enemy for the check.
Otherwise, the enemyโ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.
Use the โSPW_โ constants to provide a special value;
i.e. โSPW_FLOATERโ for flying enemies.
Use โSPW_NONEโ if you donโt know what to use.
Returns true if the enemy could be placed successfully, false otherwise.
bool isFlickerFrame() ๐ Source
This returns true if the enemy 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.