battle5

package
v0.0.0-...-8af4b65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTurn = 10 // 最大回合数为10

	SceneWidth  = 7 // 宽度
	SceneHeight = 3 // 高度
)
View Source
const (
	BuffEffectUnknow    = 0
	BuffEffectTaunt     = 1
	BuffEffectChgDamage = 2
)

Variables

View Source
var (
	// ErrInvalidFuncName - invalid func name
	ErrInvalidFuncName = errors.New("invalid func name")
	// ErrInvalidBuffID - invalid buffid
	ErrInvalidBuffID = errors.New("invalid buffid")
	// ErrInvalidFuncValsLength - invalid funcvals length
	ErrInvalidFuncValsLength = errors.New("invalid funcvals length")
	// ErrHeroIsNull - null hero
	ErrHeroIsNull = errors.New("null hero")
	// ErrDuplicateHero - duplicate hero
	ErrDuplicateHero = errors.New("duplicate hero")
	// ErrInvalidBuffEffectString - invalid Buff Effect string
	ErrInvalidBuffEffectString = errors.New("invalid Buff Effect string")
)
View Source
var MapPropTypeStr map[PropType]string

Functions

func Abs

func Abs[T int | int64](v T) T

func SimAllBattles

func SimAllBattles(fn string, totalval int, minpropval int) error

func SimBattle

func SimBattle(hero0 *Hero, hero1 *Hero) int

模拟战斗,就是基础的1打1; 返回1,hero0赢,-1,hero1赢,0平

Types

type Battle

type Battle struct {
	Scene *Scene

	Log *BattleLog

	CurTurn int
	// contains filtered or unexported fields
}

func NewBattle

func NewBattle(w, h int) *Battle

func NewBattleEx

func NewBattleEx(mgr *StaticMgr, team0 []HeroID, team1 []HeroID, w, h int) *Battle

func (*Battle) GenAliveHeroList

func (battle *Battle) GenAliveHeroList(onhero FuncEachHeroBool) *HeroList

func (*Battle) GenBuffInstanceID

func (battle *Battle) GenBuffInstanceID() BuffInstanceID

func (*Battle) GenCurHeroList

func (battle *Battle) GenCurHeroList() *HeroList

func (*Battle) GenHeroInstanceID

func (battle *Battle) GenHeroInstanceID() HeroInstanceID

func (*Battle) GetTeam

func (battle *Battle) GetTeam(index int) *Team

func (*Battle) NewBuff

func (battle *Battle) NewBuff(buffid BuffID, from *Hero, skill *Skill) (*Buff, error)

func (*Battle) SetTeam

func (battle *Battle) SetTeam(index int, lst []*HeroData, autoSetPos bool)

func (*Battle) StartBattle

func (battle *Battle) StartBattle()

type BattleActionFromData

type BattleActionFromData struct {
	Parent *BattleLogNode
	Hero   *Hero
	Skill  *Skill
}

func NewBattleActionFromData

func NewBattleActionFromData(parent *BattleLogNode, hero *Hero, skill *Skill) *BattleActionFromData

type BattleLog

type BattleLog struct {
	Root     *BattleLogNode `json:"root"`
	HashCode string         `json:"hashcode"`
	// contains filtered or unexported fields
}

func NewBattleLog

func NewBattleLog() *BattleLog

func (*BattleLog) BattleEnd

func (bl *BattleLog) BattleEnd(parent *BattleLogNode) *BattleLogNode

func (*BattleLog) BattleReady

func (bl *BattleLog) BattleReady(parent *BattleLogNode) *BattleLogNode

func (*BattleLog) EndTurn

func (bl *BattleLog) EndTurn(parent *BattleLogNode, turn int) *BattleLogNode

func (*BattleLog) FindSkillTarget

func (bl *BattleLog) FindSkillTarget(parent *BattleLogNode, src *Hero, target *Hero) *BattleLogNode

func (*BattleLog) FindTarget

func (bl *BattleLog) FindTarget(parent *BattleLogNode, src *Hero, target *Hero) *BattleLogNode

func (*BattleLog) GenNodeID

func (bl *BattleLog) GenNodeID() BattleLogNodeID

func (*BattleLog) HeroComeIn

func (bl *BattleLog) HeroComeIn(parent *BattleLogNode, hero *Hero) *BattleLogNode

func (*BattleLog) HeroMove

