Introduction
This script does two things. It displays cards on the screen in any specific spread (like the Celtic Cross), and also displays a random generated
Features
- Displays tarot cards on the screen in any spread you wish
- Customizable random generated fortune-telling messages
How to Use
You can use any picture you want for the cards if you setup in the cardPictures parameter. You can download this Rider-Waite-Smith deck that would work with the default: https://ufile.io/9q2bz (if someone can suggest a better place to upload, please suggest)
Code:
* This plugin adds four plugins commands to be used in your events:
*
* 1. TarotShuffle
* This command just shuffles the tarot deck. No arguments.
*
* 2. TarotClear
* Clear the cards on the screen
*
* 3. TarotInterpretation
* Display a message with a random fortune telling.
* I suggest you to use a message plugin with wordwrap support (eg Yanfly Message Core),
* because the generated messages are big.
*
* 4. TarotSpreadCard <X> <Y> <R>
*
* This is the main command to be used. This command will display a card on the position X, Y.
* Please note that X and Y use the card height as units, not pixels.
*
* To display the Celtic Cross spread, use the following sequence:
*
* TarotShuffle
* TarotSpreadCard 2 2 0
* TarotSpreadCard 2 2 90
* TarotSpreadCard 2 3 0
* TarotSpreadCard 1 2 0
* TarotSpreadCard 2 1 0
* TarotSpreadCard 3 2 0
* TarotSpreadCard 4 4 0
* TarotSpreadCard 4 3 0
* TarotSpreadCard 4 2 0
* TarotSpreadCard 4 1 0
* TarotInterpretation
* TarotClear
复制代码
Script
Spoiler: ELD_Tarot.js
Code:
/*:
* @plugindesc Spread cards on the screen and give fortune-telling messages
* @default ["["In the past, ","There was a time when ","Before, "]","["you were often dealt with unfairly","you had someone who meant a lot to you","you cared more than you do now"]","[".\\\\. Now, ",".\\\\. Today, "]","["you should realize things aren't so bad","life is presenting you with great opportunities you are choosing to ignore","you should remember to not let your past haunt you","you need to take life more seriously","people give you better advice than you realize","you give lots of advice but never take any"]","[".\\\\. Someday, ",".\\\\. In the future, ",".\\\\. Later, "]","["you'll realize your mistakes and it will be too late","you'll regret the choice you aren't making","you'll live life just fine no matter what anybody thinks","you'll know your mom was right sometimes","you'll realize you love someone and it will be too late"]","["."]"]
*
* Based on http://orteil.dashnet.org/randomgen/?gen=wzTkj6Qg
*
* @help
*
*
*
* This plugin adds four plugins commands to be used in your events:
*
* 1. TarotShuffle
* This command just shuffles the tarot deck. No arguments.
*
* 2. TarotClear
* Clear the cards on the screen
*
* 3. TarotInterpretation
* Display a message with a random fortune telling.
* I suggest you to use a message plugin with wordwrap support (eg Yanfly Message Core),
* because the generated messages are big.
*
* 4. TarotSpreadCard <X> <Y> <R>
*
* This is the main command to be used. This command will display a card on the position X, Y.
* Please note that X and Y use the card height as units, not pixels.
*
* To display the Celtic Cross spread, use the following sequence:
*
* TarotShuffle
* TarotSpreadCard 2 2 0
* TarotSpreadCard 2 2 90
* TarotSpreadCard 2 3 0
* TarotSpreadCard 1 2 0
* TarotSpreadCard 2 1 0
* TarotSpreadCard 3 2 0
* TarotSpreadCard 4 4 0
* TarotSpreadCard 4 3 0
* TarotSpreadCard 4 2 0
* TarotSpreadCard 4 1 0
* TarotInterpretation
* TarotClear
*
*/
(function() {
var params = PluginManager.parameters('ELD_Tarot');
function shuffle(a) {
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
var alias_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;