| | |
| | | # 动态刷新属性的,血量按百分比继承
|
| | | aftHP = int(aftMaxHP * befHP / befMaxHP)
|
| | | GameObj.SetHP(curNPC, aftHP)
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_MaxHPEx()
|
| | | curNPC.Notify_HP()
|
| | | curNPC.Notify_MaxHP()
|
| | | #GameWorld.DebugLog(" aftHP=%s,aftMaxHP=%s" % (aftHP, aftMaxHP))
|
| | |
|
| | | # 机器人复活初始化给技能
|
| | |
| | | attrStrengthenDict = attrStrengthenInfo[NPCAttr_AttrStrengthenList] # 属性成长公式字典
|
| | | playerCntCoefficient = attrStrengthenInfo[NPCAttr_PlayerCntCoefficient] # 人数系数
|
| | | npcIDPlayerCntCoefficient = attrStrengthenInfo[NPCAttr_NPCPlayerCntCoefficient] # 特殊NPC人数系数
|
| | | baseMaxHP = npcData.GetHPEx() * ShareDefine.Def_PerPointValue + npcData.GetHP()
|
| | | baseMaxHP = GameObj.GetHP(npcData) # NPCData 没有提供Max接口,对应使用GetHP
|
| | |
|
| | | if strengthenLV:
|
| | | if not strengthenIpyData:
|
| | |
| | | # continue
|
| | | #
|
| | | # angryObjType = curAngry.GetObjType()
|
| | | # angryObjValue = curAngry.GetAngryValue()
|
| | | # angryObjValue = GameObj.GetAngryValue(curAngry)
|
| | | #
|
| | | # #删除旧的仇恨,添加新的仇恨
|
| | | # if angryObjID == tagID and angryObjType == tagType:
|
| | |
| | | summonNPC.Reborn(summonPos.GetPosX(), summonPos.GetPosY(), False)
|
| | | NPCControl(summonNPC).ResetNPC_Init(isReborn=True)
|
| | | if hp or hpEx:
|
| | | summonNPC.SetHP(hp)
|
| | | summonNPC.SetHPEx(hpEx)
|
| | | summonNPC.SetMaxHP(hp)
|
| | | summonNPC.SetMaxHPEx(hpEx)
|
| | | hpTotal = hpEx * ShareDefine.Def_PerPointValue + hp
|
| | | GameObj.SetHP(summonNPC, hpTotal)
|
| | | GameObj.SetMaxHP(summonNPC, hpTotal)
|
| | | summonNPC.NotifyAppear() # 最终统一通知NPC出现
|
| | | playerPriWoodNPCList.append(summonNPC)
|
| | |
|
| | |
| | | npcAngry = curNPC.GetNPCAngry()
|
| | | angryValue = npcAngry.FindNPCAngry(seeObjID, seeObjType)
|
| | |
|
| | | if angryValue != None and angryValue.GetAngryValue() != 0 :
|
| | | if angryValue != None and GameObj.GetAngryValue(angryValue) != 0 :
|
| | | #该对象已经在仇恨列表中,不重复添加
|
| | | return False
|
| | |
|
| | |
| | | curPlayer = GameWorld.GetObj(curObjID, curObjType)
|
| | | if curPlayer and curPlayer.GetTeamID() > 0:
|
| | | addAngryTeam = GameWorld.GetTeamManager().FindTeam(curPlayer.GetTeamID())
|
| | | |
| | | #总血量有超过DWORD的情况
|
| | | plusAngryValue = FixValueByValueEx(curNPC.GetMaxHPEx(), plusAngryValue)
|
| | |
|
| | | #最小添加仇恨值为1
|
| | | plusAngryValue = max(plusAngryValue , 1)
|
| | |
| | | angryValue = npcAngry.FindNPCAngry(curObjID, curObjType)
|
| | |
|
| | | #未发现,添加
|
| | | if angryValue == None or angryValue.GetAngryValue() == 0:
|
| | | npcAngry.AddAngry(curObjID, curObjType, plusAngryValue)
|
| | | if angryValue == None or GameObj.GetAngryValue(angryValue) == 0:
|
| | | npcAngry.AddAngry(curObjID, curObjType, plusAngryValue % ShareDefine.Def_PerPointValue, plusAngryValue / ShareDefine.Def_PerPointValue)
|
| | |
|
| | | #如果需要,叠加
|
| | | elif canPile:
|
| | | angryValue.SetAngryValue(min(angryValue.GetAngryValue() + plusAngryValue, ChConfig.Def_UpperLimit_DWord))
|
| | | updAngryValue = GameObj.GetAngryValue(angryValue) + plusAngryValue
|
| | | GameObj.SetAngryValue(angryValue, updAngryValue)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | return None
|
| | |
|
| | | #仇恨值
|
| | | curAngryValue = curAngry.GetAngryValue()
|
| | | curAngryValue = GameObj.GetAngryValue(curAngry)
|
| | |
|
| | | if curAngryValue == 0:
|
| | | return None
|
| | |
| | | self.RefreshNPCState(isReborn=isReborn)
|
| | | #通知血量, 复活的情况不通知血量,由NPC出现包通知
|
| | | if not isReborn:
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_HP()
|
| | |
|
| | | #这里不设置为慢速处理,因为NPC有可能未满血
|
| | | #改为在空闲回血,如果满血的时候设置为慢速处理
|
| | |
| | | self.RefreshNPCSpeed(allAttrList)
|
| | | #检查血量是否变化, 暂不做血量增加上限通知,仅属性上限支持;
|
| | | #客户端自己算血量上限
|
| | | # if curNPC.GetMaxHP() != curNPCMaxHP_Before:
|
| | | # if GameObj.GetMaxHP(curNPC) != curNPCMaxHP_Before:
|
| | | # curNPC.Notify_MaxHP()
|
| | |
|
| | | return
|
| | |
| | | GameWorld.DebugLog("设置助战机器人属性: objID=%s,fightPower=%s,maxHP=%s" % (curNPC.GetID(), fightPower, maxHP))
|
| | | GameObj.SetMaxHP(curNPC, maxHP)
|
| | | GameObj.SetHP(curNPC, maxHP)
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_MaxHPEx()
|
| | | curNPC.Notify_HP()
|
| | | curNPC.Notify_MaxHP()
|
| | | return
|
| | |
|
| | | # NPC移动速度特殊处理,只处理百分比不能处理固定值
|
| | |
| | | # for index in range(curNPC.GetAngryNPCCount()):
|
| | | # angryNPC = curNPC.GetAngryNPCByIndex(index)
|
| | | # #已经死亡
|
| | | # if angryNPC.GetHP() <= 0:
|
| | | # if GameObj.GetHP(angryNPC) <= 0:
|
| | | # continue
|
| | | #
|
| | | # angryNPCList.append(angryNPC)
|
| | |
| | | #===============================================================================
|
| | | # curNPC = self.__Instance
|
| | | #
|
| | | # if curNPC.GetHP() == curNPC.GetMaxHP():
|
| | | # if GameObj.GetHP(curNPC) == GameObj.GetMaxHP(curNPC):
|
| | | # #满血了
|
| | | # return
|
| | | #
|
| | |
| | | return hurtObjTuple
|
| | |
|
| | | #支持抢怪,个人杀死,但自己死亡,不算
|
| | | if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if isLog:
|
| | | GameWorld.Log("该目标伤血玩家已死亡: npcID=%s,playerID=%s" % (npcID, maxHurtObj.GetValueID()))
|
| | | return hurtObjTuple
|
| | |
| | | GameWorld.Log(" i=%s, 无该队员!" % (i))
|
| | | continue
|
| | |
|
| | | if curTeamPlayer.GetHP() <= 0 or curTeamPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curTeamPlayer) <= 0 or curTeamPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if isLog:
|
| | | GameWorld.Log(" i=%s, 队员已死亡!memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
|
| | | continue
|
| | |
| | | GameWorld.DebugLog("竞争归属玩家不可见,移除归属!playerID=%s" % ownerID)
|
| | | return
|
| | |
|
| | | if owner.GetHP() <= 0 or owner.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(owner) <= 0 or owner.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | GameWorld.DebugLog("竞争归属玩家死亡,移除归属!playerID=%s" % ownerID)
|
| | | return
|
| | |
|
| | |
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 队员为空!" % i)
|
| | | continue
|
| | | if curTeamPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTeamPlayer) <= 0:
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 队员血量为0!, memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
|
| | | continue
|
| | |
| | |
|
| | | callFunc(curNPC, curPlayer, skill)
|
| | | #---------------------------------------------------------------------
|
| | | # 目标总值超过DWORD记录,需修正数值
|
| | | # 如:伤血和仇恨超过20E的情况,按高位记录取余, 最低1
|
| | | def FixValueByValueEx(valueEx, value):
|
| | | if valueEx == 0:
|
| | | return value
|
| | | |
| | | # 取高位记录的数字长度,按10N次方求余
|
| | | nlen = len(str(valueEx))
|
| | | return max(value / pow(10, nlen), 1)
|
| | |
|
| | |
|
| | | def CheckCanCollectByNPCID(curPlayer, npcID, collectNPCIpyData):
|
| | | # 根据NPCID判断是否可以采集
|