From fae8d2273dfad2dd0cf9709f15e24640e7ebfd8d Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Mon, 15 Jul 2024 18:38:53 +0800 Subject: feat(Improve the underlying business directory): Improve the underlying business directory Add { doc | feat | perf | dev } mods --- examples/rules/COC7/__init__.py | 52 ----------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 examples/rules/COC7/__init__.py (limited to 'examples/rules/COC7/__init__.py') diff --git a/examples/rules/COC7/__init__.py b/examples/rules/COC7/__init__.py deleted file mode 100644 index 65f40ab..0000000 --- a/examples/rules/COC7/__init__.py +++ /dev/null @@ -1,52 +0,0 @@ -import math - -from hrc.core import Core -from hrc.rule import Rule, BaseRule # noqa: F401 -from hrc.dependencies import Depends - -from .Character import Attributes -from .Wiki import Wiki -from .Command import Command - -core = Core() - - -class COC7(Rule): - - # 规则、指令、词条,必须至少实现任意一个 - attr: Attributes = Depends() # CharacterCard.Attribute - wiki: Wiki = Depends() # Wiki - cmd: Command = Depends() # Command # noqa: F821 - - @core.event_postprocessor_hook - async def auto_card(self): - if self.session and self.session.gid and self.ac: - if hasattr(self.pc.trans, "生命") or hasattr(self.pc.trans, "理智"): - self.event.call_back( - "set_group_card", self.pc.gid, f"card#{self.pc.uid}", await self.overview_card() - ) - - async def overview_card(self): - max_hp = math.floor( - (self.pc.get("CON", 0) + self.pc.get("SIZ", 0) / 10)) - max_san = math.floor(99 - self.pc.get("CM", 0)) - mp = self.pc.get("MP", 0) - mp_show = ( - " mp" + str(mp) + "/" + str(math.floor(self.pc.get("POW", 0) / 5)) - if mp and mp != math.floor(self.pc.get("POW", 0) / 5) - else "" - ) - return ( - self.pc.get("__Name", "") - + " hp" - + str(self.pc.get("HP", max_hp)) - + "/" - + str(max_hp) - + " san" - + str(self.pc.get("SAN", "?")) - + "/" - + str(max_san) - + mp_show - + " DEX" - + str(self.pc.get("DEX", "?")) - ) -- cgit v1.2.3-70-g09d2