neon_crisp / Modules / card/card / Card
Class: Card
card/card.Card
Table of contents
Constructors
Properties
- atk
- displayData
- hp
- id
- incomingDamage
- onAfterAttack
- onAttack
- onBeforeAttack
- onDamage
- onGameStart
- onHealthAtOrBelowZero
- onStateChange
- onTargeted
- onTurn
- state
- uid
- used
Methods
- freezeCheck
- getCardRenderData
- handleFreeze
- handleOnAfterAttack
- handleOnAttack
- handleOnBeforeAttack
- handleOnCardStateChange
- handleOnDamage
- handleOnGameStart
- handleOnHeathAtOrBelowZero
- handleOnTargeted
- handleOnTurn
- informCardGameObjectThatStateMayHaveChanged
- mutateState
- receiveDamage
- registerCardGameObjId
- setState
- clone
Constructors
constructor
• new Card(hp, atk, id, displayData, attackActions, onDamageActions, onStateChangeActions, onHealthAtOrBelowZero, onTurn, onGameStart, onTargeted, onAfterAttack, onBeforeAttack): Card
Parameters
| Name | Type |
|---|---|
hp | number |
atk | number |
id | string |
displayData | CardDisplayData |
attackActions | ActionTitle[] |
onDamageActions | ActionTitle[] |
onStateChangeActions | ActionTitle[] |
onHealthAtOrBelowZero | ActionTitle[] |
onTurn | ActionTitle[] |
onGameStart | ActionTitle[] |
onTargeted | ActionTitle[] |
onAfterAttack | ActionTitle[] |
onBeforeAttack | ActionTitle[] |
Returns
Defined in
Properties
atk
• atk: number
Defined in
displayData
• displayData: CardDisplayData
Defined in
hp
• hp: number
Defined in
id
• id: string
Defined in
incomingDamage
• incomingDamage: number
Defined in
onAfterAttack
• onAfterAttack: Action[]
Defined in
onAttack
• onAttack: Action[]
Defined in
onBeforeAttack
• onBeforeAttack: Action[]
Defined in
onDamage
• onDamage: Action[]
Defined in
onGameStart
• onGameStart: Action[]
Defined in
onHealthAtOrBelowZero
• onHealthAtOrBelowZero: Action[]
Defined in
onStateChange
• onStateChange: Action[]
Defined in
onTargeted
• onTargeted: Action[]
Defined in
onTurn
• onTurn: Action[]
Defined in
state
• state: Record<string, any>
Defined in
uid
• uid: string
Defined in
used
• used: boolean
Defined in
Methods
freezeCheck
▸ freezeCheck(): boolean
Returns
boolean
Defined in
getCardRenderData
▸ getCardRenderData(): CardRenderData
This is the accepted way of getting a cards info for displaying data in the game. This function should return you everything you need to render or update the card
Returns
Defined in
handleFreeze
▸ handleFreeze(): void
Returns
void
Defined in
handleOnAfterAttack
▸ handleOnAfterAttack(attackingCard, defendingCard, gameContext): void
this is to handle all on after attack actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnAttack
▸ handleOnAttack(attackingCard, defendingCard, gameContext): void
this is to handle all on attack actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnBeforeAttack
▸ handleOnBeforeAttack(attackingCard, defendingCard, gameContext): void
this is to handle all on before attack actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnCardStateChange
▸ handleOnCardStateChange(attackingCard, defendingCard, gameContext): void
this is to handle all on state change actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnDamage
▸ handleOnDamage(attackingCard, defendingCard, gameContext): void
this is to handle all on damage actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnGameStart
▸ handleOnGameStart(attackingCard, defendingCard, gameContext): void
this is to handle all on game start actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnHeathAtOrBelowZero
▸ handleOnHeathAtOrBelowZero(attackingCard, defendingCard, gameContext): void
this is to handle all on health on or below zero and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnTargeted
▸ handleOnTargeted(attackingCard, defendingCard, gameContext): void
this is to handle all on targeted actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void
Defined in
handleOnTurn
▸ handleOnTurn(attackingCard, defendingCard, gameContext): void
this is to handle all on turn actions and should only be called by game context
Parameters
| Name | Type |
|---|---|
attackingCard | Card |
defendingCard | Card |
gameContext | GameContext |
Returns
void