Browse Source

战斗信息做颜色区分

v1.0
许孟阳 7 days ago
parent
commit
0ce79c8a2a
  1. 8
      src/config/base.ts
  2. 2
      src/config/i18n/zh/index.ts
  3. 8
      src/config/skill/armor.ts
  4. 8
      src/config/skill/base.ts
  5. 6
      src/config/skill/bracers.ts
  6. 4
      src/config/skill/buff.ts
  7. 4
      src/config/skill/jewelry.ts
  8. 16
      src/config/skill/neck.ts
  9. 4
      src/config/skill/pants.ts
  10. 14
      src/config/skill/ring.ts
  11. 12
      src/config/skill/weapon.ts
  12. 19
      src/tool/caller/battle.ts
  13. 18
      src/views/archive.vue
  14. 45
      src/views/message/sys-info.vue
  15. 2
      src/views/shop/shop.vue

8
src/config/base.ts

@ -14,3 +14,11 @@ export const point_coefficients = {
}; };
export const player_move_time = 3000; export const player_move_time = 3000;
export const player_battle_time = 1000; export const player_battle_time = 1000;
export const battle_msg_types = {
attack: 'attack',
crit: 'crit',
gain: 'gain',
debuff: 'debuff',
extra: 'extra',
};

2
src/config/i18n/zh/index.ts

@ -153,7 +153,7 @@ export default class Zh {
saveGame = ['保存游戏(Ctrl+S)', '每5分钟会自动保存游戏一次', '游戏进度已经保存了。']; saveGame = ['保存游戏(Ctrl+S)', '每5分钟会自动保存游戏一次', '游戏进度已经保存了。'];
archive = ['存档管理(A)', '导入存档前请将存档内容粘贴到输入框内']; archive = ['存档管理(A)', '导入存档前请将存档内容粘贴到输入框内'];
copyArchive = ['复制存档', '已经复制存档了,建议保存到备忘录', '复制存档失败']; copyArchive = ['复制存档', '已经复制存档了,建议保存到备忘录', '复制存档失败', '复制旧存档'];
pasteArchive = ['粘贴存档', '粘贴存档内容到输入框成功', '粘贴失败']; pasteArchive = ['粘贴存档', '粘贴存档内容到输入框成功', '粘贴失败'];
cleanArchive = ['删除存档']; cleanArchive = ['删除存档'];
importArchive = ['导入', '导入存档成功,继续游戏吧!', '导入存档失败', '存档版本已过期,无法导入!']; importArchive = ['导入', '导入存档成功,继续游戏吧!', '导入存档失败', '存档版本已过期,无法导入!'];

8
src/config/skill/armor.ts

@ -19,7 +19,7 @@ export class BHXDJC extends PrePassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100); const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100);
owner.shield += shield; owner.shield += shield;
owner.battleLog(replace(t('skill.bhxdjc.2'), [shield])); owner.gainLog(replace(t('skill.bhxdjc.2'), [shield]));
} }
} }
//铁壁 //铁壁
@ -35,7 +35,7 @@ export class TieBi extends BuffSkill {
owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc); owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc);
} }
log(owner: BattleRole, target: BattleRole): void { log(owner: BattleRole, target: BattleRole): void {
owner.battleLog(replace(t('skill.tiebi.2'), [t(owner.type), this.dmgReduc, this.last])); owner.gainLog(replace(t('skill.tiebi.2'), [t(owner.type), this.dmgReduc, this.last]));
} }
} }
//督军的潜能 //督军的潜能
@ -51,7 +51,7 @@ export class DuJunQianNeng extends PrePassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc); owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc);
owner.battleLog(replace(t('skill.dujunqianneng.2'), [this.hpPercent, this.dmgReduc])); owner.gainLog(replace(t('skill.dujunqianneng.2'), [this.hpPercent, this.dmgReduc]));
} }
} }
//金光护身 //金光护身
@ -67,7 +67,7 @@ export class JinGuangHuShen extends CounterSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
owner.addHp((owner.attr.hp * this.hpPercent) / 100); owner.addHp((owner.attr.hp * this.hpPercent) / 100);
owner.battleLog(replace(t('skill.jinguanghushen.2'), [this.hpPercent])); owner.gainLog(replace(t('skill.jinguanghushen.2'), [this.hpPercent]));
} }
} }
//牢不可破 //牢不可破

