2025-06-04 18:17:39 +08:00
|
|
|
package logic
|
|
|
|
|
2025-06-05 17:47:59 +08:00
|
|
|
import (
|
|
|
|
"ecs/proto/pb"
|
|
|
|
"ecs/servers/game/data"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PlayerCopyPassed struct {
|
|
|
|
SceneId uint32 `bson:"scene_id" key:"1"`
|
|
|
|
TotalNum uint32 `bson:"total_num"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Player) PassedCopy(sceneTable *data.Scene, maxScore int32) {
|
|
|
|
var passed = this.CopyPassed[uint32(sceneTable.Id)]
|
|
|
|
if passed == nil {
|
|
|
|
passed = &PlayerCopyPassed{SceneId: uint32(sceneTable.Id)}
|
|
|
|
this.CopyPassed[passed.SceneId] = passed
|
|
|
|
}
|
|
|
|
|
|
|
|
switch pb.CopyType(sceneTable.CopyType) {
|
|
|
|
case pb.CopyType_CopyMain:
|
|
|
|
var copyMainTable = this.manager.tables.CopyMain.Get(sceneTable.CopyId)
|
|
|
|
if copyMainTable == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
this.PassedCopyMain(copyMainTable, maxScore)
|
|
|
|
|
|
|
|
// this.copyStorePoolUnlock(uint32(sceneTable.Id), util.Unix())
|
|
|
|
// this.chapterBattlePassLevelUnlock(uint32(sceneTable.Id))
|
|
|
|
//case pb.CopyTypeMaterial:
|
|
|
|
// var copyMaterialTable = this.manager.tables.CopyMaterialExtend.Get(sceneTable.Id)
|
|
|
|
// if copyMaterialTable == nil {
|
|
|
|
// this.manager.logger.Error("Data error, CopyMaterial not found, sceneId: ", sceneTable.Id)
|
|
|
|
// return 0, proto.ErrDataTablesError
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// this.AddCounter(proto.CounterTypeCopyMaterial, uint32(copyMaterialTable.MaterialType), 1)
|
|
|
|
//
|
|
|
|
// copyRank = this.PassedCopyMaterial(copyMaterialTable, duration, maxDepth, maxScore)
|
|
|
|
//case pb.CopyTypeReserve:
|
|
|
|
// //暂时保留
|
|
|
|
//case pb.CopyTypeSpeed:
|
|
|
|
// var copySpeedTable = this.manager.tables.CopySpeedExtend.Get(sceneTable.Id)
|
|
|
|
// if copySpeedTable == nil {
|
|
|
|
// this.manager.logger.Error("Data error, CopySpeed not found, sceneId: ", sceneTable.Id)
|
|
|
|
// return 0, proto.ErrDataTablesError
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// this.AddCounter(proto.CounterTypeCopySpeed, uint32(copySpeedTable.CopyType), 1)
|
|
|
|
//
|
|
|
|
// copyRank = this.PassedCopySpeed(copySpeedTable, duration, maxDepth, maxScore)
|
|
|
|
}
|
|
|
|
|
|
|
|
passed.TotalNum += 1
|
|
|
|
|
|
|
|
this.SaveModel(passed)
|
|
|
|
|
|
|
|
//this.CheckTask(proto.TaskSection1PassSpecificScene, sceneTable.Id, 1)
|
|
|
|
//this.CheckTask(proto.TaskSection1PassAnyScene, 0, 1)
|
|
|
|
//this.CheckTask(proto.TaskSection1PassedClassifyCopies, sceneTable.CopyType, 1)
|
|
|
|
|
|
|
|
//this.CheckAchievement(proto.AchievementTypePassedCopyTimes, uint32(sceneTable.CopyType), 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Player) GetCopyPassedNum(sceneId uint32) uint32 {
|
|
|
|
var passed = this.CopyPassed[sceneId]
|
|
|
|
if passed == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return passed.TotalNum
|
|
|
|
}
|