Difference between revisions of "Card Game Core (Irina)"

From Yanfly.moe Wiki
Jump to navigation Jump to search
(Booster Notetags)
(Booster Notetags)
Line 712: Line 712:
 
</pre>
 
</pre>
  
<html><img src='https://img.itch.zone/aW1nLzIxMTM4NjMucG5n/original/xYQSBy.png' width='630'></html>
+
<html><img src='https://img.itch.zone/aW1nLzIxMTM4NjMucG5n/original/xYQSBy.png'></html>
  
 
<pre>
 
<pre>

Revision as of 13:42, 25 June 2019

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


Contents


Download

  • [link Mirror]

System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.


Masterarbeit Writer

Atelier Irina

IrinaAvatar.png

This is a plugin created by Atelier Irina.

You can also follow Atelier Irina on itch.io.

RPG Maker Version

This plugin is made for and tested on RPG Maker MV with version 1.6.2. I cannot guarantee if it works on lower versions. Some of the plugin parameters require the later updates of RPG Maker MV for you to be able to use their entries so please update RPG Maker MV to the latest version if you want the best experience in using this plugin.

Terms of Use

You are only allowed to use the plugins made by Atelier Irina if you agree to all of the following:

  1. These plugins may be used in free or commercial games.
  2. 'RPG Maker Irina' must be given credit in your games.
  3. You are allowed to edit the code.
  4. Do NOT change the filename, parameters, and information of the plugin.
  5. You are NOT allowed to redistribute these Plugins.
  6. You may NOT take code for your own released Plugins.

Extension Plugins

The following plugins are Extension Plugins that require this plugin as its Parent Plugin.

Place the following plugins below this plugin located in the Plugin Manager if you plan on using them.

Introduction

This plugin adds a Collectible Card Game aspect to your RPG Maker MV project. Cards are database items that will look and appear differently based on how you design them. Booster packs can be used to acquire cards in a random assortment, too. Once enough is collected, you can use them to build a deck and play a card game with it, where you, the game dev, can define the rules.

This file is one of three files included in the collectible card game set and primarily focuses on the design of the cards and booster packs for opening them. If you only want collectible cards and/or booster packs in your game, just use only this file instead. Everything else is unnecessary.

Instructions

It is recommended that you place this plugin beneath all your other Yanfly Engine Plugins for maximum compatibility. I cannot guarantee this plugin will work with all of them, but there should be little reason why it wouldn't work together with something independent of the default gameplay.

This plugin supports KELYEP_DragonBones. If that plugin is installed in the same project as this, make sure KELYEP_DragonBones is located beneath this plugin in the plugin manager list. This is the only YEP plugin that you should have located beneath this plugin.

There are a lot of instructions to follow if you wish to get everything done correctly. Be sure to read through the help file carefully and download the needed information from the project's itch.io page:

itch.io link

It is recommended for you to download the assets pack to get started with the project. Everything should go into their respective folders structured in the assets pack archive file.

Plugin Parameters

There are Plugin Parameters that you may configure for this plugin.

There are a lot of plugin parameters. You must set these up properly if you wish to make this project work. Here's what each plugin parameter do.

---

Card Templates

The card templates are various design templates used for each card. Here, you can add additional card templates.

Card Templates: Name

This is the name of this particular template. Templates are named after a card element, and any kind of text used for notetag <Card Element: name> will default to the template associated with it unless <Card Template: name> is used. As an example, a card with <Card Element: Fire> will cause the template with 'Fire' as its template name to be automatically selected, but if the card has <Card Element: Fire_SSR>, then the template with 'Fire_SSR' as its name will be selected.

Card Templates: Image File

This is the card template's visual base used. The visual base is designed as a 4x1 cell sprite sheet. Cell 0 is the background. Cell 1 is the card border image. Cell 2 is the text window. Cell 3 are the icons on top. Create the cells of equal width and height. Refer to the assets pack for reference on how to make this. The image location is in img/pictures/ so place the image there.

Card Templates: Icon Index

The icon associated with this template.

Card Templates: Attack Animation

This is the default attack animation used for the card if the card item in the database has 'None' selected as its main attack animation. This is used for the card game.

Card Templates: JS: Draw Code

This is for those who know JavaScript. Here, you can determine how the draw layer will appear in your game. The draw layer is the layer shown on top of the icon layer to draw information for the player, such as the card's name, Level, Power, etc. I am not responsible if changing any of the code here crashes your game.

Card Templates: Text Box X, Y, Width, Height

The exact coordinates of the text box window in pixels that appears on the card itself. The text box will write out the card's description, that is either made through the card item's database description or using notetags:

