Class: Game_Troop

Game_Troop

new Game_Troop()

The game object class for a troop and the battle-related data.

Extends

Members

Game_Troop.LETTER_TABLE_FULLArraystaticconstant

Default Value:
  • ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

Game_Troop.LETTER_TABLE_HALFArraystaticconstant

Default Value:
  • [" A"," B"," C"," D"," E"," F"," G"," H"," I"," J"," K"," L"," M"," N"," O"," P"," Q"," R"," S"," T"," U"," V"," W"," X"," Y"," Z"]

Methods

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

aliveMembers()Arrayinherited

Get unit members who are alive
Returns:
TypeDescription
ArrayUnit members who are alive
Clear troop data
Clear all member actions
Clear results for all members

deadMembers()Arrayinherited

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

enemyNames()Array.<string>

Get the enemy names
Returns:
TypeDescription
Array.<string>The names of the enemies

expTotal()number

Get total exp from all dead enemies
Returns:
TypeDescription
numberThe total exp

goldRate()number

Get the gold rate to use
Returns:
TypeDescription
numberThe gold rate

goldTotal()number

Get total gold from all dead enemies
Returns:
TypeDescription
numberThe total gold

inBattle()booleaninherited

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

increaseTurn()

Processing when the turn is increased
Initialize the unit

isAllDead()booleaninherited

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

isEventRunning()boolean

Check if there is an event running
Returns:
TypeDescription
booleanTrue if there is an event running

isTpbTurnEnd()boolean

Check if TPB turn is ended
Returns:
TypeDescription
booleanTrue if turn is ended

letterTable()Array.<string>

Get the letter table for use in enemy names
Returns:
TypeDescription
Array.<string>The letter table to use
Make member's actions

makeDropItems()Array

Get dropped items
Returns:
TypeDescription
ArrayArray of dropped items

makeUniqueNames()

Makes unique names for enemies if multiple enemies of the same base name exist

meetsConditions(page)boolean

Check if an event page's conditions are met
NameTypeDescription
pageObjectThe event page object to check
Returns:
TypeDescription
booleanTrue if conditions are met
Get the enemy members
Returns:
TypeDescription
Array.<Game_Enemy>Array of enemy members

movableMembers()Arrayinherited

Get unit members who can move
Returns:
TypeDescription
ArrayUnit members who can move
Processing when battle ends

onBattleStart(advantageous)inherited

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 a member of the unit
NameTypeDescription
memberGame_Actor|Game_EnemyThe member to select

setup(troopId)

Set up the troop
NameTypeDescription
troopIdnumberThe troop id to set up

setupBattleEvent()

Sets up a battle event
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 | nullinherited

Get the substitute battler
NameTypeDescription
targetGame_BattlerThe original target
Returns:
TypeDescription
Game_Actor|Game_Enemy|nullThe substitute battler, may be null if none found
Sum the unit's target rate
Returns:
TypeDescription
numberUnit target rate sum

tpbBaseSpeed()numberinherited

Get the TPB base speed
Returns:
TypeDescription
numberTPB base speed

tpbReferenceTime()numberinherited

Get the TPB reference time
Returns:
TypeDescription
numberTPB reference time

troop()Object

Get the troop data object
Returns:
TypeDescription
ObjectThe troop data object

turnCount()number

Get the turn count
Returns:
TypeDescription
numberThe turn count

updateInterpreter()

Update event interpreter

updatePluralFlags()

Updates the enemy's plural name flags
Update TPB