refactor cast
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user