aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/COC7/__init__.py
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-06-28 18:25:40 +0800
committer简律纯 <i@jyunko.cn>2024-06-28 18:25:40 +0800
commit6dfe2f4a87362a27fe2e97a154daac2f11883284 (patch)
treebd4f28514482042735182d86d2c89dec8d655674 /examples/COC7/__init__.py
parent1b0d67664557e6f0b4a421e1183cee1b0dbca2d3 (diff)
downloadHydroRollCore-6dfe2f4a87362a27fe2e97a154daac2f11883284.tar.gz
HydroRollCore-6dfe2f4a87362a27fe2e97a154daac2f11883284.zip
style: ruff format code
Diffstat (limited to 'examples/COC7/__init__.py')
-rw-r--r--examples/COC7/__init__.py37
1 files changed, 27 insertions, 10 deletions
diff --git a/examples/COC7/__init__.py b/examples/COC7/__init__.py
index ecd2091..01efe57 100644
--- a/examples/COC7/__init__.py
+++ b/examples/COC7/__init__.py
@@ -6,19 +6,36 @@ core = Core()
@core.event_post_processor_hook
-async def auto_card(_event='T_Event'):
+async def auto_card(_event="T_Event"):
g = core.session
pc = player_card
if g and core.session.gid and g.ac:
- if hasattr(pc.trans, '生命') or hasattr(pc.trans, '理智'):
- core.session.call("set_group_card", pc.gid, f"card#{pc.uid}", await overview_card(pc.char))
+ if hasattr(pc.trans, "生命") or hasattr(pc.trans, "理智"):
+ core.session.call(
+ "set_group_card", pc.gid, f"card#{pc.uid}", await overview_card(pc.char)
+ )
async def overview_card(pc: player_card):
- max_hp = math.floor((pc.get('CON', 0) + pc.get('SIZ', 0) / 10))
- max_san = math.floor(99 - pc.get('CM', 0))
- mp = pc.get('MP', 0)
- mp_show = " mp" + str(mp) + "/" + str(
- math.floor(pc.get('POW', 0) / 5)
- ) if mp and mp != math.floor(pc.get('POW', 0) / 5) else ""
- return pc.get('__Name', "") + " hp" + str(pc.get('HP', max_hp)) + "/" + str(max_hp) + " san" + str(pc.get('SAN', "?")) + "/" + str(max_san) + mp_show + " DEX" + str(pc.get('DEX', "?"))
+ max_hp = math.floor((pc.get("CON", 0) + pc.get("SIZ", 0) / 10))
+ max_san = math.floor(99 - pc.get("CM", 0))
+ mp = pc.get("MP", 0)
+ mp_show = (
+ " mp" + str(mp) + "/" + str(math.floor(pc.get("POW", 0) / 5))
+ if mp and mp != math.floor(pc.get("POW", 0) / 5)
+ else ""
+ )
+ return (
+ pc.get("__Name", "")
+ + " hp"
+ + str(pc.get("HP", max_hp))
+ + "/"
+ + str(max_hp)
+ + " san"
+ + str(pc.get("SAN", "?"))
+ + "/"
+ + str(max_san)
+ + mp_show
+ + " DEX"
+ + str(pc.get("DEX", "?"))
+ )