示例#1
0
    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)
示例#2
0
 def __init__(self, _id, name):
     customActivity.__init__(self, _id, name)
     self.list = [
         101,
         102,
         103,
     ]
示例#3
0
    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
示例#4
0
    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
示例#5
0
    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)
示例#6
0
 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)
示例#7
0
	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)
示例#8
0
    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)
示例#9
0
	def load(self, data):
		customActivity.load(self, data)
		self.freeBuddyList = data.pop("freeBuddy",{})
示例#10
0
	def save(self):
		data = customActivity.save(self)
		data["freeBuddy"] = self.freeBuddyList
		return data
示例#11
0
	def __init__(self, _id, name):
		customActivity.__init__(self, _id, name)
		self.freeBuddyList = {}
示例#12
0
 def __init__(self, _id, name):
     customActivity.__init__(self, _id, name)
     self.state = 0  # 活动状态, 0.已结束  1.进行中
     self.teamInfoList = {}  # 活动队伍信息列表
示例#13
0
	def getValueByVarName(self, varName, who):
		if varName == "R":
			return who.day.fetch("raceFightCount")
		return customActivity.getValueByVarName(self, varName, who)
示例#14
0
	def __init__(self, _id, name):
		customActivity.__init__(self, _id, name)
		self.state = 0 # 活动状态, 0.已结束  1.进行中
		self.raceInfoList = {} # 竞技信息列表
		self.orderList = [] # 排序列表
示例#15
0
 def save(self):
     data = customActivity.save(self)
     data["list"] = self.list
     return data
示例#16
0
 def load(self, data):
     customActivity.load(self, data)
     self.list = data["list"]
示例#17
0
	def __init__(self, _id, name):
		customActivity.__init__(self, _id, name)