func (bl *BattleLog) HeroMove(parent *BattleLogNode, src *Hero, target *Pos) *BattleLogNode

func (*BattleLog) KillHero

func (bl *BattleLog) KillHero(parent *BattleLogNode, src *Hero, target *Hero, skill *Skill) *BattleLogNode

func (*BattleLog) SaveJson

func (bl *BattleLog) SaveJson(fn string) error

func (*BattleLog) SaveText

func (bl *BattleLog) SaveText(fn string) error

func (*BattleLog) SkillAttack

func (bl *BattleLog) SkillAttack(parent *BattleLogNode, src *Hero, target *Hero, skill *Skill, starthp int, endhp int) *BattleLogNode

func (*BattleLog) StartBattle

func (bl *BattleLog) StartBattle() *BattleLogNode

func (*BattleLog) StartTurn

func (bl *BattleLog) StartTurn(parent *BattleLogNode, turn int) *BattleLogNode

func (*BattleLog) UseSkill

func (bl *BattleLog) UseSkill(parent *BattleLogNode, src *Hero, skill *Skill) *BattleLogNode

type BattleLogNode

type BattleLogNode struct {
	NodeID            BattleLogNodeID   `json:"nodeid"`
	Type              BattleLogNodeType `json:"type"`
	Turn              int               `json:"turn,omitempty"` // turn从1开始,turnindex从0开始
	SrcTeam           int               `json:"srcteam,omitempty"`
	SrcHeroID         HeroID            `json:"srcheroid,omitempty"`
	SrcHeroInstanceID HeroInstanceID    `json:"srcheroinstanceid,omitempty"`
	SrcPos            *Pos              `json:"srcpos,omitempty"`

	TargetTeam           int            `json:"targetteam,omitempty"`
	TargetHeroID         HeroID         `json:"targetheroid,omitempty"`
	TargetHeroInstanceID HeroInstanceID `json:"targetheroinstanceid,omitempty"`
	TargetPos            *Pos           `json:"targetpos,omitempty"`

	Children      []*BattleLogNode `json:"children,omitempty"`
	Props         []PropType       `json:"props,omitempty"`
	OldPropVals   []int            `json:"oldpropvals,omitempty"`
	PropVals      []int            `json:"propvals,omitempty"`
	TargetSkillID SkillID          `json:"targetskillid,omitempty"`
	FromSkillID   SkillID          `json:"fromskillid,omitempty"`
	// contains filtered or unexported fields
}

func (*BattleLogNode) GenString

func (bln *BattleLogNode) GenString(tab string, tabnum int, ontext FuncOnText)

func (*BattleLogNode) SetFromSkill

func (bln *BattleLogNode) SetFromSkill(skill *Skill)

func (*BattleLogNode) SetSrc

func (bln *BattleLogNode) SetSrc(hero *Hero)

func (*BattleLogNode) SetTarget

func (bln *BattleLogNode) SetTarget(hero *Hero)

func (*BattleLogNode) SetTargetPos

func (bln *BattleLogNode) SetTargetPos(pos *Pos)

func (*BattleLogNode) SetTargetSkill

func (bln *BattleLogNode) SetTargetSkill(skill *Skill)

type BattleLogNodeID

type BattleLogNodeID int

type BattleLogNodeType

type BattleLogNodeType int
const (
	BLNTBattleStart     BattleLogNodeType = 1  // 战斗开始,根节点,不需要额外的数据
	BLNTHeroComeIn      BattleLogNodeType = 2  // 角色进场
	BLNTTurnStart       BattleLogNodeType = 3  // 回合开始
	BLNTTurnEnd         BattleLogNodeType = 4  // 回合结束
	BLNTHeroMove        BattleLogNodeType = 5  // 角色主动移动
	BLNTChgProp         BattleLogNodeType = 6  // 改变属性
	BLNTBattleReady     BattleLogNodeType = 7  // 战斗开始后的准备阶段,也不需要额外的数据,处理角色上场及角色特性技能、被动技能释放、装备等
	BLNTFindTarget      BattleLogNodeType = 8  // 寻找目标
	BLNTUseSkill        BattleLogNodeType = 9  // 开始放技能
	BLNTReadySkill      BattleLogNodeType = 10 // 准备放技能
	BLNTFindSkillTarget BattleLogNodeType = 11 // 寻找技能目标
	BLNTSkillAttack     BattleLogNodeType = 12 // 技能伤害
	BLNTKillHero        BattleLogNodeType = 13 // 击杀hero
	BLNTBattleEnd       BattleLogNodeType = 14 // 战斗结束
)