8
src/config/skill/base.ts

@ -1,5 +1,5 @@
import { BattleRole, callReducPercent, replace } from '@/tool'; import { BattleRole, callReducPercent, replace } from '@/tool';
import { type_boss } from '@/config'; import { battle_msg_types, type_boss } from '@/config';
import i18n from '../i18n'; import i18n from '../i18n';
import { ControlBuff } from './buff'; import { ControlBuff } from './buff';
const { t } = i18n; const { t } = i18n;
@ -139,7 +139,7 @@ export abstract class Vampire extends SufPassiveSkill {
owner.addHp(sneak); owner.addHp(sneak);
if (sneak > 0) { if (sneak > 0) {
const log = replace(t('skill.vampire.2'), [sneak]); const log = replace(t('skill.vampire.2'), [sneak]);
owner.battleLog(log); owner.gainLog(log);
} }
} }
} }
@ -156,7 +156,7 @@ export abstract class Control extends ActionSkill {
log = replace(t('skill.control.0'), [t(target.type), this.last]); log = replace(t('skill.control.0'), [t(target.type), this.last]);
} }
log = log = replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + log; log = log = replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + log;
owner.battleLog(log); owner.atteckLog(log);
} }
} }
//主动攻击技能(普通攻击) //主动攻击技能(普通攻击)
@ -175,7 +175,7 @@ export class Attack extends ActionSkill {
if (owner.dmg) { if (owner.dmg) {
target.addHp(-1 * owner.dmg); target.addHp(-1 * owner.dmg);
const log = replace(t('skill.attack.2'), [t(owner.type), t('skill.' + this.name + '.0'), t(target.type), owner.dmg, critLog]); const log = replace(t('skill.attack.2'), [t(owner.type), t('skill.' + this.name + '.0'), t(target.type), owner.dmg, critLog]);
owner.battleLog(log); owner.atteckLog(log);
} }
} }
} }

6
src/config/skill/bracers.ts

@ -18,7 +18,7 @@ export class Xianglong extends PrePassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const extra = owner.extraAttr; const extra = owner.extraAttr;
extra.dmgPercent = callDmgPercent(extra.dmgPercent, this.dmgPercent); extra.dmgPercent = callDmgPercent(extra.dmgPercent, this.dmgPercent);
owner.battleLog(replace(t('skill.xianglong.2'), [this.hpPercent, this.dmgPercent])); owner.gainLog(replace(t('skill.xianglong.2'), [this.hpPercent, this.dmgPercent]));
} }
} }
//大力丹 //大力丹
@ -47,7 +47,7 @@ export class JuDu extends CounterSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const judu = new KuiLan('kuilan', this.last); const judu = new KuiLan('kuilan', this.last);
target.putBuff(judu); target.putBuff(judu);
owner.battleLog(replace(t('skill.judu.2'), [t(target.type), this.last])); owner.gainLog(replace(t('skill.judu.2'), [t(target.type), this.last]));
} }
} }
//利爪 //利爪
@ -63,6 +63,6 @@ export class LiZhao extends PrePassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
owner.skillPercent += this.percent; owner.skillPercent += this.percent;
owner.battleLog(replace(t('skill.lizhao.2'), [this.percent])); owner.gainLog(replace(t('skill.lizhao.2'), [this.percent]));
} }
} }

4
src/config/skill/buff.ts