<Card Text>
Line 1
Line 2
Line 3
Line 4
</Card Text>

---

Overall Card Design

The plugin parameters here are used to define the overall look and structure of the card as a whole.

Overall Card Design: Flip Sound

When a card flips over, this is the sound effect it will make. The sound effect will be loaded from your project's audio/se/ folder.

Overall Card Design: Outline Thickness

Cards will have an outline to them. You can determine its thickness in pixels using this plugin parameter.

Overall Card Design: Outline Color

Determine the color of the outline with this plugin parameter. The color format works as such:

rgba(red, green, blue, alpha)
red:   number between 0 and 255
green: number between 0 and 255
blue:  number between 0 and 255
alpha: number between 0 and 1

Overall Card Design: Mask Image

The mask image determines the card shape. This is how you can make your cards have rounded edges or other shapes. The black on the image are the hidden parts of the card. The white on the image are the visible parts of the card. Refer to the assets pack for reference on how to make this. The image location is in img/pictures/ so place the image there.

Overall Card Design: Preload Common Assets

This is a true/false setting. If you wish to speed up the creation process of a card upon loading, set this to true. Otherwise, make it false.

---

Card Back Design

The plugin parameters here are used to design the back of your cards. All cards will have a uniform back appearance.

Card Back Design: Back Image

This is the card template's back image used. The image is designed as a 2x1 cell sprite sheet. Cell 0 is the background that is affected by a holo- hue filter. Cell 1 is the logo that isn't affected by the hologram. Create the cells of equal width and height. Refer to the assets pack for reference on how to make this. The image location is in img/pictures/ so place the image there.

Card Back Design: Back Hue Shift Speed

This is a numeric value on how fast the hue shifts for the back holo- hue filter. Set it to 0 if you don't want the backs to change color.

---

Card Front Design

The following plugin parameters adjust the front of the card's design. While the front is often changed by a template declared in the Card Templates plugin parameter, this decides the default settings used across each segment.

Card Front Design: Rarity Colors

This is an array of the colors used for text names and auras depending on the card's rarity using the <Card Rarity: x> notetag. This array starts at 1 and goes to whatever you let it size up to. At position 0, white is automatically added in. The colors added will follow this format:

rgba(red, green, blue, alpha)
red:   number between 0 and 255
green: number between 0 and 255
blue:  number between 0 and 255
alpha: number between 0 and 1

If a color is labeled as 'holo' or 'rainbow', then the name and aura of the card will become holographic and change colors throughout.

Card Front Design: Blend Mode: Hologram

This decides the default blend mode of the holographic image used on the card's front. This can be changed through notetags.

Card Front Design: Holo Hue Opacity

This determines the holographic image's default opacity level using a number between 0 and 255. This can be changed through notetags.

Card Front Design: Holo Hue Shift Speed

This determines the speed at which the holographic image cycles through its colors. Use 0 if you don't wish for it to cycle (but why??). This can be changed through notetags.

Card Front Design: Blend Mode: Border

This decides the default blend mode of the border cell used on the card's front by the card's template.

Card Front Design: Blend Mode: Text Box

This decides the default blend mode of the text box cell used on the card's front by the card's template.

Card Front Design: Default Text Size Scale

This determines the scale of the text window used. Use 1.0 for regular size, but the default RPG Maker MV font size won't give you much room to make the text on there look good. Settle for a number like 0.5 instead.

Card Front Design: Blend Mode Icon Layer

This decides the default blend mode of the icon cell used on the card's front by the card's template.

---

Default Booster Art

This is the default artwork used for booster packs. The image location is in img/pictures/ so place the desired image there.

Default Booster BG

This is the default background used when opening booster packs. The image location is in img/parallaxes/ so place the desired image there.

Booster Rarity Auras

Shows rarity auras when opening booster packs. Rarity auras are determined by a card's rarity level, which is determined through the <Card Rarity: x> notetag.

---

Booster Window Settings

This section is for those who wish to alter the code used to make the Booster Pack Card List Window. Do not alter these settings if you are not familiar with JavaScript.

Booster Window Settings: JS: Initialize Code

This is the code that's used to define the way the window appears and its various dimensions.

Booster Window Settings: JS: Create Title Window

This is the code used to make the window that appears above the list window indicating how many booster packs have been opened.

Booster Window Settings: JS: Create Under Window

This is the code used to make the window that appears below the list window telling the player to press OK or cancel to move forward.

Booster Window Settings: JS: Create Shown Card

