Class: Game_Action

Game_Action

new Game_Action()

The game object class for a battle action.

Members

Game_Action.EFFECT_ADD_BUFFnumberstaticconstant

Default Value:
  • 31

Game_Action.EFFECT_ADD_DEBUFFnumberstaticconstant

Default Value:
  • 32

Game_Action.EFFECT_ADD_STATEnumberstaticconstant

Default Value:
  • 21

Game_Action.EFFECT_COMMON_EVENTnumberstaticconstant

Default Value:
  • 44

Game_Action.EFFECT_GAIN_TPnumberstaticconstant

Default Value:
  • 13

Game_Action.EFFECT_GROWnumberstaticconstant

Default Value:
  • 42

Game_Action.EFFECT_LEARN_SKILLnumberstaticconstant

Default Value:
  • 43

Game_Action.EFFECT_RECOVER_HPnumberstaticconstant

Default Value:
  • 11

Game_Action.EFFECT_RECOVER_MPnumberstaticconstant

Default Value:
  • 12

Game_Action.EFFECT_REMOVE_BUFFnumberstaticconstant

Default Value:
  • 33

Game_Action.EFFECT_REMOVE_DEBUFFnumberstaticconstant

Default Value:
  • 34

Game_Action.EFFECT_REMOVE_STATEnumberstaticconstant

Default Value:
  • 22

Game_Action.EFFECT_SPECIALnumberstaticconstant

Default Value:
  • 41

Game_Action.HITTYPE_CERTAINnumberstaticconstant

Game_Action.HITTYPE_MAGICALnumberstaticconstant

Default Value:
  • 2

Game_Action.HITTYPE_PHYSICALnumberstaticconstant

Default Value:
  • 1

Game_Action.SPECIAL_EFFECT_ESCAPEnumberstaticconstant

Methods

apply(target)

Apply the action to the target
NameTypeDescription
targetGame_BattlerThe target

applyCritical(damage)number

Apply the critical effect to the damage value
NameTypeDescription
damagenumberThe original damage value
Returns:
TypeDescription
numberThe damage value after applying critical effect

applyGlobal()

Apply global effects

applyGuard(damage, target)number

Apply guard effect to the damage value
NameTypeDescription
damagenumberThe base damage value
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe damage value after applying guard effect

applyItemEffect(target, effect)

Apply item effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

applyItemUserEffect()

Apply item user effects on the target (in this case, the subject)

applyVariance(damage, variance)number

Apply variance to the damage value
NameTypeDescription
damagenumberThe base damage value
variancenumberThe variance value
Returns:
TypeDescription
numberThe damage value after applying variance

calcElementRate(target)number

Calculate the element rate for the target
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe element rate

checkDamageType(list)boolean

Check if the action's damage type matches the list of damage types
NameTypeDescription
listArrayList of damage types to check
Returns:
TypeDescription
booleanTrue if damage type included in given list

checkItemScope(list)boolean

Check the item's scope
NameTypeDescription
listArrayThe list to check scope for
Returns:
TypeDescription
booleanTrue if scope is included in the list
Clears the action
Get the confusion target
Returns:
TypeDescription
Game_BattlerThe confusion target

decideRandomTarget()

Choose a random target

elementsMaxRate(target, elements)number

Get the maximum element rate effect
NameTypeDescription
targetGame_BattlerThe target
elementsArrayThe list of elements
Returns:
TypeDescription
numberThe max element rate

evalDamageFormula(target)number

eval the damage formula
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe result value

evaluate()number

Evaluate the action
Returns:
TypeDescription
numberThe value of the action

evaluateWithTarget(target)number

Evaluate the action with a target
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe value of the action

executeDamage(target, value)

Execute damage on the target
NameTypeDescription
targetGame_BattlerThe target
valuenumberThe damage value

executeHpDamage(target, value)

Execute hp damage on the target
NameTypeDescription
targetGame_BattlerThe target
valuenumberThe damage value

executeMpDamage(target, value)

Execute mp damage on the target
NameTypeDescription
targetGame_BattlerThe target
valuenumberThe damage value
Get the friendly unit of the action
Returns:
TypeDescription
Game_UnitThe subject's friendly unit

gainDrainedHp(value)

Gain drained hp
NameTypeDescription
valuenumberThe drain value

gainDrainedMp(value)

