playroom拜访解锁等级
This commit is contained in:
parent
4c9ebf13bb
commit
58be1191c5
@ -190,6 +190,14 @@ func GetInteractNum() int {
|
||||
return gamedata.GetIntValue(data, "Value")
|
||||
}
|
||||
|
||||
func GetInteractUnlock() int {
|
||||
data, err := gamedata.GetDataByKey(CFG_PLAYROOM_CONST, "InteractUnlock")
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return gamedata.GetIntValue(data, "Value")
|
||||
}
|
||||
|
||||
func GetVisitorItem() int {
|
||||
data, err := gamedata.GetDataByKey(CFG_PLAYROOM_CONST, "VisitorItem")
|
||||
if err != nil {
|
||||
|
||||
@ -3405,6 +3405,8 @@ func ReqPlayroomInteract(player *Player, buf []byte) error {
|
||||
Msg: err.Error(),
|
||||
})
|
||||
}
|
||||
BaseMod := player.PlayMod.getBaseMod()
|
||||
PlayroomMod.AddInteractNum(BaseMod.GetLevel())
|
||||
player.QuestTrigger(&quest.Trigger{Label: quest.TRIGGER_LABEL_INTERACT, A: []interface{}{int(req.Id)}})
|
||||
player.PlayMod.save()
|
||||
G_GameLogicPtr.SetUserData(int(player.M_DwUin), VAR_OP_KISS, 0)
|
||||
|
||||
@ -518,11 +518,14 @@ func (p *PlayroomMod) Interact(Id, Type int) ([]*item.Item, int, error) {
|
||||
PType, PEffect := playroomCfg.GetInteractPhysiology(Id)
|
||||
p.AddPhysiology(PType, PEffect)
|
||||
p.AddMood(MoodType, Effect)
|
||||
p.AddInteractNum()
|
||||
return ItemList, PType, nil
|
||||
}
|
||||
|
||||
func (p *PlayroomMod) AddInteractNum() {
|
||||
func (p *PlayroomMod) AddInteractNum(Lv int) {
|
||||
Unlock := playroomCfg.GetInteractUnlock()
|
||||
if Lv < Unlock {
|
||||
return
|
||||
}
|
||||
p.InteractNum++
|
||||
p.InteractNum = min(p.InteractNum, playroomCfg.GetInteractNum())
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user