This is the code used to determine how to position a card on the screen to make it visible as the player scrolls through the list.

Booster Window Settings: JS: Draw List Item

This is the code used to determine how to draw each of the list items in the window.

---

Item Core Additions

If you are using Yanfly's Item Core (and you should if you aren't), additional options can be made if the expanded item menu is used. Do not alter the JS settings if you are not familiar with JavaScript.

Item Core Additions: Window Rarity Auras

This will show auras for the cards displayed in the preview window.

Item Core Additions: JS: Booster Commands

This adds additional commands when selecting a booster pack to use in the expanded item menu.

Item Core Additions: JS: Action Open Booster

This is the action ran when opening multiple booster packs at once. By default, there is nothing new done here but there could be if you wanted!

---

Booster Scene Settings

These settings determine the code that runs through the fancier open a booster pack scene. This is in case you want to change things up on how the scene looks to fit your game. Do not alter the JS settings if you are not familiar with JavaScript.

Booster Scene Settings: Play Unique Music?

Play unique music when entering this scene? This will fade out the currently played music for the one listed below.

Booster Scene Settings: Fade Out Duration

If the above is set to true, then is how many seconds it will take to fade out the currently played music. This is also the duration used when returning back to the previous scene after this scene is finished.

Booster Scene Settings: Booster Music

If you opt to play unique music for the booster opening scene, this is the bgm that's being played. The image location is in audio/bgm/ so place the wanted song there.

Booster Scene Settings: JS: Window Creation

This is the code that's ran to make windows in the scene that show up displaying the number of boosters the player has gone through in the session to help messages that urge the player on how to continue forward.

Booster Scene Settings: JS: Start Phase 1, 2, 3

This is the code that's ran at the start of each of the three phases used in the booster scene to open the booster packs and display the cards. Each phase has its own code.

Booster Scene Settings: JS: Update Phase 1, 2, 3, Skip, Finish

This is the code that's ran after each phase has started to transfer the player from scene to scene as well as update the sprites and windows on the screen in a controlled fashion.

---

Booster Option Settings

