From fa782898357037e016add81c72b50256e229e2d3 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Fri, 10 Apr 2015 14:08:35 +0300 Subject: [PATCH] Add config option to give SOS cards --- config/general.prc | 3 +++ toontown/cogdominium/DistributedCogdoInteriorAI.py | 2 +- toontown/suit/DistributedSellbotBossAI.py | 2 +- toontown/toon/DistributedToonAI.py | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/general.prc b/config/general.prc index 826350e9..ce4c7c79 100644 --- a/config/general.prc +++ b/config/general.prc @@ -96,6 +96,9 @@ want-resistance-dance #f # Cog battles: base-xp-multiplier 1.0 +# SOS toons: +sos-card-reward 2 + # Cog Dominiums want-emblems #t cogdo-want-barrel-room #t diff --git a/toontown/cogdominium/DistributedCogdoInteriorAI.py b/toontown/cogdominium/DistributedCogdoInteriorAI.py index 75648648..73fa5379 100644 --- a/toontown/cogdominium/DistributedCogdoInteriorAI.py +++ b/toontown/cogdominium/DistributedCogdoInteriorAI.py @@ -487,7 +487,7 @@ class DistributedCogdoInteriorAI(DistributedObjectAI, FSM.FSM): toon = self.air.doId2do.get(v) if toon: if self.FOType == 's': - if not toon.attemptAddNPCFriend(self.sosNPC, numCalls=1): + if not toon.attemptAddNPCFriend(self.sosNPC): self.notify.info('%s unable to add NPCFriend %s to %s.' % (self.doId, self.sosNPC, v)) elif self.FOType == 'l': diff --git a/toontown/suit/DistributedSellbotBossAI.py b/toontown/suit/DistributedSellbotBossAI.py index 871c6ec4..92c8c4d4 100644 --- a/toontown/suit/DistributedSellbotBossAI.py +++ b/toontown/suit/DistributedSellbotBossAI.py @@ -349,7 +349,7 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS for toonId in self.involvedToons: toon = self.air.doId2do.get(toonId) if toon: - if not toon.attemptAddNPCFriend(self.cagedToonNpcId, numCalls=1): + if not toon.attemptAddNPCFriend(self.cagedToonNpcId): self.notify.info('%s.unable to add NPCFriend %s to %s.' % (self.doId, self.cagedToonNpcId, toonId)) toon.b_promote(self.deptIndex) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 24ad3e6c..b43e883b 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -648,7 +648,9 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def resetNPCFriendsDict(self): self.b_setNPCFriendsDict([]) - def attemptAddNPCFriend(self, npcFriend, numCalls = 1): + def attemptAddNPCFriend(self, npcFriend): + numCalls = simbase.air.config.GetInt('sos-card-reward', 1) + if numCalls <= 0: self.notify.warning('invalid numCalls: %d' % numCalls) return 0