@ -151,7 +151,7 @@ export class ControlBuff extends AttackBuff {
} }
takeEffect(owner: BattleRole): void { takeEffect(owner: BattleRole): void {
owner.action = null; owner.action = null;
owner.battleLog(replace(t('skill.control.2'), [t('skill.' + this.name + '.0'), t(owner.type)])); owner.debuffLog(replace(t('skill.control.2'), [t('skill.' + this.name + '.0'), t(owner.type)]));
} }
} }
//溃烂 //溃烂
@ -198,6 +198,6 @@ export class LiuXue extends AttackBuff {
takeEffect(owner: BattleRole): void { takeEffect(owner: BattleRole): void {
const dmg = Math.ceil(owner.attr.curHp * (this.percent / 100) * this.layer); const dmg = Math.ceil(owner.attr.curHp * (this.percent / 100) * this.layer);
owner.addHp(-1 * dmg); owner.addHp(-1 * dmg);
owner.battleLog(replace(t('skill.liuxue.1'), [this.layer, t(owner.type), dmg])); owner.debuffLog(replace(t('skill.liuxue.1'), [this.layer, t(owner.type), dmg]));
} }
} }

4
src/config/skill/jewelry.ts

@ -42,7 +42,7 @@ export class CritFear extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const additional = Math.ceil((owner.atk * this.percent) / 100); const additional = Math.ceil((owner.atk * this.percent) / 100);
target.addHp(-1 * additional); target.addHp(-1 * additional);
owner.battleLog(replace(t('skill.critFear.2'), [additional])); owner.extraDmgLog(replace(t('skill.critFear.2'), [additional]));
} }
} }
//琉璃盘 //琉璃盘
@ -75,6 +75,6 @@ export class JHSY extends CounterSkill {
const reflected = Math.ceil((target.baseDmg * this.percent) / 100); const reflected = Math.ceil((target.baseDmg * this.percent) / 100);
target.addHp(-1 * reflected); target.addHp(-1 * reflected);
const log = replace(t('skill.JHSY.2'), [t(owner.type), reflected]); const log = replace(t('skill.JHSY.2'), [t(owner.type), reflected]);
owner.battleLog(log); owner.extraDmgLog(log);
} }
} }

16
src/config/skill/neck.ts