Gain drained mp
NameTypeDescription
valuenumberThe drain value

hasItemAnyValidEffects(target)boolean

Test applying the action to the target for valid effects
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
booleanTrue if the action has an effect

initialize(subject, forcing)

Initialize the action
NameTypeDefaultDescription
subjectGame_BattlerThe subject of the action
forcingbooleanfalseoptionalIf the action is forcing

isAttack()boolean

Check if the action is an attack
Returns:
TypeDescription
booleanTrue if attack

isCertainHit()boolean

Check if the action is a certain hit
Returns:
TypeDescription
booleanTrue if certain hit

isDamage()boolean

Check if the action's damage type is a damage type
Returns:
TypeDescription
booleanTrue if damage type is damage effect

isDrain()boolean

Check if the action's damage type is a drain type
Returns:
TypeDescription
booleanTrue if damage type is drain effect

isForAliveFriend()boolean

Check if the action is for alive allies
Returns:
TypeDescription
booleanTrue if scope includes alive allies

isForAll()boolean

Check if the action is for all
Returns:
TypeDescription
booleanTrue if scope includes all

isForDeadFriend()boolean

Check if the action is for dead allies
Returns:
TypeDescription
booleanTrue if scope includes only dead allies

isForEveryone()boolean

Check if the action is for everyone
Returns:
TypeDescription
booleanTrue if scope includes everyone

isForFriend()boolean

Check if the action is for allies
Returns:
TypeDescription
booleanTrue if scope includes allies

isForOne()boolean

Check if the action is for one target
Returns:
TypeDescription
booleanTrue if scope includes only one target

isForOpponent()boolean

Check if the action is for opponent
Returns:
TypeDescription
booleanTrue if scope includes opponents

isForRandom()boolean

Check if the action is for a random unit
Returns:
TypeDescription
booleanTrue if scope includes random units

isForUser()boolean

Check if the action is for the user
Returns:
TypeDescription
booleanTrue if scope includes only the user

isGuard()boolean

Check if the action is a guard
Returns:
TypeDescription
booleanTrue if guard

isHpEffect()boolean

Check if the action's damage type is an hp type
Returns:
TypeDescription
booleanTrue if damage type is hp effect

isHpRecover()boolean

Check if the action's damage type is an hp recover type
Returns:
TypeDescription
booleanTrue if damage type is hp recover effect

isItem()boolean

Check if the action item is an item
Returns:
TypeDescription
booleanTrue if item

isMagicSkill()boolean

Check if the action is a magic skill
Returns:
TypeDescription
booleanTrue if magic skill

isMagical()boolean

Check if the action is magical
Returns:
TypeDescription
booleanTrue if magical

isMpEffect()boolean

Check if the action's damage type is an mp type
Returns:
TypeDescription
booleanTrue if damage type is mp effect

isMpRecover()boolean

Check if the action's damage type is an mp recover type
Returns:
TypeDescription
booleanTrue if damage type is mp recover effect

isPhysical()boolean

Check if the action is physical
Returns:
TypeDescription
booleanTrue if physical

isRecover()boolean

Check if the action's damage type is a recover type
Returns:
TypeDescription
booleanTrue if damage type is recover effect

isSkill()boolean

Check if the action item is a skill
Returns:
TypeDescription
booleanTrue if skill

isValid()boolean

Check if the action is valid
Returns:
TypeDescription
booleanTrue if the action is valid

item()Object

Get the item of the action
Returns:
TypeDescription
ObjectThe item data object

itemCnt(target)number

Get the item cnt (counter attack rate)
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe counter attack rate

itemCri(target)number

Get the item cri (critical rate)
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe critical rate

itemEffectAddAttackState(target, effect)

Apply add attack state effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectAddBuff(target, effect)

Apply add buff effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectAddDebuff(target, effect)

Apply add debuff effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectAddNormalState(target, effect)

Apply add normal state effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectAddState(target, effect)

Apply add state effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectCommonEvent(target, effect)

Apply common event effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectGainTp(target, effect)

Apply gain tp effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectGrow(target, effect)

Apply grow effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectLearnSkill(target, effect)

Apply learn skill effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectRecoverHp(target, effect)

Apply recover hp effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectRecoverMp(target, effect)

Apply recover mp effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectRemoveBuff(target, effect)

