Exemple #1
0
    def talk(self):

        #COTrigerがTrueならCO
        if (self.COTrigger()):
            self.isCO = True
            return ttf.comingout(self.agentIdx, 'SEER')

        #COしたら言っていない結果がなくなるまでdivined
        if (self.isCO and len(self.willSay) > 0):
            target = self.willSay[0]['target']
            result = self.willSay[0]['result']
            self.willSay.pop(0)
            return ttf.divined(target, result)

        #VOTE宣言(明確な偽、自分への黒出し、最黒)
        target = self.MyTarget()
        if (self.willvote != target):
            self.willvote = target
            return ttf.vote(self.willvote)

        #ESTIMATE宣言
        if (self.myData.getTurn() < 10):
            talk = self.Estimate(self.willvote)
            if (talk != None): return talk

        return ttf.over()
Exemple #2
0
    def talk(self):

        #COTrigerがTrueならCO
        if self.COTrigger():
            self.isCO = True
            return ttf.comingout(self.agentIdx,'SEER')

        #2日目PPCO
        if self.myData.getToday() == 2 and self.PosCOTrigger():
            self.isPosCO = True
            return ttf.comingout(self.agentIdx,'POSSESSED')

        #COしたらdivined
        if(len(self.result) > 0 and not self.isPosCO):
            rand_x = random.randrange(10)
            threshhold = int(20 / math.pi * math.atan(self.myData.getTurn() - 1))
            rand_y = random.randrange(threshhold if threshhold > 1 else 1)
            if (self.isCO and rand_x <= rand_y):
                target = list(self.result.keys())[0]
                result = self.result[target]
                del self.result[target]
                return ttf.divined(target, result)

        #VOTE宣言
        if(self.willvote != self.MyTarget()):
            self.willvote = self.MyTarget()
            return ttf.vote(self.willvote)

        #ESTIMATE宣言
        if(self.myData.getTurn() < 10):
            talk = self.Estimate(self.willvote)
            if(talk != None):   return talk

        return ttf.over()
Exemple #3
0
    def talk(self):

        self.isFollow = False

        # COTrigerがTrueならCO
        if (self.SeerCOTrigger() and not self.isSeerCO):
            self.isSeerCO = True
            return ttf.comingout(self.agentIdx, 'SEER')

        # COしたら言っていない結果がなくなるまでdivined
        if (self.isSeerCO and len(self.myDivine) > 0):
            target = self.myDivine[0]
            result = self.divined[target]
            self.myDivine.pop(0)
            if (target != self.agentIdx):
                return ttf.divined(target, result)

        # 扇動受けるメソッド
        requests = self.myData.getRequestTodayMe()
        if requests != None:
            x = random.randint(0, 3)
            y = random.randint(0, 5)
            if len(requests) > 0 and x > y:
                for request in requests:
                    if request.getContent() in ['ESTIMATE']:
                        talk = self.Estimate(request.getTarget2())
                        if (talk != None): return talk
                    if request.getContent() in ['VOTE']:
                        target = request.getTarget2()
                        self.willvote = target
                        self.isFollow = True
                        return ttf.vote(target)

        #VOTE宣言(明確な偽、自分への黒出し、最黒)
        target = self.MyTarget()
        if (self.willvote != target):
            self.willvote = target
            return ttf.vote(self.willvote)

        #ESTIMATE宣言
        if (self.myData.getTurn() < 10):
            talk = self.Estimate(self.willvote)
            if (talk != None): return talk

        #REQUEST宣言
        if (self.isRequest or self.isRequestAll):
            if (not self.isSeerCO):  #占いCOしていない場合
                fakeSeers = self.alivefakeSeers + self.alivefakeMediums
                talk = self.Request(fakeSeers)
                if (talk != None): return talk

        return ttf.over()
Exemple #4
0
    def talk(self):

        if self.isSeerCO and self.doDivine:
            if self.myData.getToday() > 1:
                execute = self.myData.getExecutedAgent()
                if execute in self.divineList: self.divineList.remove(execute)
            target, result = self.PossessedDivine()
            self.myDivine.append(target)
            self.doDivine = False

        #2日目以降COの場合,Divineを規定回数するために
        if self.isSeerCO:
            if len(self.divined) < self.myData.getToday():
                target, result = self.PossessedDivine()
                self.myDivine.append(target)
        '''
        if self.myData.getToday() == 1 and self.doDivine:
            if self.myData.getTurn() == 1:
                execute = self.myData.getExecutedAgent()
                if (execute in self.divineList): self.divineList.remove(execute)
                target, result = self.PossessedDivine()
                self.myDivine.append(target)
                self.doDivine = False
        elif(self.myData.getToday() >=2 and self.doDivine):
            execute = self.myData.getExecutedAgent()
            if (execute in self.divineList): self.divineList.remove(execute)
            target, result = self.PossessedDivine()
            self.myDivine.append(target)
            self.doDivine = False
        '''

        #COTrigerがTrueならCO
        if (self.COTrigger() and not self.isSeerCO):
            self.isSeerCO = True
            return ttf.comingout(self.agentIdx, 'SEER')

        #PPTrigerがTrueなら確率で人狼・狂人CO
        if (self.PPTrigger() and not self.isBlackCO):
            self.isBlackCO = True
            x = random.randint(1, 2)
            if (x == 1):
                return ttf.comingout(self.agentIdx, 'WEREWOLF')
            else:
                return ttf.comingout(self.agentIdx, 'POSSESSED')

        #PPTriggerがTrueなら生き残り全員に黒出す
        if (self.PPTrigger() and len(self.aliveList) > 0):
            self.doPP = True
            target = self.aliveList[0]
            self.aliveList.pop(0)
            return ttf.divined(target, 'WEREWOLF')

        #COしたら言っていない結果がなくなるまでdivined
        if (self.isSeerCO and len(self.myDivine) > 0):
            target = self.myDivine[0]
            result = self.divined[target]
            self.myDivine.pop(0)
            return ttf.divined(target, result)

        #VOTE宣言(明確な偽、自分への黒出し、最黒)
        target = self.MyTarget()
        if (self.willvote != target):
            self.willvote = target
            return ttf.vote(self.willvote)

        #狼陣営と予測された人からのリクエスト受付
        requests = self.myData.getRequestTodayMe()
        if requests != None:
            wolf = self.myData.getMaxLikelyWolfAll()
            x = random.randint(0, 10)
            y = random.randint(0, 2)
            if len(requests) > 0 and x > y:
                for request in requests:
                    if (request.getAgent() in self.flatten([
                            self.fakeMediums, self.fakeSeers, self.fakeMedium,
                            self.fakeSeer, self.werewolves
                    ]) or request.getAgent()
                            == wolf):  #2重リストやとうまくいかないっぽいのでフラットにする
                        if request.getContent() in ['ESTIMATE']:
                            talk = self.Estimate(request.getTarget2())
                            if (talk != None): return talk
                        if request.getContent() in ['VOTE']:
                            target = request.getTarget2()
                            if (target != self.agentIdx):
                                self.willvote = target
                                self.isFollow = True
                                return ttf.vote(target)

        #ESTIMATE宣言
        if (self.myData.getTurn() < 10):
            talk = self.Estimate(self.willvote)
            if (talk != None): return talk
        '''
        #BGCO
        if(self.blacked and not self.isCall and not self.isSeerCO):
            self.isCall = True
            return ttf.comingout(self.agentIdx,'BODYGUARD')
        '''

        return ttf.over()