This commit is contained in:
bridge
2025-11-26 21:37:05 +08:00
parent 54cb096bd8
commit 3f7bed61fe
3 changed files with 9 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
"""
长期目标模块
为角色生成和管理长期目标(3-10年
为角色生成和管理长期目标(5-10年
"""
from __future__ import annotations
from dataclasses import dataclass
@@ -34,9 +34,9 @@ def can_generate_long_term_objective(avatar: "Avatar") -> bool:
规则:
1. 已有用户设定的目标,永不自动生成
2. 无目标时,可以生成
3. 距离上次设定 <3年,不生成
3. 距离上次设定 <5年,不生成
4. 距离上次设定 ≥10年必定生成
5. 距离上次设定 3-10年按概率生成渐进概率
5. 距离上次设定 5-10年按概率生成渐进概率
Args:
avatar: 要检查的角色
@@ -56,13 +56,13 @@ def can_generate_long_term_objective(avatar: "Avatar") -> bool:
years_passed = current_year - avatar.long_term_objective.set_year
if years_passed < 3:
if years_passed < 5:
return False
elif years_passed >= 10:
return True
else: # 3-10年之间
# 渐进概率:3年时10%随时间推移逐渐增加接近10年时接近100%
probability = (years_passed - 3) / 7 * 0.9 + 0.1
else: # 5-10年之间
# 渐进概率:5年时10%随时间推移逐渐增加接近10年时接近100%
probability = (years_passed - 5) / 5 * 0.9 + 0.1
return random.random() < probability

View File

@@ -865,8 +865,6 @@ given_name,gender,sect,cond
肃穆,,镇魂宗,
庄严,,镇魂宗,
威武,,镇魂宗,
霸气,,镇魂宗,
正气,,镇魂宗,
凛然,,镇魂宗,
浩大,,镇魂宗,
宏大,,镇魂宗,
1 given_name gender sect cond
865 肃穆 镇魂宗
866 庄严 镇魂宗
867 威武 镇魂宗
霸气 镇魂宗
正气 镇魂宗
868 凛然 镇魂宗
869 浩大 镇魂宗
870 宏大 镇魂宗

View File

@@ -1,4 +1,4 @@
你是一个仙侠世界的决策者,负责为修仙角色设定长期目标,即角色在接下来3-10年内想要达成的目标。
你是一个仙侠世界的决策者,负责为修仙角色设定长期目标,即角色在接下来5-10年内想要达成的目标。
当前世界信息:
{world_info}
@@ -6,7 +6,7 @@
角色信息:
{avatar_info}
全部可执行的动作
全部可执行的动作供你参考
{general_action_infos}
基于以上信息,为该角色设定一个符合其身份、性格、境遇的长期目标。