Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions module/umamusume/scenario/configs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
class UraConfig:
skill_event_weight: list[int]
reset_skill_event_weight_list: list[str]

def __init__(self, config: dict):
if "skillEventWeight" not in config or "resetSkillEventWeightList" not in config:
raise ValueError("错误的配置: 必须配置 'skillEventWeight' 和 'resetSkillEventWeightList'")
self.skill_event_weight = config["skillEventWeight"]
self.reset_skill_event_weight_list = config["resetSkillEventWeightList"]

def removeSkillFromList(self, skill: str):
if skill in self.reset_skill_event_weight_list:
self.reset_skill_event_weight_list.remove(skill)
# 如果技能列表空了, 重置权重
# 如果一开始列表就是空的, 这个分支就不会触发, 也不会重置权重
if len(self.reset_skill_event_weight_list) == 0:
self.skill_event_weight = [0, 0, 0]

def getSkillEventWeight(self, date: int) -> int:
if date <= 24:
return self.skill_event_weight[0]
elif date <= 48:
return self.skill_event_weight[1]
else:
return self.skill_event_weight[2]

class AoharuConfig:

preliminary_round_selections: list[int]
Expand All @@ -17,8 +43,9 @@ def get_opponent(self, round_index: int) -> int:

class ScenarioConfig:
""" 所有场景的配置 """

ura_config: UraConfig = None
aoharu_config: AoharuConfig = None

def __init__(self, aoharu_config: AoharuConfig = None):
def __init__(self, ura_config: UraConfig = None, aoharu_config: AoharuConfig = None):
self.ura_config = ura_config
self.aoharu_config = aoharu_config
27 changes: 24 additions & 3 deletions module/umamusume/script/cultivate_task/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def get_operation(ctx: UmamusumeContext) -> TurnOperation | None:
attribute_result = get_training_basic_attribute_score(ctx, ctx.cultivate_detail.turn_info,
ctx.cultivate_detail.expect_attribute)
support_card_result = get_training_support_card_score(ctx)
support_card_event_result = get_support_card_event_score(ctx)
training_level_result = get_training_level_score(ctx)

attribute_result_max = np.max(attribute_result)
Expand Down Expand Up @@ -79,7 +80,8 @@ def get_operation(ctx: UmamusumeContext) -> TurnOperation | None:
training_score = []
for i in range(5):
training_score.append(normalized_attribute_result[i] * attr_weight + normalized_support_card_result[i] *
support_card_weight + normalized_training_level_result[i] * training_level_weight)
support_card_weight + normalized_training_level_result[i] * training_level_weight +
support_card_event_result[i])
# 将权重为-1的训练得分置为0
extra_weight = [0, 0, 0, 0, 0]
date = ctx.cultivate_detail.turn_info.date
Expand Down Expand Up @@ -151,7 +153,7 @@ def get_training_level_score(ctx: UmamusumeContext):
result = []
for i in range(len(expect_attribute)):
result.append(expect_attribute[i] / sum(expect_attribute) * total_score)
log.debug("每个训练设施的得分" + str(result))
log.debug("每个训练设施的得分: " + str(result))
return result


Expand All @@ -163,7 +165,26 @@ def get_training_support_card_score(ctx: UmamusumeContext) -> list[float]:
for j in range(len(turn_info.training_info_list[i].support_card_info_list)):
score += get_support_card_score(ctx, turn_info.training_info_list[i].support_card_info_list[j])
result.append(score)
log.debug("每个训练的支援卡得分:" + str(result))
log.debug("每个训练的支援卡得分: " + str(result))
return result

def get_support_card_event_score(ctx: UmamusumeContext) -> list[float]:
# 只对URA有效
if ctx.task.detail.scenario != ScenarioType.SCENARIO_TYPE_URA:
return [0, 0, 0, 0, 0]
turn_info = ctx.cultivate_detail.turn_info
result = []
for i in range (len(turn_info.training_info_list)):
has_event = False
for j in range(len(turn_info.training_info_list[i].support_card_info_list)):
if turn_info.training_info_list[i].support_card_info_list[j].has_event:
has_event = True
break
if has_event:
result.append(1*ctx.task.detail.scenario_config.ura_config.getSkillEventWeight(ctx.cultivate_detail.turn_info.date))
else:
result.append(0)
log.debug("每个训练的事件得分: " + str(result))
return result


Expand Down
6 changes: 6 additions & 0 deletions module/umamusume/script/cultivate_task/cultivate.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ def script_cultivate_learn_skill(ctx: UmamusumeContext):
if skill_list[k]["skill_name"] == skill_list[j]["subsequent_skill"]:
skill_list[k]["available"] = False

