from otree.api import Currency as c from . import pages from ._builtin import Bot from .models import Constants class PlayerBot(Bot): def play_round(self): if self.round_number == 1: yield pages.Instruction if self.round_number == 100: yield pages.InstructionPlayer if self.round_number == 100: yield pages.InstructionUmpire if self.round_number == 1: yield pages.ControlQuestion if self.round_number == 1: yield pages.Results if self.round_number == 1: yield pages.Start if self.round_number == 1: yield pages.Role if self.player.id_in_group != 1 and self.round_number != 1: yield pages.Info if self.player.Info == True: yield pages.DiscoveryUmpire if self.player.id_in_group != 1: yield pages.Contribuzione, dict(contribution=0) if self.player.id_in_group == 1 and self.player.exitpl2 == 0 and self.player.contributionplayer2 < 99 and self.player.partecipantipg >1: yield pages.Punishment2, dict(punishment2=0) if self.player.id_in_group == 1 and self.player.exitpl2 == 0 and self.player.contributionplayer2 > 99 and self.player.partecipantipg >1: yield pages.Punishment2Bribe, dict(bribe2=1, punishment2=0) if self.player.id_in_group == 1 and self.player.exitpl2 == 1 and self.player.partecipantipg > 1: yield pages.NoPunishment2 if self.player.id_in_group == 1 and self.player.exitpl2 == 1 and self.player.partecipantipg <= 1: yield pages.NoPunishment2NoPGExit if self.player.id_in_group == 1 and self.player.exitpl2 == 0 and self.player.partecipantipg <= 1: yield pages.NoPunishment2NoPG if self.player.id_in_group == 1 and self.player.exitpl3 == 0 and self.player.contributionplayer3 < 99 and self.player.partecipantipg >1: yield pages.Punishment3, dict(punishment3=0) if self.player.id_in_group == 1 and self.player.exitpl3 == 0 and self.player.contributionplayer3 > 99 and self.player.partecipantipg >1: yield pages.Punishment3Bribe, dict(bribe3=1, punishment3=0) if self.player.id_in_group == 1 and self.player.exitpl3 == 1 and self.player.partecipantipg > 1: yield pages.NoPunishment3 if self.player.id_in_group == 1 and self.player.exitpl3 == 1 and self.player.partecipantipg <= 1: yield pages.NoPunishment3NoPGExi if self.player.id_in_group == 1 and self.player.exitpl3 == 0 and self.player.partecipantipg <= 1: yield pages.NoPunishment3NOPG if self.player.id_in_group == 1 and self.player.exitpl4 == 0 and self.player.contributionplayer4 < 99 and self.player.partecipantipg >1: yield pages.Punishment4 if self.player.id_in_group == 1 and self.player.exitpl4 == 0 and self.player.contributionplayer4 > 99 and self.player.partecipantipg >1: yield pages.Punishment4Bribe, dict(bribe4=1, punishment4=0) if self.player.id_in_group == 1 and self.player.exitpl4 == 1 and self.player.partecipantipg > 1: yield pages.NoPunishment4 if self.player.id_in_group == 1 and self.player.exitpl4 == 0 and self.player.partecipantipg <= 1: yield pages.NoPunishment4NOPG if self.player.id_in_group == 1 and self.player.exitpl4 == 1 and self.player.partecipantipg <= 1: yield pages.NoPunishment4NOPGEXIT if self.round_number == 1: yield pages.PayoffRound1 if self.round_number != 1: yield pages.Payoff2 if self.round_number == 2: yield pages.Ringraziamento