Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lottery

func Lottery(plr IPlayer, req *PB.C_PlayerLottery) *PB.GS_PlayerLottery_R

func WishHero

func WishHero(plr IPlayer, req *PB.C_PlayerWishHero) int32

Types

type ArmSlot

type ArmSlot struct {
	SlotId int32
	ArmSeq int64 //装备序号
}

func (*ArmSlot) ToMsg

func (self *ArmSlot) ToMsg() *PB.ArmorSlot

type Campsite

type Campsite struct {
	Id            int32 //ID
	CampsiteSlots []*CampsiteSlot
	// contains filtered or unexported fields
}

func (*Campsite) CalcProps

func (self *Campsite) CalcProps(plr IPlayer)

计算属性变化

func (*Campsite) GetCachePropMods

func (self *Campsite) GetCachePropMods() (*PB.PropMods, *PB.PropMods)

func (*Campsite) GetSlot

func (self *Campsite) GetSlot(slotId int32) *CampsiteSlot

计算属性变化

func (*Campsite) ToMsg

func (self *Campsite) ToMsg() *PB.Campsite

type CampsiteSlot

type CampsiteSlot struct {
	Id     int32
	HeroId int32
}

func (*CampsiteSlot) ToMsg

func (self *CampsiteSlot) ToMsg() *PB.CampsiteSlot

type Destiny

type Destiny struct {
	Id int32
	Lv int32
}

天命

type Fashion

type Fashion struct {
	Id int32 // 表 Id
}

func (*Fashion) ToMsg

func (self *Fashion) ToMsg() *PB.Fashion

type FashionMap

type FashionMap map[int32]*Fashion // 时装容器

func NewFashionMap

func NewFashionMap() *FashionMap

func (*FashionMap) FindFashion

func (self *FashionMap) FindFashion(id int32) *Fashion

func (FashionMap) MarshalBSON

func (self FashionMap) MarshalBSON() ([]byte, error)

func (*FashionMap) ToMsg

func (self *FashionMap) ToMsg() map[int32]*PB.Fashion

func (*FashionMap) UnmarshalBSON

func (self *FashionMap) UnmarshalBSON(data []byte) error

func (*FashionMap) UpgradeFashionLevel

func (self *FashionMap) UpgradeFashionLevel(fashion_id int32)

type GodWeapon

type GodWeapon struct {
	Id     int32
	Star   int32            //星级
	Dan    int32            //神段
	DanExp core.Map_I32_I32 //每一个进度map<index,exp>
}

func NewGodWeapon

func NewGodWeapon(id int32) *GodWeapon

func (*GodWeapon) ToMsg

func (self *GodWeapon) ToMsg() *PB.GodWeapon

type Hero

type Hero struct {
	PB.BaseHero

	TeamPos int32 `bson:"-"` //在队伍中的位置,0表示没有上阵
	// contains filtered or unexported fields
}

func (*Hero) AddAllProps

func (self *Hero) AddAllProps() int32

func (*Hero) AddProps

func (self *Hero) AddProps(Type, id int32, num float32)

func (*Hero) CalcProps

func (self *Hero) CalcProps(sendUpdate bool)

func (*Hero) CalcProps2

func (self *Hero) CalcProps2(props *PB.ClassAttributeType)

func (*Hero) GetAtkPower

func (self *Hero) GetAtkPower() int32

func (*Hero) GetExpFromLevel

func (self *Hero) GetExpFromLevel(lv int32) (res int32)

func (*Hero) GetProps2other

func (self *Hero) GetProps2other() *PB.ClassAttributeType

func (*Hero) LvUp

func (self *Hero) LvUp(Lv int32) int32

func (*Hero) SendUpdateProps

func (self *Hero) SendUpdateProps(updated shared.PropMap)

func (*Hero) SetAdvancedLv

func (self *Hero) SetAdvancedLv() int32

func (*Hero) SetHeroStepPassive

func (self *Hero) SetHeroStepPassive(new []int32) int32

func (*Hero) ToMsg

func (self *Hero) ToMsg() *PB.GS_Hero

func (*Hero) ToMsg_BattleHero

func (self *Hero) ToMsg_BattleHero() *PB.BattleHero

func (*Hero) UpdateProps

func (self *Hero) UpdateProps() (updated shared.PropMap)

type Heroes

type Heroes map[int32]*Hero

func NewHeroes

func NewHeroes() *Heroes

func (*Heroes) CalcTeamProps

func (self *Heroes) CalcTeamProps(sendUpdate bool, plr IPlayer)

计算上阵属性变化

func (*Heroes) CreateHero

func (self *Heroes) CreateHero(id int32, plr IPlayer) *Hero

func (*Heroes) FindHero

func (self *Heroes) FindHero(id int32) *Hero

func (*Heroes) GetElemCount

func (self *Heroes) GetElemCount(elem int32, exclude int32, mustInTeam bool) int32

获取阵营,国家数量

func (*Heroes) GetGenderCount

func (self *Heroes) GetGenderCount(gender gconst.Gender, exclude int32, mustInTeam bool) int32

func (*Heroes) GetHeroCount

func (self *Heroes) GetHeroCount(heroId int32, exclude int32, mustInTeam bool) int32

统计英雄数量

func (*Heroes) GetJobCount

func (self *Heroes) GetJobCount(job int32, exclude int32, mustInTeam bool) int32

统计职业数量

func (*Heroes) Init

func (self *Heroes) Init(plr IPlayer)

func (Heroes) MarshalBSON

func (self Heroes) MarshalBSON() ([]byte, error)

func (*Heroes) NewHero

