Update app.py
Browse files
app.py
CHANGED
@@ -128,15 +128,22 @@ def generate_others_locations_knowledge(suspect):
|
|
128 |
chance = random.random()
|
129 |
if chance < 0.5:
|
130 |
# They know where the other was
|
131 |
-
knowledge[other["name"]] = f"
|
132 |
elif chance < 0.75:
|
133 |
# They are unsure
|
134 |
-
knowledge[other["name"]] = "
|
135 |
else:
|
136 |
# They don't know
|
137 |
-
knowledge[other["name"]] = "
|
138 |
return knowledge
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
def get_ai_response(suspect_name, player_input):
|
141 |
suspect = suspects[suspect_name]
|
142 |
game_state["turns"] += 1
|
@@ -288,10 +295,12 @@ def bluff(player_input):
|
|
288 |
|
289 |
def analyze_response():
|
290 |
game_state["turns"] += 1
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
|
|
|
|
295 |
|
296 |
def handle_accusation(player_input):
|
297 |
suspect_guess = None
|
|
|
128 |
chance = random.random()
|
129 |
if chance < 0.5:
|
130 |
# They know where the other was
|
131 |
+
knowledge[other["name"]] = f"was in the {other['alibi_location']}."
|
132 |
elif chance < 0.75:
|
133 |
# They are unsure
|
134 |
+
knowledge[other["name"]] = "you are not sure where they were."
|
135 |
else:
|
136 |
# They don't know
|
137 |
+
knowledge[other["name"]] = "you have no idea where they were."
|
138 |
return knowledge
|
139 |
|
140 |
+
def analyze_tone(player_input):
|
141 |
+
accusatory_words = ["did you", "murderer", "kill", "guilty", "crime", "weapon", "suspect"]
|
142 |
+
if any(word in player_input.lower() for word in accusatory_words):
|
143 |
+
return "accusatory"
|
144 |
+
else:
|
145 |
+
return "neutral"
|
146 |
+
|
147 |
def get_ai_response(suspect_name, player_input):
|
148 |
suspect = suspects[suspect_name]
|
149 |
game_state["turns"] += 1
|
|
|
295 |
|
296 |
def analyze_response():
|
297 |
game_state["turns"] += 1
|
298 |
+
# For simplicity, we'll simulate the outcome
|
299 |
+
success = random.choice([True, False])
|
300 |
+
if success:
|
301 |
+
return "You successfully detect that the suspect is lying!"
|
302 |
+
else:
|
303 |
+
return "You fail to detect any lies."
|
304 |
|
305 |
def handle_accusation(player_input):
|
306 |
suspect_guess = None
|