@ -19,7 +19,7 @@ export class Duan extends SufPassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
target.addHp(-1 * this.dmg); target.addHp(-1 * this.dmg);
owner.battleLog(replace(st('duan.2'), [this.hpPercent, this.dmg])); owner.extraDmgLog(replace(st('duan.2'), [this.hpPercent, this.dmg]));
} }
} }
//红眼 //红眼
@ -41,7 +41,7 @@ export class HongYan extends PrePassiveSkill {
if (this.trigger(owner, target)) { if (this.trigger(owner, target)) {
const additional = Math.ceil((owner.atk * this.atkPercent) / 100); const additional = Math.ceil((owner.atk * this.atkPercent) / 100);
target.addHp(-1 * additional); target.addHp(-1 * additional);
owner.battleLog(replace(st('hongyan.2'), [this.hpPercent, additional])); owner.extraDmgLog(replace(st('hongyan.2'), [this.hpPercent, additional]));
} }
} }
} }
@ -61,14 +61,14 @@ export class ShaYi extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer);
owner.putBuff(shayi, this.retains); owner.putBuff(shayi, this.retains);
owner.battleLog(replace(st('shayi.2'), [shayi.layer])); owner.gainLog(replace(st('shayi.2'), [shayi.layer]));
} }
onAtked(owner: BattleRole, target: BattleRole): void { onAtked(owner: BattleRole, target: BattleRole): void {
if (target.crit) { if (target.crit) {
const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer);
shayi.layer = -1 * this.reduc; shayi.layer = -1 * this.reduc;
owner.putBuff(shayi, this.retains); owner.putBuff(shayi, this.retains);
owner.battleLog(replace(st('shayi.3'), [this.reduc])); owner.debuffLog(replace(st('shayi.3'), [this.reduc]));
} }
} }
} }
@ -88,7 +88,7 @@ export class NuMu extends CounterSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const numu = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); const numu = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer);
owner.putBuff(numu); owner.putBuff(numu);
owner.battleLog(replace(st('numu.2'), [numu.layer])); owner.gainLog(replace(st('numu.2'), [numu.layer]));
} }
} }
//龙腾 //龙腾
@ -109,7 +109,7 @@ export class LongTeng extends CounterSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100); const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100);
owner.shield += shield; owner.shield += shield;
owner.battleLog(replace(st('longteng.2'), [shield])); owner.gainLog(replace(st('longteng.2'), [shield]));
} }
} }
//幸运数字 //幸运数字
@ -121,7 +121,7 @@ export class XingYunShuZi extends SufPassiveSkill {
} }
beforeBattle(owner: BattleRole, target: BattleRole): void { beforeBattle(owner: BattleRole, target: BattleRole): void {
this.num = Math.ceil(Math.random() * 9); this.num = Math.ceil(Math.random() * 9);
owner.battleLog(replace(st('xingyunshuzi.2'), [t(owner.type), this.num])); owner.gainLog(replace(st('xingyunshuzi.2'), [t(owner.type), this.num]));
} }
trigger(owner: BattleRole, target: BattleRole): boolean { trigger(owner: BattleRole, target: BattleRole): boolean {
return this.num > 0 && owner.dmg % 10 == this.num; return this.num > 0 && owner.dmg % 10 == this.num;
@ -129,6 +129,6 @@ export class XingYunShuZi extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const dmg = owner.dmg * this.num; const dmg = owner.dmg * this.num;
target.addHp(-1 * dmg); target.addHp(-1 * dmg);
owner.battleLog(replace(st('xingyunshuzi.3'), [t(target.type), dmg])); owner.extraDmgLog(replace(st('xingyunshuzi.3'), [t(target.type), dmg]));
} }
} }

4
src/config/skill/pants.ts

@ -31,7 +31,7 @@ export class FuRenBiHu extends PrePassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
owner.extraAttr.dmgReduc = this.dmgReduc; owner.extraAttr.dmgReduc = this.dmgReduc;
owner.battleLog(replace(t('skill.furenbihu.2'), [this.hpPercent, this.dmgReduc])); owner.gainLog(replace(t('skill.furenbihu.2'), [this.hpPercent, this.dmgReduc]));
} }
} }
//灵感 //灵感
@ -62,7 +62,7 @@ export class WanKang extends CounterSkill {
const max = Math.ceil((owner.attr.hp * this.hpPercnet) / 100); const max = Math.ceil((owner.attr.hp * this.hpPercnet) / 100);
reflected > max && (reflected = max); reflected > max && (reflected = max);
target.addHp(-1 * reflected); target.addHp(-1 * reflected);
owner.battleLog(replace(t('skill.wankang.2'), [t(owner.type), reflected])); owner.extraDmgLog(replace(t('skill.wankang.2'), [t(owner.type), reflected]));
} }
} }
//五味 //五味

14
src/config/skill/ring.ts

