Class: Game_Party

Game_Party

new Game_Party()

The game object class for the party. Information such as gold and items is included.

Extends

Members

Game_Party.ABILITY_CANCEL_SURPRISEnumberstaticconstant

Default Value:
  • 2

Game_Party.ABILITY_DROP_ITEM_DOUBLEnumberstaticconstant

Default Value:
  • 5

Game_Party.ABILITY_ENCOUNTER_HALFnumberstaticconstant

Game_Party.ABILITY_ENCOUNTER_NONEnumberstaticconstant

Default Value:
  • 1

Game_Party.ABILITY_GOLD_DOUBLEnumberstaticconstant

Default Value:
  • 4

Game_Party.ABILITY_RAISE_PREEMPTIVEnumberstaticconstant

Default Value:
  • 3

Methods

addActor(actorId)

Add an actor to the party by id
NameTypeDescription
actorIdnumberThe id of the actor to add
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

allBattleMembers()Array.<Game_Actor>

Get all possible battle party members
Since:
  • Version 1.4.0
Returns:
TypeDescription
Array.<Game_Actor>All battle party members

allItems()Array

Get the party's items, weapons, and armors
Returns:
TypeDescription
ArrayData objects for all items, weapons, armors

allMembers()Array.<Game_Actor>

Get all possible party members
Returns:
TypeDescription
Array.<Game_Actor>All party members

armors()Array

Get the party's armors
Returns:
TypeDescription
ArrayData objects for all armors

battleMembers()Array.<Game_Actor>

Get all battle party members
Returns:
TypeDescription
Array.<Game_Actor>All battle party members

canInput()boolean

Check if any party members can input
Returns:
TypeDescription
booleanTrue if any party member can input

canUse(item)boolean

Check if the given item can be used
NameTypeDescription
itemObjectThe item to check
Returns:
TypeDescription
booleanTrue if any party member can use the item

charactersForSavefile()Array

Get character info for save file
Returns:
TypeDescription
ArrayCharacter info for the save file
Clear all member actions
Clear results for all members

consumeItem(item)

Consumes an item
NameTypeDescription
itemObjectThe item to consume

deadMembers()Arrayinherited

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

discardMembersEquip(item, amount)

Discards equipment from party members
NameTypeDescription
itemObjectThe equip item to discard
amountnumberThe amount of that item to discard

equipItems()Array

Get the party's equipable items (weapons + armors)
Returns:
TypeDescription
ArrayData objects for all equipable items

exists()boolean

Check if the party exists (more than 1 actor in it)
Returns:
TypeDescription
booleanTrue if exists

facesForSavefile()Array

Get face info for save file
Returns:
TypeDescription
ArrayFace info for the save file

gainGold(amount)

Gains gold
NameTypeDescription
amountnumberThe amount of gold to gain

gainItem(item, amount, includeEquip)

Gains items
NameTypeDescription
itemObjectThe item to gain
amountnumberThe amount of the item to gain
includeEquipbooleanIf party member equips should be discarded when amount is negative

gold()number

Get the party's gold amount
Returns:
TypeDescription
numberAmount of gold the party has

hasCancelSurprise()boolean

Check if the party has cancel surprise ability
Returns:
TypeDescription
booleanTrue if cancel surprise

hasDropItemDouble()boolean

Check if the party has drop item double ability
Returns:
TypeDescription
booleanTrue if drop item double

hasEncounterHalf()boolean

Check if the party has encounter half ability
Returns:
TypeDescription
booleanTrue if encounter half

hasEncounterNone()boolean

Check if the party has encounter none ability
Returns:
TypeDescription
booleanTrue if encounter none

hasGoldDouble()boolean

Check if the party has gold double ability
Returns:
TypeDescription
booleanTrue if gold double

hasItem(item, includeEquip)boolean

Check if the party has any of the given item
NameTypeDescription
itemObjectThe item to check
includeEquipbooleanIf should check actor equips too
Returns:
TypeDescription
booleanTrue if the party has the given item

hasMaxItems(item)boolean

Check if the party has the maximum allowed amount of the given item
NameTypeDescription
itemObjectThe item to check
Returns:
TypeDescription
booleanTrue if already has max items

hasRaisePreemptive()boolean

Check if the party has raise preemptive ability
Returns:
TypeDescription
booleanTrue if raise preemptive

hiddenBattleMembers()Array.<Game_Actor>

Get all hidden battle party members
Since:
  • Version 1.4.0
Returns:
TypeDescription
Array.<Game_Actor>All hidden battle party members

highestLevel()number

Get the highest level of any party member
Returns:
TypeDescription
numberThe highest level

inBattle()booleaninherited

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

increaseSteps()

Increase the step counter by one

initAllItems()

