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