當前位置: 首頁>>代碼示例>>Python>>正文


Python ParseResponseUtils.parseEffectsGained方法代碼示例

本文整理匯總了Python中kol.util.ParseResponseUtils.parseEffectsGained方法的典型用法代碼示例。如果您正苦於以下問題:Python ParseResponseUtils.parseEffectsGained方法的具體用法?Python ParseResponseUtils.parseEffectsGained怎麽用?Python ParseResponseUtils.parseEffectsGained使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kol.util.ParseResponseUtils的用法示例。


在下文中一共展示了ParseResponseUtils.parseEffectsGained方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
    def parseResponse(self):
        response = {}
        effectResponse = ParseResponseUtils.parseEffectsGained(self.responseText)
        if len(effectResponse) > 0:
            response["effects"] = effectResponse
        hpResponse = ParseResponseUtils.parseHPGainedLost(self.responseText)
        if hpResponse != 0:
            reponse["hp"] = hpResponse

        self.responseData = response
開發者ID:camperdave,項目名稱:pykol,代碼行數:12,代碼來源:JukeboxRequest.py

示例2: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
    def parseResponse(self):
        # Check for errors.
        notEnoughMeatPattern = PatternManager.getOrCompilePattern('noMeatForStore')
        cannotGoPattern = PatternManager.getOrCompilePattern('userShouldNotBeHere')
        notSoldPattern = PatternManager.getOrCompilePattern('notSoldHere')

        if cannotGoPattern.search(self.responseText):
            raise UserShouldNotBeHereError("You cannot reach that cafe")
        if notSoldPattern.search(self.responseText):
            raise NotSoldHereError("This cafe doesn't carry that item.")
        if notEnoughMeatPattern.search(self.responseText):
            raise NotEnoughMeatError("You do not have enough meat to purchase the item(s).")

        response = {}

        advResponse = ParseResponseUtils.parseAdventuresGained(self.responseText)
        if advResponse > 0:
            response["adventures"] = advResponse

        drunkResponse = ParseResponseUtils.parseDrunkGained(self.responseText)
        if drunkResponse > 0:
            response["drunkeness"] = drunkResponse

        subResponse = ParseResponseUtils.parseSubstatsGainedLost(self.responseText)
        if len(subResponse) > 0:
            response["substats"] = subResponse

        statResponse = ParseResponseUtils.parseStatsGainedLost(self.responseText)
        if len(statResponse) > 0:
            response["statPoints"] = statResponse

        levelResponse = ParseResponseUtils.parseLevelsGained(self.responseText)
        if levelResponse > 0:
            response["level"] = levelResponse

        effectResponse = ParseResponseUtils.parseEffectsGained(self.responseText)
        if len(effectResponse) > 0:
            response["effects"] = effectResponse

        hpResponse = ParseResponseUtils.parseHPGainedLost(self.responseText)
        if hpResponse != 0:
            reponse["hp"] = hpResponse

        mpResponse = ParseResponseUtils.parseMPGainedLost(self.responseText)
        if mpResponse != 0:
            reponse["mp"] = mpResponse

        self.responseData = response
開發者ID:camperdave,項目名稱:pykol,代碼行數:50,代碼來源:CafeRequest.py

示例3: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
    def parseResponse(self):
        # First parse for errors
        notEnoughPattern = PatternManager.getOrCompilePattern("notEnoughToUse")
        if notEnoughPattern.search(self.responseText):
            raise NotEnoughItemsError("You don't have that many of that item")

        notMultiPattern = PatternManager.getOrCompilePattern("notMultiUse")
        if notMultiPattern.search(self.responseText):
            raise InvalidActionError("You cannot multi-use that item")

        # Find out what happened
        items = ParseResponseUtils.parseItemsReceived(self.responseText, self.session)
        if len(items) > 0:
            self.responseData["items"] = items

        meat = ParseResponseUtils.parseMeatGainedLost(self.responseText)
        if meat != 0:
            self.responseData["meat"] = meat

        hp = ParseResponseUtils.parseHPGainedLost(self.responseText)
        if hp != 0:
            self.responseData["hp"] = hp

        mp = ParseResponseUtils.parseMPGainedLost(self.responseText)
        if mp != 0:
            self.responseData["mp"] = mp

        drunk = ParseResponseUtils.parseDrunkGained(self.responseText)
        if drunk != 0:
            self.responseData["drunk"] = drunk

        adventures = ParseResponseUtils.parseAdventuresGained(self.responseText)
        if adventures != 0:
            self.responseData["adventures"] = adventures

        effects = ParseResponseUtils.parseEffectsGained(self.responseText)
        if len(effects) > 0:
            self.responseData["effects"] = effects
