Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koishi-plugin-axlmly-role-playing-game

Package Overview
Dependencies
Maintainers
0
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koishi-plugin-axlmly-role-playing-game - npm Package Compare versions

Comparing version 1.0.26 to 1.0.30

468

lib/battle.js

@@ -71,5 +71,5 @@ "use strict";

var actions = [
{ action: '近身攻击', weight: 0.2 }, // 20% 概率
{ action: '武器攻击', weight: 0.3 }, // 30% 概率
{ action: '技能攻击', weight: 0.5 } // 50% 概率
{ action: '近身攻击', weight: 0.1 }, // 10% 概率
{ action: '武器攻击', weight: 0.6 }, // 60% 概率
{ action: '技能攻击', weight: 0.4 } // 40% 概率
];

@@ -96,42 +96,75 @@ // 计算总权重

// 计算伤害
var hurt1 = player1.sturdypoint + player1.attack;
var hurt2 = hurt1 * 1.5;
var hurt3 = player2.sturdypoint + player2.attack;
var hurt4 = hurt3 * 1.5;
var hurt5 = Math.round(player1.attack * 1.5) + player1.sturdypoint + player1.Skillharm1;
var hurt51 = Math.round(player1.intelligence * 1.5) + player1.sturdypoint + player1.Skillharm1;
var hurt1 = Math.round(0.7 * player1.sturdypoint) + player1.attack;
var hurt2 = hurt1 * 1.3;
var hurt3 = Math.round(0.7 * player2.sturdypoint) + player2.attack;
var hurt4 = hurt3 * 1.3;
var hurt5 = Math.round((player1.attack * 1.7) + (0.7 * player1.sturdypoint) + player1.Skillharm1);
var hurt51 = Math.round((player1.intelligence * 1.9) + (0.3 * player1.sturdypoint) + player1.Skillharm1);
var hurt6 = hurt5 * 1.5;
var hurt61 = hurt51 * 1.5;
var hurt7 = Math.round(player1.attack * 1.5) + player1.sturdypoint + player1.Skillharm2;
var hurt71 = Math.round(player1.intelligence * 1.5) + player1.sturdypoint + player1.Skillharm2;
var hurt61 = hurt51 * 1.7;
var hurt7 = Math.round((player1.attack * 1.7) + (0.7 * player1.sturdypoint) + player1.Skillharm2);
var hurt71 = Math.round((player1.intelligence * 1.9) + (0.3 * player1.sturdypoint) + player1.Skillharm2);
var hurt8 = hurt7 * 1.5;
var hurt81 = hurt71 * 1.5;
var hurt9 = Math.round(player1.attack * 1.5) + player1.sturdypoint + player1.Skillharm3;
var hurt91 = Math.round(player1.intelligence * 1.5) + player1.sturdypoint + player1.Skillharm3;
var hurt81 = hurt71 * 1.7;
var hurt9 = Math.round((player1.attack * 1.7) + (0.7 * player1.sturdypoint) + player1.Skillharm3);
var hurt91 = Math.round((player1.intelligence * 1.9) + (0.3 * player1.sturdypoint) + player1.Skillharm3);
var hurt10 = hurt9 * 1.5;
var hurt101 = hurt91 * 1.5;
var hurt11 = Math.round(player2.attack * 1.5) + player2.sturdypoint + player2.Skillharm1;
var hurt111 = Math.round(player2.intelligence * 1.5) + player2.sturdypoint + player2.Skillharm1;
var hurt101 = hurt91 * 1.7;
var hurt11 = Math.round((player2.attack * 1.7) + (0.7 * player2.sturdypoint) + player2.Skillharm1);
var hurt111 = Math.round((player2.intelligence * 1.9) + (0.3 * player2.sturdypoint) + player2.Skillharm1);
var hurt12 = hurt11 * 1.5;
var hurt121 = hurt111 * 1.5;
var hurt13 = Math.round(player2.attack * 1.5) + player2.sturdypoint + player2.Skillharm2;
var hurt131 = Math.round(player2.intelligence * 1.5) + player2.sturdypoint + player2.Skillharm2;
var hurt121 = hurt111 * 1.7;
var hurt13 = Math.round((player2.attack * 1.7) + (0.7 * player2.sturdypoint) + player2.Skillharm2);
var hurt131 = Math.round((player2.intelligence * 1.9) + (0.3 * player2.sturdypoint) + player2.Skillharm2);
var hurt14 = hurt13 * 1.5;
var hurt141 = hurt131 * 1.5;
var hurt15 = Math.round(player2.attack * 1.5) + player2.sturdypoint + player2.Skillharm3;
var hurt151 = Math.round(player2.intelligence * 1.5) + player2.sturdypoint + player2.Skillharm3;
var hurt141 = hurt131 * 1.7;
var hurt15 = Math.round((player2.attack * 1.7) + (0.7 * player2.sturdypoint) + player2.Skillharm3);
var hurt151 = Math.round((player2.intelligence * 1.9) + (0.3 * player2.sturdypoint) + player2.Skillharm3);
var hurt16 = hurt15 * 1.5;
var hurt161 = hurt151 * 1.5;
var hurt17 = Math.round(player1.attack + player1.getSecondaryweaponharm * 0.5) + player1.sturdypoint + player1.getPrimaryweaponharm;
var hurt18 = hurt17 * 1.5;
var hurt19 = Math.round(player1.attack * 2) + player1.sturdypoint + player1.getPrimaryweaponharm;
var hurt20 = hurt19 * 1.5;
var hurt21 = Math.round(player1.attack * 2) + player1.sturdypoint + player1.getSecondaryweaponharm;
var hurt22 = hurt21 * 1.5;
var hurt23 = Math.round(player2.attack + player2.getSecondaryweaponharm * 0.5) + player2.sturdypoint + player2.getPrimaryweaponharm;
var hurt24 = hurt23 * 1.5;
var hurt25 = Math.round(player2.attack * 2) + player2.sturdypoint + player2.getPrimaryweaponharm;
var hurt26 = hurt25 * 1.5;
var hurt27 = Math.round(player2.attack * 2) + player2.sturdypoint + player2.getSecondaryweaponharm;
var hurt28 = hurt27 * 1.5;
var hurt161 = hurt151 * 1.7;
var hurt17 = Math.round((player1.attack + player1.getSecondaryweaponharm * 0.5) + (0.9 * player1.sturdypoint) + player1.getPrimaryweaponharm);
var hurt18 = hurt17 * 1.7;
var hurt19 = Math.round((player1.attack * 2) + (0.9 * player1.sturdypoint) + player1.getPrimaryweaponharm);
var hurt20 = hurt19 * 1.7;
var hurt21 = Math.round((player1.attack * 2) + (0.9 * player1.sturdypoint) + player1.getSecondaryweaponharm);
var hurt22 = hurt21 * 1.7;
var hurt23 = Math.round((player2.attack + player2.getSecondaryweaponharm * 0.5) + (0.9 * player2.sturdypoint) + player2.getPrimaryweaponharm);
var hurt24 = hurt23 * 1.7;
var hurt25 = Math.round((player2.attack * 2) + (0.9 * player2.sturdypoint) + player2.getPrimaryweaponharm);
var hurt26 = hurt25 * 1.7;
var hurt27 = Math.round((player2.attack * 2) + (0.9 * player2.sturdypoint) + player2.getSecondaryweaponharm);
var hurt28 = hurt27 * 1.7;
function calculateMaxCriticalHit(luckyValue) {
var maxCriticalHit = Math.round(100 - (luckyValue / 50));
return Math.max(maxCriticalHit, 50);
}
// 计算暴击率函数
function calculateCriticalHitRandom(maxCriticalHit) {
return Math.floor(Math.random() * maxCriticalHit) + 1;
}
// 计算伤害函数
function calculateHurtCriticalHitRandom(hurtMin, hurtMax, luckyValue) {
var hurtCriticalHitRandom = Math.round(Math.floor((Math.random() * (hurtMax - hurtMin + 1) + hurtMin)) + (0.7 * luckyValue));
return Math.min(hurtCriticalHitRandom, hurtMax);
}
// 计算伤害函数
function calculateDamage(randomValue, defense, armourClass, sturdyPoint, multiplier, release) {
if (multiplier === void 0) { multiplier = 1; }
if (release === void 0) { release = 1; }
var damage = Math.round((randomValue * (1 - (defense / 100)) - multiplier * (armourClass + 0.2 * sturdyPoint)) * release);
if (damage < 0) {
damage = 1;
}
return damage;
}
// 计算暴击伤害函数
function calculateCriticalDamage(randomValue, defense, armourClass, sturdyPoint, baseDamage, multiplier, release) {
if (multiplier === void 0) { multiplier = 1; }
if (release === void 0) { release = 1; }
var criticalDamage = Math.round((randomValue * (1 - (defense / 100)) - multiplier * (armourClass + 0.2 * sturdyPoint) + (0.5 * baseDamage)) * release);
if (criticalDamage < 0) {
criticalDamage = 1;
}
return criticalDamage;
}
var _loop_1 = function () {

@@ -141,263 +174,76 @@ round++;

var result = '';
//计算暴击上限
var maxcriticalhitRndom1 = Math.round(100 - (player1.luckyvalue / 50));
if (maxcriticalhitRndom1 < 50) {
maxcriticalhitRndom1 = 50;
}
var criticalhitRndom1 = Math.floor(Math.random() * maxcriticalhitRndom1) + 1; //算上幸运值的暴击率
var hurtcriticalhitRndom1 = Math.round(Math.floor((Math.random() * (hurt2 - hurt1 + 1) + hurt1)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom1 > hurt2) {
hurtcriticalhitRndom1 = hurt2;
}
//武器
var hurtcriticalhitRndom15 = Math.round(Math.floor((Math.random() * (hurt18 - hurt17 + 1) + hurt17)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom15 > hurt18) {
hurtcriticalhitRndom15 = hurt18;
}
var hurtcriticalhitRndom16 = Math.round(Math.floor((Math.random() * (hurt20 - hurt19 + 1) + hurt19)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom16 > hurt20) {
hurtcriticalhitRndom16 = hurt20;
}
var hurtcriticalhitRndom17 = Math.round(Math.floor((Math.random() * (hurt22 - hurt21 + 1) + hurt21)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom17 > hurt22) {
hurtcriticalhitRndom17 = hurt22;
}
//技能暴击
var hurtcriticalhitRndom3 = Math.round(Math.floor((Math.random() * (hurt6 - hurt5 + 1) + hurt5)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom3 > hurt6) {
hurtcriticalhitRndom3 = hurt6;
}
var hurtcriticalhitRndom4 = Math.round(Math.floor((Math.random() * (hurt8 - hurt7 + 1) + hurt7)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom4 > hurt8) {
hurtcriticalhitRndom4 = hurt8;
}
var hurtcriticalhitRndom5 = Math.round(Math.floor((Math.random() * (hurt10 - hurt9 + 1) + hurt9)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom5 > hurt10) {
hurtcriticalhitRndom5 = hurt10;
}
var hurtcriticalhitRndom12 = Math.round(Math.floor((Math.random() * (hurt61 - hurt51 + 1) + hurt51)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom12 > hurt61) {
hurtcriticalhitRndom12 = hurt61;
}
var hurtcriticalhitRndom13 = Math.round(Math.floor((Math.random() * (hurt81 - hurt71 + 1) + hurt71)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom13 > hurt81) {
hurtcriticalhitRndom13 = hurt81;
}
var hurtcriticalhitRndom14 = Math.round(Math.floor((Math.random() * (hurt101 - hurt91 + 1) + hurt91)) + (0.7 * player1.luckyvalue));
if (hurtcriticalhitRndom14 > hurt101) {
hurtcriticalhitRndom14 = hurt101;
}
//计算暴击上限
var maxcriticalhitRndom2 = Math.round(100 - (player2.luckyvalue / 50));
if (maxcriticalhitRndom2 < 50) {
maxcriticalhitRndom2 = 50;
}
var criticalhitRndom2 = Math.floor(Math.random() * maxcriticalhitRndom2) + 1; //算上幸运值的暴击率
var hurtcriticalhitRndom2 = Math.round((Math.floor(Math.random() * (hurt4 - hurt3 + 1)) + hurt3) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom2 > hurt4) {
hurtcriticalhitRndom2 = hurt4;
}
//武器
var hurtcriticalhitRndom18 = Math.round(Math.floor((Math.random() * (hurt24 - hurt23 + 1) + hurt23)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom18 > hurt24) {
hurtcriticalhitRndom18 = hurt24;
}
var hurtcriticalhitRndom19 = Math.round(Math.floor((Math.random() * (hurt26 - hurt25 + 1) + hurt25)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom19 > hurt26) {
hurtcriticalhitRndom19 = hurt26;
}
var hurtcriticalhitRndom20 = Math.round(Math.floor((Math.random() * (hurt28 - hurt27 + 1) + hurt27)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom20 > hurt28) {
hurtcriticalhitRndom20 = hurt28;
}
//技能暴击
var hurtcriticalhitRndom6 = Math.round(Math.floor((Math.random() * (hurt12 - hurt11 + 1) + hurt11)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom6 > hurt12) {
hurtcriticalhitRndom6 = hurt12;
}
var hurtcriticalhitRndom7 = Math.round(Math.floor((Math.random() * (hurt14 - hurt13 + 1) + hurt13)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom7 > hurt14) {
hurtcriticalhitRndom7 = hurt14;
}
var hurtcriticalhitRndom8 = Math.round(Math.floor((Math.random() * (hurt16 - hurt15 + 1) + hurt15)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom8 > hurt16) {
hurtcriticalhitRndom8 = hurt16;
}
var hurtcriticalhitRndom9 = Math.round(Math.floor((Math.random() * (hurt121 - hurt111 + 1) + hurt111)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom9 > hurt121) {
hurtcriticalhitRndom9 = hurt121;
}
var hurtcriticalhitRndom10 = Math.round(Math.floor((Math.random() * (hurt141 - hurt131 + 1) + hurt131)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom10 > hurt141) {
hurtcriticalhitRndom10 = hurt141;
}
var hurtcriticalhitRndom11 = Math.round(Math.floor((Math.random() * (hurt161 - hurt151 + 1) + hurt151)) + (0.7 * player2.luckyvalue));
if (hurtcriticalhitRndom11 > hurt161) {
hurtcriticalhitRndom11 = hurt161;
}
//计算伤害上限
var hurtEnd1 = Math.round(hurtcriticalhitRndom1 * (1 - (player2.physicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint));
if (hurtEnd1 < 0) {
hurtEnd1 = 1;
}
var hurtCriticalhitEnd1 = Math.round(hurtcriticalhitRndom1 * (1 - (player2.physicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd1));
if (hurtCriticalhitEnd1 < 0) {
hurtCriticalhitEnd1 = 1;
}
var hurtEnd2 = Math.round(hurtcriticalhitRndom2 * (1 - (player1.physicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint));
if (hurtEnd2 < 0) {
hurtEnd2 = 1;
}
var hurtCriticalhitEnd2 = Math.round(hurtcriticalhitRndom2 * (1 - (player1.physicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd2));
if (hurtCriticalhitEnd2 < 0) {
hurtCriticalhitEnd2 = 1;
}
//武器
var hurtEnd15 = Math.round((hurtcriticalhitRndom15 * (1 - (player2.physicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint)));
if (hurtEnd15 < 0) {
hurtEnd15 = 1;
}
var hurtCriticalhitEnd15 = Math.round((hurtcriticalhitRndom15 * (1 - (player2.magicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd15)));
if (hurtCriticalhitEnd15 < 0) {
hurtCriticalhitEnd15 = 1;
}
var hurtEnd16 = Math.round((hurtcriticalhitRndom16 * (1 - (player2.physicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint)));
if (hurtEnd16 < 0) {
hurtEnd16 = 1;
}
var hurtCriticalhitEnd16 = Math.round((hurtcriticalhitRndom16 * (1 - (player2.magicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd16)));
if (hurtCriticalhitEnd16 < 0) {
hurtCriticalhitEnd16 = 1;
}
var hurtEnd17 = Math.round((hurtcriticalhitRndom17 * (1 - (player2.physicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint)));
if (hurtEnd17 < 0) {
hurtEnd17 = 1;
}
var hurtCriticalhitEnd17 = Math.round((hurtcriticalhitRndom17 * (1 - (player2.magicaldefense / 100)) - (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd17)));
if (hurtCriticalhitEnd17 < 0) {
hurtCriticalhitEnd17 = 1;
}
//计算技能伤害上限
var hurtEnd3 = Math.round((hurtcriticalhitRndom3 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtEnd3 < 0) {
hurtEnd3 = 1;
}
var hurtCriticalhitEnd3 = Math.round((hurtcriticalhitRndom3 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd3)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd3 < 0) {
hurtCriticalhitEnd3 = 1;
}
var hurtEnd4 = Math.round((hurtcriticalhitRndom4 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtEnd4 < 0) {
hurtEnd4 = 1;
}
var hurtCriticalhitEnd4 = Math.round((hurtcriticalhitRndom4 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd4)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd4 < 0) {
hurtCriticalhitEnd4 = 1;
}
var hurtEnd5 = Math.round((hurtcriticalhitRndom5 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtEnd5 < 0) {
hurtEnd5 = 1;
}
var hurtCriticalhitEnd5 = Math.round((hurtcriticalhitRndom5 * (1 - (player2.physicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd5)) * (player1.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd5 < 0) {
hurtCriticalhitEnd5 = 1;
}
var hurtEnd12 = Math.round((hurtcriticalhitRndom12 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtEnd12 < 0) {
hurtEnd12 = 1;
}
var hurtCriticalhitEnd12 = Math.round((hurtcriticalhitRndom12 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd12)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd12 < 0) {
hurtCriticalhitEnd12 = 1;
}
var hurtEnd13 = Math.round((hurtcriticalhitRndom13 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtEnd13 < 0) {
hurtEnd13 = 1;
}
var hurtCriticalhitEnd13 = Math.round((hurtcriticalhitRndom13 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd13)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd13 < 0) {
hurtCriticalhitEnd13 = 1;
}
var hurtEnd14 = Math.round((hurtcriticalhitRndom14 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtEnd14 < 0) {
hurtEnd14 = 1;
}
var hurtCriticalhitEnd14 = Math.round((hurtcriticalhitRndom14 * (1 - (player2.magicaldefense / 100)) - 0.5 * (player2.armourclass + 0.5 * player2.sturdypoint) + (0.5 * hurtEnd14)) * (player1.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd14 < 0) {
hurtCriticalhitEnd14 = 1;
}
//武器
var hurtEnd18 = Math.round((hurtcriticalhitRndom15 * (1 - (player1.physicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint)));
if (hurtEnd18 < 0) {
hurtEnd18 = 1;
}
var hurtCriticalhitEnd18 = Math.round((hurtcriticalhitRndom15 * (1 - (player1.magicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd18)));
if (hurtCriticalhitEnd18 < 0) {
hurtCriticalhitEnd18 = 1;
}
var hurtEnd19 = Math.round((hurtcriticalhitRndom16 * (1 - (player1.physicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint)));
if (hurtEnd19 < 0) {
hurtEnd19 = 1;
}
var hurtCriticalhitEnd19 = Math.round((hurtcriticalhitRndom16 * (1 - (player1.magicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd19)));
if (hurtCriticalhitEnd19 < 0) {
hurtCriticalhitEnd19 = 1;
}
var hurtEnd20 = Math.round((hurtcriticalhitRndom17 * (1 - (player1.physicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint)));
if (hurtEnd20 < 0) {
hurtEnd20 = 1;
}
var hurtCriticalhitEnd20 = Math.round((hurtcriticalhitRndom17 * (1 - (player1.magicaldefense / 100)) - (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd20)));
if (hurtCriticalhitEnd20 < 0) {
hurtCriticalhitEnd20 = 1;
}
//计算技能伤害上限
var hurtEnd6 = Math.round((hurtcriticalhitRndom6 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtEnd6 < 0) {
hurtEnd6 = 1;
}
var hurtCriticalhitEnd6 = Math.round((hurtcriticalhitRndom6 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd6)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd6 < 0) {
hurtCriticalhitEnd6 = 1;
}
var hurtEnd7 = Math.round((hurtcriticalhitRndom7 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtEnd7 < 0) {
hurtEnd7 = 1;
}
var hurtCriticalhitEnd7 = Math.round((hurtcriticalhitRndom7 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd7)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd7 < 0) {
hurtCriticalhitEnd7 = 1;
}
var hurtEnd8 = Math.round((hurtcriticalhitRndom8 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtEnd8 < 0) {
hurtEnd8 = 1;
}
var hurtCriticalhitEnd8 = Math.round((hurtcriticalhitRndom8 * (1 - (player1.physicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd8)) * (player2.getPrimaryweaponfightkirelease / 100));
if (hurtCriticalhitEnd8 < 0) {
hurtCriticalhitEnd8 = 1;
}
var hurtEnd9 = Math.round((hurtcriticalhitRndom9 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtEnd9 < 0) {
hurtEnd9 = 1;
}
var hurtCriticalhitEnd9 = Math.round((hurtcriticalhitRndom9 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd9)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd9 < 0) {
hurtCriticalhitEnd9 = 1;
}
var hurtEnd10 = Math.round((hurtcriticalhitRndom10 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtEnd10 < 0) {
hurtEnd10 = 1;
}
var hurtCriticalhitEnd10 = Math.round((hurtcriticalhitRndom10 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd10)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd10 < 0) {
hurtCriticalhitEnd10 = 1;
}
var hurtEnd11 = Math.round((hurtcriticalhitRndom11 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtEnd11 < 0) {
hurtEnd11 = 1;
}
var hurtCriticalhitEnd11 = Math.round((hurtcriticalhitRndom11 * (1 - (player1.magicaldefense / 100)) - 0.5 * (player1.armourclass + 0.5 * player1.sturdypoint) + (0.5 * hurtEnd11)) * (player2.getPrimaryweaponmagicrelease / 100));
if (hurtCriticalhitEnd11 < 0) {
hurtCriticalhitEnd11 = 1;
}
// 玩家1的暴击上限和伤害计算
var maxCriticalHitRandom1 = calculateMaxCriticalHit(player1.luckyvalue);
var criticalHitRandom1 = calculateCriticalHitRandom(maxCriticalHitRandom1);
var hurtCriticalHitRandom1 = calculateHurtCriticalHitRandom(hurt1, hurt2, player1.luckyvalue);
// 玩家1的武器伤害计算
var hurtCriticalHitRandom15 = calculateHurtCriticalHitRandom(hurt17, hurt18, player1.luckyvalue);
var hurtCriticalHitRandom16 = calculateHurtCriticalHitRandom(hurt19, hurt20, player1.luckyvalue);
var hurtCriticalHitRandom17 = calculateHurtCriticalHitRandom(hurt21, hurt22, player1.luckyvalue);
// 玩家1的技能暴击伤害计算
var hurtCriticalHitRandom3 = calculateHurtCriticalHitRandom(hurt5, hurt6, player1.luckyvalue);
var hurtCriticalHitRandom4 = calculateHurtCriticalHitRandom(hurt7, hurt8, player1.luckyvalue);
var hurtCriticalHitRandom5 = calculateHurtCriticalHitRandom(hurt9, hurt10, player1.luckyvalue);
var hurtCriticalHitRandom12 = calculateHurtCriticalHitRandom(hurt51, hurt61, player1.luckyvalue);
var hurtCriticalHitRandom13 = calculateHurtCriticalHitRandom(hurt71, hurt81, player1.luckyvalue);
var hurtCriticalHitRandom14 = calculateHurtCriticalHitRandom(hurt91, hurt101, player1.luckyvalue);
// 玩家2的暴击上限和伤害计算
var maxCriticalHitRandom2 = calculateMaxCriticalHit(player2.luckyvalue);
var criticalHitRandom2 = calculateCriticalHitRandom(maxCriticalHitRandom2);
var hurtCriticalHitRandom2 = calculateHurtCriticalHitRandom(hurt3, hurt4, player2.luckyvalue);
// 玩家2的武器伤害计算
var hurtCriticalHitRandom18 = calculateHurtCriticalHitRandom(hurt23, hurt24, player2.luckyvalue);
var hurtCriticalHitRandom19 = calculateHurtCriticalHitRandom(hurt25, hurt26, player2.luckyvalue);
var hurtCriticalHitRandom20 = calculateHurtCriticalHitRandom(hurt27, hurt28, player2.luckyvalue);
// 玩家2的技能暴击伤害计算
var hurtCriticalHitRandom6 = calculateHurtCriticalHitRandom(hurt11, hurt12, player2.luckyvalue);
var hurtCriticalHitRandom7 = calculateHurtCriticalHitRandom(hurt13, hurt14, player2.luckyvalue);
var hurtCriticalHitRandom8 = calculateHurtCriticalHitRandom(hurt15, hurt16, player2.luckyvalue);
var hurtCriticalHitRandom9 = calculateHurtCriticalHitRandom(hurt111, hurt121, player2.luckyvalue);
var hurtCriticalHitRandom10 = calculateHurtCriticalHitRandom(hurt131, hurt141, player2.luckyvalue);
var hurtCriticalHitRandom11 = calculateHurtCriticalHitRandom(hurt151, hurt161, player2.luckyvalue);
// 计算伤害
//拳击伤害
var hurtEnd1 = calculateDamage(hurtCriticalHitRandom1, player2.physicaldefense, player2.armourclass, player2.sturdypoint);
var hurtCriticalhitEnd1 = calculateCriticalDamage(hurtCriticalHitRandom1, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd1);
var hurtEnd2 = calculateDamage(hurtCriticalHitRandom2, player1.physicaldefense, player1.armourclass, player1.sturdypoint);
var hurtCriticalhitEnd2 = calculateCriticalDamage(hurtCriticalHitRandom2, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd2);
//py1
var hurtEnd18 = calculateDamage(hurtCriticalHitRandom18, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75);
var hurtCriticalhitEnd18 = calculateCriticalDamage(hurtCriticalHitRandom18, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd18, 0.75);
var hurtEnd19 = calculateDamage(hurtCriticalHitRandom19, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75);
var hurtCriticalhitEnd19 = calculateCriticalDamage(hurtCriticalHitRandom19, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd19, 0.75);
var hurtEnd20 = calculateDamage(hurtCriticalHitRandom20, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75);
var hurtCriticalhitEnd20 = calculateCriticalDamage(hurtCriticalHitRandom20, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd20, 0.75);
var hurtEnd3 = calculateDamage(hurtCriticalHitRandom3, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd3 = calculateCriticalDamage(hurtCriticalHitRandom3, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd3, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtEnd4 = calculateDamage(hurtCriticalHitRandom4, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd4 = calculateCriticalDamage(hurtCriticalHitRandom4, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd4, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtEnd5 = calculateDamage(hurtCriticalHitRandom5, player2.physicaldefense, player2.armourclass, player2.sturdypoint, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd5 = calculateCriticalDamage(hurtCriticalHitRandom5, player2.physicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd5, 0.75, player1.getPrimaryweaponfightkirelease / 100);
var hurtEnd12 = calculateDamage(hurtCriticalHitRandom12, player2.magicaldefense, player2.armourclass, player2.sturdypoint, 0.5, player1.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd12 = calculateCriticalDamage(hurtCriticalHitRandom12, player2.magicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd12, 0.5, player1.getPrimaryweaponmagicrelease / 100);
var hurtEnd13 = calculateDamage(hurtCriticalHitRandom13, player2.magicaldefense, player2.armourclass, player2.sturdypoint, 0.5, player1.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd13 = calculateCriticalDamage(hurtCriticalHitRandom13, player2.magicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd13, 0.5, player1.getPrimaryweaponmagicrelease / 100);
var hurtEnd14 = calculateDamage(hurtCriticalHitRandom14, player2.magicaldefense, player2.armourclass, player2.sturdypoint, 0.5, player1.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd14 = calculateCriticalDamage(hurtCriticalHitRandom14, player2.magicaldefense, player2.armourclass, player2.sturdypoint, hurtEnd14, 0.5, player1.getPrimaryweaponmagicrelease / 100);
//py2
var hurtEnd15 = calculateDamage(hurtCriticalHitRandom15, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75);
var hurtCriticalhitEnd15 = calculateCriticalDamage(hurtCriticalHitRandom15, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd15, 0.75);
var hurtEnd16 = calculateDamage(hurtCriticalHitRandom16, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75);
var hurtCriticalhitEnd16 = calculateCriticalDamage(hurtCriticalHitRandom16, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd16, 0.75);
var hurtEnd17 = calculateDamage(hurtCriticalHitRandom17, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75);
var hurtCriticalhitEnd17 = calculateCriticalDamage(hurtCriticalHitRandom17, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd17, 0.75);
var hurtEnd6 = calculateDamage(hurtCriticalHitRandom6, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd6 = calculateCriticalDamage(hurtCriticalHitRandom6, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd6, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtEnd7 = calculateDamage(hurtCriticalHitRandom7, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd7 = calculateCriticalDamage(hurtCriticalHitRandom7, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd7, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtEnd8 = calculateDamage(hurtCriticalHitRandom8, player1.physicaldefense, player1.armourclass, player1.sturdypoint, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtCriticalhitEnd8 = calculateCriticalDamage(hurtCriticalHitRandom8, player1.physicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd8, 0.75, player2.getPrimaryweaponfightkirelease / 100);
var hurtEnd9 = calculateDamage(hurtCriticalHitRandom9, player1.magicaldefense, player1.armourclass, player1.sturdypoint, 0.5, player2.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd9 = calculateCriticalDamage(hurtCriticalHitRandom9, player1.magicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd9, 0.5, player2.getPrimaryweaponmagicrelease / 100);
var hurtEnd10 = calculateDamage(hurtCriticalHitRandom10, player1.magicaldefense, player1.armourclass, player1.sturdypoint, 0.5, player2.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd10 = calculateCriticalDamage(hurtCriticalHitRandom10, player1.magicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd10, 0.5, player2.getPrimaryweaponmagicrelease / 100);
var hurtEnd11 = calculateDamage(hurtCriticalHitRandom11, player1.magicaldefense, player1.armourclass, player1.sturdypoint, 0.5, player2.getPrimaryweaponmagicrelease / 100);
var hurtCriticalhitEnd11 = calculateCriticalDamage(hurtCriticalHitRandom11, player1.magicaldefense, player1.armourclass, player1.sturdypoint, hurtEnd11, 0.5, player2.getPrimaryweaponmagicrelease / 100);
//计算闪避

@@ -421,3 +267,3 @@ var sidestep1 = Math.round(player1.dexterity + 0.7 * player1.sturdypoint + 0.5 * player1.spiritualintuition + 0.5 * player1.stamina);

if (maxsidestep3 * 3 > maxsidestep4) {
if (criticalhitRndom1 < player1.criticalhit) {
if (criticalHitRandom1 < player1.criticalhit) {
var damage = hurtCriticalhitEnd1;

@@ -446,3 +292,3 @@ player2.hp -= damage;

var secondaryWeaponEquipped = player1.getSecondaryweapontypes !== 0;
var isCriticalHit = criticalhitRndom1 < player1.criticalhit;
var isCriticalHit = criticalHitRandom1 < player1.criticalhit;
if (maxsidestep3 * 2.5 > maxsidestep4) {

@@ -470,3 +316,3 @@ var weaponName = void 0, damage = void 0, text = void 0;

weaponName = "\u53CC\u624B\u6325\u821E".concat(player1.getPrimaryweaponname, "\u4E0E").concat(player1.getSecondaryweaponname, "\u8FDB\u884C\u65A9\u51FB");
damage = isCriticalHit ? hurtCriticalhitEnd15 : hurtCriticalhitEnd15;
damage = isCriticalHit ? hurtCriticalhitEnd15 : hurtEnd15;
}

@@ -482,2 +328,6 @@ else if (skillEffect1 === 2) {

}
if (text === undefined) {
text = "";
}
console.log("py1\u5251:".concat(damage));
player2.hp -= damage;

@@ -496,3 +346,3 @@ result = isCriticalHit

var skillEffect = Math.floor(Math.random() * 3) + 1;
var skillCriticalHit_1 = criticalhitRndom1 < player1.criticalhit;
var skillCriticalHit_1 = criticalHitRandom1 < player1.criticalhit;
var skillManaExhausted = function (mpCost) { return player1.mp < mpCost; };

@@ -508,2 +358,3 @@ var attackWithFist = function (damage, reason) {

player1.mp -= mpCost;
console.log("py1\u6CD5:".concat(damage));
result = skillCriticalHit_1

@@ -513,2 +364,3 @@ ? "\u66B4\u51FB!".concat(player1.name, "\u5BF9").concat(player2.name, "\u4F7F\u7528").concat(skillName, ",").concat(skillInfo).concat(attackInfo).concat(endInfo, ",\u9020\u6210\u4E86").concat(damage, "\u70B9\u4F24\u5BB3")

};
//py1技能
if (maxsidestep3 * 2 > maxsidestep4) {

@@ -521,2 +373,3 @@ // 获取所有非0的技能类型及其对应的技能

].filter(function (skill) { return skill.type !== 0; });
console.log(availableSkills);
if (availableSkills.length === 1) {

@@ -595,3 +448,3 @@ var skill = availableSkills[0];

else if (availableSkills.length === 0) {
if (criticalhitRndom1 < player1.criticalhit) {
if (criticalHitRandom1 < player1.criticalhit) {
var damage = hurtCriticalhitEnd1;

@@ -621,3 +474,3 @@ player2.hp -= damage;

if (maxsidestep4 * 2 > maxsidestep3) {
if (criticalhitRndom2 < player2.criticalhit) {
if (criticalHitRandom2 < player2.criticalhit) {
var damage = hurtCriticalhitEnd2;

@@ -639,3 +492,3 @@ player1.hp -= damage;

var skillEffect1 = Math.floor(Math.random() * 3) + 1;
var weaponCriticalHit1_1 = criticalhitRndom2 < player2.criticalhit;
var weaponCriticalHit1_1 = criticalHitRandom2 < player2.criticalhit;
var attackWithFist = function (damage) {

@@ -652,2 +505,3 @@ player1.hp -= damage;

: "".concat(player2.name, "\u5BF9").concat(player1.name, "\u6325\u821E").concat(weaponName, "\u8FDB\u884C\u65A9\u51FB,\u9020\u6210\u4E86").concat(damage, "\u70B9\u4F24\u5BB3");
console.log("py2\u5251:".concat(damage));
};

@@ -659,2 +513,3 @@ var attackWithBothWeapons = function (primaryWeaponName, secondaryWeaponName, damage) {

: "".concat(player2.name, "\u5BF9").concat(player1.name, "\u53CC\u624B\u6325\u821E").concat(primaryWeaponName, "\u4E0E").concat(secondaryWeaponName, "\u8FDB\u884C\u65A9\u51FB,\u9020\u6210\u4E86").concat(damage, "\u70B9\u4F24\u5BB3");
console.log("py2\u5251:".concat(damage));
};

@@ -693,3 +548,3 @@ if (maxsidestep4 * 2.5 > maxsidestep3) {

var skillEffect = Math.floor(Math.random() * 3) + 1;
var weaponCriticalHit_1 = criticalhitRndom1 < player2.criticalhit;
var weaponCriticalHit_1 = criticalHitRandom1 < player2.criticalhit;
var attackWithSkill = function (skillName, skillInfo, attackInfo, endInfo, mpConsumption, damage) {

@@ -701,2 +556,3 @@ player1.hp -= damage;

: "".concat(player2.name, "\u5BF9").concat(player1.name, "\u4F7F\u7528").concat(skillName, ",").concat(skillInfo).concat(attackInfo).concat(endInfo, ",\u9020\u6210\u4E86").concat(damage, "\u70B9\u4F24\u5BB3");
console.log("py2\u6CD5:".concat(damage));
};

@@ -703,0 +559,0 @@ var skillData = [

{
"name": "koishi-plugin-axlmly-role-playing-game",
"description": "",
"version": "1.0.26",
"version": "1.0.30",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc