Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 source pure

Package cards holds the static definition of the 12 action cards, each with a front and a back side (24 actions), as ...

Overview

Package cards holds the static definition of the 12 action cards, each with a front and a back side (24 actions), as printed in the 1982 game.

Constants 4

const Advance, BackUp, Run, SpinAround, Sprint, Turn, LeapDrop, CockAimShoot, GetUpDown, Throw, Shoot, Strength, Load, HeadOutBack, DrawAndCock, Jab, Duck, Swing, Block, Belt, Guard

 1const (
 2	Advance      Code = "advance"
 3	BackUp       Code = "back_up"
 4	Run          Code = "run"
 5	SpinAround   Code = "spin_around"
 6	Sprint       Code = "sprint"
 7	Turn         Code = "turn"
 8	LeapDrop     Code = "leap_drop"
 9	CockAimShoot Code = "cock_aim_shoot"
10	GetUpDown    Code = "get_up_down"
11	Throw        Code = "throw"
12	Shoot        Code = "shoot"
13	Strength     Code = "strength"
14	Load         Code = "load"
15	HeadOutBack  Code = "head_out_back"
16	DrawAndCock  Code = "draw_and_cock"
17	Jab          Code = "jab"
18	Duck         Code = "duck"
19	Swing        Code = "swing"
20	Block        Code = "block"
21	Belt         Code = "belt"
22	Guard        Code = "guard"
23)
source

Variables 1

var Cards

 1var Cards = [12]Card{
 2	{1, Side{Advance, "Advance", KindFoot, 2, ChoiceMoveAhead}, Side{BackUp, "Back Up", KindFoot, 3, ChoiceMoveBack}},
 3	{2, Side{Run, "Run", KindFoot, 1, ChoiceMoveAhead}, Side{SpinAround, "Spin Around", KindFoot, 2, ChoiceTurnBack}},
 4	{3, Side{Sprint, "Sprint", KindFoot, 1, ChoiceNone}, Side{Turn, "Turn", KindFoot, 1, ChoiceTurnAhead}},
 5	{4, Side{Sprint, "Sprint", KindFoot, 1, ChoiceNone}, Side{LeapDrop, "Leap/Drop", KindFoot, 1, ChoiceNone}},
 6	{5, Side{CockAimShoot, "Cock/Aim/Shoot", KindHand, 2, ChoiceTargetRanged}, Side{GetUpDown, "Get Up/Down", KindFoot, 3, ChoiceNone}},
 7	{6, Side{CockAimShoot, "Cock/Aim/Shoot", KindHand, 2, ChoiceTargetRanged}, Side{Throw, "Throw", KindHand, 2, ChoiceTargetRanged}},
 8	{7, Side{Shoot, "Shoot", KindHand, 1, ChoiceTargetRanged}, Side{Strength, "Strength", KindStrength, 2, ChoiceNone}},
 9	{8, Side{Load, "Load", KindHand, 3, ChoiceNone}, Side{HeadOutBack, "Head Out/Back", KindFoot, 2, ChoiceNone}},
10	{9, Side{DrawAndCock, "Draw & Cock", KindHand, 3, ChoiceGun}, Side{HeadOutBack, "Head Out/Back", KindFoot, 2, ChoiceNone}},
11	{10, Side{Jab, "Jab", KindAttack, 2, ChoiceTargetMelee}, Side{Duck, "Duck", KindDefense, 1, ChoiceTargetDefend}},
12	{11, Side{Swing, "Swing", KindAttack, 3, ChoiceTargetMelee}, Side{Block, "Block", KindDefense, 2, ChoiceTargetDefend}},
13	{12, Side{Belt, "Belt", KindAttack, 3, ChoiceTargetMelee}, Side{Guard, "Guard", KindDefense, 2, ChoiceTargetDefend}},
14}
source

Cards is the deck, indexed by Number-1.

Functions 5

func Enabled

1func Enabled(c Code) bool
source

Enabled reports whether the action is implemented by the engine: the foot actions, Draw & Cock, Cock/Aim/Shoot, Shoot, Load, Throw and Strength; brawling comes later.

func IsMove

1func IsMove(c Code) bool
source

IsMove reports whether the action moves the character to another hex.

func IsShooting

1func IsShooting(c Code) bool
source

IsShooting reports whether the action is played with a gun in hand: it takes a shoot option (cock, uncock, aim, shoot, nothing) and names the target (rules 11.3, 11.31).

func TakesTarget

1func TakesTarget(c Code) bool
source

TakesTarget reports whether the action may name a target, a hex or a character: the gun actions and Throw (11.31, 17.11).

func Lookup

1func Lookup(number int, side byte) (Side, bool)
source

Lookup returns the side of card number (1-12) selected by 'f' or 'b'.

Types 5

type Card

struct
1type Card struct {
2	Number int
3	Front  Side
4	Back   Side
5}
source

Card is one physical card; its two sides cannot both be played in a turn.

type Choice

ident
1type Choice int
source

Choice is what the player must decide when selecting a side.

Methods on Choice

func IsAheadRel

method on Choice
1func (c Choice) IsAheadRel() bool
source

IsAheadRel reports whether the choice is one of the three forward directions.

func IsBackRel

method on Choice
1func (c Choice) IsBackRel() bool
source

IsBackRel reports whether the choice is one of the three backward directions.

func NeedsGun

method on Choice
1func (c Choice) NeedsGun() bool
source

NeedsGun reports whether the choice is a gun slot.

func NeedsRel

method on Choice
1func (c Choice) NeedsRel() bool
source

NeedsRel reports whether the choice is a relative direction (move or turn).

type Code

ident
1type Code string
source

Code identifies the action printed on one side of a card.

type Kind

ident
1type Kind int
source

Kind is the card category (rule 5.2).

type Side

struct
1type Side struct {
2	Code   Code
3	Name   string
4	Kind   Kind
5	Cost   int // time points: the sequences the action takes
6	Choice Choice
7}
source

Side is one face of a card.

Dependencies

Imports 0

Imports nothing.

/p/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/cards/v0

Imported by indexer

Source Files 2