Class: Game_BattlerBase

Game_BattlerBase

new Game_BattlerBase()

The superclass of Game_Battler. It mainly contains parameters calculation.
Properties:
NameTypeDescription
hpnumberBattler hp
mpnumberBattler mp
tpnumberBattler tp
mhpnumberBattler max hp
mmpnumberBattler max mp
atknumberBattler attack
defnumberBattler defense
matnumberBattler magic attack
mdfnumberBattler magic defense
aginumberBattler agility
luknumberBattler luck
hitnumberBattler hit rate
evanumberBattler evasion rate
crinumberBattler critical rate
cevnumberBattler critical evasion rate
mevnumberBattler magical evation rate
mrfnumberBattler magical reflection rate
cntnumberBattler counter rate
hrgnumberBattler hp regen rate
mrgnumberBattler mp regen rate
trgnumberBattler tp regen rate
tgrnumberBattler target rate
grdnumberBattler guard effect rate
recnumberBattler recovery rate
phanumberBattler pharmacology rate
mcrnumberBattler mp cost rate
tcrnumberBattler tp charge rate
pdrnumberBattler physical damage rate
mdrnumberBattler magic damage rate
fdrnumberBattler floor damage rate
exrnumberBattler exp rate

Members

Game_BattlerBase.FLAG_ID_AUTO_BATTLEnumberstaticconstant

Game_BattlerBase.FLAG_ID_GUARDnumberstaticconstant

Default Value:
  • 1

Game_BattlerBase.FLAG_ID_PRESERVE_TPnumberstaticconstant

Default Value:
  • 3

Game_BattlerBase.FLAG_ID_SUBSTITUTEnumberstaticconstant

Default Value:
  • 2

Game_BattlerBase.ICON_BUFF_STARTnumberstaticconstant

Default Value:
  • 32

Game_BattlerBase.ICON_DEBUFF_STARTnumberstaticconstant

Default Value:
  • 48

Game_BattlerBase.TRAIT_ACTION_PLUSnumberstaticconstant

Default Value:
  • 61

Game_BattlerBase.TRAIT_ATTACK_ELEMENTnumberstaticconstant

Default Value:
  • 31

Game_BattlerBase.TRAIT_ATTACK_SKILLnumberstaticconstant

Default Value:
  • 35

Game_BattlerBase.TRAIT_ATTACK_SPEEDnumberstaticconstant

Default Value:
  • 33

Game_BattlerBase.TRAIT_ATTACK_STATEnumberstaticconstant

Default Value:
  • 32

Game_BattlerBase.TRAIT_ATTACK_TIMESnumberstaticconstant

Default Value:
  • 34

Game_BattlerBase.TRAIT_COLLAPSE_TYPEnumberstaticconstant

Default Value:
  • 63

Game_BattlerBase.TRAIT_DEBUFF_RATEnumberstaticconstant

Default Value:
  • 12

Game_BattlerBase.TRAIT_ELEMENT_RATEnumberstaticconstant

Default Value:
  • 11

Game_BattlerBase.TRAIT_EQUIP_ATYPEnumberstaticconstant

Default Value:
  • 52

Game_BattlerBase.TRAIT_EQUIP_LOCKnumberstaticconstant

Default Value:
  • 53

Game_BattlerBase.TRAIT_EQUIP_SEALnumberstaticconstant

Default Value:
  • 54

Game_BattlerBase.TRAIT_EQUIP_WTYPEnumberstaticconstant

Default Value:
  • 51

Game_BattlerBase.TRAIT_PARAMnumberstaticconstant

Default Value:
  • 21

Game_BattlerBase.TRAIT_PARTY_ABILITYnumberstaticconstant

Default Value:
  • 64

Game_BattlerBase.TRAIT_SKILL_ADDnumberstaticconstant

Default Value:
  • 43

Game_BattlerBase.TRAIT_SKILL_SEALnumberstaticconstant

Default Value:
  • 44

Game_BattlerBase.TRAIT_SLOT_TYPEnumberstaticconstant

Default Value:
  • 55

Game_BattlerBase.TRAIT_SPARAMnumberstaticconstant