func (self *Heroes) NewHero(id int32, plr IPlayer) *Hero

func (*Heroes) Reset

func (self *Heroes) Reset()

func (*Heroes) ToMsg

func (self *Heroes) ToMsg() map[int32]*PB.GS_Hero

func (*Heroes) UnmarshalBSON

func (self *Heroes) UnmarshalBSON(data []byte) error

type IPlayer

type IPlayer interface {
	comp.IPlayer

	GetMainHero() *MainHero
	CreateMainHero(id int32) *MainHero
	GetHeroes() *Heroes
	GetTeam() core.Map_I32_I32
	GetFashions() *FashionMap
	CalcProp(Calc bool) *PB.ClassAttributeType
}

type MAP_I32_ArmSlot

type MAP_I32_ArmSlot map[int32]*ArmSlot

func (MAP_I32_ArmSlot) MarshalBSON

func (self MAP_I32_ArmSlot) MarshalBSON() ([]byte, error)

func (*MAP_I32_ArmSlot) UnmarshalBSON

func (self *MAP_I32_ArmSlot) UnmarshalBSON(data []byte) error

type MAP_I32_Campsite

type MAP_I32_Campsite map[int32]*Campsite

func (*MAP_I32_Campsite) GetCampsiteSlotByHeroId

func (self *MAP_I32_Campsite) GetCampsiteSlotByHeroId(heroId int32) (*Campsite, *CampsiteSlot)

判断是否已经使用

func (*MAP_I32_Campsite) Init

func (self *MAP_I32_Campsite) Init(plr IPlayer)

func (MAP_I32_Campsite) MarshalBSON

func (self MAP_I32_Campsite) MarshalBSON() ([]byte, error)

func (*MAP_I32_Campsite) SetSlotHero

func (self *MAP_I32_Campsite) SetSlotHero(plr IPlayer, id int32, slotId int32, heroId int32) *Campsite

设置营地位置,上阵哪个英雄,没有回创建营地和位置

func (*MAP_I32_Campsite) ToMsg

func (self *MAP_I32_Campsite) ToMsg() map[int32]*PB.Campsite

func (*MAP_I32_Campsite) UnmarshalBSON

func (self *MAP_I32_Campsite) UnmarshalBSON(data []byte) error

type MAP_I32_Destiny

type MAP_I32_Destiny map[int32]*Destiny

func (MAP_I32_Destiny) MarshalBSON

func (self MAP_I32_Destiny) MarshalBSON() ([]byte, error)

func (*MAP_I32_Destiny) UnmarshalBSON

func (self *MAP_I32_Destiny) UnmarshalBSON(data []byte) error

type MAP_I32_GodWeapon

type MAP_I32_GodWeapon map[int32]*GodWeapon

func (MAP_I32_GodWeapon) MarshalBSON

func (self MAP_I32_GodWeapon) MarshalBSON() ([]byte, error)

func (*MAP_I32_GodWeapon) UnmarshalBSON

func (self *MAP_I32_GodWeapon) UnmarshalBSON(data []byte) error

type MAP_I32_Tactics

type MAP_I32_Tactics map[int32]*Tactics

func (MAP_I32_Tactics) MarshalBSON

func (self MAP_I32_Tactics) MarshalBSON() ([]byte, error)

func (*MAP_I32_Tactics) ToMsg

func (self *MAP_I32_Tactics) ToMsg() map[int32]*PB.Tactics

func (*MAP_I32_Tactics) UnmarshalBSON

func (self *MAP_I32_Tactics) UnmarshalBSON(data []byte) error

type MainHero

type MainHero struct {
	Id int32 //表Id

	GodWeaponIds   []int32           `bson:"god_weapon_ids"`
	GodWeaponMap   MAP_I32_GodWeapon //已激活的神兵
	GodWeaponGroup core.Map_I32_Bool //已激活神兵连携

	TacticsMap MAP_I32_Tactics //已激活的战法

	FClothes  int32 // 时装衣服
	DestinyLv int32 //天命等级
	TitleLv   int32 //头衔等级

	CampsiteMap MAP_I32_Campsite //营地信息
	// contains filtered or unexported fields
}

func NewMainHero

func NewMainHero(id int32) *MainHero

func (*MainHero) AddAllProps

func (self *MainHero) AddAllProps()

func (*MainHero) AddProps

func (self *MainHero) AddProps(Type, id int32, num float32)

/////////系统属性计算///////////////////

func (*MainHero) CalcProps

func (self *MainHero) CalcProps(sendUpdate bool)

计算主角属性变化

func (*MainHero) CalcProps2

func (self *MainHero) CalcProps2(props *PB.ClassAttributeType)

func (*MainHero) GetAtkPower

func (self *MainHero) GetAtkPower() int32

func (*MainHero) GetProps2other

func (self *MainHero) GetProps2other() *PB.ClassAttributeType

func (*MainHero) Init

func (self *MainHero) Init(player IPlayer)

func (*MainHero) SetLevel

func (self *MainHero) SetLevel(lv int32)

func (*MainHero) ToMsg

func (self *MainHero) ToMsg() *PB.MainHero

func (*MainHero) ToMsg_BattleMainHero

func (self *MainHero) ToMsg_BattleMainHero() *PB.BattleMainHero

func (*MainHero) ToMsg_BattleSKill

func (self *MainHero) ToMsg_BattleSKill() []*PB.BattleSkill

type Tactics

type Tactics struct {
	Id int32
	Lv int32 //战法等级
}

func NewTactics

func NewTactics(id int32) *Tactics

func (*Tactics) ToMsg

func (self *Tactics) ToMsg() *PB.Tactics