Class: Game_Unit

Game_Unit

new Game_Unit()

The superclass of Game_Party and Game_Troop.

Methods

agility()number

Get the unit's agility
Returns:
TypeDescription
numberThe unit's agility

aliveMembers()Array

Get unit members who are alive
Returns:
TypeDescription
ArrayUnit members who are alive

clearActions()

Clear all member actions

clearResults()

Clear results for all members

deadMembers()Array

Get unit members who are dead
Returns:
TypeDescription
ArrayUnit members who are dead

inBattle()boolean

Check if the unit is in battle
Returns:
TypeDescription
booleanTrue if in battle

initialize()

Initialize the unit

isAllDead()boolean

Check if all members are dead
Returns:
TypeDescription
booleanTrue if all members are dead

makeActions()

Make member's actions

members()Array

Get unit members
Returns:
TypeDescription
ArrayUnit members

movableMembers()Array

Get unit members who can move
Returns:
TypeDescription
ArrayUnit members who can move

onBattleEnd()

Processing when battle ends

onBattleStart(advantageous)

Processing when battle starts
NameTypeDescription
advantageousbooleanIf the unit has the advantage
Pick a random dead target in the unit
Returns:
TypeDescription
Game_Enemy|Game_ActorThe dead target that was chosen
Pick a random target in the unit
Returns:
TypeDescription
Game_Enemy|Game_ActorThe target that was chosen

select(member)

Select a member of the unit
NameTypeDescription
memberGame_Actor|Game_EnemyThe member to select

smoothDeadTarget(index)Game_Enemy | Game_Actor

Choose a dead target by id
NameTypeDescription
indexnumberThe index of the target
Returns:
TypeDescription
Game_Enemy|Game_ActorThe target that was chosen
Choose a target by id
NameTypeDescription
indexnumberThe index of the target
Returns:
TypeDescription
Game_Enemy|Game_ActorThe target that was chosen

substituteBattler(target)Game_Actor | Game_Enemy | null

Get the substitute battler
NameTypeDescription
targetGame_BattlerThe original target
Returns:
TypeDescription
Game_Actor|Game_Enemy|nullThe substitute battler, may be null if none found

tgrSum()number

Sum the unit's target rate
Returns:
TypeDescription
numberUnit target rate sum

tpbBaseSpeed()number

Get the TPB base speed
Returns:
TypeDescription
numberTPB base speed

tpbReferenceTime()number

Get the TPB reference time
Returns:
TypeDescription
numberTPB reference time

updateTpb()

Update TPB