refactor cast

This commit is contained in:
bridge
2026-01-03 23:54:47 +08:00
parent 11cef02d74
commit 868e355e41
7 changed files with 26 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ from src.classes.battle import decide_battle, get_assassination_success_rate
from src.classes.story_teller import StoryTeller
from src.classes.normalize import normalize_avatar_name
from src.classes.death import handle_death
from src.classes.death_reason import DeathReason
from src.classes.death_reason import DeathReason, DeathType
from src.classes.kill_and_grab import kill_and_grab
if TYPE_CHECKING:
@@ -119,7 +119,7 @@ class Assassinate(InstantAction):
story_event = Event(self.world.month_stamp, story, related_avatars=rel_ids, is_story=True)
# 死亡清理
handle_death(self.world, target, DeathReason.BATTLE)
handle_death(self.world, target, DeathReason(DeathType.BATTLE, killer_name=self.avatar.name))
return [result_event, story_event]

View File

@@ -139,6 +139,14 @@ class Cast(TimedAction):
# 4. 决策:保留还是卖出
base_desc = f"铸造成功!获得了{self.target_realm.value}{item_label}{new_item.name}』。"
# 事件1铸造成功
events.append(Event(
self.world.month_stamp,
f"{self.avatar.name} 成功铸造{self.target_realm.value}{item_label}{new_item.name}』。",
related_avatars=[self.avatar.id],
is_major=True
))
_, result_text = await handle_item_exchange(
avatar=self.avatar,
new_item=new_item,
@@ -147,6 +155,7 @@ class Cast(TimedAction):
can_sell_new=True
)
# 事件2处置结果
events.append(Event(
self.world.month_stamp,
result_text,