Class: Game_Battler

Game_Battler()

new Game_Battler()

The superdeclare class of Game_Actor and Game_Enemy. It contains methods for sprites

Extends

Methods

action(index) → {Game_Action}

Parameters:
Name Type Description
index Number
Returns:
Type
Game_Action

actionPlusSet() → {Array.<number>}

Inherited From:
Returns:
Type
Array.<number>

addBuff(paramId, turns)

Adds a buff to the battler for the specified number of turns on the selected parameter.
Parameters:
Name Type Description
paramId Number
turns Number

addDebuff(paramId, turns)

Adds a debuff to the battler for the specified number of turns on the selected parameter.
Parameters:
Name Type Description
paramId Number
turns Number

addedSkills() → {Array.<number>}

Inherited From:
Returns:
Type
Array.<number>

addedSkillTypes() → {Array.<number>}

Inherited From:
Returns:
Type
Array.<number>

addNewState(stateId)

Adds a new state given a state id to the battler.
Parameters:
Name Type Description
stateId Number
Inherited From:

addParam(paramId, value)

Parameters:
Name Type Description
paramId Number
value Number
Inherited From:

addState(stateId)

Adds a state to the battler given the specified state id.
Parameters:
Name Type Description
stateId Number

allIcons() → {Array.<number>}

Returns all of the icons attached to the battler.
Inherited From:
Returns:
Type
Array.<number>

allTraits() → {Array.<RPG.Trait>}

Returns all the traits of the battler.
Inherited From:
Returns:
Type
Array.<RPG.Trait>

appear()

Shows the game battler.
Inherited From:

attackElements() → {Array.<number>}

Returns the attack elements of the battler as a list of numbers.
Inherited From:
Returns:
Type
Array.<number>

attackSkillId() → {Number}

Returns the attack skill id in the database.
Inherited From:
Returns:
Type
Number

attackSpeed() → {Number}

Returns the attack speed of the battler.
Inherited From:
Returns:
Type
Number

attackStates() → {Array.<number>}

Returns the attack states of the battler as a list of numbers.
Inherited From:
Returns:
Type
Array.<number>

attackStatesRate(stateId)

Parameters:
Name Type Description
stateId Number
Inherited From:

attackTimesAdd() → {Number}

Returns the number of attacks available to the battler.
Inherited From:
Returns:
Type
Number

buff(paramId) → {Number}

Buffs the current parameter id.
Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

buffIconIndex(buffLevel, paramId) → {Number}

Parameters:
Name Type Description
buffLevel Number
paramId Number
Inherited From:
Returns:
Type
Number

buffIcons() → {Array.<number>}

Returns the array of buff icons attached to the battler; this is determined by the active buffs on the battler.
Inherited From:
Returns:
Type
Array.<number>

buffLength() → {Number}

Returns the length of the buff.
Inherited From:
Returns:
Type
Number

canAttack() → {Boolean}

Returns true if the battler can attack.
Inherited From:
Returns:
Type
Boolean

canEquip(item) → {Boolean}

Returns true if the battler can equip the item.
Parameters:
Name Type Description
item RPG.EquipItem
Inherited From:
Returns:
Type
Boolean

canEquipArmor(item) → {Boolean}

Returns true if the battler can equip armor.
Parameters:
Name Type Description
item RPG.EquipItem
Inherited From:
Returns:
Type
Boolean

canEquipWeapon(item) → {Boolean}

Returns true if the battler can equip a weapon.
Parameters:
Name Type Description
item RPG.EquipItem
Inherited From:
Returns:
Type
Boolean

canGuard() → {Boolean}

Returns true if the battler can guard.
Inherited From:
Returns:
Type
Boolean

canInput() → {Boolean}

Returns true if the battler can input actions.
Inherited From:
Returns:
Type
Boolean

canMove() → {Boolean}

Inherited From:
Returns:
Type
Boolean

canPaySkillCost(skill) → {Boolean}

Returns true if the battler can pay the cost of the specified skill.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:
Returns:
Type
Boolean

canUse(item) → {Boolean}

Returns true if the battler can use the item.
Parameters:
Name Type Description
item RPG.UsableItem
Inherited From:
Returns:
Type
Boolean

chargeTpByDamage(damageRate)

Parameters:
Name Type Description
damageRate Number

clearActions()

Clears the battler actions.

clearAnimations()

Clears animations from the battler.

clearBuffs()

Clears buffs from the battler.
Inherited From:

clearDamagePopup()

Clear damage pop up from the battler.

clearEffect()

Clears effect from the battler.

clearMotion()

Clears motion from the battler.

clearParamPlus()

Inherited From:

clearResult()

Clears the battler action result.

clearStates()

Inherited From:

clearTp()

Clears the battler's tp.

clearWeaponAnimation()

Clear weapon animation from the battler.

collapseType() → {Number}

Returns the collapse type of the battler.
Inherited From:
Returns:
Type
Number

confusionLevel() → {Number}

Returns the confusion level of the battler.
Inherited From:
Returns:
Type
Number

consumeItem(item)

Has the battler consume the given item.
Parameters:
Name Type Description
item RPG.UsableItem

currentAction() → {Game_Action}

Returns the current action of the battler.
Returns:
Type
Game_Action

deathStateId() → {Number}

Returns the death state id.
Inherited From:
Returns:
Type
Number

debuffRate(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

decreaseBuff(paramId)

Parameters:
Name Type Description
paramId Number
Inherited From:

deselect()

die()

Kills the battler.
Inherited From:

effectType() → {String}

Returns the effect type of the battler.
Returns:
Type
String

elementRate(elementId) → {Number}

Parameters:
Name Type Description
elementId Number
Inherited From:
Returns:
Type
Number

eraseBuff(paramId)

Parameters:
Name Type Description
paramId Number
Inherited From:

eraseState(stateId)

Erases the current state from the game battler given the stateId in the editor database.
Parameters:
Name Type Description
stateId Number
Inherited From:

escape()

Has the battler escape from battle; plays a sound on escaping.

forceAction(skillId, targetIndex)

Parameters:
Name Type Description
skillId Number
targetIndex Number

gainHp(value)

Adds the specified amount of hp to the battler.
Parameters:
Name Type Description
value Number

gainMp(value)

Adds the specified amount of mp to the battler.
Parameters:
Name Type Description
value Number

gainSilentTp(value)

Adds a specified amount of tp to the battler silently.
Parameters:
Name Type Description
value Number

gainTp(value)

Adds the specified amount of tp to the battler.
Parameters:
Name Type Description
value Number

guardSkillId() → {Number}

Returns the guard skill id in the database.
Inherited From:
Returns:
Type
Number

hide()

Hides the game battler.
Inherited From:

hpRate() → {Number}

Returns the percentage of the battler's hp left as a float.
Inherited From:
Returns:
Type
Number

increaseBuff(paramId)

Parameters:
Name Type Description
paramId Number
Inherited From:

initialize()

Overrides:

initMembers()

Overrides:

initTp()

Initializes the battler's tp; tp is random.

isActing() → {Boolean}

Returns true if the battler is performing an action in battle.
Returns:
Type
Boolean

isActor() → {Boolean}

Returns true if the battler is an actor.
Inherited From:
Returns:
Type
Boolean

isAlive() → {Boolean}

Returns true if the battler is alive.
Inherited From:
Returns:
Type
Boolean

isAnimationRequested() → {Boolean}

Returns:
Type
Boolean

isAppeared() → {Boolean}

Returns true if the game battler is not hidden.
Inherited From:
Returns:
Type
Boolean

isAutoBattle() → {Boolean}

Returns true if the battler is set to battle automatically.
Inherited From:
Returns:
Type
Boolean

isBuffAffected(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isBuffExpired(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isBuffOrDebuffAffected(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isChanting() → {Boolean}

Returns true if the battler is chanting in combat.
Returns:
Type
Boolean

isConfused() → {Boolean}

Returns true if the battler is confused.
Inherited From:
Returns:
Type
Boolean

isDamagePopupRequested() → {Boolean}

Returns:
Type
Boolean

isDead() → {Boolean}

Returns true if the battler is dead.
Inherited From:
Returns:
Type
Boolean

isDeathStateAffected() → {Boolean}

Inherited From:
Returns:
Type
Boolean

isDebuffAffected(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isDualWield() → {Boolean}

Returns true if the battler dual wields.
Inherited From:
Returns:
Type
Boolean

isDying() → {Boolean}

Returns true if the battler is dying.
Inherited From:
Returns:
Type
Boolean

isEffectRequested() → {Boolean}

Returns:
Type
Boolean

isEnemy() → {Boolean}

Returns true if the battler is an enemy.
Inherited From:
Returns:
Type
Boolean

isEquipAtypeOk(atypeId) → {Boolean}

Parameters:
Name Type Description
atypeId Number
Inherited From:
Returns:
Type
Boolean

isEquipTypeLocked(etypeId) → {Boolean}

Parameters:
Name Type Description
etypeId Number
Inherited From:
Returns:
Type
Boolean

isEquipTypeSealed(etypeId) → {Boolean}

Parameters:
Name Type Description
etypeId Number
Inherited From:
Returns:
Type
Boolean

isEquipWtypeOk(wtypeId) → {Boolean}

Parameters:
Name Type Description
wtypeId Number
Inherited From:
Returns:
Type
Boolean

isGuard() → {Boolean}

Returns true if the battler is guarding.
Inherited From:
Returns:
Type
Boolean

isGuardWaiting() → {Boolean}

Returns true if the battler is waiting to guard.
Returns:
Type
Boolean

isHidden() → {Boolean}

Returns true if the game battler is hidden.
Inherited From:
Returns:
Type
Boolean

isInputting() → {Boolean}

Returns true if the battler is inputting commands in battle.
Returns:
Type
Boolean

isMaxBuffAffected(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isMaxDebuffAffected(paramId) → {Boolean}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Boolean

isMotionRefreshRequested() → {Boolean}

Returns:
Type
Boolean

isMotionRequested() → {Boolean}

Returns true if a motion is requested.
Returns:
Type
Boolean

isOccasionOk(item) → {Boolean}

Returns true if the item occasion is okay.
Parameters:
Name Type Description
item RPG.UsableItem
Inherited From:
Returns:
Type
Boolean

isPreserveTp() → {Boolean}

Returns true if tp is preserved between battles.
Inherited From:
Returns:
Type
Boolean

isRestricted() → {Boolean}

Returns true if the game battler is restricted.
Inherited From:
Returns:
Type
Boolean

isSelected() → {Boolean}

Returns:
Type
Boolean

isSkillSealed(stypeId) → {Boolean}

Parameters:
Name Type Description
stypeId Number
Inherited From:
Returns:
Type
Boolean

isSkillTypeSealed(stypeId) → {Boolean}

Parameters:
Name Type Description
stypeId Number
Inherited From:
Returns:
Type
Boolean

isSkillWtypeOk(skill) → {Boolean}

Returns true if the skill is a weapon type oriented skill.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:
Returns:
Type
Boolean

isStateAddable(stateId) → {Boolean}

Returns true if the specified state given the state id is addable.
Parameters:
Name Type Description
stateId Number
Returns:
Type
Boolean

isStateAffected(stateId) → {Boolean}

Returns true if the battler is affected by the specified state given the state id.
Parameters:
Name Type Description
stateId Number
Inherited From:
Returns:
Type
Boolean

isStateExpired(stateId) → {Boolean}

Returns true if the state, given the state id is expired.
Parameters:
Name Type Description
stateId Number
Inherited From:
Returns:
Type
Boolean

isStateResist(stateId) → {Boolean}

Parameters:
Name Type Description
stateId Number
Inherited From:
Returns:
Type
Boolean

isStateRestrict(stateId) → {Boolean}

Returns true if the specified state given the state id restricts.
Parameters:
Name Type Description
stateId Number
Returns:
Type
Boolean

isSubstitute() → {Boolean}

Inherited From:
Returns:
Type
Boolean

isUndecided() → {Boolean}

Returns:
Type
Boolean

isWaiting() → {Boolean}

Returns true if the battler is waiting in battle.
Returns:
Type
Boolean

isWeaponAnimationRequested() → {Boolean}

Returns true if a weapon animation is requested.
Returns:
Type
Boolean

makeActions()

Creates the actions for the battler.

makeActionTimes() → {Number}

Creates the number of times for an action.
Returns:
Type
Number

makeSpeed()

Calculates the speed of the battler.

maxSlipDamage() → {Number}

Returns:
Type
Number

maxTp() → {Number}

Returns the maximum tp of the battler.
Inherited From:
Returns:
Type
Number

meetsItemConditions(item) → {Boolean}

Returns true if the battler meets the item conditions.
Parameters:
Name Type Description
item RPG.Item
Inherited From:
Returns:
Type
Boolean

meetsSkillConditions(skill) → {Boolean}

Returns true if the battler meets the skill conditions.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:
Returns:
Type
Boolean

meetsUsableItemConditions(item) → {Boolean}

Parameters:
Name Type Description
item RPG.UsableItem
Inherited From:
Returns:
Type
Boolean

mostImportantStateText() → {String}

Inherited From:
Returns:
Type
String

motionType() → {String}

Returns the motion type of the battler.
Returns:
Type
String

mpRate() → {Number}

Returns the percentage of the battler's mp left as a float.
Inherited From:
Returns:
Type
Number

numActions() → {Number}

Returns the number of battler actions.
Returns:
Type
Number

onAllActionsEnd()

onBattleEnd()

onBattleStart()

onDamage(value)

Parameters:
Name Type Description
value Number

onRestrict()

Handler for when theb attler is restricted.
Overrides:

onTurnEnd()

overwriteBuffTurns(paramId, turns)

Parameters:
Name Type Description
paramId Number
turns Number
Inherited From:

param(paramId) → {Number}

Returns a standard parameter, given a paramId; standard parameters include: HP, MP, Atk, M.Atk, Def, M.Def, Luck, Agility.
Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramBase(paramId) → {Number}

Returns the base parameters of the battler; this is determined by their current level and the paramId given.
Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramBuffRate(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramMax(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramMin(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramPlus(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

paramRate(paramId) → {Number}

Parameters:
Name Type Description
paramId Number
Inherited From:
Returns:
Type
Number

partyAbility(abilityId) → {Boolean}

Parameters:
Name Type Description
abilityId Number
Inherited From:
Returns:
Type
Boolean

paySkillCost(skill)

Pays the cost of the skill when activating the skill.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:

performAction(action)

Perform given action motion.
Parameters:
Name Type Description
action Game_Action

performActionEnd()

Perform action end motion.

performActionStart(action)

Perform action start motion, given the specified game action.
Parameters:
Name Type Description
action Game_Action

performCollapse()

Performs the collapse motion.

performCounter()

Perform counter motion.

performDamage()

Perform damage motion.

performEvasion()

Perform evasion motion.

performMagicEvasion()

Perform magic evasion motion.

performMiss()

Perform miss motion.

performRecovery()

Perform recovery motion.

performReflection()

Performs the reflect motion.

performSubstitute(target)

Perform substitute motion with the specified game battler.
Parameters:
Name Type Description
target Game_Battler

recoverAll()

Recovers the battler from all states and restores the battler to maximum hp and mp.
Inherited From:

refresh()

Refreshes the battler.
Overrides:

regenerateAll()

Handler for when battle has started.

regenerateHp()

Has the battler regenerate hp based on their hp regen.

regenerateMp()

Has the battler regenerate mp based on their mp regen.

regenerateTp()

Has the battler regenerate tp based on their tp regen.

removeAllBuffs()

Removes all buffs from the battler.

removeBattleStates()

removeBuff(paramId)

Parameters:
Name Type Description
paramId Number

removeBuffsAuto()

removeCurrentAction()

Removes the current battler action.

removeState(stateId)

Removes the specified state given the state id.
Parameters:
Name Type Description
stateId Number

removeStatesAuto(timing)

Parameters:
Name Type Description
timing Number

removeStatesByDamage()

requestEffect(effectType)

Parameters:
Name Type Description
effectType String

requestMotion(motionType)

Request the specified motion on the game battler.
Parameters:
Name Type Description
motionType String

requestMotionRefresh()

resetStateCounts(stateId)

Resets the state count of the specified state, given the state id.
Parameters:
Name Type Description
stateId Number
Inherited From:

restriction() → {Number}

Returns the number of the restriction.
Inherited From:
Returns:
Type
Number

result() → {Game_ActionResult}

Returns the battler action result.
Returns:
Type
Game_ActionResult

revive()

Revives the battler.
Inherited From:

select()

setAction(index, action)

Sets the action at the specified index for the battler.
Parameters:
Name Type Description
index Number
action Game_Action

setActionState(actionState)

Parameters:
Name Type Description
actionState String

setHp(hp)

Sets the battler hp.
Parameters:
Name Type Description
hp Number
Inherited From:

setLastTarget(target)

Parameters:
Name Type Description
target Game_Battler

setMp(mp)

Sets the battler mp.
Parameters:
Name Type Description
mp Number
Inherited From:

setTp(tp)

Sets the battler tp.
Parameters:
Name Type Description
tp Number
Inherited From:

shiftAnimation() → {MV.BattlerAnimation}

Shifts the battler animation.
Returns:
Type
MV.BattlerAnimation

skillMpCost(skill) → {Number}

Returns the mp cost of the skill.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:
Returns:
Type
Number

skillTpCost(skill) → {Number}

Returns the tp cost of the skill.
Parameters:
Name Type Description
skill RPG.Skill
Inherited From:
Returns:
Type
Number

slotType() → {Number}

Returns the battler slot type of a trait.
Inherited From:
Returns:
Type
Number

sortStates()

Sorts the states attached to the battler.
Inherited From:

sparam(sparamId) → {Number}

Parameters:
Name Type Description
sparamId Number
Inherited From:
Returns:
Type
Number

specialFlag(flagId) → {Boolean}

Parameters:
Name Type Description
flagId Number
Inherited From:
Returns:
Type
Boolean

speed() → {Number}

Returns the speed of the battler.
Returns:
Type
Number

startAnimation(animationId, mirror, delay)

Starts the specified animation, given the animation id on the battler.
Parameters:
Name Type Description
animationId Number
mirror Boolean
delay Number

startDamagePopup()

Starts a damage pop up on the battler.

startWeaponAnimation(weaponImageId)

Starts the weapon animation on te battler given a weapon id.
Parameters:
Name Type Description
weaponImageId Number

stateIcons() → {Array.<number>}

Returns the array of state icons attached to the battler; this is determined by the active states on the battler.
Inherited From:
Returns:
Type
Array.<number>

stateMotionIndex() → {Number}

Inherited From:
Returns:
Type
Number

stateOverlayIndex() → {Number}

Inherited From:
Returns:
Type
Number

stateRate(stateId) → {Number}

Parameters:
Name Type Description
stateId Number
Inherited From:
Returns:
Type
Number

stateResistSet() → {Array.<number>}

Inherited From:
Returns:
Type
Array.<number>

states() → {Array.<RPG.State>}

Returns the states applied to the battler.
Inherited From:
Returns:
Type
Array.<RPG.State>

tpRate() → {Number}

Returns the percentage of the battler's tp left as a float.
Inherited From:
Returns:
Type
Number

traitObjects() → {Array.<*>}

Returns an array of the all objects having traits. States only here.
Inherited From:
Returns:
Type
Array.<*>

traits(code) → {Array.<RPG.Trait>}

Parameters:
Name Type Description
code Number
Inherited From:
Returns:
Type
Array.<RPG.Trait>

traitsPi(code, id) → {Number}

Parameters:
Name Type Description
code Number
id Number
Inherited From:
Returns:
Type
Number

traitsSet(code) → {Array.<number>}

Parameters:
Name Type Description
code Number
Inherited From:
Returns:
Type
Array.<number>

traitsSum(code, id) → {Number}

Parameters:
Name Type Description
code Number
id Number
Inherited From:
Returns:
Type
Number

traitsSumAll(code) → {Number}

Parameters:
Name Type Description
code Number
Inherited From:
Returns:
Type
Number

traitsWithId(code, id) → {Array.<RPG.Trait>}

Parameters:
Name Type Description
code Number
id Number
Inherited From:
Returns:
Type
Array.<RPG.Trait>

updateBuffTurns()

Updates the buff turns on battler.
Inherited From:

updateStateTurns()

Inherited From:

useItem(item)

Has theb attler use the given item.
Parameters:
Name Type Description
item RPG.UsableItem

weaponImageId() → {Number}

Returns the weapon image id.
Returns:
Type
Number

xparam(xparamId) → {Number}

Parameters:
Name Type Description
xparamId Number
Inherited From:
Returns:
Type
Number