Module necro.game.character.Attack
Functions
applyAttackabilityComponent (ev, component) | |
firstAttackableEntityOnTile (attacker, x, y, flags) | |
getAttackableEntitiesOnTile (attacker, x, y, flags) | |
hasAttackableEntitiesOnTile (attacker, x, y, flags) | |
isAttackable (attacker, target, flags) | |
perform (entity, direction) | Causes the specified entity to attempt to perform an attack in the specified direction. |
performInnateAttack (attacker, victim, swipeless, damageMultiplier) | |
updateAttackability (entity) |
Tables
Flag | |
FlagGroup |
Functions
- applyAttackabilityComponent (ev, component)
-
Parameters:
- ev
- component
- firstAttackableEntityOnTile (attacker, x, y, flags)
-
Parameters:
- attacker
- x
- y
- flags
- getAttackableEntitiesOnTile (attacker, x, y, flags)
-
Parameters:
- attacker
- x
- y
- flags
- hasAttackableEntitiesOnTile (attacker, x, y, flags)
-
Parameters:
- attacker
- x
- y
- flags
- isAttackable (attacker, target, flags)
-
Parameters:
- attacker
- target
- flags
- perform (entity, direction)
-
Causes the specified entity to attempt to perform an attack in the specified direction.
Returns 'true' upon a successful attack, or 'false' if no attack could be performed.
Parameters:
- entity
- direction
- performInnateAttack (attacker, victim, swipeless, damageMultiplier)
-
Parameters:
- attacker
- victim
- swipeless
- damageMultiplier
- updateAttackability (entity)
-
Parameters:
- entity
Tables
- Flag
-
Fields:
- NONE
0
- Entities without attackability flags cannot be targeted by any kind of attack. - ALL
-1
- Bitwise combination of all possible flags. Can be used to remove all attackability flags from an entity. - DEFAULT
1
- - Regular flags: an attack requires at least one of those to be common between attack and attackability. Attack execution flag. Most attacks set this flag. It is also set while detecting targets directly adjacent to the player. Most characters and crates use this flag. - DIRECT
1
- Deprecated - CHARACTER
2
- Weapon attack check flag. This flag is set while detecting targets in range of a player's weapon attack. Most characters use this flag, whereas crates omit it. - INDIRECT
2
- Deprecated - PROVOKE
4
- Provocative attack flag. All non-weapon attacks (except Holy Water and Lunging), weapon throws and gun-type ranged weapons set this flag. Friendly NPCs such as shopkeepers use this flag if they have not yet been hit. - PHASING
8
- Incorporeal attack flag. The only attack to set this flag is the Dagger of Phasing. "Hidden" entities such as phased-out ghosts, underground moles and sleeping mimics use this flag. - EXPLOSIVE
16
- Explosion collateral damage flag. Only explosions set this flag. Shrines and unactivated mimics use this flag. - UNDEAD
32
- Undead vulnerability flag. Only Holy Water and Scroll of Need's damage effects set this flag. All enemies, excluding NPCs (even after being hit), use this flag. - TRAP
64
- Trap trigger flag. Most ground traps set this flag. All grounded lightweight entities use this flag. - KICK
128
- Kick vulnerability flag. Eli's innate kick sets this flag. Lit bombs use this flag. - EARTHQUAKE
256
- Earthquake vulnerability flag. Only set by earthquake scroll and DR’s hammer. By default used by grounded enemies, with some exceptions (like CR) - PAIN
512
- Pain vulnerability flag. Boots of pain set this flag. Non-gargoyle cratelikes use this flag. - PLAYER_CONTROLLED
1024
- Set by player-controlled entities. Lobby triggers use this flag. - IGNORE_TEAM
1073741824
- Attacks with this flag will target entities of the same team. Certain spells, miniboss trampling attacks and Ogre club smashes set this flag. This is a special flag handled separately, it should never be set in the attackability field.
- NONE
- FlagGroup
-
Fields:
- SPELL
13
- SPELL