Default Value:
  • 23

Game_BattlerBase.TRAIT_SPECIAL_FLAGnumberstaticconstant

Default Value:
  • 62

Game_BattlerBase.TRAIT_STATE_RATEnumberstaticconstant

Default Value:
  • 13

Game_BattlerBase.TRAIT_STATE_RESISTnumberstaticconstant

Default Value:
  • 14

Game_BattlerBase.TRAIT_STYPE_ADDnumberstaticconstant

Default Value:
  • 41

Game_BattlerBase.TRAIT_STYPE_SEALnumberstaticconstant

Default Value:
  • 42

Game_BattlerBase.TRAIT_XPARAMnumberstaticconstant

Default Value:
  • 22

Methods

actionPlusSet()Array

Get action plus traits set
Returns:
TypeDescription
ArrayTrait values for action plus

addNewState(stateId)

Adds a new state to the battler by id
NameTypeDescription
stateIdnumberThe state id to add

addParam(paramId, value)

Adds a bonus to a parameter by id
NameTypeDescription
paramIdnumberThe parameter id to add to
valuenumberThe amount to add

addedSkillTypes()Array

Get the added skill types
Returns:
TypeDescription
ArrayThe added skill types

addedSkills()Array

Get the added skills
Returns:
TypeDescription
ArrayThe added skills
Get state and buff icons
Returns:
TypeDescription
ArrayArray of state and buff icon indexes

allTraits()Array

Get an array of all traits from all trait objects
Returns:
TypeDescription
ArrayArray of all traits
Shows the battler

attackElements()Array

Get the attack elements trait set
Returns:
TypeDescription
ArrayArray of attack element trait data ids

attackSkillId()number

Get the attack skill id
Returns:
TypeDescription
numberThe attack skill id

attackSpeed()number

Get the attack speed
Returns:
TypeDescription
numberThe attack speed

attackStates()Array

Get the attack state trait set
Returns:
TypeDescription
ArrayArray of attack state trait data ids

attackStatesRate(stateId)number

Get the attack state rate for a given state id
NameTypeDescription
stateIdnumberThe state id
Returns:
TypeDescription
numberThe state rate

attackTimesAdd()number

Get the attack times
Returns:
TypeDescription
numberThe attack times

buff(paramId)number

Get a buff for a parameter by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe buff that parameter has

buffIconIndex(buffLevel, paramId)number

Get a buff icon a specific buff
NameTypeDescription
buffLevelnumberThe buff level of the parameter
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe buff icon index

buffIcons()Array

Get buff icons for buffs the battler has
Returns:
TypeDescription
ArrayArray of buff icon indexes

buffLength()number

Get the amount of possible params to buff
Returns:
TypeDescription
numberAmount of buffs possible

canAttack()boolean

Check if the battler can attack
Returns:
TypeDescription
booleanTrue if the battler can attack

canEquip(item)boolean

Check if an item can be equipped
NameTypeDescription
itemObjectThe weapon/armor object
Returns:
TypeDescription
booleanTrue if the weapon/armor can be equipped

canEquipArmor(item)boolean

Check if an armor can be equipped
NameTypeDescription
itemObjectThe armor object
Returns:
TypeDescription
booleanTrue if the armor can be equipped

canEquipWeapon(item)boolean

Check if a weapon can be equipped
NameTypeDescription
itemObjectThe weapon object
Returns:
TypeDescription
booleanTrue if the weapon can be equipped

canGuard()boolean

Check if the battler can guard
Returns:
TypeDescription
booleanTrue if the battler can guard

canInput()boolean

Check if the battler can input
Returns:
TypeDescription
booleanTrue if can input

canMove()boolean

Check if the battler can move
Returns:
TypeDescription
booleanTrue if can move

canPaySkillCost(skill)boolean

Check if skill costs are payable
NameTypeDescription
skillObjectThe skill object
Returns:
TypeDescription
booleanTrue if costs can be paid

canUse(item)boolean

Check if an item or skill can be used
NameTypeDescription
itemObjectThe item/skill object
Returns:
TypeDescription
booleanTrue if the item/skill can be used
Clear buffs

clearParamPlus()

