Documentation ¶
Overview ¶
Package card implements data structures used by Spy Cards Online.
Index ¶
- Constants
- Variables
- func RandomRecording(ctx context.Context, mode string, not ...string) (string, error)
- type BannedCards
- type BannedCardsFlags
- type BugFablesVersion
- type ContentIdentifier
- type CosmeticData
- type Deck
- type DeckLimitFilter
- type Def
- func (cd *Def) Description(set *Set) *RichDescription
- func (cd *Def) DisplayName() string
- func (cd *Def) MarshalBinary() ([]byte, error)
- func (cd *Def) MarshalText() ([]byte, error)
- func (cd *Def) ToHTML(ctx context.Context, set *Set) string
- func (cd *Def) UnmarshalBinary(b []byte) (err error)
- func (cd *Def) UnmarshalText(b []byte) error
- func (cd *Def) UpdateID(oldID, newID ID)
- type EffectDef
- func (e *EffectDef) Complete() bool
- func (e *EffectDef) Description(card *Def, set *Set, parents ...*EffectDef) []*RichDescription
- func (e *EffectDef) IsPassive(card *Def) bool
- func (e *EffectDef) Marshal(w *format.Writer) (err error)
- func (e *EffectDef) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
- func (e *EffectDef) UpdateID(oldID, newID ID)
- type EffectFlag
- type EffectType
- type Extension
- type ExtensionType
- type ExternalMode
- type Field
- type FieldType
- type Filter
- type FilterComponent
- type FilterType
- type GameMode
- func (gm *GameMode) Get(t FieldType) Field
- func (gm *GameMode) GetAll(t FieldType) []Field
- func (gm *GameMode) MarshalBinary() ([]byte, error)
- func (gm *GameMode) MarshalText() ([]byte, error)
- func (gm *GameMode) UnmarshalBinary(b []byte) (err error)
- func (gm *GameMode) UnmarshalText(b []byte) error
- func (gm *GameMode) Variant(i int) (*GameMode, *Variant)
- type GameRules
- type Group
- type GroupFlags
- type ID
- type Metadata
- type ModifiedCardPosition
- type Number
- type Rank
- type Recording
- type RecordingRound
- type RichDescription
- type Set
- type Sets
- type SpecialFlag
- type SpecialFlags
- type SpecialFlagsFlags
- type SummonCard
- type SummonCardFlags
- type Timer
- type Tribe
- type TribeDef
- type Turn0Effect
- type TurnData
- type UnfilterCard
- type UnfilterCardFlags
- type UnknownDeck
- type VanillaVersion
- type Variant
Constants ¶
const ( // PortraitCustomEmbedded is an embedded PNG custom portrait. PortraitCustomEmbedded uint8 = 254 // PortraitCustomExternal is a FileID of an external portrait. PortraitCustomExternal uint8 = 255 // DefaultPortraitCount is the number of portrait slots that are used in // the enemy portrait sprite sheet, not counting the digits at the end. DefaultPortraitCount = 233 )
const ( PosInf = "∞" NegInf = "-∞" )
Infinity symbol strings.
const ( // ExtensionOverrideCustom (SetStage, SetMusic): override even if a custom // override is already active. ExtensionOverrideCustom uint64 = 1 << 0 )
Extension flags.
Variables ¶
var DefaultGameRules = GameRules{
MaxHP: 5,
HandMinSize: 3,
HandMaxSize: 5,
DrawPerTurn: 2,
CardsPerDeck: 15,
MinTP: 2,
MaxTP: 10,
TPPerTurn: 1,
BossCards: 1,
MiniBossCards: 2,
DuplicateBoss: 1,
DuplicateMiniBoss: 1,
DuplicateEffect: 0,
DuplicateAttacker: 0,
}
DefaultGameRules is the default game rules for Spy Cards Online.
Functions ¶
Types ¶
type BannedCards ¶
type BannedCards struct { Flags BannedCardsFlags Cards []ID }
BannedCards is a custom game mode field representing cards that cannot be used in decks or summoned via random summons in this game mode.
If Cards is empty, all vanilla cards (that is, cards with an ID less than 128) are banned.
func (*BannedCards) Marshal ¶
func (f *BannedCards) Marshal(w *format.Writer) error
Marshal implements Field.
func (*BannedCards) Unmarshal ¶
func (f *BannedCards) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*BannedCards) UpdateID ¶ added in v0.2.68
func (f *BannedCards) UpdateID(oldID, newID ID)
UpdateID implements Field.
type BannedCardsFlags ¶ added in v0.2.72
type BannedCardsFlags uint64
BannedCardsFlags is a bitfield of flags for BannedCards.
const ( BannedCardTypeMask BannedCardsFlags = 3 << 0 BannedCardTypeBanned BannedCardsFlags = 0 << 0 BannedCardTypeUnpickable BannedCardsFlags = 1 << 0 BannedCardTypeHiddenHome BannedCardsFlags = 2 << 0 )
Constants for BannedCardsFlags.
type BugFablesVersion ¶ added in v0.3.1
type BugFablesVersion uint8
BugFablesVersion is a version of Bug Fables: The Everlasting Sapling.
const ( BugFables105 BugFablesVersion = iota // Bug Fables 1.0.5 BugFables11 // Bug Fables 1.1 BugFables111 // Bug Fables 1.1.1 LatestVersion = BugFables111 )
Constants for BugFablesVersion.
func (BugFablesVersion) String ¶ added in v0.3.1
func (i BugFablesVersion) String() string
type ContentIdentifier ¶ added in v0.2.72
type ContentIdentifier []byte
ContentIdentifier is an IPFS CID.
func (ContentIdentifier) String ¶ added in v0.2.72
func (cid ContentIdentifier) String() string
type CosmeticData ¶
type CosmeticData struct {
CharacterName string `json:"character"`
}
CosmeticData is non-essential data representing choices made by each player before the match began.
type Deck ¶
type Deck []ID
Deck is a partially ordered list of Spy Cards cards, with boss first, then mini-boss, and then enemy (attacker and effect) cards.
func (Deck) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (Deck) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Deck) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*Deck) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type DeckLimitFilter ¶ added in v0.2.68
DeckLimitFilter limits the number of cards that may appear in a deck based on a filter.
func (*DeckLimitFilter) Marshal ¶ added in v0.2.68
func (f *DeckLimitFilter) Marshal(w *format.Writer) error
Marshal implements Field.
func (*DeckLimitFilter) Type ¶ added in v0.2.68
func (f *DeckLimitFilter) Type() FieldType
Type implements Field.
func (*DeckLimitFilter) Unmarshal ¶ added in v0.2.68
func (f *DeckLimitFilter) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*DeckLimitFilter) UpdateID ¶ added in v0.2.68
func (f *DeckLimitFilter) UpdateID(oldID, newID ID)
UpdateID implements Field.
type Def ¶
type Def struct { ID ID Name string Tribes []TribeDef TP int64 Rank Rank Portrait uint8 CustomPortrait []byte Effects []*EffectDef Extensions []*Extension // contains filtered or unexported fields }
Def is a card definition.
func Vanilla ¶
func Vanilla(base BugFablesVersion, id ID) *Def
Vanilla returns a card definition for a given ID.
func (*Def) Description ¶
func (cd *Def) Description(set *Set) *RichDescription
Description returns a description of this card.
func (*Def) DisplayName ¶
DisplayName returns the name of this card.
func (*Def) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*Def) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Def) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*Def) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type EffectDef ¶
type EffectDef struct { Type EffectType Priority uint8 Flags EffectFlag Text string Amount int64 Amount2 int64 Amount3 int64 Filter Filter Result *EffectDef Result2 *EffectDef }
EffectDef is a Spy Cards Online card effect definition.
func (*EffectDef) Complete ¶ added in v0.3.1
Complete returns false if the EffectDef expects a result but does not have a result.
func (*EffectDef) Description ¶
func (e *EffectDef) Description(card *Def, set *Set, parents ...*EffectDef) []*RichDescription
Description returns a description of this effect.
type EffectFlag ¶
type EffectFlag uint64
EffectFlag is a combination bitfield type for all effect flags.
const ( FlagFlavorTextHideRemaining EffectFlag = 1 << 0 FlagFlavorTextCustomColor EffectFlag = 1 << 1 FlagStatDEF EffectFlag = 1 << 0 FlagStatInfinity EffectFlag = 1 << 1 FlagStatOpponent EffectFlag = 1 << 2 FlagSummonOpponent EffectFlag = 1 << 0 FlagSummonReplace EffectFlag = 1 << 1 FlagSummonInvisible EffectFlag = 1 << 2 FlagHealInfinity EffectFlag = 1 << 0 FlagHealOpponent EffectFlag = 1 << 1 FlagHealRaw EffectFlag = 1 << 2 FlagTPInfinity EffectFlag = 1 << 0 FlagNumbInfinity EffectFlag = 1 << 0 FlagNumbSelf EffectFlag = 1 << 1 FlagNumbHighest EffectFlag = 1 << 2 FlagNumbIgnoreATK EffectFlag = 1 << 3 FlagNumbIgnoreDEF EffectFlag = 1 << 4 FlagNumbAvoidZero EffectFlag = 1 << 5 FlagNumbResult EffectFlag = 1 << 6 FlagNumbResult2 EffectFlag = 1 << 7 FlagNumbSummon EffectFlag = 1 << 8 FlagMultiplyHealingOpponent EffectFlag = 1 << 0 FlagMultiplyHealingFuture EffectFlag = 1 << 1 FlagMultiplyHealingTypeMask EffectFlag = 3 << 2 FlagMultiplyHealingTypeAll EffectFlag = 0 << 2 FlagMultiplyHealingTypeNegative EffectFlag = 1 << 2 FlagMultiplyHealingTypePositive EffectFlag = 2 << 2 FlagPreventNumbOpponent EffectFlag = 1 << 0 FlagModifyCardsOpponent EffectFlag = 1 << 0 FlagModifyCardsTypeMask EffectFlag = 3 << 1 FlagModifyCardsTypeAdd EffectFlag = 0 << 1 FlagModifyCardsTypeRemove EffectFlag = 1 << 1 FlagModifyCardsTypeMove EffectFlag = 2 << 1 FlagModifyCardsTypeReplace EffectFlag = 3 << 1 FlagModifyCardsTargetMask EffectFlag = 3 << 3 FlagModifyCardsTargetAny EffectFlag = 0 << 3 FlagModifyCardsTargetHand EffectFlag = 1 << 3 FlagModifyCardsTargetDeck EffectFlag = 2 << 3 FlagModifyCardsTargetField EffectFlag = 3 << 3 FlagModifyCardsRequireMask EffectFlag = 3 << 5 FlagModifyCardsRequireNone EffectFlag = 0 << 5 FlagModifyCardsRequireSelf EffectFlag = 1 << 5 FlagModifyCardsRequireOpponent EffectFlag = 2 << 5 FlagModifyCardsResult EffectFlag = 1 << 7 FlagModifyCardsResult2 EffectFlag = 1 << 8 FlagModifyCardsNamedGroup EffectFlag = 1 << 9 FlagModifyCardCostInfinity EffectFlag = 1 << 0 FlagDrawCardOpponent EffectFlag = 1 << 0 FlagDrawCardIgnoreMax EffectFlag = 1 << 1 FlagDrawCardUseFilter EffectFlag = 1 << 2 FlagModifyGameRuleRelative EffectFlag = 1 << 0 FlagModifyGameRulePlayerMask EffectFlag = 3 << 1 FlagModifyGameRulePlayerSelf EffectFlag = 0 << 1 FlagModifyGameRulePlayerOpponent EffectFlag = 1 << 1 FlagModifyGameRulePlayerBoth EffectFlag = 2 << 1 FlagDelaySetupOpponent EffectFlag = 1 << 0 FlagDelaySetupDelete EffectFlag = 1 << 1 FlagCondCardOpponent EffectFlag = 1 << 0 FlagCondCardTypeMask EffectFlag = 3 << 1 FlagCondCardTypeGreaterEqual EffectFlag = 0 << 1 FlagCondCardTypeLessThan EffectFlag = 1 << 1 FlagCondCardTypeEach EffectFlag = 2 << 1 FlagCondCardAllowNumb EffectFlag = 1 << 3 FlagCondCardLocationMask EffectFlag = 3 << 4 FlagCondCardLocationField EffectFlag = 0 << 4 FlagCondCardLocationHand EffectFlag = 1 << 4 FlagCondCardLocationDeck EffectFlag = 2 << 4 FlagCondLimitGreaterThan EffectFlag = 1 << 0 FlagCondWinnerTypeMask EffectFlag = 7 << 0 FlagCondWinnerTypeWinner EffectFlag = 0 << 0 FlagCondWinnerTypeLoser EffectFlag = 1 << 0 FlagCondWinnerTypeTie EffectFlag = 2 << 0 FlagCondWinnerTypeNotTie EffectFlag = 3 << 0 FlagCondWinnerTypeNotWinner EffectFlag = 4 << 0 FlagCondWinnerTypeNotLoser EffectFlag = 5 << 0 FlagCondApplyNextRound EffectFlag = 1 << 0 FlagCondApplyOpponent EffectFlag = 1 << 1 FlagCondApplyShowMask EffectFlag = 3 << 2 FlagCondApplyShowJustEffect EffectFlag = 0 << 2 FlagCondApplyShowOriginalText EffectFlag = 1 << 2 FlagCondApplyShowNothing EffectFlag = 2 << 2 FlagCondCoinTails EffectFlag = 1 << 0 FlagCondCoinNegative EffectFlag = 1 << 1 FlagCondCoinStat EffectFlag = 1 << 2 FlagCondCoinWeighted EffectFlag = 1 << 3 FlagCondStatOpponent EffectFlag = 1 << 0 FlagCondStatLessThan EffectFlag = 1 << 1 FlagCondStatTypeMask EffectFlag = 3 << 2 FlagCondStatTypeATK EffectFlag = 0 << 2 FlagCondStatTypeDEF EffectFlag = 1 << 2 FlagCondStatTypeHP EffectFlag = 2 << 2 FlagCondStatTypeTP EffectFlag = 3 << 2 FlagCondStatMultiple EffectFlag = 1 << 4 FlagCondStatMathMask EffectFlag = 3 << 5 FlagCondStatMathNone EffectFlag = 0 << 5 FlagCondStatMathAdd EffectFlag = 1 << 5 FlagCondStatMathSubtract EffectFlag = 2 << 5 FlagCondStatMathOpponent EffectFlag = 1 << 7 FlagCondStatMathTypeMask EffectFlag = 3 << 8 FlagCondStatMathTypeATK EffectFlag = 0 << 8 FlagCondStatMathTypeDEF EffectFlag = 1 << 8 FlagCondStatMathTypeHP EffectFlag = 2 << 8 FlagCondStatMathTypeTP EffectFlag = 3 << 8 FlagCondInHandHide EffectFlag = 1 << 0 FlagCondInHandOnPlayMask EffectFlag = 3 << 1 FlagCondInHandOnPlayNone EffectFlag = 0 << 1 FlagCondInHandOnPlayAlso EffectFlag = 1 << 1 FlagCondInHandOnPlayOnly EffectFlag = 2 << 1 )
Constants for EffectFlag.
type EffectType ¶
type EffectType uint8
EffectType is an enumeration of effect types.
const ( FlavorText EffectType = 0 EffectStat EffectType = 1 EffectEmpower EffectType = 2 EffectSummon EffectType = 3 EffectHeal EffectType = 4 EffectTP EffectType = 5 EffectNumb EffectType = 6 EffectRawStat EffectType = 7 EffectMultiplyHealing EffectType = 8 EffectPreventNumb EffectType = 9 EffectModifyAvailableCards EffectType = 10 EffectModifyCardCost EffectType = 11 EffectDrawCard EffectType = 12 EffectModifyGameRule EffectType = 13 EffectDelaySetup EffectType = 14 CondCard EffectType = 128 CondLimit EffectType = 129 CondWinner EffectType = 130 CondApply EffectType = 131 CondCoin EffectType = 132 CondStat EffectType = 133 CondInHand EffectType = 134 CondLastEffect EffectType = 135 CondOnNumb EffectType = 136 CondMultipleEffects EffectType = 137 )
Constants for EffectType.
func (EffectType) IsCondition ¶ added in v0.3.3
func (et EffectType) IsCondition() bool
func (EffectType) IsPassive ¶ added in v0.3.3
func (et EffectType) IsPassive() bool
func (EffectType) IsRoot ¶ added in v0.3.3
func (et EffectType) IsRoot() bool
func (EffectType) String ¶
func (i EffectType) String() string
type Extension ¶ added in v0.2.72
type Extension struct { Type ExtensionType Flags uint64 CID ContentIdentifier LoopStart float32 LoopEnd float32 // contains filtered or unexported fields }
Extension is an extension field that allows cards to have meta-game effects.
type ExtensionType ¶ added in v0.2.72
type ExtensionType uint64
ExtensionType is an extension field type.
const ( ExtensionSetStage ExtensionType = 0 ExtensionSetMusic ExtensionType = 1 )
Constants for ExtensionType.
func (ExtensionType) String ¶ added in v0.2.72
func (i ExtensionType) String() string
type ExternalMode ¶ added in v0.2.75
ExternalMode is a Spy Cards Online game mode as returned by the server.
type Field ¶
type Field interface { Type() FieldType Marshal(w *format.Writer) error Unmarshal(r *format.Reader, formatVersion uint64) error UpdateID(oldID, newID ID) }
Field is an interface implemented by all custom game mode fields.
type FieldType ¶
type FieldType uint64
FieldType is an enumeration of Spy Cards Online game mode field types.
const ( FieldMetadata FieldType = 0 FieldBannedCards FieldType = 1 FieldGameRules FieldType = 2 FieldSummonCard FieldType = 3 FieldVariant FieldType = 4 FieldUnfilterCard FieldType = 5 FieldDeckLimitFilter FieldType = 6 FieldTimer FieldType = 7 FieldTurn0Effect FieldType = 8 FieldVanillaVersion FieldType = 9 FieldGroup FieldType = 10 FieldSpecialFlags FieldType = 11 )
Constants for FieldType.
type Filter ¶ added in v0.2.72
type Filter []FilterComponent
Filter is a card filter, introduced in card format 5.
func (Filter) IsMatch ¶ added in v0.3.4
IsMatch returns true if the specified card matches this filter.
func (Filter) IsSingleCard ¶ added in v0.2.72
IsSingleCard returns true if this filter is a single card filter.
type FilterComponent ¶ added in v0.2.72
type FilterComponent struct { Type FilterType Rank Rank Tribe Tribe CustomTribe string CardID ID TP int64 }
FilterComponent is a single component of a card filter.
func (FilterComponent) String ¶ added in v0.3.14
func (fc FilterComponent) String() string
type FilterType ¶ added in v0.2.72
type FilterType uint8
FilterType is a type of card filter.
const ( FilterSingleCard FilterType = 1 FilterTribe FilterType = 16 FilterNotTribe FilterType = 32 FilterRank FilterType = 48 FilterTP FilterType = 64 )
Constants for FilterType.
func (FilterType) String ¶ added in v0.2.72
func (i FilterType) String() string
type GameMode ¶
GameMode is a custom Spy Cards Online game mode.
func (*GameMode) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*GameMode) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*GameMode) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*GameMode) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type GameRules ¶
type GameRules struct { MaxHP uint64 HandMinSize uint64 HandMaxSize uint64 DrawPerTurn uint64 CardsPerDeck uint64 MinTP uint64 MaxTP uint64 TPPerTurn uint64 BossCards uint64 MiniBossCards uint64 DuplicateBoss uint64 DuplicateMiniBoss uint64 DuplicateEffect uint64 DuplicateAttacker uint64 }
GameRules is a custom game mode field holding modified Spy Cards rules.
type Group ¶ added in v0.3.7
type Group struct { Flags GroupFlags Title string Cards []ID }
type GroupFlags ¶ added in v0.3.7
type GroupFlags uint64
type ID ¶
type ID uint64
ID is a numeric identifier for a Spy Cards card.
IDs below 128 correspond to the card's internal enemy ID in Bug Fables.
IDs 128 and above are custom Attacker, Effect, Mini-Boss, and Boss cards, in repeating groups of 32 IDs.
const ( Zombiant ID = 0 Jellyshroom ID = 1 Spider ID = 2 Zasp ID = 3 Cactiling ID = 4 Psicorp ID = 5 Thief ID = 6 Bandit ID = 7 Inichas ID = 8 Seedling ID = 9 Numbnail ID = 14 Mothiva ID = 15 Acornling ID = 16 Weevil ID = 17 VenusBud ID = 19 Chomper ID = 20 AcolyteAria ID = 21 Kabbu ID = 23 VenusGuardian ID = 24 WaspTrooper ID = 25 WaspBomber ID = 26 WaspDriller ID = 27 WaspScout ID = 28 Midge ID = 29 Underling ID = 30 MonsieurScarlet ID = 31 GoldenSeedling ID = 32 ArrowWorm ID = 33 Carmina ID = 34 SeedlingKing ID = 35 Broodmother ID = 36 Plumpling ID = 37 Flowerling ID = 38 Burglar ID = 39 Astotheles ID = 40 MotherChomper ID = 41 Ahoneynation ID = 42 BeeBoop ID = 43 SecurityTurret ID = 44 Denmuki ID = 45 HeavyDroneB33 ID = 46 Mender ID = 47 Abomihoney ID = 48 DuneScorpion ID = 49 TidalWyrm ID = 50 Kali ID = 51 Zombee ID = 52 Zombeetle ID = 53 TheWatcher ID = 54 PeacockSpider ID = 55 Bloatshroom ID = 56 Krawler ID = 57 HauntedCloth ID = 58 Warden ID = 61 JumpingSpider ID = 63 MimicSpider ID = 64 LeafbugNinja ID = 65 LeafbugArcher ID = 66 LeafbugClubber ID = 67 Madesphy ID = 68 TheBeast ID = 69 ChomperBrute ID = 70 Mantidfly ID = 71 GeneralUltimax ID = 72 WildChomper ID = 73 Cross ID = 74 Poi ID = 75 PrimalWeevil ID = 76 FalseMonarch ID = 77 Mothfly ID = 78 MothflyCluster ID = 79 Ironnail ID = 80 Belostoss ID = 81 Ruffian ID = 82 WaterStrider ID = 83 DivingSpider ID = 84 Cenn ID = 85 Pisci ID = 86 DeadLanderα ID = 87 DeadLanderβ ID = 88 DeadLanderγ ID = 89 WaspKing ID = 90 TheEverlastingKing ID = 91 Maki ID = 92 Kina ID = 93 Yin ID = 94 UltimaxTank ID = 95 Zommoth ID = 96 Riz ID = 97 Devourer ID = 98 Stratos ID = 111 Delilah ID = 112 )
Constants for ID.
func VanillaOrder ¶ added in v0.2.78
VanillaOrder returns the order of default cards for a specified back design.
func (ID) BasicIndex ¶
BasicIndex returns the index of the card in the list of vanilla cards with its back (boss, mini-boss, or enemy).
type Metadata ¶
type Metadata struct { Title string Author string Description string LatestChanges string Portrait uint8 CustomPortrait []byte }
Metadata is a custom game mode field holding human-readable descriptions of the game mode.
type ModifiedCardPosition ¶ added in v0.2.77
ModifiedCardPosition is a card modified by the Modify Available Cards effect.
type Number ¶ added in v0.3.10
Number is an integer that may be infinite or invalid.
func Num ¶ added in v0.3.10
Num is a convenience function that returns a Number representing the specified amount.
type Rank ¶
type Rank uint8
Rank is an enumeration of card types.
const ( Attacker Rank = 0 Effect Rank = 1 MiniBoss Rank = 2 // Mini-Boss Boss Rank = 3 Token Rank = 4 Enemy Rank = 5 RankNone Rank = 7 // None )
Constants for Rank.
type Recording ¶
type Recording struct { FormatVersion uint64 Version [3]uint64 ModeName string Perspective uint8 // 0 = none, n = Player n Cosmetic [2]CosmeticData RematchCount uint64 WonMatches uint64 Start time.Time SpoilerGuard [2]*[32]byte PrivateSeed [2][4]byte CustomCards Set CustomCardsRaw string InitialDeck [2]Deck Rounds []RecordingRound }
Recording is a recording of a Spy Cards Online match.
func FetchRecording ¶ added in v0.2.75
FetchRecording downloads and decodes a recording from the server, or decodes a base64-encoded recording, depending on the length of the code.
func (*Recording) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*Recording) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Recording) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*Recording) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type RecordingRound ¶
RecordingRound is data for one round of Spy Cards Online.
type RichDescription ¶
type RichDescription struct { Effect *EffectDef Text string Content []*RichDescription // Color overrides the parent's color if it is non-zero. Color sprites.Color }
RichDescription is a segment of a Spy Cards card description.
func (*RichDescription) String ¶
func (d *RichDescription) String() string
String implements fmt.Stringer.
func (*RichDescription) Typeset ¶ added in v0.2.73
func (d *RichDescription) Typeset(font sprites.FontID, x, y, z, sx, sy, spaceX, spaceY float32, effect *EffectDef, center bool, render func(x, y, z, sx, sy float32, text string, tint sprites.Color, isEffect bool))
Typeset arranges the text in an area for rendering.
type Set ¶
type Set struct { External string Mode *GameMode Spoiler []*BannedCards Variant int Cards []*Def SpoilerGuard [2]*[32]byte PortraitSheet *gfx.AssetTexture PortraitIndex map[string]int AppliedPR bool RandomByBackOrder bool FastAnimation bool // contains filtered or unexported fields }
Set is a set of custom cards.
func (*Set) BuildPortraitIndex ¶ added in v0.3.10
func (cs *Set) BuildPortraitIndex()
func (*Set) ByBack ¶ added in v0.2.75
ByBack returns the cards in this Set with the specified back design that are available for deck building.
func (*Set) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Set) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
func (*Set) VanillaVersion ¶ added in v0.3.1
func (cs *Set) VanillaVersion() BugFablesVersion
VanillaVersion returns the Bug Fables version used for vanilla cards.
type Sets ¶
type Sets []Set
Sets is a combination of sets of cards.
func (Sets) Apply ¶
Apply creates a Set that is the combination of cards in these sets, replacing IDs to ensure they don't overlap.
func (Sets) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Sets) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type SpecialFlag ¶ added in v0.3.10
type SpecialFlag uint64
const ( SpecialSubtractInf SpecialFlag // Allow Subtracting Infinities SpecialEffectBack // Use Effect Card Back SpecialNoDamageOnWin // No Damage on Win SpecialRevealSelection // Reveal Card Selection SpecialBothPlayersAreP1 // Both Players are Player 1 SpecialFlagCount // (not a special flag; denotes end of special flags) )
Values for SpecialFlag.
func (SpecialFlag) String ¶ added in v0.3.10
func (i SpecialFlag) String() string
type SpecialFlags ¶ added in v0.3.10
type SpecialFlags struct { Flags SpecialFlagsFlags Set map[SpecialFlag]bool }
func (*SpecialFlags) Marshal ¶ added in v0.3.10
func (f *SpecialFlags) Marshal(w *format.Writer) error
func (*SpecialFlags) Type ¶ added in v0.3.10
func (f *SpecialFlags) Type() FieldType
func (*SpecialFlags) Unmarshal ¶ added in v0.3.10
func (f *SpecialFlags) Unmarshal(r *format.Reader, formatVersion uint64) error
func (*SpecialFlags) UpdateID ¶ added in v0.3.10
func (f *SpecialFlags) UpdateID(oldID, newID ID)
type SpecialFlagsFlags ¶ added in v0.3.10
type SpecialFlagsFlags uint64
type SummonCard ¶
type SummonCard struct { Flags SummonCardFlags ID ID }
SummonCard is a custom game mode field that summons a card at the start of the match.
func (*SummonCard) Marshal ¶
func (f *SummonCard) Marshal(w *format.Writer) error
Marshal implements Field.
func (*SummonCard) Unmarshal ¶
func (f *SummonCard) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*SummonCard) UpdateID ¶ added in v0.2.68
func (f *SummonCard) UpdateID(oldID, newID ID)
UpdateID implements Field.
type SummonCardFlags ¶
type SummonCardFlags uint64
SummonCardFlags is a bitfield of flags for SummonCards.
const (
SummonCardBothPlayers SummonCardFlags = 1 << 0
)
Constants for SummonCardFlags.
type Timer ¶ added in v0.2.72
Timer limits the amount of time players may spend per turn.
type Tribe ¶
type Tribe uint8
Tribe is a 4-bit identifier for a Bug Fables Spy Cards tribe.
const ( TribeSeedling Tribe = 0 // Seedling TribeWasp Tribe = 1 // Wasp TribeFungi Tribe = 2 // Fungi TribeZombie Tribe = 3 // Zombie TribePlant Tribe = 4 // Plant TribeBug Tribe = 5 // Bug TribeBot Tribe = 6 // Bot TribeThug Tribe = 7 // Thug TribeUnknown Tribe = 8 // ??? TribeChomper Tribe = 9 // Chomper TribeLeafbug Tribe = 10 // Leafbug TribeDeadLander Tribe = 11 // Dead Lander TribeMothfly Tribe = 12 // Mothfly TribeSpider Tribe = 13 // Spider TribeCustom Tribe = 14 // (custom) TribeNone Tribe = 15 // (none) TribeWideCustom Tribe = 16 // (wide tribe for UI) )
Constants for Tribe.
type TribeDef ¶
TribeDef represents a built-in or custom tribe.
type Turn0Effect ¶ added in v0.2.76
Turn0Effect applies an effect before the first round of play.
func (*Turn0Effect) Marshal ¶ added in v0.2.76
func (f *Turn0Effect) Marshal(w *format.Writer) error
Marshal implements Field.
func (*Turn0Effect) Type ¶ added in v0.2.76
func (f *Turn0Effect) Type() FieldType
Type implements Field.
func (*Turn0Effect) Unmarshal ¶ added in v0.2.76
func (f *Turn0Effect) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*Turn0Effect) UpdateID ¶ added in v0.2.76
func (f *Turn0Effect) UpdateID(oldID, newID ID)
UpdateID implements Field.
type TurnData ¶ added in v0.2.75
type TurnData struct { Ready [2]uint64 Played [2][]ID InHand [2]uint64 HandID [2][]ID Modified [2][][]ModifiedCardPosition }
TurnData is the data stored for one round of Spy Cards Online to allow verification.
type UnfilterCard ¶
type UnfilterCard struct { Flags UnfilterCardFlags ID ID }
UnfilterCard is a custom game mode field that summons a card at the start of the match.
func (*UnfilterCard) Marshal ¶
func (f *UnfilterCard) Marshal(w *format.Writer) error
Marshal implements Field.
func (*UnfilterCard) Unmarshal ¶
func (f *UnfilterCard) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*UnfilterCard) UpdateID ¶ added in v0.2.68
func (f *UnfilterCard) UpdateID(oldID, newID ID)
UpdateID implements Field.
type UnfilterCardFlags ¶
type UnfilterCardFlags uint64
UnfilterCardFlags is a bitfield of flags for UnfilterCards.
type UnknownDeck ¶
type UnknownDeck []Rank
UnknownDeck is a Deck that only knows the backs of the cards within it.
func (UnknownDeck) MarshalBinary ¶
func (ud UnknownDeck) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
func (*UnknownDeck) UnmarshalBinary ¶
func (ud *UnknownDeck) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type VanillaVersion ¶ added in v0.3.1
type VanillaVersion struct {
Version BugFablesVersion
}
VanillaVersion overrides the vanilla Spy Cards card set.
func (*VanillaVersion) Marshal ¶ added in v0.3.1
func (f *VanillaVersion) Marshal(w *format.Writer) error
Marshal implements Field.
func (*VanillaVersion) Type ¶ added in v0.3.1
func (f *VanillaVersion) Type() FieldType
Type implements Field.
func (*VanillaVersion) Unmarshal ¶ added in v0.3.1
func (f *VanillaVersion) Unmarshal(r *format.Reader, formatVersion uint64) (err error)
Unmarshal implements Field.
func (*VanillaVersion) UpdateID ¶ added in v0.3.1
func (f *VanillaVersion) UpdateID(oldID, newID ID)
UpdateID implements Field.
type Variant ¶
Variant is a custom game mode field representing a sub-mode.
Variants can be selected when starting a match, and append their rules to the game mode's set of fields.
If at least one Variant is present, one variant is always applied.
Source Files ¶
- basic.go
- bugfablesversion_string.go
- card-compat-1.go
- card-compat-4.go
- card.go
- deck.go
- description.go
- effect-compat-1.go
- effect-compat-4.go
- effect.go
- effectflag.go
- effecttype_string.go
- extension.go
- extensiontype_string.go
- field.go
- fieldtype_string.go
- filter.go
- filtertype_string.go
- html.go
- id.go
- mode.go
- number.go
- rank.go
- rank_string.go
- recording.go
- set.go
- specialflag_string.go
- tribe.go
- tribe_string.go
- vanilla.go