These plugin parameters give the player an option to control whether or not they wish to watch the full booster animation when opening a pack from the Options Menu. If you are using YEP_OptionsCore (and if you're not, why????), scroll down to the YEP_OptionsCore Integration to learn how to integrate this plugin's option settings with YEP_OptionsCore.

Booster Option Settings: Show Option

If this is true, the option will appear in the options menu. If false, then it won't. Simple as that.

Booster Option Settings: Default Setting

Determine if the setting will show the full animation (true) or not (false) by default.

Booster Option Settings: Text

This is the text that appears for this option command.

Notetags

NotetagsMV.png

RPG Maker MV's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.

---

The following are notetags that you use with your items to change them into cards or booster packs.

Card Notetags

<Card Art: foldername, filename>
<Card Art: foldername, filename, hue>
- Replace 'foldername' with the img/folder's name (case sensitive)
- Replace 'filename' with the graphic's filename (case sensitive)
- (Optional) Replace 'hue' with a number between 0 and 360 for the hue. If
you don't use this option, it will default to 0.
- Example: <Card Art: sv_enemies, Dragon, 100>

<Card Dragonbones: armature>
- If you are running KELYEP_DragonBones, you can use DB armatures for the
card art instead. Replace 'armature' with the name of the armature you wish
load onto this card. The armature is automatically loaded upon game start.
This is case sensitive.

<Card Dragonbones Animation: animationName>
- Replace 'animationName' with the name of the animation used by the DB
armature. The animation name is case sensitive.
<Card Art Offset: +x, +y>
<Card Art Offset: -x, -y>
- Replace 'x' and 'y' with numeric values to determine the horizontal and
vertical offset for the art graphic from the center.
<Card Art Scale: x>
- Replace 'x' with a number to determine the scaling value of the art.
1.0 is 100%. 0.5 is 50%. 2.5 is 250%.

<Card Art Cells: ColxRow>
- Use this notetag only if you plan on using a sprite sheet.
- Replace 'Col' with the number of cell columns the sprite sheet has.
- Replace 'Row' with the number of cell rows the sprite sheet has.
- Otherwise, if this notetag is unused, the art will be treated as a
normal full-sized image.
<Cell Art Cell Index: x>
- Use this only if you plan on using a sprite sheet.
- Replace 'x' with the index number of the cell starting from 0.
- Otherwise, if this notetag is unused, the index cell will default to 0.
<Card Name: name>
- Replace 'name' with the text that you wish to appear on the card.
<Card Element: name>
- Replace 'name' with the element this card associates with. This will also
determine the Card Template plugin parameter this card uses. If this notetag
is not used, the element will default to 'None'. If you wish to use a custom
card template after defining the element, use <Card Template: x>.
<Card Level: x>
- Replace 'x' with this card's level. This is a numeric value.
<Card Power: x>
- Replace 'x' with this card's power. This is a numeric value.
<Card Health: x>
- Replace 'x' with this card's health. This is a numeric value. This does
not appear on cards by default unless you alter the settings in the Card
Templates plugin parameters to let it show.

<Card Template: name>
- Replace 'name' with the name of the Card Template you wish for this card
to use in place of the default one determined by its element.
<Card Rarity: x>
- Replace 'x' with a number representing the card's rarity. This is used to
determine the aura of the card and where it stands in the card pool when
opening booster packs.

<Card Parallax BG: filename>
- Replace 'filename' with the filename of a graphic from img/parallaxes/
to be used as this card's parallax background. This is case sensitive.
- This is an optional notetag. Not all cards need parallax backgrounds.
<Card Parallax BG Speed: +x, +y>
<Card Parallax BG Speed: -x, -y>
- Replace 'x' and 'y' with numeric values determining the parallax's scroll
speed for this card.
<Card Parallax BG Opacity: x>
- Replace 'x' with a number value between 0 and 255 to determine the opacity
level of the parallax background.
<Card Parallax BG Blend Mode: Normal>
<Card Parallax BG Blend Mode: Additive>
<Card Parallax BG Blend Mode: Multiply>
<Card Parallax BG Blend Mode: Screen>
- Determines which blend mode you wish to use for the parallax background.
You can only pick one of the above.

<Card Holo BG: filename>
- Replace 'filename' with the filename of a graphic from img/pictures/ to be
used as this card's hologram background. This is case sensitive.
- This is an optional notetag. Not all cards need holographic backgrounds.
<Card Holo BG Speed: x>
- Replace 'x' with a numeric value determine how fast the holographic hue
shifts each frame.
<Card Holo BG Opacity: x>
- Replace 'x' with a numeric value between 0 and 255 to determine the
holographic background's opacity.
<Card Holo BG Blend Mode: Normal>
<Card Holo BG Blend Mode: Additive>
<Card Holo BG Blend Mode: Multiply>
<Card Holo BG Blend Mode: Screen>
- Determines which blend mode you wish to use for the holographic background.
You can only pick one of the above.

<Card Parallax FG: filename>
- Replace 'filename' with the filename of a graphic from img/parallaxes/
to be used as this card's parallax foreground. This is case sensitive.
- This is an optional notetag. Not all cards need parallax foregrounds.
<Card Parallax FG Speed: +x, +y>
<Card Parallax FG Speed: -x, -y>
- Replace 'x' and 'y' with numeric values determining the parallax's scroll
speed for this card.
<Card Parallax FG Opacity: x>
- Replace 'x' with a number value between 0 and 255 to determine the opacity
level of the parallax foreground.
<Card Parallax FG Blend Mode: Normal>
<Card Parallax FG Blend Mode: Additive>
<Card Parallax FG Blend Mode: Multiply>
<Card Parallax FG Blend Mode: Screen>
- Determines which blend mode you wish to use for the parallax foreground.
You can only pick one of the above.

<Card Holo FG: filename>
- Replace 'filename' with the filename of a graphic from img/pictures/ to be
used as this card's hologram foreground. This is case sensitive.
- This is an optional notetag. Not all cards need holographic foregrounds.
<Card Holo FG Speed: x>
- Replace 'x' with a numeric value determine how fast the holographic hue
shifts each frame.
<Card Holo FG Opacity: x>
- Replace 'x' with a numeric value between 0 and 255 to determine the
holographic foreground's opacity.
<Card Holo FG Blend Mode: Normal>
<Card Holo FG Blend Mode: Additive>
<Card Holo FG Blend Mode: Multiply>
<Card Holo FG Blend Mode: Screen>
- Determines which blend mode you wish to use for the holographic foreground.
You can only pick one of the above.
<Card Text>
Line 1
Line 2
Line 3
Line 4
</Card Text>
- Replace lines 1 through 4 with text you wish to appear in the card's text
box. If you do not use this notetag, the text will use the card's database
item's description text instead.
<Card Text Scale: x>
- Replace 'x' with a number determining the scale of the text size.
<Not a Card>
- If you want to mark something as <Not a Card>, it won't appear in the
card pool of booster packs even if the number gets listed. It also won't be
registered as a card. This is only to be used in situations where a database
item got flagged incorrectly by the plugin as a card, when it isn't one.

Booster Notetags

<Booster Art: filename>
- Replace 'filename' with the filename of a graphic from img/pictures/ to be
used as the art for this booster pack. If you do not use this notetag, the
art will default to the one defined in the Plugin Parameters.

<Booster BG: filename>
- Replace 'filename' with the filename of a graphic from img/parallaxes/ to
be used as the background art shown when opening a booster pack during a full
booster animation sequence. If you do not use this notetag, the graphic used
will default to the one defined in the Plugin Parameters.

<Booster Rarities: x>
<Booster Rarities: x, x, x>
<Booster Rarities: x, x, x, x, x>
- Replace 'x' with numbers from 0 to whatever your highest rarity is.
- Use any number of x's you want in the notetag.
- This determines the rarity pools used when opening this booster pack.
- Use multiples of this notetag to have more variety in the booster pack
contents there can be. When this booster pack is opened, it will only choose
one of the above pools.

<Card Pool: x>
<Card Pool: x, x, x>
<Card Pool: x, x, x, x, x, x>
- Replace 'x' with the ID's of the items you wish to put into the card pool.
- Use any number of x's you want in the notetag.
- Use multiples of this notetag if you wish. The card pool will consolidate
each iteration of this notetag.
- This will combine the card pool with the below notetag.
<Card Pool: x to y>
- Replace 'x' and 'y' with the ID's you wish to grab all the numbers of
between and throw them into the card pool.
- Use multiples of this notetag if you wish. The card pool will consolidate
each iteration of this notetag.
- This will combine the card pool with the above notetag.

Script Calls

ScriptCallsMV.png

Script Calls are event commands that are used to run JavaScript code during an event to call upon unique functions, usually added by the related plugin.

Here is a list of Script Call(s) that you may use:

var itemId = 10;
var times = 1;
var consume = true;
$openCardBoosterWindow(itemId, times, consume);
- This opens up a booster pack card list window (without the fancy scene).
- Replace 'itemId' with the ID of the booster pack you wish to open.
- Replace 'times' with the number of times to open this booster pack.
- Replace 'consume' with true or false (without quotes) to determine if the
booster pack item will be consumed the player's inventory.

var itemId = 10;
var times = 1;
var consume = true;
$openCardBoosterScene(itemId, times, consume);
- This opens up a booster pack card scene (the super fancy-looking one).
- Replace 'itemId' with the ID of the booster pack you wish to open.
- Replace 'times' with the number of times to open this booster pack.
- Replace 'consume' with true or false (without quotes) to determine if the
booster pack item will be consumed the player's inventory.

var itemId = 10;
var times = 1;
var consume = true;
$openCardBoosterPacks(itemId, times, consume);
- This opens up a booster pack card scene or list depending on the player's
selected option setting.
- Replace 'itemId' with the ID of the booster pack you wish to open.
- Replace 'times' with the number of times to open this booster pack.
- Replace 'consume' with true or false (without quotes) to determine if the
booster pack item will be consumed the player's inventory.


Options Core Integration

To integrate options from this plugin into Yanfly's Options Core, use the settings below:

If you want to integrate the Booster Animation option into Yanfly's Options Core plugin, use the settings below:

Animated Cards

Name:
\i[187]Animated Cards

Help Description:
Cards of higher rarity are animated.

Symbol:
cardAnimatedCards

Show/Hide:
show = Imported.Irina_CardGameCore.AnimateCardOptionShow;

Enable:
enabled = true;

Ext:
ext = 0;

----------
Functions:
----------

Make Option Code:
this.addCommand(name, symbol, enabled, ext);

Draw Option Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
this.drawOptionsOnOff(index);

Process OK Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);

Cursor Right Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, true);

Cursor Left Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, false);

Default Config Code:
// Empty.

Save Config Code:
// Empty.

Load Config Code:
// Empty.

Booster Animations

Name:
\i[187]Booster Animations

Help Description:
Plays the full Booster Pack opening animation if ON.
Otherwise, it shows the contents of the pack(s) if OFF.

Symbol:
cardBoosterAnimation

Show/Hide:
show = Imported.Irina_CardGameCore.BoosterOptionShow;

Enable:
enabled = true;

Ext:
ext = 0;

----------
Functions:
----------

Make Option Code:
this.addCommand(name, symbol, enabled, ext);

Draw Option Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
this.drawOptionsOnOff(index);

Process OK Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);

Cursor Right Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, true);

Cursor Left Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, false);

Default Config Code:
// Empty.

Save Config Code:
// Empty.

Load Config Code:
// Empty.