Commit a0efbc77 authored by yxli's avatar yxli

Fix Yellow Hints for Attr and Race

parent b12d87aa
Pipeline #35942 passed with stages
in 1 minute and 52 seconds
...@@ -156,13 +156,23 @@ def compare_tags(guess_tags, answer_tags): ...@@ -156,13 +156,23 @@ def compare_tags(guess_tags, answer_tags):
cls = "tag-gray" cls = "tag-gray"
pills.append(f'<span class="tag {cls}">{sym}</span>') pills.append(f'<span class="tag {cls}">{sym}</span>')
return " ".join(pills) return " ".join(pills)
<<<<<<< HEAD
#同属圣王阵营或灵王阵营但属性没猜对则显示黄色 #同属圣王阵营或灵王阵营但属性没猜对则显示黄色
if key == "属性": if key == "属性":
DominusI=["水","炎","暗"] DominusAttr=[
DominusP=["风","地","光"] ["水","炎","暗"],
if ((val1 in DominusI and val2 in DominusI) or (val1 in DominusP and val2 in DominusP)) and val1!= val2: ["风","地","光"]]
cls="tag-yellow" if val1==val2:
cls="tag-green"
else:
for AttrList in DominusAttr:
if val1 in AttrList and val2 in AttrList:
cls="tag-yellow"
break
else:
cls="tag-grey"
return f'<span class="tag {cls}">{val1}</span>'
#官方全卡池中存在1个效果,其中猜的怪兽的种族与答案种族并列(例如,素材中写魔法师族·战士族,效果文中写兽族·兽战士族·鸟兽族) #官方全卡池中存在1个效果,其中猜的怪兽的种族与答案种族并列(例如,素材中写魔法师族·战士族,效果文中写兽族·兽战士族·鸟兽族)
if key == "种族": if key == "种族":
...@@ -197,10 +207,19 @@ def compare_tags(guess_tags, answer_tags): ...@@ -197,10 +207,19 @@ def compare_tags(guess_tags, answer_tags):
["机械","炎"], ["机械","炎"],
["恐龙","岩石","不死"], ["恐龙","岩石","不死"],
["龙","恶魔"]] ["龙","恶魔"]]
for CRace in CorrelatedRaces: if val1==val2:
if val1 in CRace and val2 in CRace and val1!=val2: cls="tag-green"
cls="tag-yellow" else:
for CRace in CorrelatedRaces:
if val1 in CRace and val2 in CRace:
cls="tag-yellow"
break
else:
cls="tag-grey"
return f'<span class="tag {cls}">{val1}</span>'
=======
>>>>>>> 7caf402000d55593b8b80ff5b04d5792f7f255b5
# 数值型字段:攻击、守备、等级、刻度 # 数值型字段:攻击、守备、等级、刻度
if isinstance(val1, numbers.Number): if isinstance(val1, numbers.Number):
diff = abs(val1 - val2) diff = abs(val1 - val2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment