出门历练限流
This commit is contained in:
@@ -588,7 +588,7 @@ class XiuxianPlugin(MessagePluginInterface):
|
||||
until = None
|
||||
if until and until.tzinfo is None:
|
||||
until = until.replace(tzinfo=timezone.utc)
|
||||
if status in ("Unstable_Qi", "Injured") and until and now >= until:
|
||||
if status in ("Unstable_Qi", "Injured", "Expedition") and until and now >= until:
|
||||
player["status"] = "Idle"
|
||||
player["status_until"] = None
|
||||
self._save_player(player)
|
||||
@@ -1123,8 +1123,13 @@ class XiuxianPlugin(MessagePluginInterface):
|
||||
return False, "未注册"
|
||||
player = self._check_status_update(player)
|
||||
st = player.get("status", "Idle")
|
||||
if st in ("Cultivating", "Injured"):
|
||||
if st in ("Cultivating", "Injured", "Expedition"):
|
||||
return False, "状态不可历练"
|
||||
now = datetime.now(timezone.utc)
|
||||
player["status"] = "Expedition"
|
||||
player["status_until"] = (now + timedelta(minutes=20)).isoformat()
|
||||
self._save_player(player)
|
||||
self._rate_set_global(sender, "出门历练")
|
||||
prefix, layer = self._parse_realm(player.get("realm", "炼气1层"))
|
||||
rs = self.realm_score_map.get(prefix, 0)
|
||||
realm_mult = 1.0 + (float(rs) / 100.0)
|
||||
|
||||
Reference in New Issue
Block a user