捉迷藏小游戏

This commit is contained in:
hahwu 2025-03-18 14:37:24 +08:00
parent df9cf9d44d
commit 7dcdfbb06a
2 changed files with 50 additions and 34 deletions

View File

@ -2997,7 +2997,7 @@ func ReqPlayroomInfo(player *Player, buf []byte) error {
PlayroomMod.SetTarget(Targer)
if PlayerData.Loginout > 0 && PlayerData.Loginout < GoUtil.Now()-int64(playroomCfg.GetGameOutline()) { // todo DEBUG
log.Debug("ReqPlayroomInfo PlayerData.Loginout:%v, %v", PlayerData.Loginout, playroomCfg.GetGameOutline())
PlayroomMod.SetGameId(1)
PlayroomMod.SetGameId(playroom.GAME_TYPE_HOOK)
Star := min(500, max(PlayerData.Star/10, 10))
ChessMod := player.PlayMod.getChessMod()
EmitList := ChessMod.GetOrderEmit()
@ -3023,7 +3023,7 @@ func ReqPlayroomInfo(player *Player, buf []byte) error {
PlayroomMod.SetGameReward(ChessList[0], ChessList[1], Star)
}
} else {
PlayroomMod.SetGameId(2)
PlayroomMod.SetGameId(playroom.GAME_TYPE_FILP)
PlayroomMod.SetGameRewardFlip(int(float64(PlayerData.Star)*0.03), int(float64(PlayerData.Star)*0.05), int(float64(PlayerData.Star)*0.1))
}
player.PlayMod.save()
@ -3112,6 +3112,10 @@ func ReqPlayroomGame(player *Player, buf []byte) error {
}
PlayerData := G_GameLogicPtr.GetSimplePlayerByUid(Target)
Items := make([]*item.Item, 0)
if req.Type == playroom.GAME_RESULT_LOSE {
Items = append(Items, item.NewItem(item.ITEM_STAR_ID, 20))
PlayroomMod.ResetGame()
}
if req.Type == playroom.GAME_RESULT_LOW {
Items = append(Items, item.NewItem(item.ITEM_STAR_ID, PlayerData.Level*2))
PlayroomMod.ResetGame()

View File

@ -11,38 +11,39 @@ import (
)
type PlayroomMod struct {
Collect map[int]int // 装饰
Room map[int]int // 房间
Dress map[int][]int // 服装仓库
DressSet map[int]int // 服装穿戴
PetAir []int // 宠物空气背包
PetAirSet int // 宠物空气背包穿戴
Status int // 0: 未拜访 1: 拜访
Endtime int64 // 结束时间
Starttime int64 // 开始时间
WorkStatus int // 0: 未开始 1: 进行中 2: 结束
Visitor map[int]*Info // 访客
MoodInfo map[int]*Mood // 心情
AllMood int // 总心情
Reward []*item.Item // 奖励
DayFirstT int // 每日未首次触发次数
Trigger int // 未触发次数
TriggerTime int64 // 触发时间
HasVisit map[int]int64 // 今日已拜访的玩家
Target int // 拜访的目标
GameId int // 游戏ID
GameReward map[int]*item.Item // 游戏奖励
GameStatus int // 游戏状态
Exclude bool // 是否排除
LoseItem []*item.Item // 失去的物品
Chip int // 碎片
Flip map[int]int // 翻牌
FlipReward []*item.Item // 翻牌奖励
WorkOutline int // 是否离线
LastFlip int // 上次翻牌奖励档次
NoFlip int // 连续未获取最高翻牌奖励次数
TodayFlip bool // 今日是否已获得最高档奖励
JackpotNum int // 每日转盘数量
Collect map[int]int // 装饰
Room map[int]int // 房间
Dress map[int][]int // 服装仓库
DressSet map[int]int // 服装穿戴
PetAir []int // 宠物空气背包
PetAirSet int // 宠物空气背包穿戴
Status int // 0: 未拜访 1: 拜访
Endtime int64 // 结束时间
Starttime int64 // 开始时间
WorkStatus int // 0: 未开始 1: 进行中 2: 结束
Visitor map[int]*Info // 访客
MoodInfo map[int]*Mood // 心情
AllMood int // 总心情
Reward []*item.Item // 奖励
DayFirstT int // 每日未首次触发次数
Trigger int // 未触发次数
TriggerTime int64 // 触发时间
HasVisit map[int]int64 // 今日已拜访的玩家
Target int // 拜访的目标
GameId int // 游戏ID
GameReward map[int]*item.Item // 游戏奖励
GameStatus int // 游戏状态
GameInfo map[int]interface{} // 游戏信息
Exclude bool // 是否排除
LoseItem []*item.Item // 失去的物品
Chip int // 碎片
Flip map[int]int // 翻牌
FlipReward []*item.Item // 翻牌奖励
WorkOutline int // 是否离线
LastFlip int // 上次翻牌奖励档次
NoFlip int // 连续未获取最高翻牌奖励次数
TodayFlip bool // 今日是否已获得最高档奖励
JackpotNum int // 每日转盘数量
Physiology map[int]*Physiology
}
@ -56,6 +57,7 @@ const (
MOOD_TYPE_TAKE = 4 // 照料
MOOD_TYPE_PLAY = 5 // 玩耍
GAME_RESULT_LOSE = 0 // 输
GAME_RESULT_LOW = 1 // 低
GAME_RESULT_MIDDLE = 2 // 中
GAME_RESULT_HIGH = 3 // 高
@ -69,6 +71,10 @@ const (
PHYSIOLOGY_TYPE_FEED = 3 // 进食
PHYSIOLOGY_TYPE_CLEAN = 4 // 清洁
PHYSIOLOGY_TYPE_TOLIET = 5 // 上厕所
GAME_TYPE_HOOK = 1 // 愿者上钩
GAME_TYPE_FILP = 2 // 翻牌
GAME_TYPE_HIDE = 3 // 捉迷藏
)
type Mood struct {
@ -98,6 +104,9 @@ func (p *PlayroomMod) InitData() {
if p.DressSet == nil {
p.DressSet = make(map[int]int)
}
if p.GameInfo == nil {
p.GameInfo = make(map[int]interface{})
}
InitCollect := playroomCfg.GetInitDecorate()
for _, v := range InitCollect {
p.Collect[v] = 1
@ -201,6 +210,9 @@ func (p *PlayroomMod) SetTarget(Target int) {
}
func (p *PlayroomMod) SetGameId(GameId int) {
if (p.GameId == GAME_TYPE_HOOK || p.GameId == GAME_TYPE_HIDE) && GameId == GAME_TYPE_HOOK {
return
}
p.GameId = GameId
}