type Buff

type Buff struct {
	InstanceID BuffInstanceID
	Data       *BuffData
	From       *Hero
	FromSkill  *Skill
	// contains filtered or unexported fields
}

func (*Buff) IsMe

func (buff *Buff) IsMe(b *Buff) bool

type BuffData

type BuffData struct {
	ID           BuffID
	Name         string
	Effect       BuffEffect
	Triggers     []TriggerType
	Level        int
	Turns        int
	TriggerTimes int
	Cover        *FuncData
	Attach       *FuncData
	Trigger      *FuncData
	Find         *FuncData
	Remove       *FuncData
}

type BuffDataMgr

type BuffDataMgr struct {
	// contains filtered or unexported fields
}

func LoadBuffData

func LoadBuffData(fn string) (*BuffDataMgr, error)

func (*BuffDataMgr) GetBuffData

func (mgr *BuffDataMgr) GetBuffData(id BuffID) *BuffData

type BuffEffect

type BuffEffect int

func Str2BuffEffect

func Str2BuffEffect(str string) BuffEffect

type BuffID

type BuffID int

type BuffInstanceID

type BuffInstanceID int

type BuffList

type BuffList struct {
	Buffs []*Buff
}

func NewBuffList

func NewBuffList() *BuffList

func (*BuffList) Add

func (lst *BuffList) Add(buff *Buff)

func (*BuffList) RemoveAll

func (lst *BuffList) RemoveAll()

type BuffTriggerMap

type BuffTriggerMap struct {
	MapBuffs map[TriggerType]*BuffList
}

func NewBuffTriggerMap

func NewBuffTriggerMap() *BuffTriggerMap

func (*BuffTriggerMap) Add

func (btm *BuffTriggerMap) Add(trigger TriggerType, buff *Buff)

func (*BuffTriggerMap) AddEx

func (btm *BuffTriggerMap) AddEx(buff *Buff)

func (*BuffTriggerMap) OnTrigger

func (btm *BuffTriggerMap) OnTrigger(trigger TriggerType, params *LibFuncParams) (bool, error)

func (*BuffTriggerMap) RemoveAll

func (btm *BuffTriggerMap) RemoveAll()

type FuncData

type FuncData struct {
	FuncName  string   `json:"name,omitempty"`
	InVals    []int    `json:"vals,omitempty"`
	InStrVals []string `json:"strvals,omitempty"`
	Vals      []int    `json:"-"`
	StrVals   []string `json:"-"`
}

func BuildFuncData

func BuildFuncData(header []string, row []string, prefix string) (*FuncData, error)

type FuncEachHero

type FuncEachHero func(*Hero)

简单遍历hero list

type FuncEachHeroBool

type FuncEachHeroBool func(*Hero) bool

遍历hero list,返回bool

type FuncEachHeroSkill

type FuncEachHeroSkill func(*Hero, *Skill) bool

遍历hero skills,返回false会break

type FuncInitAllFuncs

type FuncInitAllFuncs func(*FuncMgr) error

type FuncIsLess

type FuncIsLess func(i, j int) bool

type FuncLib

type FuncLib struct {
	OnProc FuncLibProc
	OnInit FuncLibInit
}

type FuncLibInit

type FuncLibInit func(*FuncData) error

type FuncLibProc

type FuncLibProc func(*FuncData, *LibFuncParams) (bool, error)

type FuncMgr

type FuncMgr struct {
	MapFunc map[string]FuncLib
}

func NewFuncMgr

func NewFuncMgr() *FuncMgr

func (*FuncMgr) InitFuncData

func (mgr *FuncMgr) InitFuncData(fd *FuncData) error

func (*FuncMgr) RegFunc

func (mgr *FuncMgr) RegFunc(name string, f FuncLib)

func (*FuncMgr) Run

func (mgr *FuncMgr) Run(fd *FuncData, params *LibFuncParams) (bool, error)

type FuncOnText

type FuncOnText func(string)

type Hero