Clears param bonus effects
Clears states affecting the battler

collapseType()number

Get collapse type
Returns:
TypeDescription
numberThe collapse type

confusionLevel()number

Determine the confusion level of the battler
Returns:
TypeDescription
numberConfusion level

deathStateId()number

Get the state id for the death state
Returns:
TypeDescription
numberThe id of the death state

debuffRate(paramId)number

Get the debuff rate by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe debuff rate

decreaseBuff(paramId)

Decrease the buff for a parameter
NameTypeDescription
paramIdnumberThe id of the param to debuff
Kills the battler

elementRate(elementId)number

Get the element rate by id
NameTypeDescription
elementIdnumberThe id of the element
Returns:
TypeDescription
numberThe element rate

eraseBuff(paramId)

Erase a buff by param id
NameTypeDescription
paramIdnumberThe id of the param to erase buffs for

eraseState(stateId)

Erases a state by id
NameTypeDescription
stateIdnumberThe id of the state to erase

guardSkillId()number

Get the guard skill's id
Returns:
TypeDescription
numberThe guard skill's id
Hides the battler
Get the battler's hp rate (hp / max hp)
Returns:
TypeDescription
numberThe hp rate

increaseBuff(paramId)

Increase the buff for a parameter
NameTypeDescription
paramIdnumberThe id of the param to buff
Initialize class variables
Initializes the class

isActor()boolean

Check if the battler is an actor type
Returns:
TypeDescription
booleanTrue if actor

isAlive()boolean

Check if the battler is alive
Returns:
TypeDescription
booleanTrue if alive

isAppeared()boolean

Check if the battler is appeared (not hidden)
Returns:
TypeDescription
booleanTrue if appeared

isAutoBattle()boolean

Check if the battler has the auto battle special flag
Returns:
TypeDescription
booleanTrue if auto battle

isBuffAffected(paramId)boolean

Check if there is a buff for a parameter by id
NameTypeDescription
paramIdnumberThe id of the param to check
Returns:
TypeDescription
booleanTrue if that parameter has a buff

isBuffExpired(paramId)boolean

Check if buff is expired by id
NameTypeDescription
paramIdnumberThe id of the param to check for expired buff
Returns:
TypeDescription
booleanTrue if the buff is expired

isBuffOrDebuffAffected(paramId)boolean

Check if there is a buff or debuff for a parameter by id
NameTypeDescription
paramIdnumberThe id of the param to check
Returns:
TypeDescription
booleanTrue if that parameter has a buff or debuff

isConfused()boolean

Check if the battler is confused
Returns:
TypeDescription
booleanTrue if confused
Check if the battler is dead
Returns:
TypeDescription
booleanTrue if dead

isDeathStateAffected()boolean

Check if the battler is affected by the death state
Returns:
TypeDescription
booleanTrue if the battler is affected by the state

isDebuffAffected(paramId)boolean

Check if there is a debuff for a parameter by id
NameTypeDescription
paramIdnumberThe id of the param to check
Returns:
TypeDescription
booleanTrue if that parameter has a debuff

isDualWield()boolean

Check if the battler is dual wield type
Returns:
TypeDescription
booleanTrue if dual wield

isDying()boolean

Check if the battler is low on hp
Returns:
TypeDescription
booleanTrue if low on hp

isEnemy()boolean

Check if the battler is an enemy type
Returns:
TypeDescription
booleanTrue if enemy

isEquipAtypeOk(atypeId)boolean

Check if an armor type is ok to equip
NameTypeDescription
atypeIdnumberThe armor type to check
Returns:
TypeDescription
booleanTrue if ok to equip

isEquipTypeLocked(etypeId)boolean

Check if an equip type is locked
NameTypeDescription
etypeIdnumberThe equip type to check
Returns:
TypeDescription
booleanTrue if locked

isEquipTypeSealed(etypeId)boolean

Check if an equip type is sealed
NameTypeDescription
etypeIdnumberThe equip type to check
Returns:
TypeDescription
booleanTrue if sealed

isEquipWtypeOk(wtypeId)boolean

