| | |
| | | #GameWorld.Log("defender = %s->%s 这个对象不可攻击"%(defender.GetName(),defender.GetID()))
|
| | | return False
|
| | |
|
| | | if attacker.GetSightLevel() != defender.GetSightLevel():
|
| | | return False
|
| | | |
| | | atkObjType = attacker.GetGameObjType()
|
| | | defObjType = defender.GetGameObjType()
|
| | | # 如果是玩家 打 NPC
|
| | |
| | | return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
|
| | |
|
| | | if curPlayer != None and curTagPlayer != None :
|
| | | #私有木桩只能自己打自己的
|
| | | if curTagSummon.GetType() in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
|
| | | if not GameWorld.IsSameObj(curPlayer, curTagPlayer):
|
| | | return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
|
| | | return ChConfig.Type_Relation_Enemy , ChConfig.Def_PASysMessage_None
|
| | | |
| | | #同一玩家不互相攻击
|
| | | if GameWorld.IsSameObj(curPlayer, curTagPlayer):
|
| | | return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
|
| | |
|
| | | |
| | | #检查攻击模式
|
| | | if not AttackCommon.CheckPlayerAttackMode_Player(curPlayer, curTagPlayer):
|
| | | return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_AttackMode
|
| | |
| | | if curObjType not in hurtTypeList:
|
| | | return None, None
|
| | |
|
| | | if attacker.GetSightLevel() != curObj.GetSightLevel():
|
| | | return None, None
|
| | | |
| | | #攻击对象
|
| | | if not curTag:
|
| | | curTag = GameWorld.GetObj(curObj.GetID(), curObjType)
|
| | |
| | | visible = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if visible:
|
| | | curPlayer.SetVisible(True)
|
| | | curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
|
| | | curPlayer.SetSightLevel(0)
|
| | | else:
|
| | | curPlayer.SetVisible(False)
|
| | | curPlayer.SetSight(0)
|
| | | curPlayer.SetSightLevel(curPlayer.GetID())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | def GetVisible(self): return _IPY_GameObj.IPY_GameObj_GetVisible(self)
|
| | | def SetIsBlind(self, *args): return _IPY_GameObj.IPY_GameObj_SetIsBlind(self, *args)
|
| | | def GetIsBlind(self): return _IPY_GameObj.IPY_GameObj_GetIsBlind(self)
|
| | | def SetSightLevel(self, *args): return _IPY_GameObj.IPY_GameObj_SetSightLevel(self, *args)
|
| | | def GetSightLevel(self): return _IPY_GameObj.IPY_GameObj_GetSightLevel(self)
|
| | | def CanSeeOther(self, *args): return _IPY_GameObj.IPY_GameObj_CanSeeOther(self, *args)
|
| | | def RefreshView(self): return _IPY_GameObj.IPY_GameObj_RefreshView(self)
|
| | | def UpdatePos(self): return _IPY_GameObj.IPY_GameObj_UpdatePos(self)
|
| | |
| | | #刷新玩家的视野
|
| | | if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
|
| | | GameWorld.DebugLog("===登录本服地图时,处于跨服或自定义场景状态,不刷新视野!", curPlayer.GetPlayerID())
|
| | | curPlayer.SetSight(0)
|
| | | curPlayer.SetSightLevel(curPlayer.GetID())
|
| | | elif curPlayer.GetLV() > 1:
|
| | | PlayerState.ChangePlayerSigh(curPlayer, tick)
|
| | |
|
| | |
| | |
|
| | | curPlayer.SetCanAttack(False)
|
| | | curPlayer.SetVisible(False)
|
| | | curPlayer.SetSight(0)
|
| | | curPlayer.SetSightLevel(curPlayer.GetID())
|
| | | curPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | if curPet:
|
| | | curPet.SetVisible(False)
|
| | |
| | | ## 退出自定义场景状态
|
| | | curPlayer.SetCanAttack(True)
|
| | | curPlayer.SetVisible(True)
|
| | | curPlayer.SetSight(0)
|
| | | curPlayer.SetSightLevel(curPlayer.GetID())
|
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
|
| | | curPlayer.SetSightLevel(0)
|
| | | curPlayer.RefreshView()
|
| | | curPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | if curPet:
|