type Hero struct {
	Battle     *Battle
	ID         HeroID
	Props      map[PropType]int
	StaticPos  *Pos           // 初始坐标,按本地坐标来的,也就是2队人,这个坐标都是对自己在左边的
	Pos        *Pos           // 坐标
	TeamIndex  int            // 队伍索引,0-进攻方,1-防守方
	InstanceID HeroInstanceID // 战斗里hero的唯一标识
	Data       *HeroData      // 直接读表数据
	Skills     []*Skill       // 技能

	LastTarget     *Hero                // 上一次的目标
	MapSingleState map[BuffEffect]*Buff // 简单状态
	Trigger        *BuffTriggerMap
	// contains filtered or unexported fields
}

func NewHero

func NewHero(hp int, atk int, def int, magic int, speed int, isMagicAtk bool) *Hero

func NewHeroEx

func NewHeroEx(battle *Battle, hd *HeroData) *Hero

func (*Hero) Attack

func (hero *Hero) Attack(toHero *Hero) bool

func (*Hero) CanAttackWithDistance

func (hero *Hero) CanAttackWithDistance(toHero *Hero) bool

是否可以攻击到

func (*Hero) CanMove

func (hero *Hero) CanMove() bool

func (*Hero) Clone

func (hero *Hero) Clone() *Hero

func (*Hero) FindFar

func (hero *Hero) FindFar(lst0 *HeroList, num int) *HeroList

在队列里找最远的多少个,一定会返回一个新的herolist

func (*Hero) FindNear

func (hero *Hero) FindNear(lst0 *HeroList, num int) *HeroList

在队列里找最近的多少个,一定会返回一个新的herolist

func (*Hero) FindTarget

func (hero *Hero) FindTarget() *HeroList

选择目标

func (*Hero) ForEachSkills

func (hero *Hero) ForEachSkills(oneach FuncEachHeroSkill) bool

func (*Hero) GetEnemyTeamIndex

func (hero *Hero) GetEnemyTeamIndex() int

获取攻击队伍,可能会被混乱等状态影响,如果返回-1,表示所有队伍都需要选择

func (*Hero) GetRealPos

func (hero *Hero) GetRealPos() *Pos

func (*Hero) IsAlive

func (hero *Hero) IsAlive() bool

func (*Hero) IsMe

func (hero *Hero) IsMe(h *Hero) bool

func (*Hero) Move2Target

func (hero *Hero) Move2Target(target *Hero) *Pos

移动

func (*Hero) OnPropChg

func (hero *Hero) OnPropChg(pt PropType, startval int, endval int, fd *BattleActionFromData)

func (*Hero) UseSkill

func (hero *Hero) UseSkill(parent *BattleLogNode, skill *Skill)

type HeroData

type HeroData struct {
	ID          HeroID
	Name        string
	HP          int
	Atk         int
	Def         int
	Magic       int
	Speed       int
	MovDistance int
	AtkDistance int
	Place       int
	Info        string
	X, Y        int
	Skills      []SkillID
	Find        *FuncData
}

func (*HeroData) Clone

func (hd *HeroData) Clone() *HeroData

type HeroDataMgr

type HeroDataMgr struct {
	// contains filtered or unexported fields
}

func LoadHeroData

func LoadHeroData(fn string) (*HeroDataMgr, error)

func (*HeroDataMgr) GetHeroData

func (mgr *HeroDataMgr) GetHeroData(id HeroID) *HeroData

type HeroID

type HeroID int

type HeroInstanceID

type HeroInstanceID int

type HeroList

type HeroList struct {
	Heros []*Hero
}

func NewHeroList

func NewHeroList() *HeroList

func NewHeroListEx

func NewHeroListEx(lst []*Hero) *HeroList

func NewHeroListEx2

func NewHeroListEx2(hs ...*Hero) *HeroList

func (*HeroList) AddHero

func (hl *HeroList) AddHero(h *Hero) error

func (*HeroList) Clone

func (hl *HeroList) Clone() *HeroList

func (*HeroList) CloneEx

func (hl *HeroList) CloneEx(onhero FuncEachHeroBool) *HeroList

func (*HeroList) Find

func (hl *HeroList) Find(h *Hero) int

func (*HeroList) ForEach

func (hl *HeroList) ForEach(oneach FuncEachHero)

func (*HeroList) ForEachWithBreak

func (hl *HeroList) ForEachWithBreak(oneach FuncEachHeroBool) bool

func (*HeroList) Format

func (hl *HeroList) Format() *HeroList

func (*HeroList) GetAliveHeros

func (hl *HeroList) GetAliveHeros() *HeroList

func (*HeroList) GetNum

