系统奶关联结婚属性修正
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
from core.basic.formula import 当前等级, 获取基础属性
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('role', 'job', 'expected'),
|
||||
[
|
||||
('格斗家(女)', '气功师', (635, 818, 635, 818)),
|
||||
('神枪手(女)', '协战师', (827, 676, 577, 826)),
|
||||
('圣职者(男)', '圣骑士', (630, 618, 831, 827)),
|
||||
('魔法师(女)', '小魔女', (618, 835, 718, 735)),
|
||||
('魔法师(男)', '冰结师', (611, 843, 648, 805)),
|
||||
('弓箭手', '猎人', (828, 625, 778, 675)),
|
||||
('弓箭手', '妖护使', (628, 825, 628, 825)),
|
||||
],
|
||||
)
|
||||
def test_level_115_base_attributes_match_2604_sheet(role, job, expected):
|
||||
assert 当前等级 == 115
|
||||
assert 获取基础属性(role, job) == expected
|
||||
@@ -0,0 +1,88 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from core.basic.character import calc_carry
|
||||
from core.basic.character.calc_carry import CalcCarryMixin
|
||||
from core.equipment.version_0.sundry import sundry_7
|
||||
|
||||
|
||||
class StatusTarget:
|
||||
def __init__(self):
|
||||
self.status_calls = []
|
||||
|
||||
def SetStatus(self, **kwargs):
|
||||
self.status_calls.append(kwargs)
|
||||
|
||||
|
||||
def make_carry(output_type: str):
|
||||
return SimpleNamespace(
|
||||
输出类型=output_type,
|
||||
角色='test-role',
|
||||
职业='test-job',
|
||||
STR=8700,
|
||||
INT=8700,
|
||||
AtkP=4500,
|
||||
AtkM=4500,
|
||||
AtkI=4500,
|
||||
PAtkP=1,
|
||||
PAtkM=1,
|
||||
PAtkI=1,
|
||||
ElementDB={'火': 0},
|
||||
buff=1,
|
||||
SkillAttack=1,
|
||||
jade_effect=SimpleNamespace(SkillAttack=0, AttackP=0),
|
||||
Attack=0,
|
||||
AttackP=1,
|
||||
ElementIncrease=1,
|
||||
system_buff_marriage_correction=15,
|
||||
)
|
||||
|
||||
|
||||
def test_marriage_attributes_enable_system_buff_correction():
|
||||
target = StatusTarget()
|
||||
|
||||
sundry_7(target, 4, 2)
|
||||
|
||||
assert target.system_buff_marriage_correction == 15
|
||||
assert {'体精': 10, '力智': 15} in target.status_calls
|
||||
|
||||
|
||||
def test_marriage_correction_resets_when_attribute_is_not_selected():
|
||||
target = StatusTarget()
|
||||
sundry_7(target, 4, 2)
|
||||
|
||||
sundry_7(target, 4, 0)
|
||||
|
||||
assert target.system_buff_marriage_correction == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('output_type', 'expected_correction'),
|
||||
[
|
||||
('物理百分比', 15),
|
||||
('魔法百分比', 0),
|
||||
],
|
||||
)
|
||||
def test_system_buff_applies_marriage_correction_by_main_stat(
|
||||
monkeypatch, output_type, expected_correction
|
||||
):
|
||||
monkeypatch.setattr(calc_carry, '获取基础属性', lambda *_: (818, 818, 818, 818))
|
||||
carry = make_carry(output_type)
|
||||
|
||||
ratios = CalcCarryMixin.calc_damage_ration(carry, DSB=True, BUFF=False)
|
||||
|
||||
system_buff = (8700 - 818 - expected_correction) * 3.08 + 2886
|
||||
assert ratios[0] == pytest.approx((8700 + system_buff) / 250 + 1)
|
||||
|
||||
|
||||
def test_system_buff_matches_2604_sheet_light_nen_example():
|
||||
carry = make_carry('魔法百分比')
|
||||
carry.角色 = '格斗家(女)'
|
||||
carry.职业 = '气功师'
|
||||
|
||||
ratios = CalcCarryMixin.calc_damage_ration(carry, DSB=True, BUFF=False)
|
||||
|
||||
final_intelligence = (ratios[0] - 1) * 250
|
||||
assert final_intelligence - 8700 == pytest.approx(27162.56)
|
||||
assert final_intelligence == pytest.approx(35862.56)
|
||||
Reference in New Issue
Block a user