Exemplo n.º 1
0
 def update_talk_request(self, agent, idx, content):
     idx = str(idx).zfill(3)
     if agent != self.mode and content[0] == self.agentIdx:
         requestContent = splitText.splitText(content[1])
         if requestContent[0] == "DIVINED" or requestContent[0] == "VOTE":
             self.DISAGREESentenceQue.append(
                 (requestContent[0], str(self.day).zfill(2), idx))
Exemplo n.º 2
0
 def update_talk_request(self, row, content):
     idx = str(row[1]["idx"]).zfill(3)
     content_ = splitText.splitText(content[2])
     if len(content_) >= 1:
         if content_[0] == "COMINGOUT" and (content_[1] == "ANY" or
                                            content_[1] == self.agentIdx):
             self.co_rate = 2
             self.agree_co = ("TALK", str(self.day).zfill(2), idx)
Exemplo n.º 3
0
 def update_talk(self, row):
     text, agent = row[1]["text"], int(row[1]["agent"]) - 1
     texts = splitText.parse_text(text)
     for text in texts:
         content = splitText.splitText(text)
         if len(content) != 0 and content[0] == "VOTE":
             self.istalk_vote[agent] = True
         if len(content) != 0 and content[0] == "REQUEST" and (content[1] == "ANY" or content[1] == self.agentIdx):
             self.update_talk_request(row, content)
Exemplo n.º 4
0
 def update_talk(self, row):
     text, agent = row[1]["text"], int(row[1]["agent"]) - 1
     texts = splitText.parse_text(text)
     for text in texts:
         content = splitText.splitText(text)
         if len(content) != 0:
             self.update_talk_repel(agent, content)
             self.update_talk_agreedisagree(agent, row[1]["idx"], content)
             self.update_talk_request(agent, row[1]["idx"], content)
             if self.myrole == "WEREWOLF":
                 self.update_talk_divine(agent, content)
Exemplo n.º 5
0
 def update_talk_agreedisagree(self, agent, idx, content):
     super().update_talk_agreedisagree(agent, idx, content)
     if content[0] == "REQUEST" and content[1] == self.agentIdx:
         text2 = content[2]
         content2 = splitText.splitText(text2)
         if content2[0] == "DIVINE":
             if content2[1] == self.talk_voteop:
                 self.requestdivine = content2[1]
                 self.AGREESentenceQue.append(
                     ("TALK", str(self.day).zfill(2), idx))
             else:
                 self.DISAGREESentenceQue.append(
                     ("TALK", str(self.day).zfill(2), idx))
Exemplo n.º 6
0
 def update_talk(self, row):
     text, agent = row[1]["text"], int(row[1]["agent"]) - 1
     texts = splitText.parse_text(text)
     for text in texts:
         content = splitText.splitText(text)
         if len(content) != 0:
             if self.myrole == "VILLAGER" or self.myrole == "SEER":
                 self.update_talk_suspicion_villager(agent, content)
             else:
                 self.update_talk_suspicion_werewolf(agent, content)
             self.update_talk_agreedisagree(agent, row[1]["idx"], content)
             if content[0] == "REQUEST" and (content[1] == "ANY" or
                                             content[1] == self.agentIdx):
                 self.update_talk_request(row, content)
Exemplo n.º 7
0
 def update_talk_agreedisagree(self, agent, idx, content):
     super().update_talk_agreedisagree(agent, idx, content)
     if content[0] == "REQUEST" and content[1] == self.agentIdx:
         text2 = content[2]
         content2 = splitText.splitText(text2)
         if content2[0] == "DIVINE":
             if content2[1] == int(
                     sorted(self.suspicion.items(),
                            key=lambda x: x[1])[-1][0]):
                 self.requestdivine = content2[1]
                 self.AGREESentenceQue.append(
                     ("TALK", str(self.day).zfill(2), idx))
             else:
                 self.DISAGREESentenceQue.append(
                     ("TALK", str(self.day).zfill(2), idx))
Exemplo n.º 8
0
 def update_talk_request(self, row, content):
     idx = str(row[1]["idx"]).zfill(3)
     content_ = splitText.splitText(content[2])
     if len(content_) >= 1:
         if content_[0] == "VOTE" and self.voteop == None and content_[1] != self.agentIdx:
             if content_[1] == "ANY":
                 return
             self.voteop = content_[1]
             self.request_vote = True
             self.request_vote_agree = (
                 ("TALK", str(self.day).zfill(2), idx))
         elif content_[0] == "VOTE" and self.voteop == content_[1]:
             self.Agreeque.append(("TALK", str(self.day).zfill(2), idx))
         if content_[0] == "DIVINE":
             self.divineop = content_[1]
         if content_[0] == "COMINGOUT":
             self.isCo = False
             self.agree_co = ("TALK", str(self.day).zfill(2), idx)
Exemplo n.º 9
0
 def update_divine(self, row):
     text = row[1]["text"]
     content = splitText.splitText(text)
     if content[2] == "WEREWOLF" or content[2] == "POSSESSED":
         self.suspicion[str(content[1])] += 100
     self.divineans = (content[1], content[2])
Exemplo n.º 10
0
 def update_divine(self, row):
     text = row[1]["text"]
     content = splitText.splitText(text)
     self.divineans = (content[1], content[2])