Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

如何正确使用plugins功能? #66

Answered by NateScarlet
fatinghenji asked this question in Q&A
Discussion options

You must be logged in to vote

example_custom_training_score.py

super().score(ctx) 是调用父类的 score 方法实现,这里是获取插件未更改前的评分 或者你不调用也可以 那就得纯靠你自己算评分了

比如我期望养成如下的马,应该怎么调整呢?

按当前属性插值 如果没达到标准线就给更高的分,当然如果你把一个训练的分数给太高可能导致总分下降

比如速度我的实现是

spd = _training_single_score(
ctx.speed,
self.speed,
((0, 2.0), (300, 1.0), (600, 0.8), (900, 0.7), (1100, 0.5)),
)

当前0速每点速度给2分 当前300速每点速度给1分 当前600分每点速度给0.8 中间是插值
_training_single_scoremathtools.integrate 的实现是一样的 之后删掉只用 mathtools

example_custom_race_score.py

只有想不到没有做不到

不过 name 是比赛名称 永远不会是 OP GⅠ 如果你要判断比赛级别用 self.grade == Race.GRADE_G1

example_custom_context.py

next_turn 会在每次一个新的回合调用

self.date

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@NateScarlet
Comment options

@fatinghenji
Comment options

@NateScarlet
Comment options

Answer selected by NateScarlet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants