Browse Source

属性调整和BUG修复

1.调整多彩装备属性和技能属性
2.修复部分技能不生效或效果错误BUG
3.修复部分技能显示和提示BUG
4.调整减伤公式
5.修复技能优先级排序错误BUG
v1.0
许孟阳 2 weeks ago
parent
commit
23ffeedbfd
  1. 4
      src/config/beings.ts
  2. 6
      src/config/equips/armor.ts
  3. 36
      src/config/equips/jewelry.ts
  4. 6
      src/config/equips/ring.ts
  5. 8
      src/config/i18n/zh/skills.ts
  6. 6
      src/config/skill/armor.ts
  7. 2
      src/config/skill/base.ts
  8. 10
      src/config/skill/jewelry.ts
  9. 8
      src/config/skill/neck.ts
  10. 3
      src/config/skill/pants.ts
  11. 8
      src/config/skill/ring.ts
  12. 8
      src/store/mutation.ts
  13. 6
      src/tool/caller/attribute.ts
  14. 30
      src/tool/caller/battle.ts

4
src/config/beings.ts

@ -112,13 +112,13 @@ export class Monster extends Attribute { @@ -112,13 +112,13 @@ export class Monster extends Attribute {
this.coins = Math.ceil(this.lv ** 1.16 * (Math.random() * 5 + variable) * this.df * this.lf);
};
callDef = () => {
this.def = Math.ceil(50 * this.ef * this.lf);
this.def = Math.ceil(100 + 100 * (this.ef - 1) * this.lf);
};
callCrit = (factor) => {
this.crit = Math.ceil((15 + 10 * (this.ef - 1) * this.lf) * factor);
this.critDmg = Math.ceil(150 + 50 * this.ef * this.lf);
this.critAvoid = Math.ceil((10 + 10 * (this.ef - 1) * this.lf) * factor);
this.critDmgReduc = Math.ceil(50 * this.ef * this.lf);
this.critDmgReduc = Math.ceil(100 + 100 * (this.ef - 1) * this.lf);
};
}

6
src/config/equips/armor.ts

@ -40,9 +40,9 @@ export const armorColorfulCategorys: Categorys[] = [ @@ -40,9 +40,9 @@ export const armorColorfulCategorys: Categorys[] = [
'wuxing',
'armor/五行压贴.png',
[
{ type: 'def', valCoefficient: 0.9 },
{ type: 'critDmg', valCoefficient: 1.7 },
{ type: 'atk', valCoefficient: 1.7 },
{ type: 'def', valCoefficient: 0.7 },
{ type: 'hp', valCoefficient: 1.5 },
{ type: 'bloc', valCoefficient: 1.4 },
],
'JinGuangHuShen'
),

36
src/config/equips/jewelry.ts

@ -7,12 +7,23 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'dmgPercent']; @@ -7,12 +7,23 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'dmgPercent'];
const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, unique: 1.8, colorful: 1.8 };
export const jewelryColorfulCategorys: Categorys[] = [
new Categorys(
'youerhuan',
'jewelry/白骨夫人的右耳环.png',
[
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'critDmg', valCoefficient: 1 },
{ type: 'atk', valCoefficient: 0.6 },
],
'Vampire1',
0.9
),
new Categorys(
'shuzhuang',
'jewelry/梳妆镜.png',
[
{ type: 'atk', valCoefficient: 1 },
{ type: 'hp', valCoefficient: 0.7 },
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'hp', valCoefficient: 1.2 },
{ type: 'def', valCoefficient: 0.4 },
],
'JHSY'
@ -21,8 +32,9 @@ export const jewelryColorfulCategorys: Categorys[] = [ @@ -21,8 +32,9 @@ export const jewelryColorfulCategorys: Categorys[] = [
'liulipan',
'jewelry/琉璃盘.png',
[
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'atk', valCoefficient: 0.6 },
{ type: 'hp', valCoefficient: 1.5 },
{ type: 'hp', valCoefficient: 1 },
],
'Liulipan'
),
@ -36,16 +48,6 @@ export const jewelryColorfulCategorys: Categorys[] = [ @@ -36,16 +48,6 @@ export const jewelryColorfulCategorys: Categorys[] = [
],
'CritFear'
),
new Categorys(
'youerhuan',
'jewelry/白骨夫人的右耳环.png',
[
{ type: 'critDmg', valCoefficient: 1.5 },
{ type: 'atk', valCoefficient: 0.8 },
],
'Vampire1',
0.9
),
new Categorys(
'jingboyu',
'jewelry/金钵盂.png',
@ -60,9 +62,9 @@ export const jewelryColorfulCategorys: Categorys[] = [ @@ -60,9 +62,9 @@ export const jewelryColorfulCategorys: Categorys[] = [
'zijingboyu',
'jewelry/紫金钵盂.png',
[
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'atk', valCoefficient: 0.8 },
{ type: 'hp', valCoefficient: 0.6 },
{ type: 'def', valCoefficient: 0.6 },
{ type: 'hp', valCoefficient: 0.8 },
],
'Fate'
),
@ -80,7 +82,7 @@ export const jewelryUniqueCategorys: Categorys[] = [ @@ -80,7 +82,7 @@ export const jewelryUniqueCategorys: Categorys[] = [
]),
new Categorys('liangren', 'jewelry/良人.png', [
{ type: 'critDmg', valCoefficient: 1.2 },
{ type: 'dmgPercent', valCoefficient: 0.4 },
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'atk', valCoefficient: 0.7 },
]),
new Categorys('duzhan', 'jewelry/督战.png', [
@ -88,7 +90,7 @@ export const jewelryUniqueCategorys: Categorys[] = [ @@ -88,7 +90,7 @@ export const jewelryUniqueCategorys: Categorys[] = [
{ type: 'atk', valCoefficient: 1.6 },
]),
new Categorys('cltx', 'jewelry/赤羚天禧.png', [
{ type: 'dmgPercent', valCoefficient: 0.5 },
{ type: 'dmgPercent', valCoefficient: 0.6 },
{ type: 'def', valCoefficient: 0.9 },
{ type: 'hp', valCoefficient: 1.2 },
]),

6
src/config/equips/ring.ts

@ -11,9 +11,9 @@ export const ringColorfulCategorys: Categorys[] = [ @@ -11,9 +11,9 @@ export const ringColorfulCategorys: Categorys[] = [
'jingangzhuo',
'ring/金刚琢.png',
[
{ type: 'atk', valCoefficient: 2.4 },
{ type: 'def', valCoefficient: 0.5 },
{ type: 'hp', valCoefficient: 0.9 },
{ type: 'critDmg', valCoefficient: 1.5 },
{ type: 'crit', valCoefficient: 0.5 },
{ type: 'atk', valCoefficient: 1 },
],
'SLWX,JinGangZhuo',
0.9

8
src/config/i18n/zh/skills.ts

@ -14,8 +14,8 @@ export const bhxdjc = [ @@ -14,8 +14,8 @@ export const bhxdjc = [
'当生命值低于${0}%时,获得自身最大生命值${1}%的护盾(护盾能吸收等额伤害,但每回合自然衰减10%),此效果每场战斗只能触发一次。',
'触发百花羞得矜持,获得${0}点护盾。',
];
export const tiebi = ['铁壁', '获得${0}%伤害减免,持续${1}回合,冷却时间${2}回合', '{0}使用了铁壁,获得${0}%伤害减免,持续${1}回合。'];
export const dujunqianneng = ['督军的潜能', '生命值低于${0}%时,获得${1}%伤害减免。', '血量低于${0}%,触发督军的潜能,获得%{1}伤害减免。'];
export const tiebi = ['铁壁', '获得${0}%伤害减免,持续${1}回合,冷却时间${2}回合', '${0}使用了铁壁,获得${1}%伤害减免,持续${2}回合。'];
export const dujunqianneng = ['督军的潜能', '生命值低于${0}%时,获得${1}%伤害减免。', '血量低于${0}%,触发督军的潜能,获得${1}%伤害减免。'];
export const jinguanghushen = ['金光护身', '抵抗一次死亡,并回复${0}%的生命,此效果每场战斗只能触发一次。', '触发金光护身,回复${0}%生命。'];
export const laobukepo = ['牢不可破', '提升${0}%格挡值。'];
@ -31,7 +31,7 @@ export const numu = ['怒目', '被攻击时提升${0}%基础攻击力,最多 @@ -31,7 +31,7 @@ export const numu = ['怒目', '被攻击时提升${0}%基础攻击力,最多
export const SLWX = ['森罗万象', '增加${0}%攻击加成、伤害加成、暴击率、暴击伤害。'];
export const jinggangzhuo = ['金刚琢', '攻击时有${0}%几率使目标进入缴械状态${1}回合。', '触发金刚镯,目标缴械${0}回合'];
export const fengxie = ['奉邪', '每次暴击,增加${0}%的暴击伤害,最多叠加${1}层,未暴击时层数清零。', '触发奉邪,当前${0}层。'];
export const fengxie = ['奉邪', '每次暴击,增加${0}%的暴击伤害,最多叠加${1}层,未暴击时层数清零。', '触发奉邪,当前${0}层。', '奉邪层数清零。'];
export const shizhong = ['噬忠', '每次被暴击,增加${0}%的暴击伤害减免,最多叠加${1}层,持续到战斗结束。', '触发噬忠,当前${0}层。'];
export const shenshang = ['神赏', '暴击时有${0}%概率恢复自身生命${1}点。', '触发神赏,恢复生命${0}点。'];
export const tongjuefanji = ['痛觉反击', '每次受到暴击时,对目标使用刺痛反击,伤害倍率${0}%。', '触发反击,对${0}造成${1}点伤害。'];
@ -41,7 +41,7 @@ export const vampire = ['汲血', '生命偷取${0}%。', '触发汲血,偷取${ @@ -41,7 +41,7 @@ export const vampire = ['汲血', '生命偷取${0}%。', '触发汲血,偷取${
export const prototype = ['现原形', '将目标变为猴子,持续${0}回合,冷却${1}回合,对boss只有${2}%成功率。'];
export const critFear = ['暴击恐惧', '暴击时附加${0}%攻击力的额外伤害。', '触发暴击恐惧,附加${0}点伤害'];
export const liulipan = ['琉璃盘', '使用后产生黑红内丹,临时提高${0}点基础攻击力进行攻击,冷却${1}回合。'];
export const JHSY = ['镜花水月', '被攻击时有${0}%概率反弹${1}%所受伤害。', '${0}触发了镜花水月,反弹${1}点伤害'];
export const JHSY = ['镜花水月', '被攻击时有${0}%概率反弹${1}%所受伤害(减伤前)。', '${0}触发了镜花水月,反弹${1}点伤害'];
export const xianglong = ['降龙', '攻击时,若生命值低于${0}%,增加${1}%伤害加成。', '触发降龙,增加${1}%伤害加成。'];

6
src/config/skill/armor.ts

@ -23,8 +23,8 @@ export class BHXDJC extends PrePassiveSkill { @@ -23,8 +23,8 @@ export class BHXDJC extends PrePassiveSkill {
//铁壁
export class TieBi extends BuffSkill {
name: string = 'tiebi';
last: number = 6;
cd: number = 9;
last: number = 4;
cd: number = 6;
dmgReduc: number = 40;
desc(): string {
return replace(t('skill.tiebi.1'), [this.dmgReduc, this.last, this.cd]);
@ -40,7 +40,7 @@ export class TieBi extends BuffSkill { @@ -40,7 +40,7 @@ export class TieBi extends BuffSkill {
export class DuJunQianNeng extends PrePassiveSkill {
name: string = 'dujunqianneng';
hpPercent: number = 50;
dmgReduc: number = 50;
dmgReduc: number = 40;
desc(): string {
return replace(t('skill.dujunqianneng.1'), [this.hpPercent, this.dmgReduc]);
}

2
src/config/skill/base.ts

@ -38,7 +38,6 @@ export abstract class ActionSkill implements Skill { @@ -38,7 +38,6 @@ export abstract class ActionSkill implements Skill {
} else {
this.rmdCd = this.cd - 1;
owner.action = this;
// this.use(owner, target);
}
}
abstract use(owner: BattleRole, target: BattleRole): void;
@ -189,6 +188,7 @@ export abstract class BuffSkill extends ActionSkill { @@ -189,6 +188,7 @@ export abstract class BuffSkill extends ActionSkill {
use(owner: BattleRole, target: BattleRole): void {
this.rmdLast = this.last;
this.log(owner, target);
this.check(owner, target);
}
abstract log(owner: BattleRole, target: BattleRole): void;
}

10
src/config/skill/jewelry.ts

@ -50,20 +50,20 @@ export class Liulipan extends Attack { @@ -50,20 +50,20 @@ export class Liulipan extends Attack {
order: number = 10;
lv?: number;
name: string = 'liulipan';
atk: number = 20;
atk: number = 50;
cd: number = 5;
desc(): string {
return replace(t('skill.liulipan.1'), [(this.lv || 1) * this.atk, this.cd]);
}
beforeAtk(owner: BattleRole, target: BattleRole): void {
use(owner: BattleRole, target: BattleRole): void {
owner.extraAttr.baseAtk += (this.lv || 1) * this.atk;
super.beforeAtk(owner, target);
super.use(owner, target);
}
}
//镜花水月
export class JHSY extends CounterSkill {
name: string = 'JHSY';
rate: number = 100;
rate: number = 50;
percent: number = 100;
desc(): string {
return replace(t('skill.JHSY.1'), [this.rate, this.percent, this.cd]);
@ -72,7 +72,7 @@ export class JHSY extends CounterSkill { @@ -72,7 +72,7 @@ export class JHSY extends CounterSkill {
return Math.random() < this.rate / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
const reflected = Math.ceil((target.dmg * this.percent) / 100);
const reflected = Math.ceil((target.baseDmg * this.percent) / 100);
target.addHp(-1 * reflected);
const log = replace(t('skill.JHSY.2'), [t(owner.type), reflected]);
owner.battleLog(log);

8
src/config/skill/neck.ts

@ -6,7 +6,7 @@ const { t } = i18n; @@ -6,7 +6,7 @@ const { t } = i18n;
//断
export class Duan extends SufPassiveSkill {
name: string = 'duan';
hpPercent: number = 10;
hpPercent: number = 20;
order: number = 999;
dmg: number = 999999999;
desc(): string {
@ -24,7 +24,7 @@ export class Duan extends SufPassiveSkill { @@ -24,7 +24,7 @@ export class Duan extends SufPassiveSkill {
export class HongYan extends PrePassiveSkill {
name: string = 'hongyan';
hpPercent: number = 65;
atk: number = 3000;
atk: number = 2000;
atkPercent: number = 200;
desc(): string {
return replace(t('skill.hongyan.1'), [this.hpPercent, this.atk, this.atkPercent]);
@ -67,7 +67,7 @@ export class ShaYi extends PrePassiveSkill { @@ -67,7 +67,7 @@ export class ShaYi extends PrePassiveSkill {
if (target.crit) {
this.layer -= this.reduc;
this.layer < 0 && (this.layer = 0);
owner.battleLog(replace(t('skill.shayi.3'), [this.reduc]));
owner.battleLog(replace(t('skill.shayi.2'), [this.reduc]));
}
}
}
@ -89,7 +89,7 @@ export class NuMu extends PrePassiveSkill { @@ -89,7 +89,7 @@ export class NuMu extends PrePassiveSkill {
onAtked(owner: BattleRole, target: BattleRole): void {
if (target.dmg > 0) {
this.layer < this.maxLayer && this.layer++;
owner.battleLog(replace(t('skill.numu.3'), [this.layer]));
owner.battleLog(replace(t('skill.numu.2'), [this.layer]));
}
}
}

3
src/config/skill/pants.ts

@ -3,7 +3,7 @@ import i18n from '../i18n'; @@ -3,7 +3,7 @@ import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class FuRenPiHu extends SufPassiveSkill {
export class FuRenPiHu extends PrePassiveSkill {
name: string = 'furenpihu';
cd: number = 999;
hpPercent: number = 30;
@ -20,4 +20,3 @@ export class FuRenPiHu extends SufPassiveSkill { @@ -20,4 +20,3 @@ export class FuRenPiHu extends SufPassiveSkill {
owner.battleLog(replace(t('skill.furenpihu.2'), [this.hpPercent, this.dmgReduc]));
}
}

8
src/config/skill/ring.ts

@ -58,11 +58,15 @@ export class FengXie extends PassiveSkill { @@ -58,11 +58,15 @@ export class FengXie extends PassiveSkill {
owner.extraAttr.critDmg = this.critDmg * this.layer;
}
afterAtk(owner: BattleRole, target: BattleRole): void {
if (this.trigger(owner, target)) {
this.layer < this.maxLayer && this.layer++;
if (!this.trigger(owner, target)) {
return;
}
if (this.layer < this.maxLayer) {
this.layer++;
owner.battleLog(replace(t('skill.fengxie.2'), [this.layer]));
} else {
this.layer = 0;
owner.battleLog(t('skill.fengxie.3'));
}
}
}

8
src/store/mutation.ts

@ -80,12 +80,15 @@ export const set_shop = (state, shop) => { @@ -80,12 +80,15 @@ export const set_shop = (state, shop) => {
state.shop = shop;
};
export const set_player_lv = (state, data) => {
data = parseInt(data) || 1;
data = data < 1 ? 1 : data;
state.playerAttribute.lv = parseInt(data || 1);
state.playerAttribute.lv = data;
state.playerAttribute.attribute.lv = data;
};
export const set_player_layer = (state, data) => {
data = parseInt(data);
data = data < 1 ? 1 : data;
state.playerAttribute.layer = parseInt(data);
state.playerAttribute.layer = data;
};
export const set_reborn_points = (state, rebornPoints) => {
state.rebornPoints = rebornPoints;
@ -97,6 +100,7 @@ export const set_reborn_points = (state, rebornPoints) => { @@ -97,6 +100,7 @@ export const set_reborn_points = (state, rebornPoints) => {
call_player_attribute(state);
};
export const add_player_curhp = (state, hp) => {
hp = Math.ceil(hp);
const attr = state.playerAttribute.attribute;
let curHp = attr.curHp + hp;
curHp > attr.hp && (curHp = attr.hp);

6
src/tool/caller/attribute.ts

@ -47,7 +47,7 @@ export const callPlayerAttribute = (player: Player, rA: any) => { @@ -47,7 +47,7 @@ export const callPlayerAttribute = (player: Player, rA: any) => {
dmgPercent = attribute.dmgPercent / 100;
attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent));
//计算减伤比例
attribute.reducPercent = callReducPercent(attribute.def);
attribute.reducPercent = callReducPercent(attribute.def, player.lv);
player.attribute = attribute;
};
@ -56,9 +56,9 @@ export const callPlayerAttribute = (player: Player, rA: any) => { @@ -56,9 +56,9 @@ export const callPlayerAttribute = (player: Player, rA: any) => {
* @param def
* @returns
*/
export const callReducPercent = (def: number): number => {
export const callReducPercent = (def: number, lv: number): number => {
// return def / (200 + 1.1 * def) + (0.09 * def) / (def + 200);
return def / (200 + 1.05263 * def);
return def / (300 + 1.05263 * def) + lv * 0.0003;
};
/**

30
src/tool/caller/battle.ts

@ -14,6 +14,7 @@ export class BattleRole { @@ -14,6 +14,7 @@ export class BattleRole {
action: Skills.ActionSkill | null = null;
atk: number = 0;
dmg: number = 0;
baseDmg: number = 0;
crit: boolean = false;
extraAttr: Attribute = new Attribute();
shield: number = 0;
@ -31,6 +32,7 @@ export class BattleRole { @@ -31,6 +32,7 @@ export class BattleRole {
this.action = null;
this.atk = 0;
this.dmg = 0;
this.baseDmg = 0;
this.crit = false;
this.extraAttr = new Attribute();
this.extraAttr.hp = 0;
@ -55,10 +57,10 @@ export class BattleRole { @@ -55,10 +57,10 @@ export class BattleRole {
onStartBattle = (target: BattleRole) => {
//技能排序
this.actions.sort((a, b) => {
return (a.order = b.order);
return a.order - b.order;
});
this.actions.sort((a, b) => {
return (a.order = b.order);
this.passives.sort((a, b) => {
return a.order - b.order;
});
//战斗开始前触发的技能
this.passives.forEach((skill) => {
@ -82,8 +84,6 @@ export class BattleRole { @@ -82,8 +84,6 @@ export class BattleRole {
});
//触发攻击目标的反制技能
target.onAttacked(this);
//初始化临时状态
this.initTmp();
};
onAttacked = (target: BattleRole) => {
@ -91,6 +91,8 @@ export class BattleRole { @@ -91,6 +91,8 @@ export class BattleRole {
this.passives.forEach((skill) => {
skill.onAtked(this, target);
});
//初始化临时状态
this.initTmp();
};
battleLog = (log: string) => {
@ -148,21 +150,19 @@ export class BattleRole { @@ -148,21 +150,19 @@ export class BattleRole {
const atkPercent = 1 + (attr.atkPercent + extra.atkPercent) / 100; //攻击加成
this.atk = baseAtk * atkPercent; //回合最终攻击力
const dmgPercent = callDmgPercent(attr.dmgPercent, extra.dmgPercent) / 100; //伤害加成
let dmg = this.atk * dmgPercent * (this.skillPercent / 100); //造成伤害
const reducPercent = callReducPercent(target.attr.def + target.extraAttr.def); //目标防御提供的减伤比例
const dmgReduc = callDmgReduc(target.attr.dmgReduc, target.extraAttr.dmgReduc); //目标伤害减免
const takeDmgPercent = (1 - reducPercent) * (1 - dmgReduc / 100); //目标承受伤害比例
const bloc = target.attr.bloc + target.extraAttr.bloc; //目标格挡值
dmg = dmg * takeDmgPercent - bloc; //目标承受伤害
this.baseDmg = this.atk * (1 + dmgPercent) * (this.skillPercent / 100); //造成伤害
const crit = attr.crit + extra.crit - target.attr.critAvoid - target.extraAttr.critAvoid; //最终暴击率
this.crit = Math.random() < crit / 100;
if (this.crit) {
let critDmg = attr.critDmg + extra.critDmg - target.attr.critDmgReduc - target.extraAttr.critDmg; //目标最终承受暴击伤害
critDmg < 100 ? 100 : critDmg; //暴击伤害不低于100%
dmg *= critDmg / 100; //暴击时目标承受伤害
this.baseDmg *= critDmg / 100; //暴击时目标承受伤害
}
dmg = dmg <= 0 ? 1 : dmg; //最低造成1点伤害
this.dmg = Math.ceil(dmg);
const reducPercent = callReducPercent(target.attr.def + target.extraAttr.def, target.attr.lv); //目标防御提供的减伤比例
const dmgReduc = callDmgReduc(target.attr.dmgReduc, target.extraAttr.dmgReduc); //目标伤害减免
const takeDmgPercent = (1 - reducPercent) * (1 - dmgReduc / 100); //目标承受伤害比例
const bloc = target.attr.bloc + target.extraAttr.bloc; //目标格挡值
this.dmg = Math.ceil(this.baseDmg * takeDmgPercent - bloc); //目标承受伤害
};
}
@ -170,7 +170,7 @@ export const createBattleRole = (player: Player, monster: Monster, commit) => { @@ -170,7 +170,7 @@ export const createBattleRole = (player: Player, monster: Monster, commit) => {
const playerRole = new BattleRole(player.attribute, commit, 'player');
const palyerEquips = [player.weapon, player.armor, player.neck, player.ring, player.jewelry, player.pants, player.shoes, player.bracers];
palyerEquips.forEach((equip) => {
equip && playerRole.addSkill(equip.base.skill);
equip && playerRole.addSkill(equip.base.skill, equip.lv);
});
monster = deepCopy(monster);

Loading…
Cancel
Save