@ -36,7 +36,7 @@ export class JinGangZhuo extends SufPassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
target.putBuff(new ControlBuff(this.name, this.last)); target.putBuff(new ControlBuff(this.name, this.last));
owner.battleLog(replace(t('skill.jinggangzhuo.2'), [this.last])); owner.extraDmgLog(replace(t('skill.jinggangzhuo.2'), [this.last]));
} }
} }
@ -56,10 +56,10 @@ export class FengXie extends SufPassiveSkill {
const fengxie = new CritDmgBuff(this.name, this.critDmg, 9999, this.maxLayer); const fengxie = new CritDmgBuff(this.name, this.critDmg, 9999, this.maxLayer);
if (owner.crit) { if (owner.crit) {
owner.putBuff(fengxie); owner.putBuff(fengxie);
owner.battleLog(replace(t('skill.fengxie.2'), [fengxie.layer])); owner.gainLog(replace(t('skill.fengxie.2'), [fengxie.layer]));
} else { } else {
owner.attackBuff.delete(this.name); owner.attackBuff.delete(this.name);
owner.battleLog(t('skill.fengxie.3')); owner.debuffLog(t('skill.fengxie.3'));
} }
} }
} }
@ -79,7 +79,7 @@ export class ShiZhong extends CounterSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const shizhong = new CritDmgReducBuff(this.name, this.critDmgReduc, 9999, this.maxLayer); const shizhong = new CritDmgReducBuff(this.name, this.critDmgReduc, 9999, this.maxLayer);
owner.putBuff(shizhong); owner.putBuff(shizhong);
owner.battleLog(replace(t('skill.shizhong.2'), [shizhong.layer])); owner.gainLog(replace(t('skill.shizhong.2'), [shizhong.layer]));
} }
} }
@ -96,7 +96,7 @@ export class ShenShang extends SufPassiveSkill {
} }
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
owner.addHp(this.hp); owner.addHp(this.hp);
owner.battleLog(replace(t('skill.shenshang.2'), [this.hp])); owner.gainLog(replace(t('skill.shenshang.2'), [this.hp]));
} }
} }
@ -113,12 +113,12 @@ export class TongJueFanJi extends CounterSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
if (!owner.action) { if (!owner.action) {
const log = replace(t('skill.tongjuefanji.3'), [t(owner.type)]); const log = replace(t('skill.tongjuefanji.3'), [t(owner.type)]);
owner.battleLog(log); owner.debuffLog(log);
return; return;
} }
owner.skillPercent = this.percent; owner.skillPercent = this.percent;
owner.callDmg(target); owner.callDmg(target);
target.addHp(-1 * owner.dmg); target.addHp(-1 * owner.dmg);
owner.battleLog(replace(t('skill.tongjuefanji.2'), [owner.dmg])); owner.atteckLog(replace(t('skill.tongjuefanji.2'), [owner.dmg]));
} }
} }

12
src/config/skill/weapon.ts

@ -21,7 +21,7 @@ export class IceBlade extends SufPassiveSkill {
const additional = Math.ceil((owner.atk * this.percent) / 100); const additional = Math.ceil((owner.atk * this.percent) / 100);
target.addHp(-1 * additional); target.addHp(-1 * additional);
target.putBuff(new ControlBuff(this.name, this.last)); target.putBuff(new ControlBuff(this.name, this.last));
owner.battleLog(replace(st('iceBlade.2'), [additional, t(target.type), this.last])); owner.extraDmgLog(replace(st('iceBlade.2'), [additional, t(target.type), this.last]));
} }
} }
//见红 //见红
@ -37,7 +37,7 @@ export class SeeRed extends ActionSkill {
owner.skillPercent = 0; owner.skillPercent = 0;
const liuxue = new LiuXue(this.layer, this.last); const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue); target.putBuff(liuxue);
owner.battleLog(replace(st('user'), [t(owner.type), st(this.name + '.0')]) + replace(st('seeRed.1'), [this.layer, this.last])); owner.extraDmgLog(replace(st('user'), [t(owner.type), st(this.name + '.0')]) + replace(st('seeRed.1'), [this.layer, this.last]));
} }
} }
//鳍刺 //鳍刺
@ -55,7 +55,7 @@ export class QiCi extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const liuxue = new LiuXue(this.layer, this.last); const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue); target.putBuff(liuxue);
owner.battleLog(replace(st('qici.2'), [t(target.type), this.layer, this.last])); owner.extraDmgLog(replace(st('qici.2'), [t(target.type), this.layer, this.last]));
} }
} }
//暴虐 //暴虐
@ -72,7 +72,7 @@ export class BaoNue extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const liuxue = new LiuXue(9999, this.last); const liuxue = new LiuXue(9999, this.last);
target.putBuff(liuxue); target.putBuff(liuxue);
owner.battleLog(replace(st('baonue.2'), [t(target.type), this.last])); owner.extraDmgLog(replace(st('baonue.2'), [t(target.type), this.last]));
} }
} }
//扎心 //扎心
@ -100,7 +100,7 @@ export class AoZhiDu extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const aozhidu = new KuiLan('kuilan', this.last); const aozhidu = new KuiLan('kuilan', this.last);
target.putBuff(aozhidu); target.putBuff(aozhidu);
owner.battleLog(replace(st('aozhidu.2'), [t(target.type), this.last])); owner.extraDmgLog(replace(st('aozhidu.2'), [t(target.type), this.last]));
} }
} }
//十九叉 //十九叉
@ -119,7 +119,7 @@ export class ShiJiuCha extends SufPassiveSkill {
if (this.cout >= 10) { if (this.cout >= 10) {
this.cout = 0; this.cout = 0;
const dmg = owner.dmg * this.times; const dmg = owner.dmg * this.times;
owner.battleLog(replace(st('shijiucha.2'), [t(owner.type), dmg])); owner.extraDmgLog(replace(st('shijiucha.2'), [t(owner.type), dmg]));
} }
} }
} }

