Documentation
¶
Index ¶
- Constants
- func GetAllBuffIds() []int
- func GetDurations(buff *Buff, spec *BuffSpec) (roundsLeft int, totalRounds int)
- func LoadDataFiles()
- func SearchBuffs(searchTerm string) []int
- type Buff
- type BuffMessage
- type BuffMessages
- type BuffSpec
- func (b *BuffSpec) Filename() string
- func (b *BuffSpec) Filepath() string
- func (b *BuffSpec) GetScript() string
- func (b *BuffSpec) GetScriptPath() string
- func (b *BuffSpec) GetValue() int
- func (b *BuffSpec) Id() int
- func (b *BuffSpec) Validate() error
- func (b *BuffSpec) VisibleNameDesc() (name, description string)
- type Buffs
- func (bs *Buffs) AddBuff(buffId int, isPermanent bool) bool
- func (bs *Buffs) GetBuffIdsWithFlag(action Flag) []int
- func (bs *Buffs) GetBuffs(buffId ...int) []*Buff
- func (bs *Buffs) HasBuff(buffId int) bool
- func (bs *Buffs) HasFlag(action Flag, expire bool) bool
- func (bs *Buffs) Prune() (prunedBuffs []*Buff)
- func (bs *Buffs) RemoveBuff(buffId int) bool
- func (bs *Buffs) Started(buffId int)
- func (bs *Buffs) StatMod(statName string) int
- func (bs *Buffs) Trigger(buffId ...int) (triggeredBuffs []*Buff)
- func (bs *Buffs) TriggersLeft(buffId int) int
- func (bs *Buffs) Validate(forceRebuild ...bool)
- type Flag
Constants ¶
View Source
const ( TriggersLeftExpired = 0 // When it hits this number it will be pruned ASAP TriggersLeftUnlimited = 1000000000 )
Variables ¶
This section is empty.
Functions ¶
func GetAllBuffIds ¶
func GetAllBuffIds() []int
func SearchBuffs ¶
Searches for buffs whose name contains text and returns their Ids
Types ¶
type Buff ¶
type Buff struct {
BuffId int // Which buff template does it refer to?
Source string `yaml:"source,omitempty"` // Optional source identifier for where this buff originated. Example: spell, item, area
OnStartWaiting bool `yaml:"onstartwaiting,omitempty"` // Is the onstart event waiting to trigger?
PermaBuff bool `yaml:"permabuff,omitempty"` // Is this buff from a worn item or race?
// Need to instance track the following:
RoundCounter int `yaml:"roundcounter,omitempty"` // How many rounds have passed. Triggers on (RoundCounter%RoundInterval == 0)
TriggersLeft int `yaml:"triggersleft,omitempty"` // How many times it triggers
}
type BuffMessage ¶
type BuffMessages ¶
type BuffMessages struct {
Start BuffMessage
Effect BuffMessage
End BuffMessage
}
type BuffSpec ¶
type BuffSpec struct {
BuffId int // Unique identifier for this buff spec
Name string // The name of the buff
Description string // A description of the buff
Secret bool // Whether or not the buff is secret (not displayed to the user)
TriggerNow bool `yaml:"triggernow,omitempty"` // if true, buff triggers once right when it is applied
TriggerRate string `yaml:"triggerrate,omitempty"` // How often should it trigger? (time string)
RoundInterval int `yaml:"roundinterval,omitempty"` // triggers every x rounds
TriggerCount int `yaml:"triggercount,omitempty"` // How many times it triggers before it is removed
StatMods statmods.StatMods `yaml:"statmods,omitempty"` // stat mods for the duration of the buff
Flags []Flag `yaml:"flags,omitempty"` // A list of actions and such that this buff prevents or enables
}
func GetBuffSpec ¶
func (*BuffSpec) GetScriptPath ¶
func (*BuffSpec) VisibleNameDesc ¶
type Buffs ¶
type Buffs struct {
List []*Buff
// contains filtered or unexported fields
}
A list of applied buffs
func (*Buffs) GetBuffIdsWithFlag ¶
func (*Buffs) RemoveBuff ¶
func (*Buffs) TriggersLeft ¶
type Flag ¶
type Flag string
const ( // // All Flags must be lowercase // All Flag = `` // Behavioral flags NoCombat Flag = `no-combat` NoMovement Flag = `no-go` NoFlee Flag = `no-flee` CancelIfCombat Flag = `cancel-on-combat` CancelOnAction Flag = `cancel-on-action` CancelOnWater Flag = `cancel-on-water` // Death preventing ReviveOnDeath Flag = `revive-on-death` // Gear related PermaGear Flag = `perma-gear` RemoveCurse Flag = `remove-curse` // Harmful flags Poison Flag = `poison` Drunk Flag = `drunk` // Useful flags Hidden Flag = `hidden` Accuracy Flag = `accuracy` Blink Flag = `blink` EmitsLight Flag = `lightsource` SuperHearing Flag = `superhearing` NightVision Flag = `nightvision` Warmed Flag = `warmed` Hydrated Flag = `hydrated` Thirsty Flag = `thirsty` // Flags that reveal things SeeHidden Flag = `see-hidden` SeeNouns Flag = `see-nouns` )
Click to show internal directories.
Click to hide internal directories.