開發者ID:camperdave,項目名稱:pykol,代碼行數:40,代碼來源:UseMultipleRequest.py

示例4: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
	def parseResponse(self):
		# Check for errors
		tooDrunkPattern = PatternManager.getOrCompilePattern('tooDrunk')
		if tooDrunkPattern.search(self.responseText):
			raise TooDrunkError("You are too drunk to drink more booze")
		notBoozePattern = PatternManager.getOrCompilePattern('notBooze')
		if notBoozePattern.search(self.responseText):
			raise InvalidActionError("That item is not booze")
		boozeMissingPattern = PatternManager.getOrCompilePattern('notEnoughItems')
		if boozeMissingPattern.search(self.responseText):
		 raise NotEnoughItemsError("Item not in inventory")

		# Check the results
		results = {}
		
		results["drunkenness"] = ParseResponseUtils.parseDrunkGained(self.responseText)
		results["adventures"] = ParseResponseUtils.parseAdventuresGained(self.responseText)
		
		substats = ParseResponseUtils.parseSubstatsGainedLost(self.responseText)
		if len(substats) > 0:
			results["substats"] = substats
		stats = ParseResponseUtils.parseStatsGainedLost(self.responseText)
		if len(stats) > 0:
			results["stats"] = stats
		level = ParseResponseUtils.parseLevelsGained(self.responseText)
		if level != 0:
			results["level"] = level
		hp = ParseResponseUtils.parseHPGainedLost(self.responseText)
		if hp != 0:
			results["hp"] = hp
		mp = ParseResponseUtils.parseMPGainedLost(self.responseText)
		if mp != 0:
			results["mp"] = mp
		effects = ParseResponseUtils.parseEffectsGained(self.responseText)
		if len(effects) > 0:
			results["effects"] = effects
		
		self.responseData = results
開發者ID:NardoLoopa,項目名稱:pykol,代碼行數:40,代碼來源:DrinkBoozeRequest.py

示例5: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
	def parseResponse(self):
		# Check for errors
		tooFullPattern = PatternManager.getOrCompilePattern('tooFull')
		if tooFullPattern.search(self.responseText):
			raise TooFullError("You are too full to eat that.")
		notFoodPattern = PatternManager.getOrCompilePattern('notFood')
		if notFoodPattern.search(self.responseText):
			raise InvalidActionError("That item is not food")
		foodMissingPattern = PatternManager.getOrCompilePattern('notEnoughItems')
		if foodMissingPattern.search(self.responseText):
		 raise NotEnoughItemsError("Item not in inventory")

		# Check the results
		results = {}
		
		results["adventures"] = ParseResponseUtils.parseAdventuresGained(self.responseText)
		
		substats = ParseResponseUtils.parseSubstatsGainedLost(self.responseText)
		if len(substats) > 0:
			results["substats"] = substats
		stats = ParseResponseUtils.parseStatsGainedLost(self.responseText)
		if len(stats) > 0:
			results["stats"] = stats
		level = ParseResponseUtils.parseLevelsGained(self.responseText)
		if level != 0:
			results["level"] = level
		hp = ParseResponseUtils.parseHPGainedLost(self.responseText)
		if hp != 0:
			results["hp"] = hp
		mp = ParseResponseUtils.parseMPGainedLost(self.responseText)
		if mp != 0:
			results["mp"] = mp
		effects = ParseResponseUtils.parseEffectsGained(self.responseText)
		if len(effects) > 0:
			results["effects"] = effects
		
		self.responseData = results
開發者ID:NardoLoopa,項目名稱:pykol,代碼行數:39,代碼來源:EatFoodRequest.py

示例6: parseResponse

# 需要導入模塊: from kol.util import ParseResponseUtils [as 別名]
# 或者: from kol.util.ParseResponseUtils import parseEffectsGained [as 別名]
	def parseResponse(self):
		self.responseData["effects"] = ParseResponseUtils.parseEffectsGained(self.responseText)
開發者ID:NardoLoopa,項目名稱:pykol,代碼行數:4,代碼來源:OldTimeyRadioRequest.py


注:本文中的kol.util.ParseResponseUtils.parseEffectsGained方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。