Initializes the items/weapons/armors
Initialize the unit
Check if all members are dead
Returns:
TypeDescription
booleanTrue if all members are dead

isAnyMemberEquipped(item)boolean

Check if any party member has the given item equipped
NameTypeDescription
itemObjectThe item to check
Returns:
TypeDescription
booleanTrue if any party member has the item equipped

isEmpty()boolean

Check if there are no party members
Returns:
TypeDescription
booleanTrue if no party members

isEscaped(item)boolean

Check if the party escaped
NameTypeDescription
item*Unused
Since:
  • Version 1.4.0
Returns:
TypeDescription
booleanTrue if escaped

itemContainer(item)Array | null

Get the item container for the given item. For example, it will return the armor container if the given item is an armor.
NameTypeDescription
itemObjectThe item object to get the container for
Returns:
TypeDescription
Array|nullObjects for all items of similar type, null if no container found

items()Array

Get the party's items
Returns:
TypeDescription
ArrayData objects for all items

lastItem()Object

Get the last item
Returns:
TypeDescription
ObjectThe last item data object
Get the party leader
Returns:
TypeDescription
Game_ActorParty member in first position

loseGold(amount)

Loses gold
NameTypeDescription
amountnumberThe amount of gold to lose

loseItem(item, amount, includeEquip)

Loses items
NameTypeDescription
itemObjectThe item to lose
amountnumberThe amount of the item to lose
includeEquipbooleanIf party member equips should be discarded if there are not enough items in the inventory to lose
Make member's actions

makeMenuActorNext()

Make the next menu actor

makeMenuActorPrevious()

Make the previous menu actor

maxBattleMembers()number

Get the maximum amount of battlers
Returns:
TypeDescription
numberMaximum amount of battle members to allow

maxGold()number

Get the maximum amount of gold allowed
Returns:
TypeDescription
numberMax allowed amount of gold

maxItems()number

Get the maximum amount of items allowed
Returns:
TypeDescription
numberMax allowed amount of any item
Get the members of the party
Returns:
TypeDescription
Array.<Game_Actor>Member array
Get the menu actor
Returns:
TypeDescription
Game_ActorThe menu actor

movableMembers()Arrayinherited

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

name()string

Get the name to use for the party
Returns:
TypeDescription
stringThe name of the party

numItems(item)number

Get the amount of the given item the party has
NameTypeDescription
itemObjectThe item to check
Returns:
TypeDescription
numberThe amount of the given item the party has
Processing when battle ends

onBattleStart(advantageous)inherited

Processing when battle starts
NameTypeDescription
advantageousbooleanIf the unit has the advantage

onEscapeFailure()

Handling when escape fails

onPlayerWalk()

Processing when the player is walking

partyAbility(abilityId)boolean

Check if any battle member has the party ability by id
NameTypeDescription
abilityIdnumberThe party ability id to check for
Returns:
TypeDescription
booleanTrue if party ability found

performEscape()

Perform escape for each member

performVictory()

Perform victory for each member
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

ratePreemptive(troopAgi)number

Get the preemptive rate
NameTypeDescription
troopAginumberThe troop's agility
Returns:
TypeDescription
numberThe preemptive rate

rateSurprise(troopAgi)number

Get the surprise rate
NameTypeDescription
troopAginumberThe troop's agility
Returns:
TypeDescription
numberThe surprise rate

removeActor(actorId)

Remove an actor from the party by id
NameTypeDescription
actorIdnumberThe id of the actor to remove

removeBattleStates()

Remove member battle states

removeInvalidMembers()

Remove any invalid party members (no corresponding data object)

requestMotionRefresh()

Request motion refresh for members

reviveBattleMembers()

Revives all dead party members
Select a member of the unit
NameTypeDescription
memberGame_Actor|Game_EnemyThe member to select

setLastItem(The)

Set the last item
NameTypeDescription
TheObjectnew last item

setMenuActor(actor)

Set the menu actor
NameTypeDescription
actorGame_ActorThe new menu actor

setTargetActor(actor)

Set the menu actor
NameTypeDescription
actorGame_ActorThe new target actor

setupBattleTest()

Set up performed when doing a battle test

setupBattleTestItems()

Set up items available during the battle test

setupBattleTestMembers()

Set up battler members when doing battle test

setupStartingMembers()

Sets up the starting party members

size()number

Get the party size
Returns:
TypeDescription
numberNumber of party members
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

steps()number

Get the party's step count
Returns:
TypeDescription
numberAmount of steps taken

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

swapOrder(index1, index2)

Swap two member's positions in the party
NameTypeDescription
index1numberThe first index to swap
index2numberThe second index to swap
Get the target actor
Returns:
TypeDescription
Game_ActorThe target actor
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
Update TPB

weapons()Array

Get the party's weapons
Returns:
TypeDescription
ArrayData objects for all weapons