55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
|
package engine
|
||
|
|
||
|
import (
|
||
|
"git.fromouter.space/mcg/draft/mlp"
|
||
|
)
|
||
|
|
||
|
// Card is a card of MLP:CCG
|
||
|
type Card struct {
|
||
|
Info mlp.Card
|
||
|
|
||
|
// Continuous abilities
|
||
|
Static []Ability
|
||
|
|
||
|
// Activated abilities
|
||
|
Activated []ActivatedAbility
|
||
|
|
||
|
// Triggered abilities
|
||
|
Triggered []TriggeredAbility
|
||
|
}
|
||
|
|
||
|
// CardInstance is an instance of a card
|
||
|
type CardInstance struct {
|
||
|
Identity Card
|
||
|
IsToken bool
|
||
|
}
|
||
|
|
||
|
// ActivatedAbility is an ability that can be activated
|
||
|
type ActivatedAbility struct {
|
||
|
Timing Timing // When can this ability be activated
|
||
|
Ability Ability
|
||
|
}
|
||
|
|
||
|
// TriggeredAbility is an ability that gets triggered during an event
|
||
|
type TriggeredAbility struct {
|
||
|
Trigger Event // When is this ability triggered
|
||
|
Ability Ability
|
||
|
}
|
||
|
|
||
|
// Ability is an ability a card can have
|
||
|
type Ability struct {
|
||
|
Requirements []Effect // These must resolve for the effects to activate
|
||
|
Effects []Effect
|
||
|
}
|
||
|
|
||
|
// Timing is when a player can activate an ability/play an event
|
||
|
type Timing string
|
||
|
|
||
|
// All timings
|
||
|
const (
|
||
|
TimeInstant Timing = "instant"
|
||
|
TimeMainPhase Timing = "main phase"
|
||
|
TimeFaceoff Timing = "faceoff"
|
||
|
TimeReaction Timing = "reaction"
|
||
|
)
|