comp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TalisMans_New

func TalisMans_New(id, star int32) *PB.TalisMan

Types

type Armor

type Armor struct {
	Seq   int64 // 序号
	Id    int32 // 表 Id
	Slot  int32 // 栏位
	Star  int32 // 星级
	Level int32 // 精炼等级
	// contains filtered or unexported fields
}

func (*Armor) GetColor

func (self *Armor) GetColor() int32

func (*Armor) GetMods

func (self *Armor) GetMods(lv int32) *PB.PropMods

func (*Armor) ToMsg

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

type Bag

type Bag struct {
	Ccy       ccy_map_t
	Items     item_map_t
	Armors    armor_map_t
	TalisMans TalisMans
	Souls     soul_map_t
	// contains filtered or unexported fields
}

func NewBag

func NewBag() *Bag

func (*Bag) Add_item

func (self *Bag) Add_item(id int32, n int32)

func (*Bag) CheckItemLimit

func (self *Bag) CheckItemLimit(id int32) bool

func (*Bag) FindArmor

func (self *Bag) FindArmor(seq int64) *Armor

func (*Bag) FindSoul

func (self *Bag) FindSoul(seq int64) *Soul

func (*Bag) FindTalisMan

func (self *Bag) FindTalisMan(seq int64) *PB.TalisMan

func (*Bag) GetCcy

func (self *Bag) GetCcy(id int32) int64

func (*Bag) GetItem

func (self *Bag) GetItem(id int32) int32

func (*Bag) GetItemsFromClass

func (self *Bag) GetItemsFromClass(class int32) (res []PB.Unit)

func (*Bag) Init

func (self *Bag) Init(plr IPlayer)

func (*Bag) NewOp

func (self *Bag) NewOp(from PB.ObjFrom) *BagOp

func (*Bag) NewSoul

func (self *Bag) NewSoul(id int32) *Soul

func (*Bag) SetTalisMan

func (self *Bag) SetTalisMan(armor *PB.TalisMan)

func (*Bag) ToMsg

func (self *Bag) ToMsg() *PB.BagData

func (*Bag) ToMsg_ArmorArray

func (self *Bag) ToMsg_ArmorArray() (ret []*PB.Armor)

func (*Bag) ToMsg_CcyArray

func (self *Bag) ToMsg_CcyArray() (ret []*PB.Ccy)

func (*Bag) ToMsg_ItemArray

func (self *Bag) ToMsg_ItemArray() (ret []*PB.Item)

func (*Bag) ToMsg_SoulArray

func (self *Bag) ToMsg_SoulArray() (ret []*PB.Soul)

type BagOp

type BagOp struct {
	Ccy          ccy_map_t
	Items        item_map_t
	Armors       armor_map_t
	ArmorsDel    []int64
	TalisMans    TalisMans
	TalisMansDel []int64
	Souls        soul_map_t
	SoulsDel     []int64

	Dict map[string]string
	// contains filtered or unexported fields
}

func (*BagOp) Add

func (self *BagOp) Add(id int32, n int64) interface{}

func (*BagOp) AddArmor

func (self *BagOp) AddArmor(armor *Armor) *BagOp

func (*BagOp) AddDict

func (self *BagOp) AddDict(k, v string)

func (*BagOp) AddSoul

func (self *BagOp) AddSoul(soul *Soul) *BagOp

战魂

func (*BagOp) AddTalisMan

func (self *BagOp) AddTalisMan(armor *PB.TalisMan) *BagOp

func (*BagOp) Apply

func (self *BagOp) Apply() *rewards_t

func (*BagOp) CheckArmorGenerate

func (self *BagOp) CheckArmorGenerate(num int32) bool

func (*BagOp) CheckEnough

func (self *BagOp) CheckEnough() int32

func (*BagOp) CheckFullBeforeApply

func (self *BagOp) CheckFullBeforeApply() int32

在提交背包之前检测是否超过上限,阻止用户的操作,比如:背包开宝箱,领取邮件,领取活动奖励等

func (*BagOp) DelArmor

func (self *BagOp) DelArmor(seq int64) *BagOp

func (*BagOp) DelSoul

func (self *BagOp) DelSoul(seq int64) *BagOp

func (*BagOp) DelTalisMan

func (self *BagOp) DelTalisMan(seq int64) *BagOp

func (*BagOp) FindAllPreArmor

func (self *BagOp) FindAllPreArmor() []*PB.Armor

func (*BagOp) Renew

func (self *BagOp) Renew()

type Fields

type Fields struct {
	Items field_map_t
	// contains filtered or unexported fields
}

func NewFields

func NewFields() *Fields

func (*Fields) Get

func (self *Fields) Get(id int32) int64

func (*Fields) Init

func (self *Fields) Init(plr IPlayer)

func (*Fields) NewOp

func (self *Fields) NewOp(from string) *FieldsOp

func (*Fields) ToMsg

func (self *Fields) ToMsg() []*PB.Field

type FieldsOp

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

func (*FieldsOp) Add

func (self *FieldsOp) Add(id int32, n int64)

func (*FieldsOp) AddCheckMax

func (self *FieldsOp) AddCheckMax(id int32, n int64, max int64) int32

