2022-04-19 23:22:44 +02:00
|
|
|
from os import stat
|
|
|
|
from re import S
|
|
|
|
from acts import *
|
|
|
|
|
|
|
|
|
|
|
|
def check_condition(state, conditions, type=all):
|
|
|
|
if type(i in state for i in conditions):
|
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
2022-04-20 10:55:53 +02:00
|
|
|
def taktyka_dialogu(state, frame):
|
|
|
|
if should_respond_gently(frame):
|
2022-04-19 23:22:44 +02:00
|
|
|
return [hello_act, name_response_act]
|
2022-04-20 10:55:53 +02:00
|
|
|
if should_prompt(frame):
|
2022-04-20 10:21:57 +02:00
|
|
|
return [hello_act, help_response_act]
|
2022-04-20 10:55:53 +02:00
|
|
|
if should_respond_cold(frame):
|
2022-04-19 23:22:44 +02:00
|
|
|
return [name_response_act]
|
|
|
|
return [unknown_act]
|
|
|
|
|
|
|
|
|
|
|
|
def should_respond_gently(state):
|
2022-04-20 10:55:53 +02:00
|
|
|
return check_condition(state, [hello_act, name_request_act])
|
2022-04-19 23:22:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
def should_prompt(state):
|
|
|
|
return check_condition(state, [hello_act], any)
|
|
|
|
|
|
|
|
|
|
|
|
def should_respond_cold(state):
|
|
|
|
return check_condition(state, [name_request_act])
|