|
|
@ -10,6 +10,7 @@ import { |
|
|
|
Equip, |
|
|
|
Equip, |
|
|
|
piont_arrts, |
|
|
|
piont_arrts, |
|
|
|
} from '@/config'; |
|
|
|
} from '@/config'; |
|
|
|
|
|
|
|
import { deepCopy } from '@/tool'; |
|
|
|
export const type_monster = 'monster'; |
|
|
|
export const type_monster = 'monster'; |
|
|
|
export const type_boss = 'boss'; |
|
|
|
export const type_boss = 'boss'; |
|
|
|
export const difficultys = ['normal', 'hard', 'pain', 'xiaomi', 'dami']; |
|
|
|
export const difficultys = ['normal', 'hard', 'pain', 'xiaomi', 'dami']; |
|
|
@ -22,7 +23,7 @@ const monster_attr_max = { |
|
|
|
critDmg: 1000, |
|
|
|
critDmg: 1000, |
|
|
|
critAvoid: 120, |
|
|
|
critAvoid: 120, |
|
|
|
critDmgReduc: 1000, |
|
|
|
critDmgReduc: 1000, |
|
|
|
def: 1100, |
|
|
|
def: 800, |
|
|
|
atkPercent: 6500, |
|
|
|
atkPercent: 6500, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -120,14 +121,13 @@ export class Monster extends Attribute { |
|
|
|
this.callCoins(11); |
|
|
|
this.callCoins(11); |
|
|
|
this.callCrit(0.5); |
|
|
|
this.callCrit(0.5); |
|
|
|
this.callDef(); |
|
|
|
this.callDef(); |
|
|
|
this.checkMax(); |
|
|
|
this.checkMax(layer); |
|
|
|
this.equipRates = [0.2 * this.df, 0.08 * this.df, 0.03 * this.df]; |
|
|
|
this.equipRates = [0.2 * this.df, 0.08 * this.df, 0.03 * this.df]; |
|
|
|
this.extraRate = [0, 0]; |
|
|
|
this.extraRate = [0, 0]; |
|
|
|
} |
|
|
|
} |
|
|
|
callAtk = (variable) => { |
|
|
|
callAtk = (variable) => { |
|
|
|
this.baseAtk = Math.ceil(this.lv ** 2.1 * (Math.random() * 0.2 + variable)); |
|
|
|
this.baseAtk = Math.ceil(this.lv ** 2.1 * (Math.random() * 0.2 + variable)); |
|
|
|
this.atkPercent = (this.df * this.lf - 1) * 100; |
|
|
|
this.atkPercent = (this.df * this.lf - 1) * 100; |
|
|
|
// this.atk = this.baseAtk;
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
callHp = (variable) => { |
|
|
|
callHp = (variable) => { |
|
|
|
this.hp = Math.ceil(this.lv ** 2.1 * (Math.random() * 3 + variable) * this.df * this.lf); |
|
|
|
this.hp = Math.ceil(this.lv ** 2.1 * (Math.random() * 3 + variable) * this.df * this.lf); |
|
|
@ -144,8 +144,10 @@ export class Monster extends Attribute { |
|
|
|
this.critAvoid = Math.ceil((10 + 10 * (this.ef - 1) * this.lf) * factor); |
|
|
|
this.critAvoid = Math.ceil((10 + 10 * (this.ef - 1) * this.lf) * factor); |
|
|
|
this.critDmgReduc = Math.ceil(100 + 100 * (this.ef - 1) * this.lf); |
|
|
|
this.critDmgReduc = Math.ceil(100 + 100 * (this.ef - 1) * this.lf); |
|
|
|
}; |
|
|
|
}; |
|
|
|
checkMax = () => { |
|
|
|
checkMax = (layer) => { |
|
|
|
const max = monster_attr_max; |
|
|
|
const max = deepCopy(monster_attr_max); |
|
|
|
|
|
|
|
max.def += layer; |
|
|
|
|
|
|
|
max.atkPercent += layer; |
|
|
|
Object.keys(max).forEach((key) => { |
|
|
|
Object.keys(max).forEach((key) => { |
|
|
|
this[key] > max[key] && (this[key] = max[key]); |
|
|
|
this[key] > max[key] && (this[key] = max[key]); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -160,7 +162,7 @@ export class BossMonster extends Monster { |
|
|
|
this.callHp(31); |
|
|
|
this.callHp(31); |
|
|
|
this.callCoins(30.5); |
|
|
|
this.callCoins(30.5); |
|
|
|
this.callCrit(1); |
|
|
|
this.callCrit(1); |
|
|
|
this.checkMax(); |
|
|
|
this.checkMax(layer); |
|
|
|
const rf = rate_factor[difficulty]; |
|
|
|
const rf = rate_factor[difficulty]; |
|
|
|
this.equipRates = [0.25 - 0.05 * rf, 0.55 - 0.1 * rf, 0.15 + 0.1 * rf, 0.05 + 0.05 * rf]; |
|
|
|
this.equipRates = [0.25 - 0.05 * rf, 0.55 - 0.1 * rf, 0.15 + 0.1 * rf, 0.05 + 0.05 * rf]; |
|
|
|
let uniqueRate = 0.02 * ((rf - 1) * 5 + 1); |
|
|
|
let uniqueRate = 0.02 * ((rf - 1) * 5 + 1); |
|
|
|