ecs/servers/game/logic/player_function_open.go

27 lines
558 B
Go
Raw Normal View History

2025-06-04 18:17:39 +08:00
package logic
import "ecs/proto/pb"
func (this *Player) CheckFunctionOpen(funcMod pb.ModId, funcType pb.FuncType, funcId int) bool {
var functionOpen = this.manager.tables.FunctionOpen.Find2(int(funcMod), int(funcType), funcId)
if functionOpen == nil {
return true
}
var yes = true
for i := range functionOpen.UnlockType {
switch functionOpen.UnlockType[i] {
case 0:
continue
case 1:
if functionOpen.UnlockArgs[i] > 0 {
if this.RoleHero.Level < uint32(functionOpen.UnlockArgs[i]) {
yes = false
}
}
}
}
return yes
}