# 如果是URA, 标记已经学习的技能, 可能会用于重置启发事件权重
# 由于上面计算过技能pt,可以保证list里面的技能都会被学到
if ctx.task.detail.scenario == ScenarioType.SCENARIO_TYPE_URA:
for skill in target_skill_list:
ctx.task.detail.scenario_config.ura_config.removeSkillFromList(skill)

# 向上移动至对齐
ctx.ctrl.swipe(x1=23, y1=950, x2=23, y2=968, duration=100, name="")
time.sleep(1)
Expand Down
3 changes: 2 additions & 1 deletion module/umamusume/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def build_task(task_execute_mode: TaskExecuteMode, task_type: int,
td.cultivate_result = {}
# 剧本相关设置
td.scenario_config = ScenarioConfig(
aoharu_config=None if (attachment_data['aoharu_config'] is None) else AoharuConfig(attachment_data['aoharu_config']))
ura_config = None if (attachment_data['ura_config'] is None) else UraConfig(attachment_data['ura_config']),
aoharu_config = None if (attachment_data['aoharu_config'] is None) else AoharuConfig(attachment_data['aoharu_config']))
# 限时: 富士奇石的表演秀
td.fujikiseki_show_mode = attachment_data['fujikiseki_show_mode']
td.fujikiseki_show_difficulty = attachment_data['fujikiseki_show_difficulty']
Expand Down
Binary file added public/assets/10001.f296c5bf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10002.42e4b022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10003.015e898e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10004.4c60d0af.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10005.bea82129.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10006.655a518b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10007.2b0d0d8e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10008.26981b0b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10009.70f66f59.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10010.1e372fa7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10011.acbe8eeb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10012.80efedeb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10013.d0ee55dd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10014.3f9452f7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10015.76b2c22c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10016.327b82d0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10017.761e5fa3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/10018.06e93d7e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20001.0221ffbb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20002.a84fa219.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20003.df0e2614.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20004.eeca68ed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20005.e37ebc32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20006.916a06ab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20007.2bf2063e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/20008.b7ee389e.png
Binary file added public/assets/20009.80bc9907.png
Binary file added public/assets/20010.5cbc2d9a.png
Binary file added public/assets/20011.1e04cfc7.png
Binary file added public/assets/20012.89975106.png
Binary file added public/assets/20013.265f123c.png
Binary file added public/assets/20014.344f093c.png
Binary file added public/assets/30001.cfdfa1b6.png
Binary file added public/assets/30002.d212c41f.png
Binary file added public/assets/30003.5cc1aab8.png
Binary file added public/assets/30004.f405571d.png
Binary file added public/assets/30005.8e340439.png
Binary file added public/assets/30006.e1957b96.png
Binary file added public/assets/30007.6568c9bf.png
Binary file added public/assets/30008.8afdab27.png
Binary file added public/assets/30009.c9569d49.png
Binary file added public/assets/30010.561a26b9.png
Binary file added public/assets/30011.000d0dd6.png
Binary file added public/assets/30012.f77179ca.png
Binary file added public/assets/30013.555fc2ae.png
Binary file added public/assets/30014.91b2ea39.png
Binary file added public/assets/30015.d1864540.png
Binary file added public/assets/40001.098e0fa5.png
Binary file added public/assets/40002.f39f380f.png
Binary file added public/assets/40003.1d24fdce.png
Binary file added public/assets/40004.f76e8b23.png
Binary file added public/assets/40005.1719b169.png
Binary file added public/assets/40006.273a2d83.png
Binary file added public/assets/40007.4cbad3f8.png
Binary file added public/assets/40008.556643cc.png
Binary file added public/assets/40009.776e61e0.png
Binary file added public/assets/40010.c5634a87.png
Binary file added public/assets/40011.3597236e.png
Binary file added public/assets/40012.485a3361.png
Binary file added public/assets/50001.ac9f3554.png
Binary file added public/assets/50002.b9f61623.png
Binary file added public/assets/50003.feae3ae1.png
Binary file added public/assets/50004.3d0280ec.png
Binary file added public/assets/50005.bc140b5e.png
Binary file added public/assets/50006.c19756a4.png
Binary file added public/assets/50007.61c65b44.png
Binary file added public/assets/50008.f588aa8a.png
Binary file added public/assets/50009.4e8bb6a1.png
Binary file added public/assets/50010.fdfc6871.png
Binary file added public/assets/aoharu_btn_bg.be426715.png
767 changes: 0 additions & 767 deletions public/assets/index.4c3c5b3d.js

This file was deleted.

1 change: 1 addition & 0 deletions public/assets/index.866bc821.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

771 changes: 771 additions & 0 deletions public/assets/index.bf056a2e.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/assets/index.e2a87859.css

This file was deleted.

Binary file added public/assets/intelligence.1f71ae89.png
Binary file added public/assets/power.b7dbe78d.png
Loading