Class

PrismaticCard

PrismaticCard(marksopt, nopt, mpopt, nullable)

複合属性を持つカードのクラス. 最初に PrismaticCard.init(GE, width, height) を 実行してからインスタンスの生成を行う.

Cardクラスと同様, 各インスタンスは次のプロパティを持つ.

  • mark
  • value
  • MP
  • skill (任意)
  • CardAtlassId (任意)

各要素の意味はCardクラスと共通である. ただし, 複合属性を持つため, mark の取りうる値は PrimitiveSuits.length ~ (Suits.length-1) の範囲の整数である.

Constructor

# new PrismaticCard(marksopt, nopt, mpopt, nullable)

複合属性のカードを生成する. どの基本属性を構成要素として含むかは, マーク数値のリスト marks により指定する.

Parameters:
Name Type Attributes Default Description
marks Array.<number> <optional>

マーク数値のリスト

n number <optional>
0

このカードのコスト

mp number <optional>
<nullable>
null

このカードのMP. 省略時は n*20 で代用する

Properties:
Name Type Attributes Description
mark number

このカードのマーク数値

value number

このカードのコスト

skill PlayerSkill_skill <optional>

このカードが持つスキル

cardAtlasID string <optional>

cardlist.jsにおけるこのカードのID

View Source card.js, line 1214

Methods

# getMP() → {number}

MPBoostBySuitの補正を適用した後のMPを計算する.

View Source card.js, line 1261

計算結果

number

# paint(GE, ctx, x, y)

指定された座標を左上端としてこのカードを描画する. ただし, コストが 0 のカードは何も描画しない.

Parameters:
Name Type Description
GE stdgam.GameEngine

この処理に用いるGameEngine

ctx CanvasRenderingContext2D

描画処理に用いるコンテクスト

x number

描画位置のx座標

y number

描画位置のy座標

View Source card.js, line 1273

# static init(GE, width, height)

PrismaticCardクラスを初期化する. 具体的には, 複合カードの描画に必要なオブジェクト (より正確には, Polysuitの「すべての」サブクラスのインスタンスを1つずつ) を生成する. 以降, これらをカードの描画に用いる.

Parameters:
Name Type Description
GE stdgam.GameEngine

画像のロードに用いるGameEngine

width number

カードの横幅

height number

カードの縦幅

View Source card.js, line 1224