Check if a weapon type is ok to equip
NameTypeDescription
wtypeIdnumberThe weapon type to check
Returns:
TypeDescription
booleanTrue if ok to equip

isGuard()boolean

Check if the battler has the guard special flag
Returns:
TypeDescription
booleanTrue if guard

isHidden()boolean

Check if the battler is hidden
Returns:
TypeDescription
booleanTrue if hidden

isMaxBuffAffected(paramId)boolean

Check if the maximum buff is on the parameter
NameTypeDescription
paramIdnumberThe id of the param to check
Returns:
TypeDescription
booleanTrue if that parameter has a maximum buff

isMaxDebuffAffected(paramId)boolean

Check if the maximum debuff is on the parameter
NameTypeDescription
paramIdnumberThe id of the param to check
Returns:
TypeDescription
booleanTrue if that parameter has a maximum debuff

isOccasionOk(item)boolean

Check if an item's occasion is met
NameTypeDescription
itemObjectThe item object
Returns:
TypeDescription
booleanTrue if the occasion is met

isPreserveTp()boolean

Check if the battler has the preserve tp special flag
Returns:
TypeDescription
booleanTrue if preserve tp

isRestricted()boolean

Check if the battler is restricted
Returns:
TypeDescription
booleanTrue if restricted

isSkillSealed(skillId)boolean

Check if a skill is sealed
NameTypeDescription
skillIdnumberThe skill to check
Returns:
TypeDescription
booleanTrue if sealed

isSkillTypeSealed(stypeId)boolean

Check if a skill type is sealed
NameTypeDescription
stypeIdnumberThe skill type to check
Returns:
TypeDescription
booleanTrue if sealed

isSkillWtypeOk()boolean

Check if skill Wtype is ok
Returns:
TypeDescription
booleanTrue if skill wtype is ok

isStateAffected(stateId)boolean

Check if the battler is affected by a state by id
NameTypeDescription
stateIdnumberThe id of the state to check
Returns:
TypeDescription
booleanTrue if the battler is affected by the state

isStateExpired(stateId)boolean

Check if a state is expired
NameTypeDescription
stateIdnumberThe id of the state to check
Returns:
TypeDescription
booleanTrue if the state is expired

isStateResist(stateId)boolean

Check if a state is resisted
NameTypeDescription
stateIdnumberThe id of the state to check
Returns:
TypeDescription
booleanTrue if resisted

isSubstitute()boolean

Check if the battler has the substitute special flag
Returns:
TypeDescription
booleanTrue if substitute
Get the max tp the battler can have
Returns:
TypeDescription
numberMaximum tp value

meetsItemConditions(item)boolean

Check if an item's conditions are met
NameTypeDescription
itemObjectThe item object
Returns:
TypeDescription
booleanTrue if the conditions are met

meetsSkillConditions(skill)boolean

Check if a skill's conditions are met
NameTypeDescription
skillObjectThe skill object
Returns:
TypeDescription
booleanTrue if the conditions are met

meetsUsableItemConditions(item)boolean

Check if an item's usable conditions are met
NameTypeDescription
itemObjectThe item object
Returns:
TypeDescription
booleanTrue if the conditions are met

mostImportantStateText()string

Get the most important state's text (persists message)
Returns:
TypeDescription
stringThe most important state's persist message
Get the battler's mp rate (mp / max mp)
Returns:
TypeDescription
numberThe mp rate
Processing when a restriction is added

overwriteBuffTurns(paramId, turns)

Overwrite a buff's turns remaining
NameTypeDescription
paramIdnumberThe id of the param to overwrite buff turns for
turnsnumberThe new amount of turns the buff will last for

param(paramId)number

Get the final parameter value id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter value

paramBase()number

Get the base param.
Returns:
TypeDescription
numberThe base param

paramBasePlus(paramId)number

Get the parameter base + plus by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter base added to parameter plus

paramBuffRate(paramId)number

Get the parameter buff rate by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter buff rate

paramMax()number

Get the maximum a parameter can be
Returns:
TypeDescription
numberThe maximum valid value for this parameter

paramMin(paramId)number

Get the minimum a parameter can be
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe minimum valid value for this parameter

paramPlus(paramId)number

