Documentation ¶
Index ¶
- Constants
- func ClassificationStrings() []string
- func InjuryTypeStrings() []string
- func NewTimingRealiser(m map[TimingPoint]time.Duration) func(Timing) time.Duration
- func OperatorStrings() []string
- type Classification
- type CostType
- type DamageEffect
- type DefileEffect
- type Description
- type Effect
- type HealEffect
- type ID
- type InjuryEffect
- type InjuryType
- type Map
- type Operation
- type Operations
- type Operator
- type ReviveEffect
- type SpawnParticipantEffect
- type Timing
- type TimingPoint
Constants ¶
const ( BasicMovement = "static-movement" UseConsumable = "use-consumable" FleeFromCombat = "flee-from-combat" EndTurn = "end-turn" )
Some skills should be staticly compiled into the executable, so that they can have special logic. They're not really part of game data.
Variables ¶
This section is empty.
Functions ¶
func ClassificationStrings ¶
func ClassificationStrings() []string
ClassificationStrings returns a slice of all String values of the enum
func InjuryTypeStrings ¶
func InjuryTypeStrings() []string
InjuryTypeStrings returns a slice of all String values of the enum
func NewTimingRealiser ¶
NewTimingRealiser creates a function to realise when to trigger an effect.
func OperatorStrings ¶
func OperatorStrings() []string
OperatorStrings returns a slice of all String values of the enum
Types ¶
type Classification ¶
type Classification int
const ( Skill Classification = iota Attack Spell Attunement )
func ClassificationString ¶
func ClassificationString(s string) (Classification, error)
ClassificationString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ClassificationValues ¶
func ClassificationValues() []Classification
ClassificationValues returns all values of the enum
func (Classification) IsAClassification ¶
func (i Classification) IsAClassification() bool
IsAClassification returns "true" if the value is listed in the enum definition. "false" otherwise
func (Classification) MarshalJSON ¶
func (i Classification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for Classification
func (Classification) String ¶
func (i Classification) String() string
func (*Classification) UnmarshalJSON ¶
func (i *Classification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for Classification
type CostType ¶
type CostType int
CostType defines what resources a skill costs to use. A skill might cost Action Points, Mana, etc, or some combination of costs.
func CostTypeFromString ¶
type DamageEffect ¶
type DamageEffect struct { Min Operations // "0.5 * attunement * 0.22 * INT" Max Operations // "10 + 5 * attunement * 0.17 * INT" Classification Classification // Spell or Attack: can it be negated or dodged? DamageType game.DamageType }
DamageEffect deals damage.
type DefileEffect ¶
type DefileEffect struct{}
DefileEffect changes the target's state from KnockedDown to Defiled.
type Description ¶
type Description struct { ID ID Name string Explanation string // Tags critically includes Attack or Spell, and allows the game to select // an appropriate animation to use when using the skill. Tags []Classification Icon game.FrameAnimation Targeting targeting.Rule // Effects of triggering this skill. Effects []Effect Costs map[CostType]int // AttackChanceToHitModifier multiplies the base chance to hit of the skill. // A value of zero does not modify the chance to hit. A value of 0.1 // improves the chance to hit by 10%. A value of -0.5 halves the chance to // hit. AttackChanceToHitModifier float64 }
Description contains all the data for a skill so that it can be displayed in menus or utilised in combat.
func (Description) IsAttack ¶
func (d Description) IsAttack() bool
IsAttack returns whether a skill is an attack or not.
type Effect ¶
type Effect struct { When Timing What []interface{} }
Effect is anything that executing a skill could trigger.
type HealEffect ¶
HealEffect heals the target. By default the amount is treated as a value to increment the current health by, but if IsPercentage is true, then the current health is incremented by the maximum health multiplied by Amount.
type InjuryEffect ¶
type InjuryEffect struct { Type InjuryType Value int }
InjuryEffect applies an injury to the target.
type InjuryType ¶
type InjuryType int
InjuryType enumerates injuries.
const (
BleedingInjury InjuryType = iota
)
func InjuryTypeFromString ¶
func InjuryTypeFromString(s string) *InjuryType
func InjuryTypeString ¶
func InjuryTypeString(s string) (InjuryType, error)
InjuryTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func InjuryTypeValues ¶
func InjuryTypeValues() []InjuryType
InjuryTypeValues returns all values of the enum
func (InjuryType) IsAInjuryType ¶
func (i InjuryType) IsAInjuryType() bool
IsAInjuryType returns "true" if the value is listed in the enum definition. "false" otherwise
func (InjuryType) MarshalJSON ¶
func (i InjuryType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for InjuryType
func (InjuryType) String ¶
func (i InjuryType) String() string
func (*InjuryType) UnmarshalJSON ¶
func (i *InjuryType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for InjuryType
type Operations ¶
type Operations []Operation
type Operator ¶
type Operator int
func OperatorString ¶
OperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func OperatorValues ¶
func OperatorValues() []Operator
OperatorValues returns all values of the enum
func (Operator) IsAOperator ¶
IsAOperator returns "true" if the value is listed in the enum definition. "false" otherwise
func (Operator) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Operator
func (*Operator) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Operator
type ReviveEffect ¶
type ReviveEffect struct{}
ReviveEffect changes the status from KnockedDown to Alive, and sets the target's current health to 1. Does nothing if the target is not KnockedDown.
type SpawnParticipantEffect ¶
type SpawnParticipantEffect struct { Profession string Level Operations }
SpawnParticipantEffect spawns a new participant.
type Timing ¶
type Timing struct {
// contains filtered or unexported fields
}
Timing represents when a skill effect should be triggered. It allows both concrete time.Duration values that specify the amount of time after skill execution starts, and virtualised "points" in the skill execution like "end" or "when the blow lands".
func NewTiming ¶
NewTiming constructs a Timing for an effect that should be triggered the specified Duration after the skill execution starts.
func NewTimingFromPoint ¶
func NewTimingFromPoint(point TimingPoint) Timing
NewTimingFromPoint constructs a Timing from a TimingPoint.
type TimingPoint ¶
type TimingPoint int
const ( // AttackApexTimingPoint applies to spells too! AttackApexTimingPoint TimingPoint = iota EndTimingPoint )
func TimingPointFromString ¶
func TimingPointFromString(s string) *TimingPoint
func (TimingPoint) String ¶
func (i TimingPoint) String() string