func (hl *HeroList) GetNum() int

func (*HeroList) Init

func (hl *HeroList) Init(battle *Battle, lst []*HeroData)

func (*HeroList) IsEmpty

func (hl *HeroList) IsEmpty() bool

func (*HeroList) RemoveHero

func (hl *HeroList) RemoveHero(h *Hero)

func (*HeroList) Sort

func (hl *HeroList) Sort(isless FuncIsLess)

func (*HeroList) SortInAutoSetPos

func (hl *HeroList) SortInAutoSetPos()

func (*HeroList) SortInAutoSetPosSlow

func (hl *HeroList) SortInAutoSetPosSlow()

func (*HeroList) SortInBattle

func (hl *HeroList) SortInBattle()

type LibFuncParams

type LibFuncParams struct {
	Src         *Hero
	Target      *HeroList
	Battle      *Battle
	LogParent   *BattleLogNode
	Skill       *Skill
	Results     *HeroList
	TriggerData *TriggerData
	CacheVals   []int
}

func NewLibFuncParams

func NewLibFuncParams(battle *Battle, src *Hero, target *HeroList, skill *Skill, parent *BattleLogNode, triggerdata *TriggerData) *LibFuncParams

type Pos

type Pos struct {
	X int `json:"x"`
	Y int `json:"y"`
}

关于位置 (x3,y1) (x2,y1) (x1,y1) (x3,y2) (x2,y2) (x1,y2) (x3,y3) (x2,y3) (x1,y3)

func NewPos

func NewPos(x, y int) *Pos

func (*Pos) CalcDistance

func (pos *Pos) CalcDistance(target *Pos) int

func (*Pos) Clone

func (pos *Pos) Clone() *Pos

func (*Pos) Equal

func (pos *Pos) Equal(target *Pos) bool

func (*Pos) Set

func (pos *Pos) Set(p *Pos)

func (*Pos) SetXY

func (pos *Pos) SetXY(x, y int)

type PropType

type PropType int
const (
	PropTypeNone PropType = 0 // none

	// 这一组是基本属性
	PropTypeHP    PropType = 1 // 初始HP
	PropTypeAtk   PropType = 2 // 初始atk
	PropTypeDef   PropType = 3 // 初始def
	PropTypeMagic PropType = 4 // 初始magic
	PropTypeSpeed PropType = 5 // 初始speed
	PropTypeDodge PropType = 6 // 初始闪避
	PropTypeCrit  PropType = 7 // 初始暴击

	PropTypeMovDistance PropType = 20 // 移动距离
	PropTypeAtkDistance PropType = 21 // 攻击距离
	PropTypePlace       PropType = 22 // 位置,1是前排、2是中排、3是后排

	PropTypeAttackType PropType = 50 // 默认是物理攻击还是魔法攻击,0 表示物理,1 表示魔法

	// 这一组是实际参与战斗的基本属性,一般是经过培养系统以后的值
	PropTypeMaxHP    PropType = 100 // 最大HP
	PropTypeCurHP    PropType = 101 // 当前HP
	PropTypeCurAtk   PropType = 102 // 当前atk
	PropTypeCurDef   PropType = 103 // 当前def
	PropTypeCurMagic PropType = 104 // 当前magic
	PropTypeCurSpeed PropType = 105 // 当前speed

	PropTypeCurMovDistance PropType = 120 // 当前移动距离
	PropTypeCurAtkDistance PropType = 121 // 当前攻击距离

	PropTypeTeamSpeedVal PropType = 150 // 队伍速度值,快的队里这个值大于慢的队

	// 状态值,是 或者 否
	PropTypeTaunt PropType = 200 // 嘲讽

	// 百分比附加属性
	PropTypeReduceDamageToMe PropType = 300 // 减少受到伤害
	PropTypeIncreaseDamage   PropType = 301 // 增加造成伤害
)

func Str2PropType

func Str2PropType(str string) PropType

type ReleaseSkillType

type ReleaseSkillType int
const (
	ReleaseSkillTypeNormal  ReleaseSkillType = 1 // 主动技能
	ReleaseSkillTypePassive ReleaseSkillType = 2 // 被动
)

func Str2ReleaseSkillType

func Str2ReleaseSkillType(str string) ReleaseSkillType

type Scene

type Scene struct {
	Width  int
	Height int
	Heros  [][]*HeroList
}

func NewScene