Get the parameter bonus by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter bonus

paramRate(paramId)number

Get the parameter rate by id
NameTypeDescription
paramIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter rate

partyAbility(abilityId)boolean

Check if there are traits with a party ability id
NameTypeDescription
abilityIdnumberThe ability id to check
Returns:
TypeDescription
booleanTrue if traits exist for the ability id

paySkillCost(skill)

Pay the skill costs
NameTypeDescription
skillObjectThe skill object
Recover all for the battler
Refresh the battler

resetStateCounts(stateId)

Resets a state's turn counter by id
NameTypeDescription
stateIdnumberThe id of the state to reset

restriction()number

Get the highest restriction on the battler
Returns:
TypeDescription
numberThe greatest restriction on the battler
Revives the battler
Sets the battler's hp to the given value
NameTypeDescription
hpnumberThe new hp value
Sets the battler's mp to the given value
NameTypeDescription
mpnumberThe new mp value
Sets the battler's tp to the given value
NameTypeDescription
tpnumberThe new tp value

skillMpCost(skill)number

Get the skill mp cost
NameTypeDescription
skillObjectThe skill object
Returns:
TypeDescription
numberSkill mp cost

skillTpCost(skill)number

Get the skill tp cost
NameTypeDescription
skillObjectThe skill object
Returns:
TypeDescription
numberSkill tp cost

slotType()number

Get the slot type
Returns:
TypeDescription
numberThe slot type
Sort the states affecting the battler by their priority

sparam(sparamId)number

Get the s-parameter value by id
NameTypeDescription
sparamIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter value

specialFlag(flagId)boolean

Check if there are traits with a special flag id
NameTypeDescription
flagIdnumberThe flag id to check
Returns:
TypeDescription
booleanTrue if traits exist for the flag id

stateIcons()Array

Get state icons for states affecting the battler
Returns:
TypeDescription
ArrayArray of state icon indexes

stateMotionIndex()number

Get the state motion index
Returns:
TypeDescription
numberThe state motion index

stateOverlayIndex()number

Get the state overlay index
Returns:
TypeDescription
numberThe state overlay index

stateRate(stateId)number

Get the state rate by id
NameTypeDescription
stateIdnumberThe id of the state
Returns:
TypeDescription
numberThe state rate

stateResistSet()Array

Get the state resist trait set
Returns:
TypeDescription
ArrayArray of state resist trait data ids
Get states affecting the battler
Returns:
TypeDescription
ArrayArray of state data objects
Get the battler's tp rate (tp / max tp)
Returns:
TypeDescription
numberThe tp rate

traitObjects()Array

Get an array of all objects that have traits
Returns:
TypeDescription
ArrayArray of all objects that have traits

traits(code)Array

Get an array of all traits from all trait objects that match the given code
NameTypeDescription
codenumberThe trait code to check for
Returns:
TypeDescription
ArrayArray of traits with given code

traitsPi(code, id)number

Get multiplicative value of all traits with given code and id
NameTypeDescription
codenumberThe trait code
idnumberThe trait data id
Returns:
TypeDescription
numberValue of the traits

traitsSet(code)Array

Get array all trait data ids with given code
NameTypeDescription
codenumberThe trait code
Returns:
TypeDescription
ArrayTrait data ids

traitsSum(code, id)number

Get additive value of all traits with given code and id
NameTypeDescription
codenumberThe trait code
idnumberThe trait data id
Returns:
TypeDescription
numberValue of the traits

traitsSumAll(code)number

Get additive value of all traits with given code
NameTypeDescription
codenumberThe trait code
Returns:
TypeDescription
numberValue of the traits

traitsWithId(code, id)Array

Get an array of all traits from all trait objects that match the given code and id
NameTypeDescription
codenumberThe trait code to check for
idnumberThe trait data id to check for
Returns:
TypeDescription
ArrayArray of traits with given code

updateBuffTurns()

Update buff turn counts

updateStateTurns()

Update state turns

xparam(xparamId)number

Get the x-parameter value by id
NameTypeDescription
xparamIdnumberThe id of the parameter
Returns:
TypeDescription
numberThe parameter value