| | |
| | | import BaseAttack
|
| | | import PassiveBuffEffMng
|
| | | import ChNetSendPack
|
| | | import IpyGameDataPY
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | DefPetRebornHPRate = 100 # 宠物死亡复活血量百分比
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 初始化宠物属性
|
| | | def InitRolePet(rolePet, canSyncClient=True):
|
| | | #---初始化时钟,致命一击倍率---
|
| | | #---初始化时钟---
|
| | | NPCCommon.InitNPC(rolePet)
|
| | |
|
| | | #---初始化仇恨列表---
|
| | |
| | | # @return BOOL 是否可出战
|
| | | # @remarks 检查当前指定宠物是否可出战
|
| | | def CheckPetCanFight(curPlayer, curPetObj):
|
| | | if not GameWorld.GetMap().GetMapCanOutPet():
|
| | | if not GetMapCanOutPet(curPlayer):
|
| | | #Pet_liubo_314885 此地图禁止宠物
|
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
|
| | | return False
|
| | |
| | | if not rolePet.GetIsBattle():
|
| | | return
|
| | |
|
| | | if not GameWorld.GetMap().GetMapCanOutPet():
|
| | | if not GetMapCanOutPet(curPlayer):
|
| | | #此地图禁止宠物
|
| | | return
|
| | | #召唤宠物出战
|
| | |
| | | # @remarks
|
| | | def DoLogic_PetLoadMapOK(curPlayer):
|
| | |
|
| | | if GameWorld.GetMap().GetMapCanOutPet():
|
| | | if GetMapCanOutPet(curPlayer):
|
| | | #此地图宠物可以上
|
| | | PlayerPet.AutoSummonPet(curPlayer)
|
| | | return
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
|
| | | return
|
| | |
|
| | | def GetMapCanOutPet(curPlayer):
|
| | | ## 检查本地图可否出战宠物,支持前端自定义场景
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | canOutPet = True if ipyMapData and ipyMapData.GetCanOutPet() else False
|
| | | else:
|
| | | canOutPet = GameWorld.GetMap().GetMapCanOutPet()
|
| | | return canOutPet
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 刷新宠物信息并通知客户端
|
| | | # @param rolePet 宠物实例
|