func (*FieldsOp) AddCheckMin

func (self *FieldsOp) AddCheckMin(id int32, n int64, min int64) int32

func (*FieldsOp) AddLimitMax

func (self *FieldsOp) AddLimitMax(id int32, n int64, max int64)

func (*FieldsOp) AddLimitMin

func (self *FieldsOp) AddLimitMin(id int32, n int64, min int64)

func (*FieldsOp) Apply

func (self *FieldsOp) Apply()

func (*FieldsOp) Set

func (self *FieldsOp) Set(id int32, v int64)

type FigureStore

type FigureStore struct {
	Ids []int32
	// contains filtered or unexported fields
}

func NewFigureStore

func NewFigureStore() *FigureStore

func (*FigureStore) Add

func (self *FigureStore) Add(id int32)

func (*FigureStore) Exists

func (self *FigureStore) Exists(id int32) bool

func (*FigureStore) Init

func (self *FigureStore) Init(plr IPlayer)

func (*FigureStore) ToMsg

func (self *FigureStore) ToMsg() []int32

============================================================================

type HFrame

type HFrame struct {
	Id       int32
	ObtainTs int64 //获得时间,0表示无限期使用
}

type HFrameStore

type HFrameStore struct {
	HFrames []*HFrame
	// contains filtered or unexported fields
}

func NewHFrameStore

func NewHFrameStore() *HFrameStore

func (*HFrameStore) Add

func (self *HFrameStore) Add(id int32)

func (*HFrameStore) Exists

func (self *HFrameStore) Exists(id int32) bool

func (*HFrameStore) Get

func (self *HFrameStore) Get(id int32) *HFrame

func (*HFrameStore) Init

func (self *HFrameStore) Init(plr IPlayer)

func (*HFrameStore) ToMsg

func (self *HFrameStore) ToMsg() []*PB.HeadFrame

============================================================================

type Head struct {
	Id       int32
	ObtainTs int64 //获得时间,0表示无限期使用
}

type HeadStore

type HeadStore struct {
	Heads []*Head
	// contains filtered or unexported fields
}

func NewHeadStore

func NewHeadStore() *HeadStore

func (*HeadStore) Add

func (self *HeadStore) Add(id int32)

func (*HeadStore) Exists

func (self *HeadStore) Exists(id int32) bool

func (*HeadStore) Get

func (self *HeadStore) Get(id int32) *Head

func (*HeadStore) Init

func (self *HeadStore) Init(plr IPlayer)

func (*HeadStore) ToMsg

func (self *HeadStore) ToMsg() []*PB.Head

============================================================================

type IPlayer

type IPlayer interface {
	GetId() string
	GetName() string
	GetSvr() string
	GetSvrId() int32
	GetSdk() string
	GetPlat() string
	GetDevId() string
	GetCreateTs() time.Time
	GetHead() int32
	GetHFrame() int32
	GetFigure() int32
	GetExp() int64
	GetLevel() int32
	GetAtkPower() int32
	AddExp(v int64) bool
	IsOnline() bool
	GetOnlineDur() int32
	GetOfflineTs() time.Time

	GetHeadStore() *HeadStore
	GetHFrameStore() *HFrameStore
	GetFigureStore() *FigureStore

	DB() *db.Database
	SendMsg(message PB.Message)
	SendMsgWithoutQueue(message PB.Message)

	GetBag() *Bag
	GetFields() *Fields

	GetVipLevel() int32
	GetBillSumDiam() int32

	GetActRawData(actid int32) interface{}
	GetActPersonalStage(actid int32) int32
	SetActPersonalStage(actid int32, v int32)

	GetGuildId() string
	GetGuildName() string
	GetGuildRank() int32
	BuyCount(counter_id int32, num int32) int32
	GetClientData() *PB.GS_UserInfo
	SendMail(mid int32, attachment []*Object, dict map[string]string)
	CalcHeroesProps(sendUpdate bool)

	//掉落接口
	Drop(args ...interface{}) (ret []int32)
	CalcTeamProps(sendUpdate bool)
}

type Object

type Object struct {
	Id  int32 `json:"Id"`
	Num int64 `json:"Num"`
}

type Soul

type Soul struct {
	Seq        int64   //唯一id
	Id         int32   //表id
	Lv         int32   //强化等级
	Exp        int32   //强化经验
	RndAttrs   []int32 //随机属性
	RndAttrsLv []int32 //随机经验强化等级

	PeerlessRndAttr int32 //无双随机属性

	HeroPos int32 //英雄位置[1,6]
}

func (*Soul) AddExp

func (self *Soul) AddExp(exp int32)

func (*Soul) GetSeat

func (self *Soul) GetSeat() int32

获取位置

func (*Soul) GetSoulStonePoint

func (self *Soul) GetSoulStonePoint() (add int32, base int32)

TODO:获得战魂点数,升到这一级的和基础的

func (*Soul) GetStar

func (self *Soul) GetStar() int32

TODO:获取star,无双为6

func (*Soul) ToMsg

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

type TalisMans

type TalisMans map[int64]*PB.TalisMan

Jump to

Keyboard shortcuts

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