Apply remove buff effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectRemoveDebuff(target, effect)

Apply remove debuff effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectRemoveState(target, effect)

Apply remove state effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEffectSpecial(target, effect)

Apply special effects on the target
NameTypeDescription
targetGame_BattlerThe target
effectObjectThe item effect

itemEva(target)number

Get the item evade rate
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe evade rate

itemHit()number

Get the item hit rate
Returns:
TypeDescription
numberThe hit rate

itemMrf(target)number

Get the item mrf (magic reflection rate)
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe magic reflection rate

itemTargetCandidates()Array.<Game_Battler>

Get the target candidates
Returns:
TypeDescription
Array.<Game_Battler>The array of candidate targets

lukEffectRate(target)number

Get the luk effect rate
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
numberThe luk effect rate

makeDamageValue(target, critical)number

Make the damage value
NameTypeDescription
targetGame_BattlerThe target
criticalbooleanIf the effect is a critical
Returns:
TypeDescription
numberThe damage value

makeSuccess(target)

Make the success status for the target
NameTypeDescription
targetGame_BattlerThe target

makeTargets()Array.<Game_Battler>

Make the targets of the action
Returns:
TypeDescription
Array.<Game_Battler>The array of targets

needsSelection()boolean

Check if the action is needs to select a target
Returns:
TypeDescription
booleanTrue if scope requires target selection

numRepeats()number

Get amount of repeats
Returns:
TypeDescription
numberNumber of repeats

numTargets()number

Get number of targets when random
Returns:
TypeDescription
numberAmount of random targets
Get the opponent unit of the action
Returns:
TypeDescription
Game_UnitThe subject's opponent unit
Prepares the action

randomTargets(unit)Array.<Game_Battler>

Make the targets for random
NameTypeDescription
unitGame_UnitThe unit to look for random targets in
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for random

repeatTargets(targets)Array.<Game_Battler>

Repeat the targets for the action if it repeats
NameTypeDescription
targetsArray.<Game_Battler>The target array to repeat
Returns:
TypeDescription
Array.<Game_Battler>The array of targets
Set an attack action

setConfusion()

Sets confusion action

setEnemyAction(The)

Set an enemy action
NameTypeDescription
TheObjectenemy action
Set a guard action

setItem(itemId)

Set an item action
NameTypeDescription
itemIdnumberThe set item's id

setItemObject(object)

Set an item action
NameTypeDescription
objectObjectThe item object to set

setSkill(skillId)

Set a skill action
NameTypeDescription
skillIdnumberThe set skill's id

setSubject(subject)

Set the subject of the action
NameTypeDescription
subjectGame_BattlerThe new subject

setTarget(targetIndex)

Set the target index
NameTypeDescription
targetIndexnumberThe target index

speed()number

Get the action speed
Returns:
TypeDescription
numberThe action speed
Get the subject of the action
Returns:
TypeDescription
Game_BattlerThe subject

targetsForAlive(unit)Array.<Game_Battler>

Make the targets for alive
NameTypeDescription
unitGame_UnitThe unit to look for alive targets in
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for alive

targetsForDead(unit)Array.<Game_Battler>

Make the targets for dead
NameTypeDescription
unitGame_UnitThe unit to look for dead targets in
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for dead

targetsForDeadAndAlive(unit)Array.<Game_Battler>

Make the targets for alive
NameTypeDescription
unitGame_UnitThe unit to look for dead and alive targets in
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for dead and alive

targetsForEveryone()Array.<Game_Battler>

Make the targets for everyone
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for everyone

targetsForFriends()Array.<Game_Battler>

Make the targets for allies
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for allies

targetsForOpponents()Array.<Game_Battler>

Make the targets for opponents
Returns:
TypeDescription
Array.<Game_Battler>The array of targets for opponents

testApply(target)boolean

Test applying the action to the target
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
booleanTrue if the action has an effect

testItemEffect(target)boolean

Test the item effect on the target
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
booleanTrue if the action has an effect

testLifeAndDeath(target)boolean

Test applying the action to the target for life and death states
NameTypeDescription
targetGame_BattlerThe target
Returns:
TypeDescription
booleanTrue if the action has an effect that works on the target's alive status

updateLastSubject()

Update the last subject id

updateLastTarget()

Update the last target id

updateLastUsed()

Update the last used skill or item id