update technique info

This commit is contained in:
bridge
2025-10-10 23:26:03 +08:00
parent 4929b52543
commit 83a12c4f3c
3 changed files with 4 additions and 8 deletions

View File

@@ -126,7 +126,7 @@ class Avatar:
尽量多打一些因为会用来给LLM进行决策
"""
personas_str = ", ".join([persona.name for persona in self.personas])
technique_str = self.technique.name if self.technique is not None else ""
technique_str = self.technique.get_info()
sect_str = self.get_sect_str()
region_name = self.tile.region.name if self.tile.region is not None else ""
return f"Avatar(id={self.id}, 性别={self.gender}, 年龄={self.age}, name={self.name}, 宗门={sect_str}, 阵营={self.alignment.get_info()}, 区域={region_name}, 灵根={str(self.root)}, 功法={technique_str}, 境界={self.cultivation_progress}, HP={self.hp}, MP={self.mp}, 个性={personas_str})"

View File

@@ -57,6 +57,9 @@ class Technique:
return True
return bool(eval(self.condition, {"__builtins__": {}}, {"avatar": avatar, "Alignment": Alignment}))
def get_info(self) -> str:
return f"{self.name}{self.attribute}{self.grade.value} {self.prompt}"
# 五行与扩展属性的克制关系
# - 五行:金克木,木克土,土克水,水克火,火克金
@@ -139,7 +142,6 @@ def is_attribute_compatible_with_root(attr: TechniqueAttribute, root: Root) -> b
return False
def get_random_technique_for_avatar(avatar) -> Technique:
import random
candidates: List[Technique] = []