Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
Tag: Visual edit
Maruno (talk | contribs)
No edit summary
Line 137: Line 137:
 
pbTriadDuel("Tim",0,5,nil,[:BULBASAUR,:CHARMANDER,:SQUIRTLE,:PIKACHU,:CLEFAIRY])
 
pbTriadDuel("Tim",0,5,nil,[:BULBASAUR,:CHARMANDER,:SQUIRTLE,:PIKACHU,:CLEFAIRY])
 
pbTriadDuel("Sophie",0,5,nil,nil,:ARCEUS)
 
pbTriadDuel("Sophie",0,5,nil,nil,:ARCEUS)
Note: For the rules part, it should like more like this: (Don't enter twice, just once per rule)
 
 
<code>pbTriadDuel("Alice",0,5,[</code>
 
 
<code>"countunplayed",</code>
 
 
<code>"samewins",</code>
 
 
<code>"elements",</code>
 
 
<code>"direct"])</code>
 
   
 
=== Result of the game ===
 
=== Result of the game ===

Revision as of 19:47, 3 April 2019

TripleTriad

Triple Triad is a mini-game included with Pokémon Essentials. It is a Pokémon-themed version of the Triple Triad mini-game in Final Fantasy VIII.

How to play

Triple Triad is a card game played on a 3x3 grid. At the start of a game, each player chooses 5 cards they own to be their hand for that game, and then take turns playing their cards in unoccupied spaces of the grid.

Each card has 4 numbers on it, one per side, which range from 1 to 10 (known as A). If a card is played which touches an opponent's card on a side, the touching numbers are compared. If the number on the newly-placed card is higher than the opponent's card's number, that opponent's card is captured and swaps ownership. Nothing happens if the newly-placed card's number is equal or less than the opponent's card's number.

The goal is to control the most cards on the grid at the end of the game, when no further cards can be played.

The winner receives one random card used by the loser. No cards change hands if the game is a draw.

Rule variations

There are a number of rules and modifications which can be applied to a Triple Triad game. These are all optional, and any combination of these rules can be applied.

Rule Description Rule phrase
Same Wins Cards are captured if their touching number is equal to or less than the newly-played card's number, not just if it is less than it. Also, the captured cards immediately attempt to capture any cards touching them. samewins
Open Hand Players can see the cards in the opponent's hand. openhand
Wrap The board wraps round on itself, so there are no edges. For example, the top of a card played in the top centre spot will touch the bottom of a card in the bottom centre spot, and may capture it. wrap
Elements Each space on the board is assigned a random type. If a card is placed on a space with the same type, it gains +1 to all its values (values can even go beyond A because of this). This bonus only applies to a newly-played card attempting to capture other cards; the bonus is removed afterwards. It will not apply if the card attempts to capture other cards because of the "Same Wins" rule (because it wasn't a newly-played card). elements
Random Hand The player doesn't choose 5 cards to be their hand at the start of the game. 5 cards are randomly chosen out of all the cards they own instead. This doesn't affect opponents, because their hands are already randomly generated. randomhand
Count Unplayed A player's score includes the cards in their hand as well as the cards they control on the grid. countunplayed

In addition, the prize for winning/cost for losing a game can be changed to be one of the following instead:

Rule Description Rule phrase
Direct Both players keep all cards of their colour. This applies even if the game is a draw. direct
Win All The winner gains all 5 cards the loser used, rather than just a random one of them. winall

Card details

A Triple Triad card features a species of Pokémon. All cards of a species are identical.

The card's type will be the first type of that species, as defined in the PBS file "pokemon.txt". The only exception is if the first type is Normal and the second type isn't (e.g. Flying), in which case it will be the second type instead.

The four numbers on each card derive from the base stats of that card's species, as defined in the PBS file"pokemon.txt":

  • The west number uses the base Attack.
  • The east number uses the base Defense.
  • The north number uses the base Special Attack.
  • The south number uses the base Special Defense.

The base stats are converted into card values as shown in the below table.

A card's price depends on the highest value it has, as the below table also shows.

Card value Stats Card price
1 29 or lower $100
2 30 to 44 $100
3 45 to 59 $250
4 60 to 69 $500
5 70 to 79 $1,000
6 80 to 99 $2,000
7 100 to 124 $5,000
8 125 to 149 $8,000
9 150 to 199 $12,000
A 200 or higher $20,000

Playing Triple Triad

To play Triple Triad, use the following script:

pbTriadDuel("Zaphod",0,5)

The three arguments are the opponent's name, minimum level and maximum level. The levels can be between 0 and 9 inclusive, and the maximum level must be higher than the minimum level.

Opponents are generated with a random set of cards. 200 possible cards are randomly generated and listed in order of the total of their four values. The minimum and maximum levels determine how far down this list to choose 5 cards from (higher levels means further down, which means stronger cards).

This will begin a basic game of Triple Triad.

Additional arguments

You may wish to customise certain games. You can do so by including additional arguments in the above script. A full list of possibilities is as follows:

pbTriadDuel(name,minLevel,maxLevel,rules,oppdeck,prize)
  • "rules" is an array of rule phrases, each of which applies one of the rule variations mentioned above.
  • "oppdeck" is an array of 5 Pokémon species, which set the 5 cards you want that opponent to use. Each one is a colon followed by the internal name of the species. This overrides the "Random Hand" rule.
  • "prize" is a Pokémon species (with a comma in front of it). If the player wins the game, rather than applying the game's prize rules, they will instead gain 1 copy of a card of this species. Losing or drawing the game are not affected.

If you don't want to use one or more of these options, put "nil" in its place (without quote marks).

Some examples are as follows:

pbTriadDuel("Alice",0,5,["countunplayed","samewins","elements","direct"])
pbTriadDuel("Tim",0,5,nil,[:BULBASAUR,:CHARMANDER,:SQUIRTLE,:PIKACHU,:CLEFAIRY])
pbTriadDuel("Sophie",0,5,nil,nil,:ARCEUS)

Result of the game

The method pbTriadDuel will return a value depending on the outcome of the battle:

  • 1 = player won
  • 2 = player lost
  • 3 = draw

You can use this information in a Conditional Branch in an event, like so:

@>Conditional Branch: Script: pbTriadDuel("Zaphod",0,5)==1
  @>Text: You won!
  @>
 : Else
  @>Text: You lost or drew the game...
  @>
 : Branch End
@>

Gaining cards

To give the player a Triad card, use the following script:

pbGiveTriadCard(PBSpecies::PIKACHU,1)

The number is how many of that card to give. This will return TRUE if the card(s) was added, and FALSE if not. It does not display any messages.

Card Shop

There are two scripts you can use to buy or sell Triad cards. They are as follows:

pbBuyTriads
pbSellTriads

"pbBuyTriads" will let you buy cards of any species that are listed as owned in the Pokédex.

"pbSellTriads" will let you sell any cards you possess. You can sell cards even if you would end up without enough cards to play a game. Cards are sold for a quarter of their buying price.

Listing cards

To show the player a list of the Triple Triad cards they have, use the following script:

pbTriadList