Skip to content

Commit

Permalink
Update 2_coc.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zeteticl committed Sep 15, 2023
1 parent 7879204 commit bca4e3b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions roll/2_coc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ async function coc7({ chack, text = "", userid, groupid, channelid, userName })
return result;
}

async function coc7chack({ chack, temp, text = "", userid, groupid, channelid, userName }) {
async function coc7chack({ chack, temp, text = "", userid, groupid, channelid, userName, bpdiceNum }) {
let result = '';
let skillPerStyle = "";
switch (true) {
Expand Down Expand Up @@ -1487,7 +1487,7 @@ async function coc7chack({ chack, temp, text = "", userid, groupid, channelid, u
break;
}
if (text) result += ':' + text;
if (userid && groupid && skillPerStyle !== "failure") {
if (userid && groupid && skillPerStyle !== "failure" && bpdiceNum <= 0) {
await dpRecorder({ userID: userid, groupid, channelid, skillName: text, skillPer: chack, skillPerStyle, skillResult: temp, userName });
}
return result;
Expand Down Expand Up @@ -1518,7 +1518,7 @@ async function coc7bp({ chack, text, userid, groupid, channelid, bpdiceNum, user

for (let index = 0; index < check.length; index++) {
let finallyStr = countStr + ' → ' + await coc7chack(
{ chack: check[index], temp: Math.min(...countArr), text: name[index], userid, groupid, channelid, userName }
{ chack: check[index], temp: Math.min(...countArr), text: name[index], userid, groupid, channelid, userName, bpdiceNum }
);
result += '1D100 ≦ ' + check[index] + " \n" + finallyStr + '\n\n';
}
Expand All @@ -1527,8 +1527,7 @@ async function coc7bp({ chack, text, userid, groupid, channelid, bpdiceNum, user
return result;
}
if (bpdiceNum < 0) {
bpdiceNum = Math.abs(bpdiceNum);
for (let i = 0; i <= bpdiceNum; i++) {
for (let i = 0; i <= Math.abs(bpdiceNum); i++) {
let temp = rollbase.Dice(10);
let temp2 = temp.toString() + temp0.toString();
if (temp2 > 100) temp2 = parseInt(temp2) - 100;
Expand All @@ -1539,7 +1538,7 @@ async function coc7bp({ chack, text, userid, groupid, channelid, bpdiceNum, user

for (let index = 0; index < check.length; index++) {
let finallyStr = countStr + ' → ' + await coc7chack(
{ chack: check[index], temp: Math.max(...countArr), text: name[index], userid, groupid, channelid }
{ chack: check[index], temp: Math.max(...countArr), text: name[index], userid, groupid, channelid, bpdiceNum }
);
result += '1D100 ≦ ' + check[index] + " \n" + finallyStr + '\n\n';
}
Expand Down

0 comments on commit bca4e3b

Please sign in to comment.