拜访机制调整
This commit is contained in:
parent
322b0e1926
commit
812402526a
@ -180,6 +180,14 @@ func GetPremiumItem() []int {
|
||||
return r
|
||||
}
|
||||
|
||||
func GetInteractNum() int {
|
||||
data, err := gamedata.GetDataByKey(CFG_PLAYROOM_CONST, "InteractNum")
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return gamedata.GetIntValue(data, "Value")
|
||||
}
|
||||
|
||||
func GetVisitorItem() int {
|
||||
data, err := gamedata.GetDataByKey(CFG_PLAYROOM_CONST, "VisitorItem")
|
||||
if err != nil {
|
||||
|
||||
@ -52,6 +52,7 @@ type PlayroomMod struct {
|
||||
DailyTask map[int]*DailyTask // 每日任务
|
||||
DailyTaskReward []int // 每日任务奖励
|
||||
Physiology map[int]*Physiology
|
||||
InteractNum int // 互动次数
|
||||
}
|
||||
|
||||
type DailyTask struct {
|
||||
@ -376,6 +377,11 @@ func (p *PlayroomMod) Interact(Id, Type int) ([]*item.Item, int, error) {
|
||||
return ItemList, MoodType, nil
|
||||
}
|
||||
|
||||
func (p *PlayroomMod) AddInteractNum() {
|
||||
p.InteractNum++
|
||||
p.InteractNum = min(p.InteractNum, playroomCfg.GetInteractNum())
|
||||
}
|
||||
|
||||
func (p *PlayroomMod) AddMood(Id, Num int) {
|
||||
_, ok := p.MoodInfo[Id]
|
||||
if !ok {
|
||||
@ -426,9 +432,10 @@ func (p *PlayroomMod) AddCollect(Id int) {
|
||||
|
||||
func (p *PlayroomMod) ResetGame() {
|
||||
p.Target = 0
|
||||
p.Status = 0
|
||||
p.Status = STATUS_IDLE
|
||||
p.GameId = 0
|
||||
p.GameReward = make(map[int]*item.Item)
|
||||
p.InteractNum = 0
|
||||
}
|
||||
|
||||
func (p *PlayroomMod) ResetLose() {
|
||||
@ -662,13 +669,12 @@ func (p *PlayroomMod) GetFlipReward() ([]*item.Item, int, error) {
|
||||
Items = append(Items, p.GameReward[FLIP_TYPE_GOLD])
|
||||
}
|
||||
p.LastFlip = v
|
||||
p.Status = STATUS_IDLE
|
||||
p.GameId = 0
|
||||
p.Flip = make(map[int]int)
|
||||
p.Target = 0
|
||||
p.ResetGame()
|
||||
return Items, T, nil
|
||||
}
|
||||
}
|
||||
|
||||
return Items, T, fmt.Errorf("GetFlipReward check is not 3")
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user