mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
be03b04ef0
- 修复了虚拟牌点数相加的bug - 修复cleaner出错直接爆炸 - QML的代码将宽度控制到80以内
34 lines
871 B
JavaScript
34 lines
871 B
JavaScript
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
function convertNumber(number) {
|
|
if (number === 1)
|
|
return "A";
|
|
if (number >= 2 && number <= 10)
|
|
return number;
|
|
if (number >= 11 && number <= 13) {
|
|
const strs = ["J", "Q", "K"];
|
|
return strs[number - 11];
|
|
}
|
|
return "";
|
|
}
|
|
|
|
function processPrompt(prompt) {
|
|
const data = prompt.split(":");
|
|
let raw = luatr(data[0]);
|
|
const src = parseInt(data[1]);
|
|
const dest = parseInt(data[2]);
|
|
if (raw.match("%src"))
|
|
raw = raw.replace(/%src/g, luatr(getPhoto(src).general));
|
|
if (raw.match("%dest"))
|
|
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
|
if (raw.match("%arg2"))
|
|
raw = raw.replace(/%arg2/g, luatr(data[4]));
|
|
if (raw.match("%arg"))
|
|
raw = raw.replace(/%arg/g, luatr(data[3]));
|
|
return raw;
|
|
}
|
|
|
|
Array.prototype.prepend = function() {
|
|
this.splice(0, 0, ...arguments);
|
|
}
|