|
|
|
@ -17,6 +17,14 @@ export const show_lv_df = ['normal', 'hard', 'pain'];
@@ -17,6 +17,14 @@ export const show_lv_df = ['normal', 'hard', 'pain'];
|
|
|
|
|
const base_attr_factor = { normal: 1, hard: 1.15, pain: 1.4, xiaomi: 2, dami: 3 }; |
|
|
|
|
const extra_factor = { normal: 0, hard: 0, pain: 0, xiaomi: 1, dami: 2 }; |
|
|
|
|
const rate_factor = { normal: 1, hard: 2, pain: 3, xiaomi: 4, dami: 5 }; |
|
|
|
|
const monster_attr_max = { |
|
|
|
|
crit: 120, |
|
|
|
|
critDmg: 1000, |
|
|
|
|
critAvoid: 120, |
|
|
|
|
critDmgReduc: 1000, |
|
|
|
|
def: 1100, |
|
|
|
|
atkPercent: 6500, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export class Attribute { |
|
|
|
|
lv: number = 1; |
|
|
|
@ -112,12 +120,14 @@ export class Monster extends Attribute {
@@ -112,12 +120,14 @@ export class Monster extends Attribute {
|
|
|
|
|
this.callCoins(11); |
|
|
|
|
this.callCrit(0.5); |
|
|
|
|
this.callDef(); |
|
|
|
|
this.checkMax(); |
|
|
|
|
this.equipRates = [0.2 * this.df, 0.08 * this.df, 0.03 * this.df]; |
|
|
|
|
this.extraRate = [0, 0]; |
|
|
|
|
} |
|
|
|
|
callAtk = (variable) => { |
|
|
|
|
this.baseAtk = Math.ceil(this.lv ** 2.1 * (Math.random() * 0.2 + variable) * this.df * this.lf); |
|
|
|
|
this.atk = this.baseAtk; |
|
|
|
|
this.baseAtk = Math.ceil(this.lv ** 2.1 * (Math.random() * 0.2 + variable)); |
|
|
|
|
this.atkPercent = (this.df * this.lf - 1) * 100; |
|
|
|
|
// this.atk = this.baseAtk;
|
|
|
|
|
}; |
|
|
|
|
callHp = (variable) => { |
|
|
|
|
this.hp = Math.ceil(this.lv ** 2.1 * (Math.random() * 3 + variable) * this.df * this.lf); |
|
|
|
@ -134,6 +144,12 @@ export class Monster extends Attribute {
@@ -134,6 +144,12 @@ export class Monster extends Attribute {
|
|
|
|
|
this.critAvoid = Math.ceil((10 + 10 * (this.ef - 1) * this.lf) * factor); |
|
|
|
|
this.critDmgReduc = Math.ceil(100 + 100 * (this.ef - 1) * this.lf); |
|
|
|
|
}; |
|
|
|
|
checkMax = () => { |
|
|
|
|
const max = monster_attr_max; |
|
|
|
|
Object.keys(max).forEach((key) => { |
|
|
|
|
this[key] > max[key] && (this[key] = max[key]); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class BossMonster extends Monster { |
|
|
|
@ -144,6 +160,7 @@ export class BossMonster extends Monster {
@@ -144,6 +160,7 @@ export class BossMonster extends Monster {
|
|
|
|
|
this.callHp(31); |
|
|
|
|
this.callCoins(30.5); |
|
|
|
|
this.callCrit(1); |
|
|
|
|
this.checkMax(); |
|
|
|
|
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]; |
|
|
|
|
let uniqueRate = 0.02 * ((rf - 1) * 5 + 1); |
|
|
|
|