// ==UserScript==
// @name 伤害计算器
// @namespace http://tampermonkey.net/
// @version 2026-03-05
// @description 这是描述还是标题
// @author 生猛的程序
// @match https://aring.cc/awakening-of-war-soul-ol/
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
const result = {};
//----如果复制不了装备F12 检查Sources下的assets/index-****.js是否匹配,不匹配需要重更新复制路径替换下面这个变量
let jsPath //`https://aring.cc/awakening-of-war-soul-ol/assets/index-nMbDFSxf.js`;
const changeTime=100 //--共斗DPS计算频率(毫秒)
let publicAuto = false //---true:开启共斗自动计算 false 取消自动计算
//
let buttXml = ``
// Your code here...
function findMsg(){
//const listview = document.querySelector('dungeon-list');
//const listview = document.querySelectorAll('.dungeon.affix');
// 获取父容器和所有子元素
const container = document.querySelector('.home-btn-wrap');
if (container) {
initView();
const children = container.children;
// 创建新元素
const newElement = document.createElement(`div`);
newElement.className = 'common-btn-wrap';
newElement.setAttribute(`color`,"#626aef")
newElement.setAttribute(`dark`,"true")
newElement.setAttribute(`data-v-ab3b4a1b`,"")
newElement.setAttribute(`style`,"grid-column: span 3;width:100%;")
newElement.innerHTML = buttXml;
// 添加点击事件(可选)
newElement.addEventListener('click', () => {
// console.log('新按钮被点击',T);
select = document.getElementById('buffType')
bdOption(buffTypeMap, select)
document.getElementById('modalOverlay').classList.add('show');
updateInfo()
});
// 插入到倒数第二个位置
// if (children.length > 0) {
// const insertBeforeNode = children[children.length - 1];
// container.insertBefore(newElement, insertBeforeNode);
// } else {
container.appendChild(newElement);
// }
/*
const pV=listview[listview.length-1]
if(pV){
const buttonGroup = pV.querySelector('[data-v-1100efd6] .left div[style="margin: 10px 0px;"]');
if(buttonGroup){
const newBtn = document.createElement('button');
newBtn.className = 'el-button el-button--danger is-plain';
newBtn.innerHTML = '伤害模拟';
// 添加点击事件(可选)
newBtn.addEventListener('click', () => {
console.log('新按钮被点击');
select = document.getElementById('buffType')
bdOption(buffTypeMap, select)
document.getElementById('modalOverlay').classList.add('show');
updateInfo()
});
// 插入到排行按钮右侧
buttonGroup.insertBefore(newBtn, buttonGroup.querySelector('.el-button--primary').nextSibling);
}
}*/
}else{
//每隔10秒一刷新
setTimeout(findMsg, 2000);
}
}
function findIndexJS(){
const scripts = document.querySelectorAll('script[src]');
scripts.forEach(script => {
const src = script.src;
if (src.includes('assets') && src.includes('index') && src.endsWith('.js')) {
jsPath=src;
setTimeout(findMsg, 3000);
setTimeout(findEndlessTower, 3000);
setTimeout(findRelicRuin, 3000);
setTimeout(renderUI,3000)
return
// console.log('找到目标文件:', src);
}
});
console.log('文件筛选完毕:');
}
setTimeout(findIndexJS, 2000);
//人物面板-共斗预测
let dpsTest=0
let isAuotRun=true
function renderUI(){
const dpsView= document.getElementById('p-dpsui');
if(dpsView){
dpsView.textContent = dpsTest==0?'点击启用':(dpsTest+'');
//dpsView.class= ''; // 方法2:使用setAttribute方法
dpsView.setAttribute('class', 'grow'); // 方法2:使用setAttribute方法
if(publicAuto){
publicAuto=false
setInterval(findPublicMonster, changeTime);
}
}else{
const viewparent = document.querySelector('.item-page.page');
if (viewparent) {
// 获取容器元素
const container = viewparent.querySelector('.text-wrap');
// 创建新的DPS元素
const dpsElement = document.createElement('p');
dpsElement.setAttribute(viewparent.attributes[0].name, '');
dpsElement.setAttribute('class', 'affix');
// 添加点击事件(可选)
dpsElement.addEventListener('click', () => {
if(dpsView){
dpsView.textContent = '计算中';
}
findPublicMonster()
});
// 创建第一个span(标签)
const labelSpan = document.createElement('span');
labelSpan.setAttribute('data-v-e550e92f', '');
labelSpan.textContent = '共斗DPS:';
// 创建第二个span(数值)
const valueSpan = document.createElement('span');
valueSpan.setAttribute('id', 'p-dpsui'); // 方法2:使用setAttribute方法
valueSpan.setAttribute('class', 'info'); // 方法2:使用setAttribute方法
valueSpan.setAttribute('data-v-e550e92f', '');
valueSpan.textContent = '点击启用';
// 组装元素
dpsElement.appendChild(labelSpan);
dpsElement.appendChild(valueSpan);
// 插入到容器的最前面(第一行位置)
container.insertBefore(dpsElement, container.firstChild);
}
setTimeout(renderUI,3000)
}
}
let clickType=1
//无尽之塔-模拟测试
let targetElement //--无尽大视图
let btnTitle //--挑战名称
let monsterInfoView //--挑战详情
function findEndlessTower(){
targetElement=document.querySelector('.endless-tower')
if (targetElement && targetElement.lastElementChild) {
btnTitle = targetElement.querySelector('.el-button')
monsterInfoView = targetElement.querySelector('.monster-detail')
// 获取最后一个子元素
const lastChild = targetElement.lastElementChild;
// 创建按钮元素
const button = document.createElement('button');
button.setAttribute('data-v-e84a4ea6', '');
button.setAttribute('aria-disabled', 'false');
button.setAttribute('type', 'button');
button.className = 'el-button el-button--warning is-plain';
// 添加点击事件(可选)
button.addEventListener('click', () => {
// 使用示例
if (monsterInfoView) {
clickType=1
extractMonsterInfo(monsterInfoView);
}else{
console.log('没找到挑战对象?');
}
});
// 创建span元素
const span = document.createElement('span');
span.className = '';
span.textContent = '预测';
// 组装按钮
button.appendChild(span);
// 将按钮添加到最后一个子元素中
lastChild.appendChild(button);
}else{
setTimeout(findEndlessTower, 3000);
}
}
//圣物遗迹-模拟测试
let targetElementRelicRuin //--无尽大视图
let btnTitleRelicRuin //--挑战名称
let monsterInfoViewRelicRuin //--挑战详情
function findRelicRuin(){
targetElementRelicRuin=document.querySelector('.relic-ruin')
if (targetElementRelicRuin && targetElementRelicRuin.lastElementChild) {
//5-2
btnTitleRelicRuin = targetElementRelicRuin.querySelector('.el-button')
monsterInfoViewRelicRuin = targetElementRelicRuin.querySelector('.monster-detail')
// 方法1:使用 children 属性获取第5个标签中的第2个子标签
const fifthChild = targetElementRelicRuin.lastElementChild; // 第5个子元素(索引从0开始)
const lastChild = fifthChild.children[1]; // 第2个子元素
//const lastChild = targetElementRelicRuin.;
// 创建按钮元素
const button = document.createElement('button');
button.setAttribute('data-v-e84a4ea6', '');
button.setAttribute('aria-disabled', 'false');
button.setAttribute('type', 'button');
button.className = 'el-button el-button--warning is-plain';
// 添加点击事件(可选)
button.addEventListener('click', () => {
// 使用示例
if (monsterInfoViewRelicRuin) {
clickType=2
extractMonsterInfo(monsterInfoViewRelicRuin);
}else{
console.log('没找到挑战对象?');
}
});
// 创建span元素
const span = document.createElement('span');
span.className = '';
span.textContent = '预测';
// 组装按钮
button.appendChild(span);
// 将按钮添加到最后一个子元素中
if(lastChild){
lastChild.appendChild(button);
}else{
setTimeout(findRelicRuin, 3000);
}
}else{
}
}
function extractMonsterInfo(htmlElement) {
// 获取怪物名称
const name = htmlElement.querySelector('h3').textContent.trim();
// 获取所有属性段落
const pElements = htmlElement.querySelectorAll('p');
// 初始化怪物对象
const monster = {
name: name,
hp: 0,
def: 0,
evs: 0,
crtdef: 0,
special: []
};
// 提取各属性数值
pElements.forEach(p => {
const text = p.textContent.trim();
if (text.includes('血量:')) {
monster.hp = parseFloat(text.replace('血量:', ''));
clickType==2 && monster.hp*1.7
} else if (text.includes('防御:')) {
monster.def = parseFloat(text.replace('防御:', ''));
} else if (text.includes('闪避率:')) {
monster.evs = parseFloat(text.replace('闪避率:', ''));
} else if (text.includes('抗爆率:')) {
monster.crtdef = parseFloat(text.replace('抗爆率:', ''));
} /*else if (text.includes('特性:')) {
// 提取特性信息
const specialElements = htmlElement.querySelectorAll('.special');
specialElements.forEach(special => {
monster.special.push(special.textContent.trim());
});
}*/
});
masterData = {}
Wj.map(item=>{
// if(monster.name==item.name){
if(monster.name.includes(item.name)){
//---共斗BOSS 无尽BOSS
masterData.attributes = monster
masterData.attributes.special = item.special
buffmasterList = masterData.attributes.special.map(buff => {
if (buff.type) {
return buff
} else {
return {
id: Date.now(), // 使用时间戳作为唯一ID
type: buff.key,
typeName: buff.name,
describe: Jp[buff.key].desc(buff.data),
...buff.data
};
}
})
}
})
console.log(masterData);
if (Object.keys(masterData).length > 0) {
coypClick(2);
}else{
showPKMsg(-1,-1,-1,-1)
}
// return monster;
}
let msgTextTE
let msgTextRuin
function showPKMsg(a,t,hp,lp){
//--计算剩余血量比率
const atkv=Number(( (lp/(hp+lp))*100 ).toFixed(2))
// let ih = '平均DPS:'.concat(a, ',用时:').concat(t,'秒,伤害:').concat(hp, `,剩余血量:`.concat(atkv, `%`))
let ih = '平均DPS:'.concat(a, ',用时:').concat(t,'秒,剩余血量:').concat(atkv, `%`)
if(a==-1&&t==-1){
ih = '没有找到这个怪物模板'
}
let msgText= initHintView(ih)
clickType==1?(msgTextTE=msgText):(msgTextRuin=msgText)
}
function initHintView(ih){
let reView= clickType==1?targetElement:targetElementRelicRuin
let msgText= clickType==1?msgTextTE:msgTextRuin
if(reView&&!msgText){
const msgView= reView.children[clickType];//--原本这里是下标1,但是刚好clicktype==2的时候需要下标2
msgText=document.createElement('div')
msgText.setAttribute('style','margin-top: 5px;margin-bottom:5px;')
msgText.innerHTML = ih
msgView.appendChild(msgText);
}else{
msgText.innerHTML = ih
}
return msgText
}
//setInterval(findPublicMonster, changeTime);
const headStr = `
/* 弹窗遮罩 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
max-width: 540px;
height: 100%;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.modal-overlay.show {
opacity: 1;
visibility: visible;
}
/* 弹窗主体 */
.modal {
background-color: #000;
box-sizing: border-box;
border: 2px solid #fff;
border-radius: 10px;
padding: 15px;
width: 90%;
max-width: 500px;
max-height: 90vh;
overflow-y: auto;
transform: scale(0.7);
transition: transform 0.3s ease;
}
@media (min-width: 1001px) {
.modal-overlay.show {
position: fixed;
transform: scale(1);
/* 定位到右侧 */
left: auto;
right: calc(50% - 770px);
}
}
.modal-overlay.show .modal {
transform: scale(1);
}
/* 标题 */
.modal-title {
color: #fff;
font-size: 20rp;
font-weight: bold;
text-align: center;
margin-bottom: 25px;
}
.viewparint {
padding: 30px;
width: 100%;
height: 100%;
border-radius: 10px;
box-sizing: border-box;
}
/* 表单容器 */
.form-container {
display: grid;
box-sizing: border-box;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 5px;
}
.form-container-msg {
min-height: 400px;
}
/* 输入项 */
.form-item {
display: flex;
flex-direction: column;
}
.form-item.full-width {
grid-column: 1 / -1;
}
.form-label {
color: #fff;
font-size: 14px;
margin-bottom: 5px;
font-weight: 500;
.master {}
}
.form-label.master {
color: #f00;
}
.form-input {
background-color: transparent;
border: 1px solid #fff;
border-radius: 5px;
padding: 5px 12px;
width: 100%;
color: #fff;
font-size: 14px;
transition: border-color 0.3s ease;
}
.form-input:focus {
outline: none;
border-color: #4CAF50;
box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}
.form-input::placeholder {
color: #888;
}
/* 下拉选择框 */
.form-select {
background-color: transparent;
border: 1px solid #fff;
border-radius: 5px;
padding: 5px 0px;
color: #fff;
font-size: 14px;
cursor: pointer;
transition: border-color 0.3s ease;
}
.form-select:focus {
outline: none;
border-color: #4CAF50;
box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}
.form-select option {
background-color: #000;
color: #fff;
}
/* Buff词缀区域 */
.buff-section {
grid-column: 1 / -1;
border: 1px solid #444;
border-radius: 8px;
padding: 20px;
margin-top: 10px;
}
.buff-title {
color: #4CAF50;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
text-align: center;
}
/* .buff-input-container {
display: flex;
gap: 10px;
background-color: aqua;
margin-bottom: 15px;
min-width: 100%;
align-items: end;
} */
.buff-input-container {
display: grid;
grid-auto-flow: column;
gap: 10px;
margin-bottom: 15px;
align-items: end;
}
.buff-input-item {
flex: 1;
min-width: 0;
}
.buff-input-item.atk {
margin-bottom: 8px;
font-size: 14px;
}
.buff-input-item .form-input,
.buff-input-item .form-select {
width: 100%;
}
.form-select.atk {
font-size: 12px;
}
/* 添加按钮 */
.add-buff-btn {
background-color: #4CAF50;
color: #fff;
border: none;
padding: 5px 12px;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s ease;
white-space: nowrap;
}
.add-buff-btn:hover {
background-color: #45a049;
}
/* Buff列表 */
.buff-list {
margin-top: 15px;
max-height: 200px;
overflow-y: auto;
}
.buff-item {
background-color: #222;
border: 1px solid #444;
border-radius: 5px;
padding: 10px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.buff-item-info {
color: #fff;
font-size: 14px;
flex: 1;
}
.buff-type {
color: #4CAF50;
font-weight: bold;
}
.buff-values {
color: #ccc;
margin-left: 10px;
}
.delete-buff-btn {
background-color: #f44336;
color: #fff;
border: none;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.3s ease;
}
.delete-buff-btn:hover {
background-color: #d32f2f;
}
.empty-buff-message {
color: #888;
text-align: center;
padding: 20px;
font-style: italic;
}
/* 按钮容器 */
.button-container {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 25px;
}
/* 按钮样式 */
.btn {
padding: 5px 10px;
border: 1px solid #fff;
border-radius: 5px;
background-color: transparent;
color: #fff;
font-size: 13px;
cursor: pointer;
transition: all 0.3s ease;
min-width: 80px;
}
.btn:hover {
background-color: #fff;
color: #000;
}
.btn-confirm {
border-color: #4CAF50;
color: #4CAF50;
}
.btn-confirm:hover {
background-color: #4CAF50;
color: #fff;
}
.btn-cancel {
border-color: #f44336;
color: #f44336;
}
.btn-cancel:hover {
background-color: #f44336;
color: #fff;
}
/* 触发按钮 */
.trigger-btn {
position: fixed;
top: 50%;
left: 50%;
background-color: #4CAF50;
color: white;
border: none;
padding: 15px 30px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
transform: translate(-50%, -50%);
}
.trigger-btn:hover {
background-color: #45a049;
}
#msgview {
border: 1px solid #fff;
padding: 10px;
max-width: 800px;
margin: 0 auto;
}
.message {
padding: 8px 0;
border-bottom: 1px dashed #444;
cursor: pointer;
}
.message:last-child {
border-bottom: none;
}
.message-number {
color: #fff;
font-weight: bold;
}
.numeric {
color: #fff;
}
.numeric.w {
color: #fff;
}
.numeric.b {
color: #AD6732;
font-weight: bold;
}
.numeric.r {
color: #a59aca;
}
`,
bodyStr = `
`
function injectStyleTag() {
const style = document.createElement('style');
style.type = 'text/css';
style.textContent = headStr;
document.head.appendChild(style);
}
function injectDivTag() {
const div = document.createElement('div');
div.innerHTML = bodyStr
document.body.appendChild(div);
}
// 方法1:拦截模块加载(适用于现代浏览器)
function getVarByInjection() {
const originalImport = unsafeWindow.importModule || unsafeWindow.import;
unsafeWindow.importModule = function(url) {
return originalImport(url).then(module => {
if(module.B) { // 检测目标导出
console.log('Captured Module qn:', module.B);
unsafeWindow._capturedB = module.B; // 转为全局可访问
}
return module;
});
};
}
function initView(){
console.log('页面初始化开始!')
injectStyleTag()
injectDivTag()
bindDataToInputs()
console.log('页面初始化完成!')
}
//------computerdata.js
const Gt = {
thumpM: {
name: "重击-率",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraDamage: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率额外造成当前攻击力 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害")
}
},
thumpV: {
name: "重击-值",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraDamage: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 伤害")
}
},
harvestM: {
name: "收割-率",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,额外造成 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害")
}
},
harvestV: {
name: "收割-值",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 伤害")
}
},
assaultM: {
name: "冲锋-率",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,额外造成 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害")
}
},
assaultV: {
name: "冲锋-值",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * (1 + h)), ")") : "", " 伤害")
}
},
chasing: {
name: "追击",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const u = 0;
return '每次攻击时,额外造成 '.concat(a, "").concat(u > 0 ?
'(+ '.concat(u, ")") : "", " 伤害")
}
},
heavyInjury: {
name: "重创",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const u = 0;
return '暴击时,额外造成 '.concat(Math.round(a + u), "").concat(u > 0 ?
'(+ '.concat(u, ")") : "", " 伤害")
}
},
break: {
name: "破阵",
desc: ({
multiplier: a,
extraMultiplier: o = 0,
soulType: r
}) => {
const n = r === 1 ? 1.2 : 1,
u = Number((o * Te.break.extraMultiplier * n).toFixed(2));
return '攻击力提高 '.concat(we(a + u, 2), "%").concat(u ?
'(+ '.concat(u, "%)") : "")
}
},
crushBoneV: {
name: "碎骨-值",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率忽略敌方 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 防御")
}
},
crushBoneM: {
name: "碎骨-率",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御")
}
},
burst: {
name: "爆发",
desc: ({
rate: a,
extraRate: o = 0,
soulType: r
}) => {
const u = 0;
return '攻击未暴击时,额外进行一次暴击判定,概率为 '.concat(we(a + u, 2), "%").concat(u > 0 ?
'(+ '.concat(u, "%)") : "", "")
}
},
nothingness: {
name: "虚无",
desc: ({
multiplier: a,
extraMultiplier: o = 0,
soulType: r
}) => {
const u = 0;
return ''.concat(we(a + u, 2), "%").concat(u ? '(+ '
.concat(u, "%)") : "", ' 的伤害转换为真实伤害')
}
},
split: {
name: "分裂",
desc: ({
rate: a,
value: o,
extraRate: r = 0,
soulType: n
}) => {
const c = 0;
if (a === 100) return '攻击分裂为 '.concat(o + 1, " 段伤害").concat(c > 0 ?
','.concat(we(c * 100, 2), '%概率额外分裂 ')
.concat(o, "段") : "");
if (a * (1 + c) > 100) {
const y = a * (1 + c) - 100;
return '攻击分裂为 '.concat(o + 1, " 段伤害").concat(c > 0 ?
','.concat(we(y, 2), '%概率额外分裂 ').concat(
o, " 段") : "")
} else return ''.concat(we(a * (1 + c), 2), "%").concat(c > 0 ?
'(+ '.concat(we(a * c, 2), "%)") : "",
' 概率,攻击分裂为 ').concat(o, " 段伤害")
}
},
cruelV: {
name: "残忍-值",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const _ = 0,
y = 0
return '暴击时,忽略敌方 '.concat(Math.round(a + _), "").concat(_ > 0 ?
'(+ '.concat(_, ")") : "").concat(y > 0 ?
' + '.concat(y, '%(+ ').concat(y,
"%)") : "", " 防御")
}
},
cruelM: {
name: "残忍-率",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const _ = 0,
y = 0;
return '暴击时,忽略敌方 '.concat(we(o, 2), "%")
.concat(y > 0 ? '(+ '.concat(y, "%)") : "").concat(_ > 0 ?
' + '.concat(_, '(+ ').concat(_,
")") : "", " 的防御")
}
},
cruelAll: {
name: "残忍-率",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const _ = a,
y = 0;
return '暴击时,忽略敌方 '.concat(we(o, 2), "%")
.concat(y > 0 ? '(+ '.concat(y, "%)") : "").concat(_ > 0 ?
' + '.concat(_, '(+ ').concat(_,
")") : "", " 的防御")
}
},
shadowBladeV: {
name: "影刃-值",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = 0,
y = 0;
return '每次攻击时,额外造成 '.concat(we(a + _), "").concat(_ > 0 ?
'(+'.concat(_, ")") : "").concat(y > 0 ?
' + '.concat(y, '%(+ ').concat(y,
"%)") : "", ' 真实伤害')
}
},
shadowBladeM: {
name: "影刃-率",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = 0,
y = 0;
return '每次攻击时,额外造成 '.concat(we(o + y, 2), "%").concat(y > 0 ?
'(+ '.concat(y, "%)") : "").concat(_ > 0 ?
' + '.concat(_, '(+ ').concat(_,
")") : "", ' 的真实伤害')
}
},
swiftness: {
name: "轻灵",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const n = r === 3 ? 1.2 : 1,
u = Number((Te.swiftness.extraValue * n * o).toFixed(2));
return '额外攻击速度增加 '.concat(we(a - 1 + u, 2)).concat(u > 0 ?
'(+'.concat(u, ")") : "", " 倍")
}
},
sharp: {
name: "锋利",
desc: ({
multiplier: a
}) => '攻击时,附加 '.concat(a, "% 的伤害")
},
precise: {
name: "精准",
desc: ({
multiplier: a,
extraMultiplier: o = 0,
soulType: r
}) => {
const n = r === 3 ? 1.2 : 1,
u = 0;
return '降低敌方闪避率的 '.concat(we(a + u, 2), "%").concat(u > 0 ?
'(+ '.concat(u, "%)") : "", "")
}
},
routM: {
name: "击溃-率",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = 0,
y = 0;
return '降低敌方抗暴率的 '.concat(we(o + y, 2), "%").concat(y > 0 ?
'(+ '.concat(y, "%)") : "")
}
},
routV: {
name: "击溃-值",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = 0,
y = 0;
return '减少敌方 '.concat(we(parseInt(a) + _, 2), "%").concat(_ > 0 ?
'(+'.concat(_, ")") : "", " 抗暴率")
}
},
tearInjury: {
name: "裂创",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const n = r === 2 ? 1.2 : 1,
u = 0;
return '暴击时,额外造成 '.concat(Math.round(a + u), "").concat(u > 0 ?
'(+'.concat(u, ")") : "",
' 真实伤害')
}
},
impactV: {
name: "冲击-值",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 防御")
}
},
impactM: {
name: "冲击-率",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御")
}
},
windUpV: {
name: "收尾-值",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(o * (1 + h), 2), "").concat(h > 0 ?
'(+ '.concat(we(o * h, 2), "%)") : "", " 防御")
}
},
windUpM: {
name: "收尾-率",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = 0,
h = 0;
return '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御")
}
},
swanElegy: {
name: "噩兆",
desc: ({
hpPercent: a
}) => '敌方血量低于 '.concat(a, "% 时,必定暴击")
},
lucky7: {
name: "幸运7",
desc: ({
rate: a
}) => '攻击时暴击率固定为 '.concat(a, "%")
},
drawChop: {
name: "拔刀斩",
desc: ({
atkPercent: a
}) => '攻击速度 减半,攻击 + '.concat(we((a - 1) * 100),
'%,命中 + 20%,暴击 + 20%')
},
onikiri: {
name: "鬼斩",
desc: ({
rate: a
}) => ''.concat(a, '% 概率,将所有伤害转为真实伤害')
},
longYa: {
name: "暴虐",
desc: ({
percent: a
}) => ''.concat(a * 100, "% 的破防转换为攻击")
},
desolator: {
name: "黯灭",
desc: ({
crtd: a
}) => '暴击伤害固定为 '.concat(a, "%")
},
gentle: {
name: "温柔一刀",
desc: () => '暴击时,无法造成伤害'
},
nightingale: {
name: "夜莺",
desc: () => '获得等同于 暴击率 的 攻击'
},
balance: {
name: "神圣平衡",
desc: ({
value: a
}) => '将 额外攻击力 与 破防 互换'
},
pity: {
name: "怜悯",
desc: ({
value: a
}) => '命中率固定为 '.concat(a, "%")
},
parocheth: {
name: "帷幕",
desc: ({
hpPercent: a
}) => '敌方血量低于 '.concat(a, "% 时,必定命中")
},
shock: {
name: "震慑",
desc: ({
multiplier: a,
mag: o
}) => '若攻击大于敌方 '.concat(o, '倍防御时,忽略敌方 ').concat(a,
"% 的防御")
},
sigh: {
name: "扼腕",
desc: ({
hpPercent: a,
multiplier: o
}) => '敌方血量低于 '.concat(a, '% 时,额外造成 ').concat(o,
'% 的真实伤害')
},
cease: {
name: "止息",
desc: ({
multiplier: a
}) => '若结算命中率大于 100%时,额外造成 '.concat(a, "% 的伤害")
},
shudder: {
name: "震撼",
desc: ({
multiplier: a
}) => '若结算暴击率大于 100%时,额外造成 '.concat(a, "% 的伤害")
},
secretLucky7: {
name: "秘 · 幸运7",
desc: () =>
'暴击率固定为 7.77%,与原暴击率相比,每降低 1%暴击率,则获得 2%暴击伤害'
},
secretPity: {
name: "秘 · 怜悯",
desc: () =>
'命中率固定为 80%,与原命中率相比,每降低 1%命中率,则获得 1破防'
},
mockMoon: {
name: "幻月",
desc: ({
mag: a
}) => '获得 '.concat(a,
' 倍额外攻击速度 的命中率')
},
slaughter: {
name: "屠戮",
desc: ({
hpPercent: a
}) => '敌方血量低于 '.concat(a, "% 时,无视防御")
},
fate: {
name: "命运",
desc: ({
min: a,
max: o
}) => '攻击命中时,将随机造成其伤害的 '.concat(a, "% ~ ").concat(o, "%")
},
focus: {
name: "青羽",
desc: ({
mag: a
}) => '暴击率及额外暴击伤害增加 '.concat(a,
"倍")
},
fallDream: {
name: "入梦",
desc: ({
mag: a
}) => '攻击未命中时,造成当前攻击力 '.concat(a * 100,
'% 的真实伤害')
},
tranquil: {
name: "安谧",
desc: () => '将 一半的暴击率转换为命中率'
},
shadowHit: {
name: "影袭",
desc: ({
multiplier: a
}) => '真实伤害增加 '.concat(a, "%")
},
honor: {
name: "荣耀",
desc: ({
multiplier: a
}) => '当造成特效仅包含 荣耀时,增加 '.concat(a,
'%伤害,反之降低 ').concat(a, "%")
},
bloodKiss: {
name: "血吻",
desc: ({
mag: a
}) => '攻击时,获得敌方 '.concat(a, '倍闪避值的破防')
},
fireHeart: {
name: "心火",
desc: ({
mag: a
}) => '每次攻击时,额外造成 '.concat(a, '倍敌方抗暴值的伤害')
}
},
Jp = {
counterAtk: {
name: "反击",
desc: ({
multiplier: a
}) => '受到多段攻击时,免疫 '.concat(a, "% 的伤害")
},
resist: {
name: "抵抗",
desc: ({
hpPercent: a,
value: o
}) => '血量低于 '.concat(a, '%时,增加 ').concat(o, " 防御")
},
survival: {
name: "求生",
desc: ({
hpPercent: a,
value: o
}) => '血量低于 '.concat(a, '%时,增加 ').concat(o, "% 闪避率")
},
weak: {
name: "虚弱",
desc: ({
value: a,
multiplier: o
}) => a ? '降低玩家 '.concat(o, " 攻击") : '降低玩家 '.concat(o,
"% 攻击")
},
fearless: {
name: "无畏",
desc: ({
hpPercent: a,
value: o
}) => '血量高于 '.concat(a, '%时,增加 ').concat(o, " 防御")
},
bedrock: {
name: "磐石",
desc: ({
rate: a,
value: o
}) => '受到攻击时,'.concat(a, '% 概率增加 ').concat(o, " 防御")
},
slow: {
name: "迟缓",
desc: ({
multiplier: a,
}) => '降低玩家 '.concat(a, "% 攻击速度")
},
stout: {
name: "坚韧",
desc: ({
hpPercent: a,
value: o
}) => '血量低于 '.concat(a, '%时,增加 ').concat(o, " 防御")
},
vampirism: {
name: "吸血",
desc: ({
value: a
}) => '攻击 未命中时,怪物回复 '.concat(Math.round(a * 100),
"% 血量")
},
intimidate: {
name: "恐吓",
desc: ({
value: a,
multiplier: o
}) => o ? '降低玩家 '.concat(o,
"% 破防") : '降低玩家 '.concat(a, " 破防")
},
repress: {
name: "镇压",
desc: ({
multiplier: a
}) => '受到暴击时,免疫 '.concat(a, "% 的伤害")
},
restore: {
name: "修复",
desc: ({
hpPercent: a,
value: o
}) => '血量降低至 '.concat(a, '% 以下时,免疫一次伤害并恢复 ').concat(o,
"% 血量(仅触发一次)")
},
palsy: {
name: "麻痹",
desc: ({
multiplier: a
}) => '受到非暴击攻击时,免疫 '.concat(a, "% 的伤害")
},
devour: {
name: "吞噬",
desc: ({
triggerValue: a,
multiplier: o
}) => '伤害结算时,若防御高于 '.concat(a, ',免疫 ').concat(o,
"% 的伤害")
},
/*
etanglement: {
name: "缠绕",
desc: ({
multiplier: a
}) => '降低玩家攻击速度的 '.concat(a, "%")
},*/
curse: {
name: "诅咒",
desc: ({
multiplier: a
}) => '降低玩家命中率的 '.concat(a, "%")
},
burn: {
name: "灼烧",
desc: ({
triggerValue: a,
multiplier: o
}) => '受到特效大于 '.concat(a, ' 个时,免疫 ').concat(o,
"% 的伤害")
},
willpower: {
name: "意志",
desc: ({
hpPercent: a,
value: o
}) => '血量低于 '.concat(a, '% 时,增加 ').concat(o,
"% 抗暴率")
},
strong: {
name: "坚固",
desc: () => '获得等同于玩家攻击的防御'
},
thirstyBlood: {
name: "渴血",
desc: ({
value: a
}) => '攻击 未命中 或 未暴击时,怪物回复 '
.concat(Math.round(a * 100), "% 血量")
},
deathStare: {
name: "死亡凝视",
desc: ({
triggerValue: a,
rate: o
}) => '每 2秒受击次数超过 '.concat(a * 2,
'次时,有 ').concat(o, '% 概率直接失败')
},
antibody: {
name: "抗体",
desc: ({
triggerValue: a,
multiplier: o
}) => '受到特效小于 '.concat(a, ' 个时,免疫 ').concat(o,
"% 的伤害")
},
thorn: {
name: "荆棘",
desc: ({
triggerValue: a,
multiplier: o
}) => '单次受到伤害大于血量的 '.concat(a, '% 时,免疫 ').concat(o,
"% 的伤害")
}
/*
magicCrystal: {
name: "魔法水晶",
desc: ({}) =>
'水晶龙后背潜藏着巨大能量的魔法水晶,若不及时打碎,则水晶将激发出巨大的能力(60秒后,若血量高于 65%,激发 水晶能量)'
},
crystalEnergy: {
name: "水晶能量",
desc: ({}) => '激发时,增加 500 防御'
},
thunderWitchcraft: {
name: "雷霆巫术",
desc: () =>
'血量低于50% 时,发动 雷霆护盾,同时发动 麻痹(受到非暴击攻击时,免疫 80% 的伤害)'
},
thunderShield: {
name: "雷霆护盾",
desc: () => '发动后,增加 50% 抗暴率'
},
frostWitchcraft: {
name: "冰霜巫术",
desc: () =>
'血量低于50% 时,发动 冰霜护盾,同时发动 吸血(攻击 未命中时,怪物回复 2% 血量)'
},
frostShield: {
name: "冰霜护盾",
desc: () => '发动后,增加 55% 闪避率'
},
fireWitchcraft: {
name: "烈焰巫术",
desc: () =>
'血量低于50% 时,发动 烈焰护盾,同时发动 吞噬(伤害结算时,若防御高于 200,免疫 80% 的伤害)'
},
fireShield: {
name: "烈焰护盾",
desc: () => '发动后,增加 250 防御'
},
senile: {
name: "衰老",
desc: ({
time: a,
maxValue: o
}) => ''.concat(a / 60, '分钟内,持续降低玩家攻击力,最高降低 ').concat(o *
100, "%,直至战斗结束")
},
terror: {
name: "惊骇",
desc: ({
hpPercent: a,
multiplier: o
}) => '血量低于 '.concat(a, '% 时,降低玩家命中率的 ').concat(o,
"%")
},
nirvana: {
name: "涅槃",
desc: ({
hpPercent: a,
value: o,
times: r
}) => '血量降低至 '.concat(a, '% 以下时,免疫一次伤害并恢复 ').concat(o,
'% 血量(可触发 ').concat(r, "次)")
},
broiling: {
name: "炙热",
desc: ({
triggerValue: a,
multiplier: o
}) => '第 3 次涅槃后,受到特效大于 '.concat(
a, ' 个时,免疫 ').concat(o, "% 的伤害")
},
sacredArmor: {
name: "神圣铠甲",
desc: ({
hpPercent: a
}) => '血量低于 '.concat(a, '% 以下时,免疫真实伤害以外所有伤害')
},
liveOn: {
name: "生息",
desc: ({
hpPercent: a,
value: o
}) => '血量高于 '.concat(a, '% 时,每次受击回复 ').concat(we(o * 100,
1), "% 血量")
},
thorn: {
name: "荆棘",
desc: ({
triggerValue: a,
multiplier: o
}) => '单次受到伤害大于血量的 '.concat(a, '% 时,免疫 ').concat(o,
"% 的伤害")
},
incorporeality: {
name: "虚体",
desc: ({
multiplier: a
}) => '免疫 非真实伤害的 '.concat(a, "%")
},
stun: {
name: "击晕",
desc: ({
percent: a
}) => "".concat(a, '% 概率,免疫 伤害型特效')
},
recovery: {
name: "复苏",
desc: ({
value: a,
times: o
}) => '受到 致命伤害时,免疫一次伤害并恢复 '.concat(a,
'% 血量(可触发 ').concat(o, "次)")
},
disdain: {
name: "蔑视",
desc: () => '防御 无法被降低'
},
elementDef: {
name: "",
explainName: ({
element: a
}) => "".concat(bs[a], "元素护盾"),
desc: ({
element: a
}) => {
const o = ii[a],
r = jt[o];
return '受到 '.concat(r).concat(bs[o],
'元素伤害时,增加玩家 20%的伤害;受到 ').concat(jt[a])
.concat(bs[a], '元素伤害时,伤害不变;受到其他元素伤害时降低 20%的伤害')
}
},
superHard: {
name: "巨硬",
desc: () => '强制将受到的攻击降低为 1'
}*/
},
Gw = [
{
name: "测试木桩",
hp: 1439000, //144795
def: 200,
evs: 20,
crtdef: 10,
special: []
}, {
name: "暴雷元素",
hp: 1439000, //144795
def: 200,
evs: 20,
crtdef: 10,
special: [{
name: "麻痹",
key: "palsy",
data: {
multiplier: 60
}
}]
},
{
name: "蝎狮",
hp: 1250000, //144795
def: 240,
evs: 15,
crtdef: -20,
special: [{
name: "虚弱",
key: "weak",
data: {
multiplier: 50
}
}]
},
{
name: "食人魔王",
hp: 1200000, //144795
def: 330,
evs: -15,
crtdef: 5,
special: [{
name: "吞噬",
key: "devour",
data: {
triggerValue: 150,
multiplier: 50
}
}]
},
{
name: "邪神王",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "修复",
key: "restore",
data: {
hpPercent: 10,
value: 30
}
}, {
name: "反击",
key: "counterAtk",
data: {
multiplier: 30
}
}]
},
{
name: "钻石人",
hp: 1166000, //144795
def: 600,
evs: -25,
crtdef: -20,
special: []
},
{
name: "木乃伊",
hp: 1750000, //144795
def: 145,
evs: -5,
crtdef: -20,
special: [{
name: "诅咒",
key: "curse",
data: {
multiplier: 30
}
}, {
name: "修复",
key: "restore",
data: {
hpPercent: 70,
value: 30
}
}]
},
{
name: "黑暗骑士",
hp: 1110000, //144795
def: 265,
evs: 20,
crtdef: 10,
special: [{
name: "诅咒",
key: "curse",
data: {
multiplier: 20
}
}, {
name: "恐吓",
key: "intimidate",
data: {
multiplier: 30
}
}]
},
{
name: "野牛",
hp: 1220000, //144795
def: 240,
evs: 0,
crtdef: 30,
special: [{
name: "镇压",
key: "repress",
data: {
multiplier: 90
}
}, {
name: "无畏",
key: "fearless",
data: {
hpPercent: 80,
value: 50
}
}]
},
{
name: "混沌泥妖",
hp: 1649000, //144795
def: 140,
evs: 0,
crtdef: 0,
special: [{
name: "迟缓",
key: "slow",
data: {
multiplier: 45
}
}]
},
{
name: "火精灵",
hp: 1340000, //144795
def: 210,
evs: 25,
crtdef: 0,
special: [{
name: "灼烧",
key: "burn",
data: {
triggerValue: 2,
multiplier: 50
}
}]
},
{
name: "石元素",
hp: 1170000, //144795
def: 330,
evs: 10,
crtdef: 50,
special: [{
name: "坚韧",
key: "stout",
data: {
hpPercent: 20,
value: 200
}
}]
},
{
name: "冰晶元素",
hp: 1230000, //144795
def: 145,
evs: 50,
crtdef: 5,
special: [{
name: "求生",
key: "survival",
data: {
hpPercent: 10,
value: 60
}
}]
},
{
name: "金人",
hp: 1010000, //144795
def: 400,
evs: -30,
crtdef: 70,
special: [{
name: "磐石",
key: "bedrock",
data: {
rate: 50,
value: 100
}
}]
},{
name: "东洋倭寇",
hp: 1410000, //144795
def: -250,
evs: -250,
crtdef: -250,
special: []
}
],
Wj = [
{
name: "恐怖骑士",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "诅咒",
key: "curse",
data: {
multiplier: 25
}
}, {
name: "恐吓",
key: "intimidate",
data: {
multiplier: 35
}
}]
},{
name: "凶牙兽",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "荆棘",
key: "thorn",
data: {
triggerValue: 0.4,
multiplier: 60
}
}]
},{
name: "独角兽",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "麻痹",
key: "palsy",
data: {
multiplier: 70,
}
}, {
name: "修复",
key: "restore",
data: {
hpPercent: 70,
value: 30
}
}]
},{
name: "毒蝎狮",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "虚弱",
key: "weak",
data: {
multiplier: 60
}
}, {
name: "抵抗",
key: "resist",
data: {
hpPercent: 40,
value: 100
}
}]
}, {
name: "烈火精灵",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "灼烧",
key: "burn",
data: {
triggerValue: 2,
multiplier: 70
}
}]
}, {
name: "诡诈巫师",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "镇压",
key: "repress",
data: {
multiplier: 90
}
}]
}, {
name: "水晶巨像",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "坚固",
key: "strong",
data: {}
}]
}, {
name: "冰晶元素",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "求生",
key: "survival",
data: {
hpPercent: 10,
value: 60,
}
}]
},{
name: "影魔",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "求生",
key: "survival",
data: {
hpPercent: 10,
value: 80,
}
}]
},
{
name: "钻石人",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: []
},
{
name: "野牛",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "无畏",
key: "fearless",
data: {
hpPercent: 80,
value: 50
}
}, {
name: "镇压",
key: "repress",
data: {
multiplier: 60
}
}]
},
{
name: "蛮牛",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "无畏",
key: "fearless",
data: {
hpPercent: 70,
value: 100
}
}, {
name: "镇压",
key: "repress",
data: {
multiplier: 70
}
}]
},
{
name: "暴雷元素",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "麻痹",
key: "palsy",
data: {
multiplier: 60,
}
}]
},
{
name: "石元素",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [
{
name: "坚韧",
key: "stout",
data: {
hpPercent: 20,
value: 200
}
}
]
},
{
name: "混沌泥妖",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "虚弱",
key: "slow",
data: {
multiplier: 45
}
}]
},
{
name: "蝎狮",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "虚弱",
key: "weak",
data: {
multiplier: 50
}
}]
},
{
name: "火精灵",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "灼烧",
key: "burn",
data: {
triggerValue: 2,
multiplier: 70
}
}]
},
{
name: "黑暗骑士",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "诅咒",
key: "curse",
data: {
multiplier: 20
}
}, {
name: "恐吓",
key: "intimidate",
data: {
multiplier: 30
}
}]
},
{
name: "妖魂",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "虚体",
key: "incorporeality",
data: {
multiplier: 50
}
}]
},
{
name: "飞龙",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "吞噬",
key: "devour",
data: {
triggerValue: 100,
multiplier: 50
}
}, {
name: "恐吓",
key: "intimidate",
data: {
multiplier: 30
}
}]
},
{
name: "精神元素",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "抗体",
key: "antibody",
data: {
triggerValue: 6,
multiplier: 60
}
}, {
name: "抵抗",
key: "resist",
data: {
hpPercent: 30,
value: 100
}
}]
},
{
name: "梦魇兽",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "死亡凝视",
key: "deathStare",
data: {
triggerValue: 3,
rate: 5
}
}]
},
{
name: "灯灵",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "迟缓",
key: "slow",
data: {
value: 55
}
}, {
name: "修复",
key: "restore",
data: {
hpPercent: 5,
value: 25
}
}]
},
{
name: "蛇妖",
hp: 1340000, //144795
def: 210,
evs: -10,
crtdef: 30,
special: [{
name: "吸血",
key: "vampirism",
data: {
value: 0.03
}
}, {
name: "反击",
key: "counterAtk",
data: {
multiplier: 30
}
}]
}
];
let dCount = 0 //----刀数
let dCount_c = 0 //----刀数
function we(a, o = 0) {
if (typeof a == "number") return Number(a.toFixed(o))
}
function writData(userinfo, buffs) {
Object.assign(I, userinfo);
akt_w.attrs.special = buffs ? buffs.map((buff) => {
let model = {
"key": buff.type,
"data": {},
}
Object.keys(buff).forEach(key => {
var v = buff[key]
var a = 0
if (isNaN(v)) {
model.data[key] = v;
} else {
a = Number(v)
model.data[key] = a;
}
});
model.name = model.data.typeName
return model
}) : []
}
// 'triggerValue': buff.triggerValue, //--条件
// "rate": buff.triggerValue, //---条件
// "hpPercent": buff.triggerValue, //--条件
// "multiplier": buff.damageValue, //--值
// "value": buff.damageValue, //--值
function writeMaster(userinfo, buffs) {
Object.assign(custommonster, userinfo);
custommonster.special = buffs ? buffs.map((buff) => {
let model = {
"name": buff.typeName,
"key": buff.type,
"data": {
...buff
}
}
Object.keys(buff).forEach(key => {
var v = buff[key]
var a = 0
if (isNaN(v)) {
model.data[key] = v;
} else {
a = Number(v)
model.data[key] = a;
}
});
return model
}) : []
}
// {
// "key": "chasing",
// "data": {
// "value": 44
// }
// }
const
I = { //---人物属性
atk: 180,
atksp: 258.3,
crt: 0, //
bcrt: 34.5, //--暴击
crtd: 194, //--爆伤
heat: 90, //--破防?
hr: 116.9, //--命中
ys: 9.1, //--元素伤害?
all: 22.6 //--全属性伤害
},
custommonster = {
name: "牢a木桩",
hp: 188900, //144795
def: 126,
evs: 21.2,
crtdef: -127.5,
special: [{
name: "镇压",
key: "repress",
data: {
multiplier: 90
}
}]
},
akt_w = {
"name": "博学者之戒",
"type": "jewelry",
"quality": "legend",
"attrs": {
"basic": {
"crt": 0,
"hr": 0
},
"special": []
},
"equipId": 19019,
"id": "19019",
"reinforcedLevel": 0,
"isLock": false
},
monster_w = {
},
pkinfo = {
pktypes: [],
allMsgCount: 0,
overHP: 0, //--造成伤害
sqAllCount: 0, //统计分裂次数
runTime: 0, //当前用时
oldHP: 0, //剩余血量
maxHP: 0,
crtCount: 0,
};
let tx = []
function je(W) {
//--攻击CD完成后才能进攻
pkinfo.sqAllCount = 0
if (!tx || tx.length <= 0) tx = L_TW('split')
sqTG(tx, 0)
return pkinfo.oldHP || pkinfo.oldHP > 0
}
function L_TW(W) {
var ae = akt_w.attrs.special.filter(i => i.key === W)
return ae != null && ae.length > 0 ? ae : null
}
function M_TW(W) {
var ae = custommonster.special.filter(i => i.key === W)
return ae != null && ae.length > 0 ? ae : null
}
let allsq=0,spccc=0;
let allsqaa=0,spcccaa=0;
function sqTG(tx) {
pkinfo.allMsgCount++
//allsqaa++
if (tx && tx.length > 0) {
var spCount = 0
let sqlv = 0
// 使用while循环替代forEach
for (let i = 0; i < tx.length; i++) {
const item = tx[i];
const randomValue = Math.random() * 100;
if (randomValue <= item.data.rate) {
sqlv++;
}
// else {
// break; // 不满足条件时终止循环
// }
}
spCount = sqlv * 2 + 1
//spcccaa+=spCount
for (var i1 = 0; i1 < spCount; i1++) {
// $n(true)
$n(false, sqlv)
}
// // for (let i = spLv; i < tx.length; i++) {
// if (spLv < tx.length-1) {
// let item = tx[spLv]
// const rand = Math.random() * 100
// if (rand <= item.data.rate) {
// // const ct = item.data.value
// spCount = Math.max(spCount, item.data.value)
// }
// if (spCount > 0) {
// for (var i1 = 0; i1 < spCount; i1++) {
// // $n(true)
// sqTG(tx, spLv + 1)
// }
// }
// }
// //直到不分裂
// if (spCount == 0) {
// pkinfo.sqAllCount++
// $n(false, spLv)
// }
} else {
$n(false, 0)
}
}
let shTxt = {}
function $n(W, sqCount = 0) {
allsq++;
var Zt, Ra, Sl;
let ae = !0,
ke = "",
{
def: Ce,
evs: Qe, //---怪物闪避
crtdef: Je
} = custommonster,
{
atk: Tn,
bcrt: Fn,
crtd: Un,
heat: bn,
hr: At,
fhr: on, //--命中
ys: Ys, //--元素伤害?
all: All //--全属性伤害
} = I,
remainL = [];
function fn(In) {
ke = "".concat(In, ",") + ke
}
function hn(In) {
ke += "".concat(Gt[In].name, ",")
}
function txC(htmlStr) {
// 提取标签内容并过滤空值
//const htmlStr = "诅咒,荣耀,";
const words = htmlStr.match(/]*>([^<]+)<\/b>/g)
?.map(tag => tag.replace(/<\/?[^>]+>/g, '')) || [];
const wordAlls = htmlStr.match(/<[^>]+>([^<]+)<\/[^>]+>/g)
?.map(tag => tag.replace(/<\/?[^>]+>/g, '')) || [];
// 不考虑重复的统计(种类数)
const uniqueCount = new Set(words).size;
//---统计总算,加上重复
let allCount = wordAlls.length;
let atkCount = words.length;
// 考虑重复的统计(频率)
const freqMap = words.reduce((map, word) => {
map[word] = (map[word] || 0) + 1;
return map;
}, {});
return {
uniqueCount, // 不重复的词汇种类数
allCount,
atkCount,
freqMap // 包含每个词汇出现次数的映射表
};
}
const maxJe = Je;
const maxQe = Qe;
const JKM = L_TW("routM");
let oi=false;
let jeM = 0
JKM && JKM.map(item => {
jeM += item.data.multiplier
});
jeM > 0 && (hn("routM"), Je = (maxJe * ((100 - jeM) / 100.0)))
// const LY = L_TW("longYa");//--暴虐
// LY && LY.length > 0 && (hn("longYa"), Tn += Math.ceil(Tn * LY[0].data.percent))
//const Ne = L_TW("nightingale");//--夜莺
//Ne && Ne.length > 0 && (hn("nightingale"), Tn += Math.ceil(Fn))
let xt = 1; //虚体免疫率
const JKV = L_TW("routV");
let jeV = 0
JKV && JKV.map(item => {
let rd = Math.random() * 100
jeV += item.data.value
});
jeV > 0 && (hn("routV"), Je -= jeV)
const ht = L_TW("parocheth");
ht && ht.length > 0 && pkinfo.oldHP / pkinfo.maxHP <(ht[0].data.hpPercent/100.0) * ht && (on = 100, hn("parocheth")),(Zt = custommonster
.special) == null ||
Zt
.forEach(({
key: In,
name: En,
data: {
multiplier: tt,
value: un,
hpPercent: Ue,
rate: Re,
}
}) => {
// if (!custommonster) return 0;
switch (In) {
case "resist":
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (fn(En), Ce += un);
break;
case "survival":
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (fn(En), Qe += un);
break;
case "weak":
fn(En), un ? Tn = Math.ceil(Tn - tt) : Tn = Math.ceil(Tn * (1 - tt / 100));
break;
case "fearless":
pkinfo.oldHP * 100 / pkinfo.maxHP > Ue && (fn(En), Ce += un);
break;
case "bedrock":
Math.random() * 100 < Re && (fn(En), Ce += un);
break;
case "slow":
fn(En);
break;
case "stout":
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (fn(En), Ce += un);
break;
case "intimidate":
fn(En), tt ? bn = Math.ceil(bn * (1 - tt / 100)) : bn = Math.ceil(bn - un);
break
case "curse":
(fn(En), At = Math.round(At * (1 - tt / 100)))
break;
case 'strong':
(fn(En), Ce += Tn);
break
case 'willpower':
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (fn(En), Je += un);
break
case "deathStare"://--死亡凝视
(userData.attributes.atksp>=150 || sqCount > 0) && Math.random() * 100 <= Re && (fn(In),dCount_c = runCount)
break
case "incorporeality"://--虚体
(fn(In),xt = (1 - tt / 100.0))
break
}
});
const L7 = L_TW("lucky7");
L7 && L7.length > 0 && (Fn =L7[0].data.rate , Je=0, hn("lucky7"));
const sL7 = L_TW("secretLucky7");
sL7 && sL7.length > 0 && (Fn =7.77 , Je=0, hn("secretLucky7"));
let pn = Math.random() * 100 < Fn * (1-Je/100.0);
const Lt = L_TW("burst");
!pn && Lt && Lt.map(item => {
let rd = Math.random() * 100
if (!pn && rd <= item.data.rate) {
pn = !0
//--爆发
hn("burst")
}
});
pn && spccc++;
//---各种额外伤害 追击 收割 冲锋 影刃 重击 裂创
let zj = 0,
sg = 0,
cf = 0,
yr = 0,
Zj = 0,
zc = 0,
xw = 0,
my = 0,
xh = 0,
lc = 0;
const Ht = L_TW("swanElegy");
Ht && Ht.length > 0 && pkinfo.oldHP / pkinfo.maxHP < .1 * Ht && (pn = !0, hn("swanElegy"));
const maxCe = Ce //--最原始的防御值
// const {
// dodgeChance: Dt
// } = tl(At, Qe + 30);
const Qt = Math.random() * 100;
Sl = akt_w.attrs.special;
Sl && Sl.length > 0 &&
Sl
.forEach(({
key: In,
name: En,
data: {
multiplier: tt,
value: un,
hpPercent: Ue,
rate: Re,
crtd: Cd,
mag:Mg,
min: a,
max: o
}
}) => {
switch (In) {
case "impactV": //--冲击
pkinfo.oldHP * 100 / pkinfo.maxHP > Ue && (hn(In), Ce = Math.max(Ce - un, 0))
break
case "impactM":
pkinfo.oldHP * 100 / pkinfo.maxHP > Ue && (hn(In), Ce = Ce - Math.ceil(maxCe * (tt / 100)))
break
case "windUpM": //--收尾
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (hn(In), Ce = Ce - Math.ceil(maxCe * (tt / 100)))
break
case "windUpV":
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (hn(In), Ce = Math.max(Ce - un, 0))
break
case "crushBoneV": //--碎骨
Math.random() * 100 <= Re && (Ce = Math.max(Ce - un, 0), hn(In))
break
case "crushBoneM":
Math.random() * 100 <= Re && (Ce = Ce - Math.ceil(maxCe * (tt / 100)), hn(In))
break
case "cruelV": //--残忍
pn && (Ce = Math.max(Ce - un, 0), hn(In))
break
case "cruelM":
pn && (Ce = Ce - Math.ceil(maxCe * (tt / 100)), hn(In));
break
case "cruelAll":
pn && (Ce = Ce - Math.ceil(maxCe * (tt / 100)), hn(In));
pn && un && un>0 && (Ce = Math.max(Ce - un, 0))
break
case "precise":
(Qe = Qe - Math.ceil(maxQe * (tt / 100)), hn(In))
break
case "onikiri":
Math.random() * 100 <= Re && (oi=true, hn(In))
break
case "gentle"://--温柔
pn && (Un=0, hn(In))
break
case "desolator"://--黯灭
(Un = Cd, hn(In))
break
case "shock"://--震慑
Math.ceil(Tn/Ce)> Mg && (Ce = Ce - Math.ceil(maxCe * (tt / 100)), hn(In))
break
case "slaughter"://--屠戮
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (Ce = 0, hn(In))
break
case "bloodKiss"://--血吻
(hn(In),bn+=Math.ceil(Mg*Qe))
break
default:
remainL.push({
key: In,
name: En,
data: {
multiplier: tt,
value: un,
hpPercent: Ue,
rate: Re,
crtd: Cd,
mag:Mg,
min: a,
max: o
}
})
break
}
});
if (pkinfo.oldHP) {
//--Ue --eyUe 额外
let In = function(Ue) {
var za;
// if (!custommonster) return 0;
//----元素伤害
/*
let bl = Ys + All
if (bl > 0) {
Ue = Math.floor(Ue * (1 + (bl / 100.0)))
}
*/
Ys>0 && (Ue = Math.ceil(Ue * (1 + (Ys / 100.0))))
All>0 && (Ue = Math.ceil(Ue * (1 + (All / 100.0))))
const FL = L_TW("sharp");//--锋利不是额外伤害
FL && FL.map(item =>{
(hn("sharp"),Ue = Math.ceil(Ue * (1 + (item.data.multiplier / 100.0))))
})
const My = L_TW("fate");//命运
My && My.length > 0 && ( Ue = Math.ceil(Ue * (My[0].data.min+Math.random()*My[0].data.max) / 100.0),hn("fate"))
pn && (ke += "暴击,");
(za = custommonster.special) == null || za.forEach(({
key: Zl,
name: ms,
data: {
multiplier: js,
value: eo,
hpPercent: no,
triggerValue: tv
}
}, K6) => {
if (!custommonster) return 0;
switch (Zl) {
case "counterAtk":
sqCount > 0 && (fn(ms), Ue = Math.ceil((1 - js / 100) * Ue));
break;
case "repress":
pn && (fn(ms), Ue = Math.ceil((1 - js / 100) * Ue));
break;
case "restore":
if (pkinfo.oldHP * 100 / pkinfo.maxHP < no) {
if (custommonster.hasFix) break;
fn(ms), Ue = 0, pkinfo.oldHP = Math.min(pkinfo.oldHP + Math.ceil(pkinfo.maxHP *
eo / 100), pkinfo.maxHP), custommonster.hasFix = !0
}
break;
case "palsy":
pn || (fn(ms), Ue = Math.ceil((1 - js / 100) * Ue));
break
case "devour":
Ce > tv && (fn(ms), Ue = Math.ceil((1 - js / 100) * Ue));
break
case "burn": //---去掉暴击
txC(ke).allCount > tv && (fn(ms), Ue =
Math.ceil((1 - js /
100) * Ue));
//(ke.includes("暴击") ? txC(ke).atkCount - 1 :
break
case "thirstyBlood":
!pn && (fn(ms), pkinfo.oldHP = Math.min(pkinfo.oldHP + Math.ceil(pkinfo.maxHP * eo), pkinfo
.maxHP));
break
case "antibody"://--抗体
txC(ke).allCount < tv && (fn(ms), Ue =
Math.ceil((1 - js /
100) * Ue));
break
case "thorn"://--荆棘
Ue>pkinfo.maxHP*tv/100.0 && (fn(ms),Ue = Math.ceil((1 - js / 100) * Ue));
break
}
});
// Ue += eyUe
// const Gs = L_TW("shadowBlade");
// Gs && (Ue += Math.ceil(Gs * .001 * pkinfo.oldHP), hn("shadowBlade"));
// const Os = L_TW("sharp");
// Os && (Ue += Math.ceil(Os * .2 * Ue), hn("sharp"));
// const Ns = L_TW("tearInjury");
return Ue
};
const En = (pn ? Un : 100) / 100;
if (pn) {
pkinfo.crtCount += 1
}
const PY = L_TW("pity");//怜悯
PY && PY.length > 0 && (At = 100,Qe =At - PY[0].data.value,hn("pity"))
const Sy = L_TW("secretPity");//怜悯
Sy && Sy.length > 0 && (At = 100,Qe = 20,hn("secretPity"))
if (Qt <= At - Qe || on == 100) {
let spAtk = Tn
if (sqCount > 0) {
spAtk = Math.floor(Tn / (2 * sqCount + 1))
for (let mi = 0; mi < sqCount; mi++) {
hn('split')
}
}
// const pf = (200 + bn) / (200 + Ce); //进阶破防
Ce = Math.max(Ce - bn, 0)
const pf =oi ? 1 : 200 / (200 + Ce); //进阶破防
// let Ue = Math.floor(spAtk * En * pf);
//各种额外伤害
const akt_comp = function(atk) {
const atkBom = atk * En
remainL.length > 0 && remainL
.forEach(({
key: In,
name: En,
data: {
multiplier: tt,
value: un,
hpPercent: Ue,
rate: Re,
min: a,
max: o,
mag: mg
}
}) => {
switch (In) {
case "harvestM": //--收割
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (hn(In), sg += Math.ceil(atkBom * tt /
100.0))
break
case "harvestV": //--收割
pkinfo.oldHP * 100 / pkinfo.maxHP < Ue && (hn(In), sg += un)
break
case "assaultM": //--冲锋
pkinfo.oldHP * 100 / pkinfo.maxHP > Ue && (hn(In), cf += Math.ceil(atkBom * tt /
100.0))
break
case "assaultV": //--冲锋
pkinfo.oldHP * 100 / pkinfo.maxHP > Ue && (hn(In), cf += un)
break
case "thumpM": //--重击
Math.random() * 100 <= Re && (hn(In), Zj += Math.ceil(Tn * tt / 100.0))
break
case "thumpV": //--重击
Math.random() * 100 <= Re && (hn(In), Zj += un)
break
case "shadowBladeM": //--影刃
(hn(In), yr += Math.ceil(atkBom * tt / 100.0))
break
case "shadowBladeV": //--影刃
(hn(In), yr += un)
break
case "chasing": //--追击
(hn(In), zj += un)
break
case "tearInjury": //--裂创
pn && (hn(In), lc += un)
break
case "heavyInjury": //--重创
pn && (hn(In), zc += un)
break
case "nothingness": //--虚无
(hn(In), xw += Math.ceil(atkBom * tt / 100.0))
break
//case "fate": //--命运--他不是额外伤害
// (hn(In), atkBom = Math.ceil(atkBom * (a+Math.random()*o) / 100.0))
// break
case "fireHeart": //--心火
(hn(In), xh += Math.abs(Math.ceil(mg*maxJe)))
break
}
});
//---非真伤类需要计算减伤
let SH = atkBom - xw + zj + Zj + cf + sg + zc + my + xh ;
let z=lc + yr + xw + (oi?SH:0)
const St = L_TW("shadowHit");//影袭
St && St.length > 0 && (z =z*(1+St[0].data.multiplier/100.0),hn("shadowHit"))
let over=oi? z: Math.ceil(SH * pf * xt )+z
const Hr = L_TW("honor");//荣耀
Hr && Hr.length > 0 && (hn("honor"),over=txC(ke).atkCount > 1 ?over*(1-Hr[0].data.multiplier/100.0):over*(1+Hr[0].data.multiplier/100.0))
const un = In(over);
Me(un), ke += '造成 '.concat(un, " 伤害")
}
//---残忍减防公式 tt && pn &&
// Ce = Math.max(Ce - Math.ceil(Ce * .3 * tt), 0), hn("cruel")
//---伤害计算 En:暴击后的暴击伤害
// const pf = (150 + bn) / (150 + Ce); //下界破防
akt_comp(spAtk)
} else {
const Fm = L_TW("fallDream");//怜悯
if(Fm && Fm.length > 0){
hn("fallDream")
let spAtk = Tn
pn=false
if (sqCount > 0) {
spAtk = Math.floor(Tn / (2 * sqCount + 1))
for (let mi = 0; mi < sqCount; mi++) {
hn('split')
}
}
const un = In(Math.ceil(spAtk*Fm[0].data.mag));
// shTxt[ke] = un
// pkinfo.pktypes = shTxt
Me(un), ke += '造成 '.concat(un, " 伤害")
}
else {
ke += ''.concat(custommonster.name,
" 闪避了这次攻击"), (Ra = custommonster.special) == null || Ra.forEach(({
key: un,
name: Ue,
data: {
multiplier: Gs,
value: Os,
}
}) => {
if (!custommonster) return 0;
switch (un) {
case "vampirism":
case "thirstyBlood":
fn(Ue), pkinfo.oldHP = Math.min(pkinfo.oldHP + Math.ceil(pkinfo.maxHP * Os), pkinfo
.maxHP);
break
}
});
} }
}
if (te(ke), !pkinfo.oldHP) {
te('击杀 '.concat(custommonster.name, ""));
te('用时 '.concat(pkinfo.runTime, "秒"));
// const In = L_TW("rout");
// In && (c.value.extraAtk += In, te("".concat(Gt.rout.name, ',增加 ')
// .concat(
// In, " 点攻击力"))), custommonster.isBoss ? c.value.killBoss++ : c.value.killMonster++;
//--我应该要重置你的血量
// clearData()
}
}
function Me(W) {
pkinfo.overHP += W
pkinfo.oldHP = Math.max(pkinfo.oldHP - W, 0);
}
let msglist = []
async function te(W) {
//----消息提示框我找到了
addPKMsg(W)
var ae;
// var hhh=custommonster.hp- pkinfo.oldHP c.value.isMessageScrollAuto || true &&
if (pkinfo.runTime > 0) {
pkinfo.dps = ((pkinfo.overHP) / (pkinfo.runTime)).toFixed(2);
}
msglist.push('刀数[' + pkinfo.allMsgCount + '],DPS[' + pkinfo.dps + '],' + W)
}
function addPKMsg(W) {
let ishave = false
pkinfo.pktypes.forEach(item => {
if (!ishave) {
ishave = item === W
}
});
!ishave && pkinfo.pktypes.push(W)
}
function clearData() {
tx = []
msglist = []
pkinfo.pktypes = []
pkinfo.allMsgCount = 0
pkinfo.overHP = 0
pkinfo.dps = 0
custommonster.hasFix = false
pkinfo.oldHP = custommonster.hp
pkinfo.maxHP = custommonster.hp
pkinfo.runTime = 0
pkinfo.sqAllCount = 0
pkinfo.crtCount = 0
allsq=0;
spccc=0;
allsqaa=0;
spcccaa=0;
}
//------computerdata.end
//------main.js
// import {
// p_value
// } from "./assets/index-TkzQunqn.js"
// document.addEventListener('plusready', function() {
// // 确保在WebView准备完成后执行
// plus.io.convertLocalFileSystemURL('_www/assets/index-TkzQunqn.js', function(url) {
// import(url.replace('file://', 'http://localhost:8080/'));
// });
// });
// Buff列表存储
let buffList = [];
let buffuserList = [
{
"id": 1758869696780,
"type": "split",
"typeName": "分裂",
"triggerValue": "32.49",
"rate": "32.49",
"hpPercent": "32.49",
"multiplier": "3",
"value": "3",
"describe": "32.49% 概率,攻击分裂为 3 段伤害"
},
{
"id": 1758869712581,
"type": "split",
"typeName": "分裂",
"triggerValue": "44.57",
"rate": "44.57",
"hpPercent": "44.57",
"multiplier": "3",
"value": "3",
"describe": "44.57% 概率,攻击分裂为 3 段伤害"
},
{
"id": 1758869723396,
"type": "split",
"typeName": "分裂",
"triggerValue": "30.77",
"rate": "30.77",
"hpPercent": "30.77",
"multiplier": "3",
"value": "3",
"describe": "30.77% 概率,攻击分裂为 3 段伤害"
},
{
"id": 1758869734157,
"type": "split",
"typeName": "分裂",
"triggerValue": "31.82",
"rate": "31.82",
"hpPercent": "31.82",
"multiplier": "3",
"value": "3",
"describe": "31.82% 概率,攻击分裂为 3 段伤害"
},
{
"id": 1758869743157,
"type": "crushBone",
"typeName": "碎骨",
"triggerValue": "50",
"rate": "50",
"hpPercent": "50",
"multiplier": "49",
"value": "49",
"describe": "50% 概率忽略敌方 49 防御"
},
{
"id": 1758869757877,
"type": "chasing",
"typeName": "追击",
"triggerValue": "1",
"rate": "1",
"hpPercent": "1",
"multiplier": "37",
"value": "37",
"describe": "每次攻击时,额外造成 37 伤害"
},
{
"id": 1758869772772,
"type": "chasing",
"typeName": "追击",
"triggerValue": "1",
"rate": "1",
"hpPercent": "1",
"multiplier": "36",
"value": "36",
"describe": "每次攻击时,额外造成 36 伤害"
},
{
"id": 1758869782324,
"type": "chasing",
"typeName": "追击",
"triggerValue": "1",
"rate": "1",
"hpPercent": "1",
"multiplier": "42",
"value": "42",
"describe": "每次攻击时,额外造成 42 伤害"
}
];
let buffmasterList = [];
let statePage = 0 // 0 角色 1 怪物属性面板
let userData = {
"atk": 175,
"atksp": 284.9,
"bcrt": 32.6,
"crtd": 179,
"heat": 205,
"hr": 119.4,
"ys": 9.06,
"all": 30
}
let masterData = {}
let userView = []
let masterView = []
let atkindex = '',
master = ''
let atkData = {
'one': {
'name': '装备套路1'
},
'two': {
'name': '装备套路2'
},
'three': {
'name': '装备套路3'
},
'four': {
'name': '装备套路4'
},
'five': {
'name': '装备套路5'
},
'six': {
'name': '装备套路6'
}
}
let masterModel
//2. 动态创建选项
let select;
//---已经测试过的词条
const testBF = ['thumpM', 'thumpV', 'chasing', 'crushBoneM', 'crushBoneV', 'split', 'tearInjury', 'routM', 'routV',
'harvestM', 'harvestV', 'assaultM', 'assaultV', 'crushBoneM', 'crushBoneV', 'heavyInjury', 'burst',
'nothingness', 'cruelM','cruelAll', 'cruelV', 'shadowBladeM', 'shadowBladeV', 'routM', 'routV', 'impactM', 'impactV',
'windUpM', 'windUpV', 'swanElegy', 'parocheth','sharp','lucky7','onikiri','longYa','desolator','gentle','fallDream','fate','slaughter','secretPity',
'secretLucky7','shadowHit','honor','bloodKiss','fireHeart'
]
// 将Gt数据转换为buffTypeMap格式
let buffTypeMap = [];
let masterTypeMap = [];
/*Object.keys(p_value.Jp).reduce((map, key) => {
map[key] = p_value.Jp[key].name;
return map;
}, {});*/
function bdOption(dataMap, seV, table = '选择特效') {
seV.innerHTML = ''; //``
Object.keys(dataMap).forEach(key => {
const option = document.createElement('option');
option.value = key;
option.textContent = dataMap[key].name;
seV.appendChild(option);
})
}
//---角色对象
const MB={
"runeCollection":{
"atk": 1,
"atksp": 0.5,
"crt": 0.3,
"crtd": 1,
"heat": 1.5,
"hr": 0.5
},
"runeBasicFactor":
{
"101": {
"name": "力量之印",
"soulType": 1,
"specialKey": ""
},
"102": {
"name": "奔腾野牛",
"soulType": 1,
"specialKey": "assault"
},
"103": {
"name": "赐福钢铁",
"soulType": 1,
"specialKey": "thump"
},
"104": {
"name": "撼地标记",
"soulType": 1,
"specialKey": "impact"
},
"105": {
"name": "血腥磨石",
"soulType": 1,
"specialKey": "cruel"
},
"106": {
"name": "愤怒之石",
"soulType": 1,
"specialKey": "heavyInjury"
},
"107": {
"name": "巨人之印",
"soulType": 1,
"specialKey": "break"
},
"201": {
"name": "智慧之印",
"soulType": 2,
"specialKey": ""
},
"202": {
"name": "灼热余烬",
"soulType": 2,
"specialKey": "burst"
},
"203": {
"name": "灵质",
"soulType": 2,
"specialKey": "shadowBlade"
},
"204": {
"name": "虚化之魂",
"soulType": 2,
"specialKey": "nothingness"
},
"205": {
"name": "幻象印记",
"soulType": 2,
"specialKey": "split"
},
"206": {
"name": "聚焦棱镜",
"soulType": 2,
"specialKey": "rout"
},
"207": {
"name": "辐光火石",
"soulType": 2,
"specialKey": "tearInjury"
},
"301": {
"name": "敏捷之印",
"soulType": 3,
"specialKey": ""
},
"302": {
"name": "破碎之爪",
"soulType": 3,
"specialKey": "crushBone"
},
"303": {
"name": "刀刃标记",
"soulType": 3,
"specialKey": "chasing"
},
"304": {
"name": "鹰眼",
"soulType": 3,
"specialKey": "precise"
},
"305": {
"name": "恶毒下颚",
"soulType": 3,
"specialKey": "harvest"
},
"306": {
"name": "完结之触",
"soulType": 3,
"specialKey": "windUp"
},
"307": {
"name": "灵动幻影",
"soulType": 3,
"specialKey": "swiftness"
}
},
"runeSpecialFactor":{
"thump": {
"extraRate": 0.024,
"extraDamage": 0.024
},
"harvest": {
"extraHpPercent": 0.025,
"extraMultiplier": 0.035
},
"assault": {
"extraHpPercent": 0.025,
"extraMultiplier": 0.035
},
"chasing": {
"extraValue": 0.6
},
"heavyInjury": {
"extraValue": 1
},
"break": {
"extraMultiplier": 0.45
},
"crushBone": {
"extraRate": 0.026,
"extraMag": 0.026
},
"burst": {
"extraRate": 0.2
},
"nothingness": {
"extraMultiplier": 0.4
},
"split": {
"extraRate": 0.035
},
"cruel": {
"extraValue": 1.2,
"extraMultiplier": 0.25
},
"shadowBlade": {
"extraValue": 0.4,
"extraMultiplier": 0.2
},
"swiftness": {
"extraValue": 0.0045
},
"precise": {
"extraMultiplier": 1
},
"rout": {
"extraValue": 0.25,
"extraMultiplier": 0.8
},
"tearInjury": {
"extraValue": 0.65
},
"impact": {
"extraHpPercent": 0.025,
"extraMag": 0.035
},
"windUp": {
"extraHpPercent": 0.025,
"extraMag": 0.035
}
},
"darkGoldBasicFactor":{
"atk": 1,
"atksp": 0.5,
"crt": 0.5,
"crtd": 1.5,
"heat": 1.5,
"hr": 0.5,
"ad": 0.266
},
"darkGoldSpecialFactor":{
"thump": {
"multiplier": 1.2
},
"harvest": {
"multiplier": 1.75
},
"assault": {
"multiplier": 1.75
},
"chasing": {
"value": 1.6
},
"heavyInjury": {
"value": 2.4
},
"break": {
"multiplier": 0.5
},
"crushBone": {
"value": 3,
"multiplier": 1.3
},
"burst": {
"rate": 0.75
},
"nothingness": {
"multiplier": 0.6
},
"split": {
"rate": 1.5
},
"cruel": {
"value": 2.4,
"multiplier": 1
},
"shadowBlade": {
"value": 0.95,
"multiplier": 0.25
},
"swiftness": {
"value": 0.02
},
"precise": {
"multiplier": 1.4
},
"rout": {
"value": 0.75,
"multiplier": 1.5
},
"tearInjury": {
"value": 1.45
},
"impact": {
"value": 5,
"multiplier": 2.3
},
"windUp": {
"value": 5,
"multiplier": 2.3
}
}
}
function attrsValue(a, r, y, h, o) {
return {
hpPercent: we(a * (1 + y), 2),
rate: we(a * (1 + y), 2),
multiplier: we(r * (1 + h), 2),
value: Math.round(o * (1 + h))
};
}
let specialModel = {};
const Pn = {
thump: {
name: "重击",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraDamage: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = Number((n * MB.runeSpecialFactor.thump.extraRate * _).toFixed(2)),
h = Number((u * MB.runeSpecialFactor.thump.extraDamage * _).toFixed(2));
specialModel = attrsValue(a, r, y, h, o)
return r ? ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率额外造成当前攻击力 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害") :
''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 伤害")
}
},
harvest: {
name: "收割",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = Number((n * MB.runeSpecialFactor.harvest.extraHpPercent * _).toFixed(2)),
h = Number((u * MB.runeSpecialFactor.harvest.extraMultiplier * _).toFixed(2));
specialModel = attrsValue(a, r, y, h, o)
return r ? '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,额外造成 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害") :
'敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 伤害")
}
},
assault: {
name: "冲锋",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMultiplier: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = Number((n * MB.runeSpecialFactor.assault.extraHpPercent * _).toFixed(2)),
h = Number((u * MB.runeSpecialFactor.assault.extraMultiplier * _).toFixed(2));
specialModel = {
hpPercent: y==0?a:we(a-(100 - a) * y, 2),
rate: we((100 - a) * y, 2),
multiplier: we(r * (1 + h), 2),
value: Math.round(o * (1 + h))
};
return r ? '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y >
0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,额外造成 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的伤害") :
'敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,额外造成 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * (1 + h)), ")") : "", " 伤害")
}
},
chasing: {
name: "追击",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const n = r === 3 ? 1.2 : 1,
u = Math.round(o * MB.runeSpecialFactor.chasing.extraValue * n);
specialModel = {
value: Math.round(a + u)
};
return '每次攻击时,额外造成 '.concat(Math.round(a + u), "").concat(u > 0 ?
'(+ '.concat(u, ")") : "", " 伤害")
}
},
heavyInjury: {
name: "重创",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const n = r === 1 ? 1.2 : 1,
u = Math.round(o * MB.runeSpecialFactor.heavyInjury.extraValue * n);
specialModel = {
value: Math.round(a + u)
};
return '暴击时,额外造成 '.concat(Math.round(a + u), "").concat(u > 0 ?
'(+ '.concat(u, ")") : "", " 伤害")
}
},
crushBone: {
name: "碎骨",
desc: ({
rate: a,
value: o,
multiplier: r,
extraRate: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = Number((n * MB.runeSpecialFactor.crushBone.extraRate * _).toFixed(2)),
h = Number((u * MB.runeSpecialFactor.crushBone.extraMag * _).toFixed(2));
specialModel = attrsValue(a, r, y, h, o)
return o ? ''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率忽略敌方 ').concat(Math.round(o * (1 + h)), "").concat(h > 0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 防御") :
''.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 概率忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御")
}
},
burst: {
name: "爆发",
desc: ({
rate: a,
extraRate: o = 0,
soulType: r
}) => {
const n = r === 2 ? 1.2 : 1,
u = Number((o * MB.runeSpecialFactor.burst.extraRate * n).toFixed(2));
specialModel = {
rate: we(a + u, 2)
};
return '攻击未暴击时,额外进行一次暴击判定,概率为 '.concat(we(a + u, 2), "%").concat(u > 0 ?
'(+ '.concat(u, "%)") : "", "")
}
},
nothingness: {
name: "虚无",
desc: ({
multiplier: a,
extraMultiplier: o = 0,
soulType: r
}) => {
const n = r === 2 ? 1.2 : 1,
u = Number((MB.runeSpecialFactor.nothingness.extraMultiplier * n * o).toFixed(2));
specialModel = {
multiplier: we(a + u, 2)
};
return ''.concat(we(a + u, 2), "%").concat(u ?
'(+ '
.concat(u, "%)") : "", ' 的伤害转换为真实伤害')
}
},
split: {
name: "分裂",
desc: ({
rate: a,
value: o,
extraRate: r = 0,
soulType: n
}) => {
const u = n === 2 ? 1.2 : 1,
c = Number((MB.runeSpecialFactor.split.extraRate * u * r).toFixed(2));
specialModel = {
rate: we(a * (1 + c), 2),
value: o + 1,
};
if (a === 100) {
specialModel = {
rate: we(c * 100, 2),
value: o + 1,
};
return '攻击分裂为 '.concat(o + 1, " 段伤害").concat(c > 0 ?
','.concat(we(c * 100, 2),
'%概率额外分裂 ')
.concat(o, "段") : "");
}
if (a * (1 + c) > 100) {
const y = a * (1 + c) - 100;
specialModel = {
rate: we(y, 2),
value: o + 1,
};
return '攻击分裂为 '.concat(o + 1, " 段伤害").concat(c > 0 ?
','.concat(we(y, 2), '%概率额外分裂 ')
.concat(
o, " 段") : "")
} else return ''.concat(we(a * (1 + c), 2), "%").concat(c > 0 ?
'(+ '.concat(we(a * c, 2), "%)") : "",
' 概率,攻击分裂为 ').concat(o + 1, " 段伤害")
}
},
cruel: {
name: "残忍",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 1 ? 1.2 : 1,
_ = Math.round(MB.runeSpecialFactor.cruel.extraValue * c * r),
y = Number((MB.runeSpecialFactor.cruel.extraMultiplier * c * n).toFixed(2));
specialModel = {
multiplier: we(o + y, 2),
value: a?Math.round(a + _):_,
};
return a ? '暴击时,忽略敌方 '.concat(Math.round(a + _), "").concat(_ > 0 ?
'(+ '.concat(_, ")") : "").concat(y > 0 ?
' + '.concat(y, '%(+ ').concat(y,
"%)") : "", " 防御") : '暴击时,忽略敌方 '.concat(we(o + y, 2), "%")
.concat(y > 0 ? '(+ '.concat(y, "%)") : "").concat(_ > 0 ?
' + '.concat(_, '(+ ').concat(_,
")") : "", " 的防御")
}
},
shadowBlade: {
name: "影刃",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = Math.round(MB.runeSpecialFactor.shadowBlade.extraValue * c * r),
y = Number((MB.runeSpecialFactor.shadowBlade.extraMultiplier * c * n).toFixed(2));
specialModel = {
multiplier: we(o + y, 2),
value: we(a + _),
};
return a ? '每次攻击时,额外造成 '.concat(we(a + _), "").concat(_ > 0 ?
'(+'.concat(_, ")") : "").concat(y > 0 ?
' + '.concat(y, '%(+ ').concat(y,
"%)") : "", ' 真实伤害') :
'每次攻击时,额外造成 '.concat(we(o + y, 2), "%").concat(y > 0 ?
'(+ '.concat(y, "%)") : "").concat(_ > 0 ?
' + '.concat(_, '(+ ').concat(_,
")") : "", ' 的真实伤害')
}
},
sharp: {
name: "锋利",
desc: ({
multiplier: a,
}) => {
specialModel = {
multiplier: a,
};
return '攻击时,附加 '.concat(a, "% 的伤害")
}
},
precise: {
name: "精准",
desc: ({
multiplier: a,
extraMultiplier: o = 0,
soulType: r
}) => {
const n = r === 3 ? 1.2 : 1,
u = Number((MB.runeSpecialFactor.precise.extraMultiplier * n * o).toFixed(2));
specialModel = {
multiplier: we(a + u, 2),
};
return '降低敌方闪避率的 '.concat(we(a + u, 2), "%").concat(u > 0 ?
'(+ '.concat(u, "%)") : "", "")
}
},
rout: {
name: "击溃",
desc: ({
value: a,
multiplier: o,
extraValue: r = 0,
extraMultiplier: n = 0,
soulType: u
}) => {
const c = u === 2 ? 1.2 : 1,
_ = Number((MB.runeSpecialFactor.rout.extraValue * c * r).toFixed(2)),
y = Number((MB.runeSpecialFactor.rout.extraMultiplier * c * n).toFixed(2));
specialModel = {
multiplier: we(o + y, 2),
value: we(a + _, 2),
};
return a ? '减少敌方 '.concat(we(a + _, 2), "%").concat(_ > 0 ?
'(+'.concat(_, ")") : "", " 抗暴率") :
'降低敌方抗暴率的 '.concat(we(o + y, 2), "%").concat(y > 0 ?
'(+ '.concat(y, "%)") : "")
}
},
tearInjury: {
name: "裂创",
desc: ({
value: a,
extraValue: o = 0,
soulType: r
}) => {
const n = r === 2 ? 1.2 : 1,
u = Math.round(MB.runeSpecialFactor.tearInjury.extraValue * n * o);
specialModel = {
value: Math.round(a + u)
};
return '暴击时,额外造成 '.concat(Math.round(a + u), "").concat(u > 0 ?
'(+'.concat(u, ")") : "",
' 真实伤害')
}
},
impact: {
name: "冲击",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 1 ? 1.2 : 1,
y = Number((n * MB.runeSpecialFactor.assault.extraHpPercent * _).toFixed(2)),
h = Number((u * MB.runeSpecialFactor.assault.extraMultiplier * _).toFixed(2));
specialModel = {
hpPercent: y==0?a:we(a - (100 - a) * y, 2),
multiplier: we(r * (1 + h), 2),
value: Math.round(o * (1 + h)),
};
return r ? '敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(
y >
0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御") :
'敌方血量高于 '.concat(we(a - (100 - a) * y, 2), "%").concat(y > 0 ?
'(- '.concat(we((100 - a) * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(Math.round(o * (1 + h)), "").concat(h >
0 ?
'(+ '.concat(Math.round(o * h), ")") : "", " 防御")
}
},
windUp: {
name: "收尾",
desc: ({
hpPercent: a,
value: o,
multiplier: r,
extraHpPercent: n = 0,
extraMag: u = 0,
soulType: c
}) => {
const _ = c === 3 ? 1.2 : 1,
y = Number((MB.runeSpecialFactor.impact.extraHpPercent * _ * n).toFixed(2)),
h = Number((MB.runeSpecialFactor.impact.extraMag * _ * u).toFixed(2));
specialModel = attrsValue(a, r, y, h, o)
return r ? '敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(r * (1 + h), 2), "%").concat(h > 0 ?
'(+ '.concat(we(r * h, 2), "%)") : "", " 的防御") :
'敌方血量低于 '.concat(we(a * (1 + y), 2), "%").concat(y > 0 ?
'(+ '.concat(we(a * y, 2), "%)") : "",
' 时,忽略敌方 ').concat(we(o * (1 + h), 2), "").concat(h > 0 ?
'(+ '.concat(we(o * h, 2), "%)") : "", " 防御")
}
},
swanElegy: {
name: "噩兆",
desc: ({
hpPercent: a
}) => {
specialModel = {
hpPercent: a,
};
return '敌方血量低于 '.concat(a, "% 时,必定暴击")
}
},
lucky7: {
name: "幸运7",
desc: ({
rate: a
}) => {
specialModel = {
rate: a,
};
return '攻击时暴击率固定为 '.concat(a, "%")
}
},
drawChop: {
name: "拔刀斩",
desc: ({
atkPercent: a
}) => {
specialModel = {
atkPercent: a,
};
return '攻击速度 减半,攻击 + '.concat(we((a - 1) * 100),
'%,命中 + 20%,暴击 + 20%')
}
},
onikiri: {
name: "鬼斩",
desc: ({
rate: a
}) => {
specialModel = {
rate: a,
};
return ''.concat(a,
'% 概率,将所有伤害转为真实伤害')
}
},
longYa: {
name: "暴虐",
desc: ({
percent: a
}) => {
specialModel = {
percent: a,
};
return ''.concat(a * 100, "% 的破防转换为攻击")
}
},
desolator: {
name: "黯灭",
desc: ({
crtd: a
}) => {
specialModel = {
crtd: a,
};
return '暴击伤害固定为 '.concat(a, "%")
}
},
gentle: {
name: "温柔一刀",
desc: () => {
return '暴击时,无法造成伤害'
}
},
nightingale: {
name: "夜莺",
desc: () => {
return '获得等同于 暴击率 的 攻击'
}
},
balance: {
name: "神圣平衡",
desc: ({
value: a
}) => {
specialModel = {
value: a,
};
return '将 额外攻击力 与 破防 互换'
}
},
pity: {
name: "怜悯",
desc: ({
value: a
}) => {
specialModel = {
value: a,
};
return '命中率固定为 '.concat(a, "%")
}
},
parocheth: {
name: "帷幕",
desc: ({
hpPercent: a
}) => {
specialModel = {
hpPercent: a,
};
return '敌方血量低于 '.concat(a, "% 时,必定命中")
}
},
shock: {
name: "震慑",
desc: ({
multiplier: a,
mag: o
}) => {
specialModel = {
multiplier: a,
mag: o
};
return '若攻击大于敌方 '.concat(o, '倍防御时,忽略敌方 ').concat(a,
"% 的防御")
}
},
sigh: {
name: "扼腕",
desc: ({
hpPercent: a,
multiplier: o
}) => {
specialModel = {
hpPercent: a,
multiplier: o
};
return '敌方血量低于 '.concat(a, '% 时,额外造成 ').concat(o,
'% 的真实伤害')
}
},
cease: {
name: "止息",
desc: ({
multiplier: a
}) => {
specialModel = {
multiplier: a
};
return '若结算命中率大于 100%时,额外造成 '.concat(a,
"% 的伤害")
}
},
shudder: {
name: "震撼",
desc: ({
multiplier: a
}) => {
specialModel = {
multiplier: a
};
return '若结算暴击率大于 100%时,额外造成 '.concat(a,
"% 的伤害")
}
},
secretLucky7: {
name: "秘 · 幸运7",
desc: () =>
'暴击率固定为 7.77%,与原暴击率相比,每降低 1%暴击率,则获得 2%暴击伤害'
},
secretPity: {
name: "秘 · 怜悯",
desc: () =>
'命中率固定为 80%,与原命中率相比,每降低 1%命中率,则获得 1破防'
},
mockMoon: {
name: "幻月",
desc: ({
mag: a
}) => {
specialModel = {
mag: a
};
return '获得 '.concat(a,
' 倍额外攻击速度 的命中率')
}
},
slaughter: {
name: "屠戮",
desc: ({
hpPercent: a
}) => {
specialModel = {
hpPercent: a
};
return '敌方血量低于 '.concat(a, "% 时,无视防御")
}
},
fate: {
name: "命运",
desc: ({
min: a,
max: o
}) => {
specialModel = {
min: a,
max: o
};
return '攻击命中时,将随机造成其伤害的 '.concat(a, "% ~ ").concat(o, "%")
}
},
focus: {
name: "青羽",
desc: ({
mag: a
}) => {
specialModel = {
mag: a
};
return '暴击率及额外暴击伤害增加 '
.concat(
a,
"倍")
}
},
fallDream: {
name: "入梦",
desc: ({
mag: a
}) => {
specialModel = {
mag: a
};
return '攻击未命中时,造成当前攻击力 '.concat(a * 100,
'% 的真实伤害')
}
},
tranquil: {
name: "安谧",
desc: () =>
'将 一半的暴击率转换为命中率'
},
shadowHit: {
name: "影袭",
desc: ({
multiplier: a
}) => {
specialModel = {
multiplier: a
};
return '真实伤害增加 '.concat(a, "%")
}
},
honor: {
name: "荣耀",
desc: ({
multiplier: a
}) => {
specialModel = {
multiplier: a
};
return '当造成特效仅包含 荣耀时,增加 '.concat(a,
'%伤害,反之降低 ').concat(a, "%")
}
},
bloodKiss: {
name: "血吻",
desc: ({
mag: a
}) => {
specialModel = {
mag: a
};
return '攻击时,获得敌方 '.concat(a, '倍闪避值的破防')
}
},
fireHeart: {
name: "心火",
desc: ({
mag: a
}) => {
specialModel = {
mag: a
};
return '每次攻击时,额外造成 '.concat(a, '倍敌方抗暴值的伤害')
}
}
};
let UserData=null,Re={};
const getItemEquipInfoList=(a)=> {
const o = a.itemList;
return a.itemList.length === 0 ? [] : o.filter(r => Object.values(a.equippedList).includes(r.id))
.map(r => {
const {
equipId: n
} = r, {
name: u,
type: c,
attrs: _
} = Re[n];
return {
...r,
name: u,
type: c,
attrs: _
}
})
};
//----特效值计算
function ti(a, o) {
const r = MB.darkGoldSpecialFactor[a],
n = {
...o
};
return Object.keys(n).forEach(u => {
r[u] && (n[u] = (n[u] + 10) * r[u], a === "swiftness" && (n[u] += 1))
}), n
}
//---非暗金特效计算
function Aa(a, o = !0) {
const r = UserData(),
n = o ? r.getExtraAttrs : {};
return a.map(u => {
let c = Pn[u.key];
if(c){
let k =u.key,
h = c.name,
y = c.desc({
...u.data,
...n[u.key],
soulType: r.soulType
});
let spKey=Gt[k]
if(!spKey){
if(c==='cruel'&&specialModel.multiplier>0&&specialModel.value>0){
k += "All";
h += $.multiplier?"-率":"-值";
}else{
k += u.data.multiplier?"M":"V";
h += u.data.multiplier?"-率":"-值";
}
spKey=Gt[k]
}
if(spKey){
const model= {
id: Date.now(), // 使用时间戳作为唯一ID
type:k,
typeName:h,
describe:spKey.desc(spKey),
...specialModel
}
model.describe=spKey.desc(model);
return model
}
return {
}
}
})
}
//---暗金特效计算
function es(a, o = !0) {
const r = UserData(),
n = o ? r.getExtraAttrs : {};
return a.map(u => {
let {
key: c,
data: _
} = u,y = Pn[c];
if(y){
let h = Pn[c].name, $ = ti(c, _), g = y.desc({
...$,
...n[c],
soulType: r.soulType
}), w = Object.keys(MB.darkGoldSpecialFactor[c]), m = (_[w[0]] || _[w[1]]) * 10;
let spKey=Gt[c]
if(!spKey){
if(c==='cruel'&&specialModel.multiplier>0&&specialModel.value>0){
c += "All";
h += $.multiplier?"-率":"-值";
}else{
c += $.multiplier?"M":"V";
h += $.multiplier?"-率":"-值";
}
spKey=Gt[c]
}
if(spKey){
const model= {
id: Date.now(), // 使用时间戳作为唯一ID
type:c,
typeName:h,
...specialModel
}
model.describe=spKey.desc(model);
return model
}
return {}
}})
}
function findPublicMonster(){
const m_Boss=document.querySelectorAll('.el-button.el-button--danger.is-plain.el-tooltip__trigger.common-btn')
if(isModalVisible()){
console.log("模拟窗口显示状态,停止自动计算!")
return
}
if(m_Boss&&m_Boss.length>1){
var bossName=m_Boss[1].innerText
console.log("当前进阶BOSS:",bossName)
let isFindBoss=false
Gw.map(item=>{
if(bossName.includes(item.name)){
//---共斗BOSS 无尽BOSS
masterData = {}
masterData.attributes = item
buffmasterList = masterData.attributes.special.map(buff => {
if (buff.type) {
return buff
} else {
return {
id: Date.now(), // 使用时间戳作为唯一ID
type: buff.key,
typeName: buff.name,
describe: Jp[buff.key].desc(buff.data),
...buff.data
};
}
})
isFindBoss=true
}
})
if(isFindBoss){
coypClick(1)
}
}
}
function isModalVisible() {
const modalOverlay = document.getElementById('modalOverlay');
return modalOverlay.classList.contains('show');
}
function copyAttrs(copyType){
const at=UserData();
userData.attributes = {
...at.userAttr,
bcrt:at.userAttr.crt,
ys: Math.max(at.userAttr.windDa, at.userAttr.fireDa, at.userAttr.waterDa, at.userAttr.soilDa),
all:at.userAttr.ad
}
at.equippedRoutineList.map(item=>{
if(item.id==at.equippedRoutineId){
atkFrom=item.name
}
})
//console.log('我要获取你的装备-原版:',at.getItemEquipInfoList); 'quality'antiquity
const equips=getItemEquipInfoList(at.$state)
equips && (buffuserList=[],equips.map(equ=>{
const datamodel={}
// if(equ.quality==='antiquity'|| equ.quality==='legend')else
if(equ.quality==='darkGold'){
goldSpecial(equ)
}else{
//--得到装备特效
const as =equ.attrs.special
as && Aa(as).map(a=>{
if(a){
buffuserList.push(a)
}
})
if(equ.quality==='myth'){
goldSpecial(equ)
}
}
return datamodel
}),/*console.log("复制后的特效如何:",buffuserList),*/copyType ==0 ? loadAtkInfo(userView,0,true):autoComputDPS(copyType));
}
function goldSpecial(equ){
const as =[]
equ.darkGoldAttrs.special[0] && as.push(equ.darkGoldAttrs.special[0])
if(equ.engraveAttr&&equ.engraveAttr.special.length>0){
as.push(equ.engraveAttr.special[0])
}
es(as).map(a=>{
if(a){
buffuserList.push(a)
}
})
}
function coypClick(copyType){
if(!jsPath){
return
}
if(UserData){
copyAttrs(copyType);
}else{
const getModuleExports = async () => {
try {
const module = await import(jsPath); // 替换为实际路径
const data={};
data.userD=module.u;
data.userRe=module.b;
return data;
} catch (e) {
console.error('模块加载失败:', e);
}
}
getModuleExports().then(tool => {
tool && (UserData=tool.userD,Re=tool.userRe , copyAttrs(copyType));
});
}
}
// 绑定数据到输入框
function bindDataToInputs() {
/*
const btn = document.querySelector('.trigger-btn');*/
// 复制角色属性
document.querySelector('.form-button').addEventListener('click', () => {
coypClick(0)
});
// 关闭弹窗
document.querySelector('.btn.btn-cancel').addEventListener('click', () => {
switch (statePage) {
case 1:
updateInfo()
break;
case 2:
backMonster()
break;
// case 3 :
// startViewTest()
// break;
default:
document.getElementById('modalOverlay').classList.remove('show');
break;
}
});
// 添加Buff
document.querySelector('.add-buff-btn').addEventListener('click', addBuff);
// 事件委托绑定到父元素
document.getElementById('buffList').addEventListener('click', (e) => {
if (e.target.classList.contains('delete-buff-btn')) {
const buffId = parseInt(e.target.dataset.buffid, 0);
buffList = buffList.filter(buff => buff.id !== buffId);
renderBuffList();
}
});
// 确认提交
document.querySelector('.btn.btn-confirm').addEventListener('click', () => {
switch (statePage) {
case 0:
masterInfo()
break;
case 1:
beginTextPK();
break;
case 2:
closeModal();
break;
}
});
// 点击遮罩关闭弹窗
document.getElementById('modalOverlay').addEventListener('click', function(e) {
if (e.target === this) {
closeModal();
}
});
// ESC键关闭弹窗
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
closeModal();
}
});
// 回车键添加buff
document.addEventListener('keydown', function(e) {
if (e.key === 'Enter' && e.target.closest('.buff-input-container')) {
e.preventDefault();
addBuff();
}
});
const inputs = document.querySelectorAll('.form-input');
loadMasterInfo(inputs, true)
buffTypeMap = testBF.reduce((acc, key) => {
if (Gt[key]) {
acc[key] = Gt[key];
}
return acc;
}, {});
masterTypeMap = Object.keys(Jp).reduce((map, key) => {
map[key] = Jp[key];
return map;
}, {});
masterModel = {}
for (let i = 0; i < Gw.length; i++) {
if (i == 0) {
var model = Gw[i]
Object.assign(model, masterData);
model.special = buffmasterList
masterModel[i] = model
} else {
masterModel[i] = Gw[i]
}
}
loadAtkInfo(inputs)
renderBuffList()
// 装备套路-怪物模板选择
document.getElementById('atklist').addEventListener('change', (e) => {
const inputs = document.querySelectorAll('.form-input');
const v = document.getElementById('atklist').value;
console.log(statePage, v, master, v !== master)
if (statePage == 0 && v !== atkindex) {
atkindex = v;
atkFrom='';
loadAtkInfo(inputs, atkindex);
} else if (statePage == 1 && v !== master) {
master = v
refreMonster()
loadMasterInfo(inputs)
}
});
}
function refreMonster() {
masterData = {}
masterData.attributes = Gw[master]
buffmasterList = masterData.attributes.special.map(buff => {
if (buff.type) {
return buff
} else {
return {
id: Date.now(), // 使用时间戳作为唯一ID
type: buff.key,
typeName: buff.name,
describe: Jp[buff.key].desc(buff.data),
...buff.data
};
}
})
}
function showTC() {
bdOption(buffTypeMap, select)
document.getElementById('modalOverlay').classList.add('show');
}
// setTimeout(showTC(), 3000)
let atkFrom=''
function loadAtkInfo(inputs, index,iscopy=false) {
if(!iscopy){
let saveindex = localStorage.getItem('atkindex')
if (saveindex) {
atkindex = saveindex
} else {
atkindex = 'one'
}
if (index) {
atkindex = index
}
const defData = localStorage.getItem('custominfo' + atkindex);
let data = {}
try {
data = defData ? JSON.parse(defData) : {};
userData = data
atkFrom=data.atkFrom
buffuserList = data.buffs
} catch (e) {}
userView = []
}
inputs.forEach(input => {
const name = input.name;
const cname = input.className;
const placeholder = input.placeholder;
// 如果数据中存在该字段,则设置值;否则使用默认值
try {
if (cname === 'form-input') {
if (name == 'atksp') {
input.value = userData.attributes[name] !== undefined ? (userData.attributes[
name] / 100.0) :
placeholder;
} else {
input.value = userData.attributes[name] !== undefined ? userData.attributes[
name] :
placeholder;
}
userView.push(input)
}
} catch (e) {
input.value = placeholder;
userView.push(input)
}
});
const atktitle = document.getElementById('atktitle');
if(atktitle&&atkFrom){
atktitle.innerHTML = `装备套路-->来源:${atkFrom}`;
}else{
atktitle.textContent = `装备套路`;
}
const atks = document.getElementById('atklist');
bdOption(atkData, atks, '装备套路')
atks.value = atkindex
//---装备buff更新
buffList = buffuserList
renderBuffList()
}
function loadMasterInfo(inputs, isload = false) {
const defMaster = localStorage.getItem('custominfomaster')
if (!master) {
let saveMonster = localStorage.getItem('custominfomasterindex')
master = saveMonster ? saveMonster : '0'
refreMonster()
}
if (master == '0') {
let master = {}
try {
master = defMaster ? JSON.parse(defMaster) : {};
masterData = master
buffmasterList = master.buffs
} catch (e) {}
}
document.getElementById('infoview').textContent = goldTemple + Gw[master].name + goldTemple
masterView = []
inputs.forEach(input => {
const name = input.name;
const cname = input.className;
const placeholder = input.placeholder;
// 如果数据中存在该字段,则设置值;否则使用默认值
try {
if (cname !== 'form-input') {
input.value = masterData.attributes[name] !== undefined ? masterData.attributes[
name] :
placeholder;
masterView.push(input)
}
} catch (e) {
input.value = placeholder;
}
});
//---装备buff更新
buffList = buffmasterList
renderBuffList()
}
function autoComputDPS(ctype){
userData.buffs=buffuserList
buffList = buffuserList
//console.log('这里是自动计算:',buffList);
//更新角色信息
writData(userData.attributes, buffuserList)
//更新角色信息
writeMaster(masterData.attributes, buffmasterList)
if(isAuotRun){
isAuotRun=false
txtPK(ctype)
}
}
// 页面加载完成后执行
//window.addEventListener('DOMContentLoaded', initView);
function closeModal() {
document.getElementById('modalOverlay').classList.remove('show');
}
function addBuff() {
const buffType = document.getElementById('buffType').value;
let triggerValue = document.getElementById('triggerValue').value;
let damageValue = document.getElementById('damageValue').value;
// 验证输入
if (!buffType) {
alert('请选择词缀类型');
return;
}
if (!triggerValue) {
// alert('请输入触发条件值');
// return;
triggerValue = 0
} else {
triggerValue = Number(triggerValue)
}
if (!damageValue) {
// alert('请输入伤害数值');
// return;
damageValue = 0
} else {
damageValue = Number(damageValue)
}
console.log(buffType, buffTypeMap)
// 创建buff对象
const buff = {
id: Date.now(), // 使用时间戳作为唯一ID
type: buffType,
typeName: statePage == 0 ? buffTypeMap[buffType].name : masterTypeMap[buffType].name,
'triggerValue': triggerValue, //--条件
"rate": triggerValue, //---条件
"hpPercent": triggerValue, //--条件
"multiplier": damageValue, //--值
"value": damageValue, //--值
"mag": damageValue, //--值
};
if(buffType==='deathStare'){
buff.triggerValue=triggerValue //--条件
buff.rate=damageValue //--值
}
buff.describe = statePage == 0 ? Gt[buffType].desc(buff) : Jp[buffType].desc(buff)
// 添加到列表
if (buffList == null) buffList = []
buffList.push(buff);
// 清空输入框
document.getElementById('buffType').value = '';
document.getElementById('triggerValue').value = '';
document.getElementById('damageValue').value = '';
// 更新显示
renderBuffList();
}
// 渲染Buff列表
function renderBuffList() {
const buffListElement = document.getElementById('buffList');
if (!buffList || buffList.length === 0) {
buffListElement.innerHTML = '暂无Buff词缀
';
return;
}
const listHTML = buffList.map(buff => {
return `
${buff.typeName}
${buff.describe}
`
}).join('');
buffListElement.innerHTML = listHTML;
}
var isdellistener = false
//---下一步
function masterInfo() {
// const form = document.getElementById('characterForm');
// const formData = new FormData(form);
userData = {
atkFrom:atkFrom,
attributes: {}, // 基础属性
buffs: buffList // buff词缀列表
};
// 收集基础属性数据
userView.forEach(input => {
const key = input.name;
const value = input.value.trim();
// 如果数据中存在该字段,则设置值;否则使用默认值
try {
if (value !== '') {
if (key === "atksp") {
userData.attributes[key] = parseFloat(value) * 100;
} else {
userData.attributes[key] = parseFloat(value);
}
}
} catch (e) {}
});
// 输出数据(你可以在这里处理提交逻辑)
// console.log('提交的数据:', data);
localStorage.setItem('atkindex', atkindex)
localStorage.setItem('custominfo' + atkindex, JSON.stringify(userData))
// alert('数据提交成功!请查看控制台。');
//更新角色信息
writData(userData.attributes, buffList)
//更新BOSS
writeMaster(masterData.attributes, buffList)
backMonster()
}
//上一步
function updateInfo() {
statePage = 0
document.querySelector('.btn.btn-cancel').textContent = '取消'
document.querySelector('.btn.btn-confirm').textContent = '下一步'
document.getElementById('infoview').textContent = "个人面板"
document.getElementById('gamecontainer').style.display = '';
document.querySelector('.form-button').style.display = '';
document.getElementById('msgview').style.display = 'none';
const allItems = document.querySelectorAll('.form-item')
allItems.forEach(item => {
if (item.className !== 'form-item') {
item.style.display = 'none';
} else {
item.style.display = '';
}
})
document.getElementById('buffviewtitle').textContent = "装备特效"
const atks = document.getElementById('atklist');
bdOption(atkData, atks, '装备套路')
//---修改下拉列表的值
bdOption(buffTypeMap, select)
//清空原buff 加载本地特性
buffList = buffuserList
renderBuffList()
document.getElementById('atklist').value = atkindex
}
//--回到怪物模板页面
function backMonster() {
document.getElementById('gamecontainer').style.display = '';
document.querySelector('.form-button').style.display = 'none';
document.getElementById('msgview').style.display = 'none';
document.querySelector('.btn.btn-cancel').textContent = '上一步'
document.querySelector('.btn.btn-confirm').textContent = '开始模拟'
document.getElementById('infoview').textContent = goldTemple + Gw[master].name + goldTemple
statePage = 1
const allItems = document.querySelectorAll('.form-item')
allItems.forEach(item => {
if (item.className === 'form-item') {
item.style.display = 'none';
} else {
item.style.display = '';
}
})
document.getElementById('buffviewtitle').textContent = "附加特性"
const atks = document.getElementById('atklist');
bdOption(masterModel, atks, '对战模板')
document.getElementById('atklist').value = master
//---修改下拉列表的值
bdOption(masterTypeMap, select)
//清空原buff 加载本地特性
buffList = buffmasterList
renderBuffList()
}
const goldTemple = "👑";
async function beginTextPK() {
document.getElementById('infoview').textContent = goldTemple + Gw[master].name + goldTemple
document.querySelector('.btn.btn-confirm').textContent = '完成'
document.getElementById('gamecontainer').style.display = 'none';
document.getElementById('msgview').style.display = '';
statePage = 2
// const form = document.getElementById('characterForm');
// const formData = new FormData(form);
masterData = {
name: '测试木桩',
attributes: {}, // 基础属性
buffs: buffList // buff词缀列表
};
// 收集基础属性数据
// for (let [key, value] of formData.entries()) {
// if (value.trim() !== '') {
// masterData.attributes[key] = parseFloat(value);
// }
// }
masterView.forEach(input => {
const key = input.name;
const value = input.value.trim();
// 如果数据中存在该字段,则设置值;否则使用默认值
try {
if (value !== '') {
masterData.attributes[key] = parseFloat(value);
}
} catch (e) {}
});
try {
masterData.attributes.name = Gw[master].name
} catch (e) {}
writeMaster(masterData.attributes, buffList)
let vt = document.getElementById('atklist').value
if (vt == 0) {
localStorage.setItem('custominfomaster', JSON.stringify(masterData))
}
localStorage.setItem('custominfomasterindex', master)
// setTimeout(, 10)
txtPK(0)
console.log('完了')
}
function getTimeString(vtime) {
// let t = Math.ceil(vtime / 1000)
let m = Math.trunc(vtime / 60)
let s = vtime % 60
return `${m}分${s}秒`
}
let ztime = 1000 / 60
let runCount = 0
async function txtPK(ctype) {
messages = []
let maxTime=ctype>0?(ctype==1?30:3):masterData.attributes.maxtime
let startItem = maxTime * 60 * 1000 //----计算总时间
let cd = Math.ceil(1e5 / userData.attributes.atksp); //----计算攻速--
let zCount = Math.floor(startItem / ztime) //-总帧数
let frequency = Math.ceil(cd / ztime)
let tt = 0
const Sw = M_TW("slow");
Sw && Sw.length > 0 && (tt = Sw[0].data.multiplier );
//dCount = Math.floor(zCount / frequency) //----计算刀数
dCount = Math.ceil( ((userData.attributes.atksp - tt ) / 100.0) * (maxTime * 60))
dCount_c = dCount
let pkCount = ctype>0?10:masterData.attributes.pkcount
clearData()
let sh=0,tm=0,lp=0
for (let i = 0; i < pkCount; i++) {
await new Promise(resolve => {
runCount = 0
let isexit=false
// console.log('开始间隔', Date.now())
const runF = () => {
// console.log('你的第一时间间隔', Date.now(), pkTime)
// akcd += ztime
// if (akcd >= aktsp || rund > 0) {
// akcd = 0
// isexit = je(0, cd)
// //---检查生命值,如果归0 提前结束
// }
// console.log('你的第二时间间隔', Date.now(), pkTime)
// console.log('你不对劲', Date.now(), rund)
runCount++
/*pkinfo.runTime = runCount >= dCount_c ? masterData.attributes.maxtime * 60 :
Number((
runCount * ztime * frequency / 1000.0).toFixed(2))*/
pkinfo.runTime = runCount >= dCount_c ? maxTime * 60 :
Number((
runCount /dCount_c * maxTime * 60 ).toFixed(2))
isexit = je(0)
if (runCount >= dCount_c) {
//--刀数用完啦
isexit = false
}
if (isexit) {
runF()
// setTimeout(runF, 0)
} else {
//console.log('阿哲',allsq,spccc,spccc/allsq,allsqaa,spcccaa,spcccaa/allsqaa)
resolve();
}
}
runF()
});
//----输出日志--
// console.log('伤害归类', JSON.stringify(shTxt))
// const msgData = [...msglist]
const msg = pkinfo
// console.log('输出伤害', JSON.stringify(msg), 'DPS:' + msg.dps,
// '分裂概率:' + (
// msg
// .sqAllCount / msg.allMsgCount).toFixed(2))
messages.push({
id: i,
isshow: false,
pkinfo: {
...msg
},
pklist: msglist
})
clearData()
}
if(ctype>0){
dpsTest=0
messages.map(msgItem=>{
dpsTest+=Number(msgItem.pkinfo.dps)
sh+=Number(msgItem.pkinfo.overHP)
tm+=Number(msgItem.pkinfo.runTime)
lp+=Number(msgItem.pkinfo.oldHP)
})
messages.length>0 && console.log(messages[0].pkinfo.pktypes)
dpsTest=Math.ceil(dpsTest/messages.length)
sh=Math.ceil(sh/messages.length)
tm=Math.ceil(tm/messages.length)
lp=Math.ceil(lp/messages.length)
if(ctype==1){
renderUI()
}else{
showPKMsg(dpsTest,tm,sh,lp)
}
isAuotRun=true
}else{
}
renderMessages()
console.log('能借宿了吗')
}
/*
async function txtPKAsync(...args) {
return new Promise((resolve) => {
txtPK(...args);
resolve(1); // 包装同步调用
});
}*/
// function startViewTest() {
// statePage = 3
// // 关闭弹窗
// closeModal();
// //修改容器显示状态
// const mainbtn = document.querySelector('.trigger-btn');
// const gameview = document.querySelector('.dungeon-page.page');
// if (mainbtn) {
// mainbtn.style.display = 'none'; // 或 'flex' 根据实际布局需求
// }
// if (gameview) {
// gameview.style.display = ''; // 或 'flex' 根据实际布局需求
// }
// // 启动游戏
// De.startGame(0)
// }
//----消息展示
// id: 1,
// pkinfo: {}
let messages = [];
function renderMessages() {
const container = document.getElementById('msgview');
container.innerHTML = '';
var allDPS=0
messages.forEach((msg, index) => {
allDPS+=Number(msg.pkinfo.dps)
const msgElement = document.createElement('div');
msgElement.className = 'message';
// | 刀数: ${msg.pkinfo.allMsgCount}
let xmlS = `
第${index + 1}次
| 用时: ${msg.pkinfo.runTime}s
| 伤害: ${msg.pkinfo.overHP}
| DPS: ${msg.pkinfo.dps}
| 剩余血量: ${(msg.pkinfo.oldHP/msg.pkinfo.maxHP*100.0).toFixed(2)}%
`;
msg.isshow && (xmlS += `
伤害词条日志`, msg.pkinfo.pktypes.forEach(item => {
let newS = String(item).replace("-率", "").replace("-值", "")
while (newS.includes("-率") || newS.includes("-值")) {
newS = newS.replace("-率", "").replace("-值", "")
}
xmlS += `
` + newS
}), xmlS += ``);
msgElement.innerHTML = xmlS
msgElement.addEventListener('click', () => {
!msg.isshow && copyToClipboard(removeHTMLTags(msg.pkinfo.pktypes))
msg.isshow = !msg.isshow
console.log('查看详情:', msg);
renderMessages()
});
container.appendChild(msgElement);
});
allDPS=Math.ceil(allDPS/messages.length)
const msgElement = document.createElement('div');
msgElement.className = 'message';
msgElement.style='font-size: 20px;'
let xmlS = `本次模拟平均DPS: ${allDPS}`
msgElement.innerHTML = xmlS
container.insertBefore(msgElement, container.firstChild);
}
/**
* 去除伤害数据中的HTML标签
* @param {Array} data - 包含HTML标签的武器数据数组
* @returns {Array} 去除标签后的纯净文本数组
*/
function removeHTMLTags(data) {
return data.map(item => {
// 创建临时div元素解析文本
const div = document.createElement('div');
div.innerHTML = item;
let str = div.textContent || div.innerText || '';
return str;
}).join('\n');;
}
/**
* 移动端剪贴板复制工具(带视觉反馈)
* @param {string} text - 要复制的文本
* @param {object} options - 配置项
* @param {string} [options.successMsg='复制成功'] - 成功提示
* @param {string} [options.errorMsg='复制失败'] - 错误提示
* @param {number} [options.duration=2000] - 提示显示时长(ms)
*/
function copyToClipboard(text, options = {}) {
const config = {
successMsg: options.successMsg || '✓ 已复制到剪贴板',
errorMsg: options.errorMsg || '✗ 复制失败,请长按手动复制',
duration: options.duration || 2000
};
// 创建提示元素
const toast = document.createElement('div');
Object.assign(toast.style, {
position: 'fixed',
bottom: '20%',
left: '50%',
transform: 'translateX(-50%)',
backgroundColor: 'rgba(0,0,0,0.7)',
color: 'white',
padding: '12px 24px',
borderRadius: '24px',
fontSize: '16px',
zIndex: 9999,
opacity: 0,
transition: 'opacity 0.3s',
whiteSpace: 'nowrap'
});
document.body.appendChild(toast);
// 显示提示
const showToast = (message, isSuccess) => {
toast.textContent = message;
toast.style.backgroundColor = isSuccess ? 'rgba(0, 180, 60, 0.9)' : 'rgba(220, 50, 50, 0.9)';
toast.style.opacity = 1;
setTimeout(() => {
toast.style.opacity = 0;
setTimeout(() => document.body.removeChild(toast), 300);
}, config.duration);
};
// 现代API方案
if (navigator.clipboard) {
navigator.clipboard.writeText(text)
.then(() => showToast(config.successMsg, true))
.catch(() => fallbackCopy(text));
return;
}
// 兼容方案
fallbackCopy(text);
function fallbackCopy() {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.opacity = '0';
textarea.readOnly = true;
document.body.appendChild(textarea);
// 移动端特殊处理:自动聚焦并选中
textarea.focus({
preventScroll: true
});
textarea.setSelectionRange(0, textarea.value.length);
try {
const successful = document.execCommand('copy');
showToast(
successful ? config.successMsg : config.errorMsg,
successful
);
} catch (err) {
showToast(config.errorMsg, false);
} finally {
document.body.removeChild(textarea);
}
}
}
//------main.end
})();