Name | Type | Description |
---|---|---|
character |
GamePlayer | The character properties |
position |
THREE.Vector3 | The battler position |
camera |
Camera | the camera associated to the battle |
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
Battler.OFFSET_SELECTED |
number |
<optional> |
10 | The pixel offset when the battler is selected |
Battler.TIME_MOVE |
number |
<optional> |
200 | The time in milliseconds when the battler moves to selection offset |
Battler.TOTAL_TIME_DAMAGE |
number |
<optional> |
250 | The total time in milliseconds for displaying damages animation |
character |
GamePlayer | The character properties | ||
arrowPosition |
THREE.Vector2 | The target arrow position on screen | ||
damagePosition |
THREE.Vector2 | The damage position on screen | ||
topPosition |
THREE.Vector2 | The top animation position on screen | ||
midPosition |
THREE.Vector2 | The mid animaion position on screen | ||
botPosition |
THREE.Vector2 | The bot animation position on screen | ||
active |
boolean | Indicate if the battler already attacked or not | ||
frame |
Frame | The battler frame | ||
frameAttacking |
Frame | The attacking battler frame | ||
frameArrow |
Frame | The target arrow frame | ||
step |
BattlerStep | The battler step | ||
width |
number | The battler textures width in squares | ||
height |
number | The battler textures height in squares | ||
selected |
boolean | Indicate if the battler is selected | ||
lastCommandIndex |
number | The last selected index command | ||
lastCommandOffset |
number | The last selected offset command | ||
lastSkillIndex |
number | The last selected index skill | ||
lastSkillOffset |
number | The last selected offset skill | ||
lastItemIndex |
number | The last selected index item | ||
lastItemOffset |
number | The last selected offset item | ||
itemsNumbers |
number | Number of items used according to ID (for actions AI) | ||
progressionAllyFront |
SystemProgressionTable | The progression for ally to move front | ||
progressionAllyBack |
SystemProgressionTable | The progression for ally to move back | ||
progressionEnemyFront |
SystemProgressionTable | The progression for enemy to move front | ||
progressionEnemyBack |
SystemProgressionTable | The progression for enemy to move back | ||
timerMove |
number | The time to move front / back | ||
timeDamage |
number | The time to display damage | ||
mesh |
THREE.Mesh | The battler mesh | ||
upPosition |
THREE.Vector3 | The vector position up to the battler | ||
halfPosition |
THREE.Vector3 | The vector position halp to the | ||
moving |
boolean | Indicate if the battler is moving ( selection) |
Methods
-
Set the selected state
Name Type Description selected
boolean Indicate if the battler is selected -
Set the active state
Name Type Description active
boolean Indicate if the battler is active -
Set battler step as attacking
-
Check if the battler is attacking (or skill, item, escape)
Returns:
Type Description boolean -
Check if the battler is attacking and the frames is currently run
Returns:
Type Description boolean -
Set battler step as using a skill
-
Set battler step as using an item
-
Set battler step as escaping
-
Set battler step as victory
-
Update battler step if is dead, attacked if attacked
Name Type Description attacked
boolean Indicate if the battler is attacked user
GamePlayer The attack / skill / item user -
Update the battler
-
Update the selected move progress
-
Update the frame
-
Update the frame
-
Update the damages position
-
Update attacking step frame
-
Update positions to screen
-
Update the arrow position
-
Add the battler to scene
-
Remove battler from scene
-
Update the UVs coordinates according to frame and orientation
-
Draw the arrow to select this battler
-
Draw the damages on top of the battler