19
src/tool/caller/battle.ts

@ -1,4 +1,4 @@
import { Equip, Skills, Monster, Attribute, Player } from '@/config'; import { Equip, Skills, Monster, Attribute, Player, battle_msg_types } from '@/config';
import { randonBootyEquip, deepCopy, replace, callReducPercent, callDmgReduc, callDmgPercent } from '@/tool'; import { randonBootyEquip, deepCopy, replace, callReducPercent, callDmgReduc, callDmgPercent } from '@/tool';
import i18n from '@/config/i18n'; import i18n from '@/config/i18n';
const { t } = i18n; const { t } = i18n;
@ -99,8 +99,21 @@ export class BattleRole {
this.initTmp(); this.initTmp();
}; };
battleLog = (log: string) => { atteckLog = (log: string) => {
this.commit('set_sys_info', { type: 'battle', msg: log }); const type = (this.crit ? battle_msg_types.crit : battle_msg_types.attack) + '_' + this.type;
this.commit('set_sys_info', { type: type, msg: log });
};
gainLog = (log: string) => {
const type = battle_msg_types.gain + '_' + this.type;
this.commit('set_sys_info', { type: type, msg: log });
};
debuffLog = (log: string) => {
const type = battle_msg_types.debuff + '_' + this.type;
this.commit('set_sys_info', { type: type, msg: log });
};
extraDmgLog = (log: string) => {
const type = battle_msg_types.extra + '_' + this.type;
this.commit('set_sys_info', { type: type, msg: log });
}; };
addHp = (hp: number) => { addHp = (hp: number) => {

18
src/views/archive.vue

@ -3,13 +3,14 @@
<img class="menu-img" :src="menu_icons.exportGame" @click="showMenu"> <img class="menu-img" :src="menu_icons.exportGame" @click="showMenu">
</Tooltip> </Tooltip>
<Dialog :title="t('archive.0')" v-model="showArchive" top="15%" left='8%'> <Dialog :title="t('archive.0')" v-model="showArchive" top="4rem" left='8%'>
<div class="archive"> <div class="archive">
<span class="tip">* {{ t('archive.1') }}</span> <span class="tip">* {{ t('archive.1') }}</span>
<textarea class="textarea" v-model="archive"></textarea> <textarea class="textarea" v-model="archive"></textarea>
</div> </div>
<div class="footer"> <div class="footer">
<button class="button" @click="copyArchive">{{ t('copyArchive.0') }}</button> <button class="button" @click="copyArchive(archive)">{{ t('copyArchive.0') }}</button>
<!-- <button class="button" @click="copyOldArchive">{{ t('copyArchive.3') }}</button> -->
<button class="button" @click="pasteArchive">{{ t('pasteArchive.0') }}</button> <button class="button" @click="pasteArchive">{{ t('pasteArchive.0') }}</button>
<button class="button" @click="importArchive">{{ t('importArchive.0') }}</button> <button class="button" @click="importArchive">{{ t('importArchive.0') }}</button>
</div> </div>
@ -46,9 +47,9 @@ const showMenu = () => {
} }
} }
const copyArchive = () => { const copyArchive = (archive) => {
if (navigator.clipboard && window.isSecureContext) { if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(archive.value).then(() => { navigator.clipboard.writeText(archive).then(() => {
commit('set_sys_info', { msg: t('copyArchive.1'), type: 'win' }) commit('set_sys_info', { msg: t('copyArchive.1'), type: 'win' })
showMenu(); showMenu();
}).catch(() => { }).catch(() => {
@ -56,7 +57,7 @@ const copyArchive = () => {
}); });
} else { } else {
const textField = document.createElement("textarea"); const textField = document.createElement("textarea");
textField.innerText = archive.value; textField.innerText = archive;
document.body.appendChild(textField); document.body.appendChild(textField);
textField.select(); textField.select();
document.execCommand("copy"); document.execCommand("copy");
@ -66,6 +67,11 @@ const copyArchive = () => {
} }
} }
const copyOldArchive = () => {
const archive = localStorage.getItem('transmigration_game_archive') || '';
copyArchive(archive);
}
const pasteArchive = () => { const pasteArchive = () => {
navigator.clipboard.readText().then((text) => { navigator.clipboard.readText().then((text) => {
archive.value = text; archive.value = text;
@ -134,7 +140,7 @@ onMounted(() => { });
} }
.textarea { .textarea {
width: 25rem; width: 30rem;
height: 15rem; height: 15rem;
user-select: text; user-select: text;
background: rgba($color: #ffffff, $alpha: 0.8); background: rgba($color: #ffffff, $alpha: 0.8);

45
src/views/message/sys-info.vue

@ -71,14 +71,11 @@ a {
margin-left: 0.3rem; margin-left: 0.3rem;
} }
.warning>.msg { .warning>.msg {
color: #f90202; color: #f90202;
} }
.battle>.msg {
color: #de8618;
}
.win>.msg { .win>.msg {
color: #24c4de; color: #24c4de;
} }
@ -92,6 +89,46 @@ a {
padding-left: 0.3rem; padding-left: 0.3rem;
} }
.attack_player>.msg,
.extra_player>.msg {
color: #B0E0E6;
}
.crit_player>.msg {
color: #FFD700;
}
.gain_player>.msg {
color: #2df805;
}
.debuff_player>.msg {
color: #489e0291;
}
.crit_monster,
.crit_boss>.msg {
color: #ff0505;
}
.attack_monster,
.attack_boss>.msg,
.extra_monster>.msg,
.extra_boss>.msg {
color: #ff0000a1;
}
.gain_monster,
.gain_boss>.msg {
color: #489e0291;
}
.debuff_monster,
.debuff_boss>.msg {
color: #2df805;
}
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.sysInfo { .sysInfo {
font-size: 0.8rem; font-size: 0.8rem;

2
src/views/shop/shop.vue

@ -3,7 +3,7 @@
<img class="menu-img" :src="menu_icons.shop" @click="showMenu"> <img class="menu-img" :src="menu_icons.shop" @click="showMenu">
</Tooltip> </Tooltip>
<Dialog :title="t('shop')" v-model="showShop" top="20%" left='8%'> <Dialog :title="t('shop')" v-model="showShop" top="4rem" left='8%'>
<div class="coins"> <div class="coins">
{{ t('coins.0') }}:{{ coins }} {{ t('coins.0') }}:{{ coins }}
</div> </div>

Loading…
Cancel
Save