Class: Battler

Battler

A battler in a battle (ally or ennemy)

new Battler (character, position, camera)

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

setSelected (selected)

Set the selected state
Name Type Description
selected boolean Indicate if the battler is selected

setActive (active)

Set the active state
Name Type Description
active boolean Indicate if the battler is active

setAttacking ()

Set battler step as attacking

isStepAttacking ()boolean

Check if the battler is attacking (or skill, item, escape)
Returns:
Type Description
boolean

isAttacking ()boolean

Check if the battler is attacking and the frames is currently run
Returns:
Type Description
boolean

setUsingSkill ()

Set battler step as using a skill

setUsingItem ()

Set battler step as using an item

setEscaping ()

Set battler step as escaping

setVictory ()

Set battler step as victory

updateDead (attacked, user)

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 ()

Update the battler

updateSelected ()

Update the selected move progress

updateFrame ()

Update the frame

updateArrow ()

Update the frame

updateDamages ()

Update the damages position

updateAttacking ()

Update attacking step frame

updatePositions ()

Update positions to screen

updateArrowPosition ()

Update the arrow position

addToScene ()

Add the battler to scene

removeFromScene ()

Remove battler from scene

updateUVs ()

Update the UVs coordinates according to frame and orientation

drawArrow ()

Draw the arrow to select this battler

drawDamages ()

Draw the damages on top of the battler