适配巡猎武器

This commit is contained in:
qwerdvd 2023-05-28 20:18:12 +08:00
parent f4141646d7
commit c2f026a9b5
4 changed files with 301 additions and 105 deletions

View File

@ -12,7 +12,6 @@ class Seele(BaseAvatar):
def __init__(self, char: Dict, skills: List): def __init__(self, char: Dict, skills: List):
super().__init__(char=char, skills=skills) super().__init__(char=char, skills=skills)
self.Buff = BaseAvatarBuff(char=char, skills=skills)
self.eidolon_attribute = {} self.eidolon_attribute = {}
self.extra_ability_attribute = {} self.extra_ability_attribute = {}
self.eidolons() self.eidolons()

View File

@ -36,9 +36,11 @@ class BaseAvatarBuff:
class BaseAvatar: class BaseAvatar:
Skill: BaseSkills Skill: BaseSkills
Buff: BaseAvatarBuff
def __init__(self, char: Dict, skills: List): def __init__(self, char: Dict, skills: List):
self.Skill = BaseSkills(char=char, skills=skills) self.Skill = BaseSkills(char=char, skills=skills)
self.Buff = BaseAvatarBuff(char=char, skills=skills)
self.avatar_id = char['id'] self.avatar_id = char['id']
self.avatar_level = char['level'] self.avatar_level = char['level']
self.avatar_rank = char['rank'] self.avatar_rank = char['rank']

View File

@ -32,23 +32,18 @@
] ]
}, },
"唯有沉默": { "21003": {
"enable": true, "Param": {
"trigger": {
"enemyCount": 2
},
"step": null,
"attrChange": {
"CriticalChance": [ "CriticalChance": [
0.12, 0.12000000011175871,
0.15, 0.1500000001396984,
0.18, 0.18000000016763806,
0.21, 0.21000000019557774,
0.24 0.24000000022351742
] ]
} }
}, },
"如泥酣眠": { "23012": {
"enable": false "enable": false
}, },
"24001": { "24001": {
@ -76,106 +71,86 @@
0.1600000001490116 0.1600000001490116
] ]
}, },
"春水初生": { "21024": {
"enable": true, "Param": {
"trigger": {
"initBattle": true
},
"attrChange": {
"SpeedAddedRatio": [ "SpeedAddedRatio": [
0.08, 0.0800000000745058,
0.09, 0.09000000008381903,
0.1, 0.10000000009313226,
0.11, 0.11000000010244548,
0.12 0.12000000011175871
] ],
}, "AllDamageAddedRatio": [
"Dmg": [ 0.12000000011175871,
0.12, 0.1500000001396984,
0.15, 0.18000000016763806,
0.18, 0.21000000019557774,
0.21, 0.24000000022351742
0.24
]
},
"点个关注吧!": {
"enable": true,
"trigger": {
"fullSP": true
},
"A_finalDmg": [
0.24,
0.3,
0.36,
0.42,
0.48
],
"E_finalDmg": [
0.24,
0.3,
0.36,
0.42,
0.48
]
},
"相抗": {
"enable": true,
"trigger": {
"eliminateEnemy": true
},
"attrChange": {
"SpeedAddedRatio": [
0.1,
0.12,
0.14,
0.16,
0.18
] ]
} }
}, },
"离弦": { "21017": {
"enable": true, "Param": {
"trigger": { "a_dmg": [
"eliminateEnemy": true 0.24000000022351742,
}, 0.3000000002793968,
"attrChange": { 0.3600000003352761,
"SpeedAddedRatio": [ 0.4200000003911555,
0.24, 0.48000000044703484
0.3, ],
0.36, "e_dmg": [
0.42, 0.24000000022351742,
0.48 0.3000000002793968,
0.3600000003352761,
0.4200000003911555,
0.48000000044703484
] ]
} }
}, },
"论剑": { "20014": {
"enable": true, "Param": {
"trigger": { "SpeedAddedRatio": [
"focusEnemy": true 0.10000000009313226,
}, 0.12000000011175871,
"Dmg": [ 0.14000000013038516,
0.08, 0.1600000001490116,
0.1, 0.18000000016763806
0.12, ]
0.14, }
0.16
]
}, },
"重返幽冥": { "20007": {
"Param": {
"AttackAddedRatio": [
0.24000000022351742,
0.3000000002793968,
0.3600000003352761,
0.4200000003911555,
0.48000000044703484
]
}
},
"21010": {
"Param": {
"AllDamageAddedRatio": [
0.0800000000745058,
0.10000000009313226,
0.12000000011175871,
0.14000000013038516,
0.1600000001490116
]
}
},
"21031": {
"enable": false "enable": false
}, },
"锋镝": { "20000": {
"enable": true, "Param": {
"trigger": {
"initBattle": true
},
"attrChange": {
"CriticalChance": [ "CriticalChance": [
0.12, 0.12000000011175871,
0.15, 0.1500000001396984,
0.18, 0.18000000016763806,
0.21, 0.21000000019557774,
0.24 0.24000000022351742
] ]
} }
} }

View File

@ -14,6 +14,196 @@ with open(path / 'Excel' / 'weapon_effect.json', 'r', encoding='utf-8') as f:
mp.dps = 14 mp.dps = 14
class Arrows(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者消灭敌方目标
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
critical_chance_base = attribute_bonus.get('CriticalChance', 0)
attribute_bonus['CriticalChance'] = critical_chance_base + mp.mpf(
weapon_effect['20000']['Param']['CriticalChance'][
self.weapon_rank - 1
]
)
return attribute_bonus
class ReturntoDarkness(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者消灭敌方目标
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
pass
return attribute_bonus
class Swordplay(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者消灭敌方目标
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
all_damage_added_ratio = attribute_bonus.get(
'AllDamageAddedRatio', 0
)
attribute_bonus[
'AllDamageAddedRatio'
] = all_damage_added_ratio + mp.mpf(
weapon_effect['21010']['Param']['AllDamageAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
class DartingArrow(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者消灭敌方目标
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
weapon_effect['20007']['Param']['AttackAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
class Adversarial(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者消灭敌方目标
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
attribute_bonus['SpeedAddedRatio'] = speed_added_ratio + mp.mpf(
weapon_effect['20014']['Param']['SpeedAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
class SubscribeforMore(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 装备者的当前能量值等于其能量上限
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0)
attribute_bonus['NormalDmgAdd'] = normal_dmg_add + (
mp.mpf(
weapon_effect['21017']['Param']['a_dmg'][
self.weapon_rank - 1
]
)
* 2
)
bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0)
attribute_bonus['BPSkillDmgAdd'] = bp_skill_dmg_add + (
mp.mpf(
weapon_effect['21017']['Param']['e_dmg'][
self.weapon_rank - 1
]
)
* 2
)
return attribute_bonus
class RiverFlowsinSpring(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 进入战斗后使装备者速度提高8%造成的伤害提高12%。
# 当装备者受到伤害后该效果失效,下个回合结束时该效果恢复。
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
attribute_bonus['SpeedAddedRatio'] = speed_added_ratio + mp.mpf(
weapon_effect['21024']['Param']['SpeedAddedRatio'][
self.weapon_rank - 1
]
)
all_damage_added_ratio = attribute_bonus.get(
'AllDamageAddedRatio', 0
)
attribute_bonus[
'AllDamageAddedRatio'
] = all_damage_added_ratio + mp.mpf(
weapon_effect['21024']['Param']['AllDamageAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
class SleepLiketheDead(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 当装备者的普攻或战技伤害未造成暴击时使自身暴击率提高36%持续1回合。
# 该效果每3回合可以触发1次。
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
return attribute_bonus
class OnlySilenceRemains(BaseWeapon):
def __init__(self, weapon: Dict):
super().__init__(weapon)
async def check(self):
# 当场上的敌方目标数量小于等于2时
return True
async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict):
if await self.check():
critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
attribute_bonus[
'CriticalChanceBase'
] = critical_chance_base + mp.mpf(
weapon_effect['21003']['Param']['CriticalChance'][
self.weapon_rank - 1
]
)
return attribute_bonus
class IntheNight(BaseWeapon): class IntheNight(BaseWeapon):
def __init__(self, weapon: Dict): def __init__(self, weapon: Dict):
super().__init__(weapon) super().__init__(weapon)
@ -87,8 +277,24 @@ class HuntWeapon:
def __new__(cls, weapon: Dict): def __new__(cls, weapon: Dict):
if weapon['id'] == 24001: if weapon['id'] == 24001:
return CruisingintheStellarSea(weapon) return CruisingintheStellarSea(weapon)
if weapon['id'] == 23001: elif weapon['id'] == 23001:
return IntheNight(weapon) return IntheNight(weapon)
elif weapon['id'] == 21003:
return OnlySilenceRemains(weapon)
elif weapon['id'] == 21024:
return RiverFlowsinSpring(weapon)
elif weapon['id'] == 20014:
return Adversarial(weapon)
elif weapon['id'] == 20007:
return DartingArrow(weapon)
elif weapon['id'] == 21010:
return Swordplay(weapon)
elif weapon['id'] == 21031:
return ReturntoDarkness(weapon)
elif weapon['id'] == 20000:
return Arrows(weapon)
else:
raise ValueError(f'未知武器id: {weapon["id"]}')
async def check_ability(self): async def check_ability(self):
pass pass
@ -96,5 +302,19 @@ class HuntWeapon:
class Weapon: class Weapon:
def __new__(cls, weapon: Dict): def __new__(cls, weapon: Dict):
if weapon['id'] == 24001 or weapon['id'] == 23001: if weapon['id'] in [
23001,
21003,
23012,
24001,
21024,
21017,
20014,
20007,
21010,
21031,
20000,
]:
return HuntWeapon(weapon) return HuntWeapon(weapon)
else:
raise ValueError(f'不支持的武器种类: {weapon["id"]}')