diff --git a/public/img/map/dami.png b/public/img/map/dami.png new file mode 100644 index 0000000..6c5e30c Binary files /dev/null and b/public/img/map/dami.png differ diff --git a/public/img/map/map.png b/public/img/map/map.png new file mode 100644 index 0000000..6917b43 Binary files /dev/null and b/public/img/map/map.png differ diff --git a/public/img/map/xiaomi.png b/public/img/map/xiaomi.png new file mode 100644 index 0000000..04a93a5 Binary files /dev/null and b/public/img/map/xiaomi.png differ diff --git a/src/assets/css/base.scss b/src/assets/css/base.scss index 3fca3ef..acf3631 100644 --- a/src/assets/css/base.scss +++ b/src/assets/css/base.scss @@ -143,19 +143,19 @@ button { // } .shabby { - color: #a1a1a1; + color: #a1a1a1 !important; } .ordinary { - color: #fff; + color: #fff !important; } .artifact { - color: #ff00ff; + color: #ff00ff !important; } .epic { - color: #f78918; + color: #f78918 !important; } .unique { - color: #ff0000; + color: #ff0000 !important; } .colorful { background-image: -webkit-linear-gradient( @@ -171,9 +171,9 @@ button { #ffff00 80%, #00ff00 90%, #4cfdfd 100% - ); - -webkit-background-clip: text; - color: transparent; + ) !important; + -webkit-background-clip: text !important; + color: transparent !important; } .fade-enter-active, diff --git a/src/config/assets.ts b/src/config/assets.ts index 03bfe8b..0c4ab29 100644 --- a/src/config/assets.ts +++ b/src/config/assets.ts @@ -48,12 +48,14 @@ export const colorful_gif = root + '/img/colorful.gif'; export const warning_icon = root + '/img/tip/warning.png'; export const dungeon_icon = { - map: root + '/img/map/map.jpg', + map: root + '/img/map/map.png', player: root + '/img/map/player-s.png', monster: root + '/img/map/monster.png', boss: root + '/img/map/boss.png', - 0: root + '/img/map/d1.png', - 1: root + '/img/map/d1.png', - 2: root + '/img/map/d2.png', - 3: root + '/img/map/d3.png', + normal: root + '/img/map/d1.png', + hard: root + '/img/map/d2.png', + pain: root + '/img/map/d3.png', + xiaomi: root + '/img/map/xiaomi.png', + dami: root + '/img/map/dami.png', + 6: root + '/img/map/boss_warrior.png', }; diff --git a/src/config/beings.ts b/src/config/beings.ts index b6c0283..59b9688 100644 --- a/src/config/beings.ts +++ b/src/config/beings.ts @@ -1,7 +1,11 @@ import { initialWeapon, initialArmor, initialNeck, initialRing, initialJewelry, initialpants, initialshoes, initialbracers, Equip } from '@/config'; -const monster_attr_factor = [0.9, 1, 1.15, 1.4]; export const type_monster = 'monster'; export const type_boss = 'boss'; +export const difficultys = ['normal', 'hard', 'pain', 'xiaomi', 'dami']; +export const show_lv_df = ['normal', 'hard', 'pain']; +const base_attr_factor = { normal: 1, hard: 1.15, pain: 1.4, xiaomi: 1.6, 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 }; export class Attribute { lv: number = 1; @@ -43,6 +47,7 @@ export class Attribute { export class Player { lv: number = 1; + layer: number = 1; coins: number = 0; weapon: Equip = initialWeapon(); armor: Equip = initialArmor(); @@ -73,58 +78,92 @@ export class RebornPoints extends RebornAttribute { } export class Monster extends Attribute { - difficulty: number; + difficulty: string; type: string = type_monster; equipRates: number[]; - extraRate: number; + extraRate: number[]; + df: number; + ef: number; + lf: number; - constructor(lv, difficulty) { + constructor(lv, difficulty: string, layer?: number) { super(); this.lv = lv; this.difficulty = difficulty; - const df = monster_attr_factor[this.difficulty]; - this.baseAtk = Math.ceil(lv * lv ** 1.1 * (Math.random() * 1 + 2) * df); - this.atk = this.baseAtk; - this.hp = Math.ceil(lv * lv ** 1.1 * (Math.random() * 5 + 16) * df); - this.coins = Math.ceil(lv ** 1.16 * (Math.random() * 5 + 11) * df); - this.equipRates = [0.2 * df, 0.08 * df, 0.03 * df]; - this.extraRate = 0; + this.df = base_attr_factor[this.difficulty]; + this.ef = extra_factor[difficulty]; + layer = layer || 0; + this.lf = ((this.lv + layer) / this.lv) ** 2; + this.callAtk(2.5); + this.callHp(17); + this.callCoins(11); + this.callCrit(5); + this.callDef(); + 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; + }; + callHp = (variable) => { + this.hp = Math.ceil(this.lv ** 2.1 * (Math.random() * 3 + variable) * this.df * this.lf); + }; + callCoins = (variable) => { + 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); + }; + callCrit = (variable) => { + this.crit = Math.ceil(variable * this.ef * this.lf); + this.critDmg = Math.ceil((150 + 50 * this.ef) * this.lf ** 0.5); + }; } export class BossMonster extends Monster { type: string = type_boss; - constructor(lv, difficulty) { - super(lv, difficulty); - const df = monster_attr_factor[this.difficulty]; - this.baseAtk = Math.ceil(lv * lv ** 1.1 * (Math.random() * 1 + 3) * df); - this.atk = this.baseAtk; - this.hp = Math.ceil(lv * lv ** 1.1 * (Math.random() * 5 + 30) * df); - this.coins = Math.ceil(lv ** 1.16 * (Math.random() * 10 + 28) * df); - this.equipRates = [0.25 - 0.05 * df, 0.55 - 0.15 * df, 0.15 + 0.15 * df, 0.05 + 0.05 * df]; - this.extraRate = 0.02 * ((this.difficulty - 1) * 5 + 1); + constructor(lv, difficulty, layer?: number) { + super(lv, difficulty, layer); + this.callAtk(3.5); + this.callHp(31); + this.callCoins(30.5); + this.callCrit(15); + 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); + const colorfulRate = 0.04 * (rf - 3) * this.lf; + if (uniqueRate + colorfulRate > 1) { + uniqueRate = 1 - colorfulRate; + } + this.extraRate = [uniqueRate, colorfulRate]; } } export class Dungeon { lv: number; - difficulty?: number; + difficulty: string; monsters?: Monster[] = new Array(); needDps?: number; + left: string = ''; + right: string = ''; + top: string = ''; - constructor(lv, difficulty) { + constructor(lv: number, difficulty: string, layer?: number) { this.lv = lv; - this.setDifficulty(difficulty); + this.difficulty = difficulty; + this.setDifficulty(difficulty, layer); } - setDifficulty(difficulty) { + setDifficulty(difficulty: string, layer?: number) { const lv = this.lv; this.difficulty = difficulty; this.monsters = new Array(); for (let i = 0; i < 4; i++) { - this.monsters.push(new Monster(lv, difficulty)); + this.monsters.push(new Monster(lv, this.difficulty, layer)); } - this.monsters.push(new BossMonster(lv, difficulty)); - this.needDps = lv * lv ** 1.3 * 2 * difficulty; + const boss = new BossMonster(lv, difficulty, layer); + this.monsters.push(boss); + this.needDps = Math.ceil(lv * lv ** 1.1 * 32.5 * base_attr_factor[this.difficulty]); } } diff --git a/src/config/i18n/zh/index.ts b/src/config/i18n/zh/index.ts index bfc5d14..4f89185 100644 --- a/src/config/i18n/zh/index.ts +++ b/src/config/i18n/zh/index.ts @@ -97,13 +97,30 @@ export default class Zh { autoSell = ['自动出售设置', '若勾选会在副本获得该品质装备时自动出售,背包满时自动出售所有品质装备', '自动出售装备']; dungeon = '副本(T)'; - difficulty = ['简单', '普通', '困难', '极难']; - dungeonTips = ['当前副本难度', '双击或右键开始挑战副本']; + // difficulty = ['简单', '普通', '困难', '极难', '小秘境', '大秘境']; + difficulty = { + normal: '普通', + hard: '困难', + pain: '极难', + xiaomi: '小秘境', + dami: '大秘境', + }; + layer = '层'; + dungeonTips = [ + '当前副本', + '当前副本BOSS额外爆率', + '正常副本难度等级为:普通、困难、极难', + 'BOSS有概率额外掉落独特装备,难度越高爆率越高', + '100以后开放小秘境和大秘境', + '大小秘境有概率掉落多彩品质装备', + '多彩品质装备有概率提升为远古(lv+20)或太古(lv+20且满ROLL)', + '大秘境有概率掉落强化保护卷', + ]; + dungeonAction = ['重复挑战', '向上挑战', '开始挑战']; player = '你'; monster = '小怪'; boss = '首领'; - eliteMonster = '无尽模式精英怪'; startDungeon = '你已进入'; battle = '你遭遇了(lv${0}${1}),正在战斗中...'; bouts = '点击查看战斗过程'; diff --git a/src/config/skill/base.ts b/src/config/skill/base.ts index a64b266..8a3f1dd 100644 --- a/src/config/skill/base.ts +++ b/src/config/skill/base.ts @@ -1,4 +1,4 @@ -import { BattleRole, replace } from '@/tool'; +import { BattleRole, callReducPercent, replace } from '@/tool'; import { type_boss } from '@/config'; import i18n from '../i18n'; const { t } = i18n; @@ -171,11 +171,15 @@ export class Attack extends ActionSkill { const attr = owner.attr; const baseAtk = attr.baseAtk + this.extraAtk; let dmg = ((baseAtk * (1 + attr.atkPercent / 100) * this.precent) / 100) * (1 + attr.dmgPercent / 100); - dmg = dmg * (1 - target.attr.reducPercent) * (1 - target.attr.dmgReduc / 100) - target.attr.bloc; - owner.crit = Math.random() < owner.attr.crit / 100; + // const reducPercent = callReducPercent(target.attr.def); + const reducPercent = target.attr.reducPercent; + dmg = dmg * (1 - reducPercent) * (1 - target.attr.dmgReduc / 100) - target.attr.bloc; + owner.crit = Math.random() < (owner.attr.crit - target.attr.critAvoid) / 100; let critLog = ''; if (owner.crit) { - dmg *= owner.attr.critDmg / 100; + let critDmg = owner.attr.critDmg - target.attr.critDmgReduc; + critDmg < 100 ? 100 : critDmg; + dmg *= critDmg / 100; critLog = t('skill.crit.0'); } dmg = dmg < 1 ? 1 : dmg; diff --git a/src/store/action.ts b/src/store/action.ts index a874b16..ac8a07a 100644 --- a/src/store/action.ts +++ b/src/store/action.ts @@ -88,6 +88,7 @@ const loadArchive = (commit, data) => { } else { commit('set_player_equips', data.equips); commit('set_player_lv', data.lv || 1); + commit('set_player_layer', data.layer || 1); commit('set_player_coins', data.coins || 0); commit('set_backpack', data.grid); commit('set_auto_sell', data.autoSell); diff --git a/src/store/mutation.ts b/src/store/mutation.ts index 5532ed8..ea23bc7 100644 --- a/src/store/mutation.ts +++ b/src/store/mutation.ts @@ -83,6 +83,10 @@ export const set_player_lv = (state, data) => { data = data < 1 ? 1 : data; state.playerAttribute.lv = parseInt(data || 1); }; +export const set_player_layer = (state, data) => { + data = data < 1 ? 1 : data; + state.playerAttribute.layer = parseInt(data); +}; export const set_reborn_points = (state, rebornPoints) => { state.rebornPoints = rebornPoints; const rebornAttribute = {}; diff --git a/src/store/state.ts b/src/store/state.ts index ee7aa67..3580af3 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -36,5 +36,7 @@ export default { // backgroundPosition: '0px 96px', // }, battleShow: false, + repeat: true, + upward: true, }, }; diff --git a/src/tool/archive.ts b/src/tool/archive.ts index 428717f..871b5e8 100644 --- a/src/tool/archive.ts +++ b/src/tool/archive.ts @@ -1,7 +1,6 @@ import { Equip, Player, RebornPoints } from '@/config'; import { getFromStore, insertToStore, store_name_archive } from './IndexedDB'; import { uuid } from './random'; -import { version } from 'vue'; const archive_version = '1.0'; const archive_version_strengthen = '1.0_flag'; @@ -9,6 +8,7 @@ export class GameArchive { version: String; equips: Equip[]; lv: number; + layer: number; coins: number; grid: any[]; autoSell: string[]; @@ -19,6 +19,7 @@ export class GameArchive { this.version = archive_version; this.equips = [player.weapon, player.armor, player.ring, player.neck, player.jewelry, player.pants, player.shoes, player.bracers]; this.lv = player.lv; + this.layer = player.layer; this.coins = player.coins; this.grid = grid; this.autoSell = autoSell; @@ -39,7 +40,6 @@ export const saveArchive = (state) => { Array.prototype.push.apply(equips, archive.grid); equips.forEach((equip) => { if (!equip) return; - if (equip.strengthenLv > 0 && !equip.id) { equip.id = uuid(); } diff --git a/src/tool/caller/attribute.ts b/src/tool/caller/attribute.ts index 89a3e00..1b08c11 100644 --- a/src/tool/caller/attribute.ts +++ b/src/tool/caller/attribute.ts @@ -51,12 +51,16 @@ export const callPlayerAttribute = (player: Player, rA: any) => { dmgPercent = attribute.dmgPercent / 100; attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent)); //计算减伤比例 - attribute.reducPercent = attribute.def / (200 + 1.1111 * attribute.def); + attribute.reducPercent = callReducPercent(attribute.def); // attribute.reducPercent = attribute.def / (200 + 1.1 * attribute.def) + (0.09 * attribute.def) / (attribute.def + 200); // attribute.reducPercent = (0.5 * attribute.def) / (200 + 0.502 * attribute.def); player.attribute = attribute; }; +export const callReducPercent = (def) => { + return def / (200 + 1.1111 * def); +}; + /** * 计算装备强化后的基础属性 * @param equip 装备 diff --git a/src/tool/random.ts b/src/tool/random.ts index 37584f5..2f7fc1e 100644 --- a/src/tool/random.ts +++ b/src/tool/random.ts @@ -1,3 +1,4 @@ +import { difficultys } from '@/config'; import { qualitys, createWeapon, createArmor, createNeck, createRing, createJewelry, createpants, createshoes, createbracers } from '@/config/equips'; const creators = new Array(); @@ -14,7 +15,12 @@ export const randonBootyEquip = (monster) => { const equips = new Array(); const equip = randomEquip(monster.equipRates, monster.lv); equip && equips.push(equip); - const extraRates = [0, 0, 0, 0, monster.extraRate]; + const extraRates = new Array(); + monster.equipRates.forEach((e) => { + extraRates.push(0); + }); + extraRates.push(monster.extraRate[0]); + extraRates.push(monster.extraRate[1]); const extraEquip = randomEquip(extraRates, monster.lv); extraEquip && equips.push(extraEquip); return equips; @@ -31,13 +37,13 @@ export const randomEquip = (rates, lv) => { break; } } -// quality = qualitys[4]; if (quality) { if (quality == qualitys[4]) { lv += Math.floor(Math.random() * 6); } else { lv += Math.floor(Math.random() * 3); } + lv = lv > 100 ? 100 : lv; const creator = creators[Math.floor(Math.random() * creators.length)]; return creator(quality, lv); } else { @@ -51,16 +57,16 @@ export const randomEquipQuality = (lv) => { }; export const randomDungeonDifficulty = () => { - const rates = [0.01, 0.84, 0.1, 0.05]; + const rates = [0.85, 0.1, 0.05]; const r = Math.random(); let tmp = 0; for (let i = 0; i < rates.length; i++) { tmp += rates[i]; if (r < tmp) { - return i; + return difficultys[i]; } } - return 1; + return difficultys[0]; }; export const uuid = () => { diff --git a/src/views/dungeon/battle.vue b/src/views/dungeon/battle.vue index c63ddc5..017baee 100644 --- a/src/views/dungeon/battle.vue +++ b/src/views/dungeon/battle.vue @@ -16,14 +16,17 @@ import { useStore } from "vuex"; import { computed, nextTick, onMounted, ref } from "vue"; import { useI18n } from "vue3-i18n"; -import { dungeon_icon, player_move_time, player_battle_time } from "@/config"; -import { randonBootyEquip, createBattleRole, BattleRole, replace } from "@/tool"; +import { dungeon_icon, player_move_time, player_battle_time, difficultys } from "@/config"; +import { createBattleRole, BattleRole, replace } from "@/tool"; const { t } = useI18n(); const { state, commit, dispatch } = useStore(); const battle = computed(() => { return state.battle; }) +const layer = computed(() => { + return state.playerAttribute.layer; +}) const props = defineProps({ dungeon: { @@ -70,12 +73,22 @@ const exploreDungeon = (monsterIdx) => { commit('set_player_lv', dungeon.lv) commit('set_sys_info', { msg: t('upgrade'), type: 'win' }) } - if (dungeon.difficulty != 1) { - dungeon.setDifficulty(1); + if (dungeon.difficulty == difficultys[1] || dungeon.difficulty == 2) { + dungeon.setDifficulty(difficultys[0]); battle.value.battleShow = false; dispatch('play_music', 'backgound'); - } else { + return; + } else if (dungeon.difficulty == difficultys[4]) { + commit('set_player_layer', dungeon.layer); + } + if (state.battle.repeat) { + if (dungeon.difficulty == difficultys[4] && state.battle.upward) { + dungeon.setDifficulty(dungeon.difficulty, layer.value + 1); + } playerMove(0, 0); + } else { + battle.value.battleShow = false; + dispatch('play_music', 'backgound'); } } }) @@ -116,6 +129,9 @@ const battleWithMonster = (monster) => { oneBout(player, monster1, battleTime).then(rsp => { if (player.isDeath()) { commit("set_sys_info", { msg: t('bout.1'), type: 'warning' }); + if (props.dungeon?.difficulty == difficultys[4] && state.battle.upward) { + props.dungeon?.setDifficulty(props.dungeon?.difficulty, layer.value); + } battle.value.battleShow = false; dispatch('play_music', 'backgound'); } else { diff --git a/src/views/dungeon/dungeon.vue b/src/views/dungeon/dungeon.vue index 18d22b7..9de2b4c 100644 --- a/src/views/dungeon/dungeon.vue +++ b/src/views/dungeon/dungeon.vue @@ -1,14 +1,11 @@