mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Proper toonKilledCogs method
This commit is contained in:
parent
b5beee98a0
commit
1ff5f28056
1 changed files with 15 additions and 3 deletions
|
@ -487,19 +487,31 @@ class QuestManagerAI:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def toonKilledCogs(self, av, suitsKilled, zoneId, activeToonList):
|
def toonKilledCogs(self, av, suitsKilled, zoneId, activeToonList):
|
||||||
|
# Get the avatar's current quests.
|
||||||
avQuests = av.getQuests()
|
avQuests = av.getQuests()
|
||||||
questList = []
|
questList = []
|
||||||
|
|
||||||
|
# Make a list of the activeToonDoIds
|
||||||
|
activeToonDoIds = [toon.doId for toon in activeToonList if not None]
|
||||||
|
|
||||||
|
# Iterate through the avatar's current quests.
|
||||||
for i in xrange(0, len(avQuests), 5):
|
for i in xrange(0, len(avQuests), 5):
|
||||||
questDesc = avQuests[i : i + 5]
|
questDesc = avQuests[i : i + 5]
|
||||||
questClass = Quests.getQuest(questDesc[QuestIdIndex])
|
questClass = Quests.getQuest(questDesc[QuestIdIndex])
|
||||||
|
|
||||||
|
# Check if they are doing a cog quest
|
||||||
if isinstance(questClass, Quests.CogQuest):
|
if isinstance(questClass, Quests.CogQuest):
|
||||||
|
# Check if the cog counts...
|
||||||
for suit in suitsKilled:
|
for suit in suitsKilled:
|
||||||
for x in xrange(questClass.doesCogCount(av.getDoId(), suit, zoneId, activeToonList)):
|
if questClass.doesCogCount(av.doId, suit, zoneId, activeToonDoIds):
|
||||||
questDesc[QuestProgressIndex] += 1
|
# Looks like the cog counts!
|
||||||
|
if questClass.getCompletionStatus(av, questDesc) != Quests.COMPLETE:
|
||||||
|
questDesc[QuestProgressIndex] += 1
|
||||||
|
|
||||||
|
# Add the quest to the questList
|
||||||
questList.append(questDesc)
|
questList.append(questDesc)
|
||||||
|
|
||||||
|
# Update the avatar's quests
|
||||||
av.b_setQuests(questList)
|
av.b_setQuests(questList)
|
||||||
|
|
||||||
@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int, int])
|
@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int, int])
|
||||||
|
|
Loading…
Reference in a new issue