add technique
This commit is contained in:
@@ -30,6 +30,7 @@ from .battle import Battle
|
||||
from .plunder_mortals import PlunderMortals
|
||||
from .help_mortals import HelpMortals
|
||||
from .talk import Talk
|
||||
from .devour_mortals import DevourMortals
|
||||
|
||||
# 注册到 ActionRegistry(标注是否为实际可执行动作)
|
||||
register_action(actual=False)(Action)
|
||||
@@ -56,6 +57,7 @@ register_action(actual=False)(Battle)
|
||||
register_action(actual=True)(PlunderMortals)
|
||||
register_action(actual=True)(HelpMortals)
|
||||
register_action(actual=True)(Talk)
|
||||
register_action(actual=True)(DevourMortals)
|
||||
|
||||
__all__ = [
|
||||
# 基类
|
||||
@@ -84,6 +86,7 @@ __all__ = [
|
||||
"PlunderMortals",
|
||||
"HelpMortals",
|
||||
"Talk",
|
||||
"DevourMortals",
|
||||
]
|
||||
|
||||
|
||||
|
||||
44
src/classes/action/devour_mortals.py
Normal file
44
src/classes/action/devour_mortals.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from src.classes.action import TimedAction
|
||||
from src.classes.event import Event
|
||||
from src.classes.region import CityRegion
|
||||
from src.classes.alignment import Alignment
|
||||
|
||||
|
||||
class DevourMortals(TimedAction):
|
||||
"""
|
||||
吞噬凡人:仅邪阵营可在城市区域执行,获得大量修炼经验。
|
||||
与普通修炼相比,经验获取显著更高。
|
||||
"""
|
||||
|
||||
COMMENT = "在城镇吞噬凡人,获得大量修行经验(邪修)"
|
||||
DOABLES_REQUIREMENTS = "仅限城市区域,且角色阵营为‘邪’,且未处于瓶颈"
|
||||
PARAMS = {}
|
||||
|
||||
duration_months = 2
|
||||
EXP_GAIN = 2000
|
||||
|
||||
def _execute(self) -> None:
|
||||
region = self.avatar.tile.region
|
||||
if not isinstance(region, CityRegion):
|
||||
return
|
||||
if self.avatar.cultivation_progress.is_in_bottleneck():
|
||||
return
|
||||
self.avatar.cultivation_progress.add_exp(self.EXP_GAIN)
|
||||
|
||||
def can_start(self) -> bool:
|
||||
region = self.avatar.tile.region
|
||||
if not isinstance(region, CityRegion):
|
||||
return False
|
||||
if self.avatar.alignment != Alignment.EVIL:
|
||||
return False
|
||||
return not self.avatar.cultivation_progress.is_in_bottleneck()
|
||||
|
||||
def start(self) -> Event:
|
||||
return Event(self.world.month_stamp, f"{self.avatar.name} 在城镇开始吞噬凡人")
|
||||
|
||||
def finish(self) -> list[Event]:
|
||||
return []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user