@@ -603,7 +603,7 @@ def _process_player_command(self, cmd: str, conn: player.PlayerConnection) -> No
603603 # the player command ended but signaled that an async dialog should be initiated
604604 topic_async_dialogs .send ((conn , x .dialog ))
605605
606- def go_through_exit (self , player : player .Player , direction : str , evoke : bool = True ) -> None :
606+ def go_through_exit (self , player : player .Player , direction : str , evoke : bool = False ) -> None :
607607 xt = player .location .exits [direction ]
608608 xt .allow_passage (player )
609609 if not xt .target .built :
@@ -818,3 +818,25 @@ def uptime(self) -> Tuple[int, int, int]:
818818 hours , seconds = divmod (uptime .total_seconds (), 3600 )
819819 minutes , seconds = divmod (seconds , 60 )
820820 return int (hours ), int (minutes ), int (seconds )
821+
822+ def prepare_combat_prompt (self ,
823+ attacker : LivingNpc ,
824+ victim : LivingNpc ,
825+ location_title : str ,
826+ location_description : str ,
827+ attacker_msg : str ):
828+ attacker_name = lang .capital (attacker .title )
829+ victim_name = lang .capital (victim .title )
830+
831+ if isinstance (attacker , player .Player ):
832+ attacker_name += "as 'You'"
833+ if isinstance (victim , player .Player ):
834+ victim_name += "as 'You'"
835+
836+ return self .llm_util .combat_prompt .format (attacker = attacker_name ,
837+ victim = victim_name ,
838+ attacker_weapon = attacker .wielding .name ,
839+ victim_weapon = victim .wielding .name ,
840+ attacker_msg = attacker_msg ,
841+ location = location_title ,
842+ location_description = location_description )
0 commit comments