Skip to content

Commit

Permalink
feat(single-mode): not log item score by default
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Mar 26, 2022
1 parent 27215ae commit e39ac0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions auto_derby/single_mode/item/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ class g:
name_label_similarity_threshold: Dict[int, float] = {}
prompt_disabled = False
explain_effect_summary = False
explain_score = False
8 changes: 4 additions & 4 deletions auto_derby/single_mode/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def effect_score(
if s:
explain = "{s:.2f} by max vitality"

if explain:
if g.explain_score and explain:
_LOGGER.debug(
"%s effect score: %.2f for %s: %s", self, ret, command, explain
)
Expand Down Expand Up @@ -181,7 +181,7 @@ def expected_effect_score(self, ctx: Context, command: Command) -> float:
explain += f"{r*100:+.0f}% by quantity;"
ret *= 1 + r

if explain:
if g.explain_score and explain:
_LOGGER.debug("%s expected effect score: %.2f: %s", self, ret, explain)
assert ret >= 0, ret
return ret
Expand Down Expand Up @@ -380,7 +380,7 @@ def exchange_score(self, ctx: Context) -> float:
explain += f"{r*100:+.0f}% by quantity;"
ret *= 1 + r

if explain:
if g.explain_score and explain:
_LOGGER.debug("%s exchange score: %.2f: %s", self, ret, explain)
return ret

Expand Down Expand Up @@ -417,7 +417,7 @@ def expected_exchange_score(self, ctx: Context) -> float:
explain += f"{r*100:+.0f}% by turns;"
ret *= 1 + r

if explain:
if g.explain_score and explain:
_LOGGER.debug("%s expected exchange score: %.2f: %s", self, ret, explain)
assert ret >= 0, ret
return ret
Expand Down
1 change: 1 addition & 0 deletions plugins/debug_item_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Plugin(auto_derby.Plugin):
def install(self) -> None:
item.g.explain_effect_summary = True
item.g.explain_score = True


auto_derby.plugin.register(__name__, Plugin())

0 comments on commit e39ac0b

Please sign in to comment.