E
- The entity type used.A
- The attacker type used.public interface WeaponServices<E extends EntityRts,A extends AttackerUsedServices<E>>
extends com.b3dgs.lionengine.game.Surface
Modifier and Type | Method and Description |
---|---|
void |
attack(E entity)
Define a target to attack.
|
int |
getAttackDamages()
Get a random attack damages (between min and max).
|
E |
getTarget()
Get the target entity.
|
A |
getUser()
Get the weapon user.
|
boolean |
isAttacking()
Check weapon is attacking.
|
void |
setAttackDamages(int min,
int max)
Set attack damages between entity and target.
|
void |
setAttackDistance(int min,
int max)
Set attack distance between entity and target.
|
void |
setAttackFrame(int frame)
Represents the frame number (inside animation) which design the attack action.
|
void |
setAttackTimer(int time)
Set attack pause time between two attacks.
|
void |
setUser(A user)
Set the weapon user.
|
void |
stopAttack()
Stop the current attack.
|
void |
updateAttack(double extrp)
Update attack routine.
|
void attack(E entity)
entity
- The target to attack.void stopAttack()
void updateAttack(double extrp)
extrp
- The extrapolation value.void setUser(A user)
user
- The weapon user.void setAttackTimer(int time)
time
- The attack pause time.void setAttackFrame(int frame)
Example: for a footman, the frame number when the sword is going to hurt somebody (between 1-last).
frame
- The frame attack number.void setAttackDistance(int min, int max)
min
- The minimum attack distance (in tile).max
- The maximum attack distance (in tile).void setAttackDamages(int min, int max)
min
- The minimum attack damages.max
- The maximum attack damages.int getAttackDamages()
boolean isAttacking()
true
if currently attacking, false
else.A getUser()
E getTarget()