def reward(self, who, rwdIdx, npcObj=None): '''奖励 ''' taskObj = task.hasTask(who, TASK_ID) if not taskObj or self.hasKillBoss(who, npcObj.idx): rwdIdx = 2001 customActivity.reward(self, who, rwdIdx, npcObj)
def __init__(self, _id, name): customActivity.__init__(self, _id, name) self.list = [ 101, 102, 103, ]
def createScene(self, sceneIdx): '''创建副本场景 ''' sceneObj = customActivity.createScene(self, sceneIdx) info = self.getSceneInfo(sceneIdx) sceneObj.landX = info.get("着陆点x", 0) sceneObj.landY = info.get("着陆点y", 0) return sceneObj
def rewardTeam(self, who, rwdIdx, npcObj=None): '''奖励队伍 ''' teamObj = who.getTeamObj() if not teamObj: return for pid in teamObj.getInTeamList(): obj = getRole(pid) if not obj: continue taskObj = task.hasTask(obj, TASK_ID) if not taskObj: continue if not self.hasKillBoss(obj, npcObj.idx): customActivity.rewardTeam(self, who, rwdIdx, npcObj) break
def validFight(self, who, npcObj, fightIdx): if not task.hasTask(who, TASK_ID): self.doScript(who, npcObj, "D4003") return 0 if not self.vaildTeam(npcObj, who): return 0 return customActivity.validFight(self, who, npcObj, fightIdx)
def getScriptHandler(self, script): m = re.match("TASK", script) if m: args = m.groups() return giveTask, args m = re.match("FBD(\d+)", script) if m: args = m.groups() return taskDone, args return customActivity.getScriptHandler(self, script)
def transString(self, content, pid=0): who = None if pid: who = getRole(pid) if who: if "$targetName" in content and hasattr(who,"pkTargetId"): target = getRole(who.pkTargetId) if target: content = content.replace("$targetName", target.name) return customActivity.transString(self, content, pid)
def transString(self, content, pid=0): '''转化字符串 ''' who = None if pid: who = getRole(pid) if who: if "$teamRoleName" in content: content = content.replace("$teamRoleName", ",".join(who.teamRoleName)) return customActivity.transString(self, content, pid)
def load(self, data): customActivity.load(self, data) self.freeBuddyList = data.pop("freeBuddy",{})
def save(self): data = customActivity.save(self) data["freeBuddy"] = self.freeBuddyList return data
def __init__(self, _id, name): customActivity.__init__(self, _id, name) self.freeBuddyList = {}
def __init__(self, _id, name): customActivity.__init__(self, _id, name) self.state = 0 # 活动状态, 0.已结束 1.进行中 self.teamInfoList = {} # 活动队伍信息列表
def getValueByVarName(self, varName, who): if varName == "R": return who.day.fetch("raceFightCount") return customActivity.getValueByVarName(self, varName, who)
def __init__(self, _id, name): customActivity.__init__(self, _id, name) self.state = 0 # 活动状态, 0.已结束 1.进行中 self.raceInfoList = {} # 竞技信息列表 self.orderList = [] # 排序列表
def save(self): data = customActivity.save(self) data["list"] = self.list return data
def load(self, data): customActivity.load(self, data) self.list = data["list"]
def __init__(self, _id, name): customActivity.__init__(self, _id, name)