paper-dynasty-discord/in_game/managerai_responses.py
Cal Corum 8118b4a691 Added PO/FO to fielding roll
Complete /log xcheck and /log groundball
2024-12-06 00:46:49 -06:00

52 lines
1.4 KiB
Python

import pydantic
class AiResponse(pydantic.BaseModel):
ai_note: str = ''
class RunResponse(AiResponse):
min_safe: int | None = None
class JumpResponse(RunResponse):
must_auto_jump: bool = False
run_if_auto_jump: bool = False
class TagResponse(RunResponse):
pass
class UncappedRunResponse(RunResponse):
send_trail: bool = False
trail_min_safe: int = 10
trail_min_safe_delta: int = 0
class ThrowResponse(AiResponse):
cutoff: bool = False # Stops on True
at_lead_runner: bool = True
at_trail_runner: bool = False # Stops on False
trail_max_safe: int = 10
trail_max_safe_delta: int = -6
class DefenseResponse(AiResponse):
hold_first: bool = False
hold_second: bool = False
hold_third: bool = False
outfield_in: bool = False
infield_in: bool = False
corners_in: bool = False
def defender_in(self, position: str):
if self.infield_in and position in ['C', '1B', '2B', '3B', 'SS', 'P']:
return True
elif self.corners_in and position in ['C', '1B', '3B', 'P']:
return True
elif self.outfield_in and position in ['LF', 'CF', 'RF']:
return True
return False