func NewScene(w, h int) *Scene

func (*Scene) AddHero

func (scene *Scene) AddHero(hero *Hero)

func (*Scene) GetHeroNum

func (scene *Scene) GetHeroNum(pos *Pos) int

func (*Scene) GetHerosWithPos

func (scene *Scene) GetHerosWithPos(pos *Pos) *HeroList

func (*Scene) HeroMove

func (scene *Scene) HeroMove(hero *Hero, pos *Pos)

type Skill

type Skill struct {
	ID   SkillID
	Data *SkillData
}

func NewSkill

func NewSkill(data *SkillData) *Skill

func (*Skill) Clone

func (skill *Skill) Clone() *Skill

type SkillData

type SkillData struct {
	ID          SkillID
	Name        string
	Info        string
	Type        SkillType
	ReleaseType ReleaseSkillType
	Atk         *FuncData
	Find        *FuncData
	OnStart     *FuncData
	OnEnd       *FuncData
}

type SkillDataMgr

type SkillDataMgr struct {
	// contains filtered or unexported fields
}

func LoadSkillData

func LoadSkillData(fn string) (*SkillDataMgr, error)

func (*SkillDataMgr) GetSkillData

func (mgr *SkillDataMgr) GetSkillData(id SkillID) *SkillData

type SkillID

type SkillID int

type SkillType

type SkillType int
const (
	SkillTypeBasicAtk SkillType = 1 // 普攻
	SkillTypeNatural  SkillType = 2 // 天赋,天赋技能
	SkillTypeUltimate SkillType = 3 // 必杀,终极技能
	SkillTypeNormal   SkillType = 4 // 普通
)

func Str2SkillType

func Str2SkillType(str string) SkillType

type StaticMgr

type StaticMgr struct {
	MgrHeroData  *HeroDataMgr
	MgrSkillData *SkillDataMgr
	MgrBuffData  *BuffDataMgr
	MgrFunc      *FuncMgr
}
var MgrStatic *StaticMgr

func NewStaticMgr

func NewStaticMgr(dir string, oninitallfuncs FuncInitAllFuncs) (*StaticMgr, error)

type TargetType

type TargetType int
const (
	TargetTypeEnemy  TargetType = 1 // 敌人
	TargetTypeFriend TargetType = 2 // 友方
	TargetTypeAll    TargetType = 3 // 不分敌我
)

type Team

type Team struct {
	Heros     *HeroList
	TeamIndex int
	Speed     int
	SpeedVal  int
	// contains filtered or unexported fields
}

func NewTeam

func NewTeam(battle *Battle, index int, lst []*HeroData) *Team

func (*Team) AutoSetPos

func (team *Team) AutoSetPos()

func (*Team) CountSpeed

func (team *Team) CountSpeed() int

func (*Team) IsAlive

func (team *Team) IsAlive() bool

func (*Team) SetTeamSpeedVal

func (team *Team) SetTeamSpeedVal(speedval int)

type TriggerData

type TriggerData struct {
	Parent   *TriggerData // 父节点,某些情况下,是A打B,B反击然后触发一个判断,所以这里需要有溯源机制
	Trigger  TriggerType  // 类型
	Turn     int          // 回合
	Src      *Hero        // 源英雄,发起方,譬如攻击、寻敌等
	Target   *Hero        // 目标英雄,受击方,被确定为目标等
	SrcSkill *Skill       // 源技能
	SrcBuff  *Buff        // 源buff
}

触发时数据,这里面的数据可以完整的表达任意时点

func NewTriggerDataFind

func NewTriggerDataFind(turn int, src *Hero) *TriggerData

func NewTriggerDataTurnEnd

func NewTriggerDataTurnEnd(turn int) *TriggerData

func NewTriggerDataTurnStart

func NewTriggerDataTurnStart(turn int) *TriggerData

type TriggerType

type TriggerType int
const (
	TriggerTypeNone      TriggerType = 0 // none
	TriggerTypeAttach    TriggerType = 1 // attach buff时,buff在被附加时
	TriggerTypeTurnStart TriggerType = 2 // 回合开始
	TriggerTypeTurnEnd   TriggerType = 3 // 回合结束
	TriggerTypeFind      TriggerType = 4 // 寻找目标时
)

func ParseTriggerList

func ParseTriggerList(str string) []TriggerType

func Str2TriggerType

func Str2TriggerType(str string) TriggerType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL