def perform(self, att, vicCast): warObj = att.war if hasattr(warObj.game, "getText"): content = warObj.game.getText(7004) warObj.say(att,content) CustomPerform.perform(self, att, vicCast)
def afterPerform(self, att, vicCast): CustomPerform.afterPerform(self, att, vicCast) # 给hp最低的加血 targetObj = None for w in att.getFriendList(): if targetObj and targetObj.hp < w.hp: continue targetObj = w if not targetObj: return targetCount = 1 damRatio = self.calDamageRatio(att, targetObj, targetObj, targetCount) dp = self.calCure(att, targetObj, targetObj, damRatio) targetObj.addHP(dp, att) # 随机给另一个加血 info = att.hasApply("PF5618Info") if not info: return if rand(100) >= info["概率"]: return for w in att.getFriendList(): if w is att: continue if w is targetObj: continue hp = dp * info["生命"] / 100 w.addHP(hp, att) return
def afterAttack(self, att, vic, vicCast, dp, targetCount): CustomPerform.afterAttack(self, att, vic, vicCast, dp, targetCount) if dp <= 0: return bout = self.calBout(att, vic, self.buffId) buffObj = buff.addOrReplace(vic, self.buffId, bout, att) if buffObj: ratioFirst, ratio = self.configInfo["伤害率"] hpFirst = int(dp * ratioFirst / 100) hp = int(dp * ratio / 100) buffObj.config(hpFirst, hp)
def afterAttack(self, att, vic, vicCast, dp, targetCount): CustomPerform.afterAttack(self, att, vic, vicCast, dp, targetCount) if dp <= 0: return if vic.isDead(): return if vic.hp * 100 / vic.hpMax > self.configInfo["目标生命比"]: return if rand(100) >= self.transCode(self.configInfo["概率"], att, vic): return bout = self.calBout(att, vic, self.buffId) buff.addOrReplace(vic, self.buffId, bout, att)
def perform(self, att, vicCast): CustomPerform.perform(self, att, vicCast) targetList = self.getPerformTargetList(att, att, 99) targetList.sort(key=lambda w: w.hp) targetCount = self.configInfo["目标数"] targetList = targetList[:targetCount] targetCount = len(targetList) damRatio = self.calDamageRatio(att, vicCast, vicCast, targetCount) for vic in targetList: if vic.isDead(): continue dp = self.calCure(att, vic, vicCast, damRatio) vic.addHP(dp, att)
def calDamageRatio(self, att, vic, vicCast, targetCount): damRatio = CustomPerform.calDamageRatio(self, att, vic, vicCast, targetCount) if vic.isRole(): ratio = self.configInfo["玩家伤害"] else: ratio = self.configInfo["非玩家伤害"] damRatio = int(damRatio * (100 + ratio) / 100) return damRatio
def validPerform(self, att, needTips): '''检查施法 ''' ratio = att.hasApply("PF1512_HPLimit") if not ratio: ratio = self.configInfo["生命值限制"] if att.hp <= int(att.hpMax * ratio / 100): if needTips: message.tips(att.getPID(), "只能在#C04当前生命值>{}%#n时使用".format(ratio)) return False return CustomPerform.validPerform(self, att, needTips)
def afterAttack(self, att, vic, vicCast, dp, targetCount): CustomPerform.afterAttack(self, att, vic, vicCast, dp, targetCount) if dp > 0 and vic.isDead() and vic.inWar(): bout = self.calBout(att, vic, self.buffId) buff.addOrReplace(vic, self.buffId, bout, att)
def afterPerform(self, att, vicCast): att.war.kickWarrior(att) CustomPerform.afterPerform(self, att, vicCast)
def afterPerform(self, att, vicCast): CustomPerform.afterPerform(self, att, vicCast) if att.isDead(): return bout = self.calBout(att, att, self.buffId) buff.addOrReplace(att, self.buffId, bout, att)
def afterAttack(self, att, vic, vicCast, dp, targetCount): CustomPerform.afterAttack(self, att, vic, vicCast, dp, targetCount) if dp > 0: vic.addFuWen(self.configInfo["目标符能"])
def getValueByVarName(self, varName, att=None, vic=None): if varName == "hpBaseV": info = monsterBase.getBaseAbleInfo(vic.level) return info["生命"] return CustomPerform.getValueByVarName(self, varName, att, vic)
def afterAttack(self, att, vic, vicCast, dp, targetCount): CustomPerform.afterAttack(self, att, vic, vicCast, dp, targetCount) if dp > 0 and vic.inWar(): mp = self.transCode("SLV*1+30", att, vic) vic.addMP(-mp, att)