from otree.api import Currency as c, currency_range
from . import pages
from ._builtin import Bot
from .models import Constants
import random

class PlayerBot(Bot):
    def play_round(self):

        if self.participant.vars['app_sequence_select'] % 2 == 0:

            if self.round_number == 1:
                yield (pages.Bienvenue)
                yield (pages.Introduction, {
                       "r1": 98,
                       "r2":2,
                       "r3":5,
                       "r4":110,
                })

            yield (pages.NextPage, {})

            keep_amount = random.randint(0, self.player.dot1)
            sent_amount = self.player.dot1 - keep_amount
            yield (pages.Send, {
                "keep_amount": keep_amount,
                "sent_amount": sent_amount,
            })

            if self.round_number == 8:
                yield (pages.Questionnaire, {
                    'altruistic_assessment_dcl': 1,
                    'confidence_level_dcl': 1,
                    'memory_recall_dcl': 1,
                })
            # if self.round_number == 8:
            #     yield (pages.Results, {
            #     })


            #if self.player.id_in_group == 1:

