N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
import { Player, Attribute } from '@/config';
|
|
|
|
|
import { deepCopy } from '.';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算角色最终属性于技能
|
|
|
|
|
* @param player 角色
|
|
|
|
|
* @param rA 转生属性
|
|
|
|
|
*/
|
|
|
|
|
export const callPlayerAttribute = (player: Player, rA: any) => {
|
|
|
|
|
const equips = [player.weapon, player.armor, player.neck, player.ring, player.jewelry, player.pants, player.shoes, player.bracers];
|
|
|
|
|
const curHp = player.attribute.curHp,
|
|
|
|
|
hp = player.attribute.hp;
|
|
|
|
|
const hpP = hp > 0 ? curHp / hp : 1;
|
|
|
|
|
|
|
|
|
|
const attribute: Attribute = new Attribute(rA);
|
|
|
|
|
const entry = new Array();
|
|
|
|
|
equips.forEach((equip) => {
|
|
|
|
|
equip && Array.prototype.push.apply(entry, equip.extraEntry);
|
|
|
|
|
equip && Array.prototype.push.apply(entry, strengthenEntry(equip));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
entry.forEach((item) => {
|
|
|
|
|
const key = item.type;
|
|
|
|
|
if (key == 'dmgPercent') {
|
|
|
|
|
attribute[key] = Math.round(callDmgPercent(attribute[key], item.value));
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
} else if (key == 'dmgReduc') {
|
|
|
|
|
attribute[key] = callDmgReduc(attribute[key], item.value);
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
} else {
|
|
|
|
|
attribute[key] += item.value;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
attribute.dmgReduc = Math.floor(attribute.dmgReduc * 100) / 100; //伤害减免保留两位小数
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
attribute.hp = Math.ceil(attribute.hp * (1 + attribute.hpPercent / 100));
|
|
|
|
|
attribute.curHp = Math.ceil(attribute.hp * hpP);
|
|
|
|
|
attribute.baseAtk = attribute.atk;
|
|
|
|
|
attribute.atk = Math.ceil(attribute.baseAtk * (1 + attribute.atkPercent / 100));
|
|
|
|
|
attribute.def = Math.ceil(attribute.def * (1 + attribute.defPercent / 100));
|
|
|
|
|
attribute.bloc = Math.ceil(attribute.bloc * (1 + attribute.blocPercent / 100));
|
|
|
|
|
const arr = ['hp', 'curHp', 'atk', 'def', 'bloc', 'eva'];
|
|
|
|
|
arr.forEach((key) => {
|
|
|
|
|
attribute[key] = Math.round(attribute[key]);
|
|
|
|
|
});
|
|
|
|
|
//计算秒伤
|
|
|
|
|
const atk = attribute.atk,
|
|
|
|
|
crit = (attribute.crit > 100 ? 100 : attribute.crit) / 100, // 暴击率最多100%
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
critdmg = attribute.critDmg / 100,
|
|
|
|
|
dmgPercent = attribute.dmgPercent / 100;
|
|
|
|
|
attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent));
|
|
|
|
|
//计算减伤比例
|
|
|
|
|
attribute.reducPercent = callReducPercent(attribute.def, player.lv);
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
player.attribute = attribute;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算防御提供的减伤比例
|
|
|
|
|
* @param def 防御
|
|
|
|
|
* @returns 减伤比例
|
|
|
|
|
*/
|
|
|
|
|
export const callReducPercent = (def: number, lv: number): number => {
|
|
|
|
|
// return def / (200 + 1.1 * def) + (0.09 * def) / (def + 200);
|
|
|
|
|
return def / (300 + 1.05263 * def) + lv * 0.0003;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算新增伤害减免后的伤害减免
|
|
|
|
|
* @param source 已有伤害减免
|
|
|
|
|
* @param add 新增伤害减免
|
|
|
|
|
* @returns 最终伤害减免
|
|
|
|
|
*/
|
|
|
|
|
export const callDmgReduc = (has, addition) => {
|
|
|
|
|
if (has > 100 || addition > 100) {
|
|
|
|
|
return 100;
|
|
|
|
|
}
|
|
|
|
|
return 100 - (100 - has) * (1 - addition / 100);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算新增伤害加成后的伤害加成
|
|
|
|
|
* @param source 已有伤害加成
|
|
|
|
|
* @param add 新增伤害加成
|
|
|
|
|
* @returns 最终伤害加成
|
|
|
|
|
*/
|
|
|
|
|
export const callDmgPercent = (has, addition) => {
|
|
|
|
|
return (100 + has) * (1 + addition / 100) - 100;
|
|
|
|
|
};
|
|
|
|
|
|
N多功能新增与调整
1.新增装备属性:伤害加成,伤害减免,暴击避免,爆伤减免,移动速度,转生属性副本行进速度更改为移动速度
2.新增装备类型:饰品,裤子,鞋子,护腕
3.新增装备品质:多彩,多彩品质装备拥有独特的主被动技能
4.新增部分多彩品质装备(暂无产出途径)
5.调整战斗逻辑,适配新增属性和技能
6.调整护甲减伤比例(调低)
7.调整格挡属性数值(调低)
8.调整暴击率和暴击伤害数值随装备等级线性增长(1级为原来一半,100级与原来相等)
9.调整转生点对移动速度的加成(调低)
10.新增装备图标资源
11.装备图鉴显示方式调整
7 months ago
|
|
|
/**
|
|
|
|
|
* 计算装备强化后的基础属性
|
|
|
|
|
* @param equip 装备
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
const strengthenEntry = (equip) => {
|
|
|
|
|
const temp = deepCopy(equip.base.entry);
|
|
|
|
|
temp.forEach((item) => {
|
|
|
|
|
item.value = strengthenValue(item.value, equip.strengthenLv);
|
|
|
|
|
});
|
|
|
|
|
return temp;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算基础属性强化后的值
|
|
|
|
|
* @param value 基础值
|
|
|
|
|
* @param strengthenLv 强化等级
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
export const strengthenValue = (value, strengthenLv) => {
|
|
|
|
|
if (strengthenLv <= 0) {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
const factor = 1.055 ** (strengthenLv ** 1.1);
|
|
|
|
|
return Math.round(factor * value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算角色转生可获得的转生点数
|
|
|
|
|
* @param playerAttribute 角色属性
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
export const getPointsOfReborn = (playerAttribute) => {
|
|
|
|
|
const lv = playerAttribute.lv;
|
|
|
|
|
let points = lv >= 20 ? Math.floor((lv - 20) ** 1.1 / 2.1) : 0;
|
|
|
|
|
|
|
|
|
|
const euqips = [playerAttribute.weapon, playerAttribute.armor, playerAttribute.neck, playerAttribute.ring];
|
|
|
|
|
euqips.forEach((equip) => {
|
|
|
|
|
if (!equip) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const wlv = equip.lv;
|
|
|
|
|
const elv = equip.enchantlvl || 0;
|
|
|
|
|
const q = equip.quality.qualityCoefficient;
|
|
|
|
|
if (wlv >= 20) {
|
|
|
|
|
points += Math.floor((((wlv - 20) / 10) ** 1.1 * (0.1 * elv ** 1.5 + 1) * q) / 3.5);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return Math.round(points * 1.2);
|
|
|
|
|
};
|