Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implementing Double Faced Cards

Leandro Doctors edited this pageFeb 4, 2020 ·1 revision

Introduction

The main idea of two-faced cards implementation is each side being implemented as separated single card and then connected to each other. Only day cards are displayed in the game (deck editor, collection viewer, game). Night cards are used for transformation and for copying stats and abilities to day card only.

Note: as collector number for such cards uses letters ('a' and 'b'), not to change all other cards to use String, it was decided to add 1000 to day card number to form the night card. Here is an example:

  • Original: Thraben Sentry - 38a Thraben Militia - 38b
  • In MAGE: Thraben Sentry - 38 Thraben Militia - 1038

Details

The steps for implementing a double faced card are as follows (we'll useThraben Sentry / Thraben Militia for this example):

  1. Generate both card classes using gen-card.pl one by one. You'll get two classes: ThrabenSentry.java, ThrabenMilitia.java
  2. Add the following lines to day card (Thraben Sentry):
this.canTransform =true;this.secondSideCard =newThrabenMilitia(ownerId);
  1. Add the transform ability to day card:
this.addAbility(newTransformAbility());
  1. Change the card number in the night card to day card's number + 1000:
super(ownerId,1038, ...
  1. Add the following lines to night card (Thraben Militia):
this.nightCard =true;this.canTransform =true;
  1. Add triggered abilities to transform the card. UseTransformSourceEffect() that is one shot effect to transform the card from day state to night and vice versa.
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp