diff options
| -rw-r--r-- | examples/COC7/Wiki.py | 3 | ||||
| -rw-r--r-- | examples/COC7/__init__.py | 14 | ||||
| -rw-r--r-- | hrc/__init__.py | 2 | ||||
| -rw-r--r-- | hrc/core.py | 3 | ||||
| -rw-r--r-- | hrc/rule/__init__.py | 2 |
5 files changed, 9 insertions, 15 deletions
diff --git a/examples/COC7/Wiki.py b/examples/COC7/Wiki.py index 62b66ab..e6a730a 100644 --- a/examples/COC7/Wiki.py +++ b/examples/COC7/Wiki.py @@ -1,2 +1 @@ -# MyRule - +# MyRule
\ No newline at end of file diff --git a/examples/COC7/__init__.py b/examples/COC7/__init__.py index 50db8f4..232ed4d 100644 --- a/examples/COC7/__init__.py +++ b/examples/COC7/__init__.py @@ -1,6 +1,6 @@ import math -from hrc import Core, player_card +from hrc.core import Core from hrc.rule import Rule, BaseRule from hrc.dependencies import Depends @@ -12,10 +12,10 @@ core = Core() class COC7(Rule): - attr: Attributes = Depends() # 必须实现一个继承自 Character.Attribute 的类 - wiki: Wiki = Depends() # 可选实现一个 Wiki + attr: Attributes = Depends() # 必须实现一个继承自 Character.Attribute 的子类 + wiki: Wiki = Depends() # 可选实现一个 Wiki 类 - @core.event_post_processor_hook + # @core.event_post_processor_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, "理智"): @@ -45,8 +45,4 @@ class COC7(Rule): + mp_show + " DEX" + str(self.pc.get("DEX", "?")) - ) - - -print(COC7) -print(COC7.attr)
\ No newline at end of file + )
\ No newline at end of file diff --git a/hrc/__init__.py b/hrc/__init__.py index 29021d3..ba4efed 100644 --- a/hrc/__init__.py +++ b/hrc/__init__.py @@ -1,7 +1,7 @@ from .LibCore import * # noqa: F403 from . import rule # noqa: F401 -from .core import Core # noqa: F401 +from . import core # noqa: F401 from . import log # noqa: F401 from . import exceptions # noqa: F401 from . import config # noqa: F401 diff --git a/hrc/core.py b/hrc/core.py index 94b9205..b346654 100644 --- a/hrc/core.py +++ b/hrc/core.py @@ -514,8 +514,7 @@ class Core: for _rule in self.rules: if _rule.__name__ == rule_class.__name__: logger.warning( - f'Already have a same name rule pack "{ - _rule.__name__}"' + f'Already have a same name rule pack "{_rule.__name__}"' ) rule_class.__rule_load_type__ = rule_load_type rule_class.__rule_file_path__ = rule_file_path diff --git a/hrc/rule/__init__.py b/hrc/rule/__init__.py index bbd2cfe..66ad686 100644 --- a/hrc/rule/__init__.py +++ b/hrc/rule/__init__.py @@ -22,7 +22,7 @@ from typing_extensions import Annotated, get_args, get_origin from ..config import ConfigModel -# from ..dependencies import Depends +from ..dependencies import Depends from ..event import Event from ..exceptions import SkipException, StopException from ..typing import ConfigT, EventT, StateT |
