Game Development Reference
In-Depth Information
We have the NPC greet the player, as is usual. Then, we have a new variable to hold the number of Arena Tokens
that the player has in his/her inventory. A Show Choices prompt appears with three possible item purchases and Bye
as the last option. When the player clicks an item choice, the NPC confirms the cost, tells the player how many Arena
Tokens he/she currently has, and asks if he/she wishes to purchase the item, bringing up a Yes/No choice prompt.
In what is perhaps one of the few times I'll ever use Set handling when conditions do not apply , we make sure that
the player has the Arena Tokens to purchase the item in question. If the player doesn't, we return an error message;
otherwise, we add the item to the player's inventory and remove the appropriate number of tokens.
: When [Defense Piece - 15 Tokens]
@>Text: -, -, Normal, Bottom
: : You currently have \V[6] Arena Tokens. Will you
: : purchase a Defense Piece?
@>Show Choices: Yes, No
: When [Yes]
@>Conditional Branch: Variable [0006:arenacurrency] >= 15
@>Change Items: [Defense Piece], +1
@>Change Items: [Arena Token], -15
@>Text: -, -, Normal, Bottom
: : Enjoy!
@>
: Else
@>Text: -, -, Normal, Bottom
: : You don't have enough Tokens!
@>
: Branch End
@>
: When [No]
@>Text: -, -, Normal, Bottom
: : Okay. See you later!
@>
: When [Solomon's Ring - 30 Tokens]
@>Text: -, -, Normal, Bottom
: : You currently have \V[6] Arena Tokens. Will you
: : purchase a Solomon's Ring?
@>Show Choices: Yes, No
: When [Yes]
@>Conditional Branch: Variable [0006:arenacurrency] >= 15
@>Change Items: [Defense Piece], +1
@>Change Items: [Arena Token], -15
@>Text: -, -, Normal, Bottom
: : Enjoy!
@>
: Else
@>Text: -, -, Normal, Bottom
: : You don't have enough Tokens!
@>
: Branch End
@>
: When [No]
@>Text: -, -, Normal, Bottom
: : Okay. See you later!
Search WWH ::




Custom Search