新增战斗/冒险系统
This commit is contained in:
44
Plugins/WPSCombatSystem/combat_plugin_heal.py
Normal file
44
Plugins/WPSCombatSystem/combat_plugin_heal.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""治疗系统插件 - 恢复受伤状态"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PWF.Convention.Runtime.GlobalConfig import ConsoleFrontColor, ProjectConfig
|
||||
|
||||
from .combat_plugin_base import WPSCombatBase
|
||||
|
||||
|
||||
logger: ProjectConfig = ProjectConfig()
|
||||
|
||||
|
||||
class WPSCombatHeal(WPSCombatBase):
|
||||
"""治疗系统插件"""
|
||||
|
||||
def is_enable_plugin(self) -> bool:
|
||||
return True
|
||||
|
||||
def wake_up(self) -> None:
|
||||
super().wake_up()
|
||||
logger.Log(
|
||||
"Info",
|
||||
f"{ConsoleFrontColor.GREEN}WPSCombatHeal 插件已加载{ConsoleFrontColor.RESET}"
|
||||
)
|
||||
self.register_plugin("治疗")
|
||||
self.register_plugin("heal")
|
||||
self.register_plugin("恢复")
|
||||
|
||||
async def callback(self, message: str, chat_id: int, user_id: int) -> Optional[str]:
|
||||
"""
|
||||
处理治疗命令
|
||||
|
||||
命令格式:
|
||||
- 治疗
|
||||
"""
|
||||
service = self.service()
|
||||
success, msg = service.heal_player(user_id)
|
||||
|
||||
return await self.send_markdown_message(msg, chat_id, user_id)
|
||||
|
||||
|
||||
__all__ = ["WPSCombatHeal"]
|
||||
Reference in New Issue
Block a user