Ejemplo n.º 1
0
    def transString(self, content, pid=0):
        '''转化字符串
		'''
        holidayId = self.fetch("holidayId")
        holidayName = holidayData.getConfig(holidayId, "节日名称")
        content = content.replace("$holiday", holidayName)

        return customTask.transString(self, content, pid)
Ejemplo n.º 2
0
 def transString(self, content, pid=0):
     if "$needCnt" in content:
         needCnt = self.getNeedMonsterCnt()
         content = content.replace("$needCnt", str(needCnt))
     if "$hasCnt" in content:
         hasCnt = self.getHasMonsterCnt()
         content = content.replace("$hasCnt", str(hasCnt))
     return customTask.transString(self, content, pid)
Ejemplo n.º 3
0
    def transString(self, content, pid=0):
        who = None
        if pid:
            who = getRole(pid)

        if who:
            if "$BOSS" in content:
                content = content.replace("$BOSS", self.getBossDesc(who))

        return customTask.transString(self, content, pid)
Ejemplo n.º 4
0
    def transString(self, content, pid=0):
        '''转化字符串
		'''
        who = None
        if pid:
            who = getRole(pid)
        if who:
            guildObj = who.getGuildObj()
            if "$union" in content:
                content = content.replace("$union", guildObj.name)
        return customTask.transString(self, content)
Ejemplo n.º 5
0
    def transString(self, content, pid=0):  #override
        '''转化字符串
		'''
        if "$monsterList" in content or "$allScene" in content:
            actObj = activity.triones.getActivity()
            if actObj:
                if "$monsterList" in content:
                    lKillMonster = []
                    lTemp = []
                    who = None
                    if pid:
                        who = getRole(pid)
                    if who:
                        lKillMonster = who.day.fetch("trionesKill", [])
                    #未战胜显示#C04
                    #已战胜显示#C05
                    for monsterIdx in xrange(1001, 1008):
                        info = actObj.getNpcInfo(monsterIdx)
                        if monsterIdx in lKillMonster:
                            lTemp.append("#C0{}{}#n".format(
                                5, info.get("名称", "")))
                        else:
                            lTemp.append("#C0{}{}#n".format(
                                4, info.get("名称", "")))

                    content = content.replace("$monsterList", "、".join(lTemp))

                if "$allScene" in content:
                    lTemp = []
                    lAllScene = actObj.getGroupInfo(9001)
                    for iSceneId in lAllScene:
                        sceneObj = scene.getScene(iSceneId)
                        if sceneObj:
                            lTemp.append("#C08{}#n".format(sceneObj.name))

                    content = content.replace("$allScene", "、".join(lTemp